From 4798aaf5b1b24b3350dfe353c6a3558fbc2e314d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 3 Nov 2022 21:28:07 +0100 Subject: [PATCH 01/34] test_safe_url_idna: adjust test data to the test scope --- tests/test_url.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index 2356c2c3..bf8ee52c 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -204,16 +204,16 @@ def test_safe_url_idna(self): # + various others websites = ( ( - "http://www.färgbolaget.nu/färgbolaget", - "http://www.xn--frgbolaget-q5a.nu/f%C3%A4rgbolaget", + "http://www.färgbolaget.nu", + "http://www.xn--frgbolaget-q5a.nu", ), ( - "http://www.räksmörgås.se/?räksmörgås=yes", - "http://www.xn--rksmrgs-5wao1o.se/?r%C3%A4ksm%C3%B6rg%C3%A5s=yes", + "http://www.räksmörgås.se", + "http://www.xn--rksmrgs-5wao1o.se", ), ( - "http://www.brændendekærlighed.com/brændende/kærlighed", - "http://www.xn--brndendekrlighed-vobh.com/br%C3%A6ndende/k%C3%A6rlighed", + "http://www.brændendekærlighed.com", + "http://www.xn--brndendekrlighed-vobh.com", ), ("http://www.예비교사.com", "http://www.xn--9d0bm53a3xbzui.com"), ("http://理容ナカムラ.com", "http://xn--lck1c3crb1723bpq4a.com"), @@ -221,25 +221,25 @@ def test_safe_url_idna(self): # --- real websites --- # in practice, this redirect (301) to http://www.buecher.de/?q=b%C3%BCcher ( - "http://www.bücher.de/?q=bücher", - "http://www.xn--bcher-kva.de/?q=b%C3%BCcher", + "http://www.bücher.de", + "http://www.xn--bcher-kva.de", ), # Japanese ( - "http://はじめよう.みんな/?query=サ&maxResults=5", - "http://xn--p8j9a0d9c9a.xn--q9jyb4c/?query=%E3%82%B5&maxResults=5", + "http://はじめよう.みんな", + "http://xn--p8j9a0d9c9a.xn--q9jyb4c", ), # Russian - ("http://кто.рф/", "http://xn--j1ail.xn--p1ai/"), + ("http://кто.рф", "http://xn--j1ail.xn--p1ai"), ( - "http://кто.рф/index.php?domain=Что", - "http://xn--j1ail.xn--p1ai/index.php?domain=%D0%A7%D1%82%D0%BE", + "http://кто.рф", + "http://xn--j1ail.xn--p1ai", ), # Korean - ("http://내도메인.한국/", "http://xn--220b31d95hq8o.xn--3e0b707e/"), + ("http://내도메인.한국", "http://xn--220b31d95hq8o.xn--3e0b707e"), ( - "http://맨체스터시티축구단.한국/", - "http://xn--2e0b17htvgtvj9haj53ccob62ni8d.xn--3e0b707e/", + "http://맨체스터시티축구단.한국", + "http://xn--2e0b17htvgtvj9haj53ccob62ni8d.xn--3e0b707e", ), # Arabic ("http://nic.شبكة", "http://nic.xn--ngbc5azd"), From 86711dd0894408f1a56e37527c95da3b662e231e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Fri, 4 Nov 2022 08:57:12 +0100 Subject: [PATCH 02/34] Fix pytest-cov warning --- .coveragerc | 1 - 1 file changed, 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index a5cf0768..101904ca 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,3 +1,2 @@ [run] branch = true -include = w3lib/* From 030a996aeb0ad52f6dcda4b888afa3a70d43db04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 8 Nov 2022 20:25:27 +0100 Subject: [PATCH 03/34] Implement safe_url and provide partial test coverage --- tests/test_encoding.py | 23 + tests/test_url.py | 236 ++++++++++ tox.ini | 2 +- w3lib/_encoding.py | 575 ++++++++++++++++++++++++ w3lib/_infra.py | 60 +++ w3lib/_rfc2396.py | 11 + w3lib/_rfc3986.py | 15 + w3lib/_url.py | 959 +++++++++++++++++++++++++++++++++++++++++ w3lib/_util.py | 66 +++ w3lib/url.py | 57 ++- 10 files changed, 2001 insertions(+), 3 deletions(-) create mode 100644 w3lib/_encoding.py create mode 100644 w3lib/_infra.py create mode 100644 w3lib/_rfc2396.py create mode 100644 w3lib/_rfc3986.py create mode 100644 w3lib/_url.py create mode 100644 w3lib/_util.py diff --git a/tests/test_encoding.py b/tests/test_encoding.py index be6d447a..6605cce0 100644 --- a/tests/test_encoding.py +++ b/tests/test_encoding.py @@ -1,6 +1,9 @@ import codecs import unittest +import pytest + +from w3lib._encoding import _get_encoding, _LABEL_ENCODINGS from w3lib.encoding import ( html_body_declared_encoding, http_content_type_encoding, @@ -10,6 +13,26 @@ to_unicode, ) +# Encodings from the spec that Python does not support. +_UNSUPPORTED_ENCODINGS = { + "iso-8859-8-i", # https://bugs.python.org/msg213772 + "replacement", # Not an actual encoding + # Not supported. + # We could bring support to it with the webencodings package. + "x-user-defined", +} + + +@pytest.mark.parametrize( + "label,name", tuple((label, name) for label, name in _LABEL_ENCODINGS.items()) +) +def test_get_encoding_python(label, name): + """The encodings that _get_encoding can return must work as encoding + aliases in Python.""" + assert _get_encoding(label) == name + if name not in _UNSUPPORTED_ENCODINGS: + codecs.lookup(name) # Raises LookupError if not found. + class RequestEncodingTests(unittest.TestCase): utf8_fragments = [ diff --git a/tests/test_url.py b/tests/test_url.py index bf8ee52c..6501364a 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -4,6 +4,16 @@ import pytest +from w3lib._infra import ( + _ASCII_ALPHA, + _ASCII_ALPHANUMERIC, + _ASCII_TAB_OR_NEWLINE, + _C0_CONTROL_OR_SPACE, +) +from w3lib._url import ( + _C0_CONTROL_PERCENT_ENCODE_SET, + _percent_encode_after_encoding, +) from w3lib.url import ( add_or_replace_parameter, add_or_replace_parameters, @@ -15,12 +25,238 @@ parse_url, path_to_file_uri, safe_download_url, + safe_url, safe_url_string, url_query_parameter, url_query_cleaner, ) +@pytest.mark.parametrize( + "input,output", + ( + ("", ""), + ("a", "a"), + ), +) +def test_percent_encode_after_encoding(input, output): + actual = _percent_encode_after_encoding( + input, + encoding="utf-8", + percent_encode_set=_C0_CONTROL_PERCENT_ENCODE_SET, + ) + assert actual == output + + +UNSET = object() + +# Test cases for URL-to-safe-URL conversions with a URL and an encoding as +# input parameters. +# +# (encoding, input URL, output URL or exception) +SAFE_URL_ENCODING_CASES = ( + (UNSET, "", ValueError), + (UNSET, "https://example.com", "https://example.com"), +) + +SAFE_URL_URL_INVALID_SCHEME_CASES = tuple( + (f"{scheme}://example.com", ValueError) + for scheme in ( + # A scheme is required. + "", + # The first scheme letter must be an ASCII alpha. + # Note: 0x80 is included below to also test non-ASCII example. + *( + chr(value) + for value in range(0x81) + if ( + chr(value) not in _ASCII_ALPHA + and chr(value) not in _C0_CONTROL_OR_SPACE # stripped + and chr(value) != ":" # separator + ) + ), + # The follow-up scheme letters can also be ASCII numbers, plus, hyphen, + # or period. + *( + f"a{chr(value)}" + for value in range(0x81) + if ( + chr(value) not in _ASCII_ALPHANUMERIC + and chr(value) not in "+-." + and chr(value) not in _C0_CONTROL_OR_SPACE # stripped + and chr(value) != ":" # separator + ) + ), + ) +) + +# Remove any leading and trailing C0 control or space from input. +SAFE_URL_URL_STRIP_CASES = tuple( + (f"{char}https://example.com{char}", "https://example.com") + for char in _C0_CONTROL_OR_SPACE + if char not in _ASCII_TAB_OR_NEWLINE +) + +SCHEME_NON_FIRST = _ASCII_ALPHANUMERIC + "+-." + +# Username and password characters that do not need escaping. +# Removed for RFC 2396 and RFC 3986: % +# Removed for the URL living standard: :;= +USERINFO_SAFE = _ASCII_ALPHANUMERIC + "-_.!~*'()" + "&+$," +USERNAME_TO_ENCODE = "".join( + chr(value) + for value in range(0x80) + if ( + chr(value) not in _C0_CONTROL_OR_SPACE + and chr(value) not in USERINFO_SAFE + and chr(value) not in ":/?#" + ) +) +USERNAME_ENCODED = "".join(f"%{ord(char):X}" for char in USERNAME_TO_ENCODE) +PASSWORD_TO_ENCODE = USERNAME_TO_ENCODE + ":" +PASSWORD_ENCODED = "".join(f"%{ord(char):X}" for char in PASSWORD_TO_ENCODE) + +# Test cases for URL-to-safe-URL conversions with only a URL as input parameter +# (i.e. no encoding or base URL). +# +# (input URL, output URL or exception) +SAFE_URL_URL_CASES = ( + # Invalid input type + (1, Exception), + (object(), Exception), + # Empty string + ("", ValueError), + *SAFE_URL_URL_STRIP_CASES, + # Remove all ASCII tab or newline from input. + *( + ( + ( + f"{char}h{char}ttps{char}:{char}/{char}/{char}a{char}:{char}a" + f"{char}@{char}exam{char}ple.com{char}:{char}1{char}/{char}a" + f"{char}?{char}a{char}#{char}a{char}" + ), + "https://a:a@example.com:1/a?a#a", + ) + for char in _ASCII_TAB_OR_NEWLINE + ), + # Scheme + *( + (f"{scheme}://example.com", f"{scheme.lower()}://example.com") + for scheme in _ASCII_ALPHA + ), + ( + f"a{SCHEME_NON_FIRST}://example.com", + f"a{SCHEME_NON_FIRST.lower()}://example.com", + ), + *SAFE_URL_URL_INVALID_SCHEME_CASES, + # Authority + ("a://a@example.com", "a://a@example.com"), + ("a://a:@example.com", "a://a:@example.com"), + ("a://a:a@example.com", "a://a:a@example.com"), + ("a://a%3A@example.com", "a://a%3A@example.com"), + ( + f"a://{USERINFO_SAFE}:{USERINFO_SAFE}@example.com", + f"a://{USERINFO_SAFE}:{USERINFO_SAFE}@example.com", + ), + ( + f"a://{USERNAME_TO_ENCODE}:{PASSWORD_TO_ENCODE}@example.com", + f"a://{USERNAME_ENCODED}:{PASSWORD_ENCODED}@example.com", + ), + ("a://@\\example.com", ValueError), + # TODO: Non-ASCII +) + + +def _test_safe_url_func(url, *, encoding=UNSET, output, func): + kwargs = {} + if encoding is not UNSET: + kwargs["encoding"] = encoding + try: + is_exception = issubclass(output, Exception) + except TypeError: + is_exception = False + if is_exception: + with pytest.raises(output): + func(url, **kwargs) + return + actual = func(url, **kwargs) + assert actual == output + assert func(actual, **kwargs) == output # Idempotency + + +def _test_safe_url(url, *, encoding=UNSET, output): + return _test_safe_url_func( + url, + encoding=encoding, + output=output, + func=safe_url, + ) + + +@pytest.mark.parametrize("encoding,url,output", SAFE_URL_ENCODING_CASES) +def test_safe_url_encoding(encoding, url, output): + _test_safe_url(url, encoding=encoding, output=output) + + +@pytest.mark.parametrize("url,output", SAFE_URL_URL_CASES) +def test_safe_url_url(url, output): + _test_safe_url(url, output=output) + + +def _test_safe_url_string(url, *, encoding=UNSET, output): + return _test_safe_url_func( + url, + encoding=encoding, + output=output, + func=safe_url_string, + ) + + +KNOWN_SAFE_URL_STRING_ENCODING_ISSUES = { + (UNSET, ""), # Invalid URL +} + + +@pytest.mark.parametrize( + "encoding,url,output", + tuple( + case + if case[:2] not in KNOWN_SAFE_URL_STRING_ENCODING_ISSUES + else pytest.param(*case, marks=pytest.mark.xfail(strict=True)) + for case in SAFE_URL_ENCODING_CASES + ), +) +def test_safe_url_string_encoding(encoding, url, output): + _test_safe_url_string(url, encoding=encoding, output=output) + + +KNOWN_SAFE_URL_STRING_URL_ISSUES = { + "", # Invalid URL + *(case[0] for case in SAFE_URL_URL_STRIP_CASES), + *(case[0] for case in SAFE_URL_URL_INVALID_SCHEME_CASES), + # %3A gets decoded, going from a "a:" username to a "a" username with an + # empty password. + "a://a%3A@example.com", + # Userinfo characters that the URL living standard requires escaping (:;=) + # are not escaped. + f"a://{USERNAME_TO_ENCODE}:{PASSWORD_TO_ENCODE}@example.com", + "a://@\\example.com", # Invalid URL +} + + +@pytest.mark.parametrize( + "url,output", + tuple( + case + if case[0] not in KNOWN_SAFE_URL_STRING_URL_ISSUES + else pytest.param(*case, marks=pytest.mark.xfail(strict=True)) + for case in SAFE_URL_URL_CASES + ), +) +def test_safe_url_string_url(url, output): + _test_safe_url_string(url, output=output) + + class UrlTests(unittest.TestCase): def test_safe_url_string(self): # Motoko Kusanagi (Cyborg from Ghost in the Shell) diff --git a/tox.ini b/tox.ini index 5647f5a1..05d81778 100644 --- a/tox.ini +++ b/tox.ini @@ -50,7 +50,7 @@ commands = deps = black==22.6.0 commands = - black --check {posargs:conftest.py setup.py tests w3lib} + black {posargs:--check conftest.py setup.py tests w3lib} [docs] changedir = docs diff --git a/w3lib/_encoding.py b/w3lib/_encoding.py new file mode 100644 index 00000000..81f68cb9 --- /dev/null +++ b/w3lib/_encoding.py @@ -0,0 +1,575 @@ +# https://encoding.spec.whatwg.org/ + +import codecs +from collections import deque +from typing import Callable, List, Optional + +from ._infra import _ASCII_WHITESPACE + + +def _short_windows_125(last_digit): + return { + label: f"windows-125{last_digit}" + for label in ( + f"cp125{last_digit}", + f"windows-125{last_digit}", + f"x-cp125{last_digit}", + ) + } + + +_REPLACEMENT_ENCODING = "replacement" +_UTF_8_ENCODING = "utf-8" +_UTF_16BE_ENCODING = "utf-16be" +_UTF_16LE_ENCODING = "utf-16le" + +# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get +# +# Maps the labels defined in the standard to an encoding label that Python +# understands. +_LABEL_ENCODINGS = { + **{ + label: _UTF_8_ENCODING + for label in ( + "unicode-1-1-utf-8", + "unicode11utf8", + "unicode20utf8", + "utf-8", + "utf8", + "x-unicode20utf8", + ) + }, + **{ + label: "ibm866" + for label in ( + "866", + "cp866", + "csibm866", + "ibm866", + ) + }, + **{ + label: "iso-8859-2" + for label in ( + "csisolatin2", + "iso-8859-2", + "iso-ir-101", + "iso8859-2", + "iso88592", + "iso_8859-2", + "iso_8859-2:1987", + "l2", + "latin2", + ) + }, + **{ + label: "iso-8859-3" + for label in ( + "csisolatin3", + "iso-8859-3", + "iso-ir-109", + "iso8859-3", + "iso88593", + "iso_8859-3", + "iso_8859-3:1988", + "l3", + "latin3", + ) + }, + **{ + label: "iso-8859-4" + for label in ( + "csisolatin4", + "iso-8859-4", + "iso-ir-110", + "iso8859-4", + "iso88594", + "iso_8859-4", + "iso_8859-4:1988", + "l4", + "latin4", + ) + }, + **{ + label: "iso-8859-5" + for label in ( + "csisolatincyrillic", + "cyrillic", + "iso-8859-5", + "iso-ir-144", + "iso8859-5", + "iso88595", + "iso_8859-5", + "iso_8859-5:1988", + ) + }, + **{ + label: "iso-8859-6" + for label in ( + "arabic", + "asmo-708", + "csiso88596e", + "csiso88596i", + "csisolatinarabic", + "ecma-114", + "iso-8859-6", + "iso-8859-6-e", + "iso-8859-6-i", + "iso-ir-127", + "iso8859-6", + "iso88596", + "iso_8859-6", + "iso_8859-6:1987", + ) + }, + **{ + label: "iso-8859-7" + for label in ( + "csisolatingreek", + "ecma-118", + "elot_928", + "greek", + "greek8", + "iso-8859-7", + "iso-ir-126", + "iso8859-7", + "iso88597", + "iso_8859-7", + "iso_8859-7:1987", + "sun_eu_greek", + ) + }, + **{ + label: "iso-8859-8" + for label in ( + "csiso88598e", + "csisolatinhebrew", + "hebrew", + "iso-8859-8", + "iso-8859-8-e", + "iso-ir-138", + "iso8859-8", + "iso88598", + "iso_8859-8", + "iso_8859-8:1988", + "visual", + ) + }, + **{ + label: "iso-8859-8-i" + for label in ( + "csiso88598i", + "iso-8859-8-i", + "logical", + ) + }, + **{ + label: "iso-8859-10" + for label in ( + "csisolatin6", + "iso-8859-10", + "iso-ir-157", + "iso8859-10", + "iso885910", + "l6", + "latin6", + ) + }, + **{ + label: "iso-8859-10" + for label in ( + "csisolatin6", + "iso-8859-10", + "iso-ir-157", + "iso8859-10", + "iso885910", + "l6", + "latin6", + ) + }, + **{ + label: "iso-8859-13" + for label in ( + "iso-8859-13", + "iso8859-13", + "iso885913", + ) + }, + **{ + label: "iso-8859-14" + for label in ( + "iso-8859-14", + "iso8859-14", + "iso885914", + ) + }, + **{ + label: "iso-8859-15" + for label in ( + "csisolatin9", + "iso-8859-15", + "iso8859-15", + "iso885915", + "iso_8859-15", + "l9", + ) + }, + "iso-8859-16": "iso-8859-16", + **{ + label: "koi8-r" + for label in ( + "cskoi8r", + "koi", + "koi8", + "koi8-r", + "koi8_r", + ) + }, + **{ + label: "koi8-u" + for label in ( + "koi8-ru", + "koi8-u", + ) + }, + **{ + label: "macintosh" + for label in ( + "csmacintosh", + "mac", + "macintosh", + "x-mac-roman", + ) + }, + **{ + label: "cp874" + for label in ( + "dos-874", + "iso-8859-11", + "iso8859-11", + "iso885911", + "tis-620", + "windows-874", + ) + }, + **_short_windows_125(0), + **_short_windows_125(1), + **{ + label: "windows-1252" + for label in ( + "ansi_x3.4-1968", + "ascii", + "cp1252", + "cp819", + "csisolatin1", + "ibm819", + "iso-8859-1", + "iso-ir-100", + "iso8859-1", + "iso88591", + "iso_8859-1", + "iso_8859-1:1987", + "l1", + "latin1", + "us-ascii", + "windows-1252", + "x-cp1252", + ) + }, + **_short_windows_125(3), + **{ + label: "windows-1254" + for label in ( + "cp1254", + "csisolatin5", + "iso-8859-9", + "iso-ir-148", + "iso8859-9", + "iso88599", + "iso_8859-9", + "iso_8859-9:1989", + "l5", + "latin5", + "windows-1254", + "x-cp1254", + ) + }, + **_short_windows_125(5), + **_short_windows_125(6), + **_short_windows_125(7), + **_short_windows_125(8), + **{ + label: "mac-cyrillic" + for label in ( + "x-mac-cyrillic", + "x-mac-ukrainian", + ) + }, + **{ + label: "gbk" + for label in ( + "chinese", + "csgb2312", + "csiso58gb231280", + "gb2312", + "gb_2312", + "gb_2312-80", + "gbk", + "iso-ir-58", + "x-gbk", + ) + }, + "gb18030": "gb18030", + **{ + label: "big5" + for label in ( + "big5", + "big5-hkscs", + "cn-big5", + "csbig5", + "x-x-big5", + ) + }, + **{ + label: "euc-jp" + for label in ( + "cseucpkdfmtjapanese", + "euc-jp", + "x-euc-jp", + ) + }, + **{ + label: "iso-2022-jp" + for label in ( + "csiso2022jp", + "iso-2022-jp", + ) + }, + **{ + label: "shift_jis" + for label in ( + "csshiftjis", + "ms932", + "ms_kanji", + "shift-jis", + "shift_jis", + "sjis", + "windows-31j", + "x-sjis", + ) + }, + **{ + label: "euc-kr" + for label in ( + "cseuckr", + "csksc56011987", + "euc-kr", + "iso-ir-149", + "korean", + "ks_c_5601-1987", + "ks_c_5601-1989", + "ksc5601", + "ksc_5601", + "windows-949", + ) + }, + **{ + label: _REPLACEMENT_ENCODING + for label in ( + "csiso2022kr", + "hz-gb-2312", + "iso-2022-cn", + "iso-2022-cn-ext", + "iso-2022-kr", + "replacement", + ) + }, + **{ + label: _UTF_16BE_ENCODING + for label in ( + "unicodefffe", + "utf-16be", + ) + }, + **{ + label: _UTF_16LE_ENCODING + for label in ( + "csunicode", + "iso-10646-ucs-2", + "ucs-2", + "unicode", + "unicodefeff", + "utf-16", + "utf-16le", + ) + }, + "x-user-defined": "x-user-defined", +} + + +class _PotentialError: + def __init__( + self, + *, + _continue: bool = False, + error: bool = False, + error_code_point: Optional[str] = None, + finished: bool = False, + items: Optional[List] = None, + ) -> None: + self.code_point = error_code_point + self._continue = _continue + self._error = error + self._finished = finished + if isinstance(items, bytes): + items = [b"%c" % byte for byte in items] + elif items is not None: + items = list(items) + else: + items = [] + self.items = items + + def is_continue(self): + return self._continue + + def is_finished(self): + return self._finished + + def is_error(self): + return self._error + + +# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#handler +def _handle_codec(*, codec, input, item): + if item is None: + return _PotentialError(finished=True) + try: + items, _ = codec(item) + except UnicodeError: + return _PotentialError(error=True, error_code_point=item) + else: + if items: + return _PotentialError(items=items) + else: + return _PotentialError(_continue=True) + + +# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-stream-read +def _read(input): + if not input: + return None + return input.popleft() + + +# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-process +def _process_item(item, *, codec, input, output, mode): + result = _handle_codec(codec=codec, input=input, item=item) + if result.is_finished(): + return result + if result.items: + for result_item in result.items: + output.append(result_item) + elif result.is_error(): + if mode == "replacement": + output.append("\uFFFD") + elif mode == "html": + output.append(b"&#%i;" % result.code_point) + elif mode == "fatal": + return result + return _PotentialError(_continue=True) + + +# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#utf-8-decode-without-bom-or-fail +def _utf_8_decode_without_bom_or_fail( + *, + input: deque, + output: deque = None, +): + if output is None: + output = deque() + potential_error = _process_queue( + input=input, + output=output, + codec=_UTF_8_DECODER, + error_mode="fatal", + ) + if potential_error.is_error(): + raise ValueError + return output + + +# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-run +def _process_queue( + *, + input: deque, + codec, + output: deque, + error_mode: str, +): + while True: + result = _process_item( + _read(input), + codec=codec, + input=input, + output=output, + mode=error_mode, + ) + if not result.is_continue(): + return result + + +# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#encode-or-fail +def _encode_or_fail(*, input, encoder, output: deque): + potential_error = _process_queue( + input=input, + codec=encoder, + output=output, + error_mode="fatal", + ) + if potential_error.is_error(): + return ord(potential_error.code_point) + return None + + +def _get_decoder(encoding: str) -> Callable: + codec_info = codecs.lookup(encoding) + return codec_info.decode + + +# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder +def _get_encoder(encoding: str) -> Callable: + codec_info = codecs.lookup(encoding) + return codec_info.encode + + +_UTF_8_DECODER = _get_decoder("utf-8") +_UTF_8_ENCODER = _get_encoder("utf-8") + + +# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get +def _get_encoding(label: str) -> str: + label = label.strip(_ASCII_WHITESPACE).lower() + try: + encoding = _LABEL_ENCODINGS[label] + except KeyError: + raise ValueError( + f"{label!r} does not match any encoding label from the Encoding " + f"Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721" + f"bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)" + ) + return encoding + + +_OUTPUT_ENCODING_UTF8_ENCODINGS = ( + _REPLACEMENT_ENCODING, + _UTF_16BE_ENCODING, + _UTF_16LE_ENCODING, +) + + +# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings +def _get_output_encoding(encoding: str) -> str: + encoding = _get_encoding(encoding) + if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: + return _UTF_8_ENCODING + return encoding diff --git a/w3lib/_infra.py b/w3lib/_infra.py new file mode 100644 index 00000000..a20e9109 --- /dev/null +++ b/w3lib/_infra.py @@ -0,0 +1,60 @@ +# https://infra.spec.whatwg.org/ + +import string + +# https://infra.spec.whatwg.org/commit-snapshots/59e0d16c1e3ba0e77c6a60bfc69a0929b8ffaa5d/#code-points +_ASCII_TAB_OR_NEWLINE = "\t\n\r" +_ASCII_WHITESPACE = "\t\n\x0c\r " +_C0_CONTROL = "".join(chr(n) for n in range(32)) +_C0_CONTROL_OR_SPACE = _C0_CONTROL + " " +_ASCII_DIGIT = string.digits +_ASCII_HEX_DIGIT = string.hexdigits +_ASCII_ALPHA = string.ascii_letters +_ASCII_ALPHANUMERIC = string.ascii_letters + string.digits + + +# https://infra.spec.whatwg.org/commit-snapshots/59e0d16c1e3ba0e77c6a60bfc69a0929b8ffaa5d/#surrogate +def _is_surrogate_code_point_id(code_point_id) -> bool: + return 0xD800 <= code_point_id <= 0xDFFF + + +# https://infra.spec.whatwg.org/commit-snapshots/59e0d16c1e3ba0e77c6a60bfc69a0929b8ffaa5d/#noncharacter +def _is_noncharacter_code_point_id(code_point_id) -> bool: + if 0xFDD0 <= code_point_id <= 0xFDEF: + return True + return code_point_id in ( + 0xFFFE, + 0xFFFF, + 0x1FFFE, + 0x1FFFF, + 0x2FFFE, + 0x2FFFF, + 0x3FFFE, + 0x3FFFF, + 0x4FFFE, + 0x4FFFF, + 0x5FFFE, + 0x5FFFF, + 0x6FFFE, + 0x6FFFF, + 0x7FFFE, + 0x7FFFF, + 0x8FFFE, + 0x8FFFF, + 0x9FFFE, + 0x9FFFF, + 0xAFFFE, + 0xAFFFF, + 0xBFFFE, + 0xBFFFF, + 0xCFFFE, + 0xCFFFF, + 0xDFFFE, + 0xDFFFF, + 0xEFFFE, + 0xEFFFF, + 0xFFFFE, + 0xFFFFF, + 0x10FFFE, + 0x10FFFF, + ) diff --git a/w3lib/_rfc2396.py b/w3lib/_rfc2396.py new file mode 100644 index 00000000..79c1fbad --- /dev/null +++ b/w3lib/_rfc2396.py @@ -0,0 +1,11 @@ +from ._infra import _ASCII_ALPHANUMERIC +from ._util import _PercentEncodeSet + + +_RFC2396_MARK_PERCENT_ENCODE_SET = _PercentEncodeSet("-_.!~*'()", exclude=True) +_RFC2396_UNRESERVED_PERCENT_ENCODE_SET = ( + _RFC2396_MARK_PERCENT_ENCODE_SET - _ASCII_ALPHANUMERIC +) +_RFC2396_USERINFO_PERCENT_ENCODE_SET = ( + _RFC2396_UNRESERVED_PERCENT_ENCODE_SET - ";:&=+$," +) diff --git a/w3lib/_rfc3986.py b/w3lib/_rfc3986.py new file mode 100644 index 00000000..b9250eda --- /dev/null +++ b/w3lib/_rfc3986.py @@ -0,0 +1,15 @@ +from ._infra import _ASCII_ALPHANUMERIC +from ._util import _PercentEncodeSet + + +_RFC3986_UNRESERVED_PERCENT_ENCODE_SET = _PercentEncodeSet( + _ASCII_ALPHANUMERIC + "-._~", + exclude=True, +) +_RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET = _PercentEncodeSet( + "!$&'()*+,;=", + exclude=True, +) +_RFC3986_USERINFO_PERCENT_ENCODE_SET = ( + _RFC3986_UNRESERVED_PERCENT_ENCODE_SET & _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET +) - ":" diff --git a/w3lib/_url.py b/w3lib/_url.py new file mode 100644 index 00000000..4d389851 --- /dev/null +++ b/w3lib/_url.py @@ -0,0 +1,959 @@ +# pylint: disable=protected-access,too-many-instance-attributes,too-many-locals,too-many-nested-blocks,too-many-statements + +# https://url.spec.whatwg.org/ + +from collections import deque +from enum import auto, Enum +from itertools import chain +from math import floor +from typing import List, Optional, Union + +from ._encoding import ( + _encode_or_fail, + _get_encoder, + _get_output_encoding, +) +from ._infra import ( + _ASCII_ALPHA, + _ASCII_ALPHANUMERIC, + _ASCII_DIGIT, + _ASCII_HEX_DIGIT, + _ASCII_TAB_OR_NEWLINE, + _C0_CONTROL, + _C0_CONTROL_OR_SPACE, + _is_noncharacter_code_point_id, + _is_surrogate_code_point_id, +) +from ._util import _PercentEncodeSet + +_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { + ord(char): None for char in _ASCII_TAB_OR_NEWLINE +} + + +class _State(Enum): + SCHEME_START = auto() + SCHEME = auto() + NO_SCHEME = auto() + SPECIAL_RELATIVE_OR_AUTHORITY = auto() + PATH_OR_AUTHORITY = auto() + RELATIVE = auto() + RELATIVE_SLASH = auto() + SPECIAL_AUTHORITY_SLASHES = auto() + SPECIAL_AUTHORITY_IGNORE_SLASHES = auto() + AUTHORITY = auto() + HOST = auto() + PORT = auto() + FILE = auto() + FILE_SLASH = auto() + FILE_HOST = auto() + PATH_START = auto() + PATH = auto() + OPAQUE_PATH = auto() + QUERY = auto() + FRAGMENT = auto() + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#default-port +_DEFAULT_PORTS = { + "ftp": 21, + "file": None, + "http": 80, + "https": 443, + "ws": 80, + "wss": 443, +} + + +class _URL: + scheme: str = "" + username: str = "" + password: str = "" + host: Union[None, int, List[int], str] = None + port: Optional[int] = None + path: Union[str, List[str]] + query: Optional[str] = None + fragment: Optional[str] = None + + # Indicates whether a color (:) separating a username from a password + # existed in the parsed URL. This enables :func:`_serialize_url` to + # generate a URL that matches the input URL, if desired. + _password_token_seen: bool = False + + def __init__(self) -> None: + self.path = [] + + def has_opaque_path(self): + return isinstance(self.path, str) + + def is_special(self): + return self.scheme in _DEFAULT_PORTS + + +_SCHEME_CHARS = _ASCII_ALPHANUMERIC + "+-." + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path +def _shorten_path(url: _URL): + path = url.path + if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + return + url.path = path[:-1] + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode +def _percent_encode_after_encoding( + input, + *, + encoding: str, + percent_encode_set: _PercentEncodeSet, + space_as_plus: bool = False, +): + encoder = _get_encoder(encoding) + input_queue = deque(input) + output = "" + potential_error = 0 + + while potential_error is not None: + encode_output = deque() + potential_error = _encode_or_fail( + input=input_queue, + encoder=encoder, + output=encode_output, + ) + for byte in encode_output: + if space_as_plus and byte == b" ": + output += "+" + continue + isomorph = byte.decode() + if isomorph not in percent_encode_set: + output += isomorph + else: + output += f"%{byte[0]:X}" + if potential_error is not None: + output += f"%26%23{ord(potential_error)}%3B" + + return output + + +_C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( + _C0_CONTROL, + greater_than="~", +) +_FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' +_QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' +_SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" +_PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" +_USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point +_FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" +_FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" + +_EOF = object() + + +def _parse_ipv6(input: str): + address = [0] * 8 + piece_index = 0 + compress = None + pointer = 0 + input_lengh = len(input) + if input[pointer] == ":": + if input[pointer + 1] != ":": + raise ValueError + pointer += 2 + piece_index += 1 + compress = piece_index + while pointer < input_lengh: + if piece_index == 8: + raise ValueError + if input[pointer] == ":": + if compress is not None: + raise ValueError + pointer += 1 + piece_index += 1 + compress = piece_index + continue + value = length = 0 + while length < 4 and input[pointer] in _ASCII_HEX_DIGIT: + value = value * 0x10 + int(input[pointer], base=16) + pointer += 1 + length += 1 + if input[pointer] == ".": + if length == 0: + raise ValueError + pointer -= length + if piece_index > 6: + raise ValueError + numbers_seen = 0 + while pointer < input_lengh: + ipv4_piece = None + if numbers_seen > 0: + if input[pointer] == "." and numbers_seen < 4: + pointer += 1 + else: + raise ValueError + if input[pointer] not in _ASCII_DIGIT: + raise ValueError + while input[pointer] in _ASCII_DIGIT: + number = int(input[pointer]) + if ipv4_piece is None: + ipv4_piece = number + elif ipv4_piece == 0: + raise ValueError + else: + ipv4_piece = ipv4_piece * 10 + number + if ipv4_piece > 255: + raise ValueError + pointer += 1 + address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + numbers_seen += 1 + if numbers_seen in (2, 4): + piece_index += 1 + if numbers_seen != 4: + raise ValueError + break + if input[pointer] == ":": + pointer += 1 + if pointer >= input_lengh: + raise ValueError + elif pointer < input_lengh: + raise ValueError + address[piece_index] = value + piece_index += 1 + if compress is not None: + swaps = piece_index - compress + piece_index = 7 + while piece_index != 0 and swaps > 0: + address[piece_index], address[compress + swaps - 1] = ( + address[compress + swaps - 1], + address[piece_index], + ) + piece_index -= 1 + swaps -= 1 + elif compress is None and piece_index != 8: + raise ValueError + return address + + +def _utf_8_percent_encode( + input: str, + percent_encode_set: _PercentEncodeSet, +): + return _percent_encode_after_encoding( + input, + encoding="utf-8", + percent_encode_set=percent_encode_set, + ) + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser +def _parse_opaque_host(input: str): + for code_point in input: + if code_point in _FORBIDDEN_HOST_CODE_POINTS: + raise ValueError + return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) + + +_ASCII_HEX_BYTES = tuple( + chain( + range(0x30, 0x39 + 1), + range(0x41, 0x46 + 1), + range(0x61, 0x66 + 1), + ) +) + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#percent-decode +def _percent_decode(input: bytes): + output = b"" + pointer = 0 + input_length = len(input) + while pointer < input_length: + byte = input[pointer] + if byte != 0x25 or ( + byte == 0x25 + and ( + pointer + 2 >= input_length + or input[pointer + 1] not in _ASCII_HEX_BYTES + or input[pointer + 2] not in _ASCII_HEX_BYTES + ) + ): + output += b"%c" % byte + else: + byte_hex = b"%c%c" % (input[pointer + 1], input[pointer + 2]) + byte_point = int(byte_hex, base=16) + output += b"%c" % byte_point + pointer += 2 + pointer += 1 + return output + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#string-percent-decode +def _percent_decode_string(input: str): + return _percent_decode(input.encode()) + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser +def _parse_ipv4_number(input: str): + if not input: + raise ValueError + validation_error = False + r = 10 + if len(input) >= 2: + if input[:2] in ("0X", "0x"): + validation_error = True + input = input[2:] + r = 16 + elif input[0] == "0": + validation_error = True + input = input[1:] + r = 8 + if not input: + return (0, True) + return (int(input, base=r), validation_error) + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker +def _ends_in_number(input: str): + parts = input.split(".") + if parts and parts[-1] == "": + if len(parts) == 1: + return False + parts = parts[:-1] + last = parts[-1] + if last and all(code_point in _ASCII_DIGIT for code_point in last): + return True + try: + _parse_ipv4_number(last) + except ValueError: + return False + return True + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser +def _parse_ipv4(input: str): + parts = input.split(".") + if parts and not parts[-1]: + parts = parts[:-1] + if len(parts) > 4: + raise ValueError + numbers = [] + for part in parts: + result = _parse_ipv4_number(part) + numbers += result[0] + if any(item > 255 for item in numbers[:-1]): + raise ValueError + if numbers[-1] >= 256 ** (5 - len(numbers)): + raise ValueError + ipv4 = numbers[-1] + counter = 0 + for n in numbers[:-1]: + ipv4 += n * 256 ** (3 - counter) + counter += 1 + return ipv4 + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser +def _parse_host(input: str, *, is_special=True): + if input.startswith("["): + if not input.endswith("]"): + raise ValueError + return _parse_ipv6(input[1:-1]) + if not is_special: + return _parse_opaque_host(input) + domain = _percent_decode_string(input).decode() + ascii_domain = domain.encode("idna").decode() + for code_point in ascii_domain: + if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + raise ValueError + if _ends_in_number(ascii_domain): + return _parse_ipv4(ascii_domain) + return ascii_domain + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter +def _is_windows_drive_letter(input: str): + return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter +def _starts_with_windows_drive_letter(input: str): + input_length = len(input) + return ( + input_length >= 2 + and _is_windows_drive_letter(input[:2]) + and (input_length == 2 or input[2] in "/\\?#") + ) + + +_ASCII_URL_CODE_POINTS = _ASCII_ALPHANUMERIC + "!$&'()*+,-./:;=?@_~" + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-code-points +def _is_url_code_point(code_point: str): + if code_point in _ASCII_URL_CODE_POINTS: + return True + code_point_id = ord(code_point) + if code_point_id < 0xA0: + return False + if code_point_id > 0x10FFFD: + return False + if _is_surrogate_code_point_id(code_point_id): + return False + if _is_noncharacter_code_point_id(code_point_id): + return False + return True + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment +def _is_double_dot_path_segment(input: str): + return input in ( + "..", + ".%2e", + ".%2E", + "%2e.", + "%2E.", + "%2e%2e", + "%2e%2E", + "%2E%2e", + "%2E%2E", + ) + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment +def _is_single_dot_path_segment(input: str): + return input in ( + "." "%2e", + "%2E", + ) + + +def _parse_url( + url: str, + *, + base_url: str = None, + encoding: str = "utf-8", + userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, +) -> str: + """Return a :class:`_URL` object built from *url*, *base_url* and + *encoding*, following the URL parsing algorithm defined in the `URL living + standard`_. + + .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing + + Additional parameters allow to deviate from the standard for specific use + cases: + + - *userinfo_percent_encode_set* allows customizing which characters found + in the user authroization part of the input URL need to be + percent-encoded. + """ + + # Additional deviations from the standard are implemented but not covered + # in the docstring above because they do not affect public APIs of this + # function or of the :class:`_URL`` output class: + # + # - The ``passwordTokenSeen`` variable from the standard algorithm is + # stored into :attr:`_URL._password_token_seen`, to allow + # :func:`_serialize_url` to distinguish when a password was missing + # from the parsed URL (e.g. ``a://a@example.com``) and when it was + # explicitly an empty string (e.g. ``a://a:@example.com``), so that its + # output can match the original parsed URL if desired. + + input = url + if base_url is not None: + base = _parse_url(base_url, encoding=encoding) + else: + base = None + encoding = _get_output_encoding(encoding) + + url = _URL() + state = _State.SCHEME_START + buffer = "" + at_sign_seen = inside_brackets = False + pointer = 0 + + input = input.strip(_C0_CONTROL_OR_SPACE) + input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) + input_length = len(input) + + while True: + try: + c = input[pointer] + except IndexError: + c = _EOF + + if state == _State.SCHEME_START: + if c is not _EOF and c in _ASCII_ALPHA: + buffer += c.lower() + state = _State.SCHEME + else: + state = _State.NO_SCHEME + pointer -= 1 + + elif state == _State.SCHEME: + if c is not _EOF and c in _SCHEME_CHARS: + buffer += c.lower() + elif c == ":": + url.scheme = buffer + buffer = "" + if url.scheme == "file": + state = _State.FILE + elif url.is_special(): + if base is not None and base.scheme == url.scheme: + state = _State.SPECIAL_RELATIVE_OR_AUTHORITY + else: + state = _State.SPECIAL_AUTHORITY_SLASHES + elif input[pointer + 1] == "/": + state = _State.PATH_OR_AUTHORITY + pointer += 1 + else: + url.path = "" + state = _State.OPAQUE_PATH + else: + buffer = "" + state = _State.NO_SCHEME + pointer = -1 + + elif state == _State.NO_SCHEME: + if base is None: + raise ValueError + if base.has_opaque_path(): + if c != "#": + raise ValueError + url.scheme = base.scheme + url.path = base.path + url.query = base.query + url.fragment = "" + state = _State.FRAGMENT + else: + if base.scheme != "file": + state = _State.RELATIVE + else: + state = _State.FILE + pointer -= 1 + + elif state == _State.SPECIAL_RELATIVE_OR_AUTHORITY: + if c == "/" and input[pointer + 1 : 1] == "/": + state = _State.SPECIAL_AUTHORITY_IGNORE_SLASHES + pointer += 1 + else: + state = _State.RELATIVE + pointer -= 1 + + elif state == _State.PATH_OR_AUTHORITY: + if c == "/": + state = _State.AUTHORITY + else: + state = _State.PATH + pointer -= 1 + + elif state == _State.RELATIVE: + url.scheme = base.scheme + if c == "/": + state = _State.RELATIVE + elif url.is_special() and c == "\\": + state = _State.RELATIVE_SLASH + else: + url.username = base.username + url.password = base.password + url.host = base.host + url.port = base.port + url.path = base.path + url.query = base.query + if c == "?": + url.query = "" + state = _State.QUERY + elif c == "#": + url.fragment = "" + state = _State.FRAGMENT + elif pointer < input_length: + url.query = None + _shorten_path(url) + state = _State.PATH + pointer -= 1 + + elif state == _State.RELATIVE_SLASH: + if url.is_special() and c is not _EOF and c in "/\\": + state = _State.SPECIAL_AUTHORITY_IGNORE_SLASHES + elif c == "/": + state = _State.AUTHORITY + else: + url.username = base.username + url.password = base.password + url.host = base.host + url.port = base.port + state = _State.PATH + pointer -= 1 + + elif state == _State.SPECIAL_AUTHORITY_SLASHES: + if c == "/" and input[pointer + 1] == "/": + state = _State.SPECIAL_AUTHORITY_IGNORE_SLASHES + pointer += 1 + else: + state = _State.SPECIAL_AUTHORITY_IGNORE_SLASHES + pointer -= 1 + + elif state == _State.SPECIAL_AUTHORITY_IGNORE_SLASHES: + if c is not _EOF and c not in "/\\": + state = _State.AUTHORITY + pointer -= 1 + + elif state == _State.AUTHORITY: + if c == "@": + if at_sign_seen: + buffer = "%40" + buffer + at_sign_seen = True + buffer_length = len(buffer) + for i, code_point in enumerate(buffer): + if code_point == ":" and not url._password_token_seen: + url._password_token_seen = True + continue + if code_point == "%" and "%" in userinfo_percent_encode_set: + if ( + i + 2 >= buffer_length + or buffer[i + 1] not in _ASCII_HEX_DIGIT + or buffer[i + 2] not in _ASCII_HEX_DIGIT + ): + encoded_code_points = "%25" + else: + encoded_code_points = "%" + else: + encoded_code_points = _utf_8_percent_encode( + code_point, + userinfo_percent_encode_set, + ) + if url._password_token_seen: + url.password += encoded_code_points + else: + url.username += encoded_code_points + buffer = "" + elif c is _EOF or c in "/?#" or url.is_special() and c == "\\": + if at_sign_seen and not buffer: + raise ValueError + pointer -= len(buffer) + 1 + buffer = "" + state = _State.HOST + else: + buffer += c + + elif state == _State.HOST: + if c == ":" and not inside_brackets: + if not buffer: + raise ValueError + host = _parse_host(buffer, is_special=url.is_special()) + url.host = host + buffer = "" + state = _State.PORT + elif c is _EOF or c in "/?#" or url.is_special() and c == "\\": + pointer -= 1 + if url.is_special() and not buffer: + raise ValueError + host = _parse_host(buffer, is_special=url.is_special()) + url.host = host + buffer = "" + state = _State.PATH_START + else: + if c == "[": + inside_brackets = True + elif c == "]": + inside_brackets = False + buffer += c + + elif state == _State.PORT: + if c is not _EOF and c in _ASCII_DIGIT: + buffer += c + elif c == _EOF or c in "/?#" or url.is_special() and c == "\\": + if buffer: + port = int(buffer) + if port > 2**16 - 1: + raise ValueError + url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port + buffer = "" + state = _State.PATH_START + pointer -= 1 + else: + raise ValueError + + elif state == _State.FILE: + url.scheme = "file" + url.host = "" + if c is not _EOF and c in "/\\": + state = _State.FILE_SLASH + elif base is not None and base.scheme == "file": + url.host = base.host + url.path = base.path + url.query = base.query + if c == "?": + url.query = "" + state = _State.QUERY + elif c == "#": + url.fragment = "" + state = _State.FRAGMENT + elif c is not _EOF: + url.query = None + if not _starts_with_windows_drive_letter(input[pointer:]): + _shorten_path(url) + else: + url.path = [] + state = _State.PATH + pointer -= 1 + else: + state = _State.PATH + pointer -= 1 + + elif state == _State.FILE_SLASH: + if c is not _EOF and c in "/\\": + state = _State.FILE_HOST + else: + if base is not None and base.scheme == "file": + url.host = base.host + if ( + not _starts_with_windows_drive_letter(input[pointer:]) + and base.path[0] in _ASCII_ALPHA + ): + url.path += base.path[0] + state = _State.PATH + pointer -= 1 + + elif state == _State.FILE_HOST: + if c is _EOF or c in "/\\?#": + pointer -= 1 + if _is_windows_drive_letter(buffer): + state = _State.PATH + elif not buffer: + url.host = "" + state = _State.PATH_START + else: + host = _parse_host(buffer, is_special=False) + if host == "localhost": + host = "" + url.host = host + buffer = "" + state = _State.PATH_START + else: + buffer += c + + elif state == _State.PATH_START: + if url.is_special(): + state = _State.PATH + if c is not _EOF and c not in "/\\": + pointer -= 1 + elif c == "?": + url.query = "" + state = _State.QUERY + elif c == "#": + url.fragment = "" + state = _State.FRAGMENT + elif c is not _EOF: + state = _State.PATH + if c != "/": + pointer -= 1 + + elif state == _State.PATH: + if c is _EOF or c == "/" or (url.is_special() and c == "\\") or c in "?#": + if _is_double_dot_path_segment(buffer): + _shorten_path(url) + if c != "/" and not (url.is_special() and c == "\\"): + url.path.append("") + elif _is_single_dot_path_segment(buffer): + if c != "/" and not (url.is_special() and c == "\\"): + url.path.append("") + else: + if ( + url.scheme == "file" + and not url.path + and _is_windows_drive_letter(buffer) + ): + buffer = buffer[0] + ":" + buffer[2:] + url.path.append(buffer) + buffer = "" + if c == "?": + url.query = "" + state = _State.QUERY + elif c == "#": + url.fragment = "" + state = _State.FRAGMENT + else: + buffer += _utf_8_percent_encode(c, _PATH_PERCENT_ENCODE_SET) + + elif state == _State.OPAQUE_PATH: + if c == "?": + url.query = "" + state = _State.QUERY + elif c == "#": + url.fragment = "" + state = _State.FRAGMENT + elif c is not _EOF: + encoded = _utf_8_percent_encode( + c, + _C0_CONTROL_PERCENT_ENCODE_SET, + ) + url.path += encoded + + elif state == _State.QUERY: + if encoding != "utf-8" and ( + not url.is_special() or url.scheme in ("ws", "wss") + ): + encoding = "utf-8" + if c == "#" or c is _EOF: + query_percent_encode_set = ( + _SPECIAL_QUERY_PERCENT_ENCODE_SET + if url.is_special() + else _QUERY_PERCENT_ENCODE_SET + ) + url.query += _percent_encode_after_encoding( + buffer, + encoding=encoding, + percent_encode_set=query_percent_encode_set, + ) + buffer = "" + if c == "#": + url.fragment = "" + state = _State.FRAGMENT + elif c is not _EOF: + buffer += c + + elif state == _State.FRAGMENT: + if c is not _EOF: + url.fragment += _utf_8_percent_encode( + c, + _FRAGMENT_PERCENT_ENCODE_SET, + ) + + if pointer >= input_length: + break + pointer += 1 + + return url + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 +def _serialize_ipv4(address: int) -> str: + output = "" + n = address + for i in range(1, 5): + output = str(n % 256) + output + if i != 4: + output = "." + output + n = floor(n / 256) + return output + + +def _get_ipv6_first_longest_0_piece_index(address: List[int], *, min_length=2): + index = None + index_length = 0 + current_length = 0 + for current_index, piece in enumerate(address): + if piece != 0: + current_length = 0 + continue + current_length += 1 + if current_length > index_length and current_length >= min_length: + index = current_index + 1 - current_length + index_length = current_length + return index + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer +def _serialize_ipv6(address: List[int]) -> str: + output = "" + compress = _get_ipv6_first_longest_0_piece_index(address) + ignore0 = False + for piece_index in range(8): + if ignore0: + if not address[piece_index]: + continue + ignore0 = False + if compress == piece_index: + separator = "::" if piece_index == 0 else ":" + output += separator + ignore0 = True + continue + output += f"{address[piece_index]:x}" + if piece_index != 7: + output += ":" + return output + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer +def _serialize_host(host: Union[str, int, List[int]]): + if isinstance(host, int): + return _serialize_ipv4(host) + if isinstance(host, list): + return f"[{_serialize_ipv6(host)}]" + return host + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer +def _serialize_url_path(url: _URL) -> str: + if url.has_opaque_path(): + return url.path + output = "" + for segment in url.path: + output += f"/{segment}" + return output + + +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing +def _serialize_url( + url: _URL, + *, + exclude_fragment: bool = False, + canonicalize: Optional[bool] = None, +) -> str: + """Return a string representation of *url* following the URL serialization + algorithm defined in the `URL living standard`_. + + .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer + + If *exclude_fragment* is ``True``, the returned URL does not include + :attr:`_URL.fragment`. + + Additional parameters allow to deviate from the standard for specific use + cases: + + - *canonicalize*: + + - ``None``: Do not deviate from the standard algorithm to apply or + prevent URL canonicalization. + + - ``True``: Deviate from the standard as needed to make sure that + functionally-equivalent URLs are always rendered the same way. + + This value has no effect at the moment, i.e. it applies the same + level of canonicalization as the standard algorithm. + + - ``False``: Deviate from the standard as needed to make sure that + the returned URL string is as close as possible to the original URL + string that was parsed into *url*, as long as the returned URL + string is still a valid URL. + + At the moment, this ensures that the password separator (:) is + included into the returned URL string as long as it was present on + the original URL string, even if :attr:`_URL.password` is an empty + string. + """ + output = url.scheme + ":" + if url.host is not None: + output += "//" + if url.username or url.password: + output += url.username + if url.password: + output += f":{url.password}" + elif url._password_token_seen: + output += ":" + output += "@" + output += _serialize_host(url.host) + if url.port is not None: + output += f":{url.port}" + elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + output += "/." + output += _serialize_url_path(url) + if url.query is not None: + output += f"?{url.query}" + if not exclude_fragment and url.fragment is not None: + output += f"#{url.fragment}" + return output diff --git a/w3lib/_util.py b/w3lib/_util.py new file mode 100644 index 00000000..731e9a73 --- /dev/null +++ b/w3lib/_util.py @@ -0,0 +1,66 @@ +class _PercentEncodeSet: + """Set of code points that require percent-encoding. + + The set is comprised of *code_points* and any code point greater than + *greater_than*. + + If *exclude* is ``True``, *code_points* is interpreted as a string of code + points *not* to percent-encode, i.e. all other code points lower or equal + to *greater_than* must be percent-encoded. + + *greater_than* is 0x7F by default, meaning all non-ASCII characters are + included. + """ + + def __init__( + self, code_points: str, *, greater_than: str = "\x7f", exclude: bool = False + ): + if isinstance(greater_than, str): + greater_than = ord(greater_than) + self._greater_than = greater_than + if exclude: + code_points = "".join( + chr(value) + for value in range(self._greater_than + 1) + if chr(value) not in code_points + ) + self._code_points = code_points + + def __contains__(self, code_point: str): + return code_point in self._code_points or ord(code_point) > self._greater_than + + def __add__(self, code_points: str): + return _PercentEncodeSet( + self._code_points + code_points, + greater_than=self._greater_than, + ) + + def __sub__(self, code_points: str): + new_code_points = self._code_points + for code_point in code_points: + new_code_points = new_code_points.replace(code_point, "") + return _PercentEncodeSet( + new_code_points, + greater_than=self._greater_than, + ) + + def __or__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": + greater_than = min(self._greater_than, other._greater_than) + code_points = "".join(set(self._code_points) | set(other._code_points)) + return _PercentEncodeSet( + code_points, + greater_than=greater_than, + ) + + def __and__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": + greater_than = max(self._greater_than, other._greater_than) + code_points = "".join(set(self._code_points) & set(other._code_points)) + return _PercentEncodeSet( + code_points, + greater_than=greater_than, + ) + + def __repr__(self) -> str: + cp = "".join(sorted(tuple(self._code_points), key=ord)) + gt = chr(self._greater_than) + return f"_PercentEncodeSet({cp!r}, greater_than={gt!r})" diff --git a/w3lib/url.py b/w3lib/url.py index a41446c4..40b57697 100644 --- a/w3lib/url.py +++ b/w3lib/url.py @@ -35,8 +35,12 @@ ) from urllib.parse import _coerce_args # type: ignore from urllib.request import pathname2url, url2pathname -from w3lib.util import to_unicode -from w3lib._types import AnyUnicodeError, StrOrBytes + +from ._rfc2396 import _RFC2396_USERINFO_PERCENT_ENCODE_SET +from ._rfc3986 import _RFC3986_USERINFO_PERCENT_ENCODE_SET +from ._types import AnyUnicodeError, StrOrBytes +from ._url import _parse_url, _serialize_url, _USERINFO_PERCENT_ENCODE_SET +from .util import to_unicode # error handling function for bytes-to-Unicode decoding errors with URLs @@ -62,6 +66,55 @@ def _quote_byte(error: UnicodeError) -> Tuple[str, int]: r"[\t\n\r]" ) # see https://infra.spec.whatwg.org/#ascii-tab-or-newline +_SAFE_USERINFO_PERCENT_ENCODE_SET = ( + _USERINFO_PERCENT_ENCODE_SET + | _RFC3986_USERINFO_PERCENT_ENCODE_SET + | _RFC2396_USERINFO_PERCENT_ENCODE_SET +) + + +def safe_url( + input: str, + *, + encoding: str = "utf-8", +) -> str: + """Return a version of *url* that most web servers can parse. + + If *url* already matches that criteria, it is returned unmodified. + + URL parsing-then-serializing is handled according to the `URL Living + Standard`_, in line with modern web browsers. As the standard changes, so + will this function. The current implementation is based on commit a46cb91_ + of the standard, from 2022-10-26. + + .. _a46cb91: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/ + .. _URL Living Standard: https://url.spec.whatwg.org/ + + However, unsafe character criteria is stricter than that of the `URL Living + Standard`_, so that the returned URL is also valid by additional standards + that are known to be used by modern web servers: + + - `RFC 2396`_ + `RFC 2732`_ + `java.net.URI`_ deviations in Java 8 + + .. _RFC 2396: https://www.rfc-editor.org/rfc/rfc2396.txt + .. _RFC 2732: https://www.rfc-editor.org/rfc/rfc2732.txt + .. _java.net.URI: https://docs.oracle.com/javase/8/docs/api/java/net/URI.html + + - `RFC 3986`_ + + .. _RFC 3986: https://www.rfc-editor.org/rfc/rfc3986.txt + + *encoding* should be the encoding of the HTML page from which *url* was + extracted. If *url* does not come from an HTML page, *encoding* should not + be passed, i.e. it should be left as UTF-8. + """ + url = _parse_url( + input, + encoding=encoding, + userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, + ) + return _serialize_url(url) + def safe_url_string( url: StrOrBytes, From 17ee8d6001eda7eb8d4082bcbab9e7b0c575af99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 8 Nov 2022 21:12:59 +0100 Subject: [PATCH 04/34] Progress on typing --- tox.ini | 2 +- w3lib/_encoding.py | 17 ++++++++--------- w3lib/_infra.py | 4 ++-- w3lib/_url.py | 2 +- w3lib/_util.py | 11 +++++++---- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/tox.ini b/tox.ini index 8966b646..60b12f38 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py37, py38, py39, py310, pypy3, docs, security, flake8, pylint, black +envlist = py37, py38, py39, py310, pypy3, docs, security, flake8, pylint, black, typing [testenv] deps = diff --git a/w3lib/_encoding.py b/w3lib/_encoding.py index 81f68cb9..d44a2d8c 100644 --- a/w3lib/_encoding.py +++ b/w3lib/_encoding.py @@ -2,12 +2,12 @@ import codecs from collections import deque -from typing import Callable, List, Optional +from typing import Callable, Dict, List, Optional from ._infra import _ASCII_WHITESPACE -def _short_windows_125(last_digit): +def _short_windows_125(last_digit: int) -> Dict[str, str]: return { label: f"windows-125{last_digit}" for label in ( @@ -429,18 +429,18 @@ def __init__( items = [] self.items = items - def is_continue(self): + def is_continue(self) -> bool: return self._continue - def is_finished(self): + def is_finished(self) -> bool: return self._finished - def is_error(self): + def is_error(self) -> bool: return self._error # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#handler -def _handle_codec(*, codec, input, item): +def _handle_codec(*, codec, item): if item is None: return _PotentialError(finished=True) try: @@ -462,8 +462,8 @@ def _read(input): # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-process -def _process_item(item, *, codec, input, output, mode): - result = _handle_codec(codec=codec, input=input, item=item) +def _process_item(item, *, codec, output, mode): + result = _handle_codec(codec=codec, item=item) if result.is_finished(): return result if result.items: @@ -510,7 +510,6 @@ def _process_queue( result = _process_item( _read(input), codec=codec, - input=input, output=output, mode=error_mode, ) diff --git a/w3lib/_infra.py b/w3lib/_infra.py index a20e9109..758b9443 100644 --- a/w3lib/_infra.py +++ b/w3lib/_infra.py @@ -14,12 +14,12 @@ # https://infra.spec.whatwg.org/commit-snapshots/59e0d16c1e3ba0e77c6a60bfc69a0929b8ffaa5d/#surrogate -def _is_surrogate_code_point_id(code_point_id) -> bool: +def _is_surrogate_code_point_id(code_point_id: int) -> bool: return 0xD800 <= code_point_id <= 0xDFFF # https://infra.spec.whatwg.org/commit-snapshots/59e0d16c1e3ba0e77c6a60bfc69a0929b8ffaa5d/#noncharacter -def _is_noncharacter_code_point_id(code_point_id) -> bool: +def _is_noncharacter_code_point_id(code_point_id: int) -> bool: if 0xFDD0 <= code_point_id <= 0xFDEF: return True return code_point_id in ( diff --git a/w3lib/_url.py b/w3lib/_url.py index 4d389851..d56769a5 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -436,7 +436,7 @@ def _parse_url( base_url: str = None, encoding: str = "utf-8", userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, -) -> str: +) -> _URL: """Return a :class:`_URL` object built from *url*, *base_url* and *encoding*, following the URL parsing algorithm defined in the `URL living standard`_. diff --git a/w3lib/_util.py b/w3lib/_util.py index 731e9a73..ebecc69d 100644 --- a/w3lib/_util.py +++ b/w3lib/_util.py @@ -1,3 +1,6 @@ +from typing import Union + + class _PercentEncodeSet: """Set of code points that require percent-encoding. @@ -13,7 +16,7 @@ class _PercentEncodeSet: """ def __init__( - self, code_points: str, *, greater_than: str = "\x7f", exclude: bool = False + self, code_points: str, *, greater_than: Union[int, str] = "\x7f", exclude: bool = False ): if isinstance(greater_than, str): greater_than = ord(greater_than) @@ -26,16 +29,16 @@ def __init__( ) self._code_points = code_points - def __contains__(self, code_point: str): + def __contains__(self, code_point: str) -> bool: return code_point in self._code_points or ord(code_point) > self._greater_than - def __add__(self, code_points: str): + def __add__(self, code_points: str) -> "_PercentEncodeSet": return _PercentEncodeSet( self._code_points + code_points, greater_than=self._greater_than, ) - def __sub__(self, code_points: str): + def __sub__(self, code_points: str) -> "_PercentEncodeSet": new_code_points = self._code_points for code_point in code_points: new_code_points = new_code_points.replace(code_point, "") From aef0532b807281a702ad380922a48d3615061e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Wed, 9 Nov 2022 16:35:21 +0100 Subject: [PATCH 05/34] Address typing issues --- .bandit.yml | 1 + w3lib/_encoding.py | 52 ++++++++++------- w3lib/_url.py | 137 +++++++++++++++++++++++++++------------------ w3lib/_util.py | 6 +- 4 files changed, 119 insertions(+), 77 deletions(-) diff --git a/.bandit.yml b/.bandit.yml index 69acb678..5287d6c2 100644 --- a/.bandit.yml +++ b/.bandit.yml @@ -1,2 +1,3 @@ skips: +- B101 # Use of assert; we use them for mypy - B107 diff --git a/w3lib/_encoding.py b/w3lib/_encoding.py index d44a2d8c..9dca92ce 100644 --- a/w3lib/_encoding.py +++ b/w3lib/_encoding.py @@ -2,11 +2,16 @@ import codecs from collections import deque -from typing import Callable, Dict, List, Optional +from typing import AnyStr, Callable, Dict, List, Optional, Tuple, Union from ._infra import _ASCII_WHITESPACE +CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] +DecodeFunction = Callable[[bytes], Tuple[str, int]] +EncodeFunction = Callable[[str], Tuple[bytes, int]] + + def _short_windows_125(last_digit: int) -> Dict[str, str]: return { label: f"windows-125{last_digit}" @@ -413,21 +418,21 @@ def __init__( *, _continue: bool = False, error: bool = False, - error_code_point: Optional[str] = None, + error_code_point: Union[bytes, str, None] = None, finished: bool = False, - items: Optional[List] = None, + items: Union[bytes, str, None] = None, ) -> None: - self.code_point = error_code_point + self.code_point: Union[bytes, str, None] = error_code_point self._continue = _continue self._error = error self._finished = finished if isinstance(items, bytes): - items = [b"%c" % byte for byte in items] + _items: List[Union[bytes, str]] = [b"%c" % byte for byte in items] elif items is not None: - items = list(items) + _items = list(items) else: - items = [] - self.items = items + _items = [] + self.items: List[Union[bytes, str]] = _items def is_continue(self) -> bool: return self._continue @@ -440,7 +445,9 @@ def is_error(self) -> bool: # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#handler -def _handle_codec(*, codec, item): +def _handle_codec( + *, codec: CodecFunction, item: Union[bytes, str, None] +) -> _PotentialError: if item is None: return _PotentialError(finished=True) try: @@ -455,14 +462,16 @@ def _handle_codec(*, codec, item): # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-stream-read -def _read(input): +def _read(input: deque) -> Union[bytes, str, None]: if not input: return None return input.popleft() # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-process -def _process_item(item, *, codec, output, mode): +def _process_item( + item: Union[bytes, str, None], *, codec: CodecFunction, output: deque, mode: str +) -> _PotentialError: result = _handle_codec(codec=codec, item=item) if result.is_finished(): return result @@ -470,10 +479,11 @@ def _process_item(item, *, codec, output, mode): for result_item in result.items: output.append(result_item) elif result.is_error(): + assert result.code_point is not None if mode == "replacement": output.append("\uFFFD") elif mode == "html": - output.append(b"&#%i;" % result.code_point) + output.append(b"&#%i;" % ord(result.code_point)) elif mode == "fatal": return result return _PotentialError(_continue=True) @@ -483,8 +493,8 @@ def _process_item(item, *, codec, output, mode): def _utf_8_decode_without_bom_or_fail( *, input: deque, - output: deque = None, -): + output: Optional[deque] = None, +) -> deque: if output is None: output = deque() potential_error = _process_queue( @@ -502,10 +512,10 @@ def _utf_8_decode_without_bom_or_fail( def _process_queue( *, input: deque, - codec, + codec: CodecFunction, output: deque, error_mode: str, -): +) -> _PotentialError: while True: result = _process_item( _read(input), @@ -518,7 +528,9 @@ def _process_queue( # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#encode-or-fail -def _encode_or_fail(*, input, encoder, output: deque): +def _encode_or_fail( + *, input: deque, encoder: EncodeFunction, output: deque +) -> Optional[_PotentialError]: potential_error = _process_queue( input=input, codec=encoder, @@ -526,17 +538,17 @@ def _encode_or_fail(*, input, encoder, output: deque): error_mode="fatal", ) if potential_error.is_error(): - return ord(potential_error.code_point) + return potential_error return None -def _get_decoder(encoding: str) -> Callable: +def _get_decoder(encoding: str) -> DecodeFunction: codec_info = codecs.lookup(encoding) return codec_info.decode # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder -def _get_encoder(encoding: str) -> Callable: +def _get_encoder(encoding: str) -> EncodeFunction: codec_info = codecs.lookup(encoding) return codec_info.encode diff --git a/w3lib/_url.py b/w3lib/_url.py index d56769a5..6b290746 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -6,12 +6,13 @@ from enum import auto, Enum from itertools import chain from math import floor -from typing import List, Optional, Union +from typing import List, Optional, Tuple, Union from ._encoding import ( _encode_or_fail, _get_encoder, _get_output_encoding, + _PotentialError, ) from ._infra import ( _ASCII_ALPHA, @@ -83,10 +84,10 @@ class _URL: def __init__(self) -> None: self.path = [] - def has_opaque_path(self): + def has_opaque_path(self) -> bool: return isinstance(self.path, str) - def is_special(self): + def is_special(self) -> bool: return self.scheme in _DEFAULT_PORTS @@ -94,7 +95,7 @@ def is_special(self): # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path -def _shorten_path(url: _URL): +def _shorten_path(url: _URL) -> None: path = url.path if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): return @@ -103,19 +104,19 @@ def _shorten_path(url: _URL): # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode def _percent_encode_after_encoding( - input, + input: str, *, encoding: str, percent_encode_set: _PercentEncodeSet, space_as_plus: bool = False, -): +) -> str: encoder = _get_encoder(encoding) input_queue = deque(input) output = "" - potential_error = 0 + potential_error: Union[int, _PotentialError, None] = 0 while potential_error is not None: - encode_output = deque() + encode_output: deque = deque() potential_error = _encode_or_fail( input=input_queue, encoder=encoder, @@ -131,7 +132,9 @@ def _percent_encode_after_encoding( else: output += f"%{byte[0]:X}" if potential_error is not None: - output += f"%26%23{ord(potential_error)}%3B" + assert isinstance(potential_error, _PotentialError) + assert isinstance(potential_error.code_point, (bytes, str)) + output += f"%26%23{ord(potential_error.code_point)}%3B" return output @@ -150,10 +153,8 @@ def _percent_encode_after_encoding( _FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" -_EOF = object() - -def _parse_ipv6(input: str): +def _parse_ipv6(input: str) -> List[int]: address = [0] * 8 piece_index = 0 compress = None @@ -207,6 +208,7 @@ def _parse_ipv6(input: str): if ipv4_piece > 255: raise ValueError pointer += 1 + assert isinstance(ipv4_piece, int) address[piece_index] = address[piece_index] * 0x100 + ipv4_piece numbers_seen += 1 if numbers_seen in (2, 4): @@ -240,7 +242,7 @@ def _parse_ipv6(input: str): def _utf_8_percent_encode( input: str, percent_encode_set: _PercentEncodeSet, -): +) -> str: return _percent_encode_after_encoding( input, encoding="utf-8", @@ -249,7 +251,7 @@ def _utf_8_percent_encode( # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser -def _parse_opaque_host(input: str): +def _parse_opaque_host(input: str) -> str: for code_point in input: if code_point in _FORBIDDEN_HOST_CODE_POINTS: raise ValueError @@ -266,7 +268,7 @@ def _parse_opaque_host(input: str): # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#percent-decode -def _percent_decode(input: bytes): +def _percent_decode(input: bytes) -> bytes: output = b"" pointer = 0 input_length = len(input) @@ -291,12 +293,12 @@ def _percent_decode(input: bytes): # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#string-percent-decode -def _percent_decode_string(input: str): +def _percent_decode_string(input: str) -> bytes: return _percent_decode(input.encode()) # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser -def _parse_ipv4_number(input: str): +def _parse_ipv4_number(input: str) -> Tuple[int, bool]: if not input: raise ValueError validation_error = False @@ -316,7 +318,7 @@ def _parse_ipv4_number(input: str): # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker -def _ends_in_number(input: str): +def _ends_in_number(input: str) -> bool: parts = input.split(".") if parts and parts[-1] == "": if len(parts) == 1: @@ -333,7 +335,7 @@ def _ends_in_number(input: str): # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser -def _parse_ipv4(input: str): +def _parse_ipv4(input: str) -> int: parts = input.split(".") if parts and not parts[-1]: parts = parts[:-1] @@ -342,7 +344,7 @@ def _parse_ipv4(input: str): numbers = [] for part in parts: result = _parse_ipv4_number(part) - numbers += result[0] + numbers.append(result[0]) if any(item > 255 for item in numbers[:-1]): raise ValueError if numbers[-1] >= 256 ** (5 - len(numbers)): @@ -356,7 +358,7 @@ def _parse_ipv4(input: str): # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser -def _parse_host(input: str, *, is_special=True): +def _parse_host(input: str, *, is_special: bool = True) -> Union[str, int, List[int]]: if input.startswith("["): if not input.endswith("]"): raise ValueError @@ -374,12 +376,12 @@ def _parse_host(input: str, *, is_special=True): # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter -def _is_windows_drive_letter(input: str): +def _is_windows_drive_letter(input: str) -> bool: return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter -def _starts_with_windows_drive_letter(input: str): +def _starts_with_windows_drive_letter(input: str) -> bool: input_length = len(input) return ( input_length >= 2 @@ -392,7 +394,7 @@ def _starts_with_windows_drive_letter(input: str): # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-code-points -def _is_url_code_point(code_point: str): +def _is_url_code_point(code_point: str) -> bool: if code_point in _ASCII_URL_CODE_POINTS: return True code_point_id = ord(code_point) @@ -408,7 +410,7 @@ def _is_url_code_point(code_point: str): # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment -def _is_double_dot_path_segment(input: str): +def _is_double_dot_path_segment(input: str) -> bool: return input in ( "..", ".%2e", @@ -423,7 +425,7 @@ def _is_double_dot_path_segment(input: str): # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment -def _is_single_dot_path_segment(input: str): +def _is_single_dot_path_segment(input: str) -> bool: return input in ( "." "%2e", "%2E", @@ -431,7 +433,7 @@ def _is_single_dot_path_segment(input: str): def _parse_url( - url: str, + input: str, *, base_url: str = None, encoding: str = "utf-8", @@ -462,7 +464,6 @@ def _parse_url( # explicitly an empty string (e.g. ``a://a:@example.com``), so that its # output can match the original parsed URL if desired. - input = url if base_url is not None: base = _parse_url(base_url, encoding=encoding) else: @@ -481,12 +482,13 @@ def _parse_url( while True: try: - c = input[pointer] + c: Optional[str] = input[pointer] except IndexError: - c = _EOF + c = None if state == _State.SCHEME_START: - if c is not _EOF and c in _ASCII_ALPHA: + if c is not None and c in _ASCII_ALPHA: + assert isinstance(c, str) buffer += c.lower() state = _State.SCHEME else: @@ -494,7 +496,8 @@ def _parse_url( pointer -= 1 elif state == _State.SCHEME: - if c is not _EOF and c in _SCHEME_CHARS: + if c is not None and c in _SCHEME_CHARS: + assert isinstance(c, str) buffer += c.lower() elif c == ":": url.scheme = buffer @@ -551,6 +554,7 @@ def _parse_url( pointer -= 1 elif state == _State.RELATIVE: + assert isinstance(base, _URL) url.scheme = base.scheme if c == "/": state = _State.RELATIVE @@ -576,7 +580,9 @@ def _parse_url( pointer -= 1 elif state == _State.RELATIVE_SLASH: - if url.is_special() and c is not _EOF and c in "/\\": + assert isinstance(base, _URL) + if url.is_special() and c is not None and c in "/\\": + assert isinstance(c, str) state = _State.SPECIAL_AUTHORITY_IGNORE_SLASHES elif c == "/": state = _State.AUTHORITY @@ -597,7 +603,8 @@ def _parse_url( pointer -= 1 elif state == _State.SPECIAL_AUTHORITY_IGNORE_SLASHES: - if c is not _EOF and c not in "/\\": + if c is not None and c not in "/\\": + assert isinstance(c, str) state = _State.AUTHORITY pointer -= 1 @@ -630,7 +637,7 @@ def _parse_url( else: url.username += encoded_code_points buffer = "" - elif c is _EOF or c in "/?#" or url.is_special() and c == "\\": + elif c is None or c in "/?#" or url.is_special() and c == "\\": if at_sign_seen and not buffer: raise ValueError pointer -= len(buffer) + 1 @@ -647,7 +654,7 @@ def _parse_url( url.host = host buffer = "" state = _State.PORT - elif c is _EOF or c in "/?#" or url.is_special() and c == "\\": + elif c is None or c in "/?#" or url.is_special() and c == "\\": pointer -= 1 if url.is_special() and not buffer: raise ValueError @@ -663,9 +670,10 @@ def _parse_url( buffer += c elif state == _State.PORT: - if c is not _EOF and c in _ASCII_DIGIT: + if c is not None and c in _ASCII_DIGIT: + assert isinstance(c, str) buffer += c - elif c == _EOF or c in "/?#" or url.is_special() and c == "\\": + elif c is None or c in "/?#" or url.is_special() and c == "\\": if buffer: port = int(buffer) if port > 2**16 - 1: @@ -680,7 +688,8 @@ def _parse_url( elif state == _State.FILE: url.scheme = "file" url.host = "" - if c is not _EOF and c in "/\\": + if c is not None and c in "/\\": + assert isinstance(c, str) state = _State.FILE_SLASH elif base is not None and base.scheme == "file": url.host = base.host @@ -692,7 +701,8 @@ def _parse_url( elif c == "#": url.fragment = "" state = _State.FRAGMENT - elif c is not _EOF: + elif c is not None: + assert isinstance(c, str) url.query = None if not _starts_with_windows_drive_letter(input[pointer:]): _shorten_path(url) @@ -705,21 +715,22 @@ def _parse_url( pointer -= 1 elif state == _State.FILE_SLASH: - if c is not _EOF and c in "/\\": + assert isinstance(url.path, list) + if c is not None and c in "/\\": + assert isinstance(c, str) state = _State.FILE_HOST else: if base is not None and base.scheme == "file": url.host = base.host - if ( - not _starts_with_windows_drive_letter(input[pointer:]) - and base.path[0] in _ASCII_ALPHA - ): - url.path += base.path[0] + if not _starts_with_windows_drive_letter( + input[pointer:] + ) and _is_windows_drive_letter(base.path[0]): + url.path.append(base.path[0]) state = _State.PATH pointer -= 1 elif state == _State.FILE_HOST: - if c is _EOF or c in "/\\?#": + if c is None or c in "/\\?#": pointer -= 1 if _is_windows_drive_letter(buffer): state = _State.PATH @@ -734,12 +745,14 @@ def _parse_url( buffer = "" state = _State.PATH_START else: + assert isinstance(c, str) buffer += c elif state == _State.PATH_START: if url.is_special(): state = _State.PATH - if c is not _EOF and c not in "/\\": + if c is not None and c not in "/\\": + assert isinstance(c, str) pointer -= 1 elif c == "?": url.query = "" @@ -747,13 +760,15 @@ def _parse_url( elif c == "#": url.fragment = "" state = _State.FRAGMENT - elif c is not _EOF: + elif c is not None: + assert isinstance(c, str) state = _State.PATH if c != "/": pointer -= 1 elif state == _State.PATH: - if c is _EOF or c == "/" or (url.is_special() and c == "\\") or c in "?#": + assert isinstance(url.path, list) + if c is None or c == "/" or (url.is_special() and c == "\\") or c in "?#": if _is_double_dot_path_segment(buffer): _shorten_path(url) if c != "/" and not (url.is_special() and c == "\\"): @@ -777,16 +792,19 @@ def _parse_url( url.fragment = "" state = _State.FRAGMENT else: + assert isinstance(c, str) buffer += _utf_8_percent_encode(c, _PATH_PERCENT_ENCODE_SET) elif state == _State.OPAQUE_PATH: + assert isinstance(url.path, str) if c == "?": url.query = "" state = _State.QUERY elif c == "#": url.fragment = "" state = _State.FRAGMENT - elif c is not _EOF: + elif c is not None: + assert isinstance(c, str) encoded = _utf_8_percent_encode( c, _C0_CONTROL_PERCENT_ENCODE_SET, @@ -794,11 +812,12 @@ def _parse_url( url.path += encoded elif state == _State.QUERY: + assert isinstance(url.query, str) if encoding != "utf-8" and ( not url.is_special() or url.scheme in ("ws", "wss") ): encoding = "utf-8" - if c == "#" or c is _EOF: + if c == "#" or c is None: query_percent_encode_set = ( _SPECIAL_QUERY_PERCENT_ENCODE_SET if url.is_special() @@ -813,11 +832,14 @@ def _parse_url( if c == "#": url.fragment = "" state = _State.FRAGMENT - elif c is not _EOF: + elif c is not None: + assert isinstance(c, str) buffer += c elif state == _State.FRAGMENT: - if c is not _EOF: + assert isinstance(url.fragment, str) + if c is not None: + assert isinstance(c, str) url.fragment += _utf_8_percent_encode( c, _FRAGMENT_PERCENT_ENCODE_SET, @@ -842,7 +864,9 @@ def _serialize_ipv4(address: int) -> str: return output -def _get_ipv6_first_longest_0_piece_index(address: List[int], *, min_length=2): +def _get_ipv6_first_longest_0_piece_index( + address: List[int], *, min_length: int = 2 +) -> Optional[int]: index = None index_length = 0 current_length = 0 @@ -879,7 +903,7 @@ def _serialize_ipv6(address: List[int]) -> str: # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer -def _serialize_host(host: Union[str, int, List[int]]): +def _serialize_host(host: Union[str, int, List[int]]) -> str: if isinstance(host, int): return _serialize_ipv4(host) if isinstance(host, list): @@ -890,6 +914,7 @@ def _serialize_host(host: Union[str, int, List[int]]): # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer def _serialize_url_path(url: _URL) -> str: if url.has_opaque_path(): + assert isinstance(url.path, str) return url.path output = "" for segment in url.path: diff --git a/w3lib/_util.py b/w3lib/_util.py index ebecc69d..c3308ea0 100644 --- a/w3lib/_util.py +++ b/w3lib/_util.py @@ -16,7 +16,11 @@ class _PercentEncodeSet: """ def __init__( - self, code_points: str, *, greater_than: Union[int, str] = "\x7f", exclude: bool = False + self, + code_points: str, + *, + greater_than: Union[int, str] = "\x7f", + exclude: bool = False, ): if isinstance(greater_than, str): greater_than = ord(greater_than) From abe403218dd52a2498224f3c7c17b5aff87e9efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Wed, 9 Nov 2022 17:20:07 +0100 Subject: [PATCH 06/34] Fix unicode encoding in userinfo and IPv6 parsing --- tests/test_url.py | 4 +++- w3lib/_url.py | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index 6501364a..3227e70a 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -163,7 +163,9 @@ def test_percent_encode_after_encoding(input, output): f"a://{USERNAME_ENCODED}:{PASSWORD_ENCODED}@example.com", ), ("a://@\\example.com", ValueError), - # TODO: Non-ASCII + ("a://\x80:\x80@example.com", "a://%C2%80:%C2%80@example.com"), + # Host + ("http://[2a01:5cc0:1:2::4]", "http://[2a01:5cc0:1:2::4]"), ) diff --git a/w3lib/_url.py b/w3lib/_url.py index 6b290746..5f1d31fa 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -126,7 +126,7 @@ def _percent_encode_after_encoding( if space_as_plus and byte == b" ": output += "+" continue - isomorph = byte.decode() + isomorph = chr(ord(byte)) if isomorph not in percent_encode_set: output += isomorph else: @@ -159,14 +159,14 @@ def _parse_ipv6(input: str) -> List[int]: piece_index = 0 compress = None pointer = 0 - input_lengh = len(input) - if input[pointer] == ":": - if input[pointer + 1] != ":": + input_lenght = len(input) + if pointer < input_lenght and input[pointer] == ":": + if pointer + 1 >= input_lenght or input[pointer + 1] != ":": raise ValueError pointer += 2 piece_index += 1 compress = piece_index - while pointer < input_lengh: + while pointer < input_lenght: if piece_index == 8: raise ValueError if input[pointer] == ":": @@ -177,27 +177,27 @@ def _parse_ipv6(input: str) -> List[int]: compress = piece_index continue value = length = 0 - while length < 4 and input[pointer] in _ASCII_HEX_DIGIT: + while length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT: value = value * 0x10 + int(input[pointer], base=16) pointer += 1 length += 1 - if input[pointer] == ".": + if pointer < input_lenght and input[pointer] == ".": if length == 0: raise ValueError pointer -= length if piece_index > 6: raise ValueError numbers_seen = 0 - while pointer < input_lengh: + while pointer < input_lenght: ipv4_piece = None if numbers_seen > 0: if input[pointer] == "." and numbers_seen < 4: pointer += 1 else: raise ValueError - if input[pointer] not in _ASCII_DIGIT: + if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: raise ValueError - while input[pointer] in _ASCII_DIGIT: + while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: number = int(input[pointer]) if ipv4_piece is None: ipv4_piece = number @@ -216,11 +216,11 @@ def _parse_ipv6(input: str) -> List[int]: if numbers_seen != 4: raise ValueError break - if input[pointer] == ":": + if pointer < input_lenght and input[pointer] == ":": pointer += 1 - if pointer >= input_lengh: + if pointer >= input_lenght: raise ValueError - elif pointer < input_lengh: + elif pointer < input_lenght: raise ValueError address[piece_index] = value piece_index += 1 From 86435dfd17a839ca41a7e6a841edb27894657550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Fri, 11 Nov 2022 17:43:18 +0100 Subject: [PATCH 07/34] Progress on tests --- tests/test_url.py | 155 +++++++++++++++++++++++++++++++++++++++++----- w3lib/_rfc2396.py | 12 ++++ w3lib/_rfc3986.py | 14 +++++ w3lib/_url.py | 101 +++++++++++++++++++++--------- w3lib/url.py | 50 +++++++++++++-- 5 files changed, 285 insertions(+), 47 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index 3227e70a..1ae8d086 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -13,6 +13,7 @@ from w3lib._url import ( _C0_CONTROL_PERCENT_ENCODE_SET, _percent_encode_after_encoding, + _SPECIAL_SCHEMES, ) from w3lib.url import ( add_or_replace_parameter, @@ -109,13 +110,67 @@ def test_percent_encode_after_encoding(input, output): if ( chr(value) not in _C0_CONTROL_OR_SPACE and chr(value) not in USERINFO_SAFE - and chr(value) not in ":/?#" + and chr(value) not in ":/?#\\" ) ) USERNAME_ENCODED = "".join(f"%{ord(char):X}" for char in USERNAME_TO_ENCODE) PASSWORD_TO_ENCODE = USERNAME_TO_ENCODE + ":" PASSWORD_ENCODED = "".join(f"%{ord(char):X}" for char in PASSWORD_TO_ENCODE) +# Path characters that do not need escaping. +# Removed for RFC 2396 and RFC 3986: %[\]^| +PATH_SAFE = _ASCII_ALPHANUMERIC + "-_.!~*'()" + ":@&=+$," + "/" + ";" +PATH_TO_ENCODE = "".join( + chr(value) + for value in range(0x80) + if ( + chr(value) not in _C0_CONTROL_OR_SPACE + and chr(value) not in PATH_SAFE + and chr(value) not in "?#\\" + ) +) +PATH_ENCODED = "".join(f"%{ord(char):X}" for char in PATH_TO_ENCODE) + +# Query characters that do not need escaping. +# Removed for RFC 2396 and RFC 3986: %[\]^`{|} +# Removed for the URL living standard: ' (special) +QUERY_SAFE = _ASCII_ALPHANUMERIC + "-_.!~*'()" + ":@&=+$," + "/" + ";" + "?" +QUERY_TO_ENCODE = "".join( + chr(value) + for value in range(0x80) + if ( + chr(value) not in _C0_CONTROL_OR_SPACE + and chr(value) not in QUERY_SAFE + and chr(value) not in "#" + ) +) +QUERY_ENCODED = "".join(f"%{ord(char):X}" for char in QUERY_TO_ENCODE) +SPECIAL_QUERY_SAFE = QUERY_SAFE.replace("'", "") +SPECIAL_QUERY_TO_ENCODE = "".join( + chr(value) + for value in range(0x80) + if ( + chr(value) not in _C0_CONTROL_OR_SPACE + and chr(value) not in SPECIAL_QUERY_SAFE + and chr(value) not in "#" + ) +) +SPECIAL_QUERY_ENCODED = "".join(f"%{ord(char):X}" for char in SPECIAL_QUERY_TO_ENCODE) + +# Fragment characters that do not need escaping. +# Removed for RFC 2396 and RFC 3986: #%[\\]^{|} +FRAGMENT_SAFE = _ASCII_ALPHANUMERIC + "-_.!~*'()" + ":@&=+$," + "/" + ";" + "?" +FRAGMENT_TO_ENCODE = "".join( + chr(value) + for value in range(0x80) + if ( + chr(value) not in _C0_CONTROL_OR_SPACE + and chr(value) not in FRAGMENT_SAFE + ) +) +FRAGMENT_ENCODED = "".join(f"%{ord(char):X}" for char in FRAGMENT_TO_ENCODE) + + # Test cases for URL-to-safe-URL conversions with only a URL as input parameter # (i.e. no encoding or base URL). # @@ -150,22 +205,84 @@ def test_percent_encode_after_encoding(input, output): ), *SAFE_URL_URL_INVALID_SCHEME_CASES, # Authority - ("a://a@example.com", "a://a@example.com"), - ("a://a:@example.com", "a://a:@example.com"), - ("a://a:a@example.com", "a://a:a@example.com"), - ("a://a%3A@example.com", "a://a%3A@example.com"), + ("https://a@example.com", "https://a@example.com"), + ("https://a:@example.com", "https://a:@example.com"), + ("https://a:a@example.com", "https://a:a@example.com"), + ("https://a%3A@example.com", "https://a%3A@example.com"), ( - f"a://{USERINFO_SAFE}:{USERINFO_SAFE}@example.com", - f"a://{USERINFO_SAFE}:{USERINFO_SAFE}@example.com", + f"https://{USERINFO_SAFE}:{USERINFO_SAFE}@example.com", + f"https://{USERINFO_SAFE}:{USERINFO_SAFE}@example.com", ), ( - f"a://{USERNAME_TO_ENCODE}:{PASSWORD_TO_ENCODE}@example.com", - f"a://{USERNAME_ENCODED}:{PASSWORD_ENCODED}@example.com", + f"https://{USERNAME_TO_ENCODE}:{PASSWORD_TO_ENCODE}@example.com", + f"https://{USERNAME_ENCODED}:{PASSWORD_ENCODED}@example.com", ), - ("a://@\\example.com", ValueError), - ("a://\x80:\x80@example.com", "a://%C2%80:%C2%80@example.com"), + ("https://@\\example.com", ValueError), + ("https://\x80:\x80@example.com", "https://%C2%80:%C2%80@example.com"), # Host + ("https://example.com", "https://example.com"), + ("https://\x80.example", ValueError), + ("https://%80.example", ValueError), + ("https://ñ.example", "https://xn--ida.example"), + ("http://192.168.0.0", "http://192.168.0.0"), + ("http://192.168.0.256", ValueError), + ("http://192.168.0.0.0", ValueError), ("http://[2a01:5cc0:1:2::4]", "http://[2a01:5cc0:1:2::4]"), + ("http://[2a01:5cc0:1:2:3:4]", ValueError), + # Path + ("https://example.com/", "https://example.com/"), + ("https://example.com/a", "https://example.com/a"), + ("https://example.com\\a", "https://example.com/a"), + ("https://example.com/a\\b", "https://example.com/a/b"), + ( + f"https://example.com/{PATH_SAFE}", + f"https://example.com/{PATH_SAFE}", + ), + ( + f"https://example.com/{PATH_TO_ENCODE}", + f"https://example.com/{PATH_ENCODED}", + ), + ("https://example.com/ñ", "https://example.com/%C3%B1"), + # Query + ("https://example.com?", "https://example.com?"), + ("https://example.com/?", "https://example.com/?"), + ("https://example.com?a", "https://example.com?a"), + ("https://example.com?a=", "https://example.com?a="), + ("https://example.com?a=b", "https://example.com?a=b"), + ( + f"a://example.com?{QUERY_SAFE}", + f"a://example.com?{QUERY_SAFE}", + ), + ( + f"a://example.com?{QUERY_TO_ENCODE}", + f"a://example.com?{QUERY_ENCODED}", + ), + *( + ( + f"{scheme}://example.com?{SPECIAL_QUERY_SAFE}", + f"{scheme}://example.com?{SPECIAL_QUERY_SAFE}", + ) + for scheme in _SPECIAL_SCHEMES + ), + *( + ( + f"{scheme}://example.com?{SPECIAL_QUERY_TO_ENCODE}", + f"{scheme}://example.com?{SPECIAL_QUERY_ENCODED}", + ) + for scheme in _SPECIAL_SCHEMES + ), + ("https://example.com?ñ", "https://example.com?%C3%B1"), + # Fragment + ("https://example.com#", "https://example.com#"), + ("https://example.com#a", "https://example.com#a"), + ( + f"a://example.com#{FRAGMENT_SAFE}", + f"a://example.com#{FRAGMENT_SAFE}", + ), + ( + f"a://example.com#{FRAGMENT_TO_ENCODE}", + f"a://example.com#{FRAGMENT_ENCODED}", + ), ) @@ -238,11 +355,21 @@ def test_safe_url_string_encoding(encoding, url, output): *(case[0] for case in SAFE_URL_URL_INVALID_SCHEME_CASES), # %3A gets decoded, going from a "a:" username to a "a" username with an # empty password. - "a://a%3A@example.com", + "https://a%3A@example.com", # Userinfo characters that the URL living standard requires escaping (:;=) # are not escaped. - f"a://{USERNAME_TO_ENCODE}:{PASSWORD_TO_ENCODE}@example.com", - "a://@\\example.com", # Invalid URL + f"https://{USERNAME_TO_ENCODE}:{PASSWORD_TO_ENCODE}@example.com", + "https://@\\example.com", # Invalid URL + "http://[2a01:5cc0:1:2::4]", # https://github.com/scrapy/w3lib/issues/193 + "https://\x80.example", # Invalid domain name (non-visible character) + "https://%80.example", # Invalid domain name (non-visible character) + "http://192.168.0.256", # Invalid IP address + "http://192.168.0.0.0", # Invalid IP address / domain name + "http://[2a01:5cc0:1:2:3:4]", # Invalid IPv6 + # Does not convert \\ to / + "https://example.com\\a", + "https://example.com\\a\\b", + "https://example.com/a/b", # Encodes the last / } diff --git a/w3lib/_rfc2396.py b/w3lib/_rfc2396.py index 79c1fbad..641f3e6d 100644 --- a/w3lib/_rfc2396.py +++ b/w3lib/_rfc2396.py @@ -3,9 +3,21 @@ _RFC2396_MARK_PERCENT_ENCODE_SET = _PercentEncodeSet("-_.!~*'()", exclude=True) +_RFC2396_RESERVED_PERCENT_ENCODE_SET = _PercentEncodeSet(";/?:@&=+$,", exclude=True) _RFC2396_UNRESERVED_PERCENT_ENCODE_SET = ( _RFC2396_MARK_PERCENT_ENCODE_SET - _ASCII_ALPHANUMERIC ) _RFC2396_USERINFO_PERCENT_ENCODE_SET = ( _RFC2396_UNRESERVED_PERCENT_ENCODE_SET - ";:&=+$," ) +_RFC2396_ABS_PATH_PERCENT_ENCODE_SET = ( + _RFC2396_UNRESERVED_PERCENT_ENCODE_SET + - ":@&=+$," # pchar + - "/" # abs_path, path_segments + - ";" # segment +) +_RFC2396_QUERY_PERCENT_ENCODE_SET = ( + _RFC2396_RESERVED_PERCENT_ENCODE_SET + & _RFC2396_UNRESERVED_PERCENT_ENCODE_SET +) +_RFC2396_FRAGMENT_PERCENT_ENCODE_SET = _RFC2396_QUERY_PERCENT_ENCODE_SET diff --git a/w3lib/_rfc3986.py b/w3lib/_rfc3986.py index b9250eda..fc1ee147 100644 --- a/w3lib/_rfc3986.py +++ b/w3lib/_rfc3986.py @@ -13,3 +13,17 @@ _RFC3986_USERINFO_PERCENT_ENCODE_SET = ( _RFC3986_UNRESERVED_PERCENT_ENCODE_SET & _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET ) - ":" +_RFC3986_PCHAR_PERCENT_ENCODE_SET = ( + _RFC3986_UNRESERVED_PERCENT_ENCODE_SET + & _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET + - ":@" +) +_RFC3986_PATH_PERCENT_ENCODE_SET = ( + _RFC3986_PCHAR_PERCENT_ENCODE_SET + - "/" +) +_RFC3986_QUERY_PERCENT_ENCODE_SET = ( + _RFC3986_PCHAR_PERCENT_ENCODE_SET + - "/?" +) +_RFC3986_FRAGMENT_PERCENT_ENCODE_SET = _RFC3986_QUERY_PERCENT_ENCODE_SET diff --git a/w3lib/_url.py b/w3lib/_url.py index 5f1d31fa..8f7b03db 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -4,7 +4,7 @@ from collections import deque from enum import auto, Enum -from itertools import chain +from itertools import chain, tee, zip_longest from math import floor from typing import List, Optional, Tuple, Union @@ -64,6 +64,7 @@ class _State(Enum): "ws": 80, "wss": 443, } +_SPECIAL_SCHEMES = set(_DEFAULT_PORTS.keys()) class _URL: @@ -81,6 +82,11 @@ class _URL: # generate a URL that matches the input URL, if desired. _password_token_seen: bool = False + # Indicates, for an empty path component, whether or not a slash (/) + # character was used. This enables :func:`_serialize_url` to + # generate a URL that matches the input URL, if desired. + _empty_path_slash: bool = True + def __init__(self) -> None: self.path = [] @@ -88,7 +94,7 @@ def has_opaque_path(self) -> bool: return isinstance(self.path, str) def is_special(self) -> bool: - return self.scheme in _DEFAULT_PORTS + return self.scheme in _SPECIAL_SCHEMES _SCHEME_CHARS = _ASCII_ALPHANUMERIC + "+-." @@ -102,7 +108,17 @@ def _shorten_path(url: _URL) -> None: url.path = path[:-1] +def by_threes(iterable): + a, b = tee(iterable) + b, c = tee(iterable) + next(b, None) + next(c, None) + next(c, None) + return zip_longest(a, b, c) + + # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode +# Extended to handled cases where % is to be percent-encoded. def _percent_encode_after_encoding( input: str, *, @@ -122,13 +138,24 @@ def _percent_encode_after_encoding( encoder=encoder, output=encode_output, ) - for byte in encode_output: + for three_bytes in by_threes(encode_output): + byte = three_bytes[0] if space_as_plus and byte == b" ": output += "+" continue isomorph = chr(ord(byte)) if isomorph not in percent_encode_set: output += isomorph + elif isomorph == "%": + if ( + three_bytes[1] is None + or chr(ord(three_bytes[1])) not in _ASCII_HEX_DIGIT + or three_bytes[2] is None + or chr(ord(three_bytes[2])) not in _ASCII_HEX_DIGIT + ): + output += "%25" + else: + output += "%" else: output += f"%{byte[0]:X}" if potential_error is not None: @@ -432,12 +459,32 @@ def _is_single_dot_path_segment(input: str) -> bool: ) +# Wrapper for _utf_8_percent_encode that ensures that, if percent symbols need +# to be escaped, they are escaped in an idempotent way (i.e. if they are +# already part of an escape sequence, they are not re-encoded). +def _idempotent_utf_8_percent_encode(*, input: str, pointer: int, encode_set: _PercentEncodeSet) -> str: + code_point = input[pointer] + if code_point == "%" and "%" in encode_set: + if ( + pointer + 2 >= len(input) + or input[pointer + 1] not in _ASCII_HEX_DIGIT + or input[pointer + 2] not in _ASCII_HEX_DIGIT + ): + return "%25" + return "%" + return _utf_8_percent_encode(code_point, encode_set) + + def _parse_url( input: str, *, base_url: str = None, encoding: str = "utf-8", userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, + path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, + query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, + special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, + fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, ) -> _URL: """Return a :class:`_URL` object built from *url*, *base_url* and *encoding*, following the URL parsing algorithm defined in the `URL living @@ -618,20 +665,11 @@ def _parse_url( if code_point == ":" and not url._password_token_seen: url._password_token_seen = True continue - if code_point == "%" and "%" in userinfo_percent_encode_set: - if ( - i + 2 >= buffer_length - or buffer[i + 1] not in _ASCII_HEX_DIGIT - or buffer[i + 2] not in _ASCII_HEX_DIGIT - ): - encoded_code_points = "%25" - else: - encoded_code_points = "%" - else: - encoded_code_points = _utf_8_percent_encode( - code_point, - userinfo_percent_encode_set, - ) + encoded_code_points = _idempotent_utf_8_percent_encode( + input=buffer, + pointer=i, + encode_set=userinfo_percent_encode_set, + ) if url._password_token_seen: url.password += encoded_code_points else: @@ -783,6 +821,8 @@ def _parse_url( and _is_windows_drive_letter(buffer) ): buffer = buffer[0] + ":" + buffer[2:] + if not url.path and not buffer and c is not None and c in "?#" and input[pointer-1] not in "/\\": + url._empty_path_slash = False url.path.append(buffer) buffer = "" if c == "?": @@ -793,7 +833,11 @@ def _parse_url( state = _State.FRAGMENT else: assert isinstance(c, str) - buffer += _utf_8_percent_encode(c, _PATH_PERCENT_ENCODE_SET) + buffer += _idempotent_utf_8_percent_encode( + input=input, + pointer=pointer, + encode_set=path_percent_encode_set, + ) elif state == _State.OPAQUE_PATH: assert isinstance(url.path, str) @@ -818,15 +862,15 @@ def _parse_url( ): encoding = "utf-8" if c == "#" or c is None: - query_percent_encode_set = ( - _SPECIAL_QUERY_PERCENT_ENCODE_SET + percent_encode_set = ( + special_query_percent_encode_set if url.is_special() - else _QUERY_PERCENT_ENCODE_SET + else query_percent_encode_set ) url.query += _percent_encode_after_encoding( buffer, encoding=encoding, - percent_encode_set=query_percent_encode_set, + percent_encode_set=percent_encode_set, ) buffer = "" if c == "#": @@ -840,10 +884,7 @@ def _parse_url( assert isinstance(url.fragment, str) if c is not None: assert isinstance(c, str) - url.fragment += _utf_8_percent_encode( - c, - _FRAGMENT_PERCENT_ENCODE_SET, - ) + url.fragment += _idempotent_utf_8_percent_encode(input=input, pointer=pointer, encode_set=fragment_percent_encode_set) if pointer >= input_length: break @@ -912,10 +953,12 @@ def _serialize_host(host: Union[str, int, List[int]]) -> str: # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer -def _serialize_url_path(url: _URL) -> str: +def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: if url.has_opaque_path(): assert isinstance(url.path, str) return url.path + if len(url.path) <= 1 and not url._empty_path_slash and not canonicalize: + return "" output = "" for segment in url.path: output += f"/{segment}" @@ -968,7 +1011,7 @@ def _serialize_url( output += url.username if url.password: output += f":{url.password}" - elif url._password_token_seen: + elif not canonicalize and url._password_token_seen: output += ":" output += "@" output += _serialize_host(url.host) @@ -976,7 +1019,7 @@ def _serialize_url( output += f":{url.port}" elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: output += "/." - output += _serialize_url_path(url) + output += _serialize_url_path(url, canonicalize=canonicalize) if url.query is not None: output += f"?{url.query}" if not exclude_fragment and url.fragment is not None: diff --git a/w3lib/url.py b/w3lib/url.py index 40b57697..0c5faae7 100644 --- a/w3lib/url.py +++ b/w3lib/url.py @@ -36,10 +36,28 @@ from urllib.parse import _coerce_args # type: ignore from urllib.request import pathname2url, url2pathname -from ._rfc2396 import _RFC2396_USERINFO_PERCENT_ENCODE_SET -from ._rfc3986 import _RFC3986_USERINFO_PERCENT_ENCODE_SET +from ._rfc2396 import ( + _RFC2396_ABS_PATH_PERCENT_ENCODE_SET, + _RFC2396_FRAGMENT_PERCENT_ENCODE_SET, + _RFC2396_QUERY_PERCENT_ENCODE_SET, + _RFC2396_USERINFO_PERCENT_ENCODE_SET, +) +from ._rfc3986 import ( + _RFC3986_FRAGMENT_PERCENT_ENCODE_SET, + _RFC3986_QUERY_PERCENT_ENCODE_SET, + _RFC3986_PATH_PERCENT_ENCODE_SET, + _RFC3986_USERINFO_PERCENT_ENCODE_SET, +) from ._types import AnyUnicodeError, StrOrBytes -from ._url import _parse_url, _serialize_url, _USERINFO_PERCENT_ENCODE_SET +from ._url import ( + _FRAGMENT_PERCENT_ENCODE_SET, + _parse_url, + _PATH_PERCENT_ENCODE_SET, + _QUERY_PERCENT_ENCODE_SET, + _serialize_url, + _SPECIAL_QUERY_PERCENT_ENCODE_SET, + _USERINFO_PERCENT_ENCODE_SET, +) from .util import to_unicode @@ -71,6 +89,26 @@ def _quote_byte(error: UnicodeError) -> Tuple[str, int]: | _RFC3986_USERINFO_PERCENT_ENCODE_SET | _RFC2396_USERINFO_PERCENT_ENCODE_SET ) +_SAFE_PATH_PERCENT_ENCODE_SET = ( + _PATH_PERCENT_ENCODE_SET + | _RFC3986_PATH_PERCENT_ENCODE_SET + | _RFC2396_ABS_PATH_PERCENT_ENCODE_SET +) +_SAFE_QUERY_PERCENT_ENCODE_SET = ( + _QUERY_PERCENT_ENCODE_SET + | _RFC3986_QUERY_PERCENT_ENCODE_SET + | _RFC2396_QUERY_PERCENT_ENCODE_SET +) +_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET = ( + _SPECIAL_QUERY_PERCENT_ENCODE_SET + | _RFC3986_QUERY_PERCENT_ENCODE_SET + | _RFC2396_QUERY_PERCENT_ENCODE_SET +) +_SAFE_FRAGMENT_PERCENT_ENCODE_SET = ( + _FRAGMENT_PERCENT_ENCODE_SET + | _RFC3986_FRAGMENT_PERCENT_ENCODE_SET + | _RFC2396_FRAGMENT_PERCENT_ENCODE_SET +) def safe_url( @@ -112,8 +150,12 @@ def safe_url( input, encoding=encoding, userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, + path_percent_encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, + query_percent_encode_set=_SAFE_QUERY_PERCENT_ENCODE_SET, + special_query_percent_encode_set=_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET, + fragment_percent_encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET, ) - return _serialize_url(url) + return _serialize_url(url, canonicalize=False) def safe_url_string( From 79193bff804f54ad7621361043ac50f6bd18622e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 15 Nov 2022 06:37:49 +0100 Subject: [PATCH 08/34] Address issues reported by tests and static checkers --- tests/test_url.py | 87 ++++++++++++++++++++++++++++++++++++----------- w3lib/_rfc2396.py | 3 +- w3lib/_rfc3986.py | 13 ++----- w3lib/_url.py | 55 ++++++++++++++++++++++++------ 4 files changed, 117 insertions(+), 41 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index 1ae8d086..82cc56b7 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -1,5 +1,9 @@ import os import unittest +from collections import deque +from collections.abc import Iterator +from itertools import tee +from platform import python_implementation from urllib.parse import urlparse import pytest @@ -163,10 +167,7 @@ def test_percent_encode_after_encoding(input, output): FRAGMENT_TO_ENCODE = "".join( chr(value) for value in range(0x80) - if ( - chr(value) not in _C0_CONTROL_OR_SPACE - and chr(value) not in FRAGMENT_SAFE - ) + if (chr(value) not in _C0_CONTROL_OR_SPACE and chr(value) not in FRAGMENT_SAFE) ) FRAGMENT_ENCODED = "".join(f"%{ord(char):X}" for char in FRAGMENT_TO_ENCODE) @@ -183,22 +184,26 @@ def test_percent_encode_after_encoding(input, output): ("", ValueError), *SAFE_URL_URL_STRIP_CASES, # Remove all ASCII tab or newline from input. - *( + ( ( - ( - f"{char}h{char}ttps{char}:{char}/{char}/{char}a{char}:{char}a" - f"{char}@{char}exam{char}ple.com{char}:{char}1{char}/{char}a" - f"{char}?{char}a{char}#{char}a{char}" - ), - "https://a:a@example.com:1/a?a#a", - ) - for char in _ASCII_TAB_OR_NEWLINE + f"{_ASCII_TAB_OR_NEWLINE}h{_ASCII_TAB_OR_NEWLINE}ttps" + f"{_ASCII_TAB_OR_NEWLINE}:{_ASCII_TAB_OR_NEWLINE}/" + f"{_ASCII_TAB_OR_NEWLINE}/{_ASCII_TAB_OR_NEWLINE}a" + f"{_ASCII_TAB_OR_NEWLINE}b{_ASCII_TAB_OR_NEWLINE}:" + f"{_ASCII_TAB_OR_NEWLINE}a{_ASCII_TAB_OR_NEWLINE}b" + f"{_ASCII_TAB_OR_NEWLINE}@{_ASCII_TAB_OR_NEWLINE}exam" + f"{_ASCII_TAB_OR_NEWLINE}ple.com{_ASCII_TAB_OR_NEWLINE}:" + f"{_ASCII_TAB_OR_NEWLINE}1{_ASCII_TAB_OR_NEWLINE}2" + f"{_ASCII_TAB_OR_NEWLINE}/{_ASCII_TAB_OR_NEWLINE}a" + f"{_ASCII_TAB_OR_NEWLINE}b{_ASCII_TAB_OR_NEWLINE}?" + f"{_ASCII_TAB_OR_NEWLINE}a{_ASCII_TAB_OR_NEWLINE}b" + f"{_ASCII_TAB_OR_NEWLINE}#{_ASCII_TAB_OR_NEWLINE}a" + f"{_ASCII_TAB_OR_NEWLINE}b{_ASCII_TAB_OR_NEWLINE}" + ), + "https://ab:ab@example.com:12/ab?ab#ab", ), # Scheme - *( - (f"{scheme}://example.com", f"{scheme.lower()}://example.com") - for scheme in _ASCII_ALPHA - ), + (f"{_ASCII_ALPHA}://example.com", f"{_ASCII_ALPHA.lower()}://example.com"), ( f"a{SCHEME_NON_FIRST}://example.com", f"a{SCHEME_NON_FIRST.lower()}://example.com", @@ -274,6 +279,9 @@ def test_percent_encode_after_encoding(input, output): ("https://example.com?ñ", "https://example.com?%C3%B1"), # Fragment ("https://example.com#", "https://example.com#"), + ("https://example.com/#", "https://example.com/#"), + ("https://example.com?#", "https://example.com?#"), + ("https://example.com/?#", "https://example.com/?#"), ("https://example.com#a", "https://example.com#a"), ( f"a://example.com#{FRAGMENT_SAFE}", @@ -283,6 +291,7 @@ def test_percent_encode_after_encoding(input, output): f"a://example.com#{FRAGMENT_TO_ENCODE}", f"a://example.com#{FRAGMENT_ENCODED}", ), + ("https://example.com#ñ", "https://example.com#%C3%B1"), ) @@ -366,10 +375,36 @@ def test_safe_url_string_encoding(encoding, url, output): "http://192.168.0.256", # Invalid IP address "http://192.168.0.0.0", # Invalid IP address / domain name "http://[2a01:5cc0:1:2:3:4]", # Invalid IPv6 - # Does not convert \\ to / + # Does not convert \ to / "https://example.com\\a", "https://example.com\\a\\b", - "https://example.com/a/b", # Encodes the last / + # Encodes \ and / after the first one in the path + "https://example.com/a/b", + "https://example.com/a\\b", + # Some path characters that RFC 2396 and RFC 3986 require escaping (%[]|) + # are not escaped. + f"https://example.com/{PATH_TO_ENCODE}", + # ? is removed + "https://example.com?", + "https://example.com/?", + # Some query characters that RFC 2396 and RFC 3986 require escaping (%[]|) + # are not escaped. + f"a://example.com?{QUERY_TO_ENCODE}", + # Some special query characters that RFC 2396 and RFC 3986 require escaping + # (%[]|) or that the URL living standard requires escaping (') are not + # escaped. + *( + f"{scheme}://example.com?{SPECIAL_QUERY_TO_ENCODE}" + for scheme in _SPECIAL_SCHEMES + ), + # ? and # are removed + "https://example.com#", + "https://example.com/#", + "https://example.com?#", + "https://example.com/?#", + # Some fragment characters that RFC 2396 and RFC 3986 require escaping + # (#%[]|) are not escaped. + f"a://example.com#{FRAGMENT_TO_ENCODE}", } @@ -386,6 +421,20 @@ def test_safe_url_string_url(url, output): _test_safe_url_string(url, output=output) +# If this is ever fixed upstream, decide what to do with our workaround. We +# currently provide a tee Python implementation for PyPy, which we should +# probably stop doing on PyPy versions where the bug is no longer present, but +# we still may want the implementation on other PyPy versions. +@pytest.mark.xfail( + python_implementation() == "PyPy", + reason="https://foss.heptapod.net/pypy/pypy/-/issues/3852", + strict=True, +) +def test_tee(): + iterator1, _ = tee(deque([b""])) + assert isinstance(iterator1, Iterator) + + class UrlTests(unittest.TestCase): def test_safe_url_string(self): # Motoko Kusanagi (Cyborg from Ghost in the Shell) diff --git a/w3lib/_rfc2396.py b/w3lib/_rfc2396.py index 641f3e6d..e4f9a252 100644 --- a/w3lib/_rfc2396.py +++ b/w3lib/_rfc2396.py @@ -17,7 +17,6 @@ - ";" # segment ) _RFC2396_QUERY_PERCENT_ENCODE_SET = ( - _RFC2396_RESERVED_PERCENT_ENCODE_SET - & _RFC2396_UNRESERVED_PERCENT_ENCODE_SET + _RFC2396_RESERVED_PERCENT_ENCODE_SET & _RFC2396_UNRESERVED_PERCENT_ENCODE_SET ) _RFC2396_FRAGMENT_PERCENT_ENCODE_SET = _RFC2396_QUERY_PERCENT_ENCODE_SET diff --git a/w3lib/_rfc3986.py b/w3lib/_rfc3986.py index fc1ee147..c5c46a11 100644 --- a/w3lib/_rfc3986.py +++ b/w3lib/_rfc3986.py @@ -15,15 +15,8 @@ ) - ":" _RFC3986_PCHAR_PERCENT_ENCODE_SET = ( _RFC3986_UNRESERVED_PERCENT_ENCODE_SET - & _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET - - ":@" -) -_RFC3986_PATH_PERCENT_ENCODE_SET = ( - _RFC3986_PCHAR_PERCENT_ENCODE_SET - - "/" -) -_RFC3986_QUERY_PERCENT_ENCODE_SET = ( - _RFC3986_PCHAR_PERCENT_ENCODE_SET - - "/?" + & _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET - ":@" ) +_RFC3986_PATH_PERCENT_ENCODE_SET = _RFC3986_PCHAR_PERCENT_ENCODE_SET - "/" +_RFC3986_QUERY_PERCENT_ENCODE_SET = _RFC3986_PCHAR_PERCENT_ENCODE_SET - "/?" _RFC3986_FRAGMENT_PERCENT_ENCODE_SET = _RFC3986_QUERY_PERCENT_ENCODE_SET diff --git a/w3lib/_url.py b/w3lib/_url.py index 8f7b03db..3c4cc5c3 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -4,9 +4,10 @@ from collections import deque from enum import auto, Enum -from itertools import chain, tee, zip_longest +from itertools import chain, zip_longest from math import floor -from typing import List, Optional, Tuple, Union +from platform import python_implementation +from typing import Iterable, Iterator, List, Optional, Tuple, TypeVar, Union from ._encoding import ( _encode_or_fail, @@ -27,6 +28,30 @@ ) from ._util import _PercentEncodeSet +T = TypeVar("T") + +if python_implementation() != "PyPy": + from itertools import tee # pylint: disable=ungrouped-imports +else: + # https://foss.heptapod.net/pypy/pypy/-/issues/3852 + def tee(__iterable: Iterable[T], __n: int = 2) -> Tuple[Iterator[T], ...]: + it = iter(__iterable) + deques: List[deque] = [deque() for i in range(__n)] + + def gen(mydeque: deque) -> Iterator: + while True: + if not mydeque: # when the local deque is empty + try: + newval = next(it) # fetch a new value and + except StopIteration: + return + for d in deques: # load it to all the deques + d.append(newval) + yield mydeque.popleft() + + return tuple(gen(d) for d in deques) + + _ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { ord(char): None for char in _ASCII_TAB_OR_NEWLINE } @@ -108,9 +133,8 @@ def _shorten_path(url: _URL) -> None: url.path = path[:-1] -def by_threes(iterable): - a, b = tee(iterable) - b, c = tee(iterable) +def by_threes(iterable: deque) -> Iterator: + a, b, c = tee(iterable, 3) next(b, None) next(c, None) next(c, None) @@ -204,7 +228,9 @@ def _parse_ipv6(input: str) -> List[int]: compress = piece_index continue value = length = 0 - while length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT: + while ( + length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT + ): value = value * 0x10 + int(input[pointer], base=16) pointer += 1 length += 1 @@ -462,7 +488,9 @@ def _is_single_dot_path_segment(input: str) -> bool: # Wrapper for _utf_8_percent_encode that ensures that, if percent symbols need # to be escaped, they are escaped in an idempotent way (i.e. if they are # already part of an escape sequence, they are not re-encoded). -def _idempotent_utf_8_percent_encode(*, input: str, pointer: int, encode_set: _PercentEncodeSet) -> str: +def _idempotent_utf_8_percent_encode( + *, input: str, pointer: int, encode_set: _PercentEncodeSet +) -> str: code_point = input[pointer] if code_point == "%" and "%" in encode_set: if ( @@ -660,7 +688,6 @@ def _parse_url( if at_sign_seen: buffer = "%40" + buffer at_sign_seen = True - buffer_length = len(buffer) for i, code_point in enumerate(buffer): if code_point == ":" and not url._password_token_seen: url._password_token_seen = True @@ -821,7 +848,13 @@ def _parse_url( and _is_windows_drive_letter(buffer) ): buffer = buffer[0] + ":" + buffer[2:] - if not url.path and not buffer and c is not None and c in "?#" and input[pointer-1] not in "/\\": + if ( + not url.path + and not buffer + and c is not None + and c in "?#" + and input[pointer - 1] not in "/\\" + ): url._empty_path_slash = False url.path.append(buffer) buffer = "" @@ -884,7 +917,9 @@ def _parse_url( assert isinstance(url.fragment, str) if c is not None: assert isinstance(c, str) - url.fragment += _idempotent_utf_8_percent_encode(input=input, pointer=pointer, encode_set=fragment_percent_encode_set) + url.fragment += _idempotent_utf_8_percent_encode( + input=input, pointer=pointer, encode_set=fragment_percent_encode_set + ) if pointer >= input_length: break From 82f6e66c168fff8f7f065ebaef9a4942e18e477a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 15 Nov 2022 08:28:47 +0100 Subject: [PATCH 09/34] Complete test coverage for safe_url --- tests/test_url.py | 373 ++++++++-------------------------------------- w3lib/_url.py | 31 +++- 2 files changed, 91 insertions(+), 313 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index 82cc56b7..223e3b95 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -62,6 +62,33 @@ def test_percent_encode_after_encoding(input, output): SAFE_URL_ENCODING_CASES = ( (UNSET, "", ValueError), (UNSET, "https://example.com", "https://example.com"), + (UNSET, "https://example.com/©", "https://example.com/%C2%A9"), + # Paths are always UTF-8-encoded. + ("iso-8859-1", "https://example.com/©", "https://example.com/%C2%A9"), + # Queries are UTF-8-encoded if the scheme is not special, ws or wss. + ("iso-8859-1", "a://example.com?©", "a://example.com?%C2%A9"), + *( + ("iso-8859-1", f"{scheme}://example.com?©", f"{scheme}://example.com?%C2%A9") + for scheme in ("ws", "wss") + ), + *( + ("iso-8859-1", f"{scheme}://example.com?©", f"{scheme}://example.com?%A9") + for scheme in _SPECIAL_SCHEMES + if scheme not in {"ws", "wss"} + ), + # Fragments are always UTF-8-encoded. + ("iso-8859-1", "https://example.com#©", "https://example.com#%C2%A9"), +) + +INVALID_SCHEME_FOLLOW_UPS = "".join( + chr(value) + for value in range(0x81) + if ( + chr(value) not in _ASCII_ALPHANUMERIC + and chr(value) not in "+-." + and chr(value) not in _C0_CONTROL_OR_SPACE # stripped + and chr(value) != ":" # separator + ) ) SAFE_URL_URL_INVALID_SCHEME_CASES = tuple( @@ -82,16 +109,7 @@ def test_percent_encode_after_encoding(input, output): ), # The follow-up scheme letters can also be ASCII numbers, plus, hyphen, # or period. - *( - f"a{chr(value)}" - for value in range(0x81) - if ( - chr(value) not in _ASCII_ALPHANUMERIC - and chr(value) not in "+-." - and chr(value) not in _C0_CONTROL_OR_SPACE # stripped - and chr(value) != ":" # separator - ) - ), + f"a{INVALID_SCHEME_FOLLOW_UPS}", ) ) @@ -226,14 +244,26 @@ def test_percent_encode_after_encoding(input, output): ("https://\x80:\x80@example.com", "https://%C2%80:%C2%80@example.com"), # Host ("https://example.com", "https://example.com"), + ("https://.example", ValueError), ("https://\x80.example", ValueError), ("https://%80.example", ValueError), + (f"https://{'a'*63}.example", f"https://{'a'*63}.example"), + (f"https://{'a'*64}.example", ValueError), + ( + f"https://{'a'*63}.{'a'*63}.{'a'*63}.{'a'*53}.example", + f"https://{'a'*63}.{'a'*63}.{'a'*63}.{'a'*53}.example", + ), + (f"https://{'a'*63}.{'a'*63}.{'a'*63}.{'a'*54}.example", ValueError), ("https://ñ.example", "https://xn--ida.example"), ("http://192.168.0.0", "http://192.168.0.0"), ("http://192.168.0.256", ValueError), ("http://192.168.0.0.0", ValueError), ("http://[2a01:5cc0:1:2::4]", "http://[2a01:5cc0:1:2::4]"), ("http://[2a01:5cc0:1:2:3:4]", ValueError), + # Port + ("https://example.com:", "https://example.com:"), + ("https://example.com:1", "https://example.com:1"), + ("https://example.com:443", "https://example.com:443"), # Path ("https://example.com/", "https://example.com/"), ("https://example.com/a", "https://example.com/a"), @@ -248,6 +278,7 @@ def test_percent_encode_after_encoding(input, output): f"https://example.com/{PATH_ENCODED}", ), ("https://example.com/ñ", "https://example.com/%C3%B1"), + ("https://example.com/ñ%C3%B1", "https://example.com/%C3%B1%C3%B1"), # Query ("https://example.com?", "https://example.com?"), ("https://example.com/?", "https://example.com/?"), @@ -277,6 +308,7 @@ def test_percent_encode_after_encoding(input, output): for scheme in _SPECIAL_SCHEMES ), ("https://example.com?ñ", "https://example.com?%C3%B1"), + ("https://example.com?ñ%C3%B1", "https://example.com?%C3%B1%C3%B1"), # Fragment ("https://example.com#", "https://example.com#"), ("https://example.com/#", "https://example.com/#"), @@ -292,6 +324,12 @@ def test_percent_encode_after_encoding(input, output): f"a://example.com#{FRAGMENT_ENCODED}", ), ("https://example.com#ñ", "https://example.com#%C3%B1"), + ("https://example.com#ñ%C3%B1", "https://example.com#%C3%B1%C3%B1"), + # All fields, UTF-8 wherever possible. + ( + "https://ñ:ñ@ñ.example:1/ñ?ñ#ñ", + "https://%C3%B1:%C3%B1@xn--ida.example:1/%C3%B1?%C3%B1#%C3%B1", + ), ) @@ -342,6 +380,13 @@ def _test_safe_url_string(url, *, encoding=UNSET, output): KNOWN_SAFE_URL_STRING_ENCODING_ISSUES = { (UNSET, ""), # Invalid URL + # UTF-8 encoding is not enforced in non-special URLs, or in URLs with the + # ws or wss schemas. + ("iso-8859-1", "a://example.com?\xa9"), + ("iso-8859-1", "ws://example.com?\xa9"), + ("iso-8859-1", "wss://example.com?\xa9"), + # UTF-8 encoding is not enforced on the fragment. + ("iso-8859-1", "https://example.com#\xa9"), } @@ -369,12 +414,16 @@ def test_safe_url_string_encoding(encoding, url, output): # are not escaped. f"https://{USERNAME_TO_ENCODE}:{PASSWORD_TO_ENCODE}@example.com", "https://@\\example.com", # Invalid URL - "http://[2a01:5cc0:1:2::4]", # https://github.com/scrapy/w3lib/issues/193 + "https://.example", # Invalid URL "https://\x80.example", # Invalid domain name (non-visible character) "https://%80.example", # Invalid domain name (non-visible character) + f"https://{'a'*64}.example", # Invalid URL + f"https://{'a'*63}.{'a'*63}.{'a'*63}.{'a'*54}.example", # Invalid URL "http://192.168.0.256", # Invalid IP address "http://192.168.0.0.0", # Invalid IP address / domain name + "http://[2a01:5cc0:1:2::4]", # https://github.com/scrapy/w3lib/issues/193 "http://[2a01:5cc0:1:2:3:4]", # Invalid IPv6 + "https://example.com:", # Removes the : # Does not convert \ to / "https://example.com\\a", "https://example.com\\a\\b", @@ -436,121 +485,11 @@ def test_tee(): class UrlTests(unittest.TestCase): - def test_safe_url_string(self): - # Motoko Kusanagi (Cyborg from Ghost in the Shell) - motoko = "\u8349\u8599 \u7d20\u5b50" - self.assertEqual( - safe_url_string(motoko), # note the %20 for space - "%E8%8D%89%E8%96%99%20%E7%B4%A0%E5%AD%90", - ) - self.assertEqual( - safe_url_string(motoko), safe_url_string(safe_url_string(motoko)) - ) - self.assertEqual(safe_url_string("©"), "%C2%A9") # copyright symbol - # page-encoding does not affect URL path - self.assertEqual(safe_url_string("©", "iso-8859-1"), "%C2%A9") - # path_encoding does - self.assertEqual(safe_url_string("©", path_encoding="iso-8859-1"), "%A9") - self.assertEqual( - safe_url_string("http://www.example.org/"), "http://www.example.org/" - ) - - alessi = "/ecommerce/oggetto/Te \xf2/tea-strainer/1273" - - self.assertEqual( - safe_url_string(alessi), "/ecommerce/oggetto/Te%20%C3%B2/tea-strainer/1273" - ) - - self.assertEqual( - safe_url_string( - "http://www.example.com/test?p(29)url(http://www.another.net/page)" - ), - "http://www.example.com/test?p(29)url(http://www.another.net/page)", - ) - self.assertEqual( - safe_url_string( - "http://www.example.com/Brochures_&_Paint_Cards&PageSize=200" - ), - "http://www.example.com/Brochures_&_Paint_Cards&PageSize=200", - ) - - # page-encoding does not affect URL path - # we still end up UTF-8 encoding characters before percent-escaping - safeurl = safe_url_string("http://www.example.com/£") - self.assertTrue(isinstance(safeurl, str)) - self.assertEqual(safeurl, "http://www.example.com/%C2%A3") - - safeurl = safe_url_string("http://www.example.com/£", encoding="utf-8") - self.assertTrue(isinstance(safeurl, str)) - self.assertEqual(safeurl, "http://www.example.com/%C2%A3") - - safeurl = safe_url_string("http://www.example.com/£", encoding="latin-1") - self.assertTrue(isinstance(safeurl, str)) - self.assertEqual(safeurl, "http://www.example.com/%C2%A3") - + def test_safe_url_string_path_encoding(self): safeurl = safe_url_string("http://www.example.com/£", path_encoding="latin-1") self.assertTrue(isinstance(safeurl, str)) self.assertEqual(safeurl, "http://www.example.com/%A3") - self.assertTrue(isinstance(safe_url_string(b"http://example.com/"), str)) - - def test_safe_url_string_remove_ascii_tab_and_newlines(self): - self.assertEqual( - safe_url_string("http://example.com/test\n.html"), - "http://example.com/test.html", - ) - self.assertEqual( - safe_url_string("http://example.com/test\t.html"), - "http://example.com/test.html", - ) - self.assertEqual( - safe_url_string("http://example.com/test\r.html"), - "http://example.com/test.html", - ) - self.assertEqual( - safe_url_string("http://example.com/test\r.html\n"), - "http://example.com/test.html", - ) - self.assertEqual( - safe_url_string("http://example.com/test\r\n.html\t"), - "http://example.com/test.html", - ) - self.assertEqual( - safe_url_string("http://example.com/test\a\n.html"), - "http://example.com/test%07.html", - ) - - def test_safe_url_string_unsafe_chars(self): - safeurl = safe_url_string( - r"http://localhost:8001/unwise{,},|,\,^,[,],`?|=[]&[]=|" - ) - self.assertEqual( - safeurl, r"http://localhost:8001/unwise%7B,%7D,|,%5C,%5E,[,],%60?|=[]&[]=|" - ) - - def test_safe_url_string_quote_path(self): - safeurl = safe_url_string('http://google.com/"hello"', quote_path=True) - self.assertEqual(safeurl, "http://google.com/%22hello%22") - - safeurl = safe_url_string('http://google.com/"hello"', quote_path=False) - self.assertEqual(safeurl, 'http://google.com/"hello"') - - safeurl = safe_url_string('http://google.com/"hello"') - self.assertEqual(safeurl, "http://google.com/%22hello%22") - - def test_safe_url_string_with_query(self): - safeurl = safe_url_string("http://www.example.com/£?unit=µ") - self.assertTrue(isinstance(safeurl, str)) - self.assertEqual(safeurl, "http://www.example.com/%C2%A3?unit=%C2%B5") - - safeurl = safe_url_string("http://www.example.com/£?unit=µ", encoding="utf-8") - self.assertTrue(isinstance(safeurl, str)) - self.assertEqual(safeurl, "http://www.example.com/%C2%A3?unit=%C2%B5") - - safeurl = safe_url_string("http://www.example.com/£?unit=µ", encoding="latin-1") - self.assertTrue(isinstance(safeurl, str)) - self.assertEqual(safeurl, "http://www.example.com/%C2%A3?unit=%B5") - safeurl = safe_url_string( "http://www.example.com/£?unit=µ", path_encoding="latin-1" ) @@ -565,15 +504,9 @@ def test_safe_url_string_with_query(self): self.assertTrue(isinstance(safeurl, str)) self.assertEqual(safeurl, "http://www.example.com/%A3?unit=%B5") - def test_safe_url_string_misc(self): - # mixing Unicode and percent-escaped sequences - safeurl = safe_url_string("http://www.example.com/£?unit=%C2%B5") - self.assertTrue(isinstance(safeurl, str)) - self.assertEqual(safeurl, "http://www.example.com/%C2%A3?unit=%C2%B5") - - safeurl = safe_url_string("http://www.example.com/%C2%A3?unit=µ") - self.assertTrue(isinstance(safeurl, str)) - self.assertEqual(safeurl, "http://www.example.com/%C2%A3?unit=%C2%B5") + def test_safe_url_string_quote_path_false(self): + safeurl = safe_url_string('http://google.com/"hello"', quote_path=False) + self.assertEqual(safeurl, 'http://google.com/"hello"') def test_safe_url_string_bytes_input(self): safeurl = safe_url_string(b"http://www.example.com/") @@ -611,184 +544,6 @@ def test_safe_url_string_bytes_input_nonutf8(self): self.assertTrue(isinstance(safeurl, str)) self.assertEqual(safeurl, "http://www.example.com/country/%D0%EE%F1%F1%E8%FF") - def test_safe_url_idna(self): - # adapted from: - # https://ssl.icu-project.org/icu-bin/idnbrowser - # http://unicode.org/faq/idn.html - # + various others - websites = ( - ( - "http://www.färgbolaget.nu", - "http://www.xn--frgbolaget-q5a.nu", - ), - ( - "http://www.räksmörgås.se", - "http://www.xn--rksmrgs-5wao1o.se", - ), - ( - "http://www.brændendekærlighed.com", - "http://www.xn--brndendekrlighed-vobh.com", - ), - ("http://www.예비교사.com", "http://www.xn--9d0bm53a3xbzui.com"), - ("http://理容ナカムラ.com", "http://xn--lck1c3crb1723bpq4a.com"), - ("http://あーるいん.com", "http://xn--l8je6s7a45b.com"), - # --- real websites --- - # in practice, this redirect (301) to http://www.buecher.de/?q=b%C3%BCcher - ( - "http://www.bücher.de", - "http://www.xn--bcher-kva.de", - ), - # Japanese - ( - "http://はじめよう.みんな", - "http://xn--p8j9a0d9c9a.xn--q9jyb4c", - ), - # Russian - ("http://кто.рф", "http://xn--j1ail.xn--p1ai"), - ( - "http://кто.рф", - "http://xn--j1ail.xn--p1ai", - ), - # Korean - ("http://내도메인.한국", "http://xn--220b31d95hq8o.xn--3e0b707e"), - ( - "http://맨체스터시티축구단.한국", - "http://xn--2e0b17htvgtvj9haj53ccob62ni8d.xn--3e0b707e", - ), - # Arabic - ("http://nic.شبكة", "http://nic.xn--ngbc5azd"), - # Chinese - ("https://www.贷款.在线", "https://www.xn--0kwr83e.xn--3ds443g"), - ("https://www2.xn--0kwr83e.在线", "https://www2.xn--0kwr83e.xn--3ds443g"), - ("https://www3.贷款.xn--3ds443g", "https://www3.xn--0kwr83e.xn--3ds443g"), - ) - for idn_input, safe_result in websites: - safeurl = safe_url_string(idn_input) - self.assertEqual(safeurl, safe_result) - - # make sure the safe URL is unchanged when made safe a 2nd time - for _, safe_result in websites: - safeurl = safe_url_string(safe_result) - self.assertEqual(safeurl, safe_result) - - def test_safe_url_idna_encoding_failure(self): - # missing DNS label - self.assertEqual( - safe_url_string("http://.example.com/résumé?q=résumé"), - "http://.example.com/r%C3%A9sum%C3%A9?q=r%C3%A9sum%C3%A9", - ) - - # DNS label too long - self.assertEqual( - safe_url_string(f"http://www.{'example' * 11}.com/résumé?q=résumé"), - f"http://www.{'example' * 11}.com/r%C3%A9sum%C3%A9?q=r%C3%A9sum%C3%A9", - ) - - def test_safe_url_port_number(self): - self.assertEqual( - safe_url_string("http://www.example.com:80/résumé?q=résumé"), - "http://www.example.com:80/r%C3%A9sum%C3%A9?q=r%C3%A9sum%C3%A9", - ) - self.assertEqual( - safe_url_string("http://www.example.com:/résumé?q=résumé"), - "http://www.example.com/r%C3%A9sum%C3%A9?q=r%C3%A9sum%C3%A9", - ) - - def test_safe_url_string_preserve_nonfragment_hash(self): - # don't decode `%23` to `#` - self.assertEqual( - safe_url_string("http://www.example.com/path/to/%23/foo/bar"), - "http://www.example.com/path/to/%23/foo/bar", - ) - self.assertEqual( - safe_url_string("http://www.example.com/path/to/%23/foo/bar#frag"), - "http://www.example.com/path/to/%23/foo/bar#frag", - ) - self.assertEqual( - safe_url_string( - "http://www.example.com/path/to/%23/foo/bar?url=http%3A%2F%2Fwww.example.com%2Fpath%2Fto%2F%23%2Fbar%2Ffoo" - ), - "http://www.example.com/path/to/%23/foo/bar?url=http%3A%2F%2Fwww.example.com%2Fpath%2Fto%2F%23%2Fbar%2Ffoo", - ) - self.assertEqual( - safe_url_string( - "http://www.example.com/path/to/%23/foo/bar?url=http%3A%2F%2Fwww.example.com%2F%2Fpath%2Fto%2F%23%2Fbar%2Ffoo#frag" - ), - "http://www.example.com/path/to/%23/foo/bar?url=http%3A%2F%2Fwww.example.com%2F%2Fpath%2Fto%2F%23%2Fbar%2Ffoo#frag", - ) - - def test_safe_url_string_encode_idna_domain_with_port(self): - self.assertEqual( - safe_url_string("http://新华网.中国:80"), "http://xn--xkrr14bows.xn--fiqs8s:80" - ) - - def test_safe_url_string_encode_idna_domain_with_username_password_and_port_number( - self, - ): - self.assertEqual( - safe_url_string("ftp://admin:admin@新华网.中国:21"), - "ftp://admin:admin@xn--xkrr14bows.xn--fiqs8s:21", - ) - self.assertEqual( - safe_url_string("http://Åsa:abc123@➡.ws:81/admin"), - "http://%C3%85sa:abc123@xn--hgi.ws:81/admin", - ) - self.assertEqual( - safe_url_string("http://japão:não@️i❤️.ws:8000/"), - "http://jap%C3%A3o:n%C3%A3o@xn--i-7iq.ws:8000/", - ) - - def test_safe_url_string_encode_idna_domain_with_username_and_empty_password_and_port_number( - self, - ): - self.assertEqual( - safe_url_string("ftp://admin:@新华网.中国:21"), - "ftp://admin:@xn--xkrr14bows.xn--fiqs8s:21", - ) - self.assertEqual( - safe_url_string("ftp://admin@新华网.中国:21"), - "ftp://admin@xn--xkrr14bows.xn--fiqs8s:21", - ) - - def test_safe_url_string_userinfo_unsafe_chars( - self, - ): - self.assertEqual( - safe_url_string("ftp://admin:|%@example.com"), - "ftp://admin:%7C%25@example.com", - ) - - def test_safe_url_string_user_and_pass_percentage_encoded(self): - self.assertEqual( - safe_url_string("http://%25user:%25pass@host"), - "http://%25user:%25pass@host", - ) - - self.assertEqual( - safe_url_string("http://%user:%pass@host"), - "http://%25user:%25pass@host", - ) - - self.assertEqual( - safe_url_string("http://%26user:%26pass@host"), - "http://&user:&pass@host", - ) - - self.assertEqual( - safe_url_string("http://%2525user:%2525pass@host"), - "http://%2525user:%2525pass@host", - ) - - self.assertEqual( - safe_url_string("http://%2526user:%2526pass@host"), - "http://%2526user:%2526pass@host", - ) - - self.assertEqual( - safe_url_string("http://%25%26user:%25%26pass@host"), - "http://%25&user:%25&pass@host", - ) - def test_safe_download_url(self): self.assertEqual( safe_download_url("http://www.example.org"), "http://www.example.org/" diff --git a/w3lib/_url.py b/w3lib/_url.py index 3c4cc5c3..520a4523 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -107,10 +107,20 @@ class _URL: # generate a URL that matches the input URL, if desired. _password_token_seen: bool = False + # Indicates, for an empty port component, whether or not a colon (:) + # character was used. This enables :func:`_serialize_url` to + # generate a URL that matches the input URL, if desired. + _port_token_seen: bool = False + + # Indicates whether or not a default port was specified in the input URL. + # This enables :func:`_serialize_url` to generate a URL that matches the + # input URL, if desired. + _default_port_seen: bool = False + # Indicates, for an empty path component, whether or not a slash (/) # character was used. This enables :func:`_serialize_url` to # generate a URL that matches the input URL, if desired. - _empty_path_slash: bool = True + _path_token_seen: bool = False def __init__(self) -> None: self.path = [] @@ -411,7 +421,11 @@ def _parse_ipv4(input: str) -> int: # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser -def _parse_host(input: str, *, is_special: bool = True) -> Union[str, int, List[int]]: +def _parse_host( + input: str, + *, + is_special: bool = True, +) -> Union[str, int, List[int]]: if input.startswith("["): if not input.endswith("]"): raise ValueError @@ -420,6 +434,8 @@ def _parse_host(input: str, *, is_special: bool = True) -> Union[str, int, List[ return _parse_opaque_host(input) domain = _percent_decode_string(input).decode() ascii_domain = domain.encode("idna").decode() + if len(ascii_domain) > 253: + raise ValueError for code_point in ascii_domain: if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: raise ValueError @@ -719,6 +735,7 @@ def _parse_url( url.host = host buffer = "" state = _State.PORT + url._port_token_seen = True elif c is None or c in "/?#" or url.is_special() and c == "\\": pointer -= 1 if url.is_special() and not buffer: @@ -744,6 +761,7 @@ def _parse_url( if port > 2**16 - 1: raise ValueError url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port + url._default_port_seen = url.port is None buffer = "" state = _State.PATH_START pointer -= 1 @@ -855,7 +873,7 @@ def _parse_url( and c in "?#" and input[pointer - 1] not in "/\\" ): - url._empty_path_slash = False + url._path_token_seen = True url.path.append(buffer) buffer = "" if c == "?": @@ -992,7 +1010,7 @@ def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: if url.has_opaque_path(): assert isinstance(url.path, str) return url.path - if len(url.path) <= 1 and not url._empty_path_slash and not canonicalize: + if len(url.path) <= 1 and url._path_token_seen and not canonicalize: return "" output = "" for segment in url.path: @@ -1052,6 +1070,11 @@ def _serialize_url( output += _serialize_host(url.host) if url.port is not None: output += f":{url.port}" + elif not canonicalize: + if url._default_port_seen: + output += f":{_DEFAULT_PORTS[url.scheme]}" + elif url._port_token_seen: + output += ":" elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: output += "/." output += _serialize_url_path(url, canonicalize=canonicalize) From 81fc83098319fbe4fac3968d8169668936f0657e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 15 Nov 2022 13:40:54 +0100 Subject: [PATCH 10/34] Progress on passing upstream tests --- setup.py | 3 + tests/test_url.py | 54 + tests/url-test-data.json | 8615 ++++++++++++++++++++++++++++++++++++++ w3lib/_url.py | 37 +- 4 files changed, 8692 insertions(+), 17 deletions(-) create mode 100644 tests/url-test-data.json diff --git a/setup.py b/setup.py index 7fdb3b1c..fe6a845d 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,9 @@ zip_safe=False, platforms=["Any"], python_requires=">=3.7", + install_requires=[ + "idna", + ], classifiers=[ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: BSD License", diff --git a/tests/test_url.py b/tests/test_url.py index 223e3b95..518f74a9 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -1,8 +1,10 @@ +import json import os import unittest from collections import deque from collections.abc import Iterator from itertools import tee +from pathlib import Path from platform import python_implementation from urllib.parse import urlparse @@ -16,7 +18,9 @@ ) from w3lib._url import ( _C0_CONTROL_PERCENT_ENCODE_SET, + _parse_url, _percent_encode_after_encoding, + _serialize_url, _SPECIAL_SCHEMES, ) from w3lib.url import ( @@ -36,6 +40,56 @@ url_query_cleaner, ) +URL_TEST_DATA_FILE_PATH = Path(__file__).parent / "url-test-data.json" +URL_TEST_DATA_KNOWN_ISSUES = ( + # https://github.com/web-platform-tests/wpt/issues/36970 + "file://example%/", + "file://%43%3A", + "file://%43%7C", + "file://C%7C", + "file://%43%7C/", + "file://\xad/p", + "file://%C2%AD/p", + "file://xn--/p", + # https://github.com/kjd/idna/issues/135 + "http://./", # Empty label error due to VerifyDnsLength=True + "http://../", # Empty label error due to VerifyDnsLength=True + "http://!\"$&'()*+,-.;=_`{}~/", # Hyphen error due to CheckHyphens=True + "wss://!\"$&'()*+,-.;=_`{}~/", # Hyphen error due to CheckHyphens=True + "http://foo.09..", # Empty label error due to VerifyDnsLength=True + # https://github.com/kjd/idna/issues/136 + "ftp://%e2%98%83", + "https://%e2%98%83", +) + + +@pytest.mark.parametrize( + "input,base,failure,href,protocol,username,password,hostname", + ( + case + if case[0] not in URL_TEST_DATA_KNOWN_ISSUES + else pytest.param(*case, marks=pytest.mark.xfail(strict=True)) + for case in ( + (i["input"], i["base"], i.get("failure"), i.get("href"), i.get("protocol"), i.get("username"), i.get("password"), i.get("hostname")) + for i in json.load(open(URL_TEST_DATA_FILE_PATH)) + if not isinstance(i, str) + ) + ), +) +def test_parse_url(input, base, failure, href, protocol, username, password, hostname): + if failure: + with pytest.raises(ValueError): + _parse_url(input, base_url=base) + return + + url = _parse_url(input, base_url=base) + assert url.scheme == (protocol[:-1] if protocol else None) + assert url.username == username + assert url.password == password + assert url.hostname == hostname + # assert _serialize_url(url) == href + # TODO: Cover additional fields + @pytest.mark.parametrize( "input,output", diff --git a/tests/url-test-data.json b/tests/url-test-data.json new file mode 100644 index 00000000..75e0387f --- /dev/null +++ b/tests/url-test-data.json @@ -0,0 +1,8615 @@ +[ + "# Source: https://github.com/web-platform-tests/wpt/blob/master/url/resources/urltestdata.json", + + "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js", + { + "input": "http://example\t.\norg", + "base": "http://example.org/foo/bar", + "href": "http://example.org/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://user:pass@foo:21/bar;par?b#c", + "base": "http://example.org/foo/bar", + "href": "http://user:pass@foo:21/bar;par?b#c", + "origin": "http://foo:21", + "protocol": "http:", + "username": "user", + "password": "pass", + "host": "foo:21", + "hostname": "foo", + "port": "21", + "pathname": "/bar;par", + "search": "?b", + "hash": "#c" + }, + { + "input": "https://test:@test", + "base": "about:blank", + "href": "https://test@test/", + "origin": "https://test", + "protocol": "https:", + "username": "test", + "password": "", + "host": "test", + "hostname": "test", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https://:@test", + "base": "about:blank", + "href": "https://test/", + "origin": "https://test", + "protocol": "https:", + "username": "", + "password": "", + "host": "test", + "hostname": "test", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "non-special://test:@test/x", + "base": "about:blank", + "href": "non-special://test@test/x", + "origin": "null", + "protocol": "non-special:", + "username": "test", + "password": "", + "host": "test", + "hostname": "test", + "port": "", + "pathname": "/x", + "search": "", + "hash": "" + }, + { + "input": "non-special://:@test/x", + "base": "about:blank", + "href": "non-special://test/x", + "origin": "null", + "protocol": "non-special:", + "username": "", + "password": "", + "host": "test", + "hostname": "test", + "port": "", + "pathname": "/x", + "search": "", + "hash": "" + }, + { + "input": "http:foo.com", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/foo.com", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/foo.com", + "search": "", + "hash": "" + }, + { + "input": "\t :foo.com \n", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:foo.com", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:foo.com", + "search": "", + "hash": "" + }, + { + "input": " foo.com ", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/foo.com", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/foo.com", + "search": "", + "hash": "" + }, + { + "input": "a:\t foo.com", + "base": "http://example.org/foo/bar", + "href": "a: foo.com", + "origin": "null", + "protocol": "a:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": " foo.com", + "search": "", + "hash": "" + }, + { + "input": "http://f:21/ b ? d # e ", + "base": "http://example.org/foo/bar", + "href": "http://f:21/%20b%20?%20d%20#%20e", + "origin": "http://f:21", + "protocol": "http:", + "username": "", + "password": "", + "host": "f:21", + "hostname": "f", + "port": "21", + "pathname": "/%20b%20", + "search": "?%20d%20", + "hash": "#%20e" + }, + { + "input": "lolscheme:x x#x x", + "base": "about:blank", + "href": "lolscheme:x x#x%20x", + "protocol": "lolscheme:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "x x", + "search": "", + "hash": "#x%20x" + }, + { + "input": "http://f:/c", + "base": "http://example.org/foo/bar", + "href": "http://f/c", + "origin": "http://f", + "protocol": "http:", + "username": "", + "password": "", + "host": "f", + "hostname": "f", + "port": "", + "pathname": "/c", + "search": "", + "hash": "" + }, + { + "input": "http://f:0/c", + "base": "http://example.org/foo/bar", + "href": "http://f:0/c", + "origin": "http://f:0", + "protocol": "http:", + "username": "", + "password": "", + "host": "f:0", + "hostname": "f", + "port": "0", + "pathname": "/c", + "search": "", + "hash": "" + }, + { + "input": "http://f:00000000000000/c", + "base": "http://example.org/foo/bar", + "href": "http://f:0/c", + "origin": "http://f:0", + "protocol": "http:", + "username": "", + "password": "", + "host": "f:0", + "hostname": "f", + "port": "0", + "pathname": "/c", + "search": "", + "hash": "" + }, + { + "input": "http://f:00000000000000000000080/c", + "base": "http://example.org/foo/bar", + "href": "http://f/c", + "origin": "http://f", + "protocol": "http:", + "username": "", + "password": "", + "host": "f", + "hostname": "f", + "port": "", + "pathname": "/c", + "search": "", + "hash": "" + }, + { + "input": "http://f:b/c", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://f: /c", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://f:\n/c", + "base": "http://example.org/foo/bar", + "href": "http://f/c", + "origin": "http://f", + "protocol": "http:", + "username": "", + "password": "", + "host": "f", + "hostname": "f", + "port": "", + "pathname": "/c", + "search": "", + "hash": "" + }, + { + "input": "http://f:fifty-two/c", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://f:999999/c", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "non-special://f:999999/c", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://f: 21 / b ? d # e ", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "" + }, + { + "input": " \t", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "" + }, + { + "input": ":foo.com/", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:foo.com/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:foo.com/", + "search": "", + "hash": "" + }, + { + "input": ":foo.com\\", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:foo.com/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:foo.com/", + "search": "", + "hash": "" + }, + { + "input": ":", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:", + "search": "", + "hash": "" + }, + { + "input": ":a", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:a", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:a", + "search": "", + "hash": "" + }, + { + "input": ":/", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:/", + "search": "", + "hash": "" + }, + { + "input": ":\\", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:/", + "search": "", + "hash": "" + }, + { + "input": ":#", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:#", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:", + "search": "", + "hash": "" + }, + { + "input": "#", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar#", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "#/", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar#/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "#/" + }, + { + "input": "#\\", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar#\\", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "#\\" + }, + { + "input": "#;?", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar#;?", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "#;?" + }, + { + "input": "?", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar?", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "/", + "base": "http://example.org/foo/bar", + "href": "http://example.org/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": ":23", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:23", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:23", + "search": "", + "hash": "" + }, + { + "input": "/:23", + "base": "http://example.org/foo/bar", + "href": "http://example.org/:23", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/:23", + "search": "", + "hash": "" + }, + { + "input": "\\x", + "base": "http://example.org/foo/bar", + "href": "http://example.org/x", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/x", + "search": "", + "hash": "" + }, + { + "input": "\\\\x\\hello", + "base": "http://example.org/foo/bar", + "href": "http://x/hello", + "origin": "http://x", + "protocol": "http:", + "username": "", + "password": "", + "host": "x", + "hostname": "x", + "port": "", + "pathname": "/hello", + "search": "", + "hash": "" + }, + { + "input": "::", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/::", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/::", + "search": "", + "hash": "" + }, + { + "input": "::23", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/::23", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/::23", + "search": "", + "hash": "" + }, + { + "input": "foo://", + "base": "http://example.org/foo/bar", + "href": "foo://", + "origin": "null", + "protocol": "foo:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "", + "search": "", + "hash": "" + }, + { + "input": "http://a:b@c:29/d", + "base": "http://example.org/foo/bar", + "href": "http://a:b@c:29/d", + "origin": "http://c:29", + "protocol": "http:", + "username": "a", + "password": "b", + "host": "c:29", + "hostname": "c", + "port": "29", + "pathname": "/d", + "search": "", + "hash": "" + }, + { + "input": "http::@c:29", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/:@c:29", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/:@c:29", + "search": "", + "hash": "" + }, + { + "input": "http://&a:foo(b]c@d:2/", + "base": "http://example.org/foo/bar", + "href": "http://&a:foo(b%5Dc@d:2/", + "origin": "http://d:2", + "protocol": "http:", + "username": "&a", + "password": "foo(b%5Dc", + "host": "d:2", + "hostname": "d", + "port": "2", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://::@c@d:2", + "base": "http://example.org/foo/bar", + "href": "http://:%3A%40c@d:2/", + "origin": "http://d:2", + "protocol": "http:", + "username": "", + "password": "%3A%40c", + "host": "d:2", + "hostname": "d", + "port": "2", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://foo.com:b@d/", + "base": "http://example.org/foo/bar", + "href": "http://foo.com:b@d/", + "origin": "http://d", + "protocol": "http:", + "username": "foo.com", + "password": "b", + "host": "d", + "hostname": "d", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://foo.com/\\@", + "base": "http://example.org/foo/bar", + "href": "http://foo.com//@", + "origin": "http://foo.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo.com", + "hostname": "foo.com", + "port": "", + "pathname": "//@", + "search": "", + "hash": "" + }, + { + "input": "http:\\\\foo.com\\", + "base": "http://example.org/foo/bar", + "href": "http://foo.com/", + "origin": "http://foo.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo.com", + "hostname": "foo.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:\\\\a\\b:c\\d@foo.com\\", + "base": "http://example.org/foo/bar", + "href": "http://a/b:c/d@foo.com/", + "origin": "http://a", + "protocol": "http:", + "username": "", + "password": "", + "host": "a", + "hostname": "a", + "port": "", + "pathname": "/b:c/d@foo.com/", + "search": "", + "hash": "" + }, + { + "input": "foo:/", + "base": "http://example.org/foo/bar", + "href": "foo:/", + "origin": "null", + "protocol": "foo:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "foo:/bar.com/", + "base": "http://example.org/foo/bar", + "href": "foo:/bar.com/", + "origin": "null", + "protocol": "foo:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/bar.com/", + "search": "", + "hash": "" + }, + { + "input": "foo://///////", + "base": "http://example.org/foo/bar", + "href": "foo://///////", + "origin": "null", + "protocol": "foo:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "///////", + "search": "", + "hash": "" + }, + { + "input": "foo://///////bar.com/", + "base": "http://example.org/foo/bar", + "href": "foo://///////bar.com/", + "origin": "null", + "protocol": "foo:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "///////bar.com/", + "search": "", + "hash": "" + }, + { + "input": "foo:////://///", + "base": "http://example.org/foo/bar", + "href": "foo:////://///", + "origin": "null", + "protocol": "foo:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//://///", + "search": "", + "hash": "" + }, + { + "input": "c:/foo", + "base": "http://example.org/foo/bar", + "href": "c:/foo", + "origin": "null", + "protocol": "c:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/foo", + "search": "", + "hash": "" + }, + { + "input": "//foo/bar", + "base": "http://example.org/foo/bar", + "href": "http://foo/bar", + "origin": "http://foo", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/bar", + "search": "", + "hash": "" + }, + { + "input": "http://foo/path;a??e#f#g", + "base": "http://example.org/foo/bar", + "href": "http://foo/path;a??e#f#g", + "origin": "http://foo", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/path;a", + "search": "??e", + "hash": "#f#g" + }, + { + "input": "http://foo/abcd?efgh?ijkl", + "base": "http://example.org/foo/bar", + "href": "http://foo/abcd?efgh?ijkl", + "origin": "http://foo", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/abcd", + "search": "?efgh?ijkl", + "hash": "" + }, + { + "input": "http://foo/abcd#foo?bar", + "base": "http://example.org/foo/bar", + "href": "http://foo/abcd#foo?bar", + "origin": "http://foo", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/abcd", + "search": "", + "hash": "#foo?bar" + }, + { + "input": "[61:24:74]:98", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/[61:24:74]:98", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/[61:24:74]:98", + "search": "", + "hash": "" + }, + { + "input": "http:[61:27]/:foo", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/[61:27]/:foo", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/[61:27]/:foo", + "search": "", + "hash": "" + }, + { + "input": "http://[1::2]:3:4", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://2001::1", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://2001::1]", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://2001::1]:80", + "base": "http://example.org/foo/bar", + "failure": true + }, + { + "input": "http://[2001::1]", + "base": "http://example.org/foo/bar", + "href": "http://[2001::1]/", + "origin": "http://[2001::1]", + "protocol": "http:", + "username": "", + "password": "", + "host": "[2001::1]", + "hostname": "[2001::1]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://[::127.0.0.1]", + "base": "http://example.org/foo/bar", + "href": "http://[::7f00:1]/", + "origin": "http://[::7f00:1]", + "protocol": "http:", + "username": "", + "password": "", + "host": "[::7f00:1]", + "hostname": "[::7f00:1]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://[0:0:0:0:0:0:13.1.68.3]", + "base": "http://example.org/foo/bar", + "href": "http://[::d01:4403]/", + "origin": "http://[::d01:4403]", + "protocol": "http:", + "username": "", + "password": "", + "host": "[::d01:4403]", + "hostname": "[::d01:4403]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://[2001::1]:80", + "base": "http://example.org/foo/bar", + "href": "http://[2001::1]/", + "origin": "http://[2001::1]", + "protocol": "http:", + "username": "", + "password": "", + "host": "[2001::1]", + "hostname": "[2001::1]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:/example.com/", + "base": "http://example.org/foo/bar", + "href": "http://example.org/example.com/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "ftp:/example.com/", + "base": "http://example.org/foo/bar", + "href": "ftp://example.com/", + "origin": "ftp://example.com", + "protocol": "ftp:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https:/example.com/", + "base": "http://example.org/foo/bar", + "href": "https://example.com/", + "origin": "https://example.com", + "protocol": "https:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "madeupscheme:/example.com/", + "base": "http://example.org/foo/bar", + "href": "madeupscheme:/example.com/", + "origin": "null", + "protocol": "madeupscheme:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "file:/example.com/", + "base": "http://example.org/foo/bar", + "href": "file:///example.com/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "file://example:1/", + "base": "about:blank", + "failure": true + }, + { + "input": "file://example:test/", + "base": "about:blank", + "failure": true + }, + { + "input": "file://example%/", + "base": "about:blank", + "failure": true + }, + { + "input": "file://[example]/", + "base": "about:blank", + "failure": true + }, + { + "input": "ftps:/example.com/", + "base": "http://example.org/foo/bar", + "href": "ftps:/example.com/", + "origin": "null", + "protocol": "ftps:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "gopher:/example.com/", + "base": "http://example.org/foo/bar", + "href": "gopher:/example.com/", + "origin": "null", + "protocol": "gopher:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "ws:/example.com/", + "base": "http://example.org/foo/bar", + "href": "ws://example.com/", + "origin": "ws://example.com", + "protocol": "ws:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss:/example.com/", + "base": "http://example.org/foo/bar", + "href": "wss://example.com/", + "origin": "wss://example.com", + "protocol": "wss:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "data:/example.com/", + "base": "http://example.org/foo/bar", + "href": "data:/example.com/", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "javascript:/example.com/", + "base": "http://example.org/foo/bar", + "href": "javascript:/example.com/", + "origin": "null", + "protocol": "javascript:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "mailto:/example.com/", + "base": "http://example.org/foo/bar", + "href": "mailto:/example.com/", + "origin": "null", + "protocol": "mailto:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "http:example.com/", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/example.com/", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/example.com/", + "search": "", + "hash": "" + }, + { + "input": "ftp:example.com/", + "base": "http://example.org/foo/bar", + "href": "ftp://example.com/", + "origin": "ftp://example.com", + "protocol": "ftp:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https:example.com/", + "base": "http://example.org/foo/bar", + "href": "https://example.com/", + "origin": "https://example.com", + "protocol": "https:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "madeupscheme:example.com/", + "base": "http://example.org/foo/bar", + "href": "madeupscheme:example.com/", + "origin": "null", + "protocol": "madeupscheme:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "ftps:example.com/", + "base": "http://example.org/foo/bar", + "href": "ftps:example.com/", + "origin": "null", + "protocol": "ftps:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "gopher:example.com/", + "base": "http://example.org/foo/bar", + "href": "gopher:example.com/", + "origin": "null", + "protocol": "gopher:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "ws:example.com/", + "base": "http://example.org/foo/bar", + "href": "ws://example.com/", + "origin": "ws://example.com", + "protocol": "ws:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss:example.com/", + "base": "http://example.org/foo/bar", + "href": "wss://example.com/", + "origin": "wss://example.com", + "protocol": "wss:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "data:example.com/", + "base": "http://example.org/foo/bar", + "href": "data:example.com/", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "javascript:example.com/", + "base": "http://example.org/foo/bar", + "href": "javascript:example.com/", + "origin": "null", + "protocol": "javascript:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "mailto:example.com/", + "base": "http://example.org/foo/bar", + "href": "mailto:example.com/", + "origin": "null", + "protocol": "mailto:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "/a/b/c", + "base": "http://example.org/foo/bar", + "href": "http://example.org/a/b/c", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/a/b/c", + "search": "", + "hash": "" + }, + { + "input": "/a/ /c", + "base": "http://example.org/foo/bar", + "href": "http://example.org/a/%20/c", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/a/%20/c", + "search": "", + "hash": "" + }, + { + "input": "/a%2fc", + "base": "http://example.org/foo/bar", + "href": "http://example.org/a%2fc", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/a%2fc", + "search": "", + "hash": "" + }, + { + "input": "/a/%2f/c", + "base": "http://example.org/foo/bar", + "href": "http://example.org/a/%2f/c", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/a/%2f/c", + "search": "", + "hash": "" + }, + { + "input": "#β", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar#%CE%B2", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "#%CE%B2" + }, + { + "input": "data:text/html,test#test", + "base": "http://example.org/foo/bar", + "href": "data:text/html,test#test", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "text/html,test", + "search": "", + "hash": "#test" + }, + { + "input": "tel:1234567890", + "base": "http://example.org/foo/bar", + "href": "tel:1234567890", + "origin": "null", + "protocol": "tel:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "1234567890", + "search": "", + "hash": "" + }, + "# Based on https://felixfbecker.github.io/whatwg-url-custom-host-repro/", + { + "input": "ssh://example.com/foo/bar.git", + "base": "http://example.org/", + "href": "ssh://example.com/foo/bar.git", + "origin": "null", + "protocol": "ssh:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/bar.git", + "search": "", + "hash": "" + }, + "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html", + { + "input": "file:c:\\foo\\bar.html", + "base": "file:///tmp/mock/path", + "href": "file:///c:/foo/bar.html", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/c:/foo/bar.html", + "search": "", + "hash": "" + }, + { + "input": " File:c|////foo\\bar.html", + "base": "file:///tmp/mock/path", + "href": "file:///c:////foo/bar.html", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/c:////foo/bar.html", + "search": "", + "hash": "" + }, + { + "input": "C|/foo/bar", + "base": "file:///tmp/mock/path", + "href": "file:///C:/foo/bar", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "/C|\\foo\\bar", + "base": "file:///tmp/mock/path", + "href": "file:///C:/foo/bar", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "//C|/foo/bar", + "base": "file:///tmp/mock/path", + "href": "file:///C:/foo/bar", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "//server/file", + "base": "file:///tmp/mock/path", + "href": "file://server/file", + "protocol": "file:", + "username": "", + "password": "", + "host": "server", + "hostname": "server", + "port": "", + "pathname": "/file", + "search": "", + "hash": "" + }, + { + "input": "\\\\server\\file", + "base": "file:///tmp/mock/path", + "href": "file://server/file", + "protocol": "file:", + "username": "", + "password": "", + "host": "server", + "hostname": "server", + "port": "", + "pathname": "/file", + "search": "", + "hash": "" + }, + { + "input": "/\\server/file", + "base": "file:///tmp/mock/path", + "href": "file://server/file", + "protocol": "file:", + "username": "", + "password": "", + "host": "server", + "hostname": "server", + "port": "", + "pathname": "/file", + "search": "", + "hash": "" + }, + { + "input": "file:///foo/bar.txt", + "base": "file:///tmp/mock/path", + "href": "file:///foo/bar.txt", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/foo/bar.txt", + "search": "", + "hash": "" + }, + { + "input": "file:///home/me", + "base": "file:///tmp/mock/path", + "href": "file:///home/me", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/home/me", + "search": "", + "hash": "" + }, + { + "input": "//", + "base": "file:///tmp/mock/path", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "///", + "base": "file:///tmp/mock/path", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "///test", + "base": "file:///tmp/mock/path", + "href": "file:///test", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "", + "hash": "" + }, + { + "input": "file://test", + "base": "file:///tmp/mock/path", + "href": "file://test/", + "protocol": "file:", + "username": "", + "password": "", + "host": "test", + "hostname": "test", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file://localhost", + "base": "file:///tmp/mock/path", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file://localhost/", + "base": "file:///tmp/mock/path", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file://localhost/test", + "base": "file:///tmp/mock/path", + "href": "file:///test", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "", + "hash": "" + }, + { + "input": "test", + "base": "file:///tmp/mock/path", + "href": "file:///tmp/mock/test", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/tmp/mock/test", + "search": "", + "hash": "" + }, + { + "input": "file:test", + "base": "file:///tmp/mock/path", + "href": "file:///tmp/mock/test", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/tmp/mock/test", + "search": "", + "hash": "" + }, + "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js", + { + "input": "http://example.com/././foo", + "base": "about:blank", + "href": "http://example.com/foo", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/./.foo", + "base": "about:blank", + "href": "http://example.com/.foo", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/.foo", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/.", + "base": "about:blank", + "href": "http://example.com/foo/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/./", + "base": "about:blank", + "href": "http://example.com/foo/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/bar/..", + "base": "about:blank", + "href": "http://example.com/foo/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/bar/../", + "base": "about:blank", + "href": "http://example.com/foo/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/..bar", + "base": "about:blank", + "href": "http://example.com/foo/..bar", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/..bar", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/bar/../ton", + "base": "about:blank", + "href": "http://example.com/foo/ton", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/ton", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/bar/../ton/../../a", + "base": "about:blank", + "href": "http://example.com/a", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/a", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/../../..", + "base": "about:blank", + "href": "http://example.com/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/../../../ton", + "base": "about:blank", + "href": "http://example.com/ton", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/ton", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/%2e", + "base": "about:blank", + "href": "http://example.com/foo/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/%2e%2", + "base": "about:blank", + "href": "http://example.com/foo/%2e%2", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/%2e%2", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar", + "base": "about:blank", + "href": "http://example.com/%2e.bar", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%2e.bar", + "search": "", + "hash": "" + }, + { + "input": "http://example.com////../..", + "base": "about:blank", + "href": "http://example.com//", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "//", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/bar//../..", + "base": "about:blank", + "href": "http://example.com/foo/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo/bar//..", + "base": "about:blank", + "href": "http://example.com/foo/bar/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo/bar/", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo", + "base": "about:blank", + "href": "http://example.com/foo", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/%20foo", + "base": "about:blank", + "href": "http://example.com/%20foo", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%20foo", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo%", + "base": "about:blank", + "href": "http://example.com/foo%", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo%", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo%2", + "base": "about:blank", + "href": "http://example.com/foo%2", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo%2", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo%2zbar", + "base": "about:blank", + "href": "http://example.com/foo%2zbar", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo%2zbar", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo%2©zbar", + "base": "about:blank", + "href": "http://example.com/foo%2%C3%82%C2%A9zbar", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo%2%C3%82%C2%A9zbar", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo%41%7a", + "base": "about:blank", + "href": "http://example.com/foo%41%7a", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo%41%7a", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo\t\u0091%91", + "base": "about:blank", + "href": "http://example.com/foo%C2%91%91", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo%C2%91%91", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo%00%51", + "base": "about:blank", + "href": "http://example.com/foo%00%51", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foo%00%51", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/(%28:%3A%29)", + "base": "about:blank", + "href": "http://example.com/(%28:%3A%29)", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/(%28:%3A%29)", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/%3A%3a%3C%3c", + "base": "about:blank", + "href": "http://example.com/%3A%3a%3C%3c", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%3A%3a%3C%3c", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/foo\tbar", + "base": "about:blank", + "href": "http://example.com/foobar", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/foobar", + "search": "", + "hash": "" + }, + { + "input": "http://example.com\\\\foo\\\\bar", + "base": "about:blank", + "href": "http://example.com//foo//bar", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "//foo//bar", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd", + "base": "about:blank", + "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/@asdf%40", + "base": "about:blank", + "href": "http://example.com/@asdf%40", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/@asdf%40", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/你好你好", + "base": "about:blank", + "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/‥/foo", + "base": "about:blank", + "href": "http://example.com/%E2%80%A5/foo", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%E2%80%A5/foo", + "search": "", + "hash": "" + }, + { + "input": "http://example.com//foo", + "base": "about:blank", + "href": "http://example.com/%EF%BB%BF/foo", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%EF%BB%BF/foo", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/‮/foo/‭/bar", + "base": "about:blank", + "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar", + "search": "", + "hash": "" + }, + "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js", + { + "input": "http://www.google.com/foo?bar=baz#", + "base": "about:blank", + "href": "http://www.google.com/foo?bar=baz#", + "origin": "http://www.google.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.google.com", + "hostname": "www.google.com", + "port": "", + "pathname": "/foo", + "search": "?bar=baz", + "hash": "" + }, + { + "input": "http://www.google.com/foo?bar=baz# »", + "base": "about:blank", + "href": "http://www.google.com/foo?bar=baz#%20%C2%BB", + "origin": "http://www.google.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.google.com", + "hostname": "www.google.com", + "port": "", + "pathname": "/foo", + "search": "?bar=baz", + "hash": "#%20%C2%BB" + }, + { + "input": "data:test# »", + "base": "about:blank", + "href": "data:test#%20%C2%BB", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "test", + "search": "", + "hash": "#%20%C2%BB" + }, + { + "input": "http://www.google.com", + "base": "about:blank", + "href": "http://www.google.com/", + "origin": "http://www.google.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.google.com", + "hostname": "www.google.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://192.0x00A80001", + "base": "about:blank", + "href": "http://192.168.0.1/", + "origin": "http://192.168.0.1", + "protocol": "http:", + "username": "", + "password": "", + "host": "192.168.0.1", + "hostname": "192.168.0.1", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://www/foo%2Ehtml", + "base": "about:blank", + "href": "http://www/foo%2Ehtml", + "origin": "http://www", + "protocol": "http:", + "username": "", + "password": "", + "host": "www", + "hostname": "www", + "port": "", + "pathname": "/foo%2Ehtml", + "search": "", + "hash": "" + }, + { + "input": "http://www/foo/%2E/html", + "base": "about:blank", + "href": "http://www/foo/html", + "origin": "http://www", + "protocol": "http:", + "username": "", + "password": "", + "host": "www", + "hostname": "www", + "port": "", + "pathname": "/foo/html", + "search": "", + "hash": "" + }, + { + "input": "http://user:pass@/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://%25DOMAIN:foobar@foodomain.com/", + "base": "about:blank", + "href": "http://%25DOMAIN:foobar@foodomain.com/", + "origin": "http://foodomain.com", + "protocol": "http:", + "username": "%25DOMAIN", + "password": "foobar", + "host": "foodomain.com", + "hostname": "foodomain.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:\\\\www.google.com\\foo", + "base": "about:blank", + "href": "http://www.google.com/foo", + "origin": "http://www.google.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.google.com", + "hostname": "www.google.com", + "port": "", + "pathname": "/foo", + "search": "", + "hash": "" + }, + { + "input": "http://foo:80/", + "base": "about:blank", + "href": "http://foo/", + "origin": "http://foo", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://foo:81/", + "base": "about:blank", + "href": "http://foo:81/", + "origin": "http://foo:81", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo:81", + "hostname": "foo", + "port": "81", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "httpa://foo:80/", + "base": "about:blank", + "href": "httpa://foo:80/", + "origin": "null", + "protocol": "httpa:", + "username": "", + "password": "", + "host": "foo:80", + "hostname": "foo", + "port": "80", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://foo:-80/", + "base": "about:blank", + "failure": true + }, + { + "input": "https://foo:443/", + "base": "about:blank", + "href": "https://foo/", + "origin": "https://foo", + "protocol": "https:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https://foo:80/", + "base": "about:blank", + "href": "https://foo:80/", + "origin": "https://foo:80", + "protocol": "https:", + "username": "", + "password": "", + "host": "foo:80", + "hostname": "foo", + "port": "80", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ftp://foo:21/", + "base": "about:blank", + "href": "ftp://foo/", + "origin": "ftp://foo", + "protocol": "ftp:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ftp://foo:80/", + "base": "about:blank", + "href": "ftp://foo:80/", + "origin": "ftp://foo:80", + "protocol": "ftp:", + "username": "", + "password": "", + "host": "foo:80", + "hostname": "foo", + "port": "80", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "gopher://foo:70/", + "base": "about:blank", + "href": "gopher://foo:70/", + "origin": "null", + "protocol": "gopher:", + "username": "", + "password": "", + "host": "foo:70", + "hostname": "foo", + "port": "70", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "gopher://foo:443/", + "base": "about:blank", + "href": "gopher://foo:443/", + "origin": "null", + "protocol": "gopher:", + "username": "", + "password": "", + "host": "foo:443", + "hostname": "foo", + "port": "443", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ws://foo:80/", + "base": "about:blank", + "href": "ws://foo/", + "origin": "ws://foo", + "protocol": "ws:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ws://foo:81/", + "base": "about:blank", + "href": "ws://foo:81/", + "origin": "ws://foo:81", + "protocol": "ws:", + "username": "", + "password": "", + "host": "foo:81", + "hostname": "foo", + "port": "81", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ws://foo:443/", + "base": "about:blank", + "href": "ws://foo:443/", + "origin": "ws://foo:443", + "protocol": "ws:", + "username": "", + "password": "", + "host": "foo:443", + "hostname": "foo", + "port": "443", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ws://foo:815/", + "base": "about:blank", + "href": "ws://foo:815/", + "origin": "ws://foo:815", + "protocol": "ws:", + "username": "", + "password": "", + "host": "foo:815", + "hostname": "foo", + "port": "815", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss://foo:80/", + "base": "about:blank", + "href": "wss://foo:80/", + "origin": "wss://foo:80", + "protocol": "wss:", + "username": "", + "password": "", + "host": "foo:80", + "hostname": "foo", + "port": "80", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss://foo:81/", + "base": "about:blank", + "href": "wss://foo:81/", + "origin": "wss://foo:81", + "protocol": "wss:", + "username": "", + "password": "", + "host": "foo:81", + "hostname": "foo", + "port": "81", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss://foo:443/", + "base": "about:blank", + "href": "wss://foo/", + "origin": "wss://foo", + "protocol": "wss:", + "username": "", + "password": "", + "host": "foo", + "hostname": "foo", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss://foo:815/", + "base": "about:blank", + "href": "wss://foo:815/", + "origin": "wss://foo:815", + "protocol": "wss:", + "username": "", + "password": "", + "host": "foo:815", + "hostname": "foo", + "port": "815", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:/example.com/", + "base": "about:blank", + "href": "http://example.com/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ftp:/example.com/", + "base": "about:blank", + "href": "ftp://example.com/", + "origin": "ftp://example.com", + "protocol": "ftp:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https:/example.com/", + "base": "about:blank", + "href": "https://example.com/", + "origin": "https://example.com", + "protocol": "https:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "madeupscheme:/example.com/", + "base": "about:blank", + "href": "madeupscheme:/example.com/", + "origin": "null", + "protocol": "madeupscheme:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "file:/example.com/", + "base": "about:blank", + "href": "file:///example.com/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "ftps:/example.com/", + "base": "about:blank", + "href": "ftps:/example.com/", + "origin": "null", + "protocol": "ftps:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "gopher:/example.com/", + "base": "about:blank", + "href": "gopher:/example.com/", + "origin": "null", + "protocol": "gopher:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "ws:/example.com/", + "base": "about:blank", + "href": "ws://example.com/", + "origin": "ws://example.com", + "protocol": "ws:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss:/example.com/", + "base": "about:blank", + "href": "wss://example.com/", + "origin": "wss://example.com", + "protocol": "wss:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "data:/example.com/", + "base": "about:blank", + "href": "data:/example.com/", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "javascript:/example.com/", + "base": "about:blank", + "href": "javascript:/example.com/", + "origin": "null", + "protocol": "javascript:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "mailto:/example.com/", + "base": "about:blank", + "href": "mailto:/example.com/", + "origin": "null", + "protocol": "mailto:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/example.com/", + "search": "", + "hash": "" + }, + { + "input": "http:example.com/", + "base": "about:blank", + "href": "http://example.com/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ftp:example.com/", + "base": "about:blank", + "href": "ftp://example.com/", + "origin": "ftp://example.com", + "protocol": "ftp:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https:example.com/", + "base": "about:blank", + "href": "https://example.com/", + "origin": "https://example.com", + "protocol": "https:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "madeupscheme:example.com/", + "base": "about:blank", + "href": "madeupscheme:example.com/", + "origin": "null", + "protocol": "madeupscheme:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "ftps:example.com/", + "base": "about:blank", + "href": "ftps:example.com/", + "origin": "null", + "protocol": "ftps:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "gopher:example.com/", + "base": "about:blank", + "href": "gopher:example.com/", + "origin": "null", + "protocol": "gopher:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "ws:example.com/", + "base": "about:blank", + "href": "ws://example.com/", + "origin": "ws://example.com", + "protocol": "ws:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "wss:example.com/", + "base": "about:blank", + "href": "wss://example.com/", + "origin": "wss://example.com", + "protocol": "wss:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "data:example.com/", + "base": "about:blank", + "href": "data:example.com/", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "javascript:example.com/", + "base": "about:blank", + "href": "javascript:example.com/", + "origin": "null", + "protocol": "javascript:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + { + "input": "mailto:example.com/", + "base": "about:blank", + "href": "mailto:example.com/", + "origin": "null", + "protocol": "mailto:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "example.com/", + "search": "", + "hash": "" + }, + "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html", + { + "input": "http:@www.example.com", + "base": "about:blank", + "href": "http://www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:/@www.example.com", + "base": "about:blank", + "href": "http://www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://@www.example.com", + "base": "about:blank", + "href": "http://www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:a:b@www.example.com", + "base": "about:blank", + "href": "http://a:b@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "a", + "password": "b", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:/a:b@www.example.com", + "base": "about:blank", + "href": "http://a:b@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "a", + "password": "b", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://a:b@www.example.com", + "base": "about:blank", + "href": "http://a:b@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "a", + "password": "b", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://@pple.com", + "base": "about:blank", + "href": "http://pple.com/", + "origin": "http://pple.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "pple.com", + "hostname": "pple.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http::b@www.example.com", + "base": "about:blank", + "href": "http://:b@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "b", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:/:b@www.example.com", + "base": "about:blank", + "href": "http://:b@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "b", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://:b@www.example.com", + "base": "about:blank", + "href": "http://:b@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "b", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:/:@/www.example.com", + "base": "about:blank", + "failure": true, + "inputCanBeRelative": true + }, + { + "input": "http://user@/www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http:@/www.example.com", + "base": "about:blank", + "failure": true, + "inputCanBeRelative": true + }, + { + "input": "http:/@/www.example.com", + "base": "about:blank", + "failure": true, + "inputCanBeRelative": true + }, + { + "input": "http://@/www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "https:@/www.example.com", + "base": "about:blank", + "failure": true, + "inputCanBeRelative": true + }, + { + "input": "http:a:b@/www.example.com", + "base": "about:blank", + "failure": true, + "inputCanBeRelative": true + }, + { + "input": "http:/a:b@/www.example.com", + "base": "about:blank", + "failure": true, + "inputCanBeRelative": true + }, + { + "input": "http://a:b@/www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http::@/www.example.com", + "base": "about:blank", + "failure": true, + "inputCanBeRelative": true + }, + { + "input": "http:a:@www.example.com", + "base": "about:blank", + "href": "http://a@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "a", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:/a:@www.example.com", + "base": "about:blank", + "href": "http://a@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "a", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://a:@www.example.com", + "base": "about:blank", + "href": "http://a@www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "a", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://www.@pple.com", + "base": "about:blank", + "href": "http://www.@pple.com/", + "origin": "http://pple.com", + "protocol": "http:", + "username": "www.", + "password": "", + "host": "pple.com", + "hostname": "pple.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http:@:www.example.com", + "base": "about:blank", + "failure": true, + "inputCanBeRelative": true + }, + { + "input": "http:/@:www.example.com", + "base": "about:blank", + "failure": true, + "inputCanBeRelative": true + }, + { + "input": "http://@:www.example.com", + "base": "about:blank", + "failure": true + }, + { + "input": "http://:@www.example.com", + "base": "about:blank", + "href": "http://www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "# Others", + { + "input": "/", + "base": "http://www.example.com/test", + "href": "http://www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "/test.txt", + "base": "http://www.example.com/test", + "href": "http://www.example.com/test.txt", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/test.txt", + "search": "", + "hash": "" + }, + { + "input": ".", + "base": "http://www.example.com/test", + "href": "http://www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "..", + "base": "http://www.example.com/test", + "href": "http://www.example.com/", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "test.txt", + "base": "http://www.example.com/test", + "href": "http://www.example.com/test.txt", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/test.txt", + "search": "", + "hash": "" + }, + { + "input": "./test.txt", + "base": "http://www.example.com/test", + "href": "http://www.example.com/test.txt", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/test.txt", + "search": "", + "hash": "" + }, + { + "input": "../test.txt", + "base": "http://www.example.com/test", + "href": "http://www.example.com/test.txt", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/test.txt", + "search": "", + "hash": "" + }, + { + "input": "../aaa/test.txt", + "base": "http://www.example.com/test", + "href": "http://www.example.com/aaa/test.txt", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/aaa/test.txt", + "search": "", + "hash": "" + }, + { + "input": "../../test.txt", + "base": "http://www.example.com/test", + "href": "http://www.example.com/test.txt", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/test.txt", + "search": "", + "hash": "" + }, + { + "input": "中/test.txt", + "base": "http://www.example.com/test", + "href": "http://www.example.com/%E4%B8%AD/test.txt", + "origin": "http://www.example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example.com", + "hostname": "www.example.com", + "port": "", + "pathname": "/%E4%B8%AD/test.txt", + "search": "", + "hash": "" + }, + { + "input": "http://www.example2.com", + "base": "http://www.example.com/test", + "href": "http://www.example2.com/", + "origin": "http://www.example2.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example2.com", + "hostname": "www.example2.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "//www.example2.com", + "base": "http://www.example.com/test", + "href": "http://www.example2.com/", + "origin": "http://www.example2.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.example2.com", + "hostname": "www.example2.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file:...", + "base": "http://www.example.com/test", + "href": "file:///...", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/...", + "search": "", + "hash": "" + }, + { + "input": "file:..", + "base": "http://www.example.com/test", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file:a", + "base": "http://www.example.com/test", + "href": "file:///a", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/a", + "search": "", + "hash": "" + }, + "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html", + "Basic canonicalization, uppercase should be converted to lowercase", + { + "input": "http://ExAmPlE.CoM", + "base": "http://other.com/", + "href": "http://example.com/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://example example.com", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://Goo%20 goo%7C|.com", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://[]", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://[:]", + "base": "http://other.com/", + "failure": true + }, + "U+3000 is mapped to U+0020 (space) which is disallowed", + { + "input": "http://GOO\u00a0\u3000goo.com", + "base": "http://other.com/", + "failure": true + }, + "Other types of space (no-break, zero-width, zero-width-no-break) are name-prepped away to nothing. U+200B, U+2060, and U+FEFF, are ignored", + { + "input": "http://GOO\u200b\u2060\ufeffgoo.com", + "base": "http://other.com/", + "href": "http://googoo.com/", + "origin": "http://googoo.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "googoo.com", + "hostname": "googoo.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Leading and trailing C0 control or space", + { + "input": "\u0000\u001b\u0004\u0012 http://example.com/\u001f \u000d ", + "base": "about:blank", + "href": "http://example.com/", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)", + { + "input": "http://www.foo。bar.com", + "base": "http://other.com/", + "href": "http://www.foo.bar.com/", + "origin": "http://www.foo.bar.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "www.foo.bar.com", + "hostname": "www.foo.bar.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0", + { + "input": "http://\ufdd0zyx.com", + "base": "http://other.com/", + "failure": true + }, + "This is the same as previous but escaped", + { + "input": "http://%ef%b7%90zyx.com", + "base": "http://other.com/", + "failure": true + }, + "U+FFFD", + { + "input": "https://\ufffd", + "base": "about:blank", + "failure": true + }, + { + "input": "https://%EF%BF%BD", + "base": "about:blank", + "failure": true + }, + { + "input": "https://x/\ufffd?\ufffd#\ufffd", + "base": "about:blank", + "href": "https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD", + "origin": "https://x", + "protocol": "https:", + "username": "", + "password": "", + "host": "x", + "hostname": "x", + "port": "", + "pathname": "/%EF%BF%BD", + "search": "?%EF%BF%BD", + "hash": "#%EF%BF%BD" + }, + "Domain is ASCII, but a label is invalid IDNA", + { + "input": "http://a.b.c.xn--pokxncvks", + "base": "about:blank", + "failure": true + }, + { + "input": "http://10.0.0.xn--pokxncvks", + "base": "about:blank", + "failure": true + }, + "IDNA labels should be matched case-insensitively", + { + "input": "http://a.b.c.XN--pokxncvks", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a.b.c.Xn--pokxncvks", + "base": "about:blank", + "failure": true + }, + { + "input": "http://10.0.0.XN--pokxncvks", + "base": "about:blank", + "failure": true + }, + { + "input": "http://10.0.0.xN--pokxncvks", + "base": "about:blank", + "failure": true + }, + "Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.", + { + "input": "http://Go.com", + "base": "http://other.com/", + "href": "http://go.com/", + "origin": "http://go.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "go.com", + "hostname": "go.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257", + { + "input": "http://%41.com", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com", + "base": "http://other.com/", + "failure": true + }, + "...%00 in fullwidth should fail (also as escaped UTF-8 input)", + { + "input": "http://%00.com", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com", + "base": "http://other.com/", + "failure": true + }, + "Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN", + { + "input": "http://你好你好", + "base": "http://other.com/", + "href": "http://xn--6qqa088eba/", + "origin": "http://xn--6qqa088eba", + "protocol": "http:", + "username": "", + "password": "", + "host": "xn--6qqa088eba", + "hostname": "xn--6qqa088eba", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https://faß.ExAmPlE/", + "base": "about:blank", + "href": "https://xn--fa-hia.example/", + "origin": "https://xn--fa-hia.example", + "protocol": "https:", + "username": "", + "password": "", + "host": "xn--fa-hia.example", + "hostname": "xn--fa-hia.example", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "sc://faß.ExAmPlE/", + "base": "about:blank", + "href": "sc://fa%C3%9F.ExAmPlE/", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "fa%C3%9F.ExAmPlE", + "hostname": "fa%C3%9F.ExAmPlE", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191", + { + "input": "http://%zz%66%a.com", + "base": "http://other.com/", + "failure": true + }, + "If we get an invalid character that has been escaped.", + { + "input": "http://%25", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://hello%00", + "base": "http://other.com/", + "failure": true + }, + "Escaped numbers should be treated like IP addresses if they are.", + { + "input": "http://%30%78%63%30%2e%30%32%35%30.01", + "base": "http://other.com/", + "href": "http://192.168.0.1/", + "origin": "http://192.168.0.1", + "protocol": "http:", + "username": "", + "password": "", + "host": "192.168.0.1", + "hostname": "192.168.0.1", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://%30%78%63%30%2e%30%32%35%30.01%2e", + "base": "http://other.com/", + "href": "http://192.168.0.1/", + "origin": "http://192.168.0.1", + "protocol": "http:", + "username": "", + "password": "", + "host": "192.168.0.1", + "hostname": "192.168.0.1", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://192.168.0.257", + "base": "http://other.com/", + "failure": true + }, + "Invalid escaping in hosts causes failure", + { + "input": "http://%3g%78%63%30%2e%30%32%35%30%2E.01", + "base": "http://other.com/", + "failure": true + }, + "A space in a host causes failure", + { + "input": "http://192.168.0.1 hello", + "base": "http://other.com/", + "failure": true + }, + { + "input": "https://x x:12", + "base": "about:blank", + "failure": true + }, + "Fullwidth and escaped UTF-8 fullwidth should still be treated as IP", + { + "input": "http://0Xc0.0250.01", + "base": "http://other.com/", + "href": "http://192.168.0.1/", + "origin": "http://192.168.0.1", + "protocol": "http:", + "username": "", + "password": "", + "host": "192.168.0.1", + "hostname": "192.168.0.1", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Domains with empty labels", + { + "input": "http://./", + "base": "about:blank", + "href": "http://./", + "origin": "http://.", + "protocol": "http:", + "username": "", + "password": "", + "host": ".", + "hostname": ".", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://../", + "base": "about:blank", + "href": "http://../", + "origin": "http://..", + "protocol": "http:", + "username": "", + "password": "", + "host": "..", + "hostname": "..", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Broken IPv6", + { + "input": "http://[www.google.com]/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://[google.com]", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://[::1.2.3.4x]", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://[::1.2.3.]", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://[::1.2.]", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://[::1.]", + "base": "http://other.com/", + "failure": true + }, + "Misc Unicode", + { + "input": "http://foo:💩@example.com/bar", + "base": "http://other.com/", + "href": "http://foo:%F0%9F%92%A9@example.com/bar", + "origin": "http://example.com", + "protocol": "http:", + "username": "foo", + "password": "%F0%9F%92%A9", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/bar", + "search": "", + "hash": "" + }, + "# resolving a fragment against any scheme succeeds", + { + "input": "#", + "base": "test:test", + "href": "test:test#", + "origin": "null", + "protocol": "test:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "test", + "search": "", + "hash": "" + }, + { + "input": "#x", + "base": "mailto:x@x.com", + "href": "mailto:x@x.com#x", + "origin": "null", + "protocol": "mailto:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "x@x.com", + "search": "", + "hash": "#x" + }, + { + "input": "#x", + "base": "data:,", + "href": "data:,#x", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": ",", + "search": "", + "hash": "#x" + }, + { + "input": "#x", + "base": "about:blank", + "href": "about:blank#x", + "origin": "null", + "protocol": "about:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "blank", + "search": "", + "hash": "#x" + }, + { + "input": "#", + "base": "test:test?test", + "href": "test:test?test#", + "origin": "null", + "protocol": "test:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "test", + "search": "?test", + "hash": "" + }, + "# multiple @ in authority state", + { + "input": "https://@test@test@example:800/", + "base": "http://doesnotmatter/", + "href": "https://%40test%40test@example:800/", + "origin": "https://example:800", + "protocol": "https:", + "username": "%40test%40test", + "password": "", + "host": "example:800", + "hostname": "example", + "port": "800", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https://@@@example", + "base": "http://doesnotmatter/", + "href": "https://%40%40@example/", + "origin": "https://example", + "protocol": "https:", + "username": "%40%40", + "password": "", + "host": "example", + "hostname": "example", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "non-az-09 characters", + { + "input": "http://`{}:`{}@h/`{}?`{}", + "base": "http://doesnotmatter/", + "href": "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}", + "origin": "http://h", + "protocol": "http:", + "username": "%60%7B%7D", + "password": "%60%7B%7D", + "host": "h", + "hostname": "h", + "port": "", + "pathname": "/%60%7B%7D", + "search": "?`{}", + "hash": "" + }, + "byte is ' and url is special", + { + "input": "http://host/?'", + "base": "about:blank", + "href": "http://host/?%27", + "origin": "http://host", + "protocol": "http:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/", + "search": "?%27", + "hash": "" + }, + { + "input": "notspecial://host/?'", + "base": "about:blank", + "href": "notspecial://host/?'", + "origin": "null", + "protocol": "notspecial:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/", + "search": "?'", + "hash": "" + }, + "# Credentials in base", + { + "input": "/some/path", + "base": "http://user@example.org/smth", + "href": "http://user@example.org/some/path", + "origin": "http://example.org", + "protocol": "http:", + "username": "user", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/some/path", + "search": "", + "hash": "" + }, + { + "input": "", + "base": "http://user:pass@example.org:21/smth", + "href": "http://user:pass@example.org:21/smth", + "origin": "http://example.org:21", + "protocol": "http:", + "username": "user", + "password": "pass", + "host": "example.org:21", + "hostname": "example.org", + "port": "21", + "pathname": "/smth", + "search": "", + "hash": "" + }, + { + "input": "/some/path", + "base": "http://user:pass@example.org:21/smth", + "href": "http://user:pass@example.org:21/some/path", + "origin": "http://example.org:21", + "protocol": "http:", + "username": "user", + "password": "pass", + "host": "example.org:21", + "hostname": "example.org", + "port": "21", + "pathname": "/some/path", + "search": "", + "hash": "" + }, + "# a set of tests designed by zcorpan for relative URLs with unknown schemes", + { + "input": "i", + "base": "sc:sd", + "failure": true + }, + { + "input": "i", + "base": "sc:sd/sd", + "failure": true + }, + { + "input": "i", + "base": "sc:/pa/pa", + "href": "sc:/pa/i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pa/i", + "search": "", + "hash": "" + }, + { + "input": "i", + "base": "sc://ho/pa", + "href": "sc://ho/i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "ho", + "hostname": "ho", + "port": "", + "pathname": "/i", + "search": "", + "hash": "" + }, + { + "input": "i", + "base": "sc:///pa/pa", + "href": "sc:///pa/i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pa/i", + "search": "", + "hash": "" + }, + { + "input": "../i", + "base": "sc:sd", + "failure": true + }, + { + "input": "../i", + "base": "sc:sd/sd", + "failure": true + }, + { + "input": "../i", + "base": "sc:/pa/pa", + "href": "sc:/i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/i", + "search": "", + "hash": "" + }, + { + "input": "../i", + "base": "sc://ho/pa", + "href": "sc://ho/i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "ho", + "hostname": "ho", + "port": "", + "pathname": "/i", + "search": "", + "hash": "" + }, + { + "input": "../i", + "base": "sc:///pa/pa", + "href": "sc:///i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/i", + "search": "", + "hash": "" + }, + { + "input": "/i", + "base": "sc:sd", + "failure": true + }, + { + "input": "/i", + "base": "sc:sd/sd", + "failure": true + }, + { + "input": "/i", + "base": "sc:/pa/pa", + "href": "sc:/i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/i", + "search": "", + "hash": "" + }, + { + "input": "/i", + "base": "sc://ho/pa", + "href": "sc://ho/i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "ho", + "hostname": "ho", + "port": "", + "pathname": "/i", + "search": "", + "hash": "" + }, + { + "input": "/i", + "base": "sc:///pa/pa", + "href": "sc:///i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/i", + "search": "", + "hash": "" + }, + { + "input": "?i", + "base": "sc:sd", + "failure": true + }, + { + "input": "?i", + "base": "sc:sd/sd", + "failure": true + }, + { + "input": "?i", + "base": "sc:/pa/pa", + "href": "sc:/pa/pa?i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pa/pa", + "search": "?i", + "hash": "" + }, + { + "input": "?i", + "base": "sc://ho/pa", + "href": "sc://ho/pa?i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "ho", + "hostname": "ho", + "port": "", + "pathname": "/pa", + "search": "?i", + "hash": "" + }, + { + "input": "?i", + "base": "sc:///pa/pa", + "href": "sc:///pa/pa?i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pa/pa", + "search": "?i", + "hash": "" + }, + { + "input": "#i", + "base": "sc:sd", + "href": "sc:sd#i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "sd", + "search": "", + "hash": "#i" + }, + { + "input": "#i", + "base": "sc:sd/sd", + "href": "sc:sd/sd#i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "sd/sd", + "search": "", + "hash": "#i" + }, + { + "input": "#i", + "base": "sc:/pa/pa", + "href": "sc:/pa/pa#i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pa/pa", + "search": "", + "hash": "#i" + }, + { + "input": "#i", + "base": "sc://ho/pa", + "href": "sc://ho/pa#i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "ho", + "hostname": "ho", + "port": "", + "pathname": "/pa", + "search": "", + "hash": "#i" + }, + { + "input": "#i", + "base": "sc:///pa/pa", + "href": "sc:///pa/pa#i", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pa/pa", + "search": "", + "hash": "#i" + }, + "# make sure that relative URL logic works on known typically non-relative schemes too", + { + "input": "about:/../", + "base": "about:blank", + "href": "about:/", + "origin": "null", + "protocol": "about:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "data:/../", + "base": "about:blank", + "href": "data:/", + "origin": "null", + "protocol": "data:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "javascript:/../", + "base": "about:blank", + "href": "javascript:/", + "origin": "null", + "protocol": "javascript:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "mailto:/../", + "base": "about:blank", + "href": "mailto:/", + "origin": "null", + "protocol": "mailto:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "# unknown schemes and their hosts", + { + "input": "sc://ñ.test/", + "base": "about:blank", + "href": "sc://%C3%B1.test/", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%C3%B1.test", + "hostname": "%C3%B1.test", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "sc://%/", + "base": "about:blank", + "href": "sc://%/", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%", + "hostname": "%", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "sc://@/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://te@s:t@/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://:/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://:12/", + "base": "about:blank", + "failure": true + }, + { + "input": "x", + "base": "sc://ñ", + "href": "sc://%C3%B1/x", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%C3%B1", + "hostname": "%C3%B1", + "port": "", + "pathname": "/x", + "search": "", + "hash": "" + }, + "# unknown schemes and backslashes", + { + "input": "sc:\\../", + "base": "about:blank", + "href": "sc:\\../", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "\\../", + "search": "", + "hash": "" + }, + "# unknown scheme with path looking like a password", + { + "input": "sc::a@example.net", + "base": "about:blank", + "href": "sc::a@example.net", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": ":a@example.net", + "search": "", + "hash": "" + }, + "# unknown scheme with bogus percent-encoding", + { + "input": "wow:%NBD", + "base": "about:blank", + "href": "wow:%NBD", + "origin": "null", + "protocol": "wow:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "%NBD", + "search": "", + "hash": "" + }, + { + "input": "wow:%1G", + "base": "about:blank", + "href": "wow:%1G", + "origin": "null", + "protocol": "wow:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "%1G", + "search": "", + "hash": "" + }, + "# unknown scheme with non-URL characters", + { + "input": "wow:\uFFFF", + "base": "about:blank", + "href": "wow:%EF%BF%BF", + "origin": "null", + "protocol": "wow:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "%EF%BF%BF", + "search": "", + "hash": "" + }, + { + "input": "http://example.com/\uD800\uD801\uDFFE\uDFFF\uFDD0\uFDCF\uFDEF\uFDF0\uFFFE\uFFFF?\uD800\uD801\uDFFE\uDFFF\uFDD0\uFDCF\uFDEF\uFDF0\uFFFE\uFFFF", + "base": "about:blank", + "href": "http://example.com/%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF?%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF", + "origin": "http://example.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.com", + "hostname": "example.com", + "port": "", + "pathname": "/%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF", + "search": "?%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF", + "hash": "" + }, + "Forbidden host code points", + { + "input": "sc://a\u0000b/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://a b/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://ab", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://a[b/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://a\\b/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://a]b/", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://a^b", + "base": "about:blank", + "failure": true + }, + { + "input": "sc://a|b/", + "base": "about:blank", + "failure": true + }, + "Forbidden host codepoints: tabs and newlines are removed during preprocessing", + { + "input": "foo://ho\u0009st/", + "base": "about:blank", + "hash": "", + "host": "host", + "hostname": "host", + "href":"foo://host/", + "password": "", + "pathname": "/", + "port":"", + "protocol": "foo:", + "search": "", + "username": "" + }, + { + "input": "foo://ho\u000Ast/", + "base": "about:blank", + "hash": "", + "host": "host", + "hostname": "host", + "href":"foo://host/", + "password": "", + "pathname": "/", + "port":"", + "protocol": "foo:", + "search": "", + "username": "" + }, + { + "input": "foo://ho\u000Dst/", + "base": "about:blank", + "hash": "", + "host": "host", + "hostname": "host", + "href":"foo://host/", + "password": "", + "pathname": "/", + "port":"", + "protocol": "foo:", + "search": "", + "username": "" + }, + "Forbidden domain code-points", + { + "input": "http://a\u0000b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0001b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0002b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0003b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0004b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0005b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0006b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0007b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0008b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u000Bb/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u000Cb/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u000Eb/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u000Fb/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0010b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0011b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0012b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0013b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0014b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0015b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0016b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0017b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0018b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u0019b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u001Ab/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u001Bb/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u001Cb/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u001Db/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u001Eb/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u001Fb/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a%b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ab", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a[b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a]b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a^b", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a|b/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a\u007Fb/", + "base": "about:blank", + "failure": true + }, + "Forbidden domain codepoints: tabs and newlines are removed during preprocessing", + { + "input": "http://ho\u0009st/", + "base": "about:blank", + "hash": "", + "host": "host", + "hostname": "host", + "href":"http://host/", + "password": "", + "pathname": "/", + "port":"", + "protocol": "http:", + "search": "", + "username": "" + }, + { + "input": "http://ho\u000Ast/", + "base": "about:blank", + "hash": "", + "host": "host", + "hostname": "host", + "href":"http://host/", + "password": "", + "pathname": "/", + "port":"", + "protocol": "http:", + "search": "", + "username": "" + }, + { + "input": "http://ho\u000Dst/", + "base": "about:blank", + "hash": "", + "host": "host", + "hostname": "host", + "href":"http://host/", + "password": "", + "pathname": "/", + "port":"", + "protocol": "http:", + "search": "", + "username": "" + }, + "Encoded forbidden domain codepoints in special URLs", + { + "input": "http://ho%00st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%01st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%02st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%03st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%04st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%05st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%06st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%07st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%08st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%09st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%0Ast/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%0Bst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%0Cst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%0Dst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%0Est/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%0Fst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%10st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%11st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%12st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%13st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%14st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%15st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%16st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%17st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%18st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%19st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%1Ast/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%1Bst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%1Cst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%1Dst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%1Est/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%1Fst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%20st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%23st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%25st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%2Fst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%3Ast/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%3Cst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%3Est/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%3Fst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%40st/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%5Bst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%5Cst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%5Dst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%7Cst/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://ho%7Fst/", + "base": "about:blank", + "failure": true + }, + "Allowed host/domain code points", + { + "input": "http://!\"$&'()*+,-.;=_`{}~/", + "base": "about:blank", + "href": "http://!\"$&'()*+,-.;=_`{}~/", + "origin": "http://!\"$&'()*+,-.;=_`{}~", + "protocol": "http:", + "username": "", + "password": "", + "host": "!\"$&'()*+,-.;=_`{}~", + "hostname": "!\"$&'()*+,-.;=_`{}~", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "sc://\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u000B\u000C\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F\u007F!\"$%&'()*+,-.;=_`{}~/", + "base": "about:blank", + "href": "sc://%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\"$%&'()*+,-.;=_`{}~/", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\"$%&'()*+,-.;=_`{}~", + "hostname": "%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\"$%&'()*+,-.;=_`{}~", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "# Hosts and percent-encoding", + { + "input": "ftp://example.com%80/", + "base": "about:blank", + "failure": true + }, + { + "input": "ftp://example.com%A0/", + "base": "about:blank", + "failure": true + }, + { + "input": "https://example.com%80/", + "base": "about:blank", + "failure": true + }, + { + "input": "https://example.com%A0/", + "base": "about:blank", + "failure": true + }, + { + "input": "ftp://%e2%98%83", + "base": "about:blank", + "href": "ftp://xn--n3h/", + "origin": "ftp://xn--n3h", + "protocol": "ftp:", + "username": "", + "password": "", + "host": "xn--n3h", + "hostname": "xn--n3h", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "https://%e2%98%83", + "base": "about:blank", + "href": "https://xn--n3h/", + "origin": "https://xn--n3h", + "protocol": "https:", + "username": "", + "password": "", + "host": "xn--n3h", + "hostname": "xn--n3h", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "# tests from jsdom/whatwg-url designed for code coverage", + { + "input": "http://127.0.0.1:10100/relative_import.html", + "base": "about:blank", + "href": "http://127.0.0.1:10100/relative_import.html", + "origin": "http://127.0.0.1:10100", + "protocol": "http:", + "username": "", + "password": "", + "host": "127.0.0.1:10100", + "hostname": "127.0.0.1", + "port": "10100", + "pathname": "/relative_import.html", + "search": "", + "hash": "" + }, + { + "input": "http://facebook.com/?foo=%7B%22abc%22", + "base": "about:blank", + "href": "http://facebook.com/?foo=%7B%22abc%22", + "origin": "http://facebook.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "facebook.com", + "hostname": "facebook.com", + "port": "", + "pathname": "/", + "search": "?foo=%7B%22abc%22", + "hash": "" + }, + { + "input": "https://localhost:3000/jqueryui@1.2.3", + "base": "about:blank", + "href": "https://localhost:3000/jqueryui@1.2.3", + "origin": "https://localhost:3000", + "protocol": "https:", + "username": "", + "password": "", + "host": "localhost:3000", + "hostname": "localhost", + "port": "3000", + "pathname": "/jqueryui@1.2.3", + "search": "", + "hash": "" + }, + "# tab/LF/CR", + { + "input": "h\tt\nt\rp://h\to\ns\rt:9\t0\n0\r0/p\ta\nt\rh?q\tu\ne\rry#f\tr\na\rg", + "base": "about:blank", + "href": "http://host:9000/path?query#frag", + "origin": "http://host:9000", + "protocol": "http:", + "username": "", + "password": "", + "host": "host:9000", + "hostname": "host", + "port": "9000", + "pathname": "/path", + "search": "?query", + "hash": "#frag" + }, + "# Stringification of URL.searchParams", + { + "input": "?a=b&c=d", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar?a=b&c=d", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "?a=b&c=d", + "searchParams": "a=b&c=d", + "hash": "" + }, + { + "input": "??a=b&c=d", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar??a=b&c=d", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "??a=b&c=d", + "searchParams": "%3Fa=b&c=d", + "hash": "" + }, + "# Scheme only", + { + "input": "http:", + "base": "http://example.org/foo/bar", + "href": "http://example.org/foo/bar", + "origin": "http://example.org", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/foo/bar", + "search": "", + "searchParams": "", + "hash": "" + }, + { + "input": "http:", + "base": "https://example.org/foo/bar", + "failure": true + }, + { + "input": "sc:", + "base": "https://example.org/foo/bar", + "href": "sc:", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "", + "search": "", + "searchParams": "", + "hash": "" + }, + "# Percent encoding of fragments", + { + "input": "http://foo.bar/baz?qux#foo\bbar", + "base": "about:blank", + "href": "http://foo.bar/baz?qux#foo%08bar", + "origin": "http://foo.bar", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo.bar", + "hostname": "foo.bar", + "port": "", + "pathname": "/baz", + "search": "?qux", + "searchParams": "qux=", + "hash": "#foo%08bar" + }, + { + "input": "http://foo.bar/baz?qux#foo\"bar", + "base": "about:blank", + "href": "http://foo.bar/baz?qux#foo%22bar", + "origin": "http://foo.bar", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo.bar", + "hostname": "foo.bar", + "port": "", + "pathname": "/baz", + "search": "?qux", + "searchParams": "qux=", + "hash": "#foo%22bar" + }, + { + "input": "http://foo.bar/baz?qux#foobar", + "base": "about:blank", + "href": "http://foo.bar/baz?qux#foo%3Ebar", + "origin": "http://foo.bar", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo.bar", + "hostname": "foo.bar", + "port": "", + "pathname": "/baz", + "search": "?qux", + "searchParams": "qux=", + "hash": "#foo%3Ebar" + }, + { + "input": "http://foo.bar/baz?qux#foo`bar", + "base": "about:blank", + "href": "http://foo.bar/baz?qux#foo%60bar", + "origin": "http://foo.bar", + "protocol": "http:", + "username": "", + "password": "", + "host": "foo.bar", + "hostname": "foo.bar", + "port": "", + "pathname": "/baz", + "search": "?qux", + "searchParams": "qux=", + "hash": "#foo%60bar" + }, + "# IPv4 parsing (via https://github.com/nodejs/node/pull/10317)", + { + "input": "http://1.2.3.4/", + "base": "http://other.com/", + "href": "http://1.2.3.4/", + "origin": "http://1.2.3.4", + "protocol": "http:", + "username": "", + "password": "", + "host": "1.2.3.4", + "hostname": "1.2.3.4", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://1.2.3.4./", + "base": "http://other.com/", + "href": "http://1.2.3.4/", + "origin": "http://1.2.3.4", + "protocol": "http:", + "username": "", + "password": "", + "host": "1.2.3.4", + "hostname": "1.2.3.4", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://192.168.257", + "base": "http://other.com/", + "href": "http://192.168.1.1/", + "origin": "http://192.168.1.1", + "protocol": "http:", + "username": "", + "password": "", + "host": "192.168.1.1", + "hostname": "192.168.1.1", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://192.168.257.", + "base": "http://other.com/", + "href": "http://192.168.1.1/", + "origin": "http://192.168.1.1", + "protocol": "http:", + "username": "", + "password": "", + "host": "192.168.1.1", + "hostname": "192.168.1.1", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://192.168.257.com", + "base": "http://other.com/", + "href": "http://192.168.257.com/", + "origin": "http://192.168.257.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "192.168.257.com", + "hostname": "192.168.257.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://256", + "base": "http://other.com/", + "href": "http://0.0.1.0/", + "origin": "http://0.0.1.0", + "protocol": "http:", + "username": "", + "password": "", + "host": "0.0.1.0", + "hostname": "0.0.1.0", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://256.com", + "base": "http://other.com/", + "href": "http://256.com/", + "origin": "http://256.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "256.com", + "hostname": "256.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://999999999", + "base": "http://other.com/", + "href": "http://59.154.201.255/", + "origin": "http://59.154.201.255", + "protocol": "http:", + "username": "", + "password": "", + "host": "59.154.201.255", + "hostname": "59.154.201.255", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://999999999.", + "base": "http://other.com/", + "href": "http://59.154.201.255/", + "origin": "http://59.154.201.255", + "protocol": "http:", + "username": "", + "password": "", + "host": "59.154.201.255", + "hostname": "59.154.201.255", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://999999999.com", + "base": "http://other.com/", + "href": "http://999999999.com/", + "origin": "http://999999999.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "999999999.com", + "hostname": "999999999.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://10000000000", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://10000000000.com", + "base": "http://other.com/", + "href": "http://10000000000.com/", + "origin": "http://10000000000.com", + "protocol": "http:", + "username": "", + "password": "", + "host": "10000000000.com", + "hostname": "10000000000.com", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://4294967295", + "base": "http://other.com/", + "href": "http://255.255.255.255/", + "origin": "http://255.255.255.255", + "protocol": "http:", + "username": "", + "password": "", + "host": "255.255.255.255", + "hostname": "255.255.255.255", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://4294967296", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://0xffffffff", + "base": "http://other.com/", + "href": "http://255.255.255.255/", + "origin": "http://255.255.255.255", + "protocol": "http:", + "username": "", + "password": "", + "host": "255.255.255.255", + "hostname": "255.255.255.255", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://0xffffffff1", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://256.256.256.256", + "base": "http://other.com/", + "failure": true + }, + { + "input": "https://0x.0x.0", + "base": "about:blank", + "href": "https://0.0.0.0/", + "origin": "https://0.0.0.0", + "protocol": "https:", + "username": "", + "password": "", + "host": "0.0.0.0", + "hostname": "0.0.0.0", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "More IPv4 parsing (via https://github.com/jsdom/whatwg-url/issues/92)", + { + "input": "https://0x100000000/test", + "base": "about:blank", + "failure": true + }, + { + "input": "https://256.0.0.1/test", + "base": "about:blank", + "failure": true + }, + "# file URLs containing percent-encoded Windows drive letters (shouldn't work)", + { + "input": "file:///C%3A/", + "base": "about:blank", + "href": "file:///C%3A/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C%3A/", + "search": "", + "hash": "" + }, + { + "input": "file:///C%7C/", + "base": "about:blank", + "href": "file:///C%7C/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C%7C/", + "search": "", + "hash": "" + }, + { + "input": "file://%43%3A", + "base": "about:blank", + "failure": true + }, + { + "input": "file://%43%7C", + "base": "about:blank", + "failure": true + }, + { + "input": "file://%43|", + "base": "about:blank", + "failure": true + }, + { + "input": "file://C%7C", + "base": "about:blank", + "failure": true + }, + { + "input": "file://%43%7C/", + "base": "about:blank", + "failure": true + }, + { + "input": "https://%43%7C/", + "base": "about:blank", + "failure": true + }, + { + "input": "asdf://%43|/", + "base": "about:blank", + "failure": true + }, + { + "input": "asdf://%43%7C/", + "base": "about:blank", + "href": "asdf://%43%7C/", + "origin": "null", + "protocol": "asdf:", + "username": "", + "password": "", + "host": "%43%7C", + "hostname": "%43%7C", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "# file URLs relative to other file URLs (via https://github.com/jsdom/whatwg-url/pull/60)", + { + "input": "pix/submit.gif", + "base": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html", + "href": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif", + "search": "", + "hash": "" + }, + { + "input": "..", + "base": "file:///C:/", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "..", + "base": "file:///", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "# More file URL tests by zcorpan and annevk", + { + "input": "/", + "base": "file:///C:/a/b", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "/", + "base": "file://h/C:/a/b", + "href": "file://h/C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "h", + "hostname": "h", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "/", + "base": "file://h/a/b", + "href": "file://h/", + "protocol": "file:", + "username": "", + "password": "", + "host": "h", + "hostname": "h", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "//d:", + "base": "file:///C:/a/b", + "href": "file:///d:", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/d:", + "search": "", + "hash": "" + }, + { + "input": "//d:/..", + "base": "file:///C:/a/b", + "href": "file:///d:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/d:/", + "search": "", + "hash": "" + }, + { + "input": "..", + "base": "file:///ab:/", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "..", + "base": "file:///1:/", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "", + "base": "file:///test?test#test", + "href": "file:///test?test", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "?test", + "hash": "" + }, + { + "input": "file:", + "base": "file:///test?test#test", + "href": "file:///test?test", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "?test", + "hash": "" + }, + { + "input": "?x", + "base": "file:///test?test#test", + "href": "file:///test?x", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "?x", + "hash": "" + }, + { + "input": "file:?x", + "base": "file:///test?test#test", + "href": "file:///test?x", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "?x", + "hash": "" + }, + { + "input": "#x", + "base": "file:///test?test#test", + "href": "file:///test?test#x", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "?test", + "hash": "#x" + }, + { + "input": "file:#x", + "base": "file:///test?test#test", + "href": "file:///test?test#x", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "?test", + "hash": "#x" + }, + "# File URLs and many (back)slashes", + { + "input": "file:\\\\//", + "base": "about:blank", + "href": "file:////", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//", + "search": "", + "hash": "" + }, + { + "input": "file:\\\\\\\\", + "base": "about:blank", + "href": "file:////", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//", + "search": "", + "hash": "" + }, + { + "input": "file:\\\\\\\\?fox", + "base": "about:blank", + "href": "file:////?fox", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//", + "search": "?fox", + "hash": "" + }, + { + "input": "file:\\\\\\\\#guppy", + "base": "about:blank", + "href": "file:////#guppy", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//", + "search": "", + "hash": "#guppy" + }, + { + "input": "file://spider///", + "base": "about:blank", + "href": "file://spider///", + "protocol": "file:", + "username": "", + "password": "", + "host": "spider", + "hostname": "spider", + "port": "", + "pathname": "///", + "search": "", + "hash": "" + }, + { + "input": "file:\\\\localhost//", + "base": "about:blank", + "href": "file:////", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//", + "search": "", + "hash": "" + }, + { + "input": "file:///localhost//cat", + "base": "about:blank", + "href": "file:///localhost//cat", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/localhost//cat", + "search": "", + "hash": "" + }, + { + "input": "file://\\/localhost//cat", + "base": "about:blank", + "href": "file:////localhost//cat", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//localhost//cat", + "search": "", + "hash": "" + }, + { + "input": "file://localhost//a//../..//", + "base": "about:blank", + "href": "file://///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "///", + "search": "", + "hash": "" + }, + { + "input": "/////mouse", + "base": "file:///elephant", + "href": "file://///mouse", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "///mouse", + "search": "", + "hash": "" + }, + { + "input": "\\//pig", + "base": "file://lion/", + "href": "file:///pig", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/pig", + "search": "", + "hash": "" + }, + { + "input": "\\/localhost//pig", + "base": "file://lion/", + "href": "file:////pig", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//pig", + "search": "", + "hash": "" + }, + { + "input": "//localhost//pig", + "base": "file://lion/", + "href": "file:////pig", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//pig", + "search": "", + "hash": "" + }, + { + "input": "/..//localhost//pig", + "base": "file://lion/", + "href": "file://lion//localhost//pig", + "protocol": "file:", + "username": "", + "password": "", + "host": "lion", + "hostname": "lion", + "port": "", + "pathname": "//localhost//pig", + "search": "", + "hash": "" + }, + { + "input": "file://", + "base": "file://ape/", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "# File URLs with non-empty hosts", + { + "input": "/rooibos", + "base": "file://tea/", + "href": "file://tea/rooibos", + "protocol": "file:", + "username": "", + "password": "", + "host": "tea", + "hostname": "tea", + "port": "", + "pathname": "/rooibos", + "search": "", + "hash": "" + }, + { + "input": "/?chai", + "base": "file://tea/", + "href": "file://tea/?chai", + "protocol": "file:", + "username": "", + "password": "", + "host": "tea", + "hostname": "tea", + "port": "", + "pathname": "/", + "search": "?chai", + "hash": "" + }, + "# Windows drive letter handling with the 'file:' base URL", + { + "input": "C|", + "base": "file://host/dir/file", + "href": "file://host/C:", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/C:", + "search": "", + "hash": "" + }, + { + "input": "C|", + "base": "file://host/D:/dir1/dir2/file", + "href": "file://host/C:", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/C:", + "search": "", + "hash": "" + }, + { + "input": "C|#", + "base": "file://host/dir/file", + "href": "file://host/C:#", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/C:", + "search": "", + "hash": "" + }, + { + "input": "C|?", + "base": "file://host/dir/file", + "href": "file://host/C:?", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/C:", + "search": "", + "hash": "" + }, + { + "input": "C|/", + "base": "file://host/dir/file", + "href": "file://host/C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "C|\n/", + "base": "file://host/dir/file", + "href": "file://host/C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "C|\\", + "base": "file://host/dir/file", + "href": "file://host/C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "C", + "base": "file://host/dir/file", + "href": "file://host/dir/C", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/dir/C", + "search": "", + "hash": "" + }, + { + "input": "C|a", + "base": "file://host/dir/file", + "href": "file://host/dir/C|a", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/dir/C|a", + "search": "", + "hash": "" + }, + "# Windows drive letter quirk in the file slash state", + { + "input": "/c:/foo/bar", + "base": "file:///c:/baz/qux", + "href": "file:///c:/foo/bar", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/c:/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "/c|/foo/bar", + "base": "file:///c:/baz/qux", + "href": "file:///c:/foo/bar", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/c:/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "file:\\c:\\foo\\bar", + "base": "file:///c:/baz/qux", + "href": "file:///c:/foo/bar", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/c:/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "/c:/foo/bar", + "base": "file://host/path", + "href": "file://host/c:/foo/bar", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/c:/foo/bar", + "search": "", + "hash": "" + }, + "# Do not drop the host in the presence of a drive letter", + { + "input": "file://example.net/C:/", + "base": "about:blank", + "href": "file://example.net/C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "example.net", + "hostname": "example.net", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "file://1.2.3.4/C:/", + "base": "about:blank", + "href": "file://1.2.3.4/C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "1.2.3.4", + "hostname": "1.2.3.4", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "file://[1::8]/C:/", + "base": "about:blank", + "href": "file://[1::8]/C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "[1::8]", + "hostname": "[1::8]", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + "# Copy the host from the base URL in the following cases", + { + "input": "C|/", + "base": "file://host/", + "href": "file://host/C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "/C:/", + "base": "file://host/", + "href": "file://host/C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "file:C:/", + "base": "file://host/", + "href": "file://host/C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "file:/C:/", + "base": "file://host/", + "href": "file://host/C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "host", + "hostname": "host", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + "# Copy the empty host from the input in the following cases", + { + "input": "//C:/", + "base": "file://host/", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "file://C:/", + "base": "file://host/", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "///C:/", + "base": "file://host/", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "file:///C:/", + "base": "file://host/", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + "# Windows drive letter quirk (no host)", + { + "input": "file:/C|/", + "base": "about:blank", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + { + "input": "file://C|/", + "base": "about:blank", + "href": "file:///C:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/C:/", + "search": "", + "hash": "" + }, + "# file URLs without base URL by Rimas Misevičius", + { + "input": "file:", + "base": "about:blank", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "file:?q=v", + "base": "about:blank", + "href": "file:///?q=v", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "?q=v", + "hash": "" + }, + { + "input": "file:#frag", + "base": "about:blank", + "href": "file:///#frag", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "#frag" + }, + "# file: drive letter cases from https://crbug.com/1078698", + { + "input": "file:///Y:", + "base": "about:blank", + "href": "file:///Y:", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/Y:", + "search": "", + "hash": "" + }, + { + "input": "file:///Y:/", + "base": "about:blank", + "href": "file:///Y:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/Y:/", + "search": "", + "hash": "" + }, + { + "input": "file:///./Y", + "base": "about:blank", + "href": "file:///Y", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/Y", + "search": "", + "hash": "" + }, + { + "input": "file:///./Y:", + "base": "about:blank", + "href": "file:///Y:", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/Y:", + "search": "", + "hash": "" + }, + { + "input": "\\\\\\.\\Y:", + "base": "about:blank", + "failure": true, + "inputCanBeRelative": true + }, + "# file: drive letter cases from https://crbug.com/1078698 but lowercased", + { + "input": "file:///y:", + "base": "about:blank", + "href": "file:///y:", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/y:", + "search": "", + "hash": "" + }, + { + "input": "file:///y:/", + "base": "about:blank", + "href": "file:///y:/", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/y:/", + "search": "", + "hash": "" + }, + { + "input": "file:///./y", + "base": "about:blank", + "href": "file:///y", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/y", + "search": "", + "hash": "" + }, + { + "input": "file:///./y:", + "base": "about:blank", + "href": "file:///y:", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/y:", + "search": "", + "hash": "" + }, + { + "input": "\\\\\\.\\y:", + "base": "about:blank", + "failure": true, + "inputCanBeRelative": true + }, + "# Additional file URL tests for (https://github.com/whatwg/url/issues/405)", + { + "input": "file://localhost//a//../..//foo", + "base": "about:blank", + "href": "file://///foo", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "///foo", + "search": "", + "hash": "" + }, + { + "input": "file://localhost////foo", + "base": "about:blank", + "href": "file://////foo", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "////foo", + "search": "", + "hash": "" + }, + { + "input": "file:////foo", + "base": "about:blank", + "href": "file:////foo", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//foo", + "search": "", + "hash": "" + }, + { + "input": "file:///one/two", + "base": "file:///", + "href": "file:///one/two", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/one/two", + "search": "", + "hash": "" + }, + { + "input": "file:////one/two", + "base": "file:///", + "href": "file:////one/two", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//one/two", + "search": "", + "hash": "" + }, + { + "input": "//one/two", + "base": "file:///", + "href": "file://one/two", + "protocol": "file:", + "username": "", + "password": "", + "host": "one", + "hostname": "one", + "port": "", + "pathname": "/two", + "search": "", + "hash": "" + }, + { + "input": "///one/two", + "base": "file:///", + "href": "file:///one/two", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/one/two", + "search": "", + "hash": "" + }, + { + "input": "////one/two", + "base": "file:///", + "href": "file:////one/two", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//one/two", + "search": "", + "hash": "" + }, + { + "input": "file:///.//", + "base": "file:////", + "href": "file:////", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//", + "search": "", + "hash": "" + }, + "File URL tests for https://github.com/whatwg/url/issues/549", + { + "input": "file:.//p", + "base": "about:blank", + "href": "file:////p", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//p", + "search": "", + "hash": "" + }, + { + "input": "file:/.//p", + "base": "about:blank", + "href": "file:////p", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//p", + "search": "", + "hash": "" + }, + "# IPv6 tests", + { + "input": "http://[1:0::]", + "base": "http://example.net/", + "href": "http://[1::]/", + "origin": "http://[1::]", + "protocol": "http:", + "username": "", + "password": "", + "host": "[1::]", + "hostname": "[1::]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://[0:1:2:3:4:5:6:7:8]", + "base": "http://example.net/", + "failure": true + }, + { + "input": "https://[0::0::0]", + "base": "about:blank", + "failure": true + }, + { + "input": "https://[0:.0]", + "base": "about:blank", + "failure": true + }, + { + "input": "https://[0:0:]", + "base": "about:blank", + "failure": true + }, + { + "input": "https://[0:1:2:3:4:5:6:7.0.0.0.1]", + "base": "about:blank", + "failure": true + }, + { + "input": "https://[0:1.00.0.0.0]", + "base": "about:blank", + "failure": true + }, + { + "input": "https://[0:1.290.0.0.0]", + "base": "about:blank", + "failure": true + }, + { + "input": "https://[0:1.23.23]", + "base": "about:blank", + "failure": true + }, + "# Empty host", + { + "input": "http://?", + "base": "about:blank", + "failure": true + }, + { + "input": "http://#", + "base": "about:blank", + "failure": true + }, + "Port overflow (2^32 + 81)", + { + "input": "http://f:4294967377/c", + "base": "http://example.org/", + "failure": true + }, + "Port overflow (2^64 + 81)", + { + "input": "http://f:18446744073709551697/c", + "base": "http://example.org/", + "failure": true + }, + "Port overflow (2^128 + 81)", + { + "input": "http://f:340282366920938463463374607431768211537/c", + "base": "http://example.org/", + "failure": true + }, + "# Non-special-URL path tests", + { + "input": "sc://ñ", + "base": "about:blank", + "href": "sc://%C3%B1", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%C3%B1", + "hostname": "%C3%B1", + "port": "", + "pathname": "", + "search": "", + "hash": "" + }, + { + "input": "sc://ñ?x", + "base": "about:blank", + "href": "sc://%C3%B1?x", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%C3%B1", + "hostname": "%C3%B1", + "port": "", + "pathname": "", + "search": "?x", + "hash": "" + }, + { + "input": "sc://ñ#x", + "base": "about:blank", + "href": "sc://%C3%B1#x", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%C3%B1", + "hostname": "%C3%B1", + "port": "", + "pathname": "", + "search": "", + "hash": "#x" + }, + { + "input": "#x", + "base": "sc://ñ", + "href": "sc://%C3%B1#x", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%C3%B1", + "hostname": "%C3%B1", + "port": "", + "pathname": "", + "search": "", + "hash": "#x" + }, + { + "input": "?x", + "base": "sc://ñ", + "href": "sc://%C3%B1?x", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%C3%B1", + "hostname": "%C3%B1", + "port": "", + "pathname": "", + "search": "?x", + "hash": "" + }, + { + "input": "sc://?", + "base": "about:blank", + "href": "sc://?", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "", + "search": "", + "hash": "" + }, + { + "input": "sc://#", + "base": "about:blank", + "href": "sc://#", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "", + "search": "", + "hash": "" + }, + { + "input": "///", + "base": "sc://x/", + "href": "sc:///", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "////", + "base": "sc://x/", + "href": "sc:////", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//", + "search": "", + "hash": "" + }, + { + "input": "////x/", + "base": "sc://x/", + "href": "sc:////x/", + "protocol": "sc:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//x/", + "search": "", + "hash": "" + }, + { + "input": "tftp://foobar.com/someconfig;mode=netascii", + "base": "about:blank", + "href": "tftp://foobar.com/someconfig;mode=netascii", + "origin": "null", + "protocol": "tftp:", + "username": "", + "password": "", + "host": "foobar.com", + "hostname": "foobar.com", + "port": "", + "pathname": "/someconfig;mode=netascii", + "search": "", + "hash": "" + }, + { + "input": "telnet://user:pass@foobar.com:23/", + "base": "about:blank", + "href": "telnet://user:pass@foobar.com:23/", + "origin": "null", + "protocol": "telnet:", + "username": "user", + "password": "pass", + "host": "foobar.com:23", + "hostname": "foobar.com", + "port": "23", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "ut2004://10.10.10.10:7777/Index.ut2", + "base": "about:blank", + "href": "ut2004://10.10.10.10:7777/Index.ut2", + "origin": "null", + "protocol": "ut2004:", + "username": "", + "password": "", + "host": "10.10.10.10:7777", + "hostname": "10.10.10.10", + "port": "7777", + "pathname": "/Index.ut2", + "search": "", + "hash": "" + }, + { + "input": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz", + "base": "about:blank", + "href": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz", + "origin": "null", + "protocol": "redis:", + "username": "foo", + "password": "bar", + "host": "somehost:6379", + "hostname": "somehost", + "port": "6379", + "pathname": "/0", + "search": "?baz=bam&qux=baz", + "hash": "" + }, + { + "input": "rsync://foo@host:911/sup", + "base": "about:blank", + "href": "rsync://foo@host:911/sup", + "origin": "null", + "protocol": "rsync:", + "username": "foo", + "password": "", + "host": "host:911", + "hostname": "host", + "port": "911", + "pathname": "/sup", + "search": "", + "hash": "" + }, + { + "input": "git://github.com/foo/bar.git", + "base": "about:blank", + "href": "git://github.com/foo/bar.git", + "origin": "null", + "protocol": "git:", + "username": "", + "password": "", + "host": "github.com", + "hostname": "github.com", + "port": "", + "pathname": "/foo/bar.git", + "search": "", + "hash": "" + }, + { + "input": "irc://myserver.com:6999/channel?passwd", + "base": "about:blank", + "href": "irc://myserver.com:6999/channel?passwd", + "origin": "null", + "protocol": "irc:", + "username": "", + "password": "", + "host": "myserver.com:6999", + "hostname": "myserver.com", + "port": "6999", + "pathname": "/channel", + "search": "?passwd", + "hash": "" + }, + { + "input": "dns://fw.example.org:9999/foo.bar.org?type=TXT", + "base": "about:blank", + "href": "dns://fw.example.org:9999/foo.bar.org?type=TXT", + "origin": "null", + "protocol": "dns:", + "username": "", + "password": "", + "host": "fw.example.org:9999", + "hostname": "fw.example.org", + "port": "9999", + "pathname": "/foo.bar.org", + "search": "?type=TXT", + "hash": "" + }, + { + "input": "ldap://localhost:389/ou=People,o=JNDITutorial", + "base": "about:blank", + "href": "ldap://localhost:389/ou=People,o=JNDITutorial", + "origin": "null", + "protocol": "ldap:", + "username": "", + "password": "", + "host": "localhost:389", + "hostname": "localhost", + "port": "389", + "pathname": "/ou=People,o=JNDITutorial", + "search": "", + "hash": "" + }, + { + "input": "git+https://github.com/foo/bar", + "base": "about:blank", + "href": "git+https://github.com/foo/bar", + "origin": "null", + "protocol": "git+https:", + "username": "", + "password": "", + "host": "github.com", + "hostname": "github.com", + "port": "", + "pathname": "/foo/bar", + "search": "", + "hash": "" + }, + { + "input": "urn:ietf:rfc:2648", + "base": "about:blank", + "href": "urn:ietf:rfc:2648", + "origin": "null", + "protocol": "urn:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "ietf:rfc:2648", + "search": "", + "hash": "" + }, + { + "input": "tag:joe@example.org,2001:foo/bar", + "base": "about:blank", + "href": "tag:joe@example.org,2001:foo/bar", + "origin": "null", + "protocol": "tag:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "joe@example.org,2001:foo/bar", + "search": "", + "hash": "" + }, + "Serialize /. in path", + { + "input": "non-spec:/.//", + "base": "about:blank", + "href": "non-spec:/.//", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//", + "search": "", + "hash": "" + }, + { + "input": "non-spec:/..//", + "base": "about:blank", + "href": "non-spec:/.//", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//", + "search": "", + "hash": "" + }, + { + "input": "non-spec:/a/..//", + "base": "about:blank", + "href": "non-spec:/.//", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//", + "search": "", + "hash": "" + }, + { + "input": "non-spec:/.//path", + "base": "about:blank", + "href": "non-spec:/.//path", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//path", + "search": "", + "hash": "" + }, + { + "input": "non-spec:/..//path", + "base": "about:blank", + "href": "non-spec:/.//path", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//path", + "search": "", + "hash": "" + }, + { + "input": "non-spec:/a/..//path", + "base": "about:blank", + "href": "non-spec:/.//path", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//path", + "search": "", + "hash": "" + }, + { + "input": "/.//path", + "base": "non-spec:/p", + "href": "non-spec:/.//path", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//path", + "search": "", + "hash": "" + }, + { + "input": "/..//path", + "base": "non-spec:/p", + "href": "non-spec:/.//path", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//path", + "search": "", + "hash": "" + }, + { + "input": "..//path", + "base": "non-spec:/p", + "href": "non-spec:/.//path", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//path", + "search": "", + "hash": "" + }, + { + "input": "a/..//path", + "base": "non-spec:/p", + "href": "non-spec:/.//path", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//path", + "search": "", + "hash": "" + }, + { + "input": "", + "base": "non-spec:/..//p", + "href": "non-spec:/.//p", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//p", + "search": "", + "hash": "" + }, + { + "input": "path", + "base": "non-spec:/..//p", + "href": "non-spec:/.//path", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "//path", + "search": "", + "hash": "" + }, + "Do not serialize /. in path", + { + "input": "../path", + "base": "non-spec:/.//p", + "href": "non-spec:/path", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/path", + "search": "", + "hash": "" + }, + "# percent encoded hosts in non-special-URLs", + { + "input": "non-special://%E2%80%A0/", + "base": "about:blank", + "href": "non-special://%E2%80%A0/", + "protocol": "non-special:", + "username": "", + "password": "", + "host": "%E2%80%A0", + "hostname": "%E2%80%A0", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "non-special://H%4fSt/path", + "base": "about:blank", + "href": "non-special://H%4fSt/path", + "protocol": "non-special:", + "username": "", + "password": "", + "host": "H%4fSt", + "hostname": "H%4fSt", + "port": "", + "pathname": "/path", + "search": "", + "hash": "" + }, + "# IPv6 in non-special-URLs", + { + "input": "non-special://[1:2:0:0:5:0:0:0]/", + "base": "about:blank", + "href": "non-special://[1:2:0:0:5::]/", + "protocol": "non-special:", + "username": "", + "password": "", + "host": "[1:2:0:0:5::]", + "hostname": "[1:2:0:0:5::]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "non-special://[1:2:0:0:0:0:0:3]/", + "base": "about:blank", + "href": "non-special://[1:2::3]/", + "protocol": "non-special:", + "username": "", + "password": "", + "host": "[1:2::3]", + "hostname": "[1:2::3]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "non-special://[1:2::3]:80/", + "base": "about:blank", + "href": "non-special://[1:2::3]:80/", + "protocol": "non-special:", + "username": "", + "password": "", + "host": "[1:2::3]:80", + "hostname": "[1:2::3]", + "port": "80", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "non-special://[:80/", + "base": "about:blank", + "failure": true + }, + { + "input": "blob:https://example.com:443/", + "base": "about:blank", + "href": "blob:https://example.com:443/", + "origin": "https://example.com", + "protocol": "blob:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "https://example.com:443/", + "search": "", + "hash": "" + }, + { + "input": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf", + "base": "about:blank", + "href": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf", + "origin": "null", + "protocol": "blob:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "d3958f5c-0777-0845-9dcf-2cb28783acaf", + "search": "", + "hash": "" + }, + { + "input": "blob:", + "base": "about:blank", + "href": "blob:", + "origin": "null", + "protocol": "blob:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "", + "search": "", + "hash": "" + }, + "Invalid IPv4 radix digits", + { + "input": "http://0x7f.0.0.0x7g", + "base": "about:blank", + "href": "http://0x7f.0.0.0x7g/", + "protocol": "http:", + "username": "", + "password": "", + "host": "0x7f.0.0.0x7g", + "hostname": "0x7f.0.0.0x7g", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://0X7F.0.0.0X7G", + "base": "about:blank", + "href": "http://0x7f.0.0.0x7g/", + "protocol": "http:", + "username": "", + "password": "", + "host": "0x7f.0.0.0x7g", + "hostname": "0x7f.0.0.0x7g", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Invalid IPv4 portion of IPv6 address", + { + "input": "http://[::127.0.0.0.1]", + "base": "about:blank", + "failure": true + }, + "Uncompressed IPv6 addresses with 0", + { + "input": "http://[0:1:0:1:0:1:0:1]", + "base": "about:blank", + "href": "http://[0:1:0:1:0:1:0:1]/", + "protocol": "http:", + "username": "", + "password": "", + "host": "[0:1:0:1:0:1:0:1]", + "hostname": "[0:1:0:1:0:1:0:1]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "http://[1:0:1:0:1:0:1:0]", + "base": "about:blank", + "href": "http://[1:0:1:0:1:0:1:0]/", + "protocol": "http:", + "username": "", + "password": "", + "host": "[1:0:1:0:1:0:1:0]", + "hostname": "[1:0:1:0:1:0:1:0]", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + "Percent-encoded query and fragment", + { + "input": "http://example.org/test?\u0022", + "base": "about:blank", + "href": "http://example.org/test?%22", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?%22", + "hash": "" + }, + { + "input": "http://example.org/test?\u0023", + "base": "about:blank", + "href": "http://example.org/test?#", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "", + "hash": "" + }, + { + "input": "http://example.org/test?\u003C", + "base": "about:blank", + "href": "http://example.org/test?%3C", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?%3C", + "hash": "" + }, + { + "input": "http://example.org/test?\u003E", + "base": "about:blank", + "href": "http://example.org/test?%3E", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?%3E", + "hash": "" + }, + { + "input": "http://example.org/test?\u2323", + "base": "about:blank", + "href": "http://example.org/test?%E2%8C%A3", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?%E2%8C%A3", + "hash": "" + }, + { + "input": "http://example.org/test?%23%23", + "base": "about:blank", + "href": "http://example.org/test?%23%23", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?%23%23", + "hash": "" + }, + { + "input": "http://example.org/test?%GH", + "base": "about:blank", + "href": "http://example.org/test?%GH", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?%GH", + "hash": "" + }, + { + "input": "http://example.org/test?a#%EF", + "base": "about:blank", + "href": "http://example.org/test?a#%EF", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?a", + "hash": "#%EF" + }, + { + "input": "http://example.org/test?a#%GH", + "base": "about:blank", + "href": "http://example.org/test?a#%GH", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?a", + "hash": "#%GH" + }, + "URLs that require a non-about:blank base. (Also serve as invalid base tests.)", + { + "input": "a", + "base": "about:blank", + "failure": true, + "inputCanBeRelative": true + }, + { + "input": "a/", + "base": "about:blank", + "failure": true, + "inputCanBeRelative": true + }, + { + "input": "a//", + "base": "about:blank", + "failure": true, + "inputCanBeRelative": true + }, + "Bases that don't fail to parse but fail to be bases", + { + "input": "test-a-colon.html", + "base": "a:", + "failure": true + }, + { + "input": "test-a-colon-b.html", + "base": "a:b", + "failure": true + }, + "Other base URL tests, that must succeed", + { + "input": "test-a-colon-slash.html", + "base": "a:/", + "href": "a:/test-a-colon-slash.html", + "protocol": "a:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test-a-colon-slash.html", + "search": "", + "hash": "" + }, + { + "input": "test-a-colon-slash-slash.html", + "base": "a://", + "href": "a:///test-a-colon-slash-slash.html", + "protocol": "a:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test-a-colon-slash-slash.html", + "search": "", + "hash": "" + }, + { + "input": "test-a-colon-slash-b.html", + "base": "a:/b", + "href": "a:/test-a-colon-slash-b.html", + "protocol": "a:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test-a-colon-slash-b.html", + "search": "", + "hash": "" + }, + { + "input": "test-a-colon-slash-slash-b.html", + "base": "a://b", + "href": "a://b/test-a-colon-slash-slash-b.html", + "protocol": "a:", + "username": "", + "password": "", + "host": "b", + "hostname": "b", + "port": "", + "pathname": "/test-a-colon-slash-slash-b.html", + "search": "", + "hash": "" + }, + "Null code point in fragment", + { + "input": "http://example.org/test?a#b\u0000c", + "base": "about:blank", + "href": "http://example.org/test?a#b%00c", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?a", + "hash": "#b%00c" + }, + { + "input": "non-spec://example.org/test?a#b\u0000c", + "base": "about:blank", + "href": "non-spec://example.org/test?a#b%00c", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/test", + "search": "?a", + "hash": "#b%00c" + }, + { + "input": "non-spec:/test?a#b\u0000c", + "base": "about:blank", + "href": "non-spec:/test?a#b%00c", + "protocol": "non-spec:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/test", + "search": "?a", + "hash": "#b%00c" + }, + "First scheme char - not allowed: https://github.com/whatwg/url/issues/464", + { + "input": "10.0.0.7:8080/foo.html", + "base": "file:///some/dir/bar.html", + "href": "file:///some/dir/10.0.0.7:8080/foo.html", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/some/dir/10.0.0.7:8080/foo.html", + "search": "", + "hash": "" + }, + "Subsequent scheme chars - not allowed", + { + "input": "a!@$*=/foo.html", + "base": "file:///some/dir/bar.html", + "href": "file:///some/dir/a!@$*=/foo.html", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/some/dir/a!@$*=/foo.html", + "search": "", + "hash": "" + }, + "First and subsequent scheme chars - allowed", + { + "input": "a1234567890-+.:foo/bar", + "base": "http://example.com/dir/file", + "href": "a1234567890-+.:foo/bar", + "protocol": "a1234567890-+.:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "foo/bar", + "search": "", + "hash": "" + }, + "IDNA ignored code points in file URLs hosts", + { + "input": "file://a\u00ADb/p", + "base": "about:blank", + "href": "file://ab/p", + "protocol": "file:", + "username": "", + "password": "", + "host": "ab", + "hostname": "ab", + "port": "", + "pathname": "/p", + "search": "", + "hash": "" + }, + { + "input": "file://a%C2%ADb/p", + "base": "about:blank", + "href": "file://ab/p", + "protocol": "file:", + "username": "", + "password": "", + "host": "ab", + "hostname": "ab", + "port": "", + "pathname": "/p", + "search": "", + "hash": "" + }, + "Empty host after the domain to ASCII", + { + "input": "file://\u00ad/p", + "base": "about:blank", + "failure": true + }, + { + "input": "file://%C2%AD/p", + "base": "about:blank", + "failure": true + }, + { + "input": "file://xn--/p", + "base": "about:blank", + "failure": true + }, + "https://bugzilla.mozilla.org/show_bug.cgi?id=1647058", + { + "input": "#link", + "base": "https://example.org/##link", + "href": "https://example.org/#link", + "protocol": "https:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/", + "search": "", + "hash": "#link" + }, + "UTF-8 percent-encode of C0 control percent-encode set and supersets", + { + "input": "non-special:cannot-be-a-base-url-\u0000\u0001\u001F\u001E\u007E\u007F\u0080", + "base": "about:blank", + "hash": "", + "host": "", + "hostname": "", + "href": "non-special:cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80", + "origin": "null", + "password": "", + "pathname": "cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80", + "port": "", + "protocol": "non-special:", + "search": "", + "username": "" + }, + { + "input": "https://www.example.com/path{\u007Fpath.html?query'\u007F=query#fragment<\u007Ffragment", + "base": "about:blank", + "hash": "#fragment%3C%7Ffragment", + "host": "www.example.com", + "hostname": "www.example.com", + "href": "https://www.example.com/path%7B%7Fpath.html?query%27%7F=query#fragment%3C%7Ffragment", + "origin": "https://www.example.com", + "password": "", + "pathname": "/path%7B%7Fpath.html", + "port": "", + "protocol": "https:", + "search": "?query%27%7F=query", + "username": "" + }, + { + "input": "https://user:pass[\u007F@foo/bar", + "base": "http://example.org", + "hash": "", + "host": "foo", + "hostname": "foo", + "href": "https://user:pass%5B%7F@foo/bar", + "origin": "https://foo", + "password": "pass%5B%7F", + "pathname": "/bar", + "port": "", + "protocol": "https:", + "search": "", + "username": "user" + }, + "Tests for the distinct percent-encode sets", + { + "input": "foo:// !\"$%&'()*+,-.;<=>@[\\]^_`{|}~@host/", + "base": "about:blank", + "hash": "", + "host": "host", + "hostname": "host", + "href": "foo://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/", + "origin": "null", + "password": "", + "pathname": "/", + "port":"", + "protocol": "foo:", + "search": "", + "username": "%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~" + }, + { + "input": "wss:// !\"$%&'()*+,-.;<=>@[]^_`{|}~@host/", + "base": "about:blank", + "hash": "", + "host": "host", + "hostname": "host", + "href": "wss://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/", + "origin": "wss://host", + "password": "", + "pathname": "/", + "port":"", + "protocol": "wss:", + "search": "", + "username": "%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~" + }, + { + "input": "foo://joe: !\"$%&'()*+,-.:;<=>@[\\]^_`{|}~@host/", + "base": "about:blank", + "hash": "", + "host": "host", + "hostname": "host", + "href": "foo://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/", + "origin": "null", + "password": "%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~", + "pathname": "/", + "port":"", + "protocol": "foo:", + "search": "", + "username": "joe" + }, + { + "input": "wss://joe: !\"$%&'()*+,-.:;<=>@[]^_`{|}~@host/", + "base": "about:blank", + "hash": "", + "host": "host", + "hostname": "host", + "href": "wss://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/", + "origin": "wss://host", + "password": "%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~", + "pathname": "/", + "port":"", + "protocol": "wss:", + "search": "", + "username": "joe" + }, + { + "input": "foo://!\"$%&'()*+,-.;=_`{}~/", + "base": "about:blank", + "hash": "", + "host": "!\"$%&'()*+,-.;=_`{}~", + "hostname": "!\"$%&'()*+,-.;=_`{}~", + "href":"foo://!\"$%&'()*+,-.;=_`{}~/", + "origin": "null", + "password": "", + "pathname": "/", + "port":"", + "protocol": "foo:", + "search": "", + "username": "" + }, + { + "input": "wss://!\"$&'()*+,-.;=_`{}~/", + "base": "about:blank", + "hash": "", + "host": "!\"$&'()*+,-.;=_`{}~", + "hostname": "!\"$&'()*+,-.;=_`{}~", + "href":"wss://!\"$&'()*+,-.;=_`{}~/", + "origin": "wss://!\"$&'()*+,-.;=_`{}~", + "password": "", + "pathname": "/", + "port":"", + "protocol": "wss:", + "search": "", + "username": "" + }, + { + "input": "foo://host/ !\"$%&'()*+,-./:;<=>@[\\]^_`{|}~", + "base": "about:blank", + "hash": "", + "host": "host", + "hostname": "host", + "href": "foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~", + "origin": "null", + "password": "", + "pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~", + "port":"", + "protocol": "foo:", + "search": "", + "username": "" + }, + { + "input": "wss://host/ !\"$%&'()*+,-./:;<=>@[\\]^_`{|}~", + "base": "about:blank", + "hash": "", + "host": "host", + "hostname": "host", + "href": "wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%60%7B|%7D~", + "origin": "wss://host", + "password": "", + "pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%60%7B|%7D~", + "port":"", + "protocol": "wss:", + "search": "", + "username": "" + }, + { + "input": "foo://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~", + "base": "about:blank", + "hash": "", + "host": "host", + "hostname": "host", + "href": "foo://host/dir/?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~", + "origin": "null", + "password": "", + "pathname": "/dir/", + "port":"", + "protocol": "foo:", + "search": "?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~", + "username": "" + }, + { + "input": "wss://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~", + "base": "about:blank", + "hash": "", + "host": "host", + "hostname": "host", + "href": "wss://host/dir/?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~", + "origin": "wss://host", + "password": "", + "pathname": "/dir/", + "port":"", + "protocol": "wss:", + "search": "?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~", + "username": "" + }, + { + "input": "foo://host/dir/# !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", + "base": "about:blank", + "hash": "#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~", + "host": "host", + "hostname": "host", + "href": "foo://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~", + "origin": "null", + "password": "", + "pathname": "/dir/", + "port":"", + "protocol": "foo:", + "search": "", + "username": "" + }, + { + "input": "wss://host/dir/# !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", + "base": "about:blank", + "hash": "#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~", + "host": "host", + "hostname": "host", + "href": "wss://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~", + "origin": "wss://host", + "password": "", + "pathname": "/dir/", + "port":"", + "protocol": "wss:", + "search": "", + "username": "" + }, + "Ensure that input schemes are not ignored when resolving non-special URLs", + { + "input": "abc:rootless", + "base": "abc://host/path", + "hash": "", + "host": "", + "hostname": "", + "href":"abc:rootless", + "password": "", + "pathname": "rootless", + "port":"", + "protocol": "abc:", + "search": "", + "username": "" + }, + { + "input": "abc:rootless", + "base": "abc:/path", + "hash": "", + "host": "", + "hostname": "", + "href":"abc:rootless", + "password": "", + "pathname": "rootless", + "port":"", + "protocol": "abc:", + "search": "", + "username": "" + }, + { + "input": "abc:rootless", + "base": "abc:path", + "hash": "", + "host": "", + "hostname": "", + "href":"abc:rootless", + "password": "", + "pathname": "rootless", + "port":"", + "protocol": "abc:", + "search": "", + "username": "" + }, + { + "input": "abc:/rooted", + "base": "abc://host/path", + "hash": "", + "host": "", + "hostname": "", + "href":"abc:/rooted", + "password": "", + "pathname": "/rooted", + "port":"", + "protocol": "abc:", + "search": "", + "username": "" + }, + "Empty query and fragment with blank should throw an error", + { + "input": "#", + "base": null, + "failure": true + }, + { + "input": "?", + "base": null, + "failure": true + }, + "Last component looks like a number, but not valid IPv4", + { + "input": "http://1.2.3.4.5", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://1.2.3.4.5.", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://0..0x300/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://0..0x300./", + "base": "about:blank", + "failure": true + }, + { + "input": "http://256.256.256.256.256", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://256.256.256.256.256.", + "base": "http://other.com/", + "failure": true + }, + { + "input": "http://1.2.3.08", + "base": "about:blank", + "failure": true + }, + { + "input": "http://1.2.3.08.", + "base": "about:blank", + "failure": true + }, + { + "input": "http://1.2.3.09", + "base": "about:blank", + "failure": true + }, + { + "input": "http://09.2.3.4", + "base": "about:blank", + "failure": true + }, + { + "input": "http://09.2.3.4.", + "base": "about:blank", + "failure": true + }, + { + "input": "http://01.2.3.4.5", + "base": "about:blank", + "failure": true + }, + { + "input": "http://01.2.3.4.5.", + "base": "about:blank", + "failure": true + }, + { + "input": "http://0x100.2.3.4", + "base": "about:blank", + "failure": true + }, + { + "input": "http://0x100.2.3.4.", + "base": "about:blank", + "failure": true + }, + { + "input": "http://0x1.2.3.4.5", + "base": "about:blank", + "failure": true + }, + { + "input": "http://0x1.2.3.4.5.", + "base": "about:blank", + "failure": true + }, + { + "input": "http://foo.1.2.3.4", + "base": "about:blank", + "failure": true + }, + { + "input": "http://foo.1.2.3.4.", + "base": "about:blank", + "failure": true + }, + { + "input": "http://foo.2.3.4", + "base": "about:blank", + "failure": true + }, + { + "input": "http://foo.2.3.4.", + "base": "about:blank", + "failure": true + }, + { + "input": "http://foo.09", + "base": "about:blank", + "failure": true + }, + { + "input": "http://foo.09.", + "base": "about:blank", + "failure": true + }, + { + "input": "http://foo.0x4", + "base": "about:blank", + "failure": true + }, + { + "input": "http://foo.0x4.", + "base": "about:blank", + "failure": true + }, + { + "input": "http://foo.09..", + "base": "about:blank", + "hash": "", + "host": "foo.09..", + "hostname": "foo.09..", + "href":"http://foo.09../", + "password": "", + "pathname": "/", + "port":"", + "protocol": "http:", + "search": "", + "username": "" + }, + { + "input": "http://0999999999999999999/", + "base": "about:blank", + "failure": true + }, + { + "input": "http://foo.0x", + "base": "about:blank", + "failure": true + }, + { + "input": "http://foo.0XFfFfFfFfFfFfFfFfFfAcE123", + "base": "about:blank", + "failure": true + }, + { + "input": "http://💩.123/", + "base": "about:blank", + "failure": true + } + ] \ No newline at end of file diff --git a/w3lib/_url.py b/w3lib/_url.py index 520a4523..5248b4ab 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -9,6 +9,8 @@ from platform import python_implementation from typing import Iterable, Iterator, List, Optional, Tuple, TypeVar, Union +import idna + from ._encoding import ( _encode_or_fail, _get_encoder, @@ -96,7 +98,7 @@ class _URL: scheme: str = "" username: str = "" password: str = "" - host: Union[None, int, List[int], str] = None + hostname: Union[None, int, List[int], str] = None port: Optional[int] = None path: Union[str, List[str]] query: Optional[str] = None @@ -433,7 +435,9 @@ def _parse_host( if not is_special: return _parse_opaque_host(input) domain = _percent_decode_string(input).decode() - ascii_domain = domain.encode("idna").decode() + be_strict = False + ascii_domain_bytes = idna.encode(domain, strict=True, uts46=True, std3_rules=be_strict) + ascii_domain = ascii_domain_bytes.decode() if len(ascii_domain) > 253: raise ValueError for code_point in ascii_domain: @@ -600,7 +604,7 @@ def _parse_url( state = _State.SPECIAL_RELATIVE_OR_AUTHORITY else: state = _State.SPECIAL_AUTHORITY_SLASHES - elif input[pointer + 1] == "/": + elif pointer + 1 < len(input) and input[pointer + 1] == "/": state = _State.PATH_OR_AUTHORITY pointer += 1 else: @@ -630,7 +634,7 @@ def _parse_url( pointer -= 1 elif state == _State.SPECIAL_RELATIVE_OR_AUTHORITY: - if c == "/" and input[pointer + 1 : 1] == "/": + if c == "/" and input[pointer + 1] == "/": state = _State.SPECIAL_AUTHORITY_IGNORE_SLASHES pointer += 1 else: @@ -654,7 +658,7 @@ def _parse_url( else: url.username = base.username url.password = base.password - url.host = base.host + url.hostname = base.hostname url.port = base.port url.path = base.path url.query = base.query @@ -680,7 +684,7 @@ def _parse_url( else: url.username = base.username url.password = base.password - url.host = base.host + url.hostname = base.hostname url.port = base.port state = _State.PATH pointer -= 1 @@ -694,8 +698,7 @@ def _parse_url( pointer -= 1 elif state == _State.SPECIAL_AUTHORITY_IGNORE_SLASHES: - if c is not None and c not in "/\\": - assert isinstance(c, str) + if c is None or c not in "/\\": state = _State.AUTHORITY pointer -= 1 @@ -732,7 +735,7 @@ def _parse_url( if not buffer: raise ValueError host = _parse_host(buffer, is_special=url.is_special()) - url.host = host + url.hostname = host buffer = "" state = _State.PORT url._port_token_seen = True @@ -741,7 +744,7 @@ def _parse_url( if url.is_special() and not buffer: raise ValueError host = _parse_host(buffer, is_special=url.is_special()) - url.host = host + url.hostname = host buffer = "" state = _State.PATH_START else: @@ -770,12 +773,12 @@ def _parse_url( elif state == _State.FILE: url.scheme = "file" - url.host = "" + url.hostname = "" if c is not None and c in "/\\": assert isinstance(c, str) state = _State.FILE_SLASH elif base is not None and base.scheme == "file": - url.host = base.host + url.hostname = base.hostname url.path = base.path url.query = base.query if c == "?": @@ -804,7 +807,7 @@ def _parse_url( state = _State.FILE_HOST else: if base is not None and base.scheme == "file": - url.host = base.host + url.hostname = base.hostname if not _starts_with_windows_drive_letter( input[pointer:] ) and _is_windows_drive_letter(base.path[0]): @@ -818,13 +821,13 @@ def _parse_url( if _is_windows_drive_letter(buffer): state = _State.PATH elif not buffer: - url.host = "" + url.hostname = "" state = _State.PATH_START else: host = _parse_host(buffer, is_special=False) if host == "localhost": host = "" - url.host = host + url.hostname = host buffer = "" state = _State.PATH_START else: @@ -1058,7 +1061,7 @@ def _serialize_url( string. """ output = url.scheme + ":" - if url.host is not None: + if url.hostname is not None: output += "//" if url.username or url.password: output += url.username @@ -1067,7 +1070,7 @@ def _serialize_url( elif not canonicalize and url._password_token_seen: output += ":" output += "@" - output += _serialize_host(url.host) + output += _serialize_host(url.hostname) if url.port is not None: output += f":{url.port}" elif not canonicalize: From 7e72474eada00afcc87c9d1650a450fc796d6d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Wed, 16 Nov 2022 12:25:53 +0100 Subject: [PATCH 11/34] Solve issues previously marked as expected failures --- tests/test_url.py | 59 +- w3lib/_rfc5892.py | 16 + w3lib/_url.py | 30 +- w3lib/_utr46.py | 301 ++ w3lib/idna.txt | 9028 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 9395 insertions(+), 39 deletions(-) create mode 100644 w3lib/_rfc5892.py create mode 100644 w3lib/_utr46.py create mode 100644 w3lib/idna.txt diff --git a/tests/test_url.py b/tests/test_url.py index 518f74a9..9c5f27c6 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -20,7 +20,7 @@ _C0_CONTROL_PERCENT_ENCODE_SET, _parse_url, _percent_encode_after_encoding, - _serialize_url, + # _serialize_url, _SPECIAL_SCHEMES, ) from w3lib.url import ( @@ -41,26 +41,10 @@ ) URL_TEST_DATA_FILE_PATH = Path(__file__).parent / "url-test-data.json" -URL_TEST_DATA_KNOWN_ISSUES = ( - # https://github.com/web-platform-tests/wpt/issues/36970 - "file://example%/", - "file://%43%3A", - "file://%43%7C", - "file://C%7C", - "file://%43%7C/", - "file://\xad/p", - "file://%C2%AD/p", - "file://xn--/p", - # https://github.com/kjd/idna/issues/135 - "http://./", # Empty label error due to VerifyDnsLength=True - "http://../", # Empty label error due to VerifyDnsLength=True - "http://!\"$&'()*+,-.;=_`{}~/", # Hyphen error due to CheckHyphens=True - "wss://!\"$&'()*+,-.;=_`{}~/", # Hyphen error due to CheckHyphens=True - "http://foo.09..", # Empty label error due to VerifyDnsLength=True - # https://github.com/kjd/idna/issues/136 - "ftp://%e2%98%83", - "https://%e2%98%83", -) +URL_TEST_DATA_KNOWN_ISSUES = () + +with open(URL_TEST_DATA_FILE_PATH, encoding="utf-8") as input: + URL_TEST_DATA = json.load(input) @pytest.mark.parametrize( @@ -70,8 +54,17 @@ if case[0] not in URL_TEST_DATA_KNOWN_ISSUES else pytest.param(*case, marks=pytest.mark.xfail(strict=True)) for case in ( - (i["input"], i["base"], i.get("failure"), i.get("href"), i.get("protocol"), i.get("username"), i.get("password"), i.get("hostname")) - for i in json.load(open(URL_TEST_DATA_FILE_PATH)) + ( + i["input"], + i["base"], + i.get("failure"), + i.get("href"), + i.get("protocol"), + i.get("username"), + i.get("password"), + i.get("hostname"), + ) + for i in URL_TEST_DATA if not isinstance(i, str) ) ), @@ -86,9 +79,9 @@ def test_parse_url(input, base, failure, href, protocol, username, password, hos assert url.scheme == (protocol[:-1] if protocol else None) assert url.username == username assert url.password == password - assert url.hostname == hostname - # assert _serialize_url(url) == href + # assert url.hostname == hostname # TODO: Cover additional fields + # assert _serialize_url(url) == href @pytest.mark.parametrize( @@ -298,16 +291,23 @@ def test_percent_encode_after_encoding(input, output): ("https://\x80:\x80@example.com", "https://%C2%80:%C2%80@example.com"), # Host ("https://example.com", "https://example.com"), - ("https://.example", ValueError), + ("https://.example", "https://.example"), ("https://\x80.example", ValueError), ("https://%80.example", ValueError), + # The 4 cases below test before and after crossing DNS length limits on + # domain name labels (63 characters) and the domain name as a whole (253 + # characters). However, all cases are expected to pass because the URL + # living standard does not require domain names to be within these limits. (f"https://{'a'*63}.example", f"https://{'a'*63}.example"), - (f"https://{'a'*64}.example", ValueError), + (f"https://{'a'*64}.example", f"https://{'a'*64}.example"), ( f"https://{'a'*63}.{'a'*63}.{'a'*63}.{'a'*53}.example", f"https://{'a'*63}.{'a'*63}.{'a'*63}.{'a'*53}.example", ), - (f"https://{'a'*63}.{'a'*63}.{'a'*63}.{'a'*54}.example", ValueError), + ( + f"https://{'a'*63}.{'a'*63}.{'a'*63}.{'a'*54}.example", + f"https://{'a'*63}.{'a'*63}.{'a'*63}.{'a'*54}.example", + ), ("https://ñ.example", "https://xn--ida.example"), ("http://192.168.0.0", "http://192.168.0.0"), ("http://192.168.0.256", ValueError), @@ -468,11 +468,8 @@ def test_safe_url_string_encoding(encoding, url, output): # are not escaped. f"https://{USERNAME_TO_ENCODE}:{PASSWORD_TO_ENCODE}@example.com", "https://@\\example.com", # Invalid URL - "https://.example", # Invalid URL "https://\x80.example", # Invalid domain name (non-visible character) "https://%80.example", # Invalid domain name (non-visible character) - f"https://{'a'*64}.example", # Invalid URL - f"https://{'a'*63}.{'a'*63}.{'a'*63}.{'a'*54}.example", # Invalid URL "http://192.168.0.256", # Invalid IP address "http://192.168.0.0.0", # Invalid IP address / domain name "http://[2a01:5cc0:1:2::4]", # https://github.com/scrapy/w3lib/issues/193 diff --git a/w3lib/_rfc5892.py b/w3lib/_rfc5892.py new file mode 100644 index 00000000..869455b0 --- /dev/null +++ b/w3lib/_rfc5892.py @@ -0,0 +1,16 @@ +# https://www.rfc-editor.org/rfc/rfc5892.txt + +from idna import intranges_contain, valid_contextj +from idna.idnadata import codepoint_classes + + +def _check_contextj_rules(label: str) -> None: + for i, code_point in enumerate(label): + value = ord(code_point) + if not intranges_contain(value, codepoint_classes["CONTEXTJ"]): + continue + if valid_contextj(label, i): + continue + raise ValueError( + f"Joiner U+{value:04X} not allowed at position {i+1} in {label!r}" + ) diff --git a/w3lib/_url.py b/w3lib/_url.py index 5248b4ab..32e848ee 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -9,8 +9,7 @@ from platform import python_implementation from typing import Iterable, Iterator, List, Optional, Tuple, TypeVar, Union -import idna - +from . import _utr46 from ._encoding import ( _encode_or_fail, _get_encoder, @@ -422,6 +421,25 @@ def _parse_ipv4(input: str) -> int: return ipv4 +# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii +def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: + result = _utr46._to_ascii( + domain, + use_std3_ascii_rules=be_strict, + check_hyphens=False, + check_bidi=True, + check_joiners=True, + transitional_processing=False, + verify_dns_length=be_strict, + ) + if not result: + raise ValueError( + f"Domain name {domain!r} is an empty string after conversion to " + f"ASCII, which makes for an invalid domain name." + ) + return result + + # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser def _parse_host( input: str, @@ -435,11 +453,7 @@ def _parse_host( if not is_special: return _parse_opaque_host(input) domain = _percent_decode_string(input).decode() - be_strict = False - ascii_domain_bytes = idna.encode(domain, strict=True, uts46=True, std3_rules=be_strict) - ascii_domain = ascii_domain_bytes.decode() - if len(ascii_domain) > 253: - raise ValueError + ascii_domain = _domain_to_ascii(domain) for code_point in ascii_domain: if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: raise ValueError @@ -824,7 +838,7 @@ def _parse_url( url.hostname = "" state = _State.PATH_START else: - host = _parse_host(buffer, is_special=False) + host = _parse_host(buffer, is_special=url.is_special()) if host == "localhost": host = "" url.hostname = host diff --git a/w3lib/_utr46.py b/w3lib/_utr46.py new file mode 100644 index 00000000..8d729635 --- /dev/null +++ b/w3lib/_utr46.py @@ -0,0 +1,301 @@ +# https://www.unicode.org/reports/tr46/ + +import re +import unicodedata +from enum import auto, Enum +from pathlib import Path +from typing import Dict, Match, Optional, Type + +from ._rfc5892 import _check_contextj_rules +from idna import check_bidi as _check_bidi + + +if hasattr(unicodedata, "is_normalized"): + _is_normalized = unicodedata.is_normalized +else: + + def _is_normalized(form: str, unistr: str) -> bool: + return unicodedata.normalize(form, unistr) == unistr + + +class _Status(Enum): + DISALLOWED = auto() + DISALLOWED_STD3_MAPPED = auto() + DISALLOWED_STD3_VALID = auto() + IGNORED = auto() + MAPPED = auto() + DEVIATION = auto() + VALID = auto() + + +class _Entry: # pylint: disable=too-few-public-methods + @classmethod + def from_match(cls: Type["_Entry"], match: Match) -> "_Entry": + if match["status"] == "disallowed": + status = _Status.DISALLOWED + elif match["status"] == "disallowed_STD3_mapped": + status = _Status.DISALLOWED_STD3_MAPPED + elif match["status"] == "disallowed_STD3_valid": + status = _Status.DISALLOWED_STD3_VALID + elif match["status"] == "ignored": + status = _Status.IGNORED + elif match["status"] == "mapped": + status = _Status.MAPPED + elif match["status"] == "deviation": + status = _Status.DEVIATION + elif match["status"] == "valid": + status = _Status.VALID + else: + raise ValueError( + f"Unknown IDNA mapping table status value found: " + f"{match['status']!r}" + ) + if match["mapping"] is None: + mapping = None + else: + mapping = "".join( + chr(int(value, base=16)) for value in match["mapping"].split(" ") + ) + return cls( + mapping=mapping, + status=status, + ) + + def __init__(self: "_Entry", *, mapping: Optional[str], status: _Status) -> None: + self.mapping = mapping + self.status = status + + +def _load_idna_mapping_table() -> Dict[str, _Entry]: + file_name = Path(__file__).parent / "idna.txt" + pattern = r"""(?x) + ^ + (?: + (?P[0-9A-F]{4,6}) + |(?P[0-9A-F]{4,6})\.\.(?P[0-9A-F]{4,6}) + ) + \s*;\s* + (?P + disallowed(?:_STD3_(?:mapped|valid))? + |ignored + |mapped + |deviation + |valid + ) + (?: + \s*;\s* + (?P + [0-9A-F]{4,6} + (\s[0-9A-F]{4,6})* + ) + )? + """ + mapping = {} + with open(file_name, encoding="utf-8") as input: + for line in input: + if line.startswith("#") or not line.strip(): + continue + match = re.search(pattern, line) + if not match: + raise ValueError( + f"Line {line!r} from {file_name} does not match the " + f"expected pattern." + ) + entry = _Entry.from_match(match) + if match["id"] is not None: + code_point = chr(int(match["id"], base=16)) + mapping[code_point] = entry + continue + start = int(match["start"], base=16) + end = int(match["end"], base=16) + for id in range(start, end + 1): + code_point = chr(id) + mapping[code_point] = entry + return mapping + + +_IDNA_MAPPING_TABLE = _load_idna_mapping_table() + + +# https://www.unicode.org/reports/tr46/#Validity_Criteria +def _validate_label( + label: str, + *, + check_hyphens: bool, + check_joiners: bool, + check_bidi: bool, + transitional_processing: bool, + use_std3_ascii_rules: bool, +) -> None: + """Validates the *label* domain name label. + + Only set *check_bidi* to ``True`` if the source domain name is a bidi + domain name, i.e. if any character in it is in the Unicode Character + Database with Bidi_Class R, AL, or AN. + """ + if not _is_normalized("NFC", label): + raise ValueError( + f"Domain name label {label!r} is not in Unicode Normalization " f"Form NFC." + ) + length = len(label) + if check_hyphens: + if length >= 4 and label[3:4] == "--": + raise ValueError( + f"Domain name label {label!r} contains '-' in its 3rd and 4rd " + f"positions." + ) + if label.startswith("-"): + raise ValueError(f"Domain name label {label!r} starts with '-'.") + if label.endswith("-"): + raise ValueError(f"Domain name label {label!r} ends with '-'.") + if "." in label: + raise ValueError(f"Domain name label {label!r} contains a '.'.") + if length >= 1 and unicodedata.category(label[0])[0] == "M": + raise ValueError( + f"Domain name label {label!r} starts with a character " + f"({label[0]!r}) in the Mark general category from the Unicode " + f"Character Database." + ) + for code_point in set(label): + entry = _IDNA_MAPPING_TABLE.get(code_point) + if entry is None: + raise ValueError( + f"Domain name label {label!r} contains an unrecognized code " + f"point: U+{ord(code_point):04X} ({code_point})." + ) + if not ( + entry.status is _Status.VALID + or not use_std3_ascii_rules + and entry.status is _Status.DISALLOWED_STD3_VALID + or not transitional_processing + and entry.status is _Status.DEVIATION + ): + raise ValueError( + f"Domain name label {label!r} contains a code point, " + f"U+{ord(code_point):04X} ({code_point}), which is neither " + f"valid nor a deviation." + ) + if check_joiners: + _check_contextj_rules(label) + if check_bidi: + _check_bidi(label) + + +# https://www.unicode.org/reports/tr46/#Notation +def _is_bidi_domain_name(domain_name: str) -> bool: + return any( + unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} + for code_point in set(domain_name) + ) + + +# https://www.unicode.org/reports/tr46/#Processing +def _process( + domain_name: str, + *, + use_std3_ascii_rules: bool, + check_hyphens: bool, + check_bidi: bool, + check_joiners: bool, + transitional_processing: bool, +) -> str: + for code_point in set(domain_name): + entry = _IDNA_MAPPING_TABLE.get(code_point) + if entry is None: + raise ValueError( + f"Domain name {domain_name!r} contains an unrecognized code " + f"point: U+{ord(code_point):04X} ({code_point})." + ) + if entry.status is _Status.DISALLOWED or ( + use_std3_ascii_rules + and entry.status + in ( + _Status.DISALLOWED_STD3_MAPPED, + _Status.DISALLOWED_STD3_VALID, + ) + ): + raise ValueError( + f"Domain name {domain_name!r} contains disallowed code point " + f"U+{ord(code_point):04X} ({code_point})." + ) + if entry.status is _Status.IGNORED: + domain_name = domain_name.replace(code_point, "") + elif entry.status is _Status.MAPPED or ( + not use_std3_ascii_rules and entry.status is _Status.DISALLOWED_STD3_MAPPED + ): + assert entry.mapping is not None + domain_name = domain_name.replace(code_point, entry.mapping) + elif entry.status is _Status.DEVIATION and transitional_processing: + assert entry.mapping is not None + domain_name = domain_name.replace(code_point, entry.mapping) + domain_name = unicodedata.normalize("NFC", domain_name) + labels = domain_name.split(".") + check_bidi = check_bidi and _is_bidi_domain_name(domain_name) + for i, label in enumerate(labels): + if label.startswith("xn--"): + new_label = label[4:].encode().decode("punycode") + _validate_label( + new_label, + transitional_processing=False, + check_hyphens=check_hyphens, + check_joiners=check_joiners, + check_bidi=check_bidi, + use_std3_ascii_rules=use_std3_ascii_rules, + ) + labels[i] = new_label + else: + _validate_label( + label, + transitional_processing=transitional_processing, + check_hyphens=check_hyphens, + check_joiners=check_joiners, + check_bidi=check_bidi, + use_std3_ascii_rules=use_std3_ascii_rules, + ) + return ".".join(labels) + + +def _convert_label(label: str) -> str: + if not any(ord(code_point) >= 0x80 for code_point in label): + return label + return f"xn--{label.encode('punycode').decode()}" + + +# https://www.unicode.org/reports/tr46/#ToASCII +def _to_ascii( + domain_name: str, + *, + check_hyphens: bool, + check_bidi: bool, + check_joiners: bool, + use_std3_ascii_rules: bool, + transitional_processing: bool, + verify_dns_length: bool, +) -> str: + domain_name = _process( + domain_name, + transitional_processing=transitional_processing, + check_hyphens=check_hyphens, + check_bidi=check_bidi, + check_joiners=check_joiners, + use_std3_ascii_rules=use_std3_ascii_rules, + ) + labels = [_convert_label(label) for label in domain_name.split(".")] + domain_name = ".".join(labels) + if verify_dns_length: + length = len(domain_name.rstrip(".")) + if not 1 <= length <= 253: + raise ValueError( + f"The length of domain name {domain_name!r}, excluding the " + f"root label and its dot, is {length}. It should be between 1 " + f"and 253. Pass verify_dns_length=False to avoid this check." + ) + for label in labels: + length = len(label) + if not 1 <= length <= 63: + raise ValueError( + f"The length of label {label!r} from domain name " + f"{domain_name!r} is {length}. It should be between 1 and " + f"63. Pass verify_dns_length=False to avoid this check." + ) + return domain_name diff --git a/w3lib/idna.txt b/w3lib/idna.txt new file mode 100644 index 00000000..ae45a569 --- /dev/null +++ b/w3lib/idna.txt @@ -0,0 +1,9028 @@ +# Source: https://www.unicode.org/Public/idna/latest/IdnaMappingTable.txt +# +# IdnaMappingTable.txt +# Date: 2022-05-02, 19:29:26 GMT +# © 2022 Unicode®, Inc. +# Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. +# For terms of use, see https://www.unicode.org/terms_of_use.html +# +# Unicode IDNA Compatible Preprocessing for UTS #46 +# Version: 15.0.0 +# +# For documentation and usage, see https://www.unicode.org/reports/tr46 +# +0000..002C ; disallowed_STD3_valid # 1.1 ..COMMA +002D..002E ; valid # 1.1 HYPHEN-MINUS..FULL STOP +002F ; disallowed_STD3_valid # 1.1 SOLIDUS +0030..0039 ; valid # 1.1 DIGIT ZERO..DIGIT NINE +003A..0040 ; disallowed_STD3_valid # 1.1 COLON..COMMERCIAL AT +0041 ; mapped ; 0061 # 1.1 LATIN CAPITAL LETTER A +0042 ; mapped ; 0062 # 1.1 LATIN CAPITAL LETTER B +0043 ; mapped ; 0063 # 1.1 LATIN CAPITAL LETTER C +0044 ; mapped ; 0064 # 1.1 LATIN CAPITAL LETTER D +0045 ; mapped ; 0065 # 1.1 LATIN CAPITAL LETTER E +0046 ; mapped ; 0066 # 1.1 LATIN CAPITAL LETTER F +0047 ; mapped ; 0067 # 1.1 LATIN CAPITAL LETTER G +0048 ; mapped ; 0068 # 1.1 LATIN CAPITAL LETTER H +0049 ; mapped ; 0069 # 1.1 LATIN CAPITAL LETTER I +004A ; mapped ; 006A # 1.1 LATIN CAPITAL LETTER J +004B ; mapped ; 006B # 1.1 LATIN CAPITAL LETTER K +004C ; mapped ; 006C # 1.1 LATIN CAPITAL LETTER L +004D ; mapped ; 006D # 1.1 LATIN CAPITAL LETTER M +004E ; mapped ; 006E # 1.1 LATIN CAPITAL LETTER N +004F ; mapped ; 006F # 1.1 LATIN CAPITAL LETTER O +0050 ; mapped ; 0070 # 1.1 LATIN CAPITAL LETTER P +0051 ; mapped ; 0071 # 1.1 LATIN CAPITAL LETTER Q +0052 ; mapped ; 0072 # 1.1 LATIN CAPITAL LETTER R +0053 ; mapped ; 0073 # 1.1 LATIN CAPITAL LETTER S +0054 ; mapped ; 0074 # 1.1 LATIN CAPITAL LETTER T +0055 ; mapped ; 0075 # 1.1 LATIN CAPITAL LETTER U +0056 ; mapped ; 0076 # 1.1 LATIN CAPITAL LETTER V +0057 ; mapped ; 0077 # 1.1 LATIN CAPITAL LETTER W +0058 ; mapped ; 0078 # 1.1 LATIN CAPITAL LETTER X +0059 ; mapped ; 0079 # 1.1 LATIN CAPITAL LETTER Y +005A ; mapped ; 007A # 1.1 LATIN CAPITAL LETTER Z +005B..0060 ; disallowed_STD3_valid # 1.1 LEFT SQUARE BRACKET..GRAVE ACCENT +0061..007A ; valid # 1.1 LATIN SMALL LETTER A..LATIN SMALL LETTER Z +007B..007F ; disallowed_STD3_valid # 1.1 LEFT CURLY BRACKET.. +0080..009F ; disallowed # 1.1 .. +00A0 ; disallowed_STD3_mapped ; 0020 # 1.1 NO-BREAK SPACE +00A1..00A7 ; valid ; ; NV8 # 1.1 INVERTED EXCLAMATION MARK..SECTION SIGN +00A8 ; disallowed_STD3_mapped ; 0020 0308 # 1.1 DIAERESIS +00A9 ; valid ; ; NV8 # 1.1 COPYRIGHT SIGN +00AA ; mapped ; 0061 # 1.1 FEMININE ORDINAL INDICATOR +00AB..00AC ; valid ; ; NV8 # 1.1 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK..NOT SIGN +00AD ; ignored # 1.1 SOFT HYPHEN +00AE ; valid ; ; NV8 # 1.1 REGISTERED SIGN +00AF ; disallowed_STD3_mapped ; 0020 0304 # 1.1 MACRON +00B0..00B1 ; valid ; ; NV8 # 1.1 DEGREE SIGN..PLUS-MINUS SIGN +00B2 ; mapped ; 0032 # 1.1 SUPERSCRIPT TWO +00B3 ; mapped ; 0033 # 1.1 SUPERSCRIPT THREE +00B4 ; disallowed_STD3_mapped ; 0020 0301 # 1.1 ACUTE ACCENT +00B5 ; mapped ; 03BC # 1.1 MICRO SIGN +00B6 ; valid ; ; NV8 # 1.1 PILCROW SIGN +00B7 ; valid # 1.1 MIDDLE DOT +00B8 ; disallowed_STD3_mapped ; 0020 0327 # 1.1 CEDILLA +00B9 ; mapped ; 0031 # 1.1 SUPERSCRIPT ONE +00BA ; mapped ; 006F # 1.1 MASCULINE ORDINAL INDICATOR +00BB ; valid ; ; NV8 # 1.1 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +00BC ; mapped ; 0031 2044 0034 #1.1 VULGAR FRACTION ONE QUARTER +00BD ; mapped ; 0031 2044 0032 #1.1 VULGAR FRACTION ONE HALF +00BE ; mapped ; 0033 2044 0034 #1.1 VULGAR FRACTION THREE QUARTERS +00BF ; valid ; ; NV8 # 1.1 INVERTED QUESTION MARK +00C0 ; mapped ; 00E0 # 1.1 LATIN CAPITAL LETTER A WITH GRAVE +00C1 ; mapped ; 00E1 # 1.1 LATIN CAPITAL LETTER A WITH ACUTE +00C2 ; mapped ; 00E2 # 1.1 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +00C3 ; mapped ; 00E3 # 1.1 LATIN CAPITAL LETTER A WITH TILDE +00C4 ; mapped ; 00E4 # 1.1 LATIN CAPITAL LETTER A WITH DIAERESIS +00C5 ; mapped ; 00E5 # 1.1 LATIN CAPITAL LETTER A WITH RING ABOVE +00C6 ; mapped ; 00E6 # 1.1 LATIN CAPITAL LETTER AE +00C7 ; mapped ; 00E7 # 1.1 LATIN CAPITAL LETTER C WITH CEDILLA +00C8 ; mapped ; 00E8 # 1.1 LATIN CAPITAL LETTER E WITH GRAVE +00C9 ; mapped ; 00E9 # 1.1 LATIN CAPITAL LETTER E WITH ACUTE +00CA ; mapped ; 00EA # 1.1 LATIN CAPITAL LETTER E WITH CIRCUMFLEX +00CB ; mapped ; 00EB # 1.1 LATIN CAPITAL LETTER E WITH DIAERESIS +00CC ; mapped ; 00EC # 1.1 LATIN CAPITAL LETTER I WITH GRAVE +00CD ; mapped ; 00ED # 1.1 LATIN CAPITAL LETTER I WITH ACUTE +00CE ; mapped ; 00EE # 1.1 LATIN CAPITAL LETTER I WITH CIRCUMFLEX +00CF ; mapped ; 00EF # 1.1 LATIN CAPITAL LETTER I WITH DIAERESIS +00D0 ; mapped ; 00F0 # 1.1 LATIN CAPITAL LETTER ETH +00D1 ; mapped ; 00F1 # 1.1 LATIN CAPITAL LETTER N WITH TILDE +00D2 ; mapped ; 00F2 # 1.1 LATIN CAPITAL LETTER O WITH GRAVE +00D3 ; mapped ; 00F3 # 1.1 LATIN CAPITAL LETTER O WITH ACUTE +00D4 ; mapped ; 00F4 # 1.1 LATIN CAPITAL LETTER O WITH CIRCUMFLEX +00D5 ; mapped ; 00F5 # 1.1 LATIN CAPITAL LETTER O WITH TILDE +00D6 ; mapped ; 00F6 # 1.1 LATIN CAPITAL LETTER O WITH DIAERESIS +00D7 ; valid ; ; NV8 # 1.1 MULTIPLICATION SIGN +00D8 ; mapped ; 00F8 # 1.1 LATIN CAPITAL LETTER O WITH STROKE +00D9 ; mapped ; 00F9 # 1.1 LATIN CAPITAL LETTER U WITH GRAVE +00DA ; mapped ; 00FA # 1.1 LATIN CAPITAL LETTER U WITH ACUTE +00DB ; mapped ; 00FB # 1.1 LATIN CAPITAL LETTER U WITH CIRCUMFLEX +00DC ; mapped ; 00FC # 1.1 LATIN CAPITAL LETTER U WITH DIAERESIS +00DD ; mapped ; 00FD # 1.1 LATIN CAPITAL LETTER Y WITH ACUTE +00DE ; mapped ; 00FE # 1.1 LATIN CAPITAL LETTER THORN +00DF ; deviation ; 0073 0073 # 1.1 LATIN SMALL LETTER SHARP S +00E0..00F6 ; valid # 1.1 LATIN SMALL LETTER A WITH GRAVE..LATIN SMALL LETTER O WITH DIAERESIS +00F7 ; valid ; ; NV8 # 1.1 DIVISION SIGN +00F8..00FF ; valid # 1.1 LATIN SMALL LETTER O WITH STROKE..LATIN SMALL LETTER Y WITH DIAERESIS +0100 ; mapped ; 0101 # 1.1 LATIN CAPITAL LETTER A WITH MACRON +0101 ; valid # 1.1 LATIN SMALL LETTER A WITH MACRON +0102 ; mapped ; 0103 # 1.1 LATIN CAPITAL LETTER A WITH BREVE +0103 ; valid # 1.1 LATIN SMALL LETTER A WITH BREVE +0104 ; mapped ; 0105 # 1.1 LATIN CAPITAL LETTER A WITH OGONEK +0105 ; valid # 1.1 LATIN SMALL LETTER A WITH OGONEK +0106 ; mapped ; 0107 # 1.1 LATIN CAPITAL LETTER C WITH ACUTE +0107 ; valid # 1.1 LATIN SMALL LETTER C WITH ACUTE +0108 ; mapped ; 0109 # 1.1 LATIN CAPITAL LETTER C WITH CIRCUMFLEX +0109 ; valid # 1.1 LATIN SMALL LETTER C WITH CIRCUMFLEX +010A ; mapped ; 010B # 1.1 LATIN CAPITAL LETTER C WITH DOT ABOVE +010B ; valid # 1.1 LATIN SMALL LETTER C WITH DOT ABOVE +010C ; mapped ; 010D # 1.1 LATIN CAPITAL LETTER C WITH CARON +010D ; valid # 1.1 LATIN SMALL LETTER C WITH CARON +010E ; mapped ; 010F # 1.1 LATIN CAPITAL LETTER D WITH CARON +010F ; valid # 1.1 LATIN SMALL LETTER D WITH CARON +0110 ; mapped ; 0111 # 1.1 LATIN CAPITAL LETTER D WITH STROKE +0111 ; valid # 1.1 LATIN SMALL LETTER D WITH STROKE +0112 ; mapped ; 0113 # 1.1 LATIN CAPITAL LETTER E WITH MACRON +0113 ; valid # 1.1 LATIN SMALL LETTER E WITH MACRON +0114 ; mapped ; 0115 # 1.1 LATIN CAPITAL LETTER E WITH BREVE +0115 ; valid # 1.1 LATIN SMALL LETTER E WITH BREVE +0116 ; mapped ; 0117 # 1.1 LATIN CAPITAL LETTER E WITH DOT ABOVE +0117 ; valid # 1.1 LATIN SMALL LETTER E WITH DOT ABOVE +0118 ; mapped ; 0119 # 1.1 LATIN CAPITAL LETTER E WITH OGONEK +0119 ; valid # 1.1 LATIN SMALL LETTER E WITH OGONEK +011A ; mapped ; 011B # 1.1 LATIN CAPITAL LETTER E WITH CARON +011B ; valid # 1.1 LATIN SMALL LETTER E WITH CARON +011C ; mapped ; 011D # 1.1 LATIN CAPITAL LETTER G WITH CIRCUMFLEX +011D ; valid # 1.1 LATIN SMALL LETTER G WITH CIRCUMFLEX +011E ; mapped ; 011F # 1.1 LATIN CAPITAL LETTER G WITH BREVE +011F ; valid # 1.1 LATIN SMALL LETTER G WITH BREVE +0120 ; mapped ; 0121 # 1.1 LATIN CAPITAL LETTER G WITH DOT ABOVE +0121 ; valid # 1.1 LATIN SMALL LETTER G WITH DOT ABOVE +0122 ; mapped ; 0123 # 1.1 LATIN CAPITAL LETTER G WITH CEDILLA +0123 ; valid # 1.1 LATIN SMALL LETTER G WITH CEDILLA +0124 ; mapped ; 0125 # 1.1 LATIN CAPITAL LETTER H WITH CIRCUMFLEX +0125 ; valid # 1.1 LATIN SMALL LETTER H WITH CIRCUMFLEX +0126 ; mapped ; 0127 # 1.1 LATIN CAPITAL LETTER H WITH STROKE +0127 ; valid # 1.1 LATIN SMALL LETTER H WITH STROKE +0128 ; mapped ; 0129 # 1.1 LATIN CAPITAL LETTER I WITH TILDE +0129 ; valid # 1.1 LATIN SMALL LETTER I WITH TILDE +012A ; mapped ; 012B # 1.1 LATIN CAPITAL LETTER I WITH MACRON +012B ; valid # 1.1 LATIN SMALL LETTER I WITH MACRON +012C ; mapped ; 012D # 1.1 LATIN CAPITAL LETTER I WITH BREVE +012D ; valid # 1.1 LATIN SMALL LETTER I WITH BREVE +012E ; mapped ; 012F # 1.1 LATIN CAPITAL LETTER I WITH OGONEK +012F ; valid # 1.1 LATIN SMALL LETTER I WITH OGONEK +0130 ; mapped ; 0069 0307 # 1.1 LATIN CAPITAL LETTER I WITH DOT ABOVE +0131 ; valid # 1.1 LATIN SMALL LETTER DOTLESS I +0132..0133 ; mapped ; 0069 006A # 1.1 LATIN CAPITAL LIGATURE IJ..LATIN SMALL LIGATURE IJ +0134 ; mapped ; 0135 # 1.1 LATIN CAPITAL LETTER J WITH CIRCUMFLEX +0135 ; valid # 1.1 LATIN SMALL LETTER J WITH CIRCUMFLEX +0136 ; mapped ; 0137 # 1.1 LATIN CAPITAL LETTER K WITH CEDILLA +0137..0138 ; valid # 1.1 LATIN SMALL LETTER K WITH CEDILLA..LATIN SMALL LETTER KRA +0139 ; mapped ; 013A # 1.1 LATIN CAPITAL LETTER L WITH ACUTE +013A ; valid # 1.1 LATIN SMALL LETTER L WITH ACUTE +013B ; mapped ; 013C # 1.1 LATIN CAPITAL LETTER L WITH CEDILLA +013C ; valid # 1.1 LATIN SMALL LETTER L WITH CEDILLA +013D ; mapped ; 013E # 1.1 LATIN CAPITAL LETTER L WITH CARON +013E ; valid # 1.1 LATIN SMALL LETTER L WITH CARON +013F..0140 ; mapped ; 006C 00B7 # 1.1 LATIN CAPITAL LETTER L WITH MIDDLE DOT..LATIN SMALL LETTER L WITH MIDDLE DOT +0141 ; mapped ; 0142 # 1.1 LATIN CAPITAL LETTER L WITH STROKE +0142 ; valid # 1.1 LATIN SMALL LETTER L WITH STROKE +0143 ; mapped ; 0144 # 1.1 LATIN CAPITAL LETTER N WITH ACUTE +0144 ; valid # 1.1 LATIN SMALL LETTER N WITH ACUTE +0145 ; mapped ; 0146 # 1.1 LATIN CAPITAL LETTER N WITH CEDILLA +0146 ; valid # 1.1 LATIN SMALL LETTER N WITH CEDILLA +0147 ; mapped ; 0148 # 1.1 LATIN CAPITAL LETTER N WITH CARON +0148 ; valid # 1.1 LATIN SMALL LETTER N WITH CARON +0149 ; mapped ; 02BC 006E # 1.1 LATIN SMALL LETTER N PRECEDED BY APOSTROPHE +014A ; mapped ; 014B # 1.1 LATIN CAPITAL LETTER ENG +014B ; valid # 1.1 LATIN SMALL LETTER ENG +014C ; mapped ; 014D # 1.1 LATIN CAPITAL LETTER O WITH MACRON +014D ; valid # 1.1 LATIN SMALL LETTER O WITH MACRON +014E ; mapped ; 014F # 1.1 LATIN CAPITAL LETTER O WITH BREVE +014F ; valid # 1.1 LATIN SMALL LETTER O WITH BREVE +0150 ; mapped ; 0151 # 1.1 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE +0151 ; valid # 1.1 LATIN SMALL LETTER O WITH DOUBLE ACUTE +0152 ; mapped ; 0153 # 1.1 LATIN CAPITAL LIGATURE OE +0153 ; valid # 1.1 LATIN SMALL LIGATURE OE +0154 ; mapped ; 0155 # 1.1 LATIN CAPITAL LETTER R WITH ACUTE +0155 ; valid # 1.1 LATIN SMALL LETTER R WITH ACUTE +0156 ; mapped ; 0157 # 1.1 LATIN CAPITAL LETTER R WITH CEDILLA +0157 ; valid # 1.1 LATIN SMALL LETTER R WITH CEDILLA +0158 ; mapped ; 0159 # 1.1 LATIN CAPITAL LETTER R WITH CARON +0159 ; valid # 1.1 LATIN SMALL LETTER R WITH CARON +015A ; mapped ; 015B # 1.1 LATIN CAPITAL LETTER S WITH ACUTE +015B ; valid # 1.1 LATIN SMALL LETTER S WITH ACUTE +015C ; mapped ; 015D # 1.1 LATIN CAPITAL LETTER S WITH CIRCUMFLEX +015D ; valid # 1.1 LATIN SMALL LETTER S WITH CIRCUMFLEX +015E ; mapped ; 015F # 1.1 LATIN CAPITAL LETTER S WITH CEDILLA +015F ; valid # 1.1 LATIN SMALL LETTER S WITH CEDILLA +0160 ; mapped ; 0161 # 1.1 LATIN CAPITAL LETTER S WITH CARON +0161 ; valid # 1.1 LATIN SMALL LETTER S WITH CARON +0162 ; mapped ; 0163 # 1.1 LATIN CAPITAL LETTER T WITH CEDILLA +0163 ; valid # 1.1 LATIN SMALL LETTER T WITH CEDILLA +0164 ; mapped ; 0165 # 1.1 LATIN CAPITAL LETTER T WITH CARON +0165 ; valid # 1.1 LATIN SMALL LETTER T WITH CARON +0166 ; mapped ; 0167 # 1.1 LATIN CAPITAL LETTER T WITH STROKE +0167 ; valid # 1.1 LATIN SMALL LETTER T WITH STROKE +0168 ; mapped ; 0169 # 1.1 LATIN CAPITAL LETTER U WITH TILDE +0169 ; valid # 1.1 LATIN SMALL LETTER U WITH TILDE +016A ; mapped ; 016B # 1.1 LATIN CAPITAL LETTER U WITH MACRON +016B ; valid # 1.1 LATIN SMALL LETTER U WITH MACRON +016C ; mapped ; 016D # 1.1 LATIN CAPITAL LETTER U WITH BREVE +016D ; valid # 1.1 LATIN SMALL LETTER U WITH BREVE +016E ; mapped ; 016F # 1.1 LATIN CAPITAL LETTER U WITH RING ABOVE +016F ; valid # 1.1 LATIN SMALL LETTER U WITH RING ABOVE +0170 ; mapped ; 0171 # 1.1 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE +0171 ; valid # 1.1 LATIN SMALL LETTER U WITH DOUBLE ACUTE +0172 ; mapped ; 0173 # 1.1 LATIN CAPITAL LETTER U WITH OGONEK +0173 ; valid # 1.1 LATIN SMALL LETTER U WITH OGONEK +0174 ; mapped ; 0175 # 1.1 LATIN CAPITAL LETTER W WITH CIRCUMFLEX +0175 ; valid # 1.1 LATIN SMALL LETTER W WITH CIRCUMFLEX +0176 ; mapped ; 0177 # 1.1 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX +0177 ; valid # 1.1 LATIN SMALL LETTER Y WITH CIRCUMFLEX +0178 ; mapped ; 00FF # 1.1 LATIN CAPITAL LETTER Y WITH DIAERESIS +0179 ; mapped ; 017A # 1.1 LATIN CAPITAL LETTER Z WITH ACUTE +017A ; valid # 1.1 LATIN SMALL LETTER Z WITH ACUTE +017B ; mapped ; 017C # 1.1 LATIN CAPITAL LETTER Z WITH DOT ABOVE +017C ; valid # 1.1 LATIN SMALL LETTER Z WITH DOT ABOVE +017D ; mapped ; 017E # 1.1 LATIN CAPITAL LETTER Z WITH CARON +017E ; valid # 1.1 LATIN SMALL LETTER Z WITH CARON +017F ; mapped ; 0073 # 1.1 LATIN SMALL LETTER LONG S +0180 ; valid # 1.1 LATIN SMALL LETTER B WITH STROKE +0181 ; mapped ; 0253 # 1.1 LATIN CAPITAL LETTER B WITH HOOK +0182 ; mapped ; 0183 # 1.1 LATIN CAPITAL LETTER B WITH TOPBAR +0183 ; valid # 1.1 LATIN SMALL LETTER B WITH TOPBAR +0184 ; mapped ; 0185 # 1.1 LATIN CAPITAL LETTER TONE SIX +0185 ; valid # 1.1 LATIN SMALL LETTER TONE SIX +0186 ; mapped ; 0254 # 1.1 LATIN CAPITAL LETTER OPEN O +0187 ; mapped ; 0188 # 1.1 LATIN CAPITAL LETTER C WITH HOOK +0188 ; valid # 1.1 LATIN SMALL LETTER C WITH HOOK +0189 ; mapped ; 0256 # 1.1 LATIN CAPITAL LETTER AFRICAN D +018A ; mapped ; 0257 # 1.1 LATIN CAPITAL LETTER D WITH HOOK +018B ; mapped ; 018C # 1.1 LATIN CAPITAL LETTER D WITH TOPBAR +018C..018D ; valid # 1.1 LATIN SMALL LETTER D WITH TOPBAR..LATIN SMALL LETTER TURNED DELTA +018E ; mapped ; 01DD # 1.1 LATIN CAPITAL LETTER REVERSED E +018F ; mapped ; 0259 # 1.1 LATIN CAPITAL LETTER SCHWA +0190 ; mapped ; 025B # 1.1 LATIN CAPITAL LETTER OPEN E +0191 ; mapped ; 0192 # 1.1 LATIN CAPITAL LETTER F WITH HOOK +0192 ; valid # 1.1 LATIN SMALL LETTER F WITH HOOK +0193 ; mapped ; 0260 # 1.1 LATIN CAPITAL LETTER G WITH HOOK +0194 ; mapped ; 0263 # 1.1 LATIN CAPITAL LETTER GAMMA +0195 ; valid # 1.1 LATIN SMALL LETTER HV +0196 ; mapped ; 0269 # 1.1 LATIN CAPITAL LETTER IOTA +0197 ; mapped ; 0268 # 1.1 LATIN CAPITAL LETTER I WITH STROKE +0198 ; mapped ; 0199 # 1.1 LATIN CAPITAL LETTER K WITH HOOK +0199..019B ; valid # 1.1 LATIN SMALL LETTER K WITH HOOK..LATIN SMALL LETTER LAMBDA WITH STROKE +019C ; mapped ; 026F # 1.1 LATIN CAPITAL LETTER TURNED M +019D ; mapped ; 0272 # 1.1 LATIN CAPITAL LETTER N WITH LEFT HOOK +019E ; valid # 1.1 LATIN SMALL LETTER N WITH LONG RIGHT LEG +019F ; mapped ; 0275 # 1.1 LATIN CAPITAL LETTER O WITH MIDDLE TILDE +01A0 ; mapped ; 01A1 # 1.1 LATIN CAPITAL LETTER O WITH HORN +01A1 ; valid # 1.1 LATIN SMALL LETTER O WITH HORN +01A2 ; mapped ; 01A3 # 1.1 LATIN CAPITAL LETTER OI +01A3 ; valid # 1.1 LATIN SMALL LETTER OI +01A4 ; mapped ; 01A5 # 1.1 LATIN CAPITAL LETTER P WITH HOOK +01A5 ; valid # 1.1 LATIN SMALL LETTER P WITH HOOK +01A6 ; mapped ; 0280 # 1.1 LATIN LETTER YR +01A7 ; mapped ; 01A8 # 1.1 LATIN CAPITAL LETTER TONE TWO +01A8 ; valid # 1.1 LATIN SMALL LETTER TONE TWO +01A9 ; mapped ; 0283 # 1.1 LATIN CAPITAL LETTER ESH +01AA..01AB ; valid # 1.1 LATIN LETTER REVERSED ESH LOOP..LATIN SMALL LETTER T WITH PALATAL HOOK +01AC ; mapped ; 01AD # 1.1 LATIN CAPITAL LETTER T WITH HOOK +01AD ; valid # 1.1 LATIN SMALL LETTER T WITH HOOK +01AE ; mapped ; 0288 # 1.1 LATIN CAPITAL LETTER T WITH RETROFLEX HOOK +01AF ; mapped ; 01B0 # 1.1 LATIN CAPITAL LETTER U WITH HORN +01B0 ; valid # 1.1 LATIN SMALL LETTER U WITH HORN +01B1 ; mapped ; 028A # 1.1 LATIN CAPITAL LETTER UPSILON +01B2 ; mapped ; 028B # 1.1 LATIN CAPITAL LETTER V WITH HOOK +01B3 ; mapped ; 01B4 # 1.1 LATIN CAPITAL LETTER Y WITH HOOK +01B4 ; valid # 1.1 LATIN SMALL LETTER Y WITH HOOK +01B5 ; mapped ; 01B6 # 1.1 LATIN CAPITAL LETTER Z WITH STROKE +01B6 ; valid # 1.1 LATIN SMALL LETTER Z WITH STROKE +01B7 ; mapped ; 0292 # 1.1 LATIN CAPITAL LETTER EZH +01B8 ; mapped ; 01B9 # 1.1 LATIN CAPITAL LETTER EZH REVERSED +01B9..01BB ; valid # 1.1 LATIN SMALL LETTER EZH REVERSED..LATIN LETTER TWO WITH STROKE +01BC ; mapped ; 01BD # 1.1 LATIN CAPITAL LETTER TONE FIVE +01BD..01C3 ; valid # 1.1 LATIN SMALL LETTER TONE FIVE..LATIN LETTER RETROFLEX CLICK +01C4..01C6 ; mapped ; 0064 017E # 1.1 LATIN CAPITAL LETTER DZ WITH CARON..LATIN SMALL LETTER DZ WITH CARON +01C7..01C9 ; mapped ; 006C 006A # 1.1 LATIN CAPITAL LETTER LJ..LATIN SMALL LETTER LJ +01CA..01CC ; mapped ; 006E 006A # 1.1 LATIN CAPITAL LETTER NJ..LATIN SMALL LETTER NJ +01CD ; mapped ; 01CE # 1.1 LATIN CAPITAL LETTER A WITH CARON +01CE ; valid # 1.1 LATIN SMALL LETTER A WITH CARON +01CF ; mapped ; 01D0 # 1.1 LATIN CAPITAL LETTER I WITH CARON +01D0 ; valid # 1.1 LATIN SMALL LETTER I WITH CARON +01D1 ; mapped ; 01D2 # 1.1 LATIN CAPITAL LETTER O WITH CARON +01D2 ; valid # 1.1 LATIN SMALL LETTER O WITH CARON +01D3 ; mapped ; 01D4 # 1.1 LATIN CAPITAL LETTER U WITH CARON +01D4 ; valid # 1.1 LATIN SMALL LETTER U WITH CARON +01D5 ; mapped ; 01D6 # 1.1 LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON +01D6 ; valid # 1.1 LATIN SMALL LETTER U WITH DIAERESIS AND MACRON +01D7 ; mapped ; 01D8 # 1.1 LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE +01D8 ; valid # 1.1 LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE +01D9 ; mapped ; 01DA # 1.1 LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON +01DA ; valid # 1.1 LATIN SMALL LETTER U WITH DIAERESIS AND CARON +01DB ; mapped ; 01DC # 1.1 LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE +01DC..01DD ; valid # 1.1 LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE..LATIN SMALL LETTER TURNED E +01DE ; mapped ; 01DF # 1.1 LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON +01DF ; valid # 1.1 LATIN SMALL LETTER A WITH DIAERESIS AND MACRON +01E0 ; mapped ; 01E1 # 1.1 LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON +01E1 ; valid # 1.1 LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON +01E2 ; mapped ; 01E3 # 1.1 LATIN CAPITAL LETTER AE WITH MACRON +01E3 ; valid # 1.1 LATIN SMALL LETTER AE WITH MACRON +01E4 ; mapped ; 01E5 # 1.1 LATIN CAPITAL LETTER G WITH STROKE +01E5 ; valid # 1.1 LATIN SMALL LETTER G WITH STROKE +01E6 ; mapped ; 01E7 # 1.1 LATIN CAPITAL LETTER G WITH CARON +01E7 ; valid # 1.1 LATIN SMALL LETTER G WITH CARON +01E8 ; mapped ; 01E9 # 1.1 LATIN CAPITAL LETTER K WITH CARON +01E9 ; valid # 1.1 LATIN SMALL LETTER K WITH CARON +01EA ; mapped ; 01EB # 1.1 LATIN CAPITAL LETTER O WITH OGONEK +01EB ; valid # 1.1 LATIN SMALL LETTER O WITH OGONEK +01EC ; mapped ; 01ED # 1.1 LATIN CAPITAL LETTER O WITH OGONEK AND MACRON +01ED ; valid # 1.1 LATIN SMALL LETTER O WITH OGONEK AND MACRON +01EE ; mapped ; 01EF # 1.1 LATIN CAPITAL LETTER EZH WITH CARON +01EF..01F0 ; valid # 1.1 LATIN SMALL LETTER EZH WITH CARON..LATIN SMALL LETTER J WITH CARON +01F1..01F3 ; mapped ; 0064 007A # 1.1 LATIN CAPITAL LETTER DZ..LATIN SMALL LETTER DZ +01F4 ; mapped ; 01F5 # 1.1 LATIN CAPITAL LETTER G WITH ACUTE +01F5 ; valid # 1.1 LATIN SMALL LETTER G WITH ACUTE +01F6 ; mapped ; 0195 # 3.0 LATIN CAPITAL LETTER HWAIR +01F7 ; mapped ; 01BF # 3.0 LATIN CAPITAL LETTER WYNN +01F8 ; mapped ; 01F9 # 3.0 LATIN CAPITAL LETTER N WITH GRAVE +01F9 ; valid # 3.0 LATIN SMALL LETTER N WITH GRAVE +01FA ; mapped ; 01FB # 1.1 LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE +01FB ; valid # 1.1 LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE +01FC ; mapped ; 01FD # 1.1 LATIN CAPITAL LETTER AE WITH ACUTE +01FD ; valid # 1.1 LATIN SMALL LETTER AE WITH ACUTE +01FE ; mapped ; 01FF # 1.1 LATIN CAPITAL LETTER O WITH STROKE AND ACUTE +01FF ; valid # 1.1 LATIN SMALL LETTER O WITH STROKE AND ACUTE +0200 ; mapped ; 0201 # 1.1 LATIN CAPITAL LETTER A WITH DOUBLE GRAVE +0201 ; valid # 1.1 LATIN SMALL LETTER A WITH DOUBLE GRAVE +0202 ; mapped ; 0203 # 1.1 LATIN CAPITAL LETTER A WITH INVERTED BREVE +0203 ; valid # 1.1 LATIN SMALL LETTER A WITH INVERTED BREVE +0204 ; mapped ; 0205 # 1.1 LATIN CAPITAL LETTER E WITH DOUBLE GRAVE +0205 ; valid # 1.1 LATIN SMALL LETTER E WITH DOUBLE GRAVE +0206 ; mapped ; 0207 # 1.1 LATIN CAPITAL LETTER E WITH INVERTED BREVE +0207 ; valid # 1.1 LATIN SMALL LETTER E WITH INVERTED BREVE +0208 ; mapped ; 0209 # 1.1 LATIN CAPITAL LETTER I WITH DOUBLE GRAVE +0209 ; valid # 1.1 LATIN SMALL LETTER I WITH DOUBLE GRAVE +020A ; mapped ; 020B # 1.1 LATIN CAPITAL LETTER I WITH INVERTED BREVE +020B ; valid # 1.1 LATIN SMALL LETTER I WITH INVERTED BREVE +020C ; mapped ; 020D # 1.1 LATIN CAPITAL LETTER O WITH DOUBLE GRAVE +020D ; valid # 1.1 LATIN SMALL LETTER O WITH DOUBLE GRAVE +020E ; mapped ; 020F # 1.1 LATIN CAPITAL LETTER O WITH INVERTED BREVE +020F ; valid # 1.1 LATIN SMALL LETTER O WITH INVERTED BREVE +0210 ; mapped ; 0211 # 1.1 LATIN CAPITAL LETTER R WITH DOUBLE GRAVE +0211 ; valid # 1.1 LATIN SMALL LETTER R WITH DOUBLE GRAVE +0212 ; mapped ; 0213 # 1.1 LATIN CAPITAL LETTER R WITH INVERTED BREVE +0213 ; valid # 1.1 LATIN SMALL LETTER R WITH INVERTED BREVE +0214 ; mapped ; 0215 # 1.1 LATIN CAPITAL LETTER U WITH DOUBLE GRAVE +0215 ; valid # 1.1 LATIN SMALL LETTER U WITH DOUBLE GRAVE +0216 ; mapped ; 0217 # 1.1 LATIN CAPITAL LETTER U WITH INVERTED BREVE +0217 ; valid # 1.1 LATIN SMALL LETTER U WITH INVERTED BREVE +0218 ; mapped ; 0219 # 3.0 LATIN CAPITAL LETTER S WITH COMMA BELOW +0219 ; valid # 3.0 LATIN SMALL LETTER S WITH COMMA BELOW +021A ; mapped ; 021B # 3.0 LATIN CAPITAL LETTER T WITH COMMA BELOW +021B ; valid # 3.0 LATIN SMALL LETTER T WITH COMMA BELOW +021C ; mapped ; 021D # 3.0 LATIN CAPITAL LETTER YOGH +021D ; valid # 3.0 LATIN SMALL LETTER YOGH +021E ; mapped ; 021F # 3.0 LATIN CAPITAL LETTER H WITH CARON +021F ; valid # 3.0 LATIN SMALL LETTER H WITH CARON +0220 ; mapped ; 019E # 3.2 LATIN CAPITAL LETTER N WITH LONG RIGHT LEG +0221 ; valid # 4.0 LATIN SMALL LETTER D WITH CURL +0222 ; mapped ; 0223 # 3.0 LATIN CAPITAL LETTER OU +0223 ; valid # 3.0 LATIN SMALL LETTER OU +0224 ; mapped ; 0225 # 3.0 LATIN CAPITAL LETTER Z WITH HOOK +0225 ; valid # 3.0 LATIN SMALL LETTER Z WITH HOOK +0226 ; mapped ; 0227 # 3.0 LATIN CAPITAL LETTER A WITH DOT ABOVE +0227 ; valid # 3.0 LATIN SMALL LETTER A WITH DOT ABOVE +0228 ; mapped ; 0229 # 3.0 LATIN CAPITAL LETTER E WITH CEDILLA +0229 ; valid # 3.0 LATIN SMALL LETTER E WITH CEDILLA +022A ; mapped ; 022B # 3.0 LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON +022B ; valid # 3.0 LATIN SMALL LETTER O WITH DIAERESIS AND MACRON +022C ; mapped ; 022D # 3.0 LATIN CAPITAL LETTER O WITH TILDE AND MACRON +022D ; valid # 3.0 LATIN SMALL LETTER O WITH TILDE AND MACRON +022E ; mapped ; 022F # 3.0 LATIN CAPITAL LETTER O WITH DOT ABOVE +022F ; valid # 3.0 LATIN SMALL LETTER O WITH DOT ABOVE +0230 ; mapped ; 0231 # 3.0 LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON +0231 ; valid # 3.0 LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON +0232 ; mapped ; 0233 # 3.0 LATIN CAPITAL LETTER Y WITH MACRON +0233 ; valid # 3.0 LATIN SMALL LETTER Y WITH MACRON +0234..0236 ; valid # 4.0 LATIN SMALL LETTER L WITH CURL..LATIN SMALL LETTER T WITH CURL +0237..0239 ; valid # 4.1 LATIN SMALL LETTER DOTLESS J..LATIN SMALL LETTER QP DIGRAPH +023A ; mapped ; 2C65 # 4.1 LATIN CAPITAL LETTER A WITH STROKE +023B ; mapped ; 023C # 4.1 LATIN CAPITAL LETTER C WITH STROKE +023C ; valid # 4.1 LATIN SMALL LETTER C WITH STROKE +023D ; mapped ; 019A # 4.1 LATIN CAPITAL LETTER L WITH BAR +023E ; mapped ; 2C66 # 4.1 LATIN CAPITAL LETTER T WITH DIAGONAL STROKE +023F..0240 ; valid # 4.1 LATIN SMALL LETTER S WITH SWASH TAIL..LATIN SMALL LETTER Z WITH SWASH TAIL +0241 ; mapped ; 0242 # 4.1 LATIN CAPITAL LETTER GLOTTAL STOP +0242 ; valid # 5.0 LATIN SMALL LETTER GLOTTAL STOP +0243 ; mapped ; 0180 # 5.0 LATIN CAPITAL LETTER B WITH STROKE +0244 ; mapped ; 0289 # 5.0 LATIN CAPITAL LETTER U BAR +0245 ; mapped ; 028C # 5.0 LATIN CAPITAL LETTER TURNED V +0246 ; mapped ; 0247 # 5.0 LATIN CAPITAL LETTER E WITH STROKE +0247 ; valid # 5.0 LATIN SMALL LETTER E WITH STROKE +0248 ; mapped ; 0249 # 5.0 LATIN CAPITAL LETTER J WITH STROKE +0249 ; valid # 5.0 LATIN SMALL LETTER J WITH STROKE +024A ; mapped ; 024B # 5.0 LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL +024B ; valid # 5.0 LATIN SMALL LETTER Q WITH HOOK TAIL +024C ; mapped ; 024D # 5.0 LATIN CAPITAL LETTER R WITH STROKE +024D ; valid # 5.0 LATIN SMALL LETTER R WITH STROKE +024E ; mapped ; 024F # 5.0 LATIN CAPITAL LETTER Y WITH STROKE +024F ; valid # 5.0 LATIN SMALL LETTER Y WITH STROKE +0250..02A8 ; valid # 1.1 LATIN SMALL LETTER TURNED A..LATIN SMALL LETTER TC DIGRAPH WITH CURL +02A9..02AD ; valid # 3.0 LATIN SMALL LETTER FENG DIGRAPH..LATIN LETTER BIDENTAL PERCUSSIVE +02AE..02AF ; valid # 4.0 LATIN SMALL LETTER TURNED H WITH FISHHOOK..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL +02B0 ; mapped ; 0068 # 1.1 MODIFIER LETTER SMALL H +02B1 ; mapped ; 0266 # 1.1 MODIFIER LETTER SMALL H WITH HOOK +02B2 ; mapped ; 006A # 1.1 MODIFIER LETTER SMALL J +02B3 ; mapped ; 0072 # 1.1 MODIFIER LETTER SMALL R +02B4 ; mapped ; 0279 # 1.1 MODIFIER LETTER SMALL TURNED R +02B5 ; mapped ; 027B # 1.1 MODIFIER LETTER SMALL TURNED R WITH HOOK +02B6 ; mapped ; 0281 # 1.1 MODIFIER LETTER SMALL CAPITAL INVERTED R +02B7 ; mapped ; 0077 # 1.1 MODIFIER LETTER SMALL W +02B8 ; mapped ; 0079 # 1.1 MODIFIER LETTER SMALL Y +02B9..02C1 ; valid # 1.1 MODIFIER LETTER PRIME..MODIFIER LETTER REVERSED GLOTTAL STOP +02C2..02C5 ; valid ; ; NV8 # 1.1 MODIFIER LETTER LEFT ARROWHEAD..MODIFIER LETTER DOWN ARROWHEAD +02C6..02D1 ; valid # 1.1 MODIFIER LETTER CIRCUMFLEX ACCENT..MODIFIER LETTER HALF TRIANGULAR COLON +02D2..02D7 ; valid ; ; NV8 # 1.1 MODIFIER LETTER CENTRED RIGHT HALF RING..MODIFIER LETTER MINUS SIGN +02D8 ; disallowed_STD3_mapped ; 0020 0306 # 1.1 BREVE +02D9 ; disallowed_STD3_mapped ; 0020 0307 # 1.1 DOT ABOVE +02DA ; disallowed_STD3_mapped ; 0020 030A # 1.1 RING ABOVE +02DB ; disallowed_STD3_mapped ; 0020 0328 # 1.1 OGONEK +02DC ; disallowed_STD3_mapped ; 0020 0303 # 1.1 SMALL TILDE +02DD ; disallowed_STD3_mapped ; 0020 030B # 1.1 DOUBLE ACUTE ACCENT +02DE ; valid ; ; NV8 # 1.1 MODIFIER LETTER RHOTIC HOOK +02DF ; valid ; ; NV8 # 3.0 MODIFIER LETTER CROSS ACCENT +02E0 ; mapped ; 0263 # 1.1 MODIFIER LETTER SMALL GAMMA +02E1 ; mapped ; 006C # 1.1 MODIFIER LETTER SMALL L +02E2 ; mapped ; 0073 # 1.1 MODIFIER LETTER SMALL S +02E3 ; mapped ; 0078 # 1.1 MODIFIER LETTER SMALL X +02E4 ; mapped ; 0295 # 1.1 MODIFIER LETTER SMALL REVERSED GLOTTAL STOP +02E5..02E9 ; valid ; ; NV8 # 1.1 MODIFIER LETTER EXTRA-HIGH TONE BAR..MODIFIER LETTER EXTRA-LOW TONE BAR +02EA..02EB ; valid ; ; NV8 # 3.0 MODIFIER LETTER YIN DEPARTING TONE MARK..MODIFIER LETTER YANG DEPARTING TONE MARK +02EC ; valid # 3.0 MODIFIER LETTER VOICING +02ED ; valid ; ; NV8 # 3.0 MODIFIER LETTER UNASPIRATED +02EE ; valid # 3.0 MODIFIER LETTER DOUBLE APOSTROPHE +02EF..02FF ; valid ; ; NV8 # 4.0 MODIFIER LETTER LOW DOWN ARROWHEAD..MODIFIER LETTER LOW LEFT ARROW +0300..033F ; valid # 1.1 COMBINING GRAVE ACCENT..COMBINING DOUBLE OVERLINE +0340 ; mapped ; 0300 # 1.1 COMBINING GRAVE TONE MARK +0341 ; mapped ; 0301 # 1.1 COMBINING ACUTE TONE MARK +0342 ; valid # 1.1 COMBINING GREEK PERISPOMENI +0343 ; mapped ; 0313 # 1.1 COMBINING GREEK KORONIS +0344 ; mapped ; 0308 0301 # 1.1 COMBINING GREEK DIALYTIKA TONOS +0345 ; mapped ; 03B9 # 1.1 COMBINING GREEK YPOGEGRAMMENI +0346..034E ; valid # 3.0 COMBINING BRIDGE ABOVE..COMBINING UPWARDS ARROW BELOW +034F ; ignored # 3.2 COMBINING GRAPHEME JOINER +0350..0357 ; valid # 4.0 COMBINING RIGHT ARROWHEAD ABOVE..COMBINING RIGHT HALF RING ABOVE +0358..035C ; valid # 4.1 COMBINING DOT ABOVE RIGHT..COMBINING DOUBLE BREVE BELOW +035D..035F ; valid # 4.0 COMBINING DOUBLE BREVE..COMBINING DOUBLE MACRON BELOW +0360..0361 ; valid # 1.1 COMBINING DOUBLE TILDE..COMBINING DOUBLE INVERTED BREVE +0362 ; valid # 3.0 COMBINING DOUBLE RIGHTWARDS ARROW BELOW +0363..036F ; valid # 3.2 COMBINING LATIN SMALL LETTER A..COMBINING LATIN SMALL LETTER X +0370 ; mapped ; 0371 # 5.1 GREEK CAPITAL LETTER HETA +0371 ; valid # 5.1 GREEK SMALL LETTER HETA +0372 ; mapped ; 0373 # 5.1 GREEK CAPITAL LETTER ARCHAIC SAMPI +0373 ; valid # 5.1 GREEK SMALL LETTER ARCHAIC SAMPI +0374 ; mapped ; 02B9 # 1.1 GREEK NUMERAL SIGN +0375 ; valid # 1.1 GREEK LOWER NUMERAL SIGN +0376 ; mapped ; 0377 # 5.1 GREEK CAPITAL LETTER PAMPHYLIAN DIGAMMA +0377 ; valid # 5.1 GREEK SMALL LETTER PAMPHYLIAN DIGAMMA +0378..0379 ; disallowed # NA .. +037A ; disallowed_STD3_mapped ; 0020 03B9 # 1.1 GREEK YPOGEGRAMMENI +037B..037D ; valid # 5.0 GREEK SMALL REVERSED LUNATE SIGMA SYMBOL..GREEK SMALL REVERSED DOTTED LUNATE SIGMA SYMBOL +037E ; disallowed_STD3_mapped ; 003B # 1.1 GREEK QUESTION MARK +037F ; mapped ; 03F3 # 7.0 GREEK CAPITAL LETTER YOT +0380..0383 ; disallowed # NA .. +0384 ; disallowed_STD3_mapped ; 0020 0301 # 1.1 GREEK TONOS +0385 ; disallowed_STD3_mapped ; 0020 0308 0301 #1.1 GREEK DIALYTIKA TONOS +0386 ; mapped ; 03AC # 1.1 GREEK CAPITAL LETTER ALPHA WITH TONOS +0387 ; mapped ; 00B7 # 1.1 GREEK ANO TELEIA +0388 ; mapped ; 03AD # 1.1 GREEK CAPITAL LETTER EPSILON WITH TONOS +0389 ; mapped ; 03AE # 1.1 GREEK CAPITAL LETTER ETA WITH TONOS +038A ; mapped ; 03AF # 1.1 GREEK CAPITAL LETTER IOTA WITH TONOS +038B ; disallowed # NA +038C ; mapped ; 03CC # 1.1 GREEK CAPITAL LETTER OMICRON WITH TONOS +038D ; disallowed # NA +038E ; mapped ; 03CD # 1.1 GREEK CAPITAL LETTER UPSILON WITH TONOS +038F ; mapped ; 03CE # 1.1 GREEK CAPITAL LETTER OMEGA WITH TONOS +0390 ; valid # 1.1 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS +0391 ; mapped ; 03B1 # 1.1 GREEK CAPITAL LETTER ALPHA +0392 ; mapped ; 03B2 # 1.1 GREEK CAPITAL LETTER BETA +0393 ; mapped ; 03B3 # 1.1 GREEK CAPITAL LETTER GAMMA +0394 ; mapped ; 03B4 # 1.1 GREEK CAPITAL LETTER DELTA +0395 ; mapped ; 03B5 # 1.1 GREEK CAPITAL LETTER EPSILON +0396 ; mapped ; 03B6 # 1.1 GREEK CAPITAL LETTER ZETA +0397 ; mapped ; 03B7 # 1.1 GREEK CAPITAL LETTER ETA +0398 ; mapped ; 03B8 # 1.1 GREEK CAPITAL LETTER THETA +0399 ; mapped ; 03B9 # 1.1 GREEK CAPITAL LETTER IOTA +039A ; mapped ; 03BA # 1.1 GREEK CAPITAL LETTER KAPPA +039B ; mapped ; 03BB # 1.1 GREEK CAPITAL LETTER LAMDA +039C ; mapped ; 03BC # 1.1 GREEK CAPITAL LETTER MU +039D ; mapped ; 03BD # 1.1 GREEK CAPITAL LETTER NU +039E ; mapped ; 03BE # 1.1 GREEK CAPITAL LETTER XI +039F ; mapped ; 03BF # 1.1 GREEK CAPITAL LETTER OMICRON +03A0 ; mapped ; 03C0 # 1.1 GREEK CAPITAL LETTER PI +03A1 ; mapped ; 03C1 # 1.1 GREEK CAPITAL LETTER RHO +03A2 ; disallowed # NA +03A3 ; mapped ; 03C3 # 1.1 GREEK CAPITAL LETTER SIGMA +03A4 ; mapped ; 03C4 # 1.1 GREEK CAPITAL LETTER TAU +03A5 ; mapped ; 03C5 # 1.1 GREEK CAPITAL LETTER UPSILON +03A6 ; mapped ; 03C6 # 1.1 GREEK CAPITAL LETTER PHI +03A7 ; mapped ; 03C7 # 1.1 GREEK CAPITAL LETTER CHI +03A8 ; mapped ; 03C8 # 1.1 GREEK CAPITAL LETTER PSI +03A9 ; mapped ; 03C9 # 1.1 GREEK CAPITAL LETTER OMEGA +03AA ; mapped ; 03CA # 1.1 GREEK CAPITAL LETTER IOTA WITH DIALYTIKA +03AB ; mapped ; 03CB # 1.1 GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA +03AC..03C1 ; valid # 1.1 GREEK SMALL LETTER ALPHA WITH TONOS..GREEK SMALL LETTER RHO +03C2 ; deviation ; 03C3 # 1.1 GREEK SMALL LETTER FINAL SIGMA +03C3..03CE ; valid # 1.1 GREEK SMALL LETTER SIGMA..GREEK SMALL LETTER OMEGA WITH TONOS +03CF ; mapped ; 03D7 # 5.1 GREEK CAPITAL KAI SYMBOL +03D0 ; mapped ; 03B2 # 1.1 GREEK BETA SYMBOL +03D1 ; mapped ; 03B8 # 1.1 GREEK THETA SYMBOL +03D2 ; mapped ; 03C5 # 1.1 GREEK UPSILON WITH HOOK SYMBOL +03D3 ; mapped ; 03CD # 1.1 GREEK UPSILON WITH ACUTE AND HOOK SYMBOL +03D4 ; mapped ; 03CB # 1.1 GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL +03D5 ; mapped ; 03C6 # 1.1 GREEK PHI SYMBOL +03D6 ; mapped ; 03C0 # 1.1 GREEK PI SYMBOL +03D7 ; valid # 3.0 GREEK KAI SYMBOL +03D8 ; mapped ; 03D9 # 3.2 GREEK LETTER ARCHAIC KOPPA +03D9 ; valid # 3.2 GREEK SMALL LETTER ARCHAIC KOPPA +03DA ; mapped ; 03DB # 1.1 GREEK LETTER STIGMA +03DB ; valid # 3.0 GREEK SMALL LETTER STIGMA +03DC ; mapped ; 03DD # 1.1 GREEK LETTER DIGAMMA +03DD ; valid # 3.0 GREEK SMALL LETTER DIGAMMA +03DE ; mapped ; 03DF # 1.1 GREEK LETTER KOPPA +03DF ; valid # 3.0 GREEK SMALL LETTER KOPPA +03E0 ; mapped ; 03E1 # 1.1 GREEK LETTER SAMPI +03E1 ; valid # 3.0 GREEK SMALL LETTER SAMPI +03E2 ; mapped ; 03E3 # 1.1 COPTIC CAPITAL LETTER SHEI +03E3 ; valid # 1.1 COPTIC SMALL LETTER SHEI +03E4 ; mapped ; 03E5 # 1.1 COPTIC CAPITAL LETTER FEI +03E5 ; valid # 1.1 COPTIC SMALL LETTER FEI +03E6 ; mapped ; 03E7 # 1.1 COPTIC CAPITAL LETTER KHEI +03E7 ; valid # 1.1 COPTIC SMALL LETTER KHEI +03E8 ; mapped ; 03E9 # 1.1 COPTIC CAPITAL LETTER HORI +03E9 ; valid # 1.1 COPTIC SMALL LETTER HORI +03EA ; mapped ; 03EB # 1.1 COPTIC CAPITAL LETTER GANGIA +03EB ; valid # 1.1 COPTIC SMALL LETTER GANGIA +03EC ; mapped ; 03ED # 1.1 COPTIC CAPITAL LETTER SHIMA +03ED ; valid # 1.1 COPTIC SMALL LETTER SHIMA +03EE ; mapped ; 03EF # 1.1 COPTIC CAPITAL LETTER DEI +03EF ; valid # 1.1 COPTIC SMALL LETTER DEI +03F0 ; mapped ; 03BA # 1.1 GREEK KAPPA SYMBOL +03F1 ; mapped ; 03C1 # 1.1 GREEK RHO SYMBOL +03F2 ; mapped ; 03C3 # 1.1 GREEK LUNATE SIGMA SYMBOL +03F3 ; valid # 1.1 GREEK LETTER YOT +03F4 ; mapped ; 03B8 # 3.1 GREEK CAPITAL THETA SYMBOL +03F5 ; mapped ; 03B5 # 3.1 GREEK LUNATE EPSILON SYMBOL +03F6 ; valid ; ; NV8 # 3.2 GREEK REVERSED LUNATE EPSILON SYMBOL +03F7 ; mapped ; 03F8 # 4.0 GREEK CAPITAL LETTER SHO +03F8 ; valid # 4.0 GREEK SMALL LETTER SHO +03F9 ; mapped ; 03C3 # 4.0 GREEK CAPITAL LUNATE SIGMA SYMBOL +03FA ; mapped ; 03FB # 4.0 GREEK CAPITAL LETTER SAN +03FB ; valid # 4.0 GREEK SMALL LETTER SAN +03FC ; valid # 4.1 GREEK RHO WITH STROKE SYMBOL +03FD ; mapped ; 037B # 4.1 GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL +03FE ; mapped ; 037C # 4.1 GREEK CAPITAL DOTTED LUNATE SIGMA SYMBOL +03FF ; mapped ; 037D # 4.1 GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL +0400 ; mapped ; 0450 # 3.0 CYRILLIC CAPITAL LETTER IE WITH GRAVE +0401 ; mapped ; 0451 # 1.1 CYRILLIC CAPITAL LETTER IO +0402 ; mapped ; 0452 # 1.1 CYRILLIC CAPITAL LETTER DJE +0403 ; mapped ; 0453 # 1.1 CYRILLIC CAPITAL LETTER GJE +0404 ; mapped ; 0454 # 1.1 CYRILLIC CAPITAL LETTER UKRAINIAN IE +0405 ; mapped ; 0455 # 1.1 CYRILLIC CAPITAL LETTER DZE +0406 ; mapped ; 0456 # 1.1 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I +0407 ; mapped ; 0457 # 1.1 CYRILLIC CAPITAL LETTER YI +0408 ; mapped ; 0458 # 1.1 CYRILLIC CAPITAL LETTER JE +0409 ; mapped ; 0459 # 1.1 CYRILLIC CAPITAL LETTER LJE +040A ; mapped ; 045A # 1.1 CYRILLIC CAPITAL LETTER NJE +040B ; mapped ; 045B # 1.1 CYRILLIC CAPITAL LETTER TSHE +040C ; mapped ; 045C # 1.1 CYRILLIC CAPITAL LETTER KJE +040D ; mapped ; 045D # 3.0 CYRILLIC CAPITAL LETTER I WITH GRAVE +040E ; mapped ; 045E # 1.1 CYRILLIC CAPITAL LETTER SHORT U +040F ; mapped ; 045F # 1.1 CYRILLIC CAPITAL LETTER DZHE +0410 ; mapped ; 0430 # 1.1 CYRILLIC CAPITAL LETTER A +0411 ; mapped ; 0431 # 1.1 CYRILLIC CAPITAL LETTER BE +0412 ; mapped ; 0432 # 1.1 CYRILLIC CAPITAL LETTER VE +0413 ; mapped ; 0433 # 1.1 CYRILLIC CAPITAL LETTER GHE +0414 ; mapped ; 0434 # 1.1 CYRILLIC CAPITAL LETTER DE +0415 ; mapped ; 0435 # 1.1 CYRILLIC CAPITAL LETTER IE +0416 ; mapped ; 0436 # 1.1 CYRILLIC CAPITAL LETTER ZHE +0417 ; mapped ; 0437 # 1.1 CYRILLIC CAPITAL LETTER ZE +0418 ; mapped ; 0438 # 1.1 CYRILLIC CAPITAL LETTER I +0419 ; mapped ; 0439 # 1.1 CYRILLIC CAPITAL LETTER SHORT I +041A ; mapped ; 043A # 1.1 CYRILLIC CAPITAL LETTER KA +041B ; mapped ; 043B # 1.1 CYRILLIC CAPITAL LETTER EL +041C ; mapped ; 043C # 1.1 CYRILLIC CAPITAL LETTER EM +041D ; mapped ; 043D # 1.1 CYRILLIC CAPITAL LETTER EN +041E ; mapped ; 043E # 1.1 CYRILLIC CAPITAL LETTER O +041F ; mapped ; 043F # 1.1 CYRILLIC CAPITAL LETTER PE +0420 ; mapped ; 0440 # 1.1 CYRILLIC CAPITAL LETTER ER +0421 ; mapped ; 0441 # 1.1 CYRILLIC CAPITAL LETTER ES +0422 ; mapped ; 0442 # 1.1 CYRILLIC CAPITAL LETTER TE +0423 ; mapped ; 0443 # 1.1 CYRILLIC CAPITAL LETTER U +0424 ; mapped ; 0444 # 1.1 CYRILLIC CAPITAL LETTER EF +0425 ; mapped ; 0445 # 1.1 CYRILLIC CAPITAL LETTER HA +0426 ; mapped ; 0446 # 1.1 CYRILLIC CAPITAL LETTER TSE +0427 ; mapped ; 0447 # 1.1 CYRILLIC CAPITAL LETTER CHE +0428 ; mapped ; 0448 # 1.1 CYRILLIC CAPITAL LETTER SHA +0429 ; mapped ; 0449 # 1.1 CYRILLIC CAPITAL LETTER SHCHA +042A ; mapped ; 044A # 1.1 CYRILLIC CAPITAL LETTER HARD SIGN +042B ; mapped ; 044B # 1.1 CYRILLIC CAPITAL LETTER YERU +042C ; mapped ; 044C # 1.1 CYRILLIC CAPITAL LETTER SOFT SIGN +042D ; mapped ; 044D # 1.1 CYRILLIC CAPITAL LETTER E +042E ; mapped ; 044E # 1.1 CYRILLIC CAPITAL LETTER YU +042F ; mapped ; 044F # 1.1 CYRILLIC CAPITAL LETTER YA +0430..044F ; valid # 1.1 CYRILLIC SMALL LETTER A..CYRILLIC SMALL LETTER YA +0450 ; valid # 3.0 CYRILLIC SMALL LETTER IE WITH GRAVE +0451..045C ; valid # 1.1 CYRILLIC SMALL LETTER IO..CYRILLIC SMALL LETTER KJE +045D ; valid # 3.0 CYRILLIC SMALL LETTER I WITH GRAVE +045E..045F ; valid # 1.1 CYRILLIC SMALL LETTER SHORT U..CYRILLIC SMALL LETTER DZHE +0460 ; mapped ; 0461 # 1.1 CYRILLIC CAPITAL LETTER OMEGA +0461 ; valid # 1.1 CYRILLIC SMALL LETTER OMEGA +0462 ; mapped ; 0463 # 1.1 CYRILLIC CAPITAL LETTER YAT +0463 ; valid # 1.1 CYRILLIC SMALL LETTER YAT +0464 ; mapped ; 0465 # 1.1 CYRILLIC CAPITAL LETTER IOTIFIED E +0465 ; valid # 1.1 CYRILLIC SMALL LETTER IOTIFIED E +0466 ; mapped ; 0467 # 1.1 CYRILLIC CAPITAL LETTER LITTLE YUS +0467 ; valid # 1.1 CYRILLIC SMALL LETTER LITTLE YUS +0468 ; mapped ; 0469 # 1.1 CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS +0469 ; valid # 1.1 CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS +046A ; mapped ; 046B # 1.1 CYRILLIC CAPITAL LETTER BIG YUS +046B ; valid # 1.1 CYRILLIC SMALL LETTER BIG YUS +046C ; mapped ; 046D # 1.1 CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS +046D ; valid # 1.1 CYRILLIC SMALL LETTER IOTIFIED BIG YUS +046E ; mapped ; 046F # 1.1 CYRILLIC CAPITAL LETTER KSI +046F ; valid # 1.1 CYRILLIC SMALL LETTER KSI +0470 ; mapped ; 0471 # 1.1 CYRILLIC CAPITAL LETTER PSI +0471 ; valid # 1.1 CYRILLIC SMALL LETTER PSI +0472 ; mapped ; 0473 # 1.1 CYRILLIC CAPITAL LETTER FITA +0473 ; valid # 1.1 CYRILLIC SMALL LETTER FITA +0474 ; mapped ; 0475 # 1.1 CYRILLIC CAPITAL LETTER IZHITSA +0475 ; valid # 1.1 CYRILLIC SMALL LETTER IZHITSA +0476 ; mapped ; 0477 # 1.1 CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT +0477 ; valid # 1.1 CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT +0478 ; mapped ; 0479 # 1.1 CYRILLIC CAPITAL LETTER UK +0479 ; valid # 1.1 CYRILLIC SMALL LETTER UK +047A ; mapped ; 047B # 1.1 CYRILLIC CAPITAL LETTER ROUND OMEGA +047B ; valid # 1.1 CYRILLIC SMALL LETTER ROUND OMEGA +047C ; mapped ; 047D # 1.1 CYRILLIC CAPITAL LETTER OMEGA WITH TITLO +047D ; valid # 1.1 CYRILLIC SMALL LETTER OMEGA WITH TITLO +047E ; mapped ; 047F # 1.1 CYRILLIC CAPITAL LETTER OT +047F ; valid # 1.1 CYRILLIC SMALL LETTER OT +0480 ; mapped ; 0481 # 1.1 CYRILLIC CAPITAL LETTER KOPPA +0481 ; valid # 1.1 CYRILLIC SMALL LETTER KOPPA +0482 ; valid ; ; NV8 # 1.1 CYRILLIC THOUSANDS SIGN +0483..0486 ; valid # 1.1 COMBINING CYRILLIC TITLO..COMBINING CYRILLIC PSILI PNEUMATA +0487 ; valid # 5.1 COMBINING CYRILLIC POKRYTIE +0488..0489 ; valid ; ; NV8 # 3.0 COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN +048A ; mapped ; 048B # 3.2 CYRILLIC CAPITAL LETTER SHORT I WITH TAIL +048B ; valid # 3.2 CYRILLIC SMALL LETTER SHORT I WITH TAIL +048C ; mapped ; 048D # 3.0 CYRILLIC CAPITAL LETTER SEMISOFT SIGN +048D ; valid # 3.0 CYRILLIC SMALL LETTER SEMISOFT SIGN +048E ; mapped ; 048F # 3.0 CYRILLIC CAPITAL LETTER ER WITH TICK +048F ; valid # 3.0 CYRILLIC SMALL LETTER ER WITH TICK +0490 ; mapped ; 0491 # 1.1 CYRILLIC CAPITAL LETTER GHE WITH UPTURN +0491 ; valid # 1.1 CYRILLIC SMALL LETTER GHE WITH UPTURN +0492 ; mapped ; 0493 # 1.1 CYRILLIC CAPITAL LETTER GHE WITH STROKE +0493 ; valid # 1.1 CYRILLIC SMALL LETTER GHE WITH STROKE +0494 ; mapped ; 0495 # 1.1 CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK +0495 ; valid # 1.1 CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK +0496 ; mapped ; 0497 # 1.1 CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER +0497 ; valid # 1.1 CYRILLIC SMALL LETTER ZHE WITH DESCENDER +0498 ; mapped ; 0499 # 1.1 CYRILLIC CAPITAL LETTER ZE WITH DESCENDER +0499 ; valid # 1.1 CYRILLIC SMALL LETTER ZE WITH DESCENDER +049A ; mapped ; 049B # 1.1 CYRILLIC CAPITAL LETTER KA WITH DESCENDER +049B ; valid # 1.1 CYRILLIC SMALL LETTER KA WITH DESCENDER +049C ; mapped ; 049D # 1.1 CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE +049D ; valid # 1.1 CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE +049E ; mapped ; 049F # 1.1 CYRILLIC CAPITAL LETTER KA WITH STROKE +049F ; valid # 1.1 CYRILLIC SMALL LETTER KA WITH STROKE +04A0 ; mapped ; 04A1 # 1.1 CYRILLIC CAPITAL LETTER BASHKIR KA +04A1 ; valid # 1.1 CYRILLIC SMALL LETTER BASHKIR KA +04A2 ; mapped ; 04A3 # 1.1 CYRILLIC CAPITAL LETTER EN WITH DESCENDER +04A3 ; valid # 1.1 CYRILLIC SMALL LETTER EN WITH DESCENDER +04A4 ; mapped ; 04A5 # 1.1 CYRILLIC CAPITAL LIGATURE EN GHE +04A5 ; valid # 1.1 CYRILLIC SMALL LIGATURE EN GHE +04A6 ; mapped ; 04A7 # 1.1 CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK +04A7 ; valid # 1.1 CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK +04A8 ; mapped ; 04A9 # 1.1 CYRILLIC CAPITAL LETTER ABKHASIAN HA +04A9 ; valid # 1.1 CYRILLIC SMALL LETTER ABKHASIAN HA +04AA ; mapped ; 04AB # 1.1 CYRILLIC CAPITAL LETTER ES WITH DESCENDER +04AB ; valid # 1.1 CYRILLIC SMALL LETTER ES WITH DESCENDER +04AC ; mapped ; 04AD # 1.1 CYRILLIC CAPITAL LETTER TE WITH DESCENDER +04AD ; valid # 1.1 CYRILLIC SMALL LETTER TE WITH DESCENDER +04AE ; mapped ; 04AF # 1.1 CYRILLIC CAPITAL LETTER STRAIGHT U +04AF ; valid # 1.1 CYRILLIC SMALL LETTER STRAIGHT U +04B0 ; mapped ; 04B1 # 1.1 CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE +04B1 ; valid # 1.1 CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE +04B2 ; mapped ; 04B3 # 1.1 CYRILLIC CAPITAL LETTER HA WITH DESCENDER +04B3 ; valid # 1.1 CYRILLIC SMALL LETTER HA WITH DESCENDER +04B4 ; mapped ; 04B5 # 1.1 CYRILLIC CAPITAL LIGATURE TE TSE +04B5 ; valid # 1.1 CYRILLIC SMALL LIGATURE TE TSE +04B6 ; mapped ; 04B7 # 1.1 CYRILLIC CAPITAL LETTER CHE WITH DESCENDER +04B7 ; valid # 1.1 CYRILLIC SMALL LETTER CHE WITH DESCENDER +04B8 ; mapped ; 04B9 # 1.1 CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE +04B9 ; valid # 1.1 CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE +04BA ; mapped ; 04BB # 1.1 CYRILLIC CAPITAL LETTER SHHA +04BB ; valid # 1.1 CYRILLIC SMALL LETTER SHHA +04BC ; mapped ; 04BD # 1.1 CYRILLIC CAPITAL LETTER ABKHASIAN CHE +04BD ; valid # 1.1 CYRILLIC SMALL LETTER ABKHASIAN CHE +04BE ; mapped ; 04BF # 1.1 CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER +04BF ; valid # 1.1 CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER +04C0 ; disallowed # 1.1 CYRILLIC LETTER PALOCHKA +04C1 ; mapped ; 04C2 # 1.1 CYRILLIC CAPITAL LETTER ZHE WITH BREVE +04C2 ; valid # 1.1 CYRILLIC SMALL LETTER ZHE WITH BREVE +04C3 ; mapped ; 04C4 # 1.1 CYRILLIC CAPITAL LETTER KA WITH HOOK +04C4 ; valid # 1.1 CYRILLIC SMALL LETTER KA WITH HOOK +04C5 ; mapped ; 04C6 # 3.2 CYRILLIC CAPITAL LETTER EL WITH TAIL +04C6 ; valid # 3.2 CYRILLIC SMALL LETTER EL WITH TAIL +04C7 ; mapped ; 04C8 # 1.1 CYRILLIC CAPITAL LETTER EN WITH HOOK +04C8 ; valid # 1.1 CYRILLIC SMALL LETTER EN WITH HOOK +04C9 ; mapped ; 04CA # 3.2 CYRILLIC CAPITAL LETTER EN WITH TAIL +04CA ; valid # 3.2 CYRILLIC SMALL LETTER EN WITH TAIL +04CB ; mapped ; 04CC # 1.1 CYRILLIC CAPITAL LETTER KHAKASSIAN CHE +04CC ; valid # 1.1 CYRILLIC SMALL LETTER KHAKASSIAN CHE +04CD ; mapped ; 04CE # 3.2 CYRILLIC CAPITAL LETTER EM WITH TAIL +04CE ; valid # 3.2 CYRILLIC SMALL LETTER EM WITH TAIL +04CF ; valid # 5.0 CYRILLIC SMALL LETTER PALOCHKA +04D0 ; mapped ; 04D1 # 1.1 CYRILLIC CAPITAL LETTER A WITH BREVE +04D1 ; valid # 1.1 CYRILLIC SMALL LETTER A WITH BREVE +04D2 ; mapped ; 04D3 # 1.1 CYRILLIC CAPITAL LETTER A WITH DIAERESIS +04D3 ; valid # 1.1 CYRILLIC SMALL LETTER A WITH DIAERESIS +04D4 ; mapped ; 04D5 # 1.1 CYRILLIC CAPITAL LIGATURE A IE +04D5 ; valid # 1.1 CYRILLIC SMALL LIGATURE A IE +04D6 ; mapped ; 04D7 # 1.1 CYRILLIC CAPITAL LETTER IE WITH BREVE +04D7 ; valid # 1.1 CYRILLIC SMALL LETTER IE WITH BREVE +04D8 ; mapped ; 04D9 # 1.1 CYRILLIC CAPITAL LETTER SCHWA +04D9 ; valid # 1.1 CYRILLIC SMALL LETTER SCHWA +04DA ; mapped ; 04DB # 1.1 CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS +04DB ; valid # 1.1 CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS +04DC ; mapped ; 04DD # 1.1 CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS +04DD ; valid # 1.1 CYRILLIC SMALL LETTER ZHE WITH DIAERESIS +04DE ; mapped ; 04DF # 1.1 CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS +04DF ; valid # 1.1 CYRILLIC SMALL LETTER ZE WITH DIAERESIS +04E0 ; mapped ; 04E1 # 1.1 CYRILLIC CAPITAL LETTER ABKHASIAN DZE +04E1 ; valid # 1.1 CYRILLIC SMALL LETTER ABKHASIAN DZE +04E2 ; mapped ; 04E3 # 1.1 CYRILLIC CAPITAL LETTER I WITH MACRON +04E3 ; valid # 1.1 CYRILLIC SMALL LETTER I WITH MACRON +04E4 ; mapped ; 04E5 # 1.1 CYRILLIC CAPITAL LETTER I WITH DIAERESIS +04E5 ; valid # 1.1 CYRILLIC SMALL LETTER I WITH DIAERESIS +04E6 ; mapped ; 04E7 # 1.1 CYRILLIC CAPITAL LETTER O WITH DIAERESIS +04E7 ; valid # 1.1 CYRILLIC SMALL LETTER O WITH DIAERESIS +04E8 ; mapped ; 04E9 # 1.1 CYRILLIC CAPITAL LETTER BARRED O +04E9 ; valid # 1.1 CYRILLIC SMALL LETTER BARRED O +04EA ; mapped ; 04EB # 1.1 CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS +04EB ; valid # 1.1 CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS +04EC ; mapped ; 04ED # 3.0 CYRILLIC CAPITAL LETTER E WITH DIAERESIS +04ED ; valid # 3.0 CYRILLIC SMALL LETTER E WITH DIAERESIS +04EE ; mapped ; 04EF # 1.1 CYRILLIC CAPITAL LETTER U WITH MACRON +04EF ; valid # 1.1 CYRILLIC SMALL LETTER U WITH MACRON +04F0 ; mapped ; 04F1 # 1.1 CYRILLIC CAPITAL LETTER U WITH DIAERESIS +04F1 ; valid # 1.1 CYRILLIC SMALL LETTER U WITH DIAERESIS +04F2 ; mapped ; 04F3 # 1.1 CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE +04F3 ; valid # 1.1 CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE +04F4 ; mapped ; 04F5 # 1.1 CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS +04F5 ; valid # 1.1 CYRILLIC SMALL LETTER CHE WITH DIAERESIS +04F6 ; mapped ; 04F7 # 4.1 CYRILLIC CAPITAL LETTER GHE WITH DESCENDER +04F7 ; valid # 4.1 CYRILLIC SMALL LETTER GHE WITH DESCENDER +04F8 ; mapped ; 04F9 # 1.1 CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS +04F9 ; valid # 1.1 CYRILLIC SMALL LETTER YERU WITH DIAERESIS +04FA ; mapped ; 04FB # 5.0 CYRILLIC CAPITAL LETTER GHE WITH STROKE AND HOOK +04FB ; valid # 5.0 CYRILLIC SMALL LETTER GHE WITH STROKE AND HOOK +04FC ; mapped ; 04FD # 5.0 CYRILLIC CAPITAL LETTER HA WITH HOOK +04FD ; valid # 5.0 CYRILLIC SMALL LETTER HA WITH HOOK +04FE ; mapped ; 04FF # 5.0 CYRILLIC CAPITAL LETTER HA WITH STROKE +04FF ; valid # 5.0 CYRILLIC SMALL LETTER HA WITH STROKE +0500 ; mapped ; 0501 # 3.2 CYRILLIC CAPITAL LETTER KOMI DE +0501 ; valid # 3.2 CYRILLIC SMALL LETTER KOMI DE +0502 ; mapped ; 0503 # 3.2 CYRILLIC CAPITAL LETTER KOMI DJE +0503 ; valid # 3.2 CYRILLIC SMALL LETTER KOMI DJE +0504 ; mapped ; 0505 # 3.2 CYRILLIC CAPITAL LETTER KOMI ZJE +0505 ; valid # 3.2 CYRILLIC SMALL LETTER KOMI ZJE +0506 ; mapped ; 0507 # 3.2 CYRILLIC CAPITAL LETTER KOMI DZJE +0507 ; valid # 3.2 CYRILLIC SMALL LETTER KOMI DZJE +0508 ; mapped ; 0509 # 3.2 CYRILLIC CAPITAL LETTER KOMI LJE +0509 ; valid # 3.2 CYRILLIC SMALL LETTER KOMI LJE +050A ; mapped ; 050B # 3.2 CYRILLIC CAPITAL LETTER KOMI NJE +050B ; valid # 3.2 CYRILLIC SMALL LETTER KOMI NJE +050C ; mapped ; 050D # 3.2 CYRILLIC CAPITAL LETTER KOMI SJE +050D ; valid # 3.2 CYRILLIC SMALL LETTER KOMI SJE +050E ; mapped ; 050F # 3.2 CYRILLIC CAPITAL LETTER KOMI TJE +050F ; valid # 3.2 CYRILLIC SMALL LETTER KOMI TJE +0510 ; mapped ; 0511 # 5.0 CYRILLIC CAPITAL LETTER REVERSED ZE +0511 ; valid # 5.0 CYRILLIC SMALL LETTER REVERSED ZE +0512 ; mapped ; 0513 # 5.0 CYRILLIC CAPITAL LETTER EL WITH HOOK +0513 ; valid # 5.0 CYRILLIC SMALL LETTER EL WITH HOOK +0514 ; mapped ; 0515 # 5.1 CYRILLIC CAPITAL LETTER LHA +0515 ; valid # 5.1 CYRILLIC SMALL LETTER LHA +0516 ; mapped ; 0517 # 5.1 CYRILLIC CAPITAL LETTER RHA +0517 ; valid # 5.1 CYRILLIC SMALL LETTER RHA +0518 ; mapped ; 0519 # 5.1 CYRILLIC CAPITAL LETTER YAE +0519 ; valid # 5.1 CYRILLIC SMALL LETTER YAE +051A ; mapped ; 051B # 5.1 CYRILLIC CAPITAL LETTER QA +051B ; valid # 5.1 CYRILLIC SMALL LETTER QA +051C ; mapped ; 051D # 5.1 CYRILLIC CAPITAL LETTER WE +051D ; valid # 5.1 CYRILLIC SMALL LETTER WE +051E ; mapped ; 051F # 5.1 CYRILLIC CAPITAL LETTER ALEUT KA +051F ; valid # 5.1 CYRILLIC SMALL LETTER ALEUT KA +0520 ; mapped ; 0521 # 5.1 CYRILLIC CAPITAL LETTER EL WITH MIDDLE HOOK +0521 ; valid # 5.1 CYRILLIC SMALL LETTER EL WITH MIDDLE HOOK +0522 ; mapped ; 0523 # 5.1 CYRILLIC CAPITAL LETTER EN WITH MIDDLE HOOK +0523 ; valid # 5.1 CYRILLIC SMALL LETTER EN WITH MIDDLE HOOK +0524 ; mapped ; 0525 # 5.2 CYRILLIC CAPITAL LETTER PE WITH DESCENDER +0525 ; valid # 5.2 CYRILLIC SMALL LETTER PE WITH DESCENDER +0526 ; mapped ; 0527 # 6.0 CYRILLIC CAPITAL LETTER SHHA WITH DESCENDER +0527 ; valid # 6.0 CYRILLIC SMALL LETTER SHHA WITH DESCENDER +0528 ; mapped ; 0529 # 7.0 CYRILLIC CAPITAL LETTER EN WITH LEFT HOOK +0529 ; valid # 7.0 CYRILLIC SMALL LETTER EN WITH LEFT HOOK +052A ; mapped ; 052B # 7.0 CYRILLIC CAPITAL LETTER DZZHE +052B ; valid # 7.0 CYRILLIC SMALL LETTER DZZHE +052C ; mapped ; 052D # 7.0 CYRILLIC CAPITAL LETTER DCHE +052D ; valid # 7.0 CYRILLIC SMALL LETTER DCHE +052E ; mapped ; 052F # 7.0 CYRILLIC CAPITAL LETTER EL WITH DESCENDER +052F ; valid # 7.0 CYRILLIC SMALL LETTER EL WITH DESCENDER +0530 ; disallowed # NA +0531 ; mapped ; 0561 # 1.1 ARMENIAN CAPITAL LETTER AYB +0532 ; mapped ; 0562 # 1.1 ARMENIAN CAPITAL LETTER BEN +0533 ; mapped ; 0563 # 1.1 ARMENIAN CAPITAL LETTER GIM +0534 ; mapped ; 0564 # 1.1 ARMENIAN CAPITAL LETTER DA +0535 ; mapped ; 0565 # 1.1 ARMENIAN CAPITAL LETTER ECH +0536 ; mapped ; 0566 # 1.1 ARMENIAN CAPITAL LETTER ZA +0537 ; mapped ; 0567 # 1.1 ARMENIAN CAPITAL LETTER EH +0538 ; mapped ; 0568 # 1.1 ARMENIAN CAPITAL LETTER ET +0539 ; mapped ; 0569 # 1.1 ARMENIAN CAPITAL LETTER TO +053A ; mapped ; 056A # 1.1 ARMENIAN CAPITAL LETTER ZHE +053B ; mapped ; 056B # 1.1 ARMENIAN CAPITAL LETTER INI +053C ; mapped ; 056C # 1.1 ARMENIAN CAPITAL LETTER LIWN +053D ; mapped ; 056D # 1.1 ARMENIAN CAPITAL LETTER XEH +053E ; mapped ; 056E # 1.1 ARMENIAN CAPITAL LETTER CA +053F ; mapped ; 056F # 1.1 ARMENIAN CAPITAL LETTER KEN +0540 ; mapped ; 0570 # 1.1 ARMENIAN CAPITAL LETTER HO +0541 ; mapped ; 0571 # 1.1 ARMENIAN CAPITAL LETTER JA +0542 ; mapped ; 0572 # 1.1 ARMENIAN CAPITAL LETTER GHAD +0543 ; mapped ; 0573 # 1.1 ARMENIAN CAPITAL LETTER CHEH +0544 ; mapped ; 0574 # 1.1 ARMENIAN CAPITAL LETTER MEN +0545 ; mapped ; 0575 # 1.1 ARMENIAN CAPITAL LETTER YI +0546 ; mapped ; 0576 # 1.1 ARMENIAN CAPITAL LETTER NOW +0547 ; mapped ; 0577 # 1.1 ARMENIAN CAPITAL LETTER SHA +0548 ; mapped ; 0578 # 1.1 ARMENIAN CAPITAL LETTER VO +0549 ; mapped ; 0579 # 1.1 ARMENIAN CAPITAL LETTER CHA +054A ; mapped ; 057A # 1.1 ARMENIAN CAPITAL LETTER PEH +054B ; mapped ; 057B # 1.1 ARMENIAN CAPITAL LETTER JHEH +054C ; mapped ; 057C # 1.1 ARMENIAN CAPITAL LETTER RA +054D ; mapped ; 057D # 1.1 ARMENIAN CAPITAL LETTER SEH +054E ; mapped ; 057E # 1.1 ARMENIAN CAPITAL LETTER VEW +054F ; mapped ; 057F # 1.1 ARMENIAN CAPITAL LETTER TIWN +0550 ; mapped ; 0580 # 1.1 ARMENIAN CAPITAL LETTER REH +0551 ; mapped ; 0581 # 1.1 ARMENIAN CAPITAL LETTER CO +0552 ; mapped ; 0582 # 1.1 ARMENIAN CAPITAL LETTER YIWN +0553 ; mapped ; 0583 # 1.1 ARMENIAN CAPITAL LETTER PIWR +0554 ; mapped ; 0584 # 1.1 ARMENIAN CAPITAL LETTER KEH +0555 ; mapped ; 0585 # 1.1 ARMENIAN CAPITAL LETTER OH +0556 ; mapped ; 0586 # 1.1 ARMENIAN CAPITAL LETTER FEH +0557..0558 ; disallowed # NA .. +0559 ; valid # 1.1 ARMENIAN MODIFIER LETTER LEFT HALF RING +055A..055F ; valid ; ; NV8 # 1.1 ARMENIAN APOSTROPHE..ARMENIAN ABBREVIATION MARK +0560 ; valid # 11.0 ARMENIAN SMALL LETTER TURNED AYB +0561..0586 ; valid # 1.1 ARMENIAN SMALL LETTER AYB..ARMENIAN SMALL LETTER FEH +0587 ; mapped ; 0565 0582 # 1.1 ARMENIAN SMALL LIGATURE ECH YIWN +0588 ; valid # 11.0 ARMENIAN SMALL LETTER YI WITH STROKE +0589 ; valid ; ; NV8 # 1.1 ARMENIAN FULL STOP +058A ; valid ; ; NV8 # 3.0 ARMENIAN HYPHEN +058B..058C ; disallowed # NA .. +058D..058E ; valid ; ; NV8 # 7.0 RIGHT-FACING ARMENIAN ETERNITY SIGN..LEFT-FACING ARMENIAN ETERNITY SIGN +058F ; valid ; ; NV8 # 6.1 ARMENIAN DRAM SIGN +0590 ; disallowed # NA +0591..05A1 ; valid # 2.0 HEBREW ACCENT ETNAHTA..HEBREW ACCENT PAZER +05A2 ; valid # 4.1 HEBREW ACCENT ATNAH HAFUKH +05A3..05AF ; valid # 2.0 HEBREW ACCENT MUNAH..HEBREW MARK MASORA CIRCLE +05B0..05B9 ; valid # 1.1 HEBREW POINT SHEVA..HEBREW POINT HOLAM +05BA ; valid # 5.0 HEBREW POINT HOLAM HASER FOR VAV +05BB..05BD ; valid # 1.1 HEBREW POINT QUBUTS..HEBREW POINT METEG +05BE ; valid ; ; NV8 # 1.1 HEBREW PUNCTUATION MAQAF +05BF ; valid # 1.1 HEBREW POINT RAFE +05C0 ; valid ; ; NV8 # 1.1 HEBREW PUNCTUATION PASEQ +05C1..05C2 ; valid # 1.1 HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT +05C3 ; valid ; ; NV8 # 1.1 HEBREW PUNCTUATION SOF PASUQ +05C4 ; valid # 2.0 HEBREW MARK UPPER DOT +05C5 ; valid # 4.1 HEBREW MARK LOWER DOT +05C6 ; valid ; ; NV8 # 4.1 HEBREW PUNCTUATION NUN HAFUKHA +05C7 ; valid # 4.1 HEBREW POINT QAMATS QATAN +05C8..05CF ; disallowed # NA .. +05D0..05EA ; valid # 1.1 HEBREW LETTER ALEF..HEBREW LETTER TAV +05EB..05EE ; disallowed # NA .. +05EF ; valid # 11.0 HEBREW YOD TRIANGLE +05F0..05F4 ; valid # 1.1 HEBREW LIGATURE YIDDISH DOUBLE VAV..HEBREW PUNCTUATION GERSHAYIM +05F5..05FF ; disallowed # NA .. +0600..0603 ; disallowed # 4.0 ARABIC NUMBER SIGN..ARABIC SIGN SAFHA +0604 ; disallowed # 6.1 ARABIC SIGN SAMVAT +0605 ; disallowed # 7.0 ARABIC NUMBER MARK ABOVE +0606..060A ; valid ; ; NV8 # 5.1 ARABIC-INDIC CUBE ROOT..ARABIC-INDIC PER TEN THOUSAND SIGN +060B ; valid ; ; NV8 # 4.1 AFGHANI SIGN +060C ; valid ; ; NV8 # 1.1 ARABIC COMMA +060D..060F ; valid ; ; NV8 # 4.0 ARABIC DATE SEPARATOR..ARABIC SIGN MISRA +0610..0615 ; valid # 4.0 ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL HIGH TAH +0616..061A ; valid # 5.1 ARABIC SMALL HIGH LIGATURE ALEF WITH LAM WITH YEH..ARABIC SMALL KASRA +061B ; valid ; ; NV8 # 1.1 ARABIC SEMICOLON +061C ; disallowed # 6.3 ARABIC LETTER MARK +061D ; valid ; ; NV8 # 14.0 ARABIC END OF TEXT MARK +061E ; valid ; ; NV8 # 4.1 ARABIC TRIPLE DOT PUNCTUATION MARK +061F ; valid ; ; NV8 # 1.1 ARABIC QUESTION MARK +0620 ; valid # 6.0 ARABIC LETTER KASHMIRI YEH +0621..063A ; valid # 1.1 ARABIC LETTER HAMZA..ARABIC LETTER GHAIN +063B..063F ; valid # 5.1 ARABIC LETTER KEHEH WITH TWO DOTS ABOVE..ARABIC LETTER FARSI YEH WITH THREE DOTS ABOVE +0640 ; valid ; ; NV8 # 1.1 ARABIC TATWEEL +0641..0652 ; valid # 1.1 ARABIC LETTER FEH..ARABIC SUKUN +0653..0655 ; valid # 3.0 ARABIC MADDAH ABOVE..ARABIC HAMZA BELOW +0656..0658 ; valid # 4.0 ARABIC SUBSCRIPT ALEF..ARABIC MARK NOON GHUNNA +0659..065E ; valid # 4.1 ARABIC ZWARAKAY..ARABIC FATHA WITH TWO DOTS +065F ; valid # 6.0 ARABIC WAVY HAMZA BELOW +0660..0669 ; valid # 1.1 ARABIC-INDIC DIGIT ZERO..ARABIC-INDIC DIGIT NINE +066A..066D ; valid ; ; NV8 # 1.1 ARABIC PERCENT SIGN..ARABIC FIVE POINTED STAR +066E..066F ; valid # 3.2 ARABIC LETTER DOTLESS BEH..ARABIC LETTER DOTLESS QAF +0670..0674 ; valid # 1.1 ARABIC LETTER SUPERSCRIPT ALEF..ARABIC LETTER HIGH HAMZA +0675 ; mapped ; 0627 0674 # 1.1 ARABIC LETTER HIGH HAMZA ALEF +0676 ; mapped ; 0648 0674 # 1.1 ARABIC LETTER HIGH HAMZA WAW +0677 ; mapped ; 06C7 0674 # 1.1 ARABIC LETTER U WITH HAMZA ABOVE +0678 ; mapped ; 064A 0674 # 1.1 ARABIC LETTER HIGH HAMZA YEH +0679..06B7 ; valid # 1.1 ARABIC LETTER TTEH..ARABIC LETTER LAM WITH THREE DOTS ABOVE +06B8..06B9 ; valid # 3.0 ARABIC LETTER LAM WITH THREE DOTS BELOW..ARABIC LETTER NOON WITH DOT BELOW +06BA..06BE ; valid # 1.1 ARABIC LETTER NOON GHUNNA..ARABIC LETTER HEH DOACHASHMEE +06BF ; valid # 3.0 ARABIC LETTER TCHEH WITH DOT ABOVE +06C0..06CE ; valid # 1.1 ARABIC LETTER HEH WITH YEH ABOVE..ARABIC LETTER YEH WITH SMALL V +06CF ; valid # 3.0 ARABIC LETTER WAW WITH DOT ABOVE +06D0..06D3 ; valid # 1.1 ARABIC LETTER E..ARABIC LETTER YEH BARREE WITH HAMZA ABOVE +06D4 ; valid ; ; NV8 # 1.1 ARABIC FULL STOP +06D5..06DC ; valid # 1.1 ARABIC LETTER AE..ARABIC SMALL HIGH SEEN +06DD ; disallowed # 1.1 ARABIC END OF AYAH +06DE ; valid ; ; NV8 # 1.1 ARABIC START OF RUB EL HIZB +06DF..06E8 ; valid # 1.1 ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH NOON +06E9 ; valid ; ; NV8 # 1.1 ARABIC PLACE OF SAJDAH +06EA..06ED ; valid # 1.1 ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM +06EE..06EF ; valid # 4.0 ARABIC LETTER DAL WITH INVERTED V..ARABIC LETTER REH WITH INVERTED V +06F0..06F9 ; valid # 1.1 EXTENDED ARABIC-INDIC DIGIT ZERO..EXTENDED ARABIC-INDIC DIGIT NINE +06FA..06FE ; valid # 3.0 ARABIC LETTER SHEEN WITH DOT BELOW..ARABIC SIGN SINDHI POSTPOSITION MEN +06FF ; valid # 4.0 ARABIC LETTER HEH WITH INVERTED V +0700..070D ; valid ; ; NV8 # 3.0 SYRIAC END OF PARAGRAPH..SYRIAC HARKLEAN ASTERISCUS +070E ; disallowed # NA +070F ; disallowed # 3.0 SYRIAC ABBREVIATION MARK +0710..072C ; valid # 3.0 SYRIAC LETTER ALAPH..SYRIAC LETTER TAW +072D..072F ; valid # 4.0 SYRIAC LETTER PERSIAN BHETH..SYRIAC LETTER PERSIAN DHALATH +0730..074A ; valid # 3.0 SYRIAC PTHAHA ABOVE..SYRIAC BARREKH +074B..074C ; disallowed # NA .. +074D..074F ; valid # 4.0 SYRIAC LETTER SOGDIAN ZHAIN..SYRIAC LETTER SOGDIAN FE +0750..076D ; valid # 4.1 ARABIC LETTER BEH WITH THREE DOTS HORIZONTALLY BELOW..ARABIC LETTER SEEN WITH TWO DOTS VERTICALLY ABOVE +076E..077F ; valid # 5.1 ARABIC LETTER HAH WITH SMALL ARABIC LETTER TAH BELOW..ARABIC LETTER KAF WITH TWO DOTS ABOVE +0780..07B0 ; valid # 3.0 THAANA LETTER HAA..THAANA SUKUN +07B1 ; valid # 3.2 THAANA LETTER NAA +07B2..07BF ; disallowed # NA .. +07C0..07F5 ; valid # 5.0 NKO DIGIT ZERO..NKO LOW TONE APOSTROPHE +07F6..07FA ; valid ; ; NV8 # 5.0 NKO SYMBOL OO DENNEN..NKO LAJANYALAN +07FB..07FC ; disallowed # NA .. +07FD ; valid # 11.0 NKO DANTAYALAN +07FE..07FF ; valid ; ; NV8 # 11.0 NKO DOROME SIGN..NKO TAMAN SIGN +0800..082D ; valid # 5.2 SAMARITAN LETTER ALAF..SAMARITAN MARK NEQUDAA +082E..082F ; disallowed # NA .. +0830..083E ; valid ; ; NV8 # 5.2 SAMARITAN PUNCTUATION NEQUDAA..SAMARITAN PUNCTUATION ANNAAU +083F ; disallowed # NA +0840..085B ; valid # 6.0 MANDAIC LETTER HALQA..MANDAIC GEMINATION MARK +085C..085D ; disallowed # NA .. +085E ; valid ; ; NV8 # 6.0 MANDAIC PUNCTUATION +085F ; disallowed # NA +0860..086A ; valid # 10.0 SYRIAC LETTER MALAYALAM NGA..SYRIAC LETTER MALAYALAM SSA +086B..086F ; disallowed # NA .. +0870..0887 ; valid # 14.0 ARABIC LETTER ALEF WITH ATTACHED FATHA..ARABIC BASELINE ROUND DOT +0888 ; valid ; ; NV8 # 14.0 ARABIC RAISED ROUND DOT +0889..088E ; valid # 14.0 ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC VERTICAL TAIL +088F ; disallowed # NA +0890..0891 ; disallowed # 14.0 ARABIC POUND MARK ABOVE..ARABIC PIASTRE MARK ABOVE +0892..0897 ; disallowed # NA .. +0898..089F ; valid # 14.0 ARABIC SMALL HIGH WORD AL-JUZ..ARABIC HALF MADDA OVER MADDA +08A0 ; valid # 6.1 ARABIC LETTER BEH WITH SMALL V BELOW +08A1 ; valid # 7.0 ARABIC LETTER BEH WITH HAMZA ABOVE +08A2..08AC ; valid # 6.1 ARABIC LETTER JEEM WITH TWO DOTS ABOVE..ARABIC LETTER ROHINGYA YEH +08AD..08B2 ; valid # 7.0 ARABIC LETTER LOW ALEF..ARABIC LETTER ZAIN WITH INVERTED V ABOVE +08B3..08B4 ; valid # 8.0 ARABIC LETTER AIN WITH THREE DOTS BELOW..ARABIC LETTER KAF WITH DOT BELOW +08B5 ; valid # 14.0 ARABIC LETTER QAF WITH DOT BELOW AND NO DOTS ABOVE +08B6..08BD ; valid # 9.0 ARABIC LETTER BEH WITH SMALL MEEM ABOVE..ARABIC LETTER AFRICAN NOON +08BE..08C7 ; valid # 13.0 ARABIC LETTER PEH WITH SMALL V..ARABIC LETTER LAM WITH SMALL ARABIC LETTER TAH ABOVE +08C8..08D2 ; valid # 14.0 ARABIC LETTER GRAF..ARABIC LARGE ROUND DOT INSIDE CIRCLE BELOW +08D3 ; valid # 11.0 ARABIC SMALL LOW WAW +08D4..08E1 ; valid # 9.0 ARABIC SMALL HIGH WORD AR-RUB..ARABIC SMALL HIGH SIGN SAFHA +08E2 ; disallowed # 9.0 ARABIC DISPUTED END OF AYAH +08E3 ; valid # 8.0 ARABIC TURNED DAMMA BELOW +08E4..08FE ; valid # 6.1 ARABIC CURLY FATHA..ARABIC DAMMA WITH DOT +08FF ; valid # 7.0 ARABIC MARK SIDEWAYS NOON GHUNNA +0900 ; valid # 5.2 DEVANAGARI SIGN INVERTED CANDRABINDU +0901..0903 ; valid # 1.1 DEVANAGARI SIGN CANDRABINDU..DEVANAGARI SIGN VISARGA +0904 ; valid # 4.0 DEVANAGARI LETTER SHORT A +0905..0939 ; valid # 1.1 DEVANAGARI LETTER A..DEVANAGARI LETTER HA +093A..093B ; valid # 6.0 DEVANAGARI VOWEL SIGN OE..DEVANAGARI VOWEL SIGN OOE +093C..094D ; valid # 1.1 DEVANAGARI SIGN NUKTA..DEVANAGARI SIGN VIRAMA +094E ; valid # 5.2 DEVANAGARI VOWEL SIGN PRISHTHAMATRA E +094F ; valid # 6.0 DEVANAGARI VOWEL SIGN AW +0950..0954 ; valid # 1.1 DEVANAGARI OM..DEVANAGARI ACUTE ACCENT +0955 ; valid # 5.2 DEVANAGARI VOWEL SIGN CANDRA LONG E +0956..0957 ; valid # 6.0 DEVANAGARI VOWEL SIGN UE..DEVANAGARI VOWEL SIGN UUE +0958 ; mapped ; 0915 093C # 1.1 DEVANAGARI LETTER QA +0959 ; mapped ; 0916 093C # 1.1 DEVANAGARI LETTER KHHA +095A ; mapped ; 0917 093C # 1.1 DEVANAGARI LETTER GHHA +095B ; mapped ; 091C 093C # 1.1 DEVANAGARI LETTER ZA +095C ; mapped ; 0921 093C # 1.1 DEVANAGARI LETTER DDDHA +095D ; mapped ; 0922 093C # 1.1 DEVANAGARI LETTER RHA +095E ; mapped ; 092B 093C # 1.1 DEVANAGARI LETTER FA +095F ; mapped ; 092F 093C # 1.1 DEVANAGARI LETTER YYA +0960..0963 ; valid # 1.1 DEVANAGARI LETTER VOCALIC RR..DEVANAGARI VOWEL SIGN VOCALIC LL +0964..0965 ; valid ; ; NV8 # 1.1 DEVANAGARI DANDA..DEVANAGARI DOUBLE DANDA +0966..096F ; valid # 1.1 DEVANAGARI DIGIT ZERO..DEVANAGARI DIGIT NINE +0970 ; valid ; ; NV8 # 1.1 DEVANAGARI ABBREVIATION SIGN +0971..0972 ; valid # 5.1 DEVANAGARI SIGN HIGH SPACING DOT..DEVANAGARI LETTER CANDRA A +0973..0977 ; valid # 6.0 DEVANAGARI LETTER OE..DEVANAGARI LETTER UUE +0978 ; valid # 7.0 DEVANAGARI LETTER MARWARI DDA +0979..097A ; valid # 5.2 DEVANAGARI LETTER ZHA..DEVANAGARI LETTER HEAVY YA +097B..097C ; valid # 5.0 DEVANAGARI LETTER GGA..DEVANAGARI LETTER JJA +097D ; valid # 4.1 DEVANAGARI LETTER GLOTTAL STOP +097E..097F ; valid # 5.0 DEVANAGARI LETTER DDDA..DEVANAGARI LETTER BBA +0980 ; valid # 7.0 BENGALI ANJI +0981..0983 ; valid # 1.1 BENGALI SIGN CANDRABINDU..BENGALI SIGN VISARGA +0984 ; disallowed # NA +0985..098C ; valid # 1.1 BENGALI LETTER A..BENGALI LETTER VOCALIC L +098D..098E ; disallowed # NA .. +098F..0990 ; valid # 1.1 BENGALI LETTER E..BENGALI LETTER AI +0991..0992 ; disallowed # NA .. +0993..09A8 ; valid # 1.1 BENGALI LETTER O..BENGALI LETTER NA +09A9 ; disallowed # NA +09AA..09B0 ; valid # 1.1 BENGALI LETTER PA..BENGALI LETTER RA +09B1 ; disallowed # NA +09B2 ; valid # 1.1 BENGALI LETTER LA +09B3..09B5 ; disallowed # NA .. +09B6..09B9 ; valid # 1.1 BENGALI LETTER SHA..BENGALI LETTER HA +09BA..09BB ; disallowed # NA .. +09BC ; valid # 1.1 BENGALI SIGN NUKTA +09BD ; valid # 4.0 BENGALI SIGN AVAGRAHA +09BE..09C4 ; valid # 1.1 BENGALI VOWEL SIGN AA..BENGALI VOWEL SIGN VOCALIC RR +09C5..09C6 ; disallowed # NA .. +09C7..09C8 ; valid # 1.1 BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI +09C9..09CA ; disallowed # NA .. +09CB..09CD ; valid # 1.1 BENGALI VOWEL SIGN O..BENGALI SIGN VIRAMA +09CE ; valid # 4.1 BENGALI LETTER KHANDA TA +09CF..09D6 ; disallowed # NA .. +09D7 ; valid # 1.1 BENGALI AU LENGTH MARK +09D8..09DB ; disallowed # NA .. +09DC ; mapped ; 09A1 09BC # 1.1 BENGALI LETTER RRA +09DD ; mapped ; 09A2 09BC # 1.1 BENGALI LETTER RHA +09DE ; disallowed # NA +09DF ; mapped ; 09AF 09BC # 1.1 BENGALI LETTER YYA +09E0..09E3 ; valid # 1.1 BENGALI LETTER VOCALIC RR..BENGALI VOWEL SIGN VOCALIC LL +09E4..09E5 ; disallowed # NA .. +09E6..09F1 ; valid # 1.1 BENGALI DIGIT ZERO..BENGALI LETTER RA WITH LOWER DIAGONAL +09F2..09FA ; valid ; ; NV8 # 1.1 BENGALI RUPEE MARK..BENGALI ISSHAR +09FB ; valid ; ; NV8 # 5.2 BENGALI GANDA MARK +09FC ; valid # 10.0 BENGALI LETTER VEDIC ANUSVARA +09FD ; valid ; ; NV8 # 10.0 BENGALI ABBREVIATION SIGN +09FE ; valid # 11.0 BENGALI SANDHI MARK +09FF..0A00 ; disallowed # NA .. +0A01 ; valid # 4.0 GURMUKHI SIGN ADAK BINDI +0A02 ; valid # 1.1 GURMUKHI SIGN BINDI +0A03 ; valid # 4.0 GURMUKHI SIGN VISARGA +0A04 ; disallowed # NA +0A05..0A0A ; valid # 1.1 GURMUKHI LETTER A..GURMUKHI LETTER UU +0A0B..0A0E ; disallowed # NA .. +0A0F..0A10 ; valid # 1.1 GURMUKHI LETTER EE..GURMUKHI LETTER AI +0A11..0A12 ; disallowed # NA .. +0A13..0A28 ; valid # 1.1 GURMUKHI LETTER OO..GURMUKHI LETTER NA +0A29 ; disallowed # NA +0A2A..0A30 ; valid # 1.1 GURMUKHI LETTER PA..GURMUKHI LETTER RA +0A31 ; disallowed # NA +0A32 ; valid # 1.1 GURMUKHI LETTER LA +0A33 ; mapped ; 0A32 0A3C # 1.1 GURMUKHI LETTER LLA +0A34 ; disallowed # NA +0A35 ; valid # 1.1 GURMUKHI LETTER VA +0A36 ; mapped ; 0A38 0A3C # 1.1 GURMUKHI LETTER SHA +0A37 ; disallowed # NA +0A38..0A39 ; valid # 1.1 GURMUKHI LETTER SA..GURMUKHI LETTER HA +0A3A..0A3B ; disallowed # NA .. +0A3C ; valid # 1.1 GURMUKHI SIGN NUKTA +0A3D ; disallowed # NA +0A3E..0A42 ; valid # 1.1 GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN UU +0A43..0A46 ; disallowed # NA .. +0A47..0A48 ; valid # 1.1 GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI +0A49..0A4A ; disallowed # NA .. +0A4B..0A4D ; valid # 1.1 GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA +0A4E..0A50 ; disallowed # NA .. +0A51 ; valid # 5.1 GURMUKHI SIGN UDAAT +0A52..0A58 ; disallowed # NA .. +0A59 ; mapped ; 0A16 0A3C # 1.1 GURMUKHI LETTER KHHA +0A5A ; mapped ; 0A17 0A3C # 1.1 GURMUKHI LETTER GHHA +0A5B ; mapped ; 0A1C 0A3C # 1.1 GURMUKHI LETTER ZA +0A5C ; valid # 1.1 GURMUKHI LETTER RRA +0A5D ; disallowed # NA +0A5E ; mapped ; 0A2B 0A3C # 1.1 GURMUKHI LETTER FA +0A5F..0A65 ; disallowed # NA .. +0A66..0A74 ; valid # 1.1 GURMUKHI DIGIT ZERO..GURMUKHI EK ONKAR +0A75 ; valid # 5.1 GURMUKHI SIGN YAKASH +0A76 ; valid ; ; NV8 # 11.0 GURMUKHI ABBREVIATION SIGN +0A77..0A80 ; disallowed # NA .. +0A81..0A83 ; valid # 1.1 GUJARATI SIGN CANDRABINDU..GUJARATI SIGN VISARGA +0A84 ; disallowed # NA +0A85..0A8B ; valid # 1.1 GUJARATI LETTER A..GUJARATI LETTER VOCALIC R +0A8C ; valid # 4.0 GUJARATI LETTER VOCALIC L +0A8D ; valid # 1.1 GUJARATI VOWEL CANDRA E +0A8E ; disallowed # NA +0A8F..0A91 ; valid # 1.1 GUJARATI LETTER E..GUJARATI VOWEL CANDRA O +0A92 ; disallowed # NA +0A93..0AA8 ; valid # 1.1 GUJARATI LETTER O..GUJARATI LETTER NA +0AA9 ; disallowed # NA +0AAA..0AB0 ; valid # 1.1 GUJARATI LETTER PA..GUJARATI LETTER RA +0AB1 ; disallowed # NA +0AB2..0AB3 ; valid # 1.1 GUJARATI LETTER LA..GUJARATI LETTER LLA +0AB4 ; disallowed # NA +0AB5..0AB9 ; valid # 1.1 GUJARATI LETTER VA..GUJARATI LETTER HA +0ABA..0ABB ; disallowed # NA .. +0ABC..0AC5 ; valid # 1.1 GUJARATI SIGN NUKTA..GUJARATI VOWEL SIGN CANDRA E +0AC6 ; disallowed # NA +0AC7..0AC9 ; valid # 1.1 GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN CANDRA O +0ACA ; disallowed # NA +0ACB..0ACD ; valid # 1.1 GUJARATI VOWEL SIGN O..GUJARATI SIGN VIRAMA +0ACE..0ACF ; disallowed # NA .. +0AD0 ; valid # 1.1 GUJARATI OM +0AD1..0ADF ; disallowed # NA .. +0AE0 ; valid # 1.1 GUJARATI LETTER VOCALIC RR +0AE1..0AE3 ; valid # 4.0 GUJARATI LETTER VOCALIC LL..GUJARATI VOWEL SIGN VOCALIC LL +0AE4..0AE5 ; disallowed # NA .. +0AE6..0AEF ; valid # 1.1 GUJARATI DIGIT ZERO..GUJARATI DIGIT NINE +0AF0 ; valid ; ; NV8 # 6.1 GUJARATI ABBREVIATION SIGN +0AF1 ; valid ; ; NV8 # 4.0 GUJARATI RUPEE SIGN +0AF2..0AF8 ; disallowed # NA .. +0AF9 ; valid # 8.0 GUJARATI LETTER ZHA +0AFA..0AFF ; valid # 10.0 GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE +0B00 ; disallowed # NA +0B01..0B03 ; valid # 1.1 ORIYA SIGN CANDRABINDU..ORIYA SIGN VISARGA +0B04 ; disallowed # NA +0B05..0B0C ; valid # 1.1 ORIYA LETTER A..ORIYA LETTER VOCALIC L +0B0D..0B0E ; disallowed # NA .. +0B0F..0B10 ; valid # 1.1 ORIYA LETTER E..ORIYA LETTER AI +0B11..0B12 ; disallowed # NA .. +0B13..0B28 ; valid # 1.1 ORIYA LETTER O..ORIYA LETTER NA +0B29 ; disallowed # NA +0B2A..0B30 ; valid # 1.1 ORIYA LETTER PA..ORIYA LETTER RA +0B31 ; disallowed # NA +0B32..0B33 ; valid # 1.1 ORIYA LETTER LA..ORIYA LETTER LLA +0B34 ; disallowed # NA +0B35 ; valid # 4.0 ORIYA LETTER VA +0B36..0B39 ; valid # 1.1 ORIYA LETTER SHA..ORIYA LETTER HA +0B3A..0B3B ; disallowed # NA .. +0B3C..0B43 ; valid # 1.1 ORIYA SIGN NUKTA..ORIYA VOWEL SIGN VOCALIC R +0B44 ; valid # 5.1 ORIYA VOWEL SIGN VOCALIC RR +0B45..0B46 ; disallowed # NA .. +0B47..0B48 ; valid # 1.1 ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI +0B49..0B4A ; disallowed # NA .. +0B4B..0B4D ; valid # 1.1 ORIYA VOWEL SIGN O..ORIYA SIGN VIRAMA +0B4E..0B54 ; disallowed # NA .. +0B55 ; valid # 13.0 ORIYA SIGN OVERLINE +0B56..0B57 ; valid # 1.1 ORIYA AI LENGTH MARK..ORIYA AU LENGTH MARK +0B58..0B5B ; disallowed # NA .. +0B5C ; mapped ; 0B21 0B3C # 1.1 ORIYA LETTER RRA +0B5D ; mapped ; 0B22 0B3C # 1.1 ORIYA LETTER RHA +0B5E ; disallowed # NA +0B5F..0B61 ; valid # 1.1 ORIYA LETTER YYA..ORIYA LETTER VOCALIC LL +0B62..0B63 ; valid # 5.1 ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL +0B64..0B65 ; disallowed # NA .. +0B66..0B6F ; valid # 1.1 ORIYA DIGIT ZERO..ORIYA DIGIT NINE +0B70 ; valid ; ; NV8 # 1.1 ORIYA ISSHAR +0B71 ; valid # 4.0 ORIYA LETTER WA +0B72..0B77 ; valid ; ; NV8 # 6.0 ORIYA FRACTION ONE QUARTER..ORIYA FRACTION THREE SIXTEENTHS +0B78..0B81 ; disallowed # NA .. +0B82..0B83 ; valid # 1.1 TAMIL SIGN ANUSVARA..TAMIL SIGN VISARGA +0B84 ; disallowed # NA +0B85..0B8A ; valid # 1.1 TAMIL LETTER A..TAMIL LETTER UU +0B8B..0B8D ; disallowed # NA .. +0B8E..0B90 ; valid # 1.1 TAMIL LETTER E..TAMIL LETTER AI +0B91 ; disallowed # NA +0B92..0B95 ; valid # 1.1 TAMIL LETTER O..TAMIL LETTER KA +0B96..0B98 ; disallowed # NA .. +0B99..0B9A ; valid # 1.1 TAMIL LETTER NGA..TAMIL LETTER CA +0B9B ; disallowed # NA +0B9C ; valid # 1.1 TAMIL LETTER JA +0B9D ; disallowed # NA +0B9E..0B9F ; valid # 1.1 TAMIL LETTER NYA..TAMIL LETTER TTA +0BA0..0BA2 ; disallowed # NA .. +0BA3..0BA4 ; valid # 1.1 TAMIL LETTER NNA..TAMIL LETTER TA +0BA5..0BA7 ; disallowed # NA .. +0BA8..0BAA ; valid # 1.1 TAMIL LETTER NA..TAMIL LETTER PA +0BAB..0BAD ; disallowed # NA .. +0BAE..0BB5 ; valid # 1.1 TAMIL LETTER MA..TAMIL LETTER VA +0BB6 ; valid # 4.1 TAMIL LETTER SHA +0BB7..0BB9 ; valid # 1.1 TAMIL LETTER SSA..TAMIL LETTER HA +0BBA..0BBD ; disallowed # NA .. +0BBE..0BC2 ; valid # 1.1 TAMIL VOWEL SIGN AA..TAMIL VOWEL SIGN UU +0BC3..0BC5 ; disallowed # NA .. +0BC6..0BC8 ; valid # 1.1 TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI +0BC9 ; disallowed # NA +0BCA..0BCD ; valid # 1.1 TAMIL VOWEL SIGN O..TAMIL SIGN VIRAMA +0BCE..0BCF ; disallowed # NA .. +0BD0 ; valid # 5.1 TAMIL OM +0BD1..0BD6 ; disallowed # NA .. +0BD7 ; valid # 1.1 TAMIL AU LENGTH MARK +0BD8..0BE5 ; disallowed # NA .. +0BE6 ; valid # 4.1 TAMIL DIGIT ZERO +0BE7..0BEF ; valid # 1.1 TAMIL DIGIT ONE..TAMIL DIGIT NINE +0BF0..0BF2 ; valid ; ; NV8 # 1.1 TAMIL NUMBER TEN..TAMIL NUMBER ONE THOUSAND +0BF3..0BFA ; valid ; ; NV8 # 4.0 TAMIL DAY SIGN..TAMIL NUMBER SIGN +0BFB..0BFF ; disallowed # NA .. +0C00 ; valid # 7.0 TELUGU SIGN COMBINING CANDRABINDU ABOVE +0C01..0C03 ; valid # 1.1 TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA +0C04 ; valid # 11.0 TELUGU SIGN COMBINING ANUSVARA ABOVE +0C05..0C0C ; valid # 1.1 TELUGU LETTER A..TELUGU LETTER VOCALIC L +0C0D ; disallowed # NA +0C0E..0C10 ; valid # 1.1 TELUGU LETTER E..TELUGU LETTER AI +0C11 ; disallowed # NA +0C12..0C28 ; valid # 1.1 TELUGU LETTER O..TELUGU LETTER NA +0C29 ; disallowed # NA +0C2A..0C33 ; valid # 1.1 TELUGU LETTER PA..TELUGU LETTER LLA +0C34 ; valid # 7.0 TELUGU LETTER LLLA +0C35..0C39 ; valid # 1.1 TELUGU LETTER VA..TELUGU LETTER HA +0C3A..0C3B ; disallowed # NA .. +0C3C ; valid # 14.0 TELUGU SIGN NUKTA +0C3D ; valid # 5.1 TELUGU SIGN AVAGRAHA +0C3E..0C44 ; valid # 1.1 TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN VOCALIC RR +0C45 ; disallowed # NA +0C46..0C48 ; valid # 1.1 TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI +0C49 ; disallowed # NA +0C4A..0C4D ; valid # 1.1 TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA +0C4E..0C54 ; disallowed # NA .. +0C55..0C56 ; valid # 1.1 TELUGU LENGTH MARK..TELUGU AI LENGTH MARK +0C57 ; disallowed # NA +0C58..0C59 ; valid # 5.1 TELUGU LETTER TSA..TELUGU LETTER DZA +0C5A ; valid # 8.0 TELUGU LETTER RRRA +0C5B..0C5C ; disallowed # NA .. +0C5D ; valid # 14.0 TELUGU LETTER NAKAARA POLLU +0C5E..0C5F ; disallowed # NA .. +0C60..0C61 ; valid # 1.1 TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL +0C62..0C63 ; valid # 5.1 TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL +0C64..0C65 ; disallowed # NA .. +0C66..0C6F ; valid # 1.1 TELUGU DIGIT ZERO..TELUGU DIGIT NINE +0C70..0C76 ; disallowed # NA .. +0C77 ; valid ; ; NV8 # 12.0 TELUGU SIGN SIDDHAM +0C78..0C7F ; valid ; ; NV8 # 5.1 TELUGU FRACTION DIGIT ZERO FOR ODD POWERS OF FOUR..TELUGU SIGN TUUMU +0C80 ; valid # 9.0 KANNADA SIGN SPACING CANDRABINDU +0C81 ; valid # 7.0 KANNADA SIGN CANDRABINDU +0C82..0C83 ; valid # 1.1 KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA +0C84 ; valid ; ; NV8 # 11.0 KANNADA SIGN SIDDHAM +0C85..0C8C ; valid # 1.1 KANNADA LETTER A..KANNADA LETTER VOCALIC L +0C8D ; disallowed # NA +0C8E..0C90 ; valid # 1.1 KANNADA LETTER E..KANNADA LETTER AI +0C91 ; disallowed # NA +0C92..0CA8 ; valid # 1.1 KANNADA LETTER O..KANNADA LETTER NA +0CA9 ; disallowed # NA +0CAA..0CB3 ; valid # 1.1 KANNADA LETTER PA..KANNADA LETTER LLA +0CB4 ; disallowed # NA +0CB5..0CB9 ; valid # 1.1 KANNADA LETTER VA..KANNADA LETTER HA +0CBA..0CBB ; disallowed # NA .. +0CBC..0CBD ; valid # 4.0 KANNADA SIGN NUKTA..KANNADA SIGN AVAGRAHA +0CBE..0CC4 ; valid # 1.1 KANNADA VOWEL SIGN AA..KANNADA VOWEL SIGN VOCALIC RR +0CC5 ; disallowed # NA +0CC6..0CC8 ; valid # 1.1 KANNADA VOWEL SIGN E..KANNADA VOWEL SIGN AI +0CC9 ; disallowed # NA +0CCA..0CCD ; valid # 1.1 KANNADA VOWEL SIGN O..KANNADA SIGN VIRAMA +0CCE..0CD4 ; disallowed # NA .. +0CD5..0CD6 ; valid # 1.1 KANNADA LENGTH MARK..KANNADA AI LENGTH MARK +0CD7..0CDC ; disallowed # NA .. +0CDD ; valid # 14.0 KANNADA LETTER NAKAARA POLLU +0CDE ; valid # 1.1 KANNADA LETTER FA +0CDF ; disallowed # NA +0CE0..0CE1 ; valid # 1.1 KANNADA LETTER VOCALIC RR..KANNADA LETTER VOCALIC LL +0CE2..0CE3 ; valid # 5.0 KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL +0CE4..0CE5 ; disallowed # NA .. +0CE6..0CEF ; valid # 1.1 KANNADA DIGIT ZERO..KANNADA DIGIT NINE +0CF0 ; disallowed # NA +0CF1..0CF2 ; valid # 5.0 KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA +0CF3 ; valid # 15.0 KANNADA SIGN COMBINING ANUSVARA ABOVE RIGHT +0CF4..0CFF ; disallowed # NA .. +0D00 ; valid # 10.0 MALAYALAM SIGN COMBINING ANUSVARA ABOVE +0D01 ; valid # 7.0 MALAYALAM SIGN CANDRABINDU +0D02..0D03 ; valid # 1.1 MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA +0D04 ; valid # 13.0 MALAYALAM LETTER VEDIC ANUSVARA +0D05..0D0C ; valid # 1.1 MALAYALAM LETTER A..MALAYALAM LETTER VOCALIC L +0D0D ; disallowed # NA +0D0E..0D10 ; valid # 1.1 MALAYALAM LETTER E..MALAYALAM LETTER AI +0D11 ; disallowed # NA +0D12..0D28 ; valid # 1.1 MALAYALAM LETTER O..MALAYALAM LETTER NA +0D29 ; valid # 6.0 MALAYALAM LETTER NNNA +0D2A..0D39 ; valid # 1.1 MALAYALAM LETTER PA..MALAYALAM LETTER HA +0D3A ; valid # 6.0 MALAYALAM LETTER TTTA +0D3B..0D3C ; valid # 10.0 MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA +0D3D ; valid # 5.1 MALAYALAM SIGN AVAGRAHA +0D3E..0D43 ; valid # 1.1 MALAYALAM VOWEL SIGN AA..MALAYALAM VOWEL SIGN VOCALIC R +0D44 ; valid # 5.1 MALAYALAM VOWEL SIGN VOCALIC RR +0D45 ; disallowed # NA +0D46..0D48 ; valid # 1.1 MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI +0D49 ; disallowed # NA +0D4A..0D4D ; valid # 1.1 MALAYALAM VOWEL SIGN O..MALAYALAM SIGN VIRAMA +0D4E ; valid # 6.0 MALAYALAM LETTER DOT REPH +0D4F ; valid ; ; NV8 # 9.0 MALAYALAM SIGN PARA +0D50..0D53 ; disallowed # NA .. +0D54..0D56 ; valid # 9.0 MALAYALAM LETTER CHILLU M..MALAYALAM LETTER CHILLU LLL +0D57 ; valid # 1.1 MALAYALAM AU LENGTH MARK +0D58..0D5E ; valid ; ; NV8 # 9.0 MALAYALAM FRACTION ONE ONE-HUNDRED-AND-SIXTIETH..MALAYALAM FRACTION ONE FIFTH +0D5F ; valid # 8.0 MALAYALAM LETTER ARCHAIC II +0D60..0D61 ; valid # 1.1 MALAYALAM LETTER VOCALIC RR..MALAYALAM LETTER VOCALIC LL +0D62..0D63 ; valid # 5.1 MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL +0D64..0D65 ; disallowed # NA .. +0D66..0D6F ; valid # 1.1 MALAYALAM DIGIT ZERO..MALAYALAM DIGIT NINE +0D70..0D75 ; valid ; ; NV8 # 5.1 MALAYALAM NUMBER TEN..MALAYALAM FRACTION THREE QUARTERS +0D76..0D78 ; valid ; ; NV8 # 9.0 MALAYALAM FRACTION ONE SIXTEENTH..MALAYALAM FRACTION THREE SIXTEENTHS +0D79 ; valid ; ; NV8 # 5.1 MALAYALAM DATE MARK +0D7A..0D7F ; valid # 5.1 MALAYALAM LETTER CHILLU NN..MALAYALAM LETTER CHILLU K +0D80 ; disallowed # NA +0D81 ; valid # 13.0 SINHALA SIGN CANDRABINDU +0D82..0D83 ; valid # 3.0 SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA +0D84 ; disallowed # NA +0D85..0D96 ; valid # 3.0 SINHALA LETTER AYANNA..SINHALA LETTER AUYANNA +0D97..0D99 ; disallowed # NA .. +0D9A..0DB1 ; valid # 3.0 SINHALA LETTER ALPAPRAANA KAYANNA..SINHALA LETTER DANTAJA NAYANNA +0DB2 ; disallowed # NA +0DB3..0DBB ; valid # 3.0 SINHALA LETTER SANYAKA DAYANNA..SINHALA LETTER RAYANNA +0DBC ; disallowed # NA +0DBD ; valid # 3.0 SINHALA LETTER DANTAJA LAYANNA +0DBE..0DBF ; disallowed # NA .. +0DC0..0DC6 ; valid # 3.0 SINHALA LETTER VAYANNA..SINHALA LETTER FAYANNA +0DC7..0DC9 ; disallowed # NA .. +0DCA ; valid # 3.0 SINHALA SIGN AL-LAKUNA +0DCB..0DCE ; disallowed # NA .. +0DCF..0DD4 ; valid # 3.0 SINHALA VOWEL SIGN AELA-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA +0DD5 ; disallowed # NA +0DD6 ; valid # 3.0 SINHALA VOWEL SIGN DIGA PAA-PILLA +0DD7 ; disallowed # NA +0DD8..0DDF ; valid # 3.0 SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN GAYANUKITTA +0DE0..0DE5 ; disallowed # NA .. +0DE6..0DEF ; valid # 7.0 SINHALA LITH DIGIT ZERO..SINHALA LITH DIGIT NINE +0DF0..0DF1 ; disallowed # NA .. +0DF2..0DF3 ; valid # 3.0 SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA +0DF4 ; valid ; ; NV8 # 3.0 SINHALA PUNCTUATION KUNDDALIYA +0DF5..0E00 ; disallowed # NA .. +0E01..0E32 ; valid # 1.1 THAI CHARACTER KO KAI..THAI CHARACTER SARA AA +0E33 ; mapped ; 0E4D 0E32 # 1.1 THAI CHARACTER SARA AM +0E34..0E3A ; valid # 1.1 THAI CHARACTER SARA I..THAI CHARACTER PHINTHU +0E3B..0E3E ; disallowed # NA .. +0E3F ; valid ; ; NV8 # 1.1 THAI CURRENCY SYMBOL BAHT +0E40..0E4E ; valid # 1.1 THAI CHARACTER SARA E..THAI CHARACTER YAMAKKAN +0E4F ; valid ; ; NV8 # 1.1 THAI CHARACTER FONGMAN +0E50..0E59 ; valid # 1.1 THAI DIGIT ZERO..THAI DIGIT NINE +0E5A..0E5B ; valid ; ; NV8 # 1.1 THAI CHARACTER ANGKHANKHU..THAI CHARACTER KHOMUT +0E5C..0E80 ; disallowed # NA .. +0E81..0E82 ; valid # 1.1 LAO LETTER KO..LAO LETTER KHO SUNG +0E83 ; disallowed # NA +0E84 ; valid # 1.1 LAO LETTER KHO TAM +0E85 ; disallowed # NA +0E86 ; valid # 12.0 LAO LETTER PALI GHA +0E87..0E88 ; valid # 1.1 LAO LETTER NGO..LAO LETTER CO +0E89 ; valid # 12.0 LAO LETTER PALI CHA +0E8A ; valid # 1.1 LAO LETTER SO TAM +0E8B ; disallowed # NA +0E8C ; valid # 12.0 LAO LETTER PALI JHA +0E8D ; valid # 1.1 LAO LETTER NYO +0E8E..0E93 ; valid # 12.0 LAO LETTER PALI NYA..LAO LETTER PALI NNA +0E94..0E97 ; valid # 1.1 LAO LETTER DO..LAO LETTER THO TAM +0E98 ; valid # 12.0 LAO LETTER PALI DHA +0E99..0E9F ; valid # 1.1 LAO LETTER NO..LAO LETTER FO SUNG +0EA0 ; valid # 12.0 LAO LETTER PALI BHA +0EA1..0EA3 ; valid # 1.1 LAO LETTER MO..LAO LETTER LO LING +0EA4 ; disallowed # NA +0EA5 ; valid # 1.1 LAO LETTER LO LOOT +0EA6 ; disallowed # NA +0EA7 ; valid # 1.1 LAO LETTER WO +0EA8..0EA9 ; valid # 12.0 LAO LETTER SANSKRIT SHA..LAO LETTER SANSKRIT SSA +0EAA..0EAB ; valid # 1.1 LAO LETTER SO SUNG..LAO LETTER HO SUNG +0EAC ; valid # 12.0 LAO LETTER PALI LLA +0EAD..0EB2 ; valid # 1.1 LAO LETTER O..LAO VOWEL SIGN AA +0EB3 ; mapped ; 0ECD 0EB2 # 1.1 LAO VOWEL SIGN AM +0EB4..0EB9 ; valid # 1.1 LAO VOWEL SIGN I..LAO VOWEL SIGN UU +0EBA ; valid # 12.0 LAO SIGN PALI VIRAMA +0EBB..0EBD ; valid # 1.1 LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN NYO +0EBE..0EBF ; disallowed # NA .. +0EC0..0EC4 ; valid # 1.1 LAO VOWEL SIGN E..LAO VOWEL SIGN AI +0EC5 ; disallowed # NA +0EC6 ; valid # 1.1 LAO KO LA +0EC7 ; disallowed # NA +0EC8..0ECD ; valid # 1.1 LAO TONE MAI EK..LAO NIGGAHITA +0ECE ; valid # 15.0 LAO YAMAKKAN +0ECF ; disallowed # NA +0ED0..0ED9 ; valid # 1.1 LAO DIGIT ZERO..LAO DIGIT NINE +0EDA..0EDB ; disallowed # NA .. +0EDC ; mapped ; 0EAB 0E99 # 1.1 LAO HO NO +0EDD ; mapped ; 0EAB 0EA1 # 1.1 LAO HO MO +0EDE..0EDF ; valid # 6.1 LAO LETTER KHMU GO..LAO LETTER KHMU NYO +0EE0..0EFF ; disallowed # NA .. +0F00 ; valid # 2.0 TIBETAN SYLLABLE OM +0F01..0F0A ; valid ; ; NV8 # 2.0 TIBETAN MARK GTER YIG MGO TRUNCATED A..TIBETAN MARK BKA- SHOG YIG MGO +0F0B ; valid # 2.0 TIBETAN MARK INTERSYLLABIC TSHEG +0F0C ; mapped ; 0F0B # 2.0 TIBETAN MARK DELIMITER TSHEG BSTAR +0F0D..0F17 ; valid ; ; NV8 # 2.0 TIBETAN MARK SHAD..TIBETAN ASTROLOGICAL SIGN SGRA GCAN -CHAR RTAGS +0F18..0F19 ; valid # 2.0 TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS +0F1A..0F1F ; valid ; ; NV8 # 2.0 TIBETAN SIGN RDEL DKAR GCIG..TIBETAN SIGN RDEL DKAR RDEL NAG +0F20..0F29 ; valid # 2.0 TIBETAN DIGIT ZERO..TIBETAN DIGIT NINE +0F2A..0F34 ; valid ; ; NV8 # 2.0 TIBETAN DIGIT HALF ONE..TIBETAN MARK BSDUS RTAGS +0F35 ; valid # 2.0 TIBETAN MARK NGAS BZUNG NYI ZLA +0F36 ; valid ; ; NV8 # 2.0 TIBETAN MARK CARET -DZUD RTAGS BZHI MIG CAN +0F37 ; valid # 2.0 TIBETAN MARK NGAS BZUNG SGOR RTAGS +0F38 ; valid ; ; NV8 # 2.0 TIBETAN MARK CHE MGO +0F39 ; valid # 2.0 TIBETAN MARK TSA -PHRU +0F3A..0F3D ; valid ; ; NV8 # 2.0 TIBETAN MARK GUG RTAGS GYON..TIBETAN MARK ANG KHANG GYAS +0F3E..0F42 ; valid # 2.0 TIBETAN SIGN YAR TSHES..TIBETAN LETTER GA +0F43 ; mapped ; 0F42 0FB7 # 2.0 TIBETAN LETTER GHA +0F44..0F47 ; valid # 2.0 TIBETAN LETTER NGA..TIBETAN LETTER JA +0F48 ; disallowed # NA +0F49..0F4C ; valid # 2.0 TIBETAN LETTER NYA..TIBETAN LETTER DDA +0F4D ; mapped ; 0F4C 0FB7 # 2.0 TIBETAN LETTER DDHA +0F4E..0F51 ; valid # 2.0 TIBETAN LETTER NNA..TIBETAN LETTER DA +0F52 ; mapped ; 0F51 0FB7 # 2.0 TIBETAN LETTER DHA +0F53..0F56 ; valid # 2.0 TIBETAN LETTER NA..TIBETAN LETTER BA +0F57 ; mapped ; 0F56 0FB7 # 2.0 TIBETAN LETTER BHA +0F58..0F5B ; valid # 2.0 TIBETAN LETTER MA..TIBETAN LETTER DZA +0F5C ; mapped ; 0F5B 0FB7 # 2.0 TIBETAN LETTER DZHA +0F5D..0F68 ; valid # 2.0 TIBETAN LETTER WA..TIBETAN LETTER A +0F69 ; mapped ; 0F40 0FB5 # 2.0 TIBETAN LETTER KSSA +0F6A ; valid # 3.0 TIBETAN LETTER FIXED-FORM RA +0F6B..0F6C ; valid # 5.1 TIBETAN LETTER KKA..TIBETAN LETTER RRA +0F6D..0F70 ; disallowed # NA .. +0F71..0F72 ; valid # 2.0 TIBETAN VOWEL SIGN AA..TIBETAN VOWEL SIGN I +0F73 ; mapped ; 0F71 0F72 # 2.0 TIBETAN VOWEL SIGN II +0F74 ; valid # 2.0 TIBETAN VOWEL SIGN U +0F75 ; mapped ; 0F71 0F74 # 2.0 TIBETAN VOWEL SIGN UU +0F76 ; mapped ; 0FB2 0F80 # 2.0 TIBETAN VOWEL SIGN VOCALIC R +0F77 ; mapped ; 0FB2 0F71 0F80 #2.0 TIBETAN VOWEL SIGN VOCALIC RR +0F78 ; mapped ; 0FB3 0F80 # 2.0 TIBETAN VOWEL SIGN VOCALIC L +0F79 ; mapped ; 0FB3 0F71 0F80 #2.0 TIBETAN VOWEL SIGN VOCALIC LL +0F7A..0F80 ; valid # 2.0 TIBETAN VOWEL SIGN E..TIBETAN VOWEL SIGN REVERSED I +0F81 ; mapped ; 0F71 0F80 # 2.0 TIBETAN VOWEL SIGN REVERSED II +0F82..0F84 ; valid # 2.0 TIBETAN SIGN NYI ZLA NAA DA..TIBETAN MARK HALANTA +0F85 ; valid ; ; NV8 # 2.0 TIBETAN MARK PALUTA +0F86..0F8B ; valid # 2.0 TIBETAN SIGN LCI RTAGS..TIBETAN SIGN GRU MED RGYINGS +0F8C..0F8F ; valid # 6.0 TIBETAN SIGN INVERTED MCHU CAN..TIBETAN SUBJOINED SIGN INVERTED MCHU CAN +0F90..0F92 ; valid # 2.0 TIBETAN SUBJOINED LETTER KA..TIBETAN SUBJOINED LETTER GA +0F93 ; mapped ; 0F92 0FB7 # 2.0 TIBETAN SUBJOINED LETTER GHA +0F94..0F95 ; valid # 2.0 TIBETAN SUBJOINED LETTER NGA..TIBETAN SUBJOINED LETTER CA +0F96 ; valid # 3.0 TIBETAN SUBJOINED LETTER CHA +0F97 ; valid # 2.0 TIBETAN SUBJOINED LETTER JA +0F98 ; disallowed # NA +0F99..0F9C ; valid # 2.0 TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER DDA +0F9D ; mapped ; 0F9C 0FB7 # 2.0 TIBETAN SUBJOINED LETTER DDHA +0F9E..0FA1 ; valid # 2.0 TIBETAN SUBJOINED LETTER NNA..TIBETAN SUBJOINED LETTER DA +0FA2 ; mapped ; 0FA1 0FB7 # 2.0 TIBETAN SUBJOINED LETTER DHA +0FA3..0FA6 ; valid # 2.0 TIBETAN SUBJOINED LETTER NA..TIBETAN SUBJOINED LETTER BA +0FA7 ; mapped ; 0FA6 0FB7 # 2.0 TIBETAN SUBJOINED LETTER BHA +0FA8..0FAB ; valid # 2.0 TIBETAN SUBJOINED LETTER MA..TIBETAN SUBJOINED LETTER DZA +0FAC ; mapped ; 0FAB 0FB7 # 2.0 TIBETAN SUBJOINED LETTER DZHA +0FAD ; valid # 2.0 TIBETAN SUBJOINED LETTER WA +0FAE..0FB0 ; valid # 3.0 TIBETAN SUBJOINED LETTER ZHA..TIBETAN SUBJOINED LETTER -A +0FB1..0FB7 ; valid # 2.0 TIBETAN SUBJOINED LETTER YA..TIBETAN SUBJOINED LETTER HA +0FB8 ; valid # 3.0 TIBETAN SUBJOINED LETTER A +0FB9 ; mapped ; 0F90 0FB5 # 2.0 TIBETAN SUBJOINED LETTER KSSA +0FBA..0FBC ; valid # 3.0 TIBETAN SUBJOINED LETTER FIXED-FORM WA..TIBETAN SUBJOINED LETTER FIXED-FORM RA +0FBD ; disallowed # NA +0FBE..0FC5 ; valid ; ; NV8 # 3.0 TIBETAN KU RU KHA..TIBETAN SYMBOL RDO RJE +0FC6 ; valid # 3.0 TIBETAN SYMBOL PADMA GDAN +0FC7..0FCC ; valid ; ; NV8 # 3.0 TIBETAN SYMBOL RDO RJE RGYA GRAM..TIBETAN SYMBOL NOR BU BZHI -KHYIL +0FCD ; disallowed # NA +0FCE ; valid ; ; NV8 # 5.1 TIBETAN SIGN RDEL NAG RDEL DKAR +0FCF ; valid ; ; NV8 # 3.0 TIBETAN SIGN RDEL NAG GSUM +0FD0..0FD1 ; valid ; ; NV8 # 4.1 TIBETAN MARK BSKA- SHOG GI MGO RGYAN..TIBETAN MARK MNYAM YIG GI MGO RGYAN +0FD2..0FD4 ; valid ; ; NV8 # 5.1 TIBETAN MARK NYIS TSHEG..TIBETAN MARK CLOSING BRDA RNYING YIG MGO SGAB MA +0FD5..0FD8 ; valid ; ; NV8 # 5.2 RIGHT-FACING SVASTI SIGN..LEFT-FACING SVASTI SIGN WITH DOTS +0FD9..0FDA ; valid ; ; NV8 # 6.0 TIBETAN MARK LEADING MCHAN RTAGS..TIBETAN MARK TRAILING MCHAN RTAGS +0FDB..0FFF ; disallowed # NA .. +1000..1021 ; valid # 3.0 MYANMAR LETTER KA..MYANMAR LETTER A +1022 ; valid # 5.1 MYANMAR LETTER SHAN A +1023..1027 ; valid # 3.0 MYANMAR LETTER I..MYANMAR LETTER E +1028 ; valid # 5.1 MYANMAR LETTER MON E +1029..102A ; valid # 3.0 MYANMAR LETTER O..MYANMAR LETTER AU +102B ; valid # 5.1 MYANMAR VOWEL SIGN TALL AA +102C..1032 ; valid # 3.0 MYANMAR VOWEL SIGN AA..MYANMAR VOWEL SIGN AI +1033..1035 ; valid # 5.1 MYANMAR VOWEL SIGN MON II..MYANMAR VOWEL SIGN E ABOVE +1036..1039 ; valid # 3.0 MYANMAR SIGN ANUSVARA..MYANMAR SIGN VIRAMA +103A..103F ; valid # 5.1 MYANMAR SIGN ASAT..MYANMAR LETTER GREAT SA +1040..1049 ; valid # 3.0 MYANMAR DIGIT ZERO..MYANMAR DIGIT NINE +104A..104F ; valid ; ; NV8 # 3.0 MYANMAR SIGN LITTLE SECTION..MYANMAR SYMBOL GENITIVE +1050..1059 ; valid # 3.0 MYANMAR LETTER SHA..MYANMAR VOWEL SIGN VOCALIC LL +105A..1099 ; valid # 5.1 MYANMAR LETTER MON NGA..MYANMAR SHAN DIGIT NINE +109A..109D ; valid # 5.2 MYANMAR SIGN KHAMTI TONE-1..MYANMAR VOWEL SIGN AITON AI +109E..109F ; valid ; ; NV8 # 5.1 MYANMAR SYMBOL SHAN ONE..MYANMAR SYMBOL SHAN EXCLAMATION +10A0..10C5 ; disallowed # 1.1 GEORGIAN CAPITAL LETTER AN..GEORGIAN CAPITAL LETTER HOE +10C6 ; disallowed # NA +10C7 ; mapped ; 2D27 # 6.1 GEORGIAN CAPITAL LETTER YN +10C8..10CC ; disallowed # NA .. +10CD ; mapped ; 2D2D # 6.1 GEORGIAN CAPITAL LETTER AEN +10CE..10CF ; disallowed # NA .. +10D0..10F6 ; valid # 1.1 GEORGIAN LETTER AN..GEORGIAN LETTER FI +10F7..10F8 ; valid # 3.2 GEORGIAN LETTER YN..GEORGIAN LETTER ELIFI +10F9..10FA ; valid # 4.1 GEORGIAN LETTER TURNED GAN..GEORGIAN LETTER AIN +10FB ; valid ; ; NV8 # 1.1 GEORGIAN PARAGRAPH SEPARATOR +10FC ; mapped ; 10DC # 4.1 MODIFIER LETTER GEORGIAN NAR +10FD..10FF ; valid # 6.1 GEORGIAN LETTER AEN..GEORGIAN LETTER LABIAL SIGN +1100..1159 ; valid ; ; NV8 # 1.1 HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG YEORINHIEUH +115A..115E ; valid ; ; NV8 # 5.2 HANGUL CHOSEONG KIYEOK-TIKEUT..HANGUL CHOSEONG TIKEUT-RIEUL +115F..1160 ; disallowed # 1.1 HANGUL CHOSEONG FILLER..HANGUL JUNGSEONG FILLER +1161..11A2 ; valid ; ; NV8 # 1.1 HANGUL JUNGSEONG A..HANGUL JUNGSEONG SSANGARAEA +11A3..11A7 ; valid ; ; NV8 # 5.2 HANGUL JUNGSEONG A-EU..HANGUL JUNGSEONG O-YAE +11A8..11F9 ; valid ; ; NV8 # 1.1 HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG YEORINHIEUH +11FA..11FF ; valid ; ; NV8 # 5.2 HANGUL JONGSEONG KIYEOK-NIEUN..HANGUL JONGSEONG SSANGNIEUN +1200..1206 ; valid # 3.0 ETHIOPIC SYLLABLE HA..ETHIOPIC SYLLABLE HO +1207 ; valid # 4.1 ETHIOPIC SYLLABLE HOA +1208..1246 ; valid # 3.0 ETHIOPIC SYLLABLE LA..ETHIOPIC SYLLABLE QO +1247 ; valid # 4.1 ETHIOPIC SYLLABLE QOA +1248 ; valid # 3.0 ETHIOPIC SYLLABLE QWA +1249 ; disallowed # NA +124A..124D ; valid # 3.0 ETHIOPIC SYLLABLE QWI..ETHIOPIC SYLLABLE QWE +124E..124F ; disallowed # NA .. +1250..1256 ; valid # 3.0 ETHIOPIC SYLLABLE QHA..ETHIOPIC SYLLABLE QHO +1257 ; disallowed # NA +1258 ; valid # 3.0 ETHIOPIC SYLLABLE QHWA +1259 ; disallowed # NA +125A..125D ; valid # 3.0 ETHIOPIC SYLLABLE QHWI..ETHIOPIC SYLLABLE QHWE +125E..125F ; disallowed # NA .. +1260..1286 ; valid # 3.0 ETHIOPIC SYLLABLE BA..ETHIOPIC SYLLABLE XO +1287 ; valid # 4.1 ETHIOPIC SYLLABLE XOA +1288 ; valid # 3.0 ETHIOPIC SYLLABLE XWA +1289 ; disallowed # NA +128A..128D ; valid # 3.0 ETHIOPIC SYLLABLE XWI..ETHIOPIC SYLLABLE XWE +128E..128F ; disallowed # NA .. +1290..12AE ; valid # 3.0 ETHIOPIC SYLLABLE NA..ETHIOPIC SYLLABLE KO +12AF ; valid # 4.1 ETHIOPIC SYLLABLE KOA +12B0 ; valid # 3.0 ETHIOPIC SYLLABLE KWA +12B1 ; disallowed # NA +12B2..12B5 ; valid # 3.0 ETHIOPIC SYLLABLE KWI..ETHIOPIC SYLLABLE KWE +12B6..12B7 ; disallowed # NA .. +12B8..12BE ; valid # 3.0 ETHIOPIC SYLLABLE KXA..ETHIOPIC SYLLABLE KXO +12BF ; disallowed # NA +12C0 ; valid # 3.0 ETHIOPIC SYLLABLE KXWA +12C1 ; disallowed # NA +12C2..12C5 ; valid # 3.0 ETHIOPIC SYLLABLE KXWI..ETHIOPIC SYLLABLE KXWE +12C6..12C7 ; disallowed # NA .. +12C8..12CE ; valid # 3.0 ETHIOPIC SYLLABLE WA..ETHIOPIC SYLLABLE WO +12CF ; valid # 4.1 ETHIOPIC SYLLABLE WOA +12D0..12D6 ; valid # 3.0 ETHIOPIC SYLLABLE PHARYNGEAL A..ETHIOPIC SYLLABLE PHARYNGEAL O +12D7 ; disallowed # NA +12D8..12EE ; valid # 3.0 ETHIOPIC SYLLABLE ZA..ETHIOPIC SYLLABLE YO +12EF ; valid # 4.1 ETHIOPIC SYLLABLE YOA +12F0..130E ; valid # 3.0 ETHIOPIC SYLLABLE DA..ETHIOPIC SYLLABLE GO +130F ; valid # 4.1 ETHIOPIC SYLLABLE GOA +1310 ; valid # 3.0 ETHIOPIC SYLLABLE GWA +1311 ; disallowed # NA +1312..1315 ; valid # 3.0 ETHIOPIC SYLLABLE GWI..ETHIOPIC SYLLABLE GWE +1316..1317 ; disallowed # NA .. +1318..131E ; valid # 3.0 ETHIOPIC SYLLABLE GGA..ETHIOPIC SYLLABLE GGO +131F ; valid # 4.1 ETHIOPIC SYLLABLE GGWAA +1320..1346 ; valid # 3.0 ETHIOPIC SYLLABLE THA..ETHIOPIC SYLLABLE TZO +1347 ; valid # 4.1 ETHIOPIC SYLLABLE TZOA +1348..135A ; valid # 3.0 ETHIOPIC SYLLABLE FA..ETHIOPIC SYLLABLE FYA +135B..135C ; disallowed # NA .. +135D..135E ; valid # 6.0 ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING VOWEL LENGTH MARK +135F ; valid # 4.1 ETHIOPIC COMBINING GEMINATION MARK +1360 ; valid ; ; NV8 # 4.1 ETHIOPIC SECTION MARK +1361..137C ; valid ; ; NV8 # 3.0 ETHIOPIC WORDSPACE..ETHIOPIC NUMBER TEN THOUSAND +137D..137F ; disallowed # NA .. +1380..138F ; valid # 4.1 ETHIOPIC SYLLABLE SEBATBEIT MWA..ETHIOPIC SYLLABLE PWE +1390..1399 ; valid ; ; NV8 # 4.1 ETHIOPIC TONAL MARK YIZET..ETHIOPIC TONAL MARK KURT +139A..139F ; disallowed # NA .. +13A0..13F4 ; valid # 3.0 CHEROKEE LETTER A..CHEROKEE LETTER YV +13F5 ; valid # 8.0 CHEROKEE LETTER MV +13F6..13F7 ; disallowed # NA .. +13F8 ; mapped ; 13F0 # 8.0 CHEROKEE SMALL LETTER YE +13F9 ; mapped ; 13F1 # 8.0 CHEROKEE SMALL LETTER YI +13FA ; mapped ; 13F2 # 8.0 CHEROKEE SMALL LETTER YO +13FB ; mapped ; 13F3 # 8.0 CHEROKEE SMALL LETTER YU +13FC ; mapped ; 13F4 # 8.0 CHEROKEE SMALL LETTER YV +13FD ; mapped ; 13F5 # 8.0 CHEROKEE SMALL LETTER MV +13FE..13FF ; disallowed # NA .. +1400 ; valid ; ; NV8 # 5.2 CANADIAN SYLLABICS HYPHEN +1401..166C ; valid # 3.0 CANADIAN SYLLABICS E..CANADIAN SYLLABICS CARRIER TTSA +166D..166E ; valid ; ; NV8 # 3.0 CANADIAN SYLLABICS CHI SIGN..CANADIAN SYLLABICS FULL STOP +166F..1676 ; valid # 3.0 CANADIAN SYLLABICS QAI..CANADIAN SYLLABICS NNGAA +1677..167F ; valid # 5.2 CANADIAN SYLLABICS WOODS-CREE THWEE..CANADIAN SYLLABICS BLACKFOOT W +1680 ; disallowed # 3.0 OGHAM SPACE MARK +1681..169A ; valid # 3.0 OGHAM LETTER BEITH..OGHAM LETTER PEITH +169B..169C ; valid ; ; NV8 # 3.0 OGHAM FEATHER MARK..OGHAM REVERSED FEATHER MARK +169D..169F ; disallowed # NA .. +16A0..16EA ; valid # 3.0 RUNIC LETTER FEHU FEOH FE F..RUNIC LETTER X +16EB..16F0 ; valid ; ; NV8 # 3.0 RUNIC SINGLE PUNCTUATION..RUNIC BELGTHOR SYMBOL +16F1..16F8 ; valid # 7.0 RUNIC LETTER K..RUNIC LETTER FRANKS CASKET AESC +16F9..16FF ; disallowed # NA .. +1700..170C ; valid # 3.2 TAGALOG LETTER A..TAGALOG LETTER YA +170D ; valid # 14.0 TAGALOG LETTER RA +170E..1714 ; valid # 3.2 TAGALOG LETTER LA..TAGALOG SIGN VIRAMA +1715 ; valid # 14.0 TAGALOG SIGN PAMUDPOD +1716..171E ; disallowed # NA .. +171F ; valid # 14.0 TAGALOG LETTER ARCHAIC RA +1720..1734 ; valid # 3.2 HANUNOO LETTER A..HANUNOO SIGN PAMUDPOD +1735..1736 ; valid ; ; NV8 # 3.2 PHILIPPINE SINGLE PUNCTUATION..PHILIPPINE DOUBLE PUNCTUATION +1737..173F ; disallowed # NA .. +1740..1753 ; valid # 3.2 BUHID LETTER A..BUHID VOWEL SIGN U +1754..175F ; disallowed # NA .. +1760..176C ; valid # 3.2 TAGBANWA LETTER A..TAGBANWA LETTER YA +176D ; disallowed # NA +176E..1770 ; valid # 3.2 TAGBANWA LETTER LA..TAGBANWA LETTER SA +1771 ; disallowed # NA +1772..1773 ; valid # 3.2 TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U +1774..177F ; disallowed # NA .. +1780..17B3 ; valid # 3.0 KHMER LETTER KA..KHMER INDEPENDENT VOWEL QAU +17B4..17B5 ; disallowed # 3.0 KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA +17B6..17D3 ; valid # 3.0 KHMER VOWEL SIGN AA..KHMER SIGN BATHAMASAT +17D4..17D6 ; valid ; ; NV8 # 3.0 KHMER SIGN KHAN..KHMER SIGN CAMNUC PII KUUH +17D7 ; valid # 3.0 KHMER SIGN LEK TOO +17D8..17DB ; valid ; ; NV8 # 3.0 KHMER SIGN BEYYAL..KHMER CURRENCY SYMBOL RIEL +17DC ; valid # 3.0 KHMER SIGN AVAKRAHASANYA +17DD ; valid # 4.0 KHMER SIGN ATTHACAN +17DE..17DF ; disallowed # NA .. +17E0..17E9 ; valid # 3.0 KHMER DIGIT ZERO..KHMER DIGIT NINE +17EA..17EF ; disallowed # NA .. +17F0..17F9 ; valid ; ; NV8 # 4.0 KHMER SYMBOL LEK ATTAK SON..KHMER SYMBOL LEK ATTAK PRAM-BUON +17FA..17FF ; disallowed # NA .. +1800..1805 ; valid ; ; NV8 # 3.0 MONGOLIAN BIRGA..MONGOLIAN FOUR DOTS +1806 ; disallowed # 3.0 MONGOLIAN TODO SOFT HYPHEN +1807..180A ; valid ; ; NV8 # 3.0 MONGOLIAN SIBE SYLLABLE BOUNDARY MARKER..MONGOLIAN NIRUGU +180B..180D ; ignored # 3.0 MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE +180E ; disallowed # 3.0 MONGOLIAN VOWEL SEPARATOR +180F ; ignored # 14.0 MONGOLIAN FREE VARIATION SELECTOR FOUR +1810..1819 ; valid # 3.0 MONGOLIAN DIGIT ZERO..MONGOLIAN DIGIT NINE +181A..181F ; disallowed # NA .. +1820..1877 ; valid # 3.0 MONGOLIAN LETTER A..MONGOLIAN LETTER MANCHU ZHA +1878 ; valid # 11.0 MONGOLIAN LETTER CHA WITH TWO DOTS +1879..187F ; disallowed # NA .. +1880..18A9 ; valid # 3.0 MONGOLIAN LETTER ALI GALI ANUSVARA ONE..MONGOLIAN LETTER ALI GALI DAGALGA +18AA ; valid # 5.1 MONGOLIAN LETTER MANCHU ALI GALI LHA +18AB..18AF ; disallowed # NA .. +18B0..18F5 ; valid # 5.2 CANADIAN SYLLABICS OY..CANADIAN SYLLABICS CARRIER DENTAL S +18F6..18FF ; disallowed # NA .. +1900..191C ; valid # 4.0 LIMBU VOWEL-CARRIER LETTER..LIMBU LETTER HA +191D..191E ; valid # 7.0 LIMBU LETTER GYAN..LIMBU LETTER TRA +191F ; disallowed # NA +1920..192B ; valid # 4.0 LIMBU VOWEL SIGN A..LIMBU SUBJOINED LETTER WA +192C..192F ; disallowed # NA .. +1930..193B ; valid # 4.0 LIMBU SMALL LETTER KA..LIMBU SIGN SA-I +193C..193F ; disallowed # NA .. +1940 ; valid ; ; NV8 # 4.0 LIMBU SIGN LOO +1941..1943 ; disallowed # NA .. +1944..1945 ; valid ; ; NV8 # 4.0 LIMBU EXCLAMATION MARK..LIMBU QUESTION MARK +1946..196D ; valid # 4.0 LIMBU DIGIT ZERO..TAI LE LETTER AI +196E..196F ; disallowed # NA .. +1970..1974 ; valid # 4.0 TAI LE LETTER TONE-2..TAI LE LETTER TONE-6 +1975..197F ; disallowed # NA .. +1980..19A9 ; valid # 4.1 NEW TAI LUE LETTER HIGH QA..NEW TAI LUE LETTER LOW XVA +19AA..19AB ; valid # 5.2 NEW TAI LUE LETTER HIGH SUA..NEW TAI LUE LETTER LOW SUA +19AC..19AF ; disallowed # NA .. +19B0..19C9 ; valid # 4.1 NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE TONE MARK-2 +19CA..19CF ; disallowed # NA .. +19D0..19D9 ; valid # 4.1 NEW TAI LUE DIGIT ZERO..NEW TAI LUE DIGIT NINE +19DA ; valid ; ; XV8 # 5.2 NEW TAI LUE THAM DIGIT ONE +19DB..19DD ; disallowed # NA .. +19DE..19DF ; valid ; ; NV8 # 4.1 NEW TAI LUE SIGN LAE..NEW TAI LUE SIGN LAEV +19E0..19FF ; valid ; ; NV8 # 4.0 KHMER SYMBOL PATHAMASAT..KHMER SYMBOL DAP-PRAM ROC +1A00..1A1B ; valid # 4.1 BUGINESE LETTER KA..BUGINESE VOWEL SIGN AE +1A1C..1A1D ; disallowed # NA .. +1A1E..1A1F ; valid ; ; NV8 # 4.1 BUGINESE PALLAWA..BUGINESE END OF SECTION +1A20..1A5E ; valid # 5.2 TAI THAM LETTER HIGH KA..TAI THAM CONSONANT SIGN SA +1A5F ; disallowed # NA +1A60..1A7C ; valid # 5.2 TAI THAM SIGN SAKOT..TAI THAM SIGN KHUEN-LUE KARAN +1A7D..1A7E ; disallowed # NA .. +1A7F..1A89 ; valid # 5.2 TAI THAM COMBINING CRYPTOGRAMMIC DOT..TAI THAM HORA DIGIT NINE +1A8A..1A8F ; disallowed # NA .. +1A90..1A99 ; valid # 5.2 TAI THAM THAM DIGIT ZERO..TAI THAM THAM DIGIT NINE +1A9A..1A9F ; disallowed # NA .. +1AA0..1AA6 ; valid ; ; NV8 # 5.2 TAI THAM SIGN WIANG..TAI THAM SIGN REVERSED ROTATED RANA +1AA7 ; valid # 5.2 TAI THAM SIGN MAI YAMOK +1AA8..1AAD ; valid ; ; NV8 # 5.2 TAI THAM SIGN KAAN..TAI THAM SIGN CAANG +1AAE..1AAF ; disallowed # NA .. +1AB0..1ABD ; valid # 7.0 COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW +1ABE ; valid ; ; NV8 # 7.0 COMBINING PARENTHESES OVERLAY +1ABF..1AC0 ; valid # 13.0 COMBINING LATIN SMALL LETTER W BELOW..COMBINING LATIN SMALL LETTER TURNED W BELOW +1AC1..1ACE ; valid # 14.0 COMBINING LEFT PARENTHESIS ABOVE LEFT..COMBINING LATIN SMALL LETTER INSULAR T +1ACF..1AFF ; disallowed # NA .. +1B00..1B4B ; valid # 5.0 BALINESE SIGN ULU RICEM..BALINESE LETTER ASYURA SASAK +1B4C ; valid # 14.0 BALINESE LETTER ARCHAIC JNYA +1B4D..1B4F ; disallowed # NA .. +1B50..1B59 ; valid # 5.0 BALINESE DIGIT ZERO..BALINESE DIGIT NINE +1B5A..1B6A ; valid ; ; NV8 # 5.0 BALINESE PANTI..BALINESE MUSICAL SYMBOL DANG GEDE +1B6B..1B73 ; valid # 5.0 BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG +1B74..1B7C ; valid ; ; NV8 # 5.0 BALINESE MUSICAL SYMBOL RIGHT-HAND OPEN DUG..BALINESE MUSICAL SYMBOL LEFT-HAND OPEN PING +1B7D..1B7E ; valid ; ; NV8 # 14.0 BALINESE PANTI LANTANG..BALINESE PAMADA LANTANG +1B7F ; disallowed # NA +1B80..1BAA ; valid # 5.1 SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PAMAAEH +1BAB..1BAD ; valid # 6.1 SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT SIGN PASANGAN WA +1BAE..1BB9 ; valid # 5.1 SUNDANESE LETTER KHA..SUNDANESE DIGIT NINE +1BBA..1BBF ; valid # 6.1 SUNDANESE AVAGRAHA..SUNDANESE LETTER FINAL M +1BC0..1BF3 ; valid # 6.0 BATAK LETTER A..BATAK PANONGONAN +1BF4..1BFB ; disallowed # NA .. +1BFC..1BFF ; valid ; ; NV8 # 6.0 BATAK SYMBOL BINDU NA METEK..BATAK SYMBOL BINDU PANGOLAT +1C00..1C37 ; valid # 5.1 LEPCHA LETTER KA..LEPCHA SIGN NUKTA +1C38..1C3A ; disallowed # NA .. +1C3B..1C3F ; valid ; ; NV8 # 5.1 LEPCHA PUNCTUATION TA-ROL..LEPCHA PUNCTUATION TSHOOK +1C40..1C49 ; valid # 5.1 LEPCHA DIGIT ZERO..LEPCHA DIGIT NINE +1C4A..1C4C ; disallowed # NA .. +1C4D..1C7D ; valid # 5.1 LEPCHA LETTER TTA..OL CHIKI AHAD +1C7E..1C7F ; valid ; ; NV8 # 5.1 OL CHIKI PUNCTUATION MUCAAD..OL CHIKI PUNCTUATION DOUBLE MUCAAD +1C80 ; mapped ; 0432 # 9.0 CYRILLIC SMALL LETTER ROUNDED VE +1C81 ; mapped ; 0434 # 9.0 CYRILLIC SMALL LETTER LONG-LEGGED DE +1C82 ; mapped ; 043E # 9.0 CYRILLIC SMALL LETTER NARROW O +1C83 ; mapped ; 0441 # 9.0 CYRILLIC SMALL LETTER WIDE ES +1C84..1C85 ; mapped ; 0442 # 9.0 CYRILLIC SMALL LETTER TALL TE..CYRILLIC SMALL LETTER THREE-LEGGED TE +1C86 ; mapped ; 044A # 9.0 CYRILLIC SMALL LETTER TALL HARD SIGN +1C87 ; mapped ; 0463 # 9.0 CYRILLIC SMALL LETTER TALL YAT +1C88 ; mapped ; A64B # 9.0 CYRILLIC SMALL LETTER UNBLENDED UK +1C89..1C8F ; disallowed # NA .. +1C90 ; mapped ; 10D0 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER AN +1C91 ; mapped ; 10D1 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER BAN +1C92 ; mapped ; 10D2 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER GAN +1C93 ; mapped ; 10D3 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER DON +1C94 ; mapped ; 10D4 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER EN +1C95 ; mapped ; 10D5 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER VIN +1C96 ; mapped ; 10D6 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER ZEN +1C97 ; mapped ; 10D7 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER TAN +1C98 ; mapped ; 10D8 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER IN +1C99 ; mapped ; 10D9 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER KAN +1C9A ; mapped ; 10DA # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER LAS +1C9B ; mapped ; 10DB # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER MAN +1C9C ; mapped ; 10DC # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER NAR +1C9D ; mapped ; 10DD # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER ON +1C9E ; mapped ; 10DE # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER PAR +1C9F ; mapped ; 10DF # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER ZHAR +1CA0 ; mapped ; 10E0 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER RAE +1CA1 ; mapped ; 10E1 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER SAN +1CA2 ; mapped ; 10E2 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER TAR +1CA3 ; mapped ; 10E3 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER UN +1CA4 ; mapped ; 10E4 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER PHAR +1CA5 ; mapped ; 10E5 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER KHAR +1CA6 ; mapped ; 10E6 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER GHAN +1CA7 ; mapped ; 10E7 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER QAR +1CA8 ; mapped ; 10E8 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER SHIN +1CA9 ; mapped ; 10E9 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER CHIN +1CAA ; mapped ; 10EA # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER CAN +1CAB ; mapped ; 10EB # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER JIL +1CAC ; mapped ; 10EC # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER CIL +1CAD ; mapped ; 10ED # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER CHAR +1CAE ; mapped ; 10EE # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER XAN +1CAF ; mapped ; 10EF # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER JHAN +1CB0 ; mapped ; 10F0 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER HAE +1CB1 ; mapped ; 10F1 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER HE +1CB2 ; mapped ; 10F2 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER HIE +1CB3 ; mapped ; 10F3 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER WE +1CB4 ; mapped ; 10F4 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER HAR +1CB5 ; mapped ; 10F5 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER HOE +1CB6 ; mapped ; 10F6 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER FI +1CB7 ; mapped ; 10F7 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER YN +1CB8 ; mapped ; 10F8 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER ELIFI +1CB9 ; mapped ; 10F9 # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER TURNED GAN +1CBA ; mapped ; 10FA # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER AIN +1CBB..1CBC ; disallowed # NA .. +1CBD ; mapped ; 10FD # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER AEN +1CBE ; mapped ; 10FE # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER HARD SIGN +1CBF ; mapped ; 10FF # 11.0 GEORGIAN MTAVRULI CAPITAL LETTER LABIAL SIGN +1CC0..1CC7 ; valid ; ; NV8 # 6.1 SUNDANESE PUNCTUATION BINDU SURYA..SUNDANESE PUNCTUATION BINDU BA SATANGA +1CC8..1CCF ; disallowed # NA .. +1CD0..1CD2 ; valid # 5.2 VEDIC TONE KARSHANA..VEDIC TONE PRENKHA +1CD3 ; valid ; ; NV8 # 5.2 VEDIC SIGN NIHSHVASA +1CD4..1CF2 ; valid # 5.2 VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC SIGN ARDHAVISARGA +1CF3..1CF6 ; valid # 6.1 VEDIC SIGN ROTATED ARDHAVISARGA..VEDIC SIGN UPADHMANIYA +1CF7 ; valid # 10.0 VEDIC SIGN ATIKRAMA +1CF8..1CF9 ; valid # 7.0 VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE +1CFA ; valid # 12.0 VEDIC SIGN DOUBLE ANUSVARA ANTARGOMUKHA +1CFB..1CFF ; disallowed # NA .. +1D00..1D2B ; valid # 4.0 LATIN LETTER SMALL CAPITAL A..CYRILLIC LETTER SMALL CAPITAL EL +1D2C ; mapped ; 0061 # 4.0 MODIFIER LETTER CAPITAL A +1D2D ; mapped ; 00E6 # 4.0 MODIFIER LETTER CAPITAL AE +1D2E ; mapped ; 0062 # 4.0 MODIFIER LETTER CAPITAL B +1D2F ; valid # 4.0 MODIFIER LETTER CAPITAL BARRED B +1D30 ; mapped ; 0064 # 4.0 MODIFIER LETTER CAPITAL D +1D31 ; mapped ; 0065 # 4.0 MODIFIER LETTER CAPITAL E +1D32 ; mapped ; 01DD # 4.0 MODIFIER LETTER CAPITAL REVERSED E +1D33 ; mapped ; 0067 # 4.0 MODIFIER LETTER CAPITAL G +1D34 ; mapped ; 0068 # 4.0 MODIFIER LETTER CAPITAL H +1D35 ; mapped ; 0069 # 4.0 MODIFIER LETTER CAPITAL I +1D36 ; mapped ; 006A # 4.0 MODIFIER LETTER CAPITAL J +1D37 ; mapped ; 006B # 4.0 MODIFIER LETTER CAPITAL K +1D38 ; mapped ; 006C # 4.0 MODIFIER LETTER CAPITAL L +1D39 ; mapped ; 006D # 4.0 MODIFIER LETTER CAPITAL M +1D3A ; mapped ; 006E # 4.0 MODIFIER LETTER CAPITAL N +1D3B ; valid # 4.0 MODIFIER LETTER CAPITAL REVERSED N +1D3C ; mapped ; 006F # 4.0 MODIFIER LETTER CAPITAL O +1D3D ; mapped ; 0223 # 4.0 MODIFIER LETTER CAPITAL OU +1D3E ; mapped ; 0070 # 4.0 MODIFIER LETTER CAPITAL P +1D3F ; mapped ; 0072 # 4.0 MODIFIER LETTER CAPITAL R +1D40 ; mapped ; 0074 # 4.0 MODIFIER LETTER CAPITAL T +1D41 ; mapped ; 0075 # 4.0 MODIFIER LETTER CAPITAL U +1D42 ; mapped ; 0077 # 4.0 MODIFIER LETTER CAPITAL W +1D43 ; mapped ; 0061 # 4.0 MODIFIER LETTER SMALL A +1D44 ; mapped ; 0250 # 4.0 MODIFIER LETTER SMALL TURNED A +1D45 ; mapped ; 0251 # 4.0 MODIFIER LETTER SMALL ALPHA +1D46 ; mapped ; 1D02 # 4.0 MODIFIER LETTER SMALL TURNED AE +1D47 ; mapped ; 0062 # 4.0 MODIFIER LETTER SMALL B +1D48 ; mapped ; 0064 # 4.0 MODIFIER LETTER SMALL D +1D49 ; mapped ; 0065 # 4.0 MODIFIER LETTER SMALL E +1D4A ; mapped ; 0259 # 4.0 MODIFIER LETTER SMALL SCHWA +1D4B ; mapped ; 025B # 4.0 MODIFIER LETTER SMALL OPEN E +1D4C ; mapped ; 025C # 4.0 MODIFIER LETTER SMALL TURNED OPEN E +1D4D ; mapped ; 0067 # 4.0 MODIFIER LETTER SMALL G +1D4E ; valid # 4.0 MODIFIER LETTER SMALL TURNED I +1D4F ; mapped ; 006B # 4.0 MODIFIER LETTER SMALL K +1D50 ; mapped ; 006D # 4.0 MODIFIER LETTER SMALL M +1D51 ; mapped ; 014B # 4.0 MODIFIER LETTER SMALL ENG +1D52 ; mapped ; 006F # 4.0 MODIFIER LETTER SMALL O +1D53 ; mapped ; 0254 # 4.0 MODIFIER LETTER SMALL OPEN O +1D54 ; mapped ; 1D16 # 4.0 MODIFIER LETTER SMALL TOP HALF O +1D55 ; mapped ; 1D17 # 4.0 MODIFIER LETTER SMALL BOTTOM HALF O +1D56 ; mapped ; 0070 # 4.0 MODIFIER LETTER SMALL P +1D57 ; mapped ; 0074 # 4.0 MODIFIER LETTER SMALL T +1D58 ; mapped ; 0075 # 4.0 MODIFIER LETTER SMALL U +1D59 ; mapped ; 1D1D # 4.0 MODIFIER LETTER SMALL SIDEWAYS U +1D5A ; mapped ; 026F # 4.0 MODIFIER LETTER SMALL TURNED M +1D5B ; mapped ; 0076 # 4.0 MODIFIER LETTER SMALL V +1D5C ; mapped ; 1D25 # 4.0 MODIFIER LETTER SMALL AIN +1D5D ; mapped ; 03B2 # 4.0 MODIFIER LETTER SMALL BETA +1D5E ; mapped ; 03B3 # 4.0 MODIFIER LETTER SMALL GREEK GAMMA +1D5F ; mapped ; 03B4 # 4.0 MODIFIER LETTER SMALL DELTA +1D60 ; mapped ; 03C6 # 4.0 MODIFIER LETTER SMALL GREEK PHI +1D61 ; mapped ; 03C7 # 4.0 MODIFIER LETTER SMALL CHI +1D62 ; mapped ; 0069 # 4.0 LATIN SUBSCRIPT SMALL LETTER I +1D63 ; mapped ; 0072 # 4.0 LATIN SUBSCRIPT SMALL LETTER R +1D64 ; mapped ; 0075 # 4.0 LATIN SUBSCRIPT SMALL LETTER U +1D65 ; mapped ; 0076 # 4.0 LATIN SUBSCRIPT SMALL LETTER V +1D66 ; mapped ; 03B2 # 4.0 GREEK SUBSCRIPT SMALL LETTER BETA +1D67 ; mapped ; 03B3 # 4.0 GREEK SUBSCRIPT SMALL LETTER GAMMA +1D68 ; mapped ; 03C1 # 4.0 GREEK SUBSCRIPT SMALL LETTER RHO +1D69 ; mapped ; 03C6 # 4.0 GREEK SUBSCRIPT SMALL LETTER PHI +1D6A ; mapped ; 03C7 # 4.0 GREEK SUBSCRIPT SMALL LETTER CHI +1D6B ; valid # 4.0 LATIN SMALL LETTER UE +1D6C..1D77 ; valid # 4.1 LATIN SMALL LETTER B WITH MIDDLE TILDE..LATIN SMALL LETTER TURNED G +1D78 ; mapped ; 043D # 4.1 MODIFIER LETTER CYRILLIC EN +1D79..1D9A ; valid # 4.1 LATIN SMALL LETTER INSULAR G..LATIN SMALL LETTER EZH WITH RETROFLEX HOOK +1D9B ; mapped ; 0252 # 4.1 MODIFIER LETTER SMALL TURNED ALPHA +1D9C ; mapped ; 0063 # 4.1 MODIFIER LETTER SMALL C +1D9D ; mapped ; 0255 # 4.1 MODIFIER LETTER SMALL C WITH CURL +1D9E ; mapped ; 00F0 # 4.1 MODIFIER LETTER SMALL ETH +1D9F ; mapped ; 025C # 4.1 MODIFIER LETTER SMALL REVERSED OPEN E +1DA0 ; mapped ; 0066 # 4.1 MODIFIER LETTER SMALL F +1DA1 ; mapped ; 025F # 4.1 MODIFIER LETTER SMALL DOTLESS J WITH STROKE +1DA2 ; mapped ; 0261 # 4.1 MODIFIER LETTER SMALL SCRIPT G +1DA3 ; mapped ; 0265 # 4.1 MODIFIER LETTER SMALL TURNED H +1DA4 ; mapped ; 0268 # 4.1 MODIFIER LETTER SMALL I WITH STROKE +1DA5 ; mapped ; 0269 # 4.1 MODIFIER LETTER SMALL IOTA +1DA6 ; mapped ; 026A # 4.1 MODIFIER LETTER SMALL CAPITAL I +1DA7 ; mapped ; 1D7B # 4.1 MODIFIER LETTER SMALL CAPITAL I WITH STROKE +1DA8 ; mapped ; 029D # 4.1 MODIFIER LETTER SMALL J WITH CROSSED-TAIL +1DA9 ; mapped ; 026D # 4.1 MODIFIER LETTER SMALL L WITH RETROFLEX HOOK +1DAA ; mapped ; 1D85 # 4.1 MODIFIER LETTER SMALL L WITH PALATAL HOOK +1DAB ; mapped ; 029F # 4.1 MODIFIER LETTER SMALL CAPITAL L +1DAC ; mapped ; 0271 # 4.1 MODIFIER LETTER SMALL M WITH HOOK +1DAD ; mapped ; 0270 # 4.1 MODIFIER LETTER SMALL TURNED M WITH LONG LEG +1DAE ; mapped ; 0272 # 4.1 MODIFIER LETTER SMALL N WITH LEFT HOOK +1DAF ; mapped ; 0273 # 4.1 MODIFIER LETTER SMALL N WITH RETROFLEX HOOK +1DB0 ; mapped ; 0274 # 4.1 MODIFIER LETTER SMALL CAPITAL N +1DB1 ; mapped ; 0275 # 4.1 MODIFIER LETTER SMALL BARRED O +1DB2 ; mapped ; 0278 # 4.1 MODIFIER LETTER SMALL PHI +1DB3 ; mapped ; 0282 # 4.1 MODIFIER LETTER SMALL S WITH HOOK +1DB4 ; mapped ; 0283 # 4.1 MODIFIER LETTER SMALL ESH +1DB5 ; mapped ; 01AB # 4.1 MODIFIER LETTER SMALL T WITH PALATAL HOOK +1DB6 ; mapped ; 0289 # 4.1 MODIFIER LETTER SMALL U BAR +1DB7 ; mapped ; 028A # 4.1 MODIFIER LETTER SMALL UPSILON +1DB8 ; mapped ; 1D1C # 4.1 MODIFIER LETTER SMALL CAPITAL U +1DB9 ; mapped ; 028B # 4.1 MODIFIER LETTER SMALL V WITH HOOK +1DBA ; mapped ; 028C # 4.1 MODIFIER LETTER SMALL TURNED V +1DBB ; mapped ; 007A # 4.1 MODIFIER LETTER SMALL Z +1DBC ; mapped ; 0290 # 4.1 MODIFIER LETTER SMALL Z WITH RETROFLEX HOOK +1DBD ; mapped ; 0291 # 4.1 MODIFIER LETTER SMALL Z WITH CURL +1DBE ; mapped ; 0292 # 4.1 MODIFIER LETTER SMALL EZH +1DBF ; mapped ; 03B8 # 4.1 MODIFIER LETTER SMALL THETA +1DC0..1DC3 ; valid # 4.1 COMBINING DOTTED GRAVE ACCENT..COMBINING SUSPENSION MARK +1DC4..1DCA ; valid # 5.0 COMBINING MACRON-ACUTE..COMBINING LATIN SMALL LETTER R BELOW +1DCB..1DE6 ; valid # 5.1 COMBINING BREVE-MACRON..COMBINING LATIN SMALL LETTER Z +1DE7..1DF5 ; valid # 7.0 COMBINING LATIN SMALL LETTER ALPHA..COMBINING UP TACK ABOVE +1DF6..1DF9 ; valid # 10.0 COMBINING KAVYKA ABOVE RIGHT..COMBINING WIDE INVERTED BRIDGE BELOW +1DFA ; valid # 14.0 COMBINING DOT BELOW LEFT +1DFB ; valid # 9.0 COMBINING DELETION MARK +1DFC ; valid # 6.0 COMBINING DOUBLE INVERTED BREVE BELOW +1DFD ; valid # 5.2 COMBINING ALMOST EQUAL TO BELOW +1DFE..1DFF ; valid # 5.0 COMBINING LEFT ARROWHEAD ABOVE..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW +1E00 ; mapped ; 1E01 # 1.1 LATIN CAPITAL LETTER A WITH RING BELOW +1E01 ; valid # 1.1 LATIN SMALL LETTER A WITH RING BELOW +1E02 ; mapped ; 1E03 # 1.1 LATIN CAPITAL LETTER B WITH DOT ABOVE +1E03 ; valid # 1.1 LATIN SMALL LETTER B WITH DOT ABOVE +1E04 ; mapped ; 1E05 # 1.1 LATIN CAPITAL LETTER B WITH DOT BELOW +1E05 ; valid # 1.1 LATIN SMALL LETTER B WITH DOT BELOW +1E06 ; mapped ; 1E07 # 1.1 LATIN CAPITAL LETTER B WITH LINE BELOW +1E07 ; valid # 1.1 LATIN SMALL LETTER B WITH LINE BELOW +1E08 ; mapped ; 1E09 # 1.1 LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE +1E09 ; valid # 1.1 LATIN SMALL LETTER C WITH CEDILLA AND ACUTE +1E0A ; mapped ; 1E0B # 1.1 LATIN CAPITAL LETTER D WITH DOT ABOVE +1E0B ; valid # 1.1 LATIN SMALL LETTER D WITH DOT ABOVE +1E0C ; mapped ; 1E0D # 1.1 LATIN CAPITAL LETTER D WITH DOT BELOW +1E0D ; valid # 1.1 LATIN SMALL LETTER D WITH DOT BELOW +1E0E ; mapped ; 1E0F # 1.1 LATIN CAPITAL LETTER D WITH LINE BELOW +1E0F ; valid # 1.1 LATIN SMALL LETTER D WITH LINE BELOW +1E10 ; mapped ; 1E11 # 1.1 LATIN CAPITAL LETTER D WITH CEDILLA +1E11 ; valid # 1.1 LATIN SMALL LETTER D WITH CEDILLA +1E12 ; mapped ; 1E13 # 1.1 LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW +1E13 ; valid # 1.1 LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW +1E14 ; mapped ; 1E15 # 1.1 LATIN CAPITAL LETTER E WITH MACRON AND GRAVE +1E15 ; valid # 1.1 LATIN SMALL LETTER E WITH MACRON AND GRAVE +1E16 ; mapped ; 1E17 # 1.1 LATIN CAPITAL LETTER E WITH MACRON AND ACUTE +1E17 ; valid # 1.1 LATIN SMALL LETTER E WITH MACRON AND ACUTE +1E18 ; mapped ; 1E19 # 1.1 LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW +1E19 ; valid # 1.1 LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW +1E1A ; mapped ; 1E1B # 1.1 LATIN CAPITAL LETTER E WITH TILDE BELOW +1E1B ; valid # 1.1 LATIN SMALL LETTER E WITH TILDE BELOW +1E1C ; mapped ; 1E1D # 1.1 LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE +1E1D ; valid # 1.1 LATIN SMALL LETTER E WITH CEDILLA AND BREVE +1E1E ; mapped ; 1E1F # 1.1 LATIN CAPITAL LETTER F WITH DOT ABOVE +1E1F ; valid # 1.1 LATIN SMALL LETTER F WITH DOT ABOVE +1E20 ; mapped ; 1E21 # 1.1 LATIN CAPITAL LETTER G WITH MACRON +1E21 ; valid # 1.1 LATIN SMALL LETTER G WITH MACRON +1E22 ; mapped ; 1E23 # 1.1 LATIN CAPITAL LETTER H WITH DOT ABOVE +1E23 ; valid # 1.1 LATIN SMALL LETTER H WITH DOT ABOVE +1E24 ; mapped ; 1E25 # 1.1 LATIN CAPITAL LETTER H WITH DOT BELOW +1E25 ; valid # 1.1 LATIN SMALL LETTER H WITH DOT BELOW +1E26 ; mapped ; 1E27 # 1.1 LATIN CAPITAL LETTER H WITH DIAERESIS +1E27 ; valid # 1.1 LATIN SMALL LETTER H WITH DIAERESIS +1E28 ; mapped ; 1E29 # 1.1 LATIN CAPITAL LETTER H WITH CEDILLA +1E29 ; valid # 1.1 LATIN SMALL LETTER H WITH CEDILLA +1E2A ; mapped ; 1E2B # 1.1 LATIN CAPITAL LETTER H WITH BREVE BELOW +1E2B ; valid # 1.1 LATIN SMALL LETTER H WITH BREVE BELOW +1E2C ; mapped ; 1E2D # 1.1 LATIN CAPITAL LETTER I WITH TILDE BELOW +1E2D ; valid # 1.1 LATIN SMALL LETTER I WITH TILDE BELOW +1E2E ; mapped ; 1E2F # 1.1 LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE +1E2F ; valid # 1.1 LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE +1E30 ; mapped ; 1E31 # 1.1 LATIN CAPITAL LETTER K WITH ACUTE +1E31 ; valid # 1.1 LATIN SMALL LETTER K WITH ACUTE +1E32 ; mapped ; 1E33 # 1.1 LATIN CAPITAL LETTER K WITH DOT BELOW +1E33 ; valid # 1.1 LATIN SMALL LETTER K WITH DOT BELOW +1E34 ; mapped ; 1E35 # 1.1 LATIN CAPITAL LETTER K WITH LINE BELOW +1E35 ; valid # 1.1 LATIN SMALL LETTER K WITH LINE BELOW +1E36 ; mapped ; 1E37 # 1.1 LATIN CAPITAL LETTER L WITH DOT BELOW +1E37 ; valid # 1.1 LATIN SMALL LETTER L WITH DOT BELOW +1E38 ; mapped ; 1E39 # 1.1 LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON +1E39 ; valid # 1.1 LATIN SMALL LETTER L WITH DOT BELOW AND MACRON +1E3A ; mapped ; 1E3B # 1.1 LATIN CAPITAL LETTER L WITH LINE BELOW +1E3B ; valid # 1.1 LATIN SMALL LETTER L WITH LINE BELOW +1E3C ; mapped ; 1E3D # 1.1 LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW +1E3D ; valid # 1.1 LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW +1E3E ; mapped ; 1E3F # 1.1 LATIN CAPITAL LETTER M WITH ACUTE +1E3F ; valid # 1.1 LATIN SMALL LETTER M WITH ACUTE +1E40 ; mapped ; 1E41 # 1.1 LATIN CAPITAL LETTER M WITH DOT ABOVE +1E41 ; valid # 1.1 LATIN SMALL LETTER M WITH DOT ABOVE +1E42 ; mapped ; 1E43 # 1.1 LATIN CAPITAL LETTER M WITH DOT BELOW +1E43 ; valid # 1.1 LATIN SMALL LETTER M WITH DOT BELOW +1E44 ; mapped ; 1E45 # 1.1 LATIN CAPITAL LETTER N WITH DOT ABOVE +1E45 ; valid # 1.1 LATIN SMALL LETTER N WITH DOT ABOVE +1E46 ; mapped ; 1E47 # 1.1 LATIN CAPITAL LETTER N WITH DOT BELOW +1E47 ; valid # 1.1 LATIN SMALL LETTER N WITH DOT BELOW +1E48 ; mapped ; 1E49 # 1.1 LATIN CAPITAL LETTER N WITH LINE BELOW +1E49 ; valid # 1.1 LATIN SMALL LETTER N WITH LINE BELOW +1E4A ; mapped ; 1E4B # 1.1 LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW +1E4B ; valid # 1.1 LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW +1E4C ; mapped ; 1E4D # 1.1 LATIN CAPITAL LETTER O WITH TILDE AND ACUTE +1E4D ; valid # 1.1 LATIN SMALL LETTER O WITH TILDE AND ACUTE +1E4E ; mapped ; 1E4F # 1.1 LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS +1E4F ; valid # 1.1 LATIN SMALL LETTER O WITH TILDE AND DIAERESIS +1E50 ; mapped ; 1E51 # 1.1 LATIN CAPITAL LETTER O WITH MACRON AND GRAVE +1E51 ; valid # 1.1 LATIN SMALL LETTER O WITH MACRON AND GRAVE +1E52 ; mapped ; 1E53 # 1.1 LATIN CAPITAL LETTER O WITH MACRON AND ACUTE +1E53 ; valid # 1.1 LATIN SMALL LETTER O WITH MACRON AND ACUTE +1E54 ; mapped ; 1E55 # 1.1 LATIN CAPITAL LETTER P WITH ACUTE +1E55 ; valid # 1.1 LATIN SMALL LETTER P WITH ACUTE +1E56 ; mapped ; 1E57 # 1.1 LATIN CAPITAL LETTER P WITH DOT ABOVE +1E57 ; valid # 1.1 LATIN SMALL LETTER P WITH DOT ABOVE +1E58 ; mapped ; 1E59 # 1.1 LATIN CAPITAL LETTER R WITH DOT ABOVE +1E59 ; valid # 1.1 LATIN SMALL LETTER R WITH DOT ABOVE +1E5A ; mapped ; 1E5B # 1.1 LATIN CAPITAL LETTER R WITH DOT BELOW +1E5B ; valid # 1.1 LATIN SMALL LETTER R WITH DOT BELOW +1E5C ; mapped ; 1E5D # 1.1 LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON +1E5D ; valid # 1.1 LATIN SMALL LETTER R WITH DOT BELOW AND MACRON +1E5E ; mapped ; 1E5F # 1.1 LATIN CAPITAL LETTER R WITH LINE BELOW +1E5F ; valid # 1.1 LATIN SMALL LETTER R WITH LINE BELOW +1E60 ; mapped ; 1E61 # 1.1 LATIN CAPITAL LETTER S WITH DOT ABOVE +1E61 ; valid # 1.1 LATIN SMALL LETTER S WITH DOT ABOVE +1E62 ; mapped ; 1E63 # 1.1 LATIN CAPITAL LETTER S WITH DOT BELOW +1E63 ; valid # 1.1 LATIN SMALL LETTER S WITH DOT BELOW +1E64 ; mapped ; 1E65 # 1.1 LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE +1E65 ; valid # 1.1 LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE +1E66 ; mapped ; 1E67 # 1.1 LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE +1E67 ; valid # 1.1 LATIN SMALL LETTER S WITH CARON AND DOT ABOVE +1E68 ; mapped ; 1E69 # 1.1 LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE +1E69 ; valid # 1.1 LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE +1E6A ; mapped ; 1E6B # 1.1 LATIN CAPITAL LETTER T WITH DOT ABOVE +1E6B ; valid # 1.1 LATIN SMALL LETTER T WITH DOT ABOVE +1E6C ; mapped ; 1E6D # 1.1 LATIN CAPITAL LETTER T WITH DOT BELOW +1E6D ; valid # 1.1 LATIN SMALL LETTER T WITH DOT BELOW +1E6E ; mapped ; 1E6F # 1.1 LATIN CAPITAL LETTER T WITH LINE BELOW +1E6F ; valid # 1.1 LATIN SMALL LETTER T WITH LINE BELOW +1E70 ; mapped ; 1E71 # 1.1 LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW +1E71 ; valid # 1.1 LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW +1E72 ; mapped ; 1E73 # 1.1 LATIN CAPITAL LETTER U WITH DIAERESIS BELOW +1E73 ; valid # 1.1 LATIN SMALL LETTER U WITH DIAERESIS BELOW +1E74 ; mapped ; 1E75 # 1.1 LATIN CAPITAL LETTER U WITH TILDE BELOW +1E75 ; valid # 1.1 LATIN SMALL LETTER U WITH TILDE BELOW +1E76 ; mapped ; 1E77 # 1.1 LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW +1E77 ; valid # 1.1 LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW +1E78 ; mapped ; 1E79 # 1.1 LATIN CAPITAL LETTER U WITH TILDE AND ACUTE +1E79 ; valid # 1.1 LATIN SMALL LETTER U WITH TILDE AND ACUTE +1E7A ; mapped ; 1E7B # 1.1 LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS +1E7B ; valid # 1.1 LATIN SMALL LETTER U WITH MACRON AND DIAERESIS +1E7C ; mapped ; 1E7D # 1.1 LATIN CAPITAL LETTER V WITH TILDE +1E7D ; valid # 1.1 LATIN SMALL LETTER V WITH TILDE +1E7E ; mapped ; 1E7F # 1.1 LATIN CAPITAL LETTER V WITH DOT BELOW +1E7F ; valid # 1.1 LATIN SMALL LETTER V WITH DOT BELOW +1E80 ; mapped ; 1E81 # 1.1 LATIN CAPITAL LETTER W WITH GRAVE +1E81 ; valid # 1.1 LATIN SMALL LETTER W WITH GRAVE +1E82 ; mapped ; 1E83 # 1.1 LATIN CAPITAL LETTER W WITH ACUTE +1E83 ; valid # 1.1 LATIN SMALL LETTER W WITH ACUTE +1E84 ; mapped ; 1E85 # 1.1 LATIN CAPITAL LETTER W WITH DIAERESIS +1E85 ; valid # 1.1 LATIN SMALL LETTER W WITH DIAERESIS +1E86 ; mapped ; 1E87 # 1.1 LATIN CAPITAL LETTER W WITH DOT ABOVE +1E87 ; valid # 1.1 LATIN SMALL LETTER W WITH DOT ABOVE +1E88 ; mapped ; 1E89 # 1.1 LATIN CAPITAL LETTER W WITH DOT BELOW +1E89 ; valid # 1.1 LATIN SMALL LETTER W WITH DOT BELOW +1E8A ; mapped ; 1E8B # 1.1 LATIN CAPITAL LETTER X WITH DOT ABOVE +1E8B ; valid # 1.1 LATIN SMALL LETTER X WITH DOT ABOVE +1E8C ; mapped ; 1E8D # 1.1 LATIN CAPITAL LETTER X WITH DIAERESIS +1E8D ; valid # 1.1 LATIN SMALL LETTER X WITH DIAERESIS +1E8E ; mapped ; 1E8F # 1.1 LATIN CAPITAL LETTER Y WITH DOT ABOVE +1E8F ; valid # 1.1 LATIN SMALL LETTER Y WITH DOT ABOVE +1E90 ; mapped ; 1E91 # 1.1 LATIN CAPITAL LETTER Z WITH CIRCUMFLEX +1E91 ; valid # 1.1 LATIN SMALL LETTER Z WITH CIRCUMFLEX +1E92 ; mapped ; 1E93 # 1.1 LATIN CAPITAL LETTER Z WITH DOT BELOW +1E93 ; valid # 1.1 LATIN SMALL LETTER Z WITH DOT BELOW +1E94 ; mapped ; 1E95 # 1.1 LATIN CAPITAL LETTER Z WITH LINE BELOW +1E95..1E99 ; valid # 1.1 LATIN SMALL LETTER Z WITH LINE BELOW..LATIN SMALL LETTER Y WITH RING ABOVE +1E9A ; mapped ; 0061 02BE # 1.1 LATIN SMALL LETTER A WITH RIGHT HALF RING +1E9B ; mapped ; 1E61 # 2.0 LATIN SMALL LETTER LONG S WITH DOT ABOVE +1E9C..1E9D ; valid # 5.1 LATIN SMALL LETTER LONG S WITH DIAGONAL STROKE..LATIN SMALL LETTER LONG S WITH HIGH STROKE +1E9E ; mapped ; 0073 0073 # 5.1 LATIN CAPITAL LETTER SHARP S +1E9F ; valid # 5.1 LATIN SMALL LETTER DELTA +1EA0 ; mapped ; 1EA1 # 1.1 LATIN CAPITAL LETTER A WITH DOT BELOW +1EA1 ; valid # 1.1 LATIN SMALL LETTER A WITH DOT BELOW +1EA2 ; mapped ; 1EA3 # 1.1 LATIN CAPITAL LETTER A WITH HOOK ABOVE +1EA3 ; valid # 1.1 LATIN SMALL LETTER A WITH HOOK ABOVE +1EA4 ; mapped ; 1EA5 # 1.1 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE +1EA5 ; valid # 1.1 LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE +1EA6 ; mapped ; 1EA7 # 1.1 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE +1EA7 ; valid # 1.1 LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE +1EA8 ; mapped ; 1EA9 # 1.1 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE +1EA9 ; valid # 1.1 LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE +1EAA ; mapped ; 1EAB # 1.1 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE +1EAB ; valid # 1.1 LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE +1EAC ; mapped ; 1EAD # 1.1 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW +1EAD ; valid # 1.1 LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW +1EAE ; mapped ; 1EAF # 1.1 LATIN CAPITAL LETTER A WITH BREVE AND ACUTE +1EAF ; valid # 1.1 LATIN SMALL LETTER A WITH BREVE AND ACUTE +1EB0 ; mapped ; 1EB1 # 1.1 LATIN CAPITAL LETTER A WITH BREVE AND GRAVE +1EB1 ; valid # 1.1 LATIN SMALL LETTER A WITH BREVE AND GRAVE +1EB2 ; mapped ; 1EB3 # 1.1 LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE +1EB3 ; valid # 1.1 LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE +1EB4 ; mapped ; 1EB5 # 1.1 LATIN CAPITAL LETTER A WITH BREVE AND TILDE +1EB5 ; valid # 1.1 LATIN SMALL LETTER A WITH BREVE AND TILDE +1EB6 ; mapped ; 1EB7 # 1.1 LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW +1EB7 ; valid # 1.1 LATIN SMALL LETTER A WITH BREVE AND DOT BELOW +1EB8 ; mapped ; 1EB9 # 1.1 LATIN CAPITAL LETTER E WITH DOT BELOW +1EB9 ; valid # 1.1 LATIN SMALL LETTER E WITH DOT BELOW +1EBA ; mapped ; 1EBB # 1.1 LATIN CAPITAL LETTER E WITH HOOK ABOVE +1EBB ; valid # 1.1 LATIN SMALL LETTER E WITH HOOK ABOVE +1EBC ; mapped ; 1EBD # 1.1 LATIN CAPITAL LETTER E WITH TILDE +1EBD ; valid # 1.1 LATIN SMALL LETTER E WITH TILDE +1EBE ; mapped ; 1EBF # 1.1 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE +1EBF ; valid # 1.1 LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE +1EC0 ; mapped ; 1EC1 # 1.1 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE +1EC1 ; valid # 1.1 LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE +1EC2 ; mapped ; 1EC3 # 1.1 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE +1EC3 ; valid # 1.1 LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE +1EC4 ; mapped ; 1EC5 # 1.1 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE +1EC5 ; valid # 1.1 LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE +1EC6 ; mapped ; 1EC7 # 1.1 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW +1EC7 ; valid # 1.1 LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW +1EC8 ; mapped ; 1EC9 # 1.1 LATIN CAPITAL LETTER I WITH HOOK ABOVE +1EC9 ; valid # 1.1 LATIN SMALL LETTER I WITH HOOK ABOVE +1ECA ; mapped ; 1ECB # 1.1 LATIN CAPITAL LETTER I WITH DOT BELOW +1ECB ; valid # 1.1 LATIN SMALL LETTER I WITH DOT BELOW +1ECC ; mapped ; 1ECD # 1.1 LATIN CAPITAL LETTER O WITH DOT BELOW +1ECD ; valid # 1.1 LATIN SMALL LETTER O WITH DOT BELOW +1ECE ; mapped ; 1ECF # 1.1 LATIN CAPITAL LETTER O WITH HOOK ABOVE +1ECF ; valid # 1.1 LATIN SMALL LETTER O WITH HOOK ABOVE +1ED0 ; mapped ; 1ED1 # 1.1 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE +1ED1 ; valid # 1.1 LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE +1ED2 ; mapped ; 1ED3 # 1.1 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE +1ED3 ; valid # 1.1 LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE +1ED4 ; mapped ; 1ED5 # 1.1 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE +1ED5 ; valid # 1.1 LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE +1ED6 ; mapped ; 1ED7 # 1.1 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE +1ED7 ; valid # 1.1 LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE +1ED8 ; mapped ; 1ED9 # 1.1 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW +1ED9 ; valid # 1.1 LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW +1EDA ; mapped ; 1EDB # 1.1 LATIN CAPITAL LETTER O WITH HORN AND ACUTE +1EDB ; valid # 1.1 LATIN SMALL LETTER O WITH HORN AND ACUTE +1EDC ; mapped ; 1EDD # 1.1 LATIN CAPITAL LETTER O WITH HORN AND GRAVE +1EDD ; valid # 1.1 LATIN SMALL LETTER O WITH HORN AND GRAVE +1EDE ; mapped ; 1EDF # 1.1 LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE +1EDF ; valid # 1.1 LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE +1EE0 ; mapped ; 1EE1 # 1.1 LATIN CAPITAL LETTER O WITH HORN AND TILDE +1EE1 ; valid # 1.1 LATIN SMALL LETTER O WITH HORN AND TILDE +1EE2 ; mapped ; 1EE3 # 1.1 LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW +1EE3 ; valid # 1.1 LATIN SMALL LETTER O WITH HORN AND DOT BELOW +1EE4 ; mapped ; 1EE5 # 1.1 LATIN CAPITAL LETTER U WITH DOT BELOW +1EE5 ; valid # 1.1 LATIN SMALL LETTER U WITH DOT BELOW +1EE6 ; mapped ; 1EE7 # 1.1 LATIN CAPITAL LETTER U WITH HOOK ABOVE +1EE7 ; valid # 1.1 LATIN SMALL LETTER U WITH HOOK ABOVE +1EE8 ; mapped ; 1EE9 # 1.1 LATIN CAPITAL LETTER U WITH HORN AND ACUTE +1EE9 ; valid # 1.1 LATIN SMALL LETTER U WITH HORN AND ACUTE +1EEA ; mapped ; 1EEB # 1.1 LATIN CAPITAL LETTER U WITH HORN AND GRAVE +1EEB ; valid # 1.1 LATIN SMALL LETTER U WITH HORN AND GRAVE +1EEC ; mapped ; 1EED # 1.1 LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE +1EED ; valid # 1.1 LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE +1EEE ; mapped ; 1EEF # 1.1 LATIN CAPITAL LETTER U WITH HORN AND TILDE +1EEF ; valid # 1.1 LATIN SMALL LETTER U WITH HORN AND TILDE +1EF0 ; mapped ; 1EF1 # 1.1 LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW +1EF1 ; valid # 1.1 LATIN SMALL LETTER U WITH HORN AND DOT BELOW +1EF2 ; mapped ; 1EF3 # 1.1 LATIN CAPITAL LETTER Y WITH GRAVE +1EF3 ; valid # 1.1 LATIN SMALL LETTER Y WITH GRAVE +1EF4 ; mapped ; 1EF5 # 1.1 LATIN CAPITAL LETTER Y WITH DOT BELOW +1EF5 ; valid # 1.1 LATIN SMALL LETTER Y WITH DOT BELOW +1EF6 ; mapped ; 1EF7 # 1.1 LATIN CAPITAL LETTER Y WITH HOOK ABOVE +1EF7 ; valid # 1.1 LATIN SMALL LETTER Y WITH HOOK ABOVE +1EF8 ; mapped ; 1EF9 # 1.1 LATIN CAPITAL LETTER Y WITH TILDE +1EF9 ; valid # 1.1 LATIN SMALL LETTER Y WITH TILDE +1EFA ; mapped ; 1EFB # 5.1 LATIN CAPITAL LETTER MIDDLE-WELSH LL +1EFB ; valid # 5.1 LATIN SMALL LETTER MIDDLE-WELSH LL +1EFC ; mapped ; 1EFD # 5.1 LATIN CAPITAL LETTER MIDDLE-WELSH V +1EFD ; valid # 5.1 LATIN SMALL LETTER MIDDLE-WELSH V +1EFE ; mapped ; 1EFF # 5.1 LATIN CAPITAL LETTER Y WITH LOOP +1EFF ; valid # 5.1 LATIN SMALL LETTER Y WITH LOOP +1F00..1F07 ; valid # 1.1 GREEK SMALL LETTER ALPHA WITH PSILI..GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI +1F08 ; mapped ; 1F00 # 1.1 GREEK CAPITAL LETTER ALPHA WITH PSILI +1F09 ; mapped ; 1F01 # 1.1 GREEK CAPITAL LETTER ALPHA WITH DASIA +1F0A ; mapped ; 1F02 # 1.1 GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA +1F0B ; mapped ; 1F03 # 1.1 GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA +1F0C ; mapped ; 1F04 # 1.1 GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA +1F0D ; mapped ; 1F05 # 1.1 GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA +1F0E ; mapped ; 1F06 # 1.1 GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI +1F0F ; mapped ; 1F07 # 1.1 GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI +1F10..1F15 ; valid # 1.1 GREEK SMALL LETTER EPSILON WITH PSILI..GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA +1F16..1F17 ; disallowed # NA .. +1F18 ; mapped ; 1F10 # 1.1 GREEK CAPITAL LETTER EPSILON WITH PSILI +1F19 ; mapped ; 1F11 # 1.1 GREEK CAPITAL LETTER EPSILON WITH DASIA +1F1A ; mapped ; 1F12 # 1.1 GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA +1F1B ; mapped ; 1F13 # 1.1 GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA +1F1C ; mapped ; 1F14 # 1.1 GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA +1F1D ; mapped ; 1F15 # 1.1 GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA +1F1E..1F1F ; disallowed # NA .. +1F20..1F27 ; valid # 1.1 GREEK SMALL LETTER ETA WITH PSILI..GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI +1F28 ; mapped ; 1F20 # 1.1 GREEK CAPITAL LETTER ETA WITH PSILI +1F29 ; mapped ; 1F21 # 1.1 GREEK CAPITAL LETTER ETA WITH DASIA +1F2A ; mapped ; 1F22 # 1.1 GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA +1F2B ; mapped ; 1F23 # 1.1 GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA +1F2C ; mapped ; 1F24 # 1.1 GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA +1F2D ; mapped ; 1F25 # 1.1 GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA +1F2E ; mapped ; 1F26 # 1.1 GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI +1F2F ; mapped ; 1F27 # 1.1 GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI +1F30..1F37 ; valid # 1.1 GREEK SMALL LETTER IOTA WITH PSILI..GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI +1F38 ; mapped ; 1F30 # 1.1 GREEK CAPITAL LETTER IOTA WITH PSILI +1F39 ; mapped ; 1F31 # 1.1 GREEK CAPITAL LETTER IOTA WITH DASIA +1F3A ; mapped ; 1F32 # 1.1 GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA +1F3B ; mapped ; 1F33 # 1.1 GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA +1F3C ; mapped ; 1F34 # 1.1 GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA +1F3D ; mapped ; 1F35 # 1.1 GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA +1F3E ; mapped ; 1F36 # 1.1 GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI +1F3F ; mapped ; 1F37 # 1.1 GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI +1F40..1F45 ; valid # 1.1 GREEK SMALL LETTER OMICRON WITH PSILI..GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA +1F46..1F47 ; disallowed # NA .. +1F48 ; mapped ; 1F40 # 1.1 GREEK CAPITAL LETTER OMICRON WITH PSILI +1F49 ; mapped ; 1F41 # 1.1 GREEK CAPITAL LETTER OMICRON WITH DASIA +1F4A ; mapped ; 1F42 # 1.1 GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA +1F4B ; mapped ; 1F43 # 1.1 GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA +1F4C ; mapped ; 1F44 # 1.1 GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA +1F4D ; mapped ; 1F45 # 1.1 GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA +1F4E..1F4F ; disallowed # NA .. +1F50..1F57 ; valid # 1.1 GREEK SMALL LETTER UPSILON WITH PSILI..GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI +1F58 ; disallowed # NA +1F59 ; mapped ; 1F51 # 1.1 GREEK CAPITAL LETTER UPSILON WITH DASIA +1F5A ; disallowed # NA +1F5B ; mapped ; 1F53 # 1.1 GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA +1F5C ; disallowed # NA +1F5D ; mapped ; 1F55 # 1.1 GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA +1F5E ; disallowed # NA +1F5F ; mapped ; 1F57 # 1.1 GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI +1F60..1F67 ; valid # 1.1 GREEK SMALL LETTER OMEGA WITH PSILI..GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI +1F68 ; mapped ; 1F60 # 1.1 GREEK CAPITAL LETTER OMEGA WITH PSILI +1F69 ; mapped ; 1F61 # 1.1 GREEK CAPITAL LETTER OMEGA WITH DASIA +1F6A ; mapped ; 1F62 # 1.1 GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA +1F6B ; mapped ; 1F63 # 1.1 GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA +1F6C ; mapped ; 1F64 # 1.1 GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA +1F6D ; mapped ; 1F65 # 1.1 GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA +1F6E ; mapped ; 1F66 # 1.1 GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI +1F6F ; mapped ; 1F67 # 1.1 GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI +1F70 ; valid # 1.1 GREEK SMALL LETTER ALPHA WITH VARIA +1F71 ; mapped ; 03AC # 1.1 GREEK SMALL LETTER ALPHA WITH OXIA +1F72 ; valid # 1.1 GREEK SMALL LETTER EPSILON WITH VARIA +1F73 ; mapped ; 03AD # 1.1 GREEK SMALL LETTER EPSILON WITH OXIA +1F74 ; valid # 1.1 GREEK SMALL LETTER ETA WITH VARIA +1F75 ; mapped ; 03AE # 1.1 GREEK SMALL LETTER ETA WITH OXIA +1F76 ; valid # 1.1 GREEK SMALL LETTER IOTA WITH VARIA +1F77 ; mapped ; 03AF # 1.1 GREEK SMALL LETTER IOTA WITH OXIA +1F78 ; valid # 1.1 GREEK SMALL LETTER OMICRON WITH VARIA +1F79 ; mapped ; 03CC # 1.1 GREEK SMALL LETTER OMICRON WITH OXIA +1F7A ; valid # 1.1 GREEK SMALL LETTER UPSILON WITH VARIA +1F7B ; mapped ; 03CD # 1.1 GREEK SMALL LETTER UPSILON WITH OXIA +1F7C ; valid # 1.1 GREEK SMALL LETTER OMEGA WITH VARIA +1F7D ; mapped ; 03CE # 1.1 GREEK SMALL LETTER OMEGA WITH OXIA +1F7E..1F7F ; disallowed # NA .. +1F80 ; mapped ; 1F00 03B9 # 1.1 GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI +1F81 ; mapped ; 1F01 03B9 # 1.1 GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI +1F82 ; mapped ; 1F02 03B9 # 1.1 GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI +1F83 ; mapped ; 1F03 03B9 # 1.1 GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI +1F84 ; mapped ; 1F04 03B9 # 1.1 GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI +1F85 ; mapped ; 1F05 03B9 # 1.1 GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI +1F86 ; mapped ; 1F06 03B9 # 1.1 GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI +1F87 ; mapped ; 1F07 03B9 # 1.1 GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI +1F88 ; mapped ; 1F00 03B9 # 1.1 GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI +1F89 ; mapped ; 1F01 03B9 # 1.1 GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI +1F8A ; mapped ; 1F02 03B9 # 1.1 GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI +1F8B ; mapped ; 1F03 03B9 # 1.1 GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI +1F8C ; mapped ; 1F04 03B9 # 1.1 GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI +1F8D ; mapped ; 1F05 03B9 # 1.1 GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI +1F8E ; mapped ; 1F06 03B9 # 1.1 GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI +1F8F ; mapped ; 1F07 03B9 # 1.1 GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI +1F90 ; mapped ; 1F20 03B9 # 1.1 GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI +1F91 ; mapped ; 1F21 03B9 # 1.1 GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI +1F92 ; mapped ; 1F22 03B9 # 1.1 GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI +1F93 ; mapped ; 1F23 03B9 # 1.1 GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI +1F94 ; mapped ; 1F24 03B9 # 1.1 GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI +1F95 ; mapped ; 1F25 03B9 # 1.1 GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI +1F96 ; mapped ; 1F26 03B9 # 1.1 GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI +1F97 ; mapped ; 1F27 03B9 # 1.1 GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI +1F98 ; mapped ; 1F20 03B9 # 1.1 GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI +1F99 ; mapped ; 1F21 03B9 # 1.1 GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI +1F9A ; mapped ; 1F22 03B9 # 1.1 GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI +1F9B ; mapped ; 1F23 03B9 # 1.1 GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI +1F9C ; mapped ; 1F24 03B9 # 1.1 GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI +1F9D ; mapped ; 1F25 03B9 # 1.1 GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI +1F9E ; mapped ; 1F26 03B9 # 1.1 GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI +1F9F ; mapped ; 1F27 03B9 # 1.1 GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI +1FA0 ; mapped ; 1F60 03B9 # 1.1 GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI +1FA1 ; mapped ; 1F61 03B9 # 1.1 GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI +1FA2 ; mapped ; 1F62 03B9 # 1.1 GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI +1FA3 ; mapped ; 1F63 03B9 # 1.1 GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI +1FA4 ; mapped ; 1F64 03B9 # 1.1 GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI +1FA5 ; mapped ; 1F65 03B9 # 1.1 GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI +1FA6 ; mapped ; 1F66 03B9 # 1.1 GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI +1FA7 ; mapped ; 1F67 03B9 # 1.1 GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI +1FA8 ; mapped ; 1F60 03B9 # 1.1 GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI +1FA9 ; mapped ; 1F61 03B9 # 1.1 GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI +1FAA ; mapped ; 1F62 03B9 # 1.1 GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI +1FAB ; mapped ; 1F63 03B9 # 1.1 GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI +1FAC ; mapped ; 1F64 03B9 # 1.1 GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI +1FAD ; mapped ; 1F65 03B9 # 1.1 GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI +1FAE ; mapped ; 1F66 03B9 # 1.1 GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI +1FAF ; mapped ; 1F67 03B9 # 1.1 GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI +1FB0..1FB1 ; valid # 1.1 GREEK SMALL LETTER ALPHA WITH VRACHY..GREEK SMALL LETTER ALPHA WITH MACRON +1FB2 ; mapped ; 1F70 03B9 # 1.1 GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI +1FB3 ; mapped ; 03B1 03B9 # 1.1 GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI +1FB4 ; mapped ; 03AC 03B9 # 1.1 GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI +1FB5 ; disallowed # NA +1FB6 ; valid # 1.1 GREEK SMALL LETTER ALPHA WITH PERISPOMENI +1FB7 ; mapped ; 1FB6 03B9 # 1.1 GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI +1FB8 ; mapped ; 1FB0 # 1.1 GREEK CAPITAL LETTER ALPHA WITH VRACHY +1FB9 ; mapped ; 1FB1 # 1.1 GREEK CAPITAL LETTER ALPHA WITH MACRON +1FBA ; mapped ; 1F70 # 1.1 GREEK CAPITAL LETTER ALPHA WITH VARIA +1FBB ; mapped ; 03AC # 1.1 GREEK CAPITAL LETTER ALPHA WITH OXIA +1FBC ; mapped ; 03B1 03B9 # 1.1 GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI +1FBD ; disallowed_STD3_mapped ; 0020 0313 # 1.1 GREEK KORONIS +1FBE ; mapped ; 03B9 # 1.1 GREEK PROSGEGRAMMENI +1FBF ; disallowed_STD3_mapped ; 0020 0313 # 1.1 GREEK PSILI +1FC0 ; disallowed_STD3_mapped ; 0020 0342 # 1.1 GREEK PERISPOMENI +1FC1 ; disallowed_STD3_mapped ; 0020 0308 0342 #1.1 GREEK DIALYTIKA AND PERISPOMENI +1FC2 ; mapped ; 1F74 03B9 # 1.1 GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI +1FC3 ; mapped ; 03B7 03B9 # 1.1 GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI +1FC4 ; mapped ; 03AE 03B9 # 1.1 GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI +1FC5 ; disallowed # NA +1FC6 ; valid # 1.1 GREEK SMALL LETTER ETA WITH PERISPOMENI +1FC7 ; mapped ; 1FC6 03B9 # 1.1 GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI +1FC8 ; mapped ; 1F72 # 1.1 GREEK CAPITAL LETTER EPSILON WITH VARIA +1FC9 ; mapped ; 03AD # 1.1 GREEK CAPITAL LETTER EPSILON WITH OXIA +1FCA ; mapped ; 1F74 # 1.1 GREEK CAPITAL LETTER ETA WITH VARIA +1FCB ; mapped ; 03AE # 1.1 GREEK CAPITAL LETTER ETA WITH OXIA +1FCC ; mapped ; 03B7 03B9 # 1.1 GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI +1FCD ; disallowed_STD3_mapped ; 0020 0313 0300 #1.1 GREEK PSILI AND VARIA +1FCE ; disallowed_STD3_mapped ; 0020 0313 0301 #1.1 GREEK PSILI AND OXIA +1FCF ; disallowed_STD3_mapped ; 0020 0313 0342 #1.1 GREEK PSILI AND PERISPOMENI +1FD0..1FD2 ; valid # 1.1 GREEK SMALL LETTER IOTA WITH VRACHY..GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA +1FD3 ; mapped ; 0390 # 1.1 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA +1FD4..1FD5 ; disallowed # NA .. +1FD6..1FD7 ; valid # 1.1 GREEK SMALL LETTER IOTA WITH PERISPOMENI..GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI +1FD8 ; mapped ; 1FD0 # 1.1 GREEK CAPITAL LETTER IOTA WITH VRACHY +1FD9 ; mapped ; 1FD1 # 1.1 GREEK CAPITAL LETTER IOTA WITH MACRON +1FDA ; mapped ; 1F76 # 1.1 GREEK CAPITAL LETTER IOTA WITH VARIA +1FDB ; mapped ; 03AF # 1.1 GREEK CAPITAL LETTER IOTA WITH OXIA +1FDC ; disallowed # NA +1FDD ; disallowed_STD3_mapped ; 0020 0314 0300 #1.1 GREEK DASIA AND VARIA +1FDE ; disallowed_STD3_mapped ; 0020 0314 0301 #1.1 GREEK DASIA AND OXIA +1FDF ; disallowed_STD3_mapped ; 0020 0314 0342 #1.1 GREEK DASIA AND PERISPOMENI +1FE0..1FE2 ; valid # 1.1 GREEK SMALL LETTER UPSILON WITH VRACHY..GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA +1FE3 ; mapped ; 03B0 # 1.1 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA +1FE4..1FE7 ; valid # 1.1 GREEK SMALL LETTER RHO WITH PSILI..GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI +1FE8 ; mapped ; 1FE0 # 1.1 GREEK CAPITAL LETTER UPSILON WITH VRACHY +1FE9 ; mapped ; 1FE1 # 1.1 GREEK CAPITAL LETTER UPSILON WITH MACRON +1FEA ; mapped ; 1F7A # 1.1 GREEK CAPITAL LETTER UPSILON WITH VARIA +1FEB ; mapped ; 03CD # 1.1 GREEK CAPITAL LETTER UPSILON WITH OXIA +1FEC ; mapped ; 1FE5 # 1.1 GREEK CAPITAL LETTER RHO WITH DASIA +1FED ; disallowed_STD3_mapped ; 0020 0308 0300 #1.1 GREEK DIALYTIKA AND VARIA +1FEE ; disallowed_STD3_mapped ; 0020 0308 0301 #1.1 GREEK DIALYTIKA AND OXIA +1FEF ; disallowed_STD3_mapped ; 0060 # 1.1 GREEK VARIA +1FF0..1FF1 ; disallowed # NA .. +1FF2 ; mapped ; 1F7C 03B9 # 1.1 GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI +1FF3 ; mapped ; 03C9 03B9 # 1.1 GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI +1FF4 ; mapped ; 03CE 03B9 # 1.1 GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI +1FF5 ; disallowed # NA +1FF6 ; valid # 1.1 GREEK SMALL LETTER OMEGA WITH PERISPOMENI +1FF7 ; mapped ; 1FF6 03B9 # 1.1 GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI +1FF8 ; mapped ; 1F78 # 1.1 GREEK CAPITAL LETTER OMICRON WITH VARIA +1FF9 ; mapped ; 03CC # 1.1 GREEK CAPITAL LETTER OMICRON WITH OXIA +1FFA ; mapped ; 1F7C # 1.1 GREEK CAPITAL LETTER OMEGA WITH VARIA +1FFB ; mapped ; 03CE # 1.1 GREEK CAPITAL LETTER OMEGA WITH OXIA +1FFC ; mapped ; 03C9 03B9 # 1.1 GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI +1FFD ; disallowed_STD3_mapped ; 0020 0301 # 1.1 GREEK OXIA +1FFE ; disallowed_STD3_mapped ; 0020 0314 # 1.1 GREEK DASIA +1FFF ; disallowed # NA +2000..200A ; disallowed_STD3_mapped ; 0020 # 1.1 EN QUAD..HAIR SPACE +200B ; ignored # 1.1 ZERO WIDTH SPACE +200C..200D ; deviation ; # 1.1 ZERO WIDTH NON-JOINER..ZERO WIDTH JOINER +200E..200F ; disallowed # 1.1 LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK +2010 ; valid ; ; NV8 # 1.1 HYPHEN +2011 ; mapped ; 2010 # 1.1 NON-BREAKING HYPHEN +2012..2016 ; valid ; ; NV8 # 1.1 FIGURE DASH..DOUBLE VERTICAL LINE +2017 ; disallowed_STD3_mapped ; 0020 0333 # 1.1 DOUBLE LOW LINE +2018..2023 ; valid ; ; NV8 # 1.1 LEFT SINGLE QUOTATION MARK..TRIANGULAR BULLET +2024..2026 ; disallowed # 1.1 ONE DOT LEADER..HORIZONTAL ELLIPSIS +2027 ; valid ; ; NV8 # 1.1 HYPHENATION POINT +2028..202E ; disallowed # 1.1 LINE SEPARATOR..RIGHT-TO-LEFT OVERRIDE +202F ; disallowed_STD3_mapped ; 0020 # 3.0 NARROW NO-BREAK SPACE +2030..2032 ; valid ; ; NV8 # 1.1 PER MILLE SIGN..PRIME +2033 ; mapped ; 2032 2032 # 1.1 DOUBLE PRIME +2034 ; mapped ; 2032 2032 2032 #1.1 TRIPLE PRIME +2035 ; valid ; ; NV8 # 1.1 REVERSED PRIME +2036 ; mapped ; 2035 2035 # 1.1 REVERSED DOUBLE PRIME +2037 ; mapped ; 2035 2035 2035 #1.1 REVERSED TRIPLE PRIME +2038..203B ; valid ; ; NV8 # 1.1 CARET..REFERENCE MARK +203C ; disallowed_STD3_mapped ; 0021 0021 # 1.1 DOUBLE EXCLAMATION MARK +203D ; valid ; ; NV8 # 1.1 INTERROBANG +203E ; disallowed_STD3_mapped ; 0020 0305 # 1.1 OVERLINE +203F..2046 ; valid ; ; NV8 # 1.1 UNDERTIE..RIGHT SQUARE BRACKET WITH QUILL +2047 ; disallowed_STD3_mapped ; 003F 003F # 3.2 DOUBLE QUESTION MARK +2048 ; disallowed_STD3_mapped ; 003F 0021 # 3.0 QUESTION EXCLAMATION MARK +2049 ; disallowed_STD3_mapped ; 0021 003F # 3.0 EXCLAMATION QUESTION MARK +204A..204D ; valid ; ; NV8 # 3.0 TIRONIAN SIGN ET..BLACK RIGHTWARDS BULLET +204E..2052 ; valid ; ; NV8 # 3.2 LOW ASTERISK..COMMERCIAL MINUS SIGN +2053..2054 ; valid ; ; NV8 # 4.0 SWUNG DASH..INVERTED UNDERTIE +2055..2056 ; valid ; ; NV8 # 4.1 FLOWER PUNCTUATION MARK..THREE DOT PUNCTUATION +2057 ; mapped ; 2032 2032 2032 2032 #3.2 QUADRUPLE PRIME +2058..205E ; valid ; ; NV8 # 4.1 FOUR DOT PUNCTUATION..VERTICAL FOUR DOTS +205F ; disallowed_STD3_mapped ; 0020 # 3.2 MEDIUM MATHEMATICAL SPACE +2060 ; ignored # 3.2 WORD JOINER +2061..2063 ; disallowed # 3.2 FUNCTION APPLICATION..INVISIBLE SEPARATOR +2064 ; ignored # 5.1 INVISIBLE PLUS +2065 ; disallowed # NA +2066..2069 ; disallowed # 6.3 LEFT-TO-RIGHT ISOLATE..POP DIRECTIONAL ISOLATE +206A..206F ; disallowed # 1.1 INHIBIT SYMMETRIC SWAPPING..NOMINAL DIGIT SHAPES +2070 ; mapped ; 0030 # 1.1 SUPERSCRIPT ZERO +2071 ; mapped ; 0069 # 3.2 SUPERSCRIPT LATIN SMALL LETTER I +2072..2073 ; disallowed # NA .. +2074 ; mapped ; 0034 # 1.1 SUPERSCRIPT FOUR +2075 ; mapped ; 0035 # 1.1 SUPERSCRIPT FIVE +2076 ; mapped ; 0036 # 1.1 SUPERSCRIPT SIX +2077 ; mapped ; 0037 # 1.1 SUPERSCRIPT SEVEN +2078 ; mapped ; 0038 # 1.1 SUPERSCRIPT EIGHT +2079 ; mapped ; 0039 # 1.1 SUPERSCRIPT NINE +207A ; disallowed_STD3_mapped ; 002B # 1.1 SUPERSCRIPT PLUS SIGN +207B ; mapped ; 2212 # 1.1 SUPERSCRIPT MINUS +207C ; disallowed_STD3_mapped ; 003D # 1.1 SUPERSCRIPT EQUALS SIGN +207D ; disallowed_STD3_mapped ; 0028 # 1.1 SUPERSCRIPT LEFT PARENTHESIS +207E ; disallowed_STD3_mapped ; 0029 # 1.1 SUPERSCRIPT RIGHT PARENTHESIS +207F ; mapped ; 006E # 1.1 SUPERSCRIPT LATIN SMALL LETTER N +2080 ; mapped ; 0030 # 1.1 SUBSCRIPT ZERO +2081 ; mapped ; 0031 # 1.1 SUBSCRIPT ONE +2082 ; mapped ; 0032 # 1.1 SUBSCRIPT TWO +2083 ; mapped ; 0033 # 1.1 SUBSCRIPT THREE +2084 ; mapped ; 0034 # 1.1 SUBSCRIPT FOUR +2085 ; mapped ; 0035 # 1.1 SUBSCRIPT FIVE +2086 ; mapped ; 0036 # 1.1 SUBSCRIPT SIX +2087 ; mapped ; 0037 # 1.1 SUBSCRIPT SEVEN +2088 ; mapped ; 0038 # 1.1 SUBSCRIPT EIGHT +2089 ; mapped ; 0039 # 1.1 SUBSCRIPT NINE +208A ; disallowed_STD3_mapped ; 002B # 1.1 SUBSCRIPT PLUS SIGN +208B ; mapped ; 2212 # 1.1 SUBSCRIPT MINUS +208C ; disallowed_STD3_mapped ; 003D # 1.1 SUBSCRIPT EQUALS SIGN +208D ; disallowed_STD3_mapped ; 0028 # 1.1 SUBSCRIPT LEFT PARENTHESIS +208E ; disallowed_STD3_mapped ; 0029 # 1.1 SUBSCRIPT RIGHT PARENTHESIS +208F ; disallowed # NA +2090 ; mapped ; 0061 # 4.1 LATIN SUBSCRIPT SMALL LETTER A +2091 ; mapped ; 0065 # 4.1 LATIN SUBSCRIPT SMALL LETTER E +2092 ; mapped ; 006F # 4.1 LATIN SUBSCRIPT SMALL LETTER O +2093 ; mapped ; 0078 # 4.1 LATIN SUBSCRIPT SMALL LETTER X +2094 ; mapped ; 0259 # 4.1 LATIN SUBSCRIPT SMALL LETTER SCHWA +2095 ; mapped ; 0068 # 6.0 LATIN SUBSCRIPT SMALL LETTER H +2096 ; mapped ; 006B # 6.0 LATIN SUBSCRIPT SMALL LETTER K +2097 ; mapped ; 006C # 6.0 LATIN SUBSCRIPT SMALL LETTER L +2098 ; mapped ; 006D # 6.0 LATIN SUBSCRIPT SMALL LETTER M +2099 ; mapped ; 006E # 6.0 LATIN SUBSCRIPT SMALL LETTER N +209A ; mapped ; 0070 # 6.0 LATIN SUBSCRIPT SMALL LETTER P +209B ; mapped ; 0073 # 6.0 LATIN SUBSCRIPT SMALL LETTER S +209C ; mapped ; 0074 # 6.0 LATIN SUBSCRIPT SMALL LETTER T +209D..209F ; disallowed # NA .. +20A0..20A7 ; valid ; ; NV8 # 1.1 EURO-CURRENCY SIGN..PESETA SIGN +20A8 ; mapped ; 0072 0073 # 1.1 RUPEE SIGN +20A9..20AA ; valid ; ; NV8 # 1.1 WON SIGN..NEW SHEQEL SIGN +20AB ; valid ; ; NV8 # 2.0 DONG SIGN +20AC ; valid ; ; NV8 # 2.1 EURO SIGN +20AD..20AF ; valid ; ; NV8 # 3.0 KIP SIGN..DRACHMA SIGN +20B0..20B1 ; valid ; ; NV8 # 3.2 GERMAN PENNY SIGN..PESO SIGN +20B2..20B5 ; valid ; ; NV8 # 4.1 GUARANI SIGN..CEDI SIGN +20B6..20B8 ; valid ; ; NV8 # 5.2 LIVRE TOURNOIS SIGN..TENGE SIGN +20B9 ; valid ; ; NV8 # 6.0 INDIAN RUPEE SIGN +20BA ; valid ; ; NV8 # 6.2 TURKISH LIRA SIGN +20BB..20BD ; valid ; ; NV8 # 7.0 NORDIC MARK SIGN..RUBLE SIGN +20BE ; valid ; ; NV8 # 8.0 LARI SIGN +20BF ; valid ; ; NV8 # 10.0 BITCOIN SIGN +20C0 ; valid ; ; NV8 # 14.0 SOM SIGN +20C1..20CF ; disallowed # NA .. +20D0..20E1 ; valid ; ; NV8 # 1.1 COMBINING LEFT HARPOON ABOVE..COMBINING LEFT RIGHT ARROW ABOVE +20E2..20E3 ; valid ; ; NV8 # 3.0 COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING KEYCAP +20E4..20EA ; valid ; ; NV8 # 3.2 COMBINING ENCLOSING UPWARD POINTING TRIANGLE..COMBINING LEFTWARDS ARROW OVERLAY +20EB ; valid ; ; NV8 # 4.1 COMBINING LONG DOUBLE SOLIDUS OVERLAY +20EC..20EF ; valid ; ; NV8 # 5.0 COMBINING RIGHTWARDS HARPOON WITH BARB DOWNWARDS..COMBINING RIGHT ARROW BELOW +20F0 ; valid ; ; NV8 # 5.1 COMBINING ASTERISK ABOVE +20F1..20FF ; disallowed # NA .. +2100 ; disallowed_STD3_mapped ; 0061 002F 0063 #1.1 ACCOUNT OF +2101 ; disallowed_STD3_mapped ; 0061 002F 0073 #1.1 ADDRESSED TO THE SUBJECT +2102 ; mapped ; 0063 # 1.1 DOUBLE-STRUCK CAPITAL C +2103 ; mapped ; 00B0 0063 # 1.1 DEGREE CELSIUS +2104 ; valid ; ; NV8 # 1.1 CENTRE LINE SYMBOL +2105 ; disallowed_STD3_mapped ; 0063 002F 006F #1.1 CARE OF +2106 ; disallowed_STD3_mapped ; 0063 002F 0075 #1.1 CADA UNA +2107 ; mapped ; 025B # 1.1 EULER CONSTANT +2108 ; valid ; ; NV8 # 1.1 SCRUPLE +2109 ; mapped ; 00B0 0066 # 1.1 DEGREE FAHRENHEIT +210A ; mapped ; 0067 # 1.1 SCRIPT SMALL G +210B..210E ; mapped ; 0068 # 1.1 SCRIPT CAPITAL H..PLANCK CONSTANT +210F ; mapped ; 0127 # 1.1 PLANCK CONSTANT OVER TWO PI +2110..2111 ; mapped ; 0069 # 1.1 SCRIPT CAPITAL I..BLACK-LETTER CAPITAL I +2112..2113 ; mapped ; 006C # 1.1 SCRIPT CAPITAL L..SCRIPT SMALL L +2114 ; valid ; ; NV8 # 1.1 L B BAR SYMBOL +2115 ; mapped ; 006E # 1.1 DOUBLE-STRUCK CAPITAL N +2116 ; mapped ; 006E 006F # 1.1 NUMERO SIGN +2117..2118 ; valid ; ; NV8 # 1.1 SOUND RECORDING COPYRIGHT..SCRIPT CAPITAL P +2119 ; mapped ; 0070 # 1.1 DOUBLE-STRUCK CAPITAL P +211A ; mapped ; 0071 # 1.1 DOUBLE-STRUCK CAPITAL Q +211B..211D ; mapped ; 0072 # 1.1 SCRIPT CAPITAL R..DOUBLE-STRUCK CAPITAL R +211E..211F ; valid ; ; NV8 # 1.1 PRESCRIPTION TAKE..RESPONSE +2120 ; mapped ; 0073 006D # 1.1 SERVICE MARK +2121 ; mapped ; 0074 0065 006C #1.1 TELEPHONE SIGN +2122 ; mapped ; 0074 006D # 1.1 TRADE MARK SIGN +2123 ; valid ; ; NV8 # 1.1 VERSICLE +2124 ; mapped ; 007A # 1.1 DOUBLE-STRUCK CAPITAL Z +2125 ; valid ; ; NV8 # 1.1 OUNCE SIGN +2126 ; mapped ; 03C9 # 1.1 OHM SIGN +2127 ; valid ; ; NV8 # 1.1 INVERTED OHM SIGN +2128 ; mapped ; 007A # 1.1 BLACK-LETTER CAPITAL Z +2129 ; valid ; ; NV8 # 1.1 TURNED GREEK SMALL LETTER IOTA +212A ; mapped ; 006B # 1.1 KELVIN SIGN +212B ; mapped ; 00E5 # 1.1 ANGSTROM SIGN +212C ; mapped ; 0062 # 1.1 SCRIPT CAPITAL B +212D ; mapped ; 0063 # 1.1 BLACK-LETTER CAPITAL C +212E ; valid ; ; NV8 # 1.1 ESTIMATED SYMBOL +212F..2130 ; mapped ; 0065 # 1.1 SCRIPT SMALL E..SCRIPT CAPITAL E +2131 ; mapped ; 0066 # 1.1 SCRIPT CAPITAL F +2132 ; disallowed # 1.1 TURNED CAPITAL F +2133 ; mapped ; 006D # 1.1 SCRIPT CAPITAL M +2134 ; mapped ; 006F # 1.1 SCRIPT SMALL O +2135 ; mapped ; 05D0 # 1.1 ALEF SYMBOL +2136 ; mapped ; 05D1 # 1.1 BET SYMBOL +2137 ; mapped ; 05D2 # 1.1 GIMEL SYMBOL +2138 ; mapped ; 05D3 # 1.1 DALET SYMBOL +2139 ; mapped ; 0069 # 3.0 INFORMATION SOURCE +213A ; valid ; ; NV8 # 3.0 ROTATED CAPITAL Q +213B ; mapped ; 0066 0061 0078 #4.0 FACSIMILE SIGN +213C ; mapped ; 03C0 # 4.1 DOUBLE-STRUCK SMALL PI +213D..213E ; mapped ; 03B3 # 3.2 DOUBLE-STRUCK SMALL GAMMA..DOUBLE-STRUCK CAPITAL GAMMA +213F ; mapped ; 03C0 # 3.2 DOUBLE-STRUCK CAPITAL PI +2140 ; mapped ; 2211 # 3.2 DOUBLE-STRUCK N-ARY SUMMATION +2141..2144 ; valid ; ; NV8 # 3.2 TURNED SANS-SERIF CAPITAL G..TURNED SANS-SERIF CAPITAL Y +2145..2146 ; mapped ; 0064 # 3.2 DOUBLE-STRUCK ITALIC CAPITAL D..DOUBLE-STRUCK ITALIC SMALL D +2147 ; mapped ; 0065 # 3.2 DOUBLE-STRUCK ITALIC SMALL E +2148 ; mapped ; 0069 # 3.2 DOUBLE-STRUCK ITALIC SMALL I +2149 ; mapped ; 006A # 3.2 DOUBLE-STRUCK ITALIC SMALL J +214A..214B ; valid ; ; NV8 # 3.2 PROPERTY LINE..TURNED AMPERSAND +214C ; valid ; ; NV8 # 4.1 PER SIGN +214D ; valid ; ; NV8 # 5.0 AKTIESELSKAB +214E ; valid # 5.0 TURNED SMALL F +214F ; valid ; ; NV8 # 5.1 SYMBOL FOR SAMARITAN SOURCE +2150 ; mapped ; 0031 2044 0037 #5.2 VULGAR FRACTION ONE SEVENTH +2151 ; mapped ; 0031 2044 0039 #5.2 VULGAR FRACTION ONE NINTH +2152 ; mapped ; 0031 2044 0031 0030 #5.2 VULGAR FRACTION ONE TENTH +2153 ; mapped ; 0031 2044 0033 #1.1 VULGAR FRACTION ONE THIRD +2154 ; mapped ; 0032 2044 0033 #1.1 VULGAR FRACTION TWO THIRDS +2155 ; mapped ; 0031 2044 0035 #1.1 VULGAR FRACTION ONE FIFTH +2156 ; mapped ; 0032 2044 0035 #1.1 VULGAR FRACTION TWO FIFTHS +2157 ; mapped ; 0033 2044 0035 #1.1 VULGAR FRACTION THREE FIFTHS +2158 ; mapped ; 0034 2044 0035 #1.1 VULGAR FRACTION FOUR FIFTHS +2159 ; mapped ; 0031 2044 0036 #1.1 VULGAR FRACTION ONE SIXTH +215A ; mapped ; 0035 2044 0036 #1.1 VULGAR FRACTION FIVE SIXTHS +215B ; mapped ; 0031 2044 0038 #1.1 VULGAR FRACTION ONE EIGHTH +215C ; mapped ; 0033 2044 0038 #1.1 VULGAR FRACTION THREE EIGHTHS +215D ; mapped ; 0035 2044 0038 #1.1 VULGAR FRACTION FIVE EIGHTHS +215E ; mapped ; 0037 2044 0038 #1.1 VULGAR FRACTION SEVEN EIGHTHS +215F ; mapped ; 0031 2044 # 1.1 FRACTION NUMERATOR ONE +2160 ; mapped ; 0069 # 1.1 ROMAN NUMERAL ONE +2161 ; mapped ; 0069 0069 # 1.1 ROMAN NUMERAL TWO +2162 ; mapped ; 0069 0069 0069 #1.1 ROMAN NUMERAL THREE +2163 ; mapped ; 0069 0076 # 1.1 ROMAN NUMERAL FOUR +2164 ; mapped ; 0076 # 1.1 ROMAN NUMERAL FIVE +2165 ; mapped ; 0076 0069 # 1.1 ROMAN NUMERAL SIX +2166 ; mapped ; 0076 0069 0069 #1.1 ROMAN NUMERAL SEVEN +2167 ; mapped ; 0076 0069 0069 0069 #1.1 ROMAN NUMERAL EIGHT +2168 ; mapped ; 0069 0078 # 1.1 ROMAN NUMERAL NINE +2169 ; mapped ; 0078 # 1.1 ROMAN NUMERAL TEN +216A ; mapped ; 0078 0069 # 1.1 ROMAN NUMERAL ELEVEN +216B ; mapped ; 0078 0069 0069 #1.1 ROMAN NUMERAL TWELVE +216C ; mapped ; 006C # 1.1 ROMAN NUMERAL FIFTY +216D ; mapped ; 0063 # 1.1 ROMAN NUMERAL ONE HUNDRED +216E ; mapped ; 0064 # 1.1 ROMAN NUMERAL FIVE HUNDRED +216F ; mapped ; 006D # 1.1 ROMAN NUMERAL ONE THOUSAND +2170 ; mapped ; 0069 # 1.1 SMALL ROMAN NUMERAL ONE +2171 ; mapped ; 0069 0069 # 1.1 SMALL ROMAN NUMERAL TWO +2172 ; mapped ; 0069 0069 0069 #1.1 SMALL ROMAN NUMERAL THREE +2173 ; mapped ; 0069 0076 # 1.1 SMALL ROMAN NUMERAL FOUR +2174 ; mapped ; 0076 # 1.1 SMALL ROMAN NUMERAL FIVE +2175 ; mapped ; 0076 0069 # 1.1 SMALL ROMAN NUMERAL SIX +2176 ; mapped ; 0076 0069 0069 #1.1 SMALL ROMAN NUMERAL SEVEN +2177 ; mapped ; 0076 0069 0069 0069 #1.1 SMALL ROMAN NUMERAL EIGHT +2178 ; mapped ; 0069 0078 # 1.1 SMALL ROMAN NUMERAL NINE +2179 ; mapped ; 0078 # 1.1 SMALL ROMAN NUMERAL TEN +217A ; mapped ; 0078 0069 # 1.1 SMALL ROMAN NUMERAL ELEVEN +217B ; mapped ; 0078 0069 0069 #1.1 SMALL ROMAN NUMERAL TWELVE +217C ; mapped ; 006C # 1.1 SMALL ROMAN NUMERAL FIFTY +217D ; mapped ; 0063 # 1.1 SMALL ROMAN NUMERAL ONE HUNDRED +217E ; mapped ; 0064 # 1.1 SMALL ROMAN NUMERAL FIVE HUNDRED +217F ; mapped ; 006D # 1.1 SMALL ROMAN NUMERAL ONE THOUSAND +2180..2182 ; valid ; ; NV8 # 1.1 ROMAN NUMERAL ONE THOUSAND C D..ROMAN NUMERAL TEN THOUSAND +2183 ; disallowed # 3.0 ROMAN NUMERAL REVERSED ONE HUNDRED +2184 ; valid # 5.0 LATIN SMALL LETTER REVERSED C +2185..2188 ; valid ; ; NV8 # 5.1 ROMAN NUMERAL SIX LATE FORM..ROMAN NUMERAL ONE HUNDRED THOUSAND +2189 ; mapped ; 0030 2044 0033 #5.2 VULGAR FRACTION ZERO THIRDS +218A..218B ; valid ; ; NV8 # 8.0 TURNED DIGIT TWO..TURNED DIGIT THREE +218C..218F ; disallowed # NA .. +2190..21EA ; valid ; ; NV8 # 1.1 LEFTWARDS ARROW..UPWARDS WHITE ARROW FROM BAR +21EB..21F3 ; valid ; ; NV8 # 3.0 UPWARDS WHITE ARROW ON PEDESTAL..UP DOWN WHITE ARROW +21F4..21FF ; valid ; ; NV8 # 3.2 RIGHT ARROW WITH SMALL CIRCLE..LEFT RIGHT OPEN-HEADED ARROW +2200..222B ; valid ; ; NV8 # 1.1 FOR ALL..INTEGRAL +222C ; mapped ; 222B 222B # 1.1 DOUBLE INTEGRAL +222D ; mapped ; 222B 222B 222B #1.1 TRIPLE INTEGRAL +222E ; valid ; ; NV8 # 1.1 CONTOUR INTEGRAL +222F ; mapped ; 222E 222E # 1.1 SURFACE INTEGRAL +2230 ; mapped ; 222E 222E 222E #1.1 VOLUME INTEGRAL +2231..225F ; valid ; ; NV8 # 1.1 CLOCKWISE INTEGRAL..QUESTIONED EQUAL TO +2260 ; disallowed_STD3_valid # 1.1 NOT EQUAL TO +2261..226D ; valid ; ; NV8 # 1.1 IDENTICAL TO..NOT EQUIVALENT TO +226E..226F ; disallowed_STD3_valid # 1.1 NOT LESS-THAN..NOT GREATER-THAN +2270..22F1 ; valid ; ; NV8 # 1.1 NEITHER LESS-THAN NOR EQUAL TO..DOWN RIGHT DIAGONAL ELLIPSIS +22F2..22FF ; valid ; ; NV8 # 3.2 ELEMENT OF WITH LONG HORIZONTAL STROKE..Z NOTATION BAG MEMBERSHIP +2300 ; valid ; ; NV8 # 1.1 DIAMETER SIGN +2301 ; valid ; ; NV8 # 3.0 ELECTRIC ARROW +2302..2328 ; valid ; ; NV8 # 1.1 HOUSE..KEYBOARD +2329 ; mapped ; 3008 # 1.1 LEFT-POINTING ANGLE BRACKET +232A ; mapped ; 3009 # 1.1 RIGHT-POINTING ANGLE BRACKET +232B..237A ; valid ; ; NV8 # 1.1 ERASE TO THE LEFT..APL FUNCTIONAL SYMBOL ALPHA +237B ; valid ; ; NV8 # 3.0 NOT CHECK MARK +237C ; valid ; ; NV8 # 3.2 RIGHT ANGLE WITH DOWNWARDS ZIGZAG ARROW +237D..239A ; valid ; ; NV8 # 3.0 SHOULDERED OPEN BOX..CLEAR SCREEN SYMBOL +239B..23CE ; valid ; ; NV8 # 3.2 LEFT PARENTHESIS UPPER HOOK..RETURN SYMBOL +23CF..23D0 ; valid ; ; NV8 # 4.0 EJECT SYMBOL..VERTICAL LINE EXTENSION +23D1..23DB ; valid ; ; NV8 # 4.1 METRICAL BREVE..FUSE +23DC..23E7 ; valid ; ; NV8 # 5.0 TOP PARENTHESIS..ELECTRICAL INTERSECTION +23E8 ; valid ; ; NV8 # 5.2 DECIMAL EXPONENT SYMBOL +23E9..23F3 ; valid ; ; NV8 # 6.0 BLACK RIGHT-POINTING DOUBLE TRIANGLE..HOURGLASS WITH FLOWING SAND +23F4..23FA ; valid ; ; NV8 # 7.0 BLACK MEDIUM LEFT-POINTING TRIANGLE..BLACK CIRCLE FOR RECORD +23FB..23FE ; valid ; ; NV8 # 9.0 POWER SYMBOL..POWER SLEEP SYMBOL +23FF ; valid ; ; NV8 # 10.0 OBSERVER EYE SYMBOL +2400..2424 ; valid ; ; NV8 # 1.1 SYMBOL FOR NULL..SYMBOL FOR NEWLINE +2425..2426 ; valid ; ; NV8 # 3.0 SYMBOL FOR DELETE FORM TWO..SYMBOL FOR SUBSTITUTE FORM TWO +2427..243F ; disallowed # NA .. +2440..244A ; valid ; ; NV8 # 1.1 OCR HOOK..OCR DOUBLE BACKSLASH +244B..245F ; disallowed # NA .. +2460 ; mapped ; 0031 # 1.1 CIRCLED DIGIT ONE +2461 ; mapped ; 0032 # 1.1 CIRCLED DIGIT TWO +2462 ; mapped ; 0033 # 1.1 CIRCLED DIGIT THREE +2463 ; mapped ; 0034 # 1.1 CIRCLED DIGIT FOUR +2464 ; mapped ; 0035 # 1.1 CIRCLED DIGIT FIVE +2465 ; mapped ; 0036 # 1.1 CIRCLED DIGIT SIX +2466 ; mapped ; 0037 # 1.1 CIRCLED DIGIT SEVEN +2467 ; mapped ; 0038 # 1.1 CIRCLED DIGIT EIGHT +2468 ; mapped ; 0039 # 1.1 CIRCLED DIGIT NINE +2469 ; mapped ; 0031 0030 # 1.1 CIRCLED NUMBER TEN +246A ; mapped ; 0031 0031 # 1.1 CIRCLED NUMBER ELEVEN +246B ; mapped ; 0031 0032 # 1.1 CIRCLED NUMBER TWELVE +246C ; mapped ; 0031 0033 # 1.1 CIRCLED NUMBER THIRTEEN +246D ; mapped ; 0031 0034 # 1.1 CIRCLED NUMBER FOURTEEN +246E ; mapped ; 0031 0035 # 1.1 CIRCLED NUMBER FIFTEEN +246F ; mapped ; 0031 0036 # 1.1 CIRCLED NUMBER SIXTEEN +2470 ; mapped ; 0031 0037 # 1.1 CIRCLED NUMBER SEVENTEEN +2471 ; mapped ; 0031 0038 # 1.1 CIRCLED NUMBER EIGHTEEN +2472 ; mapped ; 0031 0039 # 1.1 CIRCLED NUMBER NINETEEN +2473 ; mapped ; 0032 0030 # 1.1 CIRCLED NUMBER TWENTY +2474 ; disallowed_STD3_mapped ; 0028 0031 0029 #1.1 PARENTHESIZED DIGIT ONE +2475 ; disallowed_STD3_mapped ; 0028 0032 0029 #1.1 PARENTHESIZED DIGIT TWO +2476 ; disallowed_STD3_mapped ; 0028 0033 0029 #1.1 PARENTHESIZED DIGIT THREE +2477 ; disallowed_STD3_mapped ; 0028 0034 0029 #1.1 PARENTHESIZED DIGIT FOUR +2478 ; disallowed_STD3_mapped ; 0028 0035 0029 #1.1 PARENTHESIZED DIGIT FIVE +2479 ; disallowed_STD3_mapped ; 0028 0036 0029 #1.1 PARENTHESIZED DIGIT SIX +247A ; disallowed_STD3_mapped ; 0028 0037 0029 #1.1 PARENTHESIZED DIGIT SEVEN +247B ; disallowed_STD3_mapped ; 0028 0038 0029 #1.1 PARENTHESIZED DIGIT EIGHT +247C ; disallowed_STD3_mapped ; 0028 0039 0029 #1.1 PARENTHESIZED DIGIT NINE +247D ; disallowed_STD3_mapped ; 0028 0031 0030 0029 #1.1 PARENTHESIZED NUMBER TEN +247E ; disallowed_STD3_mapped ; 0028 0031 0031 0029 #1.1 PARENTHESIZED NUMBER ELEVEN +247F ; disallowed_STD3_mapped ; 0028 0031 0032 0029 #1.1 PARENTHESIZED NUMBER TWELVE +2480 ; disallowed_STD3_mapped ; 0028 0031 0033 0029 #1.1 PARENTHESIZED NUMBER THIRTEEN +2481 ; disallowed_STD3_mapped ; 0028 0031 0034 0029 #1.1 PARENTHESIZED NUMBER FOURTEEN +2482 ; disallowed_STD3_mapped ; 0028 0031 0035 0029 #1.1 PARENTHESIZED NUMBER FIFTEEN +2483 ; disallowed_STD3_mapped ; 0028 0031 0036 0029 #1.1 PARENTHESIZED NUMBER SIXTEEN +2484 ; disallowed_STD3_mapped ; 0028 0031 0037 0029 #1.1 PARENTHESIZED NUMBER SEVENTEEN +2485 ; disallowed_STD3_mapped ; 0028 0031 0038 0029 #1.1 PARENTHESIZED NUMBER EIGHTEEN +2486 ; disallowed_STD3_mapped ; 0028 0031 0039 0029 #1.1 PARENTHESIZED NUMBER NINETEEN +2487 ; disallowed_STD3_mapped ; 0028 0032 0030 0029 #1.1 PARENTHESIZED NUMBER TWENTY +2488..249B ; disallowed # 1.1 DIGIT ONE FULL STOP..NUMBER TWENTY FULL STOP +249C ; disallowed_STD3_mapped ; 0028 0061 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER A +249D ; disallowed_STD3_mapped ; 0028 0062 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER B +249E ; disallowed_STD3_mapped ; 0028 0063 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER C +249F ; disallowed_STD3_mapped ; 0028 0064 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER D +24A0 ; disallowed_STD3_mapped ; 0028 0065 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER E +24A1 ; disallowed_STD3_mapped ; 0028 0066 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER F +24A2 ; disallowed_STD3_mapped ; 0028 0067 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER G +24A3 ; disallowed_STD3_mapped ; 0028 0068 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER H +24A4 ; disallowed_STD3_mapped ; 0028 0069 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER I +24A5 ; disallowed_STD3_mapped ; 0028 006A 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER J +24A6 ; disallowed_STD3_mapped ; 0028 006B 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER K +24A7 ; disallowed_STD3_mapped ; 0028 006C 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER L +24A8 ; disallowed_STD3_mapped ; 0028 006D 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER M +24A9 ; disallowed_STD3_mapped ; 0028 006E 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER N +24AA ; disallowed_STD3_mapped ; 0028 006F 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER O +24AB ; disallowed_STD3_mapped ; 0028 0070 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER P +24AC ; disallowed_STD3_mapped ; 0028 0071 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER Q +24AD ; disallowed_STD3_mapped ; 0028 0072 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER R +24AE ; disallowed_STD3_mapped ; 0028 0073 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER S +24AF ; disallowed_STD3_mapped ; 0028 0074 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER T +24B0 ; disallowed_STD3_mapped ; 0028 0075 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER U +24B1 ; disallowed_STD3_mapped ; 0028 0076 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER V +24B2 ; disallowed_STD3_mapped ; 0028 0077 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER W +24B3 ; disallowed_STD3_mapped ; 0028 0078 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER X +24B4 ; disallowed_STD3_mapped ; 0028 0079 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER Y +24B5 ; disallowed_STD3_mapped ; 0028 007A 0029 #1.1 PARENTHESIZED LATIN SMALL LETTER Z +24B6 ; mapped ; 0061 # 1.1 CIRCLED LATIN CAPITAL LETTER A +24B7 ; mapped ; 0062 # 1.1 CIRCLED LATIN CAPITAL LETTER B +24B8 ; mapped ; 0063 # 1.1 CIRCLED LATIN CAPITAL LETTER C +24B9 ; mapped ; 0064 # 1.1 CIRCLED LATIN CAPITAL LETTER D +24BA ; mapped ; 0065 # 1.1 CIRCLED LATIN CAPITAL LETTER E +24BB ; mapped ; 0066 # 1.1 CIRCLED LATIN CAPITAL LETTER F +24BC ; mapped ; 0067 # 1.1 CIRCLED LATIN CAPITAL LETTER G +24BD ; mapped ; 0068 # 1.1 CIRCLED LATIN CAPITAL LETTER H +24BE ; mapped ; 0069 # 1.1 CIRCLED LATIN CAPITAL LETTER I +24BF ; mapped ; 006A # 1.1 CIRCLED LATIN CAPITAL LETTER J +24C0 ; mapped ; 006B # 1.1 CIRCLED LATIN CAPITAL LETTER K +24C1 ; mapped ; 006C # 1.1 CIRCLED LATIN CAPITAL LETTER L +24C2 ; mapped ; 006D # 1.1 CIRCLED LATIN CAPITAL LETTER M +24C3 ; mapped ; 006E # 1.1 CIRCLED LATIN CAPITAL LETTER N +24C4 ; mapped ; 006F # 1.1 CIRCLED LATIN CAPITAL LETTER O +24C5 ; mapped ; 0070 # 1.1 CIRCLED LATIN CAPITAL LETTER P +24C6 ; mapped ; 0071 # 1.1 CIRCLED LATIN CAPITAL LETTER Q +24C7 ; mapped ; 0072 # 1.1 CIRCLED LATIN CAPITAL LETTER R +24C8 ; mapped ; 0073 # 1.1 CIRCLED LATIN CAPITAL LETTER S +24C9 ; mapped ; 0074 # 1.1 CIRCLED LATIN CAPITAL LETTER T +24CA ; mapped ; 0075 # 1.1 CIRCLED LATIN CAPITAL LETTER U +24CB ; mapped ; 0076 # 1.1 CIRCLED LATIN CAPITAL LETTER V +24CC ; mapped ; 0077 # 1.1 CIRCLED LATIN CAPITAL LETTER W +24CD ; mapped ; 0078 # 1.1 CIRCLED LATIN CAPITAL LETTER X +24CE ; mapped ; 0079 # 1.1 CIRCLED LATIN CAPITAL LETTER Y +24CF ; mapped ; 007A # 1.1 CIRCLED LATIN CAPITAL LETTER Z +24D0 ; mapped ; 0061 # 1.1 CIRCLED LATIN SMALL LETTER A +24D1 ; mapped ; 0062 # 1.1 CIRCLED LATIN SMALL LETTER B +24D2 ; mapped ; 0063 # 1.1 CIRCLED LATIN SMALL LETTER C +24D3 ; mapped ; 0064 # 1.1 CIRCLED LATIN SMALL LETTER D +24D4 ; mapped ; 0065 # 1.1 CIRCLED LATIN SMALL LETTER E +24D5 ; mapped ; 0066 # 1.1 CIRCLED LATIN SMALL LETTER F +24D6 ; mapped ; 0067 # 1.1 CIRCLED LATIN SMALL LETTER G +24D7 ; mapped ; 0068 # 1.1 CIRCLED LATIN SMALL LETTER H +24D8 ; mapped ; 0069 # 1.1 CIRCLED LATIN SMALL LETTER I +24D9 ; mapped ; 006A # 1.1 CIRCLED LATIN SMALL LETTER J +24DA ; mapped ; 006B # 1.1 CIRCLED LATIN SMALL LETTER K +24DB ; mapped ; 006C # 1.1 CIRCLED LATIN SMALL LETTER L +24DC ; mapped ; 006D # 1.1 CIRCLED LATIN SMALL LETTER M +24DD ; mapped ; 006E # 1.1 CIRCLED LATIN SMALL LETTER N +24DE ; mapped ; 006F # 1.1 CIRCLED LATIN SMALL LETTER O +24DF ; mapped ; 0070 # 1.1 CIRCLED LATIN SMALL LETTER P +24E0 ; mapped ; 0071 # 1.1 CIRCLED LATIN SMALL LETTER Q +24E1 ; mapped ; 0072 # 1.1 CIRCLED LATIN SMALL LETTER R +24E2 ; mapped ; 0073 # 1.1 CIRCLED LATIN SMALL LETTER S +24E3 ; mapped ; 0074 # 1.1 CIRCLED LATIN SMALL LETTER T +24E4 ; mapped ; 0075 # 1.1 CIRCLED LATIN SMALL LETTER U +24E5 ; mapped ; 0076 # 1.1 CIRCLED LATIN SMALL LETTER V +24E6 ; mapped ; 0077 # 1.1 CIRCLED LATIN SMALL LETTER W +24E7 ; mapped ; 0078 # 1.1 CIRCLED LATIN SMALL LETTER X +24E8 ; mapped ; 0079 # 1.1 CIRCLED LATIN SMALL LETTER Y +24E9 ; mapped ; 007A # 1.1 CIRCLED LATIN SMALL LETTER Z +24EA ; mapped ; 0030 # 1.1 CIRCLED DIGIT ZERO +24EB..24FE ; valid ; ; NV8 # 3.2 NEGATIVE CIRCLED NUMBER ELEVEN..DOUBLE CIRCLED NUMBER TEN +24FF ; valid ; ; NV8 # 4.0 NEGATIVE CIRCLED DIGIT ZERO +2500..2595 ; valid ; ; NV8 # 1.1 BOX DRAWINGS LIGHT HORIZONTAL..RIGHT ONE EIGHTH BLOCK +2596..259F ; valid ; ; NV8 # 3.2 QUADRANT LOWER LEFT..QUADRANT UPPER RIGHT AND LOWER LEFT AND LOWER RIGHT +25A0..25EF ; valid ; ; NV8 # 1.1 BLACK SQUARE..LARGE CIRCLE +25F0..25F7 ; valid ; ; NV8 # 3.0 WHITE SQUARE WITH UPPER LEFT QUADRANT..WHITE CIRCLE WITH UPPER RIGHT QUADRANT +25F8..25FF ; valid ; ; NV8 # 3.2 UPPER LEFT TRIANGLE..LOWER RIGHT TRIANGLE +2600..2613 ; valid ; ; NV8 # 1.1 BLACK SUN WITH RAYS..SALTIRE +2614..2615 ; valid ; ; NV8 # 4.0 UMBRELLA WITH RAIN DROPS..HOT BEVERAGE +2616..2617 ; valid ; ; NV8 # 3.2 WHITE SHOGI PIECE..BLACK SHOGI PIECE +2618 ; valid ; ; NV8 # 4.1 SHAMROCK +2619 ; valid ; ; NV8 # 3.0 REVERSED ROTATED FLORAL HEART BULLET +261A..266F ; valid ; ; NV8 # 1.1 BLACK LEFT POINTING INDEX..MUSIC SHARP SIGN +2670..2671 ; valid ; ; NV8 # 3.0 WEST SYRIAC CROSS..EAST SYRIAC CROSS +2672..267D ; valid ; ; NV8 # 3.2 UNIVERSAL RECYCLING SYMBOL..PARTIALLY-RECYCLED PAPER SYMBOL +267E..267F ; valid ; ; NV8 # 4.1 PERMANENT PAPER SIGN..WHEELCHAIR SYMBOL +2680..2689 ; valid ; ; NV8 # 3.2 DIE FACE-1..BLACK CIRCLE WITH TWO WHITE DOTS +268A..2691 ; valid ; ; NV8 # 4.0 MONOGRAM FOR YANG..BLACK FLAG +2692..269C ; valid ; ; NV8 # 4.1 HAMMER AND PICK..FLEUR-DE-LIS +269D ; valid ; ; NV8 # 5.1 OUTLINED WHITE STAR +269E..269F ; valid ; ; NV8 # 5.2 THREE LINES CONVERGING RIGHT..THREE LINES CONVERGING LEFT +26A0..26A1 ; valid ; ; NV8 # 4.0 WARNING SIGN..HIGH VOLTAGE SIGN +26A2..26B1 ; valid ; ; NV8 # 4.1 DOUBLED FEMALE SIGN..FUNERAL URN +26B2 ; valid ; ; NV8 # 5.0 NEUTER +26B3..26BC ; valid ; ; NV8 # 5.1 CERES..SESQUIQUADRATE +26BD..26BF ; valid ; ; NV8 # 5.2 SOCCER BALL..SQUARED KEY +26C0..26C3 ; valid ; ; NV8 # 5.1 WHITE DRAUGHTS MAN..BLACK DRAUGHTS KING +26C4..26CD ; valid ; ; NV8 # 5.2 SNOWMAN WITHOUT SNOW..DISABLED CAR +26CE ; valid ; ; NV8 # 6.0 OPHIUCHUS +26CF..26E1 ; valid ; ; NV8 # 5.2 PICK..RESTRICTED LEFT ENTRY-2 +26E2 ; valid ; ; NV8 # 6.0 ASTRONOMICAL SYMBOL FOR URANUS +26E3 ; valid ; ; NV8 # 5.2 HEAVY CIRCLE WITH STROKE AND TWO DOTS ABOVE +26E4..26E7 ; valid ; ; NV8 # 6.0 PENTAGRAM..INVERTED PENTAGRAM +26E8..26FF ; valid ; ; NV8 # 5.2 BLACK CROSS ON SHIELD..WHITE FLAG WITH HORIZONTAL MIDDLE BLACK STRIPE +2700 ; valid ; ; NV8 # 7.0 BLACK SAFETY SCISSORS +2701..2704 ; valid ; ; NV8 # 1.1 UPPER BLADE SCISSORS..WHITE SCISSORS +2705 ; valid ; ; NV8 # 6.0 WHITE HEAVY CHECK MARK +2706..2709 ; valid ; ; NV8 # 1.1 TELEPHONE LOCATION SIGN..ENVELOPE +270A..270B ; valid ; ; NV8 # 6.0 RAISED FIST..RAISED HAND +270C..2727 ; valid ; ; NV8 # 1.1 VICTORY HAND..WHITE FOUR POINTED STAR +2728 ; valid ; ; NV8 # 6.0 SPARKLES +2729..274B ; valid ; ; NV8 # 1.1 STRESS OUTLINED WHITE STAR..HEAVY EIGHT TEARDROP-SPOKED PROPELLER ASTERISK +274C ; valid ; ; NV8 # 6.0 CROSS MARK +274D ; valid ; ; NV8 # 1.1 SHADOWED WHITE CIRCLE +274E ; valid ; ; NV8 # 6.0 NEGATIVE SQUARED CROSS MARK +274F..2752 ; valid ; ; NV8 # 1.1 LOWER RIGHT DROP-SHADOWED WHITE SQUARE..UPPER RIGHT SHADOWED WHITE SQUARE +2753..2755 ; valid ; ; NV8 # 6.0 BLACK QUESTION MARK ORNAMENT..WHITE EXCLAMATION MARK ORNAMENT +2756 ; valid ; ; NV8 # 1.1 BLACK DIAMOND MINUS WHITE X +2757 ; valid ; ; NV8 # 5.2 HEAVY EXCLAMATION MARK SYMBOL +2758..275E ; valid ; ; NV8 # 1.1 LIGHT VERTICAL BAR..HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT +275F..2760 ; valid ; ; NV8 # 6.0 HEAVY LOW SINGLE COMMA QUOTATION MARK ORNAMENT..HEAVY LOW DOUBLE COMMA QUOTATION MARK ORNAMENT +2761..2767 ; valid ; ; NV8 # 1.1 CURVED STEM PARAGRAPH SIGN ORNAMENT..ROTATED FLORAL HEART BULLET +2768..2775 ; valid ; ; NV8 # 3.2 MEDIUM LEFT PARENTHESIS ORNAMENT..MEDIUM RIGHT CURLY BRACKET ORNAMENT +2776..2794 ; valid ; ; NV8 # 1.1 DINGBAT NEGATIVE CIRCLED DIGIT ONE..HEAVY WIDE-HEADED RIGHTWARDS ARROW +2795..2797 ; valid ; ; NV8 # 6.0 HEAVY PLUS SIGN..HEAVY DIVISION SIGN +2798..27AF ; valid ; ; NV8 # 1.1 HEAVY SOUTH EAST ARROW..NOTCHED LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW +27B0 ; valid ; ; NV8 # 6.0 CURLY LOOP +27B1..27BE ; valid ; ; NV8 # 1.1 NOTCHED UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW..OPEN-OUTLINED RIGHTWARDS ARROW +27BF ; valid ; ; NV8 # 6.0 DOUBLE CURLY LOOP +27C0..27C6 ; valid ; ; NV8 # 4.1 THREE DIMENSIONAL ANGLE..RIGHT S-SHAPED BAG DELIMITER +27C7..27CA ; valid ; ; NV8 # 5.0 OR WITH DOT INSIDE..VERTICAL BAR WITH HORIZONTAL STROKE +27CB ; valid ; ; NV8 # 6.1 MATHEMATICAL RISING DIAGONAL +27CC ; valid ; ; NV8 # 5.1 LONG DIVISION +27CD ; valid ; ; NV8 # 6.1 MATHEMATICAL FALLING DIAGONAL +27CE..27CF ; valid ; ; NV8 # 6.0 SQUARED LOGICAL AND..SQUARED LOGICAL OR +27D0..27EB ; valid ; ; NV8 # 3.2 WHITE DIAMOND WITH CENTRED DOT..MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET +27EC..27EF ; valid ; ; NV8 # 5.1 MATHEMATICAL LEFT WHITE TORTOISE SHELL BRACKET..MATHEMATICAL RIGHT FLATTENED PARENTHESIS +27F0..27FF ; valid ; ; NV8 # 3.2 UPWARDS QUADRUPLE ARROW..LONG RIGHTWARDS SQUIGGLE ARROW +2800..28FF ; valid ; ; NV8 # 3.0 BRAILLE PATTERN BLANK..BRAILLE PATTERN DOTS-12345678 +2900..2A0B ; valid ; ; NV8 # 3.2 RIGHTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE..SUMMATION WITH INTEGRAL +2A0C ; mapped ; 222B 222B 222B 222B #3.2 QUADRUPLE INTEGRAL OPERATOR +2A0D..2A73 ; valid ; ; NV8 # 3.2 FINITE PART INTEGRAL..EQUALS SIGN ABOVE TILDE OPERATOR +2A74 ; disallowed_STD3_mapped ; 003A 003A 003D #3.2 DOUBLE COLON EQUAL +2A75 ; disallowed_STD3_mapped ; 003D 003D # 3.2 TWO CONSECUTIVE EQUALS SIGNS +2A76 ; disallowed_STD3_mapped ; 003D 003D 003D #3.2 THREE CONSECUTIVE EQUALS SIGNS +2A77..2ADB ; valid ; ; NV8 # 3.2 EQUALS SIGN WITH TWO DOTS ABOVE AND TWO DOTS BELOW..TRANSVERSAL INTERSECTION +2ADC ; mapped ; 2ADD 0338 # 3.2 FORKING +2ADD..2AFF ; valid ; ; NV8 # 3.2 NONFORKING..N-ARY WHITE VERTICAL BAR +2B00..2B0D ; valid ; ; NV8 # 4.0 NORTH EAST WHITE ARROW..UP DOWN BLACK ARROW +2B0E..2B13 ; valid ; ; NV8 # 4.1 RIGHTWARDS ARROW WITH TIP DOWNWARDS..SQUARE WITH BOTTOM HALF BLACK +2B14..2B1A ; valid ; ; NV8 # 5.0 SQUARE WITH UPPER RIGHT DIAGONAL HALF BLACK..DOTTED SQUARE +2B1B..2B1F ; valid ; ; NV8 # 5.1 BLACK LARGE SQUARE..BLACK PENTAGON +2B20..2B23 ; valid ; ; NV8 # 5.0 WHITE PENTAGON..HORIZONTAL BLACK HEXAGON +2B24..2B4C ; valid ; ; NV8 # 5.1 BLACK LARGE CIRCLE..RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR +2B4D..2B4F ; valid ; ; NV8 # 7.0 DOWNWARDS TRIANGLE-HEADED ZIGZAG ARROW..SHORT BACKSLANTED SOUTH ARROW +2B50..2B54 ; valid ; ; NV8 # 5.1 WHITE MEDIUM STAR..WHITE RIGHT-POINTING PENTAGON +2B55..2B59 ; valid ; ; NV8 # 5.2 HEAVY LARGE CIRCLE..HEAVY CIRCLED SALTIRE +2B5A..2B73 ; valid ; ; NV8 # 7.0 SLANTED NORTH ARROW WITH HOOKED HEAD..DOWNWARDS TRIANGLE-HEADED ARROW TO BAR +2B74..2B75 ; disallowed # NA .. +2B76..2B95 ; valid ; ; NV8 # 7.0 NORTH WEST TRIANGLE-HEADED ARROW TO BAR..RIGHTWARDS BLACK ARROW +2B96 ; disallowed # NA +2B97 ; valid ; ; NV8 # 13.0 SYMBOL FOR TYPE A ELECTRONICS +2B98..2BB9 ; valid ; ; NV8 # 7.0 THREE-D TOP-LIGHTED LEFTWARDS EQUILATERAL ARROWHEAD..UP ARROWHEAD IN A RECTANGLE BOX +2BBA..2BBC ; valid ; ; NV8 # 11.0 OVERLAPPING WHITE SQUARES..OVERLAPPING BLACK SQUARES +2BBD..2BC8 ; valid ; ; NV8 # 7.0 BALLOT BOX WITH LIGHT X..BLACK MEDIUM RIGHT-POINTING TRIANGLE CENTRED +2BC9 ; valid ; ; NV8 # 12.0 NEPTUNE FORM TWO +2BCA..2BD1 ; valid ; ; NV8 # 7.0 TOP HALF BLACK CIRCLE..UNCERTAINTY SIGN +2BD2 ; valid ; ; NV8 # 10.0 GROUP MARK +2BD3..2BEB ; valid ; ; NV8 # 11.0 PLUTO FORM TWO..STAR WITH RIGHT HALF BLACK +2BEC..2BEF ; valid ; ; NV8 # 8.0 LEFTWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS..DOWNWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS +2BF0..2BFE ; valid ; ; NV8 # 11.0 ERIS FORM ONE..REVERSED RIGHT ANGLE +2BFF ; valid ; ; NV8 # 12.0 HELLSCHREIBER PAUSE SYMBOL +2C00 ; mapped ; 2C30 # 4.1 GLAGOLITIC CAPITAL LETTER AZU +2C01 ; mapped ; 2C31 # 4.1 GLAGOLITIC CAPITAL LETTER BUKY +2C02 ; mapped ; 2C32 # 4.1 GLAGOLITIC CAPITAL LETTER VEDE +2C03 ; mapped ; 2C33 # 4.1 GLAGOLITIC CAPITAL LETTER GLAGOLI +2C04 ; mapped ; 2C34 # 4.1 GLAGOLITIC CAPITAL LETTER DOBRO +2C05 ; mapped ; 2C35 # 4.1 GLAGOLITIC CAPITAL LETTER YESTU +2C06 ; mapped ; 2C36 # 4.1 GLAGOLITIC CAPITAL LETTER ZHIVETE +2C07 ; mapped ; 2C37 # 4.1 GLAGOLITIC CAPITAL LETTER DZELO +2C08 ; mapped ; 2C38 # 4.1 GLAGOLITIC CAPITAL LETTER ZEMLJA +2C09 ; mapped ; 2C39 # 4.1 GLAGOLITIC CAPITAL LETTER IZHE +2C0A ; mapped ; 2C3A # 4.1 GLAGOLITIC CAPITAL LETTER INITIAL IZHE +2C0B ; mapped ; 2C3B # 4.1 GLAGOLITIC CAPITAL LETTER I +2C0C ; mapped ; 2C3C # 4.1 GLAGOLITIC CAPITAL LETTER DJERVI +2C0D ; mapped ; 2C3D # 4.1 GLAGOLITIC CAPITAL LETTER KAKO +2C0E ; mapped ; 2C3E # 4.1 GLAGOLITIC CAPITAL LETTER LJUDIJE +2C0F ; mapped ; 2C3F # 4.1 GLAGOLITIC CAPITAL LETTER MYSLITE +2C10 ; mapped ; 2C40 # 4.1 GLAGOLITIC CAPITAL LETTER NASHI +2C11 ; mapped ; 2C41 # 4.1 GLAGOLITIC CAPITAL LETTER ONU +2C12 ; mapped ; 2C42 # 4.1 GLAGOLITIC CAPITAL LETTER POKOJI +2C13 ; mapped ; 2C43 # 4.1 GLAGOLITIC CAPITAL LETTER RITSI +2C14 ; mapped ; 2C44 # 4.1 GLAGOLITIC CAPITAL LETTER SLOVO +2C15 ; mapped ; 2C45 # 4.1 GLAGOLITIC CAPITAL LETTER TVRIDO +2C16 ; mapped ; 2C46 # 4.1 GLAGOLITIC CAPITAL LETTER UKU +2C17 ; mapped ; 2C47 # 4.1 GLAGOLITIC CAPITAL LETTER FRITU +2C18 ; mapped ; 2C48 # 4.1 GLAGOLITIC CAPITAL LETTER HERU +2C19 ; mapped ; 2C49 # 4.1 GLAGOLITIC CAPITAL LETTER OTU +2C1A ; mapped ; 2C4A # 4.1 GLAGOLITIC CAPITAL LETTER PE +2C1B ; mapped ; 2C4B # 4.1 GLAGOLITIC CAPITAL LETTER SHTA +2C1C ; mapped ; 2C4C # 4.1 GLAGOLITIC CAPITAL LETTER TSI +2C1D ; mapped ; 2C4D # 4.1 GLAGOLITIC CAPITAL LETTER CHRIVI +2C1E ; mapped ; 2C4E # 4.1 GLAGOLITIC CAPITAL LETTER SHA +2C1F ; mapped ; 2C4F # 4.1 GLAGOLITIC CAPITAL LETTER YERU +2C20 ; mapped ; 2C50 # 4.1 GLAGOLITIC CAPITAL LETTER YERI +2C21 ; mapped ; 2C51 # 4.1 GLAGOLITIC CAPITAL LETTER YATI +2C22 ; mapped ; 2C52 # 4.1 GLAGOLITIC CAPITAL LETTER SPIDERY HA +2C23 ; mapped ; 2C53 # 4.1 GLAGOLITIC CAPITAL LETTER YU +2C24 ; mapped ; 2C54 # 4.1 GLAGOLITIC CAPITAL LETTER SMALL YUS +2C25 ; mapped ; 2C55 # 4.1 GLAGOLITIC CAPITAL LETTER SMALL YUS WITH TAIL +2C26 ; mapped ; 2C56 # 4.1 GLAGOLITIC CAPITAL LETTER YO +2C27 ; mapped ; 2C57 # 4.1 GLAGOLITIC CAPITAL LETTER IOTATED SMALL YUS +2C28 ; mapped ; 2C58 # 4.1 GLAGOLITIC CAPITAL LETTER BIG YUS +2C29 ; mapped ; 2C59 # 4.1 GLAGOLITIC CAPITAL LETTER IOTATED BIG YUS +2C2A ; mapped ; 2C5A # 4.1 GLAGOLITIC CAPITAL LETTER FITA +2C2B ; mapped ; 2C5B # 4.1 GLAGOLITIC CAPITAL LETTER IZHITSA +2C2C ; mapped ; 2C5C # 4.1 GLAGOLITIC CAPITAL LETTER SHTAPIC +2C2D ; mapped ; 2C5D # 4.1 GLAGOLITIC CAPITAL LETTER TROKUTASTI A +2C2E ; mapped ; 2C5E # 4.1 GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE +2C2F ; mapped ; 2C5F # 14.0 GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI +2C30..2C5E ; valid # 4.1 GLAGOLITIC SMALL LETTER AZU..GLAGOLITIC SMALL LETTER LATINATE MYSLITE +2C5F ; valid # 14.0 GLAGOLITIC SMALL LETTER CAUDATE CHRIVI +2C60 ; mapped ; 2C61 # 5.0 LATIN CAPITAL LETTER L WITH DOUBLE BAR +2C61 ; valid # 5.0 LATIN SMALL LETTER L WITH DOUBLE BAR +2C62 ; mapped ; 026B # 5.0 LATIN CAPITAL LETTER L WITH MIDDLE TILDE +2C63 ; mapped ; 1D7D # 5.0 LATIN CAPITAL LETTER P WITH STROKE +2C64 ; mapped ; 027D # 5.0 LATIN CAPITAL LETTER R WITH TAIL +2C65..2C66 ; valid # 5.0 LATIN SMALL LETTER A WITH STROKE..LATIN SMALL LETTER T WITH DIAGONAL STROKE +2C67 ; mapped ; 2C68 # 5.0 LATIN CAPITAL LETTER H WITH DESCENDER +2C68 ; valid # 5.0 LATIN SMALL LETTER H WITH DESCENDER +2C69 ; mapped ; 2C6A # 5.0 LATIN CAPITAL LETTER K WITH DESCENDER +2C6A ; valid # 5.0 LATIN SMALL LETTER K WITH DESCENDER +2C6B ; mapped ; 2C6C # 5.0 LATIN CAPITAL LETTER Z WITH DESCENDER +2C6C ; valid # 5.0 LATIN SMALL LETTER Z WITH DESCENDER +2C6D ; mapped ; 0251 # 5.1 LATIN CAPITAL LETTER ALPHA +2C6E ; mapped ; 0271 # 5.1 LATIN CAPITAL LETTER M WITH HOOK +2C6F ; mapped ; 0250 # 5.1 LATIN CAPITAL LETTER TURNED A +2C70 ; mapped ; 0252 # 5.2 LATIN CAPITAL LETTER TURNED ALPHA +2C71 ; valid # 5.1 LATIN SMALL LETTER V WITH RIGHT HOOK +2C72 ; mapped ; 2C73 # 5.1 LATIN CAPITAL LETTER W WITH HOOK +2C73 ; valid # 5.1 LATIN SMALL LETTER W WITH HOOK +2C74 ; valid # 5.0 LATIN SMALL LETTER V WITH CURL +2C75 ; mapped ; 2C76 # 5.0 LATIN CAPITAL LETTER HALF H +2C76..2C77 ; valid # 5.0 LATIN SMALL LETTER HALF H..LATIN SMALL LETTER TAILLESS PHI +2C78..2C7B ; valid # 5.1 LATIN SMALL LETTER E WITH NOTCH..LATIN LETTER SMALL CAPITAL TURNED E +2C7C ; mapped ; 006A # 5.1 LATIN SUBSCRIPT SMALL LETTER J +2C7D ; mapped ; 0076 # 5.1 MODIFIER LETTER CAPITAL V +2C7E ; mapped ; 023F # 5.2 LATIN CAPITAL LETTER S WITH SWASH TAIL +2C7F ; mapped ; 0240 # 5.2 LATIN CAPITAL LETTER Z WITH SWASH TAIL +2C80 ; mapped ; 2C81 # 4.1 COPTIC CAPITAL LETTER ALFA +2C81 ; valid # 4.1 COPTIC SMALL LETTER ALFA +2C82 ; mapped ; 2C83 # 4.1 COPTIC CAPITAL LETTER VIDA +2C83 ; valid # 4.1 COPTIC SMALL LETTER VIDA +2C84 ; mapped ; 2C85 # 4.1 COPTIC CAPITAL LETTER GAMMA +2C85 ; valid # 4.1 COPTIC SMALL LETTER GAMMA +2C86 ; mapped ; 2C87 # 4.1 COPTIC CAPITAL LETTER DALDA +2C87 ; valid # 4.1 COPTIC SMALL LETTER DALDA +2C88 ; mapped ; 2C89 # 4.1 COPTIC CAPITAL LETTER EIE +2C89 ; valid # 4.1 COPTIC SMALL LETTER EIE +2C8A ; mapped ; 2C8B # 4.1 COPTIC CAPITAL LETTER SOU +2C8B ; valid # 4.1 COPTIC SMALL LETTER SOU +2C8C ; mapped ; 2C8D # 4.1 COPTIC CAPITAL LETTER ZATA +2C8D ; valid # 4.1 COPTIC SMALL LETTER ZATA +2C8E ; mapped ; 2C8F # 4.1 COPTIC CAPITAL LETTER HATE +2C8F ; valid # 4.1 COPTIC SMALL LETTER HATE +2C90 ; mapped ; 2C91 # 4.1 COPTIC CAPITAL LETTER THETHE +2C91 ; valid # 4.1 COPTIC SMALL LETTER THETHE +2C92 ; mapped ; 2C93 # 4.1 COPTIC CAPITAL LETTER IAUDA +2C93 ; valid # 4.1 COPTIC SMALL LETTER IAUDA +2C94 ; mapped ; 2C95 # 4.1 COPTIC CAPITAL LETTER KAPA +2C95 ; valid # 4.1 COPTIC SMALL LETTER KAPA +2C96 ; mapped ; 2C97 # 4.1 COPTIC CAPITAL LETTER LAULA +2C97 ; valid # 4.1 COPTIC SMALL LETTER LAULA +2C98 ; mapped ; 2C99 # 4.1 COPTIC CAPITAL LETTER MI +2C99 ; valid # 4.1 COPTIC SMALL LETTER MI +2C9A ; mapped ; 2C9B # 4.1 COPTIC CAPITAL LETTER NI +2C9B ; valid # 4.1 COPTIC SMALL LETTER NI +2C9C ; mapped ; 2C9D # 4.1 COPTIC CAPITAL LETTER KSI +2C9D ; valid # 4.1 COPTIC SMALL LETTER KSI +2C9E ; mapped ; 2C9F # 4.1 COPTIC CAPITAL LETTER O +2C9F ; valid # 4.1 COPTIC SMALL LETTER O +2CA0 ; mapped ; 2CA1 # 4.1 COPTIC CAPITAL LETTER PI +2CA1 ; valid # 4.1 COPTIC SMALL LETTER PI +2CA2 ; mapped ; 2CA3 # 4.1 COPTIC CAPITAL LETTER RO +2CA3 ; valid # 4.1 COPTIC SMALL LETTER RO +2CA4 ; mapped ; 2CA5 # 4.1 COPTIC CAPITAL LETTER SIMA +2CA5 ; valid # 4.1 COPTIC SMALL LETTER SIMA +2CA6 ; mapped ; 2CA7 # 4.1 COPTIC CAPITAL LETTER TAU +2CA7 ; valid # 4.1 COPTIC SMALL LETTER TAU +2CA8 ; mapped ; 2CA9 # 4.1 COPTIC CAPITAL LETTER UA +2CA9 ; valid # 4.1 COPTIC SMALL LETTER UA +2CAA ; mapped ; 2CAB # 4.1 COPTIC CAPITAL LETTER FI +2CAB ; valid # 4.1 COPTIC SMALL LETTER FI +2CAC ; mapped ; 2CAD # 4.1 COPTIC CAPITAL LETTER KHI +2CAD ; valid # 4.1 COPTIC SMALL LETTER KHI +2CAE ; mapped ; 2CAF # 4.1 COPTIC CAPITAL LETTER PSI +2CAF ; valid # 4.1 COPTIC SMALL LETTER PSI +2CB0 ; mapped ; 2CB1 # 4.1 COPTIC CAPITAL LETTER OOU +2CB1 ; valid # 4.1 COPTIC SMALL LETTER OOU +2CB2 ; mapped ; 2CB3 # 4.1 COPTIC CAPITAL LETTER DIALECT-P ALEF +2CB3 ; valid # 4.1 COPTIC SMALL LETTER DIALECT-P ALEF +2CB4 ; mapped ; 2CB5 # 4.1 COPTIC CAPITAL LETTER OLD COPTIC AIN +2CB5 ; valid # 4.1 COPTIC SMALL LETTER OLD COPTIC AIN +2CB6 ; mapped ; 2CB7 # 4.1 COPTIC CAPITAL LETTER CRYPTOGRAMMIC EIE +2CB7 ; valid # 4.1 COPTIC SMALL LETTER CRYPTOGRAMMIC EIE +2CB8 ; mapped ; 2CB9 # 4.1 COPTIC CAPITAL LETTER DIALECT-P KAPA +2CB9 ; valid # 4.1 COPTIC SMALL LETTER DIALECT-P KAPA +2CBA ; mapped ; 2CBB # 4.1 COPTIC CAPITAL LETTER DIALECT-P NI +2CBB ; valid # 4.1 COPTIC SMALL LETTER DIALECT-P NI +2CBC ; mapped ; 2CBD # 4.1 COPTIC CAPITAL LETTER CRYPTOGRAMMIC NI +2CBD ; valid # 4.1 COPTIC SMALL LETTER CRYPTOGRAMMIC NI +2CBE ; mapped ; 2CBF # 4.1 COPTIC CAPITAL LETTER OLD COPTIC OOU +2CBF ; valid # 4.1 COPTIC SMALL LETTER OLD COPTIC OOU +2CC0 ; mapped ; 2CC1 # 4.1 COPTIC CAPITAL LETTER SAMPI +2CC1 ; valid # 4.1 COPTIC SMALL LETTER SAMPI +2CC2 ; mapped ; 2CC3 # 4.1 COPTIC CAPITAL LETTER CROSSED SHEI +2CC3 ; valid # 4.1 COPTIC SMALL LETTER CROSSED SHEI +2CC4 ; mapped ; 2CC5 # 4.1 COPTIC CAPITAL LETTER OLD COPTIC SHEI +2CC5 ; valid # 4.1 COPTIC SMALL LETTER OLD COPTIC SHEI +2CC6 ; mapped ; 2CC7 # 4.1 COPTIC CAPITAL LETTER OLD COPTIC ESH +2CC7 ; valid # 4.1 COPTIC SMALL LETTER OLD COPTIC ESH +2CC8 ; mapped ; 2CC9 # 4.1 COPTIC CAPITAL LETTER AKHMIMIC KHEI +2CC9 ; valid # 4.1 COPTIC SMALL LETTER AKHMIMIC KHEI +2CCA ; mapped ; 2CCB # 4.1 COPTIC CAPITAL LETTER DIALECT-P HORI +2CCB ; valid # 4.1 COPTIC SMALL LETTER DIALECT-P HORI +2CCC ; mapped ; 2CCD # 4.1 COPTIC CAPITAL LETTER OLD COPTIC HORI +2CCD ; valid # 4.1 COPTIC SMALL LETTER OLD COPTIC HORI +2CCE ; mapped ; 2CCF # 4.1 COPTIC CAPITAL LETTER OLD COPTIC HA +2CCF ; valid # 4.1 COPTIC SMALL LETTER OLD COPTIC HA +2CD0 ; mapped ; 2CD1 # 4.1 COPTIC CAPITAL LETTER L-SHAPED HA +2CD1 ; valid # 4.1 COPTIC SMALL LETTER L-SHAPED HA +2CD2 ; mapped ; 2CD3 # 4.1 COPTIC CAPITAL LETTER OLD COPTIC HEI +2CD3 ; valid # 4.1 COPTIC SMALL LETTER OLD COPTIC HEI +2CD4 ; mapped ; 2CD5 # 4.1 COPTIC CAPITAL LETTER OLD COPTIC HAT +2CD5 ; valid # 4.1 COPTIC SMALL LETTER OLD COPTIC HAT +2CD6 ; mapped ; 2CD7 # 4.1 COPTIC CAPITAL LETTER OLD COPTIC GANGIA +2CD7 ; valid # 4.1 COPTIC SMALL LETTER OLD COPTIC GANGIA +2CD8 ; mapped ; 2CD9 # 4.1 COPTIC CAPITAL LETTER OLD COPTIC DJA +2CD9 ; valid # 4.1 COPTIC SMALL LETTER OLD COPTIC DJA +2CDA ; mapped ; 2CDB # 4.1 COPTIC CAPITAL LETTER OLD COPTIC SHIMA +2CDB ; valid # 4.1 COPTIC SMALL LETTER OLD COPTIC SHIMA +2CDC ; mapped ; 2CDD # 4.1 COPTIC CAPITAL LETTER OLD NUBIAN SHIMA +2CDD ; valid # 4.1 COPTIC SMALL LETTER OLD NUBIAN SHIMA +2CDE ; mapped ; 2CDF # 4.1 COPTIC CAPITAL LETTER OLD NUBIAN NGI +2CDF ; valid # 4.1 COPTIC SMALL LETTER OLD NUBIAN NGI +2CE0 ; mapped ; 2CE1 # 4.1 COPTIC CAPITAL LETTER OLD NUBIAN NYI +2CE1 ; valid # 4.1 COPTIC SMALL LETTER OLD NUBIAN NYI +2CE2 ; mapped ; 2CE3 # 4.1 COPTIC CAPITAL LETTER OLD NUBIAN WAU +2CE3..2CE4 ; valid # 4.1 COPTIC SMALL LETTER OLD NUBIAN WAU..COPTIC SYMBOL KAI +2CE5..2CEA ; valid ; ; NV8 # 4.1 COPTIC SYMBOL MI RO..COPTIC SYMBOL SHIMA SIMA +2CEB ; mapped ; 2CEC # 5.2 COPTIC CAPITAL LETTER CRYPTOGRAMMIC SHEI +2CEC ; valid # 5.2 COPTIC SMALL LETTER CRYPTOGRAMMIC SHEI +2CED ; mapped ; 2CEE # 5.2 COPTIC CAPITAL LETTER CRYPTOGRAMMIC GANGIA +2CEE..2CF1 ; valid # 5.2 COPTIC SMALL LETTER CRYPTOGRAMMIC GANGIA..COPTIC COMBINING SPIRITUS LENIS +2CF2 ; mapped ; 2CF3 # 6.1 COPTIC CAPITAL LETTER BOHAIRIC KHEI +2CF3 ; valid # 6.1 COPTIC SMALL LETTER BOHAIRIC KHEI +2CF4..2CF8 ; disallowed # NA .. +2CF9..2CFF ; valid ; ; NV8 # 4.1 COPTIC OLD NUBIAN FULL STOP..COPTIC MORPHOLOGICAL DIVIDER +2D00..2D25 ; valid # 4.1 GEORGIAN SMALL LETTER AN..GEORGIAN SMALL LETTER HOE +2D26 ; disallowed # NA +2D27 ; valid # 6.1 GEORGIAN SMALL LETTER YN +2D28..2D2C ; disallowed # NA .. +2D2D ; valid # 6.1 GEORGIAN SMALL LETTER AEN +2D2E..2D2F ; disallowed # NA .. +2D30..2D65 ; valid # 4.1 TIFINAGH LETTER YA..TIFINAGH LETTER YAZZ +2D66..2D67 ; valid # 6.1 TIFINAGH LETTER YE..TIFINAGH LETTER YO +2D68..2D6E ; disallowed # NA .. +2D6F ; mapped ; 2D61 # 4.1 TIFINAGH MODIFIER LETTER LABIALIZATION MARK +2D70 ; valid ; ; NV8 # 6.0 TIFINAGH SEPARATOR MARK +2D71..2D7E ; disallowed # NA .. +2D7F ; valid # 6.0 TIFINAGH CONSONANT JOINER +2D80..2D96 ; valid # 4.1 ETHIOPIC SYLLABLE LOA..ETHIOPIC SYLLABLE GGWE +2D97..2D9F ; disallowed # NA .. +2DA0..2DA6 ; valid # 4.1 ETHIOPIC SYLLABLE SSA..ETHIOPIC SYLLABLE SSO +2DA7 ; disallowed # NA +2DA8..2DAE ; valid # 4.1 ETHIOPIC SYLLABLE CCA..ETHIOPIC SYLLABLE CCO +2DAF ; disallowed # NA +2DB0..2DB6 ; valid # 4.1 ETHIOPIC SYLLABLE ZZA..ETHIOPIC SYLLABLE ZZO +2DB7 ; disallowed # NA +2DB8..2DBE ; valid # 4.1 ETHIOPIC SYLLABLE CCHA..ETHIOPIC SYLLABLE CCHO +2DBF ; disallowed # NA +2DC0..2DC6 ; valid # 4.1 ETHIOPIC SYLLABLE QYA..ETHIOPIC SYLLABLE QYO +2DC7 ; disallowed # NA +2DC8..2DCE ; valid # 4.1 ETHIOPIC SYLLABLE KYA..ETHIOPIC SYLLABLE KYO +2DCF ; disallowed # NA +2DD0..2DD6 ; valid # 4.1 ETHIOPIC SYLLABLE XYA..ETHIOPIC SYLLABLE XYO +2DD7 ; disallowed # NA +2DD8..2DDE ; valid # 4.1 ETHIOPIC SYLLABLE GYA..ETHIOPIC SYLLABLE GYO +2DDF ; disallowed # NA +2DE0..2DFF ; valid # 5.1 COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS +2E00..2E17 ; valid ; ; NV8 # 4.1 RIGHT ANGLE SUBSTITUTION MARKER..DOUBLE OBLIQUE HYPHEN +2E18..2E1B ; valid ; ; NV8 # 5.1 INVERTED INTERROBANG..TILDE WITH RING ABOVE +2E1C..2E1D ; valid ; ; NV8 # 4.1 LEFT LOW PARAPHRASE BRACKET..RIGHT LOW PARAPHRASE BRACKET +2E1E..2E2E ; valid ; ; NV8 # 5.1 TILDE WITH DOT ABOVE..REVERSED QUESTION MARK +2E2F ; valid # 5.1 VERTICAL TILDE +2E30 ; valid ; ; NV8 # 5.1 RING POINT +2E31 ; valid ; ; NV8 # 5.2 WORD SEPARATOR MIDDLE DOT +2E32..2E3B ; valid ; ; NV8 # 6.1 TURNED COMMA..THREE-EM DASH +2E3C..2E42 ; valid ; ; NV8 # 7.0 STENOGRAPHIC FULL STOP..DOUBLE LOW-REVERSED-9 QUOTATION MARK +2E43..2E44 ; valid ; ; NV8 # 9.0 DASH WITH LEFT UPTURN..DOUBLE SUSPENSION MARK +2E45..2E49 ; valid ; ; NV8 # 10.0 INVERTED LOW KAVYKA..DOUBLE STACKED COMMA +2E4A..2E4E ; valid ; ; NV8 # 11.0 DOTTED SOLIDUS..PUNCTUS ELEVATUS MARK +2E4F ; valid ; ; NV8 # 12.0 CORNISH VERSE DIVIDER +2E50..2E52 ; valid ; ; NV8 # 13.0 CROSS PATTY WITH RIGHT CROSSBAR..TIRONIAN SIGN CAPITAL ET +2E53..2E5D ; valid ; ; NV8 # 14.0 MEDIEVAL EXCLAMATION MARK..OBLIQUE HYPHEN +2E5E..2E7F ; disallowed # NA .. +2E80..2E99 ; valid ; ; NV8 # 3.0 CJK RADICAL REPEAT..CJK RADICAL RAP +2E9A ; disallowed # NA +2E9B..2E9E ; valid ; ; NV8 # 3.0 CJK RADICAL CHOKE..CJK RADICAL DEATH +2E9F ; mapped ; 6BCD # 3.0 CJK RADICAL MOTHER +2EA0..2EF2 ; valid ; ; NV8 # 3.0 CJK RADICAL CIVILIAN..CJK RADICAL J-SIMPLIFIED TURTLE +2EF3 ; mapped ; 9F9F # 3.0 CJK RADICAL C-SIMPLIFIED TURTLE +2EF4..2EFF ; disallowed # NA .. +2F00 ; mapped ; 4E00 # 3.0 KANGXI RADICAL ONE +2F01 ; mapped ; 4E28 # 3.0 KANGXI RADICAL LINE +2F02 ; mapped ; 4E36 # 3.0 KANGXI RADICAL DOT +2F03 ; mapped ; 4E3F # 3.0 KANGXI RADICAL SLASH +2F04 ; mapped ; 4E59 # 3.0 KANGXI RADICAL SECOND +2F05 ; mapped ; 4E85 # 3.0 KANGXI RADICAL HOOK +2F06 ; mapped ; 4E8C # 3.0 KANGXI RADICAL TWO +2F07 ; mapped ; 4EA0 # 3.0 KANGXI RADICAL LID +2F08 ; mapped ; 4EBA # 3.0 KANGXI RADICAL MAN +2F09 ; mapped ; 513F # 3.0 KANGXI RADICAL LEGS +2F0A ; mapped ; 5165 # 3.0 KANGXI RADICAL ENTER +2F0B ; mapped ; 516B # 3.0 KANGXI RADICAL EIGHT +2F0C ; mapped ; 5182 # 3.0 KANGXI RADICAL DOWN BOX +2F0D ; mapped ; 5196 # 3.0 KANGXI RADICAL COVER +2F0E ; mapped ; 51AB # 3.0 KANGXI RADICAL ICE +2F0F ; mapped ; 51E0 # 3.0 KANGXI RADICAL TABLE +2F10 ; mapped ; 51F5 # 3.0 KANGXI RADICAL OPEN BOX +2F11 ; mapped ; 5200 # 3.0 KANGXI RADICAL KNIFE +2F12 ; mapped ; 529B # 3.0 KANGXI RADICAL POWER +2F13 ; mapped ; 52F9 # 3.0 KANGXI RADICAL WRAP +2F14 ; mapped ; 5315 # 3.0 KANGXI RADICAL SPOON +2F15 ; mapped ; 531A # 3.0 KANGXI RADICAL RIGHT OPEN BOX +2F16 ; mapped ; 5338 # 3.0 KANGXI RADICAL HIDING ENCLOSURE +2F17 ; mapped ; 5341 # 3.0 KANGXI RADICAL TEN +2F18 ; mapped ; 535C # 3.0 KANGXI RADICAL DIVINATION +2F19 ; mapped ; 5369 # 3.0 KANGXI RADICAL SEAL +2F1A ; mapped ; 5382 # 3.0 KANGXI RADICAL CLIFF +2F1B ; mapped ; 53B6 # 3.0 KANGXI RADICAL PRIVATE +2F1C ; mapped ; 53C8 # 3.0 KANGXI RADICAL AGAIN +2F1D ; mapped ; 53E3 # 3.0 KANGXI RADICAL MOUTH +2F1E ; mapped ; 56D7 # 3.0 KANGXI RADICAL ENCLOSURE +2F1F ; mapped ; 571F # 3.0 KANGXI RADICAL EARTH +2F20 ; mapped ; 58EB # 3.0 KANGXI RADICAL SCHOLAR +2F21 ; mapped ; 5902 # 3.0 KANGXI RADICAL GO +2F22 ; mapped ; 590A # 3.0 KANGXI RADICAL GO SLOWLY +2F23 ; mapped ; 5915 # 3.0 KANGXI RADICAL EVENING +2F24 ; mapped ; 5927 # 3.0 KANGXI RADICAL BIG +2F25 ; mapped ; 5973 # 3.0 KANGXI RADICAL WOMAN +2F26 ; mapped ; 5B50 # 3.0 KANGXI RADICAL CHILD +2F27 ; mapped ; 5B80 # 3.0 KANGXI RADICAL ROOF +2F28 ; mapped ; 5BF8 # 3.0 KANGXI RADICAL INCH +2F29 ; mapped ; 5C0F # 3.0 KANGXI RADICAL SMALL +2F2A ; mapped ; 5C22 # 3.0 KANGXI RADICAL LAME +2F2B ; mapped ; 5C38 # 3.0 KANGXI RADICAL CORPSE +2F2C ; mapped ; 5C6E # 3.0 KANGXI RADICAL SPROUT +2F2D ; mapped ; 5C71 # 3.0 KANGXI RADICAL MOUNTAIN +2F2E ; mapped ; 5DDB # 3.0 KANGXI RADICAL RIVER +2F2F ; mapped ; 5DE5 # 3.0 KANGXI RADICAL WORK +2F30 ; mapped ; 5DF1 # 3.0 KANGXI RADICAL ONESELF +2F31 ; mapped ; 5DFE # 3.0 KANGXI RADICAL TURBAN +2F32 ; mapped ; 5E72 # 3.0 KANGXI RADICAL DRY +2F33 ; mapped ; 5E7A # 3.0 KANGXI RADICAL SHORT THREAD +2F34 ; mapped ; 5E7F # 3.0 KANGXI RADICAL DOTTED CLIFF +2F35 ; mapped ; 5EF4 # 3.0 KANGXI RADICAL LONG STRIDE +2F36 ; mapped ; 5EFE # 3.0 KANGXI RADICAL TWO HANDS +2F37 ; mapped ; 5F0B # 3.0 KANGXI RADICAL SHOOT +2F38 ; mapped ; 5F13 # 3.0 KANGXI RADICAL BOW +2F39 ; mapped ; 5F50 # 3.0 KANGXI RADICAL SNOUT +2F3A ; mapped ; 5F61 # 3.0 KANGXI RADICAL BRISTLE +2F3B ; mapped ; 5F73 # 3.0 KANGXI RADICAL STEP +2F3C ; mapped ; 5FC3 # 3.0 KANGXI RADICAL HEART +2F3D ; mapped ; 6208 # 3.0 KANGXI RADICAL HALBERD +2F3E ; mapped ; 6236 # 3.0 KANGXI RADICAL DOOR +2F3F ; mapped ; 624B # 3.0 KANGXI RADICAL HAND +2F40 ; mapped ; 652F # 3.0 KANGXI RADICAL BRANCH +2F41 ; mapped ; 6534 # 3.0 KANGXI RADICAL RAP +2F42 ; mapped ; 6587 # 3.0 KANGXI RADICAL SCRIPT +2F43 ; mapped ; 6597 # 3.0 KANGXI RADICAL DIPPER +2F44 ; mapped ; 65A4 # 3.0 KANGXI RADICAL AXE +2F45 ; mapped ; 65B9 # 3.0 KANGXI RADICAL SQUARE +2F46 ; mapped ; 65E0 # 3.0 KANGXI RADICAL NOT +2F47 ; mapped ; 65E5 # 3.0 KANGXI RADICAL SUN +2F48 ; mapped ; 66F0 # 3.0 KANGXI RADICAL SAY +2F49 ; mapped ; 6708 # 3.0 KANGXI RADICAL MOON +2F4A ; mapped ; 6728 # 3.0 KANGXI RADICAL TREE +2F4B ; mapped ; 6B20 # 3.0 KANGXI RADICAL LACK +2F4C ; mapped ; 6B62 # 3.0 KANGXI RADICAL STOP +2F4D ; mapped ; 6B79 # 3.0 KANGXI RADICAL DEATH +2F4E ; mapped ; 6BB3 # 3.0 KANGXI RADICAL WEAPON +2F4F ; mapped ; 6BCB # 3.0 KANGXI RADICAL DO NOT +2F50 ; mapped ; 6BD4 # 3.0 KANGXI RADICAL COMPARE +2F51 ; mapped ; 6BDB # 3.0 KANGXI RADICAL FUR +2F52 ; mapped ; 6C0F # 3.0 KANGXI RADICAL CLAN +2F53 ; mapped ; 6C14 # 3.0 KANGXI RADICAL STEAM +2F54 ; mapped ; 6C34 # 3.0 KANGXI RADICAL WATER +2F55 ; mapped ; 706B # 3.0 KANGXI RADICAL FIRE +2F56 ; mapped ; 722A # 3.0 KANGXI RADICAL CLAW +2F57 ; mapped ; 7236 # 3.0 KANGXI RADICAL FATHER +2F58 ; mapped ; 723B # 3.0 KANGXI RADICAL DOUBLE X +2F59 ; mapped ; 723F # 3.0 KANGXI RADICAL HALF TREE TRUNK +2F5A ; mapped ; 7247 # 3.0 KANGXI RADICAL SLICE +2F5B ; mapped ; 7259 # 3.0 KANGXI RADICAL FANG +2F5C ; mapped ; 725B # 3.0 KANGXI RADICAL COW +2F5D ; mapped ; 72AC # 3.0 KANGXI RADICAL DOG +2F5E ; mapped ; 7384 # 3.0 KANGXI RADICAL PROFOUND +2F5F ; mapped ; 7389 # 3.0 KANGXI RADICAL JADE +2F60 ; mapped ; 74DC # 3.0 KANGXI RADICAL MELON +2F61 ; mapped ; 74E6 # 3.0 KANGXI RADICAL TILE +2F62 ; mapped ; 7518 # 3.0 KANGXI RADICAL SWEET +2F63 ; mapped ; 751F # 3.0 KANGXI RADICAL LIFE +2F64 ; mapped ; 7528 # 3.0 KANGXI RADICAL USE +2F65 ; mapped ; 7530 # 3.0 KANGXI RADICAL FIELD +2F66 ; mapped ; 758B # 3.0 KANGXI RADICAL BOLT OF CLOTH +2F67 ; mapped ; 7592 # 3.0 KANGXI RADICAL SICKNESS +2F68 ; mapped ; 7676 # 3.0 KANGXI RADICAL DOTTED TENT +2F69 ; mapped ; 767D # 3.0 KANGXI RADICAL WHITE +2F6A ; mapped ; 76AE # 3.0 KANGXI RADICAL SKIN +2F6B ; mapped ; 76BF # 3.0 KANGXI RADICAL DISH +2F6C ; mapped ; 76EE # 3.0 KANGXI RADICAL EYE +2F6D ; mapped ; 77DB # 3.0 KANGXI RADICAL SPEAR +2F6E ; mapped ; 77E2 # 3.0 KANGXI RADICAL ARROW +2F6F ; mapped ; 77F3 # 3.0 KANGXI RADICAL STONE +2F70 ; mapped ; 793A # 3.0 KANGXI RADICAL SPIRIT +2F71 ; mapped ; 79B8 # 3.0 KANGXI RADICAL TRACK +2F72 ; mapped ; 79BE # 3.0 KANGXI RADICAL GRAIN +2F73 ; mapped ; 7A74 # 3.0 KANGXI RADICAL CAVE +2F74 ; mapped ; 7ACB # 3.0 KANGXI RADICAL STAND +2F75 ; mapped ; 7AF9 # 3.0 KANGXI RADICAL BAMBOO +2F76 ; mapped ; 7C73 # 3.0 KANGXI RADICAL RICE +2F77 ; mapped ; 7CF8 # 3.0 KANGXI RADICAL SILK +2F78 ; mapped ; 7F36 # 3.0 KANGXI RADICAL JAR +2F79 ; mapped ; 7F51 # 3.0 KANGXI RADICAL NET +2F7A ; mapped ; 7F8A # 3.0 KANGXI RADICAL SHEEP +2F7B ; mapped ; 7FBD # 3.0 KANGXI RADICAL FEATHER +2F7C ; mapped ; 8001 # 3.0 KANGXI RADICAL OLD +2F7D ; mapped ; 800C # 3.0 KANGXI RADICAL AND +2F7E ; mapped ; 8012 # 3.0 KANGXI RADICAL PLOW +2F7F ; mapped ; 8033 # 3.0 KANGXI RADICAL EAR +2F80 ; mapped ; 807F # 3.0 KANGXI RADICAL BRUSH +2F81 ; mapped ; 8089 # 3.0 KANGXI RADICAL MEAT +2F82 ; mapped ; 81E3 # 3.0 KANGXI RADICAL MINISTER +2F83 ; mapped ; 81EA # 3.0 KANGXI RADICAL SELF +2F84 ; mapped ; 81F3 # 3.0 KANGXI RADICAL ARRIVE +2F85 ; mapped ; 81FC # 3.0 KANGXI RADICAL MORTAR +2F86 ; mapped ; 820C # 3.0 KANGXI RADICAL TONGUE +2F87 ; mapped ; 821B # 3.0 KANGXI RADICAL OPPOSE +2F88 ; mapped ; 821F # 3.0 KANGXI RADICAL BOAT +2F89 ; mapped ; 826E # 3.0 KANGXI RADICAL STOPPING +2F8A ; mapped ; 8272 # 3.0 KANGXI RADICAL COLOR +2F8B ; mapped ; 8278 # 3.0 KANGXI RADICAL GRASS +2F8C ; mapped ; 864D # 3.0 KANGXI RADICAL TIGER +2F8D ; mapped ; 866B # 3.0 KANGXI RADICAL INSECT +2F8E ; mapped ; 8840 # 3.0 KANGXI RADICAL BLOOD +2F8F ; mapped ; 884C # 3.0 KANGXI RADICAL WALK ENCLOSURE +2F90 ; mapped ; 8863 # 3.0 KANGXI RADICAL CLOTHES +2F91 ; mapped ; 897E # 3.0 KANGXI RADICAL WEST +2F92 ; mapped ; 898B # 3.0 KANGXI RADICAL SEE +2F93 ; mapped ; 89D2 # 3.0 KANGXI RADICAL HORN +2F94 ; mapped ; 8A00 # 3.0 KANGXI RADICAL SPEECH +2F95 ; mapped ; 8C37 # 3.0 KANGXI RADICAL VALLEY +2F96 ; mapped ; 8C46 # 3.0 KANGXI RADICAL BEAN +2F97 ; mapped ; 8C55 # 3.0 KANGXI RADICAL PIG +2F98 ; mapped ; 8C78 # 3.0 KANGXI RADICAL BADGER +2F99 ; mapped ; 8C9D # 3.0 KANGXI RADICAL SHELL +2F9A ; mapped ; 8D64 # 3.0 KANGXI RADICAL RED +2F9B ; mapped ; 8D70 # 3.0 KANGXI RADICAL RUN +2F9C ; mapped ; 8DB3 # 3.0 KANGXI RADICAL FOOT +2F9D ; mapped ; 8EAB # 3.0 KANGXI RADICAL BODY +2F9E ; mapped ; 8ECA # 3.0 KANGXI RADICAL CART +2F9F ; mapped ; 8F9B # 3.0 KANGXI RADICAL BITTER +2FA0 ; mapped ; 8FB0 # 3.0 KANGXI RADICAL MORNING +2FA1 ; mapped ; 8FB5 # 3.0 KANGXI RADICAL WALK +2FA2 ; mapped ; 9091 # 3.0 KANGXI RADICAL CITY +2FA3 ; mapped ; 9149 # 3.0 KANGXI RADICAL WINE +2FA4 ; mapped ; 91C6 # 3.0 KANGXI RADICAL DISTINGUISH +2FA5 ; mapped ; 91CC # 3.0 KANGXI RADICAL VILLAGE +2FA6 ; mapped ; 91D1 # 3.0 KANGXI RADICAL GOLD +2FA7 ; mapped ; 9577 # 3.0 KANGXI RADICAL LONG +2FA8 ; mapped ; 9580 # 3.0 KANGXI RADICAL GATE +2FA9 ; mapped ; 961C # 3.0 KANGXI RADICAL MOUND +2FAA ; mapped ; 96B6 # 3.0 KANGXI RADICAL SLAVE +2FAB ; mapped ; 96B9 # 3.0 KANGXI RADICAL SHORT TAILED BIRD +2FAC ; mapped ; 96E8 # 3.0 KANGXI RADICAL RAIN +2FAD ; mapped ; 9751 # 3.0 KANGXI RADICAL BLUE +2FAE ; mapped ; 975E # 3.0 KANGXI RADICAL WRONG +2FAF ; mapped ; 9762 # 3.0 KANGXI RADICAL FACE +2FB0 ; mapped ; 9769 # 3.0 KANGXI RADICAL LEATHER +2FB1 ; mapped ; 97CB # 3.0 KANGXI RADICAL TANNED LEATHER +2FB2 ; mapped ; 97ED # 3.0 KANGXI RADICAL LEEK +2FB3 ; mapped ; 97F3 # 3.0 KANGXI RADICAL SOUND +2FB4 ; mapped ; 9801 # 3.0 KANGXI RADICAL LEAF +2FB5 ; mapped ; 98A8 # 3.0 KANGXI RADICAL WIND +2FB6 ; mapped ; 98DB # 3.0 KANGXI RADICAL FLY +2FB7 ; mapped ; 98DF # 3.0 KANGXI RADICAL EAT +2FB8 ; mapped ; 9996 # 3.0 KANGXI RADICAL HEAD +2FB9 ; mapped ; 9999 # 3.0 KANGXI RADICAL FRAGRANT +2FBA ; mapped ; 99AC # 3.0 KANGXI RADICAL HORSE +2FBB ; mapped ; 9AA8 # 3.0 KANGXI RADICAL BONE +2FBC ; mapped ; 9AD8 # 3.0 KANGXI RADICAL TALL +2FBD ; mapped ; 9ADF # 3.0 KANGXI RADICAL HAIR +2FBE ; mapped ; 9B25 # 3.0 KANGXI RADICAL FIGHT +2FBF ; mapped ; 9B2F # 3.0 KANGXI RADICAL SACRIFICIAL WINE +2FC0 ; mapped ; 9B32 # 3.0 KANGXI RADICAL CAULDRON +2FC1 ; mapped ; 9B3C # 3.0 KANGXI RADICAL GHOST +2FC2 ; mapped ; 9B5A # 3.0 KANGXI RADICAL FISH +2FC3 ; mapped ; 9CE5 # 3.0 KANGXI RADICAL BIRD +2FC4 ; mapped ; 9E75 # 3.0 KANGXI RADICAL SALT +2FC5 ; mapped ; 9E7F # 3.0 KANGXI RADICAL DEER +2FC6 ; mapped ; 9EA5 # 3.0 KANGXI RADICAL WHEAT +2FC7 ; mapped ; 9EBB # 3.0 KANGXI RADICAL HEMP +2FC8 ; mapped ; 9EC3 # 3.0 KANGXI RADICAL YELLOW +2FC9 ; mapped ; 9ECD # 3.0 KANGXI RADICAL MILLET +2FCA ; mapped ; 9ED1 # 3.0 KANGXI RADICAL BLACK +2FCB ; mapped ; 9EF9 # 3.0 KANGXI RADICAL EMBROIDERY +2FCC ; mapped ; 9EFD # 3.0 KANGXI RADICAL FROG +2FCD ; mapped ; 9F0E # 3.0 KANGXI RADICAL TRIPOD +2FCE ; mapped ; 9F13 # 3.0 KANGXI RADICAL DRUM +2FCF ; mapped ; 9F20 # 3.0 KANGXI RADICAL RAT +2FD0 ; mapped ; 9F3B # 3.0 KANGXI RADICAL NOSE +2FD1 ; mapped ; 9F4A # 3.0 KANGXI RADICAL EVEN +2FD2 ; mapped ; 9F52 # 3.0 KANGXI RADICAL TOOTH +2FD3 ; mapped ; 9F8D # 3.0 KANGXI RADICAL DRAGON +2FD4 ; mapped ; 9F9C # 3.0 KANGXI RADICAL TURTLE +2FD5 ; mapped ; 9FA0 # 3.0 KANGXI RADICAL FLUTE +2FD6..2FEF ; disallowed # NA .. +2FF0..2FFB ; disallowed # 3.0 IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RIGHT..IDEOGRAPHIC DESCRIPTION CHARACTER OVERLAID +2FFC..2FFF ; disallowed # NA .. +3000 ; disallowed_STD3_mapped ; 0020 # 1.1 IDEOGRAPHIC SPACE +3001 ; valid ; ; NV8 # 1.1 IDEOGRAPHIC COMMA +3002 ; mapped ; 002E # 1.1 IDEOGRAPHIC FULL STOP +3003..3004 ; valid ; ; NV8 # 1.1 DITTO MARK..JAPANESE INDUSTRIAL STANDARD SYMBOL +3005..3007 ; valid # 1.1 IDEOGRAPHIC ITERATION MARK..IDEOGRAPHIC NUMBER ZERO +3008..3029 ; valid ; ; NV8 # 1.1 LEFT ANGLE BRACKET..HANGZHOU NUMERAL NINE +302A..302D ; valid # 1.1 IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK +302E..3035 ; valid ; ; NV8 # 1.1 HANGUL SINGLE DOT TONE MARK..VERTICAL KANA REPEAT MARK LOWER HALF +3036 ; mapped ; 3012 # 1.1 CIRCLED POSTAL MARK +3037 ; valid ; ; NV8 # 1.1 IDEOGRAPHIC TELEGRAPH LINE FEED SEPARATOR SYMBOL +3038 ; mapped ; 5341 # 3.0 HANGZHOU NUMERAL TEN +3039 ; mapped ; 5344 # 3.0 HANGZHOU NUMERAL TWENTY +303A ; mapped ; 5345 # 3.0 HANGZHOU NUMERAL THIRTY +303B ; valid ; ; NV8 # 3.2 VERTICAL IDEOGRAPHIC ITERATION MARK +303C ; valid # 3.2 MASU MARK +303D ; valid ; ; NV8 # 3.2 PART ALTERNATION MARK +303E ; valid ; ; NV8 # 3.0 IDEOGRAPHIC VARIATION INDICATOR +303F ; valid ; ; NV8 # 1.1 IDEOGRAPHIC HALF FILL SPACE +3040 ; disallowed # NA +3041..3094 ; valid # 1.1 HIRAGANA LETTER SMALL A..HIRAGANA LETTER VU +3095..3096 ; valid # 3.2 HIRAGANA LETTER SMALL KA..HIRAGANA LETTER SMALL KE +3097..3098 ; disallowed # NA .. +3099..309A ; valid # 1.1 COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK +309B ; disallowed_STD3_mapped ; 0020 3099 # 1.1 KATAKANA-HIRAGANA VOICED SOUND MARK +309C ; disallowed_STD3_mapped ; 0020 309A # 1.1 KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK +309D..309E ; valid # 1.1 HIRAGANA ITERATION MARK..HIRAGANA VOICED ITERATION MARK +309F ; mapped ; 3088 308A # 3.2 HIRAGANA DIGRAPH YORI +30A0 ; valid ; ; NV8 # 3.2 KATAKANA-HIRAGANA DOUBLE HYPHEN +30A1..30FE ; valid # 1.1 KATAKANA LETTER SMALL A..KATAKANA VOICED ITERATION MARK +30FF ; mapped ; 30B3 30C8 # 3.2 KATAKANA DIGRAPH KOTO +3100..3104 ; disallowed # NA .. +3105..312C ; valid # 1.1 BOPOMOFO LETTER B..BOPOMOFO LETTER GN +312D ; valid # 5.1 BOPOMOFO LETTER IH +312E ; valid # 10.0 BOPOMOFO LETTER O WITH DOT ABOVE +312F ; valid # 11.0 BOPOMOFO LETTER NN +3130 ; disallowed # NA +3131 ; mapped ; 1100 # 1.1 HANGUL LETTER KIYEOK +3132 ; mapped ; 1101 # 1.1 HANGUL LETTER SSANGKIYEOK +3133 ; mapped ; 11AA # 1.1 HANGUL LETTER KIYEOK-SIOS +3134 ; mapped ; 1102 # 1.1 HANGUL LETTER NIEUN +3135 ; mapped ; 11AC # 1.1 HANGUL LETTER NIEUN-CIEUC +3136 ; mapped ; 11AD # 1.1 HANGUL LETTER NIEUN-HIEUH +3137 ; mapped ; 1103 # 1.1 HANGUL LETTER TIKEUT +3138 ; mapped ; 1104 # 1.1 HANGUL LETTER SSANGTIKEUT +3139 ; mapped ; 1105 # 1.1 HANGUL LETTER RIEUL +313A ; mapped ; 11B0 # 1.1 HANGUL LETTER RIEUL-KIYEOK +313B ; mapped ; 11B1 # 1.1 HANGUL LETTER RIEUL-MIEUM +313C ; mapped ; 11B2 # 1.1 HANGUL LETTER RIEUL-PIEUP +313D ; mapped ; 11B3 # 1.1 HANGUL LETTER RIEUL-SIOS +313E ; mapped ; 11B4 # 1.1 HANGUL LETTER RIEUL-THIEUTH +313F ; mapped ; 11B5 # 1.1 HANGUL LETTER RIEUL-PHIEUPH +3140 ; mapped ; 111A # 1.1 HANGUL LETTER RIEUL-HIEUH +3141 ; mapped ; 1106 # 1.1 HANGUL LETTER MIEUM +3142 ; mapped ; 1107 # 1.1 HANGUL LETTER PIEUP +3143 ; mapped ; 1108 # 1.1 HANGUL LETTER SSANGPIEUP +3144 ; mapped ; 1121 # 1.1 HANGUL LETTER PIEUP-SIOS +3145 ; mapped ; 1109 # 1.1 HANGUL LETTER SIOS +3146 ; mapped ; 110A # 1.1 HANGUL LETTER SSANGSIOS +3147 ; mapped ; 110B # 1.1 HANGUL LETTER IEUNG +3148 ; mapped ; 110C # 1.1 HANGUL LETTER CIEUC +3149 ; mapped ; 110D # 1.1 HANGUL LETTER SSANGCIEUC +314A ; mapped ; 110E # 1.1 HANGUL LETTER CHIEUCH +314B ; mapped ; 110F # 1.1 HANGUL LETTER KHIEUKH +314C ; mapped ; 1110 # 1.1 HANGUL LETTER THIEUTH +314D ; mapped ; 1111 # 1.1 HANGUL LETTER PHIEUPH +314E ; mapped ; 1112 # 1.1 HANGUL LETTER HIEUH +314F ; mapped ; 1161 # 1.1 HANGUL LETTER A +3150 ; mapped ; 1162 # 1.1 HANGUL LETTER AE +3151 ; mapped ; 1163 # 1.1 HANGUL LETTER YA +3152 ; mapped ; 1164 # 1.1 HANGUL LETTER YAE +3153 ; mapped ; 1165 # 1.1 HANGUL LETTER EO +3154 ; mapped ; 1166 # 1.1 HANGUL LETTER E +3155 ; mapped ; 1167 # 1.1 HANGUL LETTER YEO +3156 ; mapped ; 1168 # 1.1 HANGUL LETTER YE +3157 ; mapped ; 1169 # 1.1 HANGUL LETTER O +3158 ; mapped ; 116A # 1.1 HANGUL LETTER WA +3159 ; mapped ; 116B # 1.1 HANGUL LETTER WAE +315A ; mapped ; 116C # 1.1 HANGUL LETTER OE +315B ; mapped ; 116D # 1.1 HANGUL LETTER YO +315C ; mapped ; 116E # 1.1 HANGUL LETTER U +315D ; mapped ; 116F # 1.1 HANGUL LETTER WEO +315E ; mapped ; 1170 # 1.1 HANGUL LETTER WE +315F ; mapped ; 1171 # 1.1 HANGUL LETTER WI +3160 ; mapped ; 1172 # 1.1 HANGUL LETTER YU +3161 ; mapped ; 1173 # 1.1 HANGUL LETTER EU +3162 ; mapped ; 1174 # 1.1 HANGUL LETTER YI +3163 ; mapped ; 1175 # 1.1 HANGUL LETTER I +3164 ; disallowed # 1.1 HANGUL FILLER +3165 ; mapped ; 1114 # 1.1 HANGUL LETTER SSANGNIEUN +3166 ; mapped ; 1115 # 1.1 HANGUL LETTER NIEUN-TIKEUT +3167 ; mapped ; 11C7 # 1.1 HANGUL LETTER NIEUN-SIOS +3168 ; mapped ; 11C8 # 1.1 HANGUL LETTER NIEUN-PANSIOS +3169 ; mapped ; 11CC # 1.1 HANGUL LETTER RIEUL-KIYEOK-SIOS +316A ; mapped ; 11CE # 1.1 HANGUL LETTER RIEUL-TIKEUT +316B ; mapped ; 11D3 # 1.1 HANGUL LETTER RIEUL-PIEUP-SIOS +316C ; mapped ; 11D7 # 1.1 HANGUL LETTER RIEUL-PANSIOS +316D ; mapped ; 11D9 # 1.1 HANGUL LETTER RIEUL-YEORINHIEUH +316E ; mapped ; 111C # 1.1 HANGUL LETTER MIEUM-PIEUP +316F ; mapped ; 11DD # 1.1 HANGUL LETTER MIEUM-SIOS +3170 ; mapped ; 11DF # 1.1 HANGUL LETTER MIEUM-PANSIOS +3171 ; mapped ; 111D # 1.1 HANGUL LETTER KAPYEOUNMIEUM +3172 ; mapped ; 111E # 1.1 HANGUL LETTER PIEUP-KIYEOK +3173 ; mapped ; 1120 # 1.1 HANGUL LETTER PIEUP-TIKEUT +3174 ; mapped ; 1122 # 1.1 HANGUL LETTER PIEUP-SIOS-KIYEOK +3175 ; mapped ; 1123 # 1.1 HANGUL LETTER PIEUP-SIOS-TIKEUT +3176 ; mapped ; 1127 # 1.1 HANGUL LETTER PIEUP-CIEUC +3177 ; mapped ; 1129 # 1.1 HANGUL LETTER PIEUP-THIEUTH +3178 ; mapped ; 112B # 1.1 HANGUL LETTER KAPYEOUNPIEUP +3179 ; mapped ; 112C # 1.1 HANGUL LETTER KAPYEOUNSSANGPIEUP +317A ; mapped ; 112D # 1.1 HANGUL LETTER SIOS-KIYEOK +317B ; mapped ; 112E # 1.1 HANGUL LETTER SIOS-NIEUN +317C ; mapped ; 112F # 1.1 HANGUL LETTER SIOS-TIKEUT +317D ; mapped ; 1132 # 1.1 HANGUL LETTER SIOS-PIEUP +317E ; mapped ; 1136 # 1.1 HANGUL LETTER SIOS-CIEUC +317F ; mapped ; 1140 # 1.1 HANGUL LETTER PANSIOS +3180 ; mapped ; 1147 # 1.1 HANGUL LETTER SSANGIEUNG +3181 ; mapped ; 114C # 1.1 HANGUL LETTER YESIEUNG +3182 ; mapped ; 11F1 # 1.1 HANGUL LETTER YESIEUNG-SIOS +3183 ; mapped ; 11F2 # 1.1 HANGUL LETTER YESIEUNG-PANSIOS +3184 ; mapped ; 1157 # 1.1 HANGUL LETTER KAPYEOUNPHIEUPH +3185 ; mapped ; 1158 # 1.1 HANGUL LETTER SSANGHIEUH +3186 ; mapped ; 1159 # 1.1 HANGUL LETTER YEORINHIEUH +3187 ; mapped ; 1184 # 1.1 HANGUL LETTER YO-YA +3188 ; mapped ; 1185 # 1.1 HANGUL LETTER YO-YAE +3189 ; mapped ; 1188 # 1.1 HANGUL LETTER YO-I +318A ; mapped ; 1191 # 1.1 HANGUL LETTER YU-YEO +318B ; mapped ; 1192 # 1.1 HANGUL LETTER YU-YE +318C ; mapped ; 1194 # 1.1 HANGUL LETTER YU-I +318D ; mapped ; 119E # 1.1 HANGUL LETTER ARAEA +318E ; mapped ; 11A1 # 1.1 HANGUL LETTER ARAEAE +318F ; disallowed # NA +3190..3191 ; valid ; ; NV8 # 1.1 IDEOGRAPHIC ANNOTATION LINKING MARK..IDEOGRAPHIC ANNOTATION REVERSE MARK +3192 ; mapped ; 4E00 # 1.1 IDEOGRAPHIC ANNOTATION ONE MARK +3193 ; mapped ; 4E8C # 1.1 IDEOGRAPHIC ANNOTATION TWO MARK +3194 ; mapped ; 4E09 # 1.1 IDEOGRAPHIC ANNOTATION THREE MARK +3195 ; mapped ; 56DB # 1.1 IDEOGRAPHIC ANNOTATION FOUR MARK +3196 ; mapped ; 4E0A # 1.1 IDEOGRAPHIC ANNOTATION TOP MARK +3197 ; mapped ; 4E2D # 1.1 IDEOGRAPHIC ANNOTATION MIDDLE MARK +3198 ; mapped ; 4E0B # 1.1 IDEOGRAPHIC ANNOTATION BOTTOM MARK +3199 ; mapped ; 7532 # 1.1 IDEOGRAPHIC ANNOTATION FIRST MARK +319A ; mapped ; 4E59 # 1.1 IDEOGRAPHIC ANNOTATION SECOND MARK +319B ; mapped ; 4E19 # 1.1 IDEOGRAPHIC ANNOTATION THIRD MARK +319C ; mapped ; 4E01 # 1.1 IDEOGRAPHIC ANNOTATION FOURTH MARK +319D ; mapped ; 5929 # 1.1 IDEOGRAPHIC ANNOTATION HEAVEN MARK +319E ; mapped ; 5730 # 1.1 IDEOGRAPHIC ANNOTATION EARTH MARK +319F ; mapped ; 4EBA # 1.1 IDEOGRAPHIC ANNOTATION MAN MARK +31A0..31B7 ; valid # 3.0 BOPOMOFO LETTER BU..BOPOMOFO FINAL LETTER H +31B8..31BA ; valid # 6.0 BOPOMOFO LETTER GH..BOPOMOFO LETTER ZY +31BB..31BF ; valid # 13.0 BOPOMOFO FINAL LETTER G..BOPOMOFO LETTER AH +31C0..31CF ; valid ; ; NV8 # 4.1 CJK STROKE T..CJK STROKE N +31D0..31E3 ; valid ; ; NV8 # 5.1 CJK STROKE H..CJK STROKE Q +31E4..31EF ; disallowed # NA .. +31F0..31FF ; valid # 3.2 KATAKANA LETTER SMALL KU..KATAKANA LETTER SMALL RO +3200 ; disallowed_STD3_mapped ; 0028 1100 0029 #1.1 PARENTHESIZED HANGUL KIYEOK +3201 ; disallowed_STD3_mapped ; 0028 1102 0029 #1.1 PARENTHESIZED HANGUL NIEUN +3202 ; disallowed_STD3_mapped ; 0028 1103 0029 #1.1 PARENTHESIZED HANGUL TIKEUT +3203 ; disallowed_STD3_mapped ; 0028 1105 0029 #1.1 PARENTHESIZED HANGUL RIEUL +3204 ; disallowed_STD3_mapped ; 0028 1106 0029 #1.1 PARENTHESIZED HANGUL MIEUM +3205 ; disallowed_STD3_mapped ; 0028 1107 0029 #1.1 PARENTHESIZED HANGUL PIEUP +3206 ; disallowed_STD3_mapped ; 0028 1109 0029 #1.1 PARENTHESIZED HANGUL SIOS +3207 ; disallowed_STD3_mapped ; 0028 110B 0029 #1.1 PARENTHESIZED HANGUL IEUNG +3208 ; disallowed_STD3_mapped ; 0028 110C 0029 #1.1 PARENTHESIZED HANGUL CIEUC +3209 ; disallowed_STD3_mapped ; 0028 110E 0029 #1.1 PARENTHESIZED HANGUL CHIEUCH +320A ; disallowed_STD3_mapped ; 0028 110F 0029 #1.1 PARENTHESIZED HANGUL KHIEUKH +320B ; disallowed_STD3_mapped ; 0028 1110 0029 #1.1 PARENTHESIZED HANGUL THIEUTH +320C ; disallowed_STD3_mapped ; 0028 1111 0029 #1.1 PARENTHESIZED HANGUL PHIEUPH +320D ; disallowed_STD3_mapped ; 0028 1112 0029 #1.1 PARENTHESIZED HANGUL HIEUH +320E ; disallowed_STD3_mapped ; 0028 AC00 0029 #1.1 PARENTHESIZED HANGUL KIYEOK A +320F ; disallowed_STD3_mapped ; 0028 B098 0029 #1.1 PARENTHESIZED HANGUL NIEUN A +3210 ; disallowed_STD3_mapped ; 0028 B2E4 0029 #1.1 PARENTHESIZED HANGUL TIKEUT A +3211 ; disallowed_STD3_mapped ; 0028 B77C 0029 #1.1 PARENTHESIZED HANGUL RIEUL A +3212 ; disallowed_STD3_mapped ; 0028 B9C8 0029 #1.1 PARENTHESIZED HANGUL MIEUM A +3213 ; disallowed_STD3_mapped ; 0028 BC14 0029 #1.1 PARENTHESIZED HANGUL PIEUP A +3214 ; disallowed_STD3_mapped ; 0028 C0AC 0029 #1.1 PARENTHESIZED HANGUL SIOS A +3215 ; disallowed_STD3_mapped ; 0028 C544 0029 #1.1 PARENTHESIZED HANGUL IEUNG A +3216 ; disallowed_STD3_mapped ; 0028 C790 0029 #1.1 PARENTHESIZED HANGUL CIEUC A +3217 ; disallowed_STD3_mapped ; 0028 CC28 0029 #1.1 PARENTHESIZED HANGUL CHIEUCH A +3218 ; disallowed_STD3_mapped ; 0028 CE74 0029 #1.1 PARENTHESIZED HANGUL KHIEUKH A +3219 ; disallowed_STD3_mapped ; 0028 D0C0 0029 #1.1 PARENTHESIZED HANGUL THIEUTH A +321A ; disallowed_STD3_mapped ; 0028 D30C 0029 #1.1 PARENTHESIZED HANGUL PHIEUPH A +321B ; disallowed_STD3_mapped ; 0028 D558 0029 #1.1 PARENTHESIZED HANGUL HIEUH A +321C ; disallowed_STD3_mapped ; 0028 C8FC 0029 #1.1 PARENTHESIZED HANGUL CIEUC U +321D ; disallowed_STD3_mapped ; 0028 C624 C804 0029 #4.0 PARENTHESIZED KOREAN CHARACTER OJEON +321E ; disallowed_STD3_mapped ; 0028 C624 D6C4 0029 #4.0 PARENTHESIZED KOREAN CHARACTER O HU +321F ; disallowed # NA +3220 ; disallowed_STD3_mapped ; 0028 4E00 0029 #1.1 PARENTHESIZED IDEOGRAPH ONE +3221 ; disallowed_STD3_mapped ; 0028 4E8C 0029 #1.1 PARENTHESIZED IDEOGRAPH TWO +3222 ; disallowed_STD3_mapped ; 0028 4E09 0029 #1.1 PARENTHESIZED IDEOGRAPH THREE +3223 ; disallowed_STD3_mapped ; 0028 56DB 0029 #1.1 PARENTHESIZED IDEOGRAPH FOUR +3224 ; disallowed_STD3_mapped ; 0028 4E94 0029 #1.1 PARENTHESIZED IDEOGRAPH FIVE +3225 ; disallowed_STD3_mapped ; 0028 516D 0029 #1.1 PARENTHESIZED IDEOGRAPH SIX +3226 ; disallowed_STD3_mapped ; 0028 4E03 0029 #1.1 PARENTHESIZED IDEOGRAPH SEVEN +3227 ; disallowed_STD3_mapped ; 0028 516B 0029 #1.1 PARENTHESIZED IDEOGRAPH EIGHT +3228 ; disallowed_STD3_mapped ; 0028 4E5D 0029 #1.1 PARENTHESIZED IDEOGRAPH NINE +3229 ; disallowed_STD3_mapped ; 0028 5341 0029 #1.1 PARENTHESIZED IDEOGRAPH TEN +322A ; disallowed_STD3_mapped ; 0028 6708 0029 #1.1 PARENTHESIZED IDEOGRAPH MOON +322B ; disallowed_STD3_mapped ; 0028 706B 0029 #1.1 PARENTHESIZED IDEOGRAPH FIRE +322C ; disallowed_STD3_mapped ; 0028 6C34 0029 #1.1 PARENTHESIZED IDEOGRAPH WATER +322D ; disallowed_STD3_mapped ; 0028 6728 0029 #1.1 PARENTHESIZED IDEOGRAPH WOOD +322E ; disallowed_STD3_mapped ; 0028 91D1 0029 #1.1 PARENTHESIZED IDEOGRAPH METAL +322F ; disallowed_STD3_mapped ; 0028 571F 0029 #1.1 PARENTHESIZED IDEOGRAPH EARTH +3230 ; disallowed_STD3_mapped ; 0028 65E5 0029 #1.1 PARENTHESIZED IDEOGRAPH SUN +3231 ; disallowed_STD3_mapped ; 0028 682A 0029 #1.1 PARENTHESIZED IDEOGRAPH STOCK +3232 ; disallowed_STD3_mapped ; 0028 6709 0029 #1.1 PARENTHESIZED IDEOGRAPH HAVE +3233 ; disallowed_STD3_mapped ; 0028 793E 0029 #1.1 PARENTHESIZED IDEOGRAPH SOCIETY +3234 ; disallowed_STD3_mapped ; 0028 540D 0029 #1.1 PARENTHESIZED IDEOGRAPH NAME +3235 ; disallowed_STD3_mapped ; 0028 7279 0029 #1.1 PARENTHESIZED IDEOGRAPH SPECIAL +3236 ; disallowed_STD3_mapped ; 0028 8CA1 0029 #1.1 PARENTHESIZED IDEOGRAPH FINANCIAL +3237 ; disallowed_STD3_mapped ; 0028 795D 0029 #1.1 PARENTHESIZED IDEOGRAPH CONGRATULATION +3238 ; disallowed_STD3_mapped ; 0028 52B4 0029 #1.1 PARENTHESIZED IDEOGRAPH LABOR +3239 ; disallowed_STD3_mapped ; 0028 4EE3 0029 #1.1 PARENTHESIZED IDEOGRAPH REPRESENT +323A ; disallowed_STD3_mapped ; 0028 547C 0029 #1.1 PARENTHESIZED IDEOGRAPH CALL +323B ; disallowed_STD3_mapped ; 0028 5B66 0029 #1.1 PARENTHESIZED IDEOGRAPH STUDY +323C ; disallowed_STD3_mapped ; 0028 76E3 0029 #1.1 PARENTHESIZED IDEOGRAPH SUPERVISE +323D ; disallowed_STD3_mapped ; 0028 4F01 0029 #1.1 PARENTHESIZED IDEOGRAPH ENTERPRISE +323E ; disallowed_STD3_mapped ; 0028 8CC7 0029 #1.1 PARENTHESIZED IDEOGRAPH RESOURCE +323F ; disallowed_STD3_mapped ; 0028 5354 0029 #1.1 PARENTHESIZED IDEOGRAPH ALLIANCE +3240 ; disallowed_STD3_mapped ; 0028 796D 0029 #1.1 PARENTHESIZED IDEOGRAPH FESTIVAL +3241 ; disallowed_STD3_mapped ; 0028 4F11 0029 #1.1 PARENTHESIZED IDEOGRAPH REST +3242 ; disallowed_STD3_mapped ; 0028 81EA 0029 #1.1 PARENTHESIZED IDEOGRAPH SELF +3243 ; disallowed_STD3_mapped ; 0028 81F3 0029 #1.1 PARENTHESIZED IDEOGRAPH REACH +3244 ; mapped ; 554F # 5.2 CIRCLED IDEOGRAPH QUESTION +3245 ; mapped ; 5E7C # 5.2 CIRCLED IDEOGRAPH KINDERGARTEN +3246 ; mapped ; 6587 # 5.2 CIRCLED IDEOGRAPH SCHOOL +3247 ; mapped ; 7B8F # 5.2 CIRCLED IDEOGRAPH KOTO +3248..324F ; valid ; ; NV8 # 5.2 CIRCLED NUMBER TEN ON BLACK SQUARE..CIRCLED NUMBER EIGHTY ON BLACK SQUARE +3250 ; mapped ; 0070 0074 0065 #4.0 PARTNERSHIP SIGN +3251 ; mapped ; 0032 0031 # 3.2 CIRCLED NUMBER TWENTY ONE +3252 ; mapped ; 0032 0032 # 3.2 CIRCLED NUMBER TWENTY TWO +3253 ; mapped ; 0032 0033 # 3.2 CIRCLED NUMBER TWENTY THREE +3254 ; mapped ; 0032 0034 # 3.2 CIRCLED NUMBER TWENTY FOUR +3255 ; mapped ; 0032 0035 # 3.2 CIRCLED NUMBER TWENTY FIVE +3256 ; mapped ; 0032 0036 # 3.2 CIRCLED NUMBER TWENTY SIX +3257 ; mapped ; 0032 0037 # 3.2 CIRCLED NUMBER TWENTY SEVEN +3258 ; mapped ; 0032 0038 # 3.2 CIRCLED NUMBER TWENTY EIGHT +3259 ; mapped ; 0032 0039 # 3.2 CIRCLED NUMBER TWENTY NINE +325A ; mapped ; 0033 0030 # 3.2 CIRCLED NUMBER THIRTY +325B ; mapped ; 0033 0031 # 3.2 CIRCLED NUMBER THIRTY ONE +325C ; mapped ; 0033 0032 # 3.2 CIRCLED NUMBER THIRTY TWO +325D ; mapped ; 0033 0033 # 3.2 CIRCLED NUMBER THIRTY THREE +325E ; mapped ; 0033 0034 # 3.2 CIRCLED NUMBER THIRTY FOUR +325F ; mapped ; 0033 0035 # 3.2 CIRCLED NUMBER THIRTY FIVE +3260 ; mapped ; 1100 # 1.1 CIRCLED HANGUL KIYEOK +3261 ; mapped ; 1102 # 1.1 CIRCLED HANGUL NIEUN +3262 ; mapped ; 1103 # 1.1 CIRCLED HANGUL TIKEUT +3263 ; mapped ; 1105 # 1.1 CIRCLED HANGUL RIEUL +3264 ; mapped ; 1106 # 1.1 CIRCLED HANGUL MIEUM +3265 ; mapped ; 1107 # 1.1 CIRCLED HANGUL PIEUP +3266 ; mapped ; 1109 # 1.1 CIRCLED HANGUL SIOS +3267 ; mapped ; 110B # 1.1 CIRCLED HANGUL IEUNG +3268 ; mapped ; 110C # 1.1 CIRCLED HANGUL CIEUC +3269 ; mapped ; 110E # 1.1 CIRCLED HANGUL CHIEUCH +326A ; mapped ; 110F # 1.1 CIRCLED HANGUL KHIEUKH +326B ; mapped ; 1110 # 1.1 CIRCLED HANGUL THIEUTH +326C ; mapped ; 1111 # 1.1 CIRCLED HANGUL PHIEUPH +326D ; mapped ; 1112 # 1.1 CIRCLED HANGUL HIEUH +326E ; mapped ; AC00 # 1.1 CIRCLED HANGUL KIYEOK A +326F ; mapped ; B098 # 1.1 CIRCLED HANGUL NIEUN A +3270 ; mapped ; B2E4 # 1.1 CIRCLED HANGUL TIKEUT A +3271 ; mapped ; B77C # 1.1 CIRCLED HANGUL RIEUL A +3272 ; mapped ; B9C8 # 1.1 CIRCLED HANGUL MIEUM A +3273 ; mapped ; BC14 # 1.1 CIRCLED HANGUL PIEUP A +3274 ; mapped ; C0AC # 1.1 CIRCLED HANGUL SIOS A +3275 ; mapped ; C544 # 1.1 CIRCLED HANGUL IEUNG A +3276 ; mapped ; C790 # 1.1 CIRCLED HANGUL CIEUC A +3277 ; mapped ; CC28 # 1.1 CIRCLED HANGUL CHIEUCH A +3278 ; mapped ; CE74 # 1.1 CIRCLED HANGUL KHIEUKH A +3279 ; mapped ; D0C0 # 1.1 CIRCLED HANGUL THIEUTH A +327A ; mapped ; D30C # 1.1 CIRCLED HANGUL PHIEUPH A +327B ; mapped ; D558 # 1.1 CIRCLED HANGUL HIEUH A +327C ; mapped ; CC38 ACE0 # 4.0 CIRCLED KOREAN CHARACTER CHAMKO +327D ; mapped ; C8FC C758 # 4.0 CIRCLED KOREAN CHARACTER JUEUI +327E ; mapped ; C6B0 # 4.1 CIRCLED HANGUL IEUNG U +327F ; valid ; ; NV8 # 1.1 KOREAN STANDARD SYMBOL +3280 ; mapped ; 4E00 # 1.1 CIRCLED IDEOGRAPH ONE +3281 ; mapped ; 4E8C # 1.1 CIRCLED IDEOGRAPH TWO +3282 ; mapped ; 4E09 # 1.1 CIRCLED IDEOGRAPH THREE +3283 ; mapped ; 56DB # 1.1 CIRCLED IDEOGRAPH FOUR +3284 ; mapped ; 4E94 # 1.1 CIRCLED IDEOGRAPH FIVE +3285 ; mapped ; 516D # 1.1 CIRCLED IDEOGRAPH SIX +3286 ; mapped ; 4E03 # 1.1 CIRCLED IDEOGRAPH SEVEN +3287 ; mapped ; 516B # 1.1 CIRCLED IDEOGRAPH EIGHT +3288 ; mapped ; 4E5D # 1.1 CIRCLED IDEOGRAPH NINE +3289 ; mapped ; 5341 # 1.1 CIRCLED IDEOGRAPH TEN +328A ; mapped ; 6708 # 1.1 CIRCLED IDEOGRAPH MOON +328B ; mapped ; 706B # 1.1 CIRCLED IDEOGRAPH FIRE +328C ; mapped ; 6C34 # 1.1 CIRCLED IDEOGRAPH WATER +328D ; mapped ; 6728 # 1.1 CIRCLED IDEOGRAPH WOOD +328E ; mapped ; 91D1 # 1.1 CIRCLED IDEOGRAPH METAL +328F ; mapped ; 571F # 1.1 CIRCLED IDEOGRAPH EARTH +3290 ; mapped ; 65E5 # 1.1 CIRCLED IDEOGRAPH SUN +3291 ; mapped ; 682A # 1.1 CIRCLED IDEOGRAPH STOCK +3292 ; mapped ; 6709 # 1.1 CIRCLED IDEOGRAPH HAVE +3293 ; mapped ; 793E # 1.1 CIRCLED IDEOGRAPH SOCIETY +3294 ; mapped ; 540D # 1.1 CIRCLED IDEOGRAPH NAME +3295 ; mapped ; 7279 # 1.1 CIRCLED IDEOGRAPH SPECIAL +3296 ; mapped ; 8CA1 # 1.1 CIRCLED IDEOGRAPH FINANCIAL +3297 ; mapped ; 795D # 1.1 CIRCLED IDEOGRAPH CONGRATULATION +3298 ; mapped ; 52B4 # 1.1 CIRCLED IDEOGRAPH LABOR +3299 ; mapped ; 79D8 # 1.1 CIRCLED IDEOGRAPH SECRET +329A ; mapped ; 7537 # 1.1 CIRCLED IDEOGRAPH MALE +329B ; mapped ; 5973 # 1.1 CIRCLED IDEOGRAPH FEMALE +329C ; mapped ; 9069 # 1.1 CIRCLED IDEOGRAPH SUITABLE +329D ; mapped ; 512A # 1.1 CIRCLED IDEOGRAPH EXCELLENT +329E ; mapped ; 5370 # 1.1 CIRCLED IDEOGRAPH PRINT +329F ; mapped ; 6CE8 # 1.1 CIRCLED IDEOGRAPH ATTENTION +32A0 ; mapped ; 9805 # 1.1 CIRCLED IDEOGRAPH ITEM +32A1 ; mapped ; 4F11 # 1.1 CIRCLED IDEOGRAPH REST +32A2 ; mapped ; 5199 # 1.1 CIRCLED IDEOGRAPH COPY +32A3 ; mapped ; 6B63 # 1.1 CIRCLED IDEOGRAPH CORRECT +32A4 ; mapped ; 4E0A # 1.1 CIRCLED IDEOGRAPH HIGH +32A5 ; mapped ; 4E2D # 1.1 CIRCLED IDEOGRAPH CENTRE +32A6 ; mapped ; 4E0B # 1.1 CIRCLED IDEOGRAPH LOW +32A7 ; mapped ; 5DE6 # 1.1 CIRCLED IDEOGRAPH LEFT +32A8 ; mapped ; 53F3 # 1.1 CIRCLED IDEOGRAPH RIGHT +32A9 ; mapped ; 533B # 1.1 CIRCLED IDEOGRAPH MEDICINE +32AA ; mapped ; 5B97 # 1.1 CIRCLED IDEOGRAPH RELIGION +32AB ; mapped ; 5B66 # 1.1 CIRCLED IDEOGRAPH STUDY +32AC ; mapped ; 76E3 # 1.1 CIRCLED IDEOGRAPH SUPERVISE +32AD ; mapped ; 4F01 # 1.1 CIRCLED IDEOGRAPH ENTERPRISE +32AE ; mapped ; 8CC7 # 1.1 CIRCLED IDEOGRAPH RESOURCE +32AF ; mapped ; 5354 # 1.1 CIRCLED IDEOGRAPH ALLIANCE +32B0 ; mapped ; 591C # 1.1 CIRCLED IDEOGRAPH NIGHT +32B1 ; mapped ; 0033 0036 # 3.2 CIRCLED NUMBER THIRTY SIX +32B2 ; mapped ; 0033 0037 # 3.2 CIRCLED NUMBER THIRTY SEVEN +32B3 ; mapped ; 0033 0038 # 3.2 CIRCLED NUMBER THIRTY EIGHT +32B4 ; mapped ; 0033 0039 # 3.2 CIRCLED NUMBER THIRTY NINE +32B5 ; mapped ; 0034 0030 # 3.2 CIRCLED NUMBER FORTY +32B6 ; mapped ; 0034 0031 # 3.2 CIRCLED NUMBER FORTY ONE +32B7 ; mapped ; 0034 0032 # 3.2 CIRCLED NUMBER FORTY TWO +32B8 ; mapped ; 0034 0033 # 3.2 CIRCLED NUMBER FORTY THREE +32B9 ; mapped ; 0034 0034 # 3.2 CIRCLED NUMBER FORTY FOUR +32BA ; mapped ; 0034 0035 # 3.2 CIRCLED NUMBER FORTY FIVE +32BB ; mapped ; 0034 0036 # 3.2 CIRCLED NUMBER FORTY SIX +32BC ; mapped ; 0034 0037 # 3.2 CIRCLED NUMBER FORTY SEVEN +32BD ; mapped ; 0034 0038 # 3.2 CIRCLED NUMBER FORTY EIGHT +32BE ; mapped ; 0034 0039 # 3.2 CIRCLED NUMBER FORTY NINE +32BF ; mapped ; 0035 0030 # 3.2 CIRCLED NUMBER FIFTY +32C0 ; mapped ; 0031 6708 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR JANUARY +32C1 ; mapped ; 0032 6708 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR FEBRUARY +32C2 ; mapped ; 0033 6708 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR MARCH +32C3 ; mapped ; 0034 6708 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR APRIL +32C4 ; mapped ; 0035 6708 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR MAY +32C5 ; mapped ; 0036 6708 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR JUNE +32C6 ; mapped ; 0037 6708 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR JULY +32C7 ; mapped ; 0038 6708 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR AUGUST +32C8 ; mapped ; 0039 6708 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR SEPTEMBER +32C9 ; mapped ; 0031 0030 6708 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR OCTOBER +32CA ; mapped ; 0031 0031 6708 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR NOVEMBER +32CB ; mapped ; 0031 0032 6708 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DECEMBER +32CC ; mapped ; 0068 0067 # 4.0 SQUARE HG +32CD ; mapped ; 0065 0072 0067 #4.0 SQUARE ERG +32CE ; mapped ; 0065 0076 # 4.0 SQUARE EV +32CF ; mapped ; 006C 0074 0064 #4.0 LIMITED LIABILITY SIGN +32D0 ; mapped ; 30A2 # 1.1 CIRCLED KATAKANA A +32D1 ; mapped ; 30A4 # 1.1 CIRCLED KATAKANA I +32D2 ; mapped ; 30A6 # 1.1 CIRCLED KATAKANA U +32D3 ; mapped ; 30A8 # 1.1 CIRCLED KATAKANA E +32D4 ; mapped ; 30AA # 1.1 CIRCLED KATAKANA O +32D5 ; mapped ; 30AB # 1.1 CIRCLED KATAKANA KA +32D6 ; mapped ; 30AD # 1.1 CIRCLED KATAKANA KI +32D7 ; mapped ; 30AF # 1.1 CIRCLED KATAKANA KU +32D8 ; mapped ; 30B1 # 1.1 CIRCLED KATAKANA KE +32D9 ; mapped ; 30B3 # 1.1 CIRCLED KATAKANA KO +32DA ; mapped ; 30B5 # 1.1 CIRCLED KATAKANA SA +32DB ; mapped ; 30B7 # 1.1 CIRCLED KATAKANA SI +32DC ; mapped ; 30B9 # 1.1 CIRCLED KATAKANA SU +32DD ; mapped ; 30BB # 1.1 CIRCLED KATAKANA SE +32DE ; mapped ; 30BD # 1.1 CIRCLED KATAKANA SO +32DF ; mapped ; 30BF # 1.1 CIRCLED KATAKANA TA +32E0 ; mapped ; 30C1 # 1.1 CIRCLED KATAKANA TI +32E1 ; mapped ; 30C4 # 1.1 CIRCLED KATAKANA TU +32E2 ; mapped ; 30C6 # 1.1 CIRCLED KATAKANA TE +32E3 ; mapped ; 30C8 # 1.1 CIRCLED KATAKANA TO +32E4 ; mapped ; 30CA # 1.1 CIRCLED KATAKANA NA +32E5 ; mapped ; 30CB # 1.1 CIRCLED KATAKANA NI +32E6 ; mapped ; 30CC # 1.1 CIRCLED KATAKANA NU +32E7 ; mapped ; 30CD # 1.1 CIRCLED KATAKANA NE +32E8 ; mapped ; 30CE # 1.1 CIRCLED KATAKANA NO +32E9 ; mapped ; 30CF # 1.1 CIRCLED KATAKANA HA +32EA ; mapped ; 30D2 # 1.1 CIRCLED KATAKANA HI +32EB ; mapped ; 30D5 # 1.1 CIRCLED KATAKANA HU +32EC ; mapped ; 30D8 # 1.1 CIRCLED KATAKANA HE +32ED ; mapped ; 30DB # 1.1 CIRCLED KATAKANA HO +32EE ; mapped ; 30DE # 1.1 CIRCLED KATAKANA MA +32EF ; mapped ; 30DF # 1.1 CIRCLED KATAKANA MI +32F0 ; mapped ; 30E0 # 1.1 CIRCLED KATAKANA MU +32F1 ; mapped ; 30E1 # 1.1 CIRCLED KATAKANA ME +32F2 ; mapped ; 30E2 # 1.1 CIRCLED KATAKANA MO +32F3 ; mapped ; 30E4 # 1.1 CIRCLED KATAKANA YA +32F4 ; mapped ; 30E6 # 1.1 CIRCLED KATAKANA YU +32F5 ; mapped ; 30E8 # 1.1 CIRCLED KATAKANA YO +32F6 ; mapped ; 30E9 # 1.1 CIRCLED KATAKANA RA +32F7 ; mapped ; 30EA # 1.1 CIRCLED KATAKANA RI +32F8 ; mapped ; 30EB # 1.1 CIRCLED KATAKANA RU +32F9 ; mapped ; 30EC # 1.1 CIRCLED KATAKANA RE +32FA ; mapped ; 30ED # 1.1 CIRCLED KATAKANA RO +32FB ; mapped ; 30EF # 1.1 CIRCLED KATAKANA WA +32FC ; mapped ; 30F0 # 1.1 CIRCLED KATAKANA WI +32FD ; mapped ; 30F1 # 1.1 CIRCLED KATAKANA WE +32FE ; mapped ; 30F2 # 1.1 CIRCLED KATAKANA WO +32FF ; mapped ; 4EE4 548C # 12.1 SQUARE ERA NAME REIWA +3300 ; mapped ; 30A2 30D1 30FC 30C8 #1.1 SQUARE APAATO +3301 ; mapped ; 30A2 30EB 30D5 30A1 #1.1 SQUARE ARUHUA +3302 ; mapped ; 30A2 30F3 30DA 30A2 #1.1 SQUARE ANPEA +3303 ; mapped ; 30A2 30FC 30EB #1.1 SQUARE AARU +3304 ; mapped ; 30A4 30CB 30F3 30B0 #1.1 SQUARE ININGU +3305 ; mapped ; 30A4 30F3 30C1 #1.1 SQUARE INTI +3306 ; mapped ; 30A6 30A9 30F3 #1.1 SQUARE UON +3307 ; mapped ; 30A8 30B9 30AF 30FC 30C9 #1.1 SQUARE ESUKUUDO +3308 ; mapped ; 30A8 30FC 30AB 30FC #1.1 SQUARE EEKAA +3309 ; mapped ; 30AA 30F3 30B9 #1.1 SQUARE ONSU +330A ; mapped ; 30AA 30FC 30E0 #1.1 SQUARE OOMU +330B ; mapped ; 30AB 30A4 30EA #1.1 SQUARE KAIRI +330C ; mapped ; 30AB 30E9 30C3 30C8 #1.1 SQUARE KARATTO +330D ; mapped ; 30AB 30ED 30EA 30FC #1.1 SQUARE KARORII +330E ; mapped ; 30AC 30ED 30F3 #1.1 SQUARE GARON +330F ; mapped ; 30AC 30F3 30DE #1.1 SQUARE GANMA +3310 ; mapped ; 30AE 30AC # 1.1 SQUARE GIGA +3311 ; mapped ; 30AE 30CB 30FC #1.1 SQUARE GINII +3312 ; mapped ; 30AD 30E5 30EA 30FC #1.1 SQUARE KYURII +3313 ; mapped ; 30AE 30EB 30C0 30FC #1.1 SQUARE GIRUDAA +3314 ; mapped ; 30AD 30ED # 1.1 SQUARE KIRO +3315 ; mapped ; 30AD 30ED 30B0 30E9 30E0 #1.1 SQUARE KIROGURAMU +3316 ; mapped ; 30AD 30ED 30E1 30FC 30C8 30EB #1.1 SQUARE KIROMEETORU +3317 ; mapped ; 30AD 30ED 30EF 30C3 30C8 #1.1 SQUARE KIROWATTO +3318 ; mapped ; 30B0 30E9 30E0 #1.1 SQUARE GURAMU +3319 ; mapped ; 30B0 30E9 30E0 30C8 30F3 #1.1 SQUARE GURAMUTON +331A ; mapped ; 30AF 30EB 30BC 30A4 30ED #1.1 SQUARE KURUZEIRO +331B ; mapped ; 30AF 30ED 30FC 30CD #1.1 SQUARE KUROONE +331C ; mapped ; 30B1 30FC 30B9 #1.1 SQUARE KEESU +331D ; mapped ; 30B3 30EB 30CA #1.1 SQUARE KORUNA +331E ; mapped ; 30B3 30FC 30DD #1.1 SQUARE KOOPO +331F ; mapped ; 30B5 30A4 30AF 30EB #1.1 SQUARE SAIKURU +3320 ; mapped ; 30B5 30F3 30C1 30FC 30E0 #1.1 SQUARE SANTIIMU +3321 ; mapped ; 30B7 30EA 30F3 30B0 #1.1 SQUARE SIRINGU +3322 ; mapped ; 30BB 30F3 30C1 #1.1 SQUARE SENTI +3323 ; mapped ; 30BB 30F3 30C8 #1.1 SQUARE SENTO +3324 ; mapped ; 30C0 30FC 30B9 #1.1 SQUARE DAASU +3325 ; mapped ; 30C7 30B7 # 1.1 SQUARE DESI +3326 ; mapped ; 30C9 30EB # 1.1 SQUARE DORU +3327 ; mapped ; 30C8 30F3 # 1.1 SQUARE TON +3328 ; mapped ; 30CA 30CE # 1.1 SQUARE NANO +3329 ; mapped ; 30CE 30C3 30C8 #1.1 SQUARE NOTTO +332A ; mapped ; 30CF 30A4 30C4 #1.1 SQUARE HAITU +332B ; mapped ; 30D1 30FC 30BB 30F3 30C8 #1.1 SQUARE PAASENTO +332C ; mapped ; 30D1 30FC 30C4 #1.1 SQUARE PAATU +332D ; mapped ; 30D0 30FC 30EC 30EB #1.1 SQUARE BAARERU +332E ; mapped ; 30D4 30A2 30B9 30C8 30EB #1.1 SQUARE PIASUTORU +332F ; mapped ; 30D4 30AF 30EB #1.1 SQUARE PIKURU +3330 ; mapped ; 30D4 30B3 # 1.1 SQUARE PIKO +3331 ; mapped ; 30D3 30EB # 1.1 SQUARE BIRU +3332 ; mapped ; 30D5 30A1 30E9 30C3 30C9 #1.1 SQUARE HUARADDO +3333 ; mapped ; 30D5 30A3 30FC 30C8 #1.1 SQUARE HUIITO +3334 ; mapped ; 30D6 30C3 30B7 30A7 30EB #1.1 SQUARE BUSSYERU +3335 ; mapped ; 30D5 30E9 30F3 #1.1 SQUARE HURAN +3336 ; mapped ; 30D8 30AF 30BF 30FC 30EB #1.1 SQUARE HEKUTAARU +3337 ; mapped ; 30DA 30BD # 1.1 SQUARE PESO +3338 ; mapped ; 30DA 30CB 30D2 #1.1 SQUARE PENIHI +3339 ; mapped ; 30D8 30EB 30C4 #1.1 SQUARE HERUTU +333A ; mapped ; 30DA 30F3 30B9 #1.1 SQUARE PENSU +333B ; mapped ; 30DA 30FC 30B8 #1.1 SQUARE PEEZI +333C ; mapped ; 30D9 30FC 30BF #1.1 SQUARE BEETA +333D ; mapped ; 30DD 30A4 30F3 30C8 #1.1 SQUARE POINTO +333E ; mapped ; 30DC 30EB 30C8 #1.1 SQUARE BORUTO +333F ; mapped ; 30DB 30F3 # 1.1 SQUARE HON +3340 ; mapped ; 30DD 30F3 30C9 #1.1 SQUARE PONDO +3341 ; mapped ; 30DB 30FC 30EB #1.1 SQUARE HOORU +3342 ; mapped ; 30DB 30FC 30F3 #1.1 SQUARE HOON +3343 ; mapped ; 30DE 30A4 30AF 30ED #1.1 SQUARE MAIKURO +3344 ; mapped ; 30DE 30A4 30EB #1.1 SQUARE MAIRU +3345 ; mapped ; 30DE 30C3 30CF #1.1 SQUARE MAHHA +3346 ; mapped ; 30DE 30EB 30AF #1.1 SQUARE MARUKU +3347 ; mapped ; 30DE 30F3 30B7 30E7 30F3 #1.1 SQUARE MANSYON +3348 ; mapped ; 30DF 30AF 30ED 30F3 #1.1 SQUARE MIKURON +3349 ; mapped ; 30DF 30EA # 1.1 SQUARE MIRI +334A ; mapped ; 30DF 30EA 30D0 30FC 30EB #1.1 SQUARE MIRIBAARU +334B ; mapped ; 30E1 30AC # 1.1 SQUARE MEGA +334C ; mapped ; 30E1 30AC 30C8 30F3 #1.1 SQUARE MEGATON +334D ; mapped ; 30E1 30FC 30C8 30EB #1.1 SQUARE MEETORU +334E ; mapped ; 30E4 30FC 30C9 #1.1 SQUARE YAADO +334F ; mapped ; 30E4 30FC 30EB #1.1 SQUARE YAARU +3350 ; mapped ; 30E6 30A2 30F3 #1.1 SQUARE YUAN +3351 ; mapped ; 30EA 30C3 30C8 30EB #1.1 SQUARE RITTORU +3352 ; mapped ; 30EA 30E9 # 1.1 SQUARE RIRA +3353 ; mapped ; 30EB 30D4 30FC #1.1 SQUARE RUPII +3354 ; mapped ; 30EB 30FC 30D6 30EB #1.1 SQUARE RUUBURU +3355 ; mapped ; 30EC 30E0 # 1.1 SQUARE REMU +3356 ; mapped ; 30EC 30F3 30C8 30B2 30F3 #1.1 SQUARE RENTOGEN +3357 ; mapped ; 30EF 30C3 30C8 #1.1 SQUARE WATTO +3358 ; mapped ; 0030 70B9 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR ZERO +3359 ; mapped ; 0031 70B9 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR ONE +335A ; mapped ; 0032 70B9 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TWO +335B ; mapped ; 0033 70B9 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR THREE +335C ; mapped ; 0034 70B9 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR FOUR +335D ; mapped ; 0035 70B9 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR FIVE +335E ; mapped ; 0036 70B9 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR SIX +335F ; mapped ; 0037 70B9 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR SEVEN +3360 ; mapped ; 0038 70B9 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR EIGHT +3361 ; mapped ; 0039 70B9 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR NINE +3362 ; mapped ; 0031 0030 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TEN +3363 ; mapped ; 0031 0031 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR ELEVEN +3364 ; mapped ; 0031 0032 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TWELVE +3365 ; mapped ; 0031 0033 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR THIRTEEN +3366 ; mapped ; 0031 0034 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR FOURTEEN +3367 ; mapped ; 0031 0035 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR FIFTEEN +3368 ; mapped ; 0031 0036 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR SIXTEEN +3369 ; mapped ; 0031 0037 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR SEVENTEEN +336A ; mapped ; 0031 0038 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR EIGHTEEN +336B ; mapped ; 0031 0039 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR NINETEEN +336C ; mapped ; 0032 0030 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TWENTY +336D ; mapped ; 0032 0031 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TWENTY-ONE +336E ; mapped ; 0032 0032 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TWENTY-TWO +336F ; mapped ; 0032 0033 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TWENTY-THREE +3370 ; mapped ; 0032 0034 70B9 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR TWENTY-FOUR +3371 ; mapped ; 0068 0070 0061 #1.1 SQUARE HPA +3372 ; mapped ; 0064 0061 # 1.1 SQUARE DA +3373 ; mapped ; 0061 0075 # 1.1 SQUARE AU +3374 ; mapped ; 0062 0061 0072 #1.1 SQUARE BAR +3375 ; mapped ; 006F 0076 # 1.1 SQUARE OV +3376 ; mapped ; 0070 0063 # 1.1 SQUARE PC +3377 ; mapped ; 0064 006D # 4.0 SQUARE DM +3378 ; mapped ; 0064 006D 0032 #4.0 SQUARE DM SQUARED +3379 ; mapped ; 0064 006D 0033 #4.0 SQUARE DM CUBED +337A ; mapped ; 0069 0075 # 4.0 SQUARE IU +337B ; mapped ; 5E73 6210 # 1.1 SQUARE ERA NAME HEISEI +337C ; mapped ; 662D 548C # 1.1 SQUARE ERA NAME SYOUWA +337D ; mapped ; 5927 6B63 # 1.1 SQUARE ERA NAME TAISYOU +337E ; mapped ; 660E 6CBB # 1.1 SQUARE ERA NAME MEIZI +337F ; mapped ; 682A 5F0F 4F1A 793E #1.1 SQUARE CORPORATION +3380 ; mapped ; 0070 0061 # 1.1 SQUARE PA AMPS +3381 ; mapped ; 006E 0061 # 1.1 SQUARE NA +3382 ; mapped ; 03BC 0061 # 1.1 SQUARE MU A +3383 ; mapped ; 006D 0061 # 1.1 SQUARE MA +3384 ; mapped ; 006B 0061 # 1.1 SQUARE KA +3385 ; mapped ; 006B 0062 # 1.1 SQUARE KB +3386 ; mapped ; 006D 0062 # 1.1 SQUARE MB +3387 ; mapped ; 0067 0062 # 1.1 SQUARE GB +3388 ; mapped ; 0063 0061 006C #1.1 SQUARE CAL +3389 ; mapped ; 006B 0063 0061 006C #1.1 SQUARE KCAL +338A ; mapped ; 0070 0066 # 1.1 SQUARE PF +338B ; mapped ; 006E 0066 # 1.1 SQUARE NF +338C ; mapped ; 03BC 0066 # 1.1 SQUARE MU F +338D ; mapped ; 03BC 0067 # 1.1 SQUARE MU G +338E ; mapped ; 006D 0067 # 1.1 SQUARE MG +338F ; mapped ; 006B 0067 # 1.1 SQUARE KG +3390 ; mapped ; 0068 007A # 1.1 SQUARE HZ +3391 ; mapped ; 006B 0068 007A #1.1 SQUARE KHZ +3392 ; mapped ; 006D 0068 007A #1.1 SQUARE MHZ +3393 ; mapped ; 0067 0068 007A #1.1 SQUARE GHZ +3394 ; mapped ; 0074 0068 007A #1.1 SQUARE THZ +3395 ; mapped ; 03BC 006C # 1.1 SQUARE MU L +3396 ; mapped ; 006D 006C # 1.1 SQUARE ML +3397 ; mapped ; 0064 006C # 1.1 SQUARE DL +3398 ; mapped ; 006B 006C # 1.1 SQUARE KL +3399 ; mapped ; 0066 006D # 1.1 SQUARE FM +339A ; mapped ; 006E 006D # 1.1 SQUARE NM +339B ; mapped ; 03BC 006D # 1.1 SQUARE MU M +339C ; mapped ; 006D 006D # 1.1 SQUARE MM +339D ; mapped ; 0063 006D # 1.1 SQUARE CM +339E ; mapped ; 006B 006D # 1.1 SQUARE KM +339F ; mapped ; 006D 006D 0032 #1.1 SQUARE MM SQUARED +33A0 ; mapped ; 0063 006D 0032 #1.1 SQUARE CM SQUARED +33A1 ; mapped ; 006D 0032 # 1.1 SQUARE M SQUARED +33A2 ; mapped ; 006B 006D 0032 #1.1 SQUARE KM SQUARED +33A3 ; mapped ; 006D 006D 0033 #1.1 SQUARE MM CUBED +33A4 ; mapped ; 0063 006D 0033 #1.1 SQUARE CM CUBED +33A5 ; mapped ; 006D 0033 # 1.1 SQUARE M CUBED +33A6 ; mapped ; 006B 006D 0033 #1.1 SQUARE KM CUBED +33A7 ; mapped ; 006D 2215 0073 #1.1 SQUARE M OVER S +33A8 ; mapped ; 006D 2215 0073 0032 #1.1 SQUARE M OVER S SQUARED +33A9 ; mapped ; 0070 0061 # 1.1 SQUARE PA +33AA ; mapped ; 006B 0070 0061 #1.1 SQUARE KPA +33AB ; mapped ; 006D 0070 0061 #1.1 SQUARE MPA +33AC ; mapped ; 0067 0070 0061 #1.1 SQUARE GPA +33AD ; mapped ; 0072 0061 0064 #1.1 SQUARE RAD +33AE ; mapped ; 0072 0061 0064 2215 0073 #1.1 SQUARE RAD OVER S +33AF ; mapped ; 0072 0061 0064 2215 0073 0032 #1.1 SQUARE RAD OVER S SQUARED +33B0 ; mapped ; 0070 0073 # 1.1 SQUARE PS +33B1 ; mapped ; 006E 0073 # 1.1 SQUARE NS +33B2 ; mapped ; 03BC 0073 # 1.1 SQUARE MU S +33B3 ; mapped ; 006D 0073 # 1.1 SQUARE MS +33B4 ; mapped ; 0070 0076 # 1.1 SQUARE PV +33B5 ; mapped ; 006E 0076 # 1.1 SQUARE NV +33B6 ; mapped ; 03BC 0076 # 1.1 SQUARE MU V +33B7 ; mapped ; 006D 0076 # 1.1 SQUARE MV +33B8 ; mapped ; 006B 0076 # 1.1 SQUARE KV +33B9 ; mapped ; 006D 0076 # 1.1 SQUARE MV MEGA +33BA ; mapped ; 0070 0077 # 1.1 SQUARE PW +33BB ; mapped ; 006E 0077 # 1.1 SQUARE NW +33BC ; mapped ; 03BC 0077 # 1.1 SQUARE MU W +33BD ; mapped ; 006D 0077 # 1.1 SQUARE MW +33BE ; mapped ; 006B 0077 # 1.1 SQUARE KW +33BF ; mapped ; 006D 0077 # 1.1 SQUARE MW MEGA +33C0 ; mapped ; 006B 03C9 # 1.1 SQUARE K OHM +33C1 ; mapped ; 006D 03C9 # 1.1 SQUARE M OHM +33C2 ; disallowed # 1.1 SQUARE AM +33C3 ; mapped ; 0062 0071 # 1.1 SQUARE BQ +33C4 ; mapped ; 0063 0063 # 1.1 SQUARE CC +33C5 ; mapped ; 0063 0064 # 1.1 SQUARE CD +33C6 ; mapped ; 0063 2215 006B 0067 #1.1 SQUARE C OVER KG +33C7 ; disallowed # 1.1 SQUARE CO +33C8 ; mapped ; 0064 0062 # 1.1 SQUARE DB +33C9 ; mapped ; 0067 0079 # 1.1 SQUARE GY +33CA ; mapped ; 0068 0061 # 1.1 SQUARE HA +33CB ; mapped ; 0068 0070 # 1.1 SQUARE HP +33CC ; mapped ; 0069 006E # 1.1 SQUARE IN +33CD ; mapped ; 006B 006B # 1.1 SQUARE KK +33CE ; mapped ; 006B 006D # 1.1 SQUARE KM CAPITAL +33CF ; mapped ; 006B 0074 # 1.1 SQUARE KT +33D0 ; mapped ; 006C 006D # 1.1 SQUARE LM +33D1 ; mapped ; 006C 006E # 1.1 SQUARE LN +33D2 ; mapped ; 006C 006F 0067 #1.1 SQUARE LOG +33D3 ; mapped ; 006C 0078 # 1.1 SQUARE LX +33D4 ; mapped ; 006D 0062 # 1.1 SQUARE MB SMALL +33D5 ; mapped ; 006D 0069 006C #1.1 SQUARE MIL +33D6 ; mapped ; 006D 006F 006C #1.1 SQUARE MOL +33D7 ; mapped ; 0070 0068 # 1.1 SQUARE PH +33D8 ; disallowed # 1.1 SQUARE PM +33D9 ; mapped ; 0070 0070 006D #1.1 SQUARE PPM +33DA ; mapped ; 0070 0072 # 1.1 SQUARE PR +33DB ; mapped ; 0073 0072 # 1.1 SQUARE SR +33DC ; mapped ; 0073 0076 # 1.1 SQUARE SV +33DD ; mapped ; 0077 0062 # 1.1 SQUARE WB +33DE ; mapped ; 0076 2215 006D #4.0 SQUARE V OVER M +33DF ; mapped ; 0061 2215 006D #4.0 SQUARE A OVER M +33E0 ; mapped ; 0031 65E5 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY ONE +33E1 ; mapped ; 0032 65E5 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWO +33E2 ; mapped ; 0033 65E5 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY THREE +33E3 ; mapped ; 0034 65E5 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY FOUR +33E4 ; mapped ; 0035 65E5 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY FIVE +33E5 ; mapped ; 0036 65E5 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY SIX +33E6 ; mapped ; 0037 65E5 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY SEVEN +33E7 ; mapped ; 0038 65E5 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY EIGHT +33E8 ; mapped ; 0039 65E5 # 1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY NINE +33E9 ; mapped ; 0031 0030 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TEN +33EA ; mapped ; 0031 0031 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY ELEVEN +33EB ; mapped ; 0031 0032 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWELVE +33EC ; mapped ; 0031 0033 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY THIRTEEN +33ED ; mapped ; 0031 0034 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY FOURTEEN +33EE ; mapped ; 0031 0035 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY FIFTEEN +33EF ; mapped ; 0031 0036 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY SIXTEEN +33F0 ; mapped ; 0031 0037 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY SEVENTEEN +33F1 ; mapped ; 0031 0038 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY EIGHTEEN +33F2 ; mapped ; 0031 0039 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY NINETEEN +33F3 ; mapped ; 0032 0030 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY +33F4 ; mapped ; 0032 0031 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-ONE +33F5 ; mapped ; 0032 0032 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-TWO +33F6 ; mapped ; 0032 0033 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-THREE +33F7 ; mapped ; 0032 0034 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-FOUR +33F8 ; mapped ; 0032 0035 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-FIVE +33F9 ; mapped ; 0032 0036 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-SIX +33FA ; mapped ; 0032 0037 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-SEVEN +33FB ; mapped ; 0032 0038 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-EIGHT +33FC ; mapped ; 0032 0039 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY TWENTY-NINE +33FD ; mapped ; 0033 0030 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY THIRTY +33FE ; mapped ; 0033 0031 65E5 #1.1 IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY THIRTY-ONE +33FF ; mapped ; 0067 0061 006C #4.0 SQUARE GAL +3400..4DB5 ; valid # 3.0 CJK UNIFIED IDEOGRAPH-3400..CJK UNIFIED IDEOGRAPH-4DB5 +4DB6..4DBF ; valid # 13.0 CJK UNIFIED IDEOGRAPH-4DB6..CJK UNIFIED IDEOGRAPH-4DBF +4DC0..4DFF ; valid ; ; NV8 # 4.0 HEXAGRAM FOR THE CREATIVE HEAVEN..HEXAGRAM FOR BEFORE COMPLETION +4E00..9FA5 ; valid # 1.1 CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FA5 +9FA6..9FBB ; valid # 4.1 CJK UNIFIED IDEOGRAPH-9FA6..CJK UNIFIED IDEOGRAPH-9FBB +9FBC..9FC3 ; valid # 5.1 CJK UNIFIED IDEOGRAPH-9FBC..CJK UNIFIED IDEOGRAPH-9FC3 +9FC4..9FCB ; valid # 5.2 CJK UNIFIED IDEOGRAPH-9FC4..CJK UNIFIED IDEOGRAPH-9FCB +9FCC ; valid # 6.1 CJK UNIFIED IDEOGRAPH-9FCC +9FCD..9FD5 ; valid # 8.0 CJK UNIFIED IDEOGRAPH-9FCD..CJK UNIFIED IDEOGRAPH-9FD5 +9FD6..9FEA ; valid # 10.0 CJK UNIFIED IDEOGRAPH-9FD6..CJK UNIFIED IDEOGRAPH-9FEA +9FEB..9FEF ; valid # 11.0 CJK UNIFIED IDEOGRAPH-9FEB..CJK UNIFIED IDEOGRAPH-9FEF +9FF0..9FFC ; valid # 13.0 CJK UNIFIED IDEOGRAPH-9FF0..CJK UNIFIED IDEOGRAPH-9FFC +9FFD..9FFF ; valid # 14.0 CJK UNIFIED IDEOGRAPH-9FFD..CJK UNIFIED IDEOGRAPH-9FFF +A000..A48C ; valid # 3.0 YI SYLLABLE IT..YI SYLLABLE YYR +A48D..A48F ; disallowed # NA .. +A490..A4A1 ; valid ; ; NV8 # 3.0 YI RADICAL QOT..YI RADICAL GA +A4A2..A4A3 ; valid ; ; NV8 # 3.2 YI RADICAL ZUP..YI RADICAL CYT +A4A4..A4B3 ; valid ; ; NV8 # 3.0 YI RADICAL DDUR..YI RADICAL JO +A4B4 ; valid ; ; NV8 # 3.2 YI RADICAL NZUP +A4B5..A4C0 ; valid ; ; NV8 # 3.0 YI RADICAL JJY..YI RADICAL SHAT +A4C1 ; valid ; ; NV8 # 3.2 YI RADICAL ZUR +A4C2..A4C4 ; valid ; ; NV8 # 3.0 YI RADICAL SHOP..YI RADICAL ZZIET +A4C5 ; valid ; ; NV8 # 3.2 YI RADICAL NBIE +A4C6 ; valid ; ; NV8 # 3.0 YI RADICAL KE +A4C7..A4CF ; disallowed # NA .. +A4D0..A4FD ; valid # 5.2 LISU LETTER BA..LISU LETTER TONE MYA JEU +A4FE..A4FF ; valid ; ; NV8 # 5.2 LISU PUNCTUATION COMMA..LISU PUNCTUATION FULL STOP +A500..A60C ; valid # 5.1 VAI SYLLABLE EE..VAI SYLLABLE LENGTHENER +A60D..A60F ; valid ; ; NV8 # 5.1 VAI COMMA..VAI QUESTION MARK +A610..A62B ; valid # 5.1 VAI SYLLABLE NDOLE FA..VAI SYLLABLE NDOLE DO +A62C..A63F ; disallowed # NA .. +A640 ; mapped ; A641 # 5.1 CYRILLIC CAPITAL LETTER ZEMLYA +A641 ; valid # 5.1 CYRILLIC SMALL LETTER ZEMLYA +A642 ; mapped ; A643 # 5.1 CYRILLIC CAPITAL LETTER DZELO +A643 ; valid # 5.1 CYRILLIC SMALL LETTER DZELO +A644 ; mapped ; A645 # 5.1 CYRILLIC CAPITAL LETTER REVERSED DZE +A645 ; valid # 5.1 CYRILLIC SMALL LETTER REVERSED DZE +A646 ; mapped ; A647 # 5.1 CYRILLIC CAPITAL LETTER IOTA +A647 ; valid # 5.1 CYRILLIC SMALL LETTER IOTA +A648 ; mapped ; A649 # 5.1 CYRILLIC CAPITAL LETTER DJERV +A649 ; valid # 5.1 CYRILLIC SMALL LETTER DJERV +A64A ; mapped ; A64B # 5.1 CYRILLIC CAPITAL LETTER MONOGRAPH UK +A64B ; valid # 5.1 CYRILLIC SMALL LETTER MONOGRAPH UK +A64C ; mapped ; A64D # 5.1 CYRILLIC CAPITAL LETTER BROAD OMEGA +A64D ; valid # 5.1 CYRILLIC SMALL LETTER BROAD OMEGA +A64E ; mapped ; A64F # 5.1 CYRILLIC CAPITAL LETTER NEUTRAL YER +A64F ; valid # 5.1 CYRILLIC SMALL LETTER NEUTRAL YER +A650 ; mapped ; A651 # 5.1 CYRILLIC CAPITAL LETTER YERU WITH BACK YER +A651 ; valid # 5.1 CYRILLIC SMALL LETTER YERU WITH BACK YER +A652 ; mapped ; A653 # 5.1 CYRILLIC CAPITAL LETTER IOTIFIED YAT +A653 ; valid # 5.1 CYRILLIC SMALL LETTER IOTIFIED YAT +A654 ; mapped ; A655 # 5.1 CYRILLIC CAPITAL LETTER REVERSED YU +A655 ; valid # 5.1 CYRILLIC SMALL LETTER REVERSED YU +A656 ; mapped ; A657 # 5.1 CYRILLIC CAPITAL LETTER IOTIFIED A +A657 ; valid # 5.1 CYRILLIC SMALL LETTER IOTIFIED A +A658 ; mapped ; A659 # 5.1 CYRILLIC CAPITAL LETTER CLOSED LITTLE YUS +A659 ; valid # 5.1 CYRILLIC SMALL LETTER CLOSED LITTLE YUS +A65A ; mapped ; A65B # 5.1 CYRILLIC CAPITAL LETTER BLENDED YUS +A65B ; valid # 5.1 CYRILLIC SMALL LETTER BLENDED YUS +A65C ; mapped ; A65D # 5.1 CYRILLIC CAPITAL LETTER IOTIFIED CLOSED LITTLE YUS +A65D ; valid # 5.1 CYRILLIC SMALL LETTER IOTIFIED CLOSED LITTLE YUS +A65E ; mapped ; A65F # 5.1 CYRILLIC CAPITAL LETTER YN +A65F ; valid # 5.1 CYRILLIC SMALL LETTER YN +A660 ; mapped ; A661 # 6.0 CYRILLIC CAPITAL LETTER REVERSED TSE +A661 ; valid # 6.0 CYRILLIC SMALL LETTER REVERSED TSE +A662 ; mapped ; A663 # 5.1 CYRILLIC CAPITAL LETTER SOFT DE +A663 ; valid # 5.1 CYRILLIC SMALL LETTER SOFT DE +A664 ; mapped ; A665 # 5.1 CYRILLIC CAPITAL LETTER SOFT EL +A665 ; valid # 5.1 CYRILLIC SMALL LETTER SOFT EL +A666 ; mapped ; A667 # 5.1 CYRILLIC CAPITAL LETTER SOFT EM +A667 ; valid # 5.1 CYRILLIC SMALL LETTER SOFT EM +A668 ; mapped ; A669 # 5.1 CYRILLIC CAPITAL LETTER MONOCULAR O +A669 ; valid # 5.1 CYRILLIC SMALL LETTER MONOCULAR O +A66A ; mapped ; A66B # 5.1 CYRILLIC CAPITAL LETTER BINOCULAR O +A66B ; valid # 5.1 CYRILLIC SMALL LETTER BINOCULAR O +A66C ; mapped ; A66D # 5.1 CYRILLIC CAPITAL LETTER DOUBLE MONOCULAR O +A66D..A66F ; valid # 5.1 CYRILLIC SMALL LETTER DOUBLE MONOCULAR O..COMBINING CYRILLIC VZMET +A670..A673 ; valid ; ; NV8 # 5.1 COMBINING CYRILLIC TEN MILLIONS SIGN..SLAVONIC ASTERISK +A674..A67B ; valid # 6.1 COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC LETTER OMEGA +A67C..A67D ; valid # 5.1 COMBINING CYRILLIC KAVYKA..COMBINING CYRILLIC PAYEROK +A67E ; valid ; ; NV8 # 5.1 CYRILLIC KAVYKA +A67F ; valid # 5.1 CYRILLIC PAYEROK +A680 ; mapped ; A681 # 5.1 CYRILLIC CAPITAL LETTER DWE +A681 ; valid # 5.1 CYRILLIC SMALL LETTER DWE +A682 ; mapped ; A683 # 5.1 CYRILLIC CAPITAL LETTER DZWE +A683 ; valid # 5.1 CYRILLIC SMALL LETTER DZWE +A684 ; mapped ; A685 # 5.1 CYRILLIC CAPITAL LETTER ZHWE +A685 ; valid # 5.1 CYRILLIC SMALL LETTER ZHWE +A686 ; mapped ; A687 # 5.1 CYRILLIC CAPITAL LETTER CCHE +A687 ; valid # 5.1 CYRILLIC SMALL LETTER CCHE +A688 ; mapped ; A689 # 5.1 CYRILLIC CAPITAL LETTER DZZE +A689 ; valid # 5.1 CYRILLIC SMALL LETTER DZZE +A68A ; mapped ; A68B # 5.1 CYRILLIC CAPITAL LETTER TE WITH MIDDLE HOOK +A68B ; valid # 5.1 CYRILLIC SMALL LETTER TE WITH MIDDLE HOOK +A68C ; mapped ; A68D # 5.1 CYRILLIC CAPITAL LETTER TWE +A68D ; valid # 5.1 CYRILLIC SMALL LETTER TWE +A68E ; mapped ; A68F # 5.1 CYRILLIC CAPITAL LETTER TSWE +A68F ; valid # 5.1 CYRILLIC SMALL LETTER TSWE +A690 ; mapped ; A691 # 5.1 CYRILLIC CAPITAL LETTER TSSE +A691 ; valid # 5.1 CYRILLIC SMALL LETTER TSSE +A692 ; mapped ; A693 # 5.1 CYRILLIC CAPITAL LETTER TCHE +A693 ; valid # 5.1 CYRILLIC SMALL LETTER TCHE +A694 ; mapped ; A695 # 5.1 CYRILLIC CAPITAL LETTER HWE +A695 ; valid # 5.1 CYRILLIC SMALL LETTER HWE +A696 ; mapped ; A697 # 5.1 CYRILLIC CAPITAL LETTER SHWE +A697 ; valid # 5.1 CYRILLIC SMALL LETTER SHWE +A698 ; mapped ; A699 # 7.0 CYRILLIC CAPITAL LETTER DOUBLE O +A699 ; valid # 7.0 CYRILLIC SMALL LETTER DOUBLE O +A69A ; mapped ; A69B # 7.0 CYRILLIC CAPITAL LETTER CROSSED O +A69B ; valid # 7.0 CYRILLIC SMALL LETTER CROSSED O +A69C ; mapped ; 044A # 7.0 MODIFIER LETTER CYRILLIC HARD SIGN +A69D ; mapped ; 044C # 7.0 MODIFIER LETTER CYRILLIC SOFT SIGN +A69E ; valid # 8.0 COMBINING CYRILLIC LETTER EF +A69F ; valid # 6.1 COMBINING CYRILLIC LETTER IOTIFIED E +A6A0..A6E5 ; valid # 5.2 BAMUM LETTER A..BAMUM LETTER KI +A6E6..A6EF ; valid ; ; NV8 # 5.2 BAMUM LETTER MO..BAMUM LETTER KOGHOM +A6F0..A6F1 ; valid # 5.2 BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS +A6F2..A6F7 ; valid ; ; NV8 # 5.2 BAMUM NJAEMLI..BAMUM QUESTION MARK +A6F8..A6FF ; disallowed # NA .. +A700..A716 ; valid ; ; NV8 # 4.1 MODIFIER LETTER CHINESE TONE YIN PING..MODIFIER LETTER EXTRA-LOW LEFT-STEM TONE BAR +A717..A71A ; valid # 5.0 MODIFIER LETTER DOT VERTICAL BAR..MODIFIER LETTER LOWER RIGHT CORNER ANGLE +A71B..A71F ; valid # 5.1 MODIFIER LETTER RAISED UP ARROW..MODIFIER LETTER LOW INVERTED EXCLAMATION MARK +A720..A721 ; valid ; ; NV8 # 5.0 MODIFIER LETTER STRESS AND HIGH TONE..MODIFIER LETTER STRESS AND LOW TONE +A722 ; mapped ; A723 # 5.1 LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF +A723 ; valid # 5.1 LATIN SMALL LETTER EGYPTOLOGICAL ALEF +A724 ; mapped ; A725 # 5.1 LATIN CAPITAL LETTER EGYPTOLOGICAL AIN +A725 ; valid # 5.1 LATIN SMALL LETTER EGYPTOLOGICAL AIN +A726 ; mapped ; A727 # 5.1 LATIN CAPITAL LETTER HENG +A727 ; valid # 5.1 LATIN SMALL LETTER HENG +A728 ; mapped ; A729 # 5.1 LATIN CAPITAL LETTER TZ +A729 ; valid # 5.1 LATIN SMALL LETTER TZ +A72A ; mapped ; A72B # 5.1 LATIN CAPITAL LETTER TRESILLO +A72B ; valid # 5.1 LATIN SMALL LETTER TRESILLO +A72C ; mapped ; A72D # 5.1 LATIN CAPITAL LETTER CUATRILLO +A72D ; valid # 5.1 LATIN SMALL LETTER CUATRILLO +A72E ; mapped ; A72F # 5.1 LATIN CAPITAL LETTER CUATRILLO WITH COMMA +A72F..A731 ; valid # 5.1 LATIN SMALL LETTER CUATRILLO WITH COMMA..LATIN LETTER SMALL CAPITAL S +A732 ; mapped ; A733 # 5.1 LATIN CAPITAL LETTER AA +A733 ; valid # 5.1 LATIN SMALL LETTER AA +A734 ; mapped ; A735 # 5.1 LATIN CAPITAL LETTER AO +A735 ; valid # 5.1 LATIN SMALL LETTER AO +A736 ; mapped ; A737 # 5.1 LATIN CAPITAL LETTER AU +A737 ; valid # 5.1 LATIN SMALL LETTER AU +A738 ; mapped ; A739 # 5.1 LATIN CAPITAL LETTER AV +A739 ; valid # 5.1 LATIN SMALL LETTER AV +A73A ; mapped ; A73B # 5.1 LATIN CAPITAL LETTER AV WITH HORIZONTAL BAR +A73B ; valid # 5.1 LATIN SMALL LETTER AV WITH HORIZONTAL BAR +A73C ; mapped ; A73D # 5.1 LATIN CAPITAL LETTER AY +A73D ; valid # 5.1 LATIN SMALL LETTER AY +A73E ; mapped ; A73F # 5.1 LATIN CAPITAL LETTER REVERSED C WITH DOT +A73F ; valid # 5.1 LATIN SMALL LETTER REVERSED C WITH DOT +A740 ; mapped ; A741 # 5.1 LATIN CAPITAL LETTER K WITH STROKE +A741 ; valid # 5.1 LATIN SMALL LETTER K WITH STROKE +A742 ; mapped ; A743 # 5.1 LATIN CAPITAL LETTER K WITH DIAGONAL STROKE +A743 ; valid # 5.1 LATIN SMALL LETTER K WITH DIAGONAL STROKE +A744 ; mapped ; A745 # 5.1 LATIN CAPITAL LETTER K WITH STROKE AND DIAGONAL STROKE +A745 ; valid # 5.1 LATIN SMALL LETTER K WITH STROKE AND DIAGONAL STROKE +A746 ; mapped ; A747 # 5.1 LATIN CAPITAL LETTER BROKEN L +A747 ; valid # 5.1 LATIN SMALL LETTER BROKEN L +A748 ; mapped ; A749 # 5.1 LATIN CAPITAL LETTER L WITH HIGH STROKE +A749 ; valid # 5.1 LATIN SMALL LETTER L WITH HIGH STROKE +A74A ; mapped ; A74B # 5.1 LATIN CAPITAL LETTER O WITH LONG STROKE OVERLAY +A74B ; valid # 5.1 LATIN SMALL LETTER O WITH LONG STROKE OVERLAY +A74C ; mapped ; A74D # 5.1 LATIN CAPITAL LETTER O WITH LOOP +A74D ; valid # 5.1 LATIN SMALL LETTER O WITH LOOP +A74E ; mapped ; A74F # 5.1 LATIN CAPITAL LETTER OO +A74F ; valid # 5.1 LATIN SMALL LETTER OO +A750 ; mapped ; A751 # 5.1 LATIN CAPITAL LETTER P WITH STROKE THROUGH DESCENDER +A751 ; valid # 5.1 LATIN SMALL LETTER P WITH STROKE THROUGH DESCENDER +A752 ; mapped ; A753 # 5.1 LATIN CAPITAL LETTER P WITH FLOURISH +A753 ; valid # 5.1 LATIN SMALL LETTER P WITH FLOURISH +A754 ; mapped ; A755 # 5.1 LATIN CAPITAL LETTER P WITH SQUIRREL TAIL +A755 ; valid # 5.1 LATIN SMALL LETTER P WITH SQUIRREL TAIL +A756 ; mapped ; A757 # 5.1 LATIN CAPITAL LETTER Q WITH STROKE THROUGH DESCENDER +A757 ; valid # 5.1 LATIN SMALL LETTER Q WITH STROKE THROUGH DESCENDER +A758 ; mapped ; A759 # 5.1 LATIN CAPITAL LETTER Q WITH DIAGONAL STROKE +A759 ; valid # 5.1 LATIN SMALL LETTER Q WITH DIAGONAL STROKE +A75A ; mapped ; A75B # 5.1 LATIN CAPITAL LETTER R ROTUNDA +A75B ; valid # 5.1 LATIN SMALL LETTER R ROTUNDA +A75C ; mapped ; A75D # 5.1 LATIN CAPITAL LETTER RUM ROTUNDA +A75D ; valid # 5.1 LATIN SMALL LETTER RUM ROTUNDA +A75E ; mapped ; A75F # 5.1 LATIN CAPITAL LETTER V WITH DIAGONAL STROKE +A75F ; valid # 5.1 LATIN SMALL LETTER V WITH DIAGONAL STROKE +A760 ; mapped ; A761 # 5.1 LATIN CAPITAL LETTER VY +A761 ; valid # 5.1 LATIN SMALL LETTER VY +A762 ; mapped ; A763 # 5.1 LATIN CAPITAL LETTER VISIGOTHIC Z +A763 ; valid # 5.1 LATIN SMALL LETTER VISIGOTHIC Z +A764 ; mapped ; A765 # 5.1 LATIN CAPITAL LETTER THORN WITH STROKE +A765 ; valid # 5.1 LATIN SMALL LETTER THORN WITH STROKE +A766 ; mapped ; A767 # 5.1 LATIN CAPITAL LETTER THORN WITH STROKE THROUGH DESCENDER +A767 ; valid # 5.1 LATIN SMALL LETTER THORN WITH STROKE THROUGH DESCENDER +A768 ; mapped ; A769 # 5.1 LATIN CAPITAL LETTER VEND +A769 ; valid # 5.1 LATIN SMALL LETTER VEND +A76A ; mapped ; A76B # 5.1 LATIN CAPITAL LETTER ET +A76B ; valid # 5.1 LATIN SMALL LETTER ET +A76C ; mapped ; A76D # 5.1 LATIN CAPITAL LETTER IS +A76D ; valid # 5.1 LATIN SMALL LETTER IS +A76E ; mapped ; A76F # 5.1 LATIN CAPITAL LETTER CON +A76F ; valid # 5.1 LATIN SMALL LETTER CON +A770 ; mapped ; A76F # 5.1 MODIFIER LETTER US +A771..A778 ; valid # 5.1 LATIN SMALL LETTER DUM..LATIN SMALL LETTER UM +A779 ; mapped ; A77A # 5.1 LATIN CAPITAL LETTER INSULAR D +A77A ; valid # 5.1 LATIN SMALL LETTER INSULAR D +A77B ; mapped ; A77C # 5.1 LATIN CAPITAL LETTER INSULAR F +A77C ; valid # 5.1 LATIN SMALL LETTER INSULAR F +A77D ; mapped ; 1D79 # 5.1 LATIN CAPITAL LETTER INSULAR G +A77E ; mapped ; A77F # 5.1 LATIN CAPITAL LETTER TURNED INSULAR G +A77F ; valid # 5.1 LATIN SMALL LETTER TURNED INSULAR G +A780 ; mapped ; A781 # 5.1 LATIN CAPITAL LETTER TURNED L +A781 ; valid # 5.1 LATIN SMALL LETTER TURNED L +A782 ; mapped ; A783 # 5.1 LATIN CAPITAL LETTER INSULAR R +A783 ; valid # 5.1 LATIN SMALL LETTER INSULAR R +A784 ; mapped ; A785 # 5.1 LATIN CAPITAL LETTER INSULAR S +A785 ; valid # 5.1 LATIN SMALL LETTER INSULAR S +A786 ; mapped ; A787 # 5.1 LATIN CAPITAL LETTER INSULAR T +A787..A788 ; valid # 5.1 LATIN SMALL LETTER INSULAR T..MODIFIER LETTER LOW CIRCUMFLEX ACCENT +A789..A78A ; valid ; ; NV8 # 5.1 MODIFIER LETTER COLON..MODIFIER LETTER SHORT EQUALS SIGN +A78B ; mapped ; A78C # 5.1 LATIN CAPITAL LETTER SALTILLO +A78C ; valid # 5.1 LATIN SMALL LETTER SALTILLO +A78D ; mapped ; 0265 # 6.0 LATIN CAPITAL LETTER TURNED H +A78E ; valid # 6.0 LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT +A78F ; valid # 8.0 LATIN LETTER SINOLOGICAL DOT +A790 ; mapped ; A791 # 6.0 LATIN CAPITAL LETTER N WITH DESCENDER +A791 ; valid # 6.0 LATIN SMALL LETTER N WITH DESCENDER +A792 ; mapped ; A793 # 6.1 LATIN CAPITAL LETTER C WITH BAR +A793 ; valid # 6.1 LATIN SMALL LETTER C WITH BAR +A794..A795 ; valid # 7.0 LATIN SMALL LETTER C WITH PALATAL HOOK..LATIN SMALL LETTER H WITH PALATAL HOOK +A796 ; mapped ; A797 # 7.0 LATIN CAPITAL LETTER B WITH FLOURISH +A797 ; valid # 7.0 LATIN SMALL LETTER B WITH FLOURISH +A798 ; mapped ; A799 # 7.0 LATIN CAPITAL LETTER F WITH STROKE +A799 ; valid # 7.0 LATIN SMALL LETTER F WITH STROKE +A79A ; mapped ; A79B # 7.0 LATIN CAPITAL LETTER VOLAPUK AE +A79B ; valid # 7.0 LATIN SMALL LETTER VOLAPUK AE +A79C ; mapped ; A79D # 7.0 LATIN CAPITAL LETTER VOLAPUK OE +A79D ; valid # 7.0 LATIN SMALL LETTER VOLAPUK OE +A79E ; mapped ; A79F # 7.0 LATIN CAPITAL LETTER VOLAPUK UE +A79F ; valid # 7.0 LATIN SMALL LETTER VOLAPUK UE +A7A0 ; mapped ; A7A1 # 6.0 LATIN CAPITAL LETTER G WITH OBLIQUE STROKE +A7A1 ; valid # 6.0 LATIN SMALL LETTER G WITH OBLIQUE STROKE +A7A2 ; mapped ; A7A3 # 6.0 LATIN CAPITAL LETTER K WITH OBLIQUE STROKE +A7A3 ; valid # 6.0 LATIN SMALL LETTER K WITH OBLIQUE STROKE +A7A4 ; mapped ; A7A5 # 6.0 LATIN CAPITAL LETTER N WITH OBLIQUE STROKE +A7A5 ; valid # 6.0 LATIN SMALL LETTER N WITH OBLIQUE STROKE +A7A6 ; mapped ; A7A7 # 6.0 LATIN CAPITAL LETTER R WITH OBLIQUE STROKE +A7A7 ; valid # 6.0 LATIN SMALL LETTER R WITH OBLIQUE STROKE +A7A8 ; mapped ; A7A9 # 6.0 LATIN CAPITAL LETTER S WITH OBLIQUE STROKE +A7A9 ; valid # 6.0 LATIN SMALL LETTER S WITH OBLIQUE STROKE +A7AA ; mapped ; 0266 # 6.1 LATIN CAPITAL LETTER H WITH HOOK +A7AB ; mapped ; 025C # 7.0 LATIN CAPITAL LETTER REVERSED OPEN E +A7AC ; mapped ; 0261 # 7.0 LATIN CAPITAL LETTER SCRIPT G +A7AD ; mapped ; 026C # 7.0 LATIN CAPITAL LETTER L WITH BELT +A7AE ; mapped ; 026A # 9.0 LATIN CAPITAL LETTER SMALL CAPITAL I +A7AF ; valid # 11.0 LATIN LETTER SMALL CAPITAL Q +A7B0 ; mapped ; 029E # 7.0 LATIN CAPITAL LETTER TURNED K +A7B1 ; mapped ; 0287 # 7.0 LATIN CAPITAL LETTER TURNED T +A7B2 ; mapped ; 029D # 8.0 LATIN CAPITAL LETTER J WITH CROSSED-TAIL +A7B3 ; mapped ; AB53 # 8.0 LATIN CAPITAL LETTER CHI +A7B4 ; mapped ; A7B5 # 8.0 LATIN CAPITAL LETTER BETA +A7B5 ; valid # 8.0 LATIN SMALL LETTER BETA +A7B6 ; mapped ; A7B7 # 8.0 LATIN CAPITAL LETTER OMEGA +A7B7 ; valid # 8.0 LATIN SMALL LETTER OMEGA +A7B8 ; mapped ; A7B9 # 11.0 LATIN CAPITAL LETTER U WITH STROKE +A7B9 ; valid # 11.0 LATIN SMALL LETTER U WITH STROKE +A7BA ; mapped ; A7BB # 12.0 LATIN CAPITAL LETTER GLOTTAL A +A7BB ; valid # 12.0 LATIN SMALL LETTER GLOTTAL A +A7BC ; mapped ; A7BD # 12.0 LATIN CAPITAL LETTER GLOTTAL I +A7BD ; valid # 12.0 LATIN SMALL LETTER GLOTTAL I +A7BE ; mapped ; A7BF # 12.0 LATIN CAPITAL LETTER GLOTTAL U +A7BF ; valid # 12.0 LATIN SMALL LETTER GLOTTAL U +A7C0 ; mapped ; A7C1 # 14.0 LATIN CAPITAL LETTER OLD POLISH O +A7C1 ; valid # 14.0 LATIN SMALL LETTER OLD POLISH O +A7C2 ; mapped ; A7C3 # 12.0 LATIN CAPITAL LETTER ANGLICANA W +A7C3 ; valid # 12.0 LATIN SMALL LETTER ANGLICANA W +A7C4 ; mapped ; A794 # 12.0 LATIN CAPITAL LETTER C WITH PALATAL HOOK +A7C5 ; mapped ; 0282 # 12.0 LATIN CAPITAL LETTER S WITH HOOK +A7C6 ; mapped ; 1D8E # 12.0 LATIN CAPITAL LETTER Z WITH PALATAL HOOK +A7C7 ; mapped ; A7C8 # 13.0 LATIN CAPITAL LETTER D WITH SHORT STROKE OVERLAY +A7C8 ; valid # 13.0 LATIN SMALL LETTER D WITH SHORT STROKE OVERLAY +A7C9 ; mapped ; A7CA # 13.0 LATIN CAPITAL LETTER S WITH SHORT STROKE OVERLAY +A7CA ; valid # 13.0 LATIN SMALL LETTER S WITH SHORT STROKE OVERLAY +A7CB..A7CF ; disallowed # NA .. +A7D0 ; mapped ; A7D1 # 14.0 LATIN CAPITAL LETTER CLOSED INSULAR G +A7D1 ; valid # 14.0 LATIN SMALL LETTER CLOSED INSULAR G +A7D2 ; disallowed # NA +A7D3 ; valid # 14.0 LATIN SMALL LETTER DOUBLE THORN +A7D4 ; disallowed # NA +A7D5 ; valid # 14.0 LATIN SMALL LETTER DOUBLE WYNN +A7D6 ; mapped ; A7D7 # 14.0 LATIN CAPITAL LETTER MIDDLE SCOTS S +A7D7 ; valid # 14.0 LATIN SMALL LETTER MIDDLE SCOTS S +A7D8 ; mapped ; A7D9 # 14.0 LATIN CAPITAL LETTER SIGMOID S +A7D9 ; valid # 14.0 LATIN SMALL LETTER SIGMOID S +A7DA..A7F1 ; disallowed # NA .. +A7F2 ; mapped ; 0063 # 14.0 MODIFIER LETTER CAPITAL C +A7F3 ; mapped ; 0066 # 14.0 MODIFIER LETTER CAPITAL F +A7F4 ; mapped ; 0071 # 14.0 MODIFIER LETTER CAPITAL Q +A7F5 ; mapped ; A7F6 # 13.0 LATIN CAPITAL LETTER REVERSED HALF H +A7F6 ; valid # 13.0 LATIN SMALL LETTER REVERSED HALF H +A7F7 ; valid # 7.0 LATIN EPIGRAPHIC LETTER SIDEWAYS I +A7F8 ; mapped ; 0127 # 6.1 MODIFIER LETTER CAPITAL H WITH STROKE +A7F9 ; mapped ; 0153 # 6.1 MODIFIER LETTER SMALL LIGATURE OE +A7FA ; valid # 6.0 LATIN LETTER SMALL CAPITAL TURNED M +A7FB..A7FF ; valid # 5.1 LATIN EPIGRAPHIC LETTER REVERSED F..LATIN EPIGRAPHIC LETTER ARCHAIC M +A800..A827 ; valid # 4.1 SYLOTI NAGRI LETTER A..SYLOTI NAGRI VOWEL SIGN OO +A828..A82B ; valid ; ; NV8 # 4.1 SYLOTI NAGRI POETRY MARK-1..SYLOTI NAGRI POETRY MARK-4 +A82C ; valid # 13.0 SYLOTI NAGRI SIGN ALTERNATE HASANTA +A82D..A82F ; disallowed # NA .. +A830..A839 ; valid ; ; NV8 # 5.2 NORTH INDIC FRACTION ONE QUARTER..NORTH INDIC QUANTITY MARK +A83A..A83F ; disallowed # NA .. +A840..A873 ; valid # 5.0 PHAGS-PA LETTER KA..PHAGS-PA LETTER CANDRABINDU +A874..A877 ; valid ; ; NV8 # 5.0 PHAGS-PA SINGLE HEAD MARK..PHAGS-PA MARK DOUBLE SHAD +A878..A87F ; disallowed # NA .. +A880..A8C4 ; valid # 5.1 SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VIRAMA +A8C5 ; valid # 9.0 SAURASHTRA SIGN CANDRABINDU +A8C6..A8CD ; disallowed # NA .. +A8CE..A8CF ; valid ; ; NV8 # 5.1 SAURASHTRA DANDA..SAURASHTRA DOUBLE DANDA +A8D0..A8D9 ; valid # 5.1 SAURASHTRA DIGIT ZERO..SAURASHTRA DIGIT NINE +A8DA..A8DF ; disallowed # NA .. +A8E0..A8F7 ; valid # 5.2 COMBINING DEVANAGARI DIGIT ZERO..DEVANAGARI SIGN CANDRABINDU AVAGRAHA +A8F8..A8FA ; valid ; ; NV8 # 5.2 DEVANAGARI SIGN PUSHPIKA..DEVANAGARI CARET +A8FB ; valid # 5.2 DEVANAGARI HEADSTROKE +A8FC ; valid ; ; NV8 # 8.0 DEVANAGARI SIGN SIDDHAM +A8FD ; valid # 8.0 DEVANAGARI JAIN OM +A8FE..A8FF ; valid # 11.0 DEVANAGARI LETTER AY..DEVANAGARI VOWEL SIGN AY +A900..A92D ; valid # 5.1 KAYAH LI DIGIT ZERO..KAYAH LI TONE CALYA PLOPHU +A92E..A92F ; valid ; ; NV8 # 5.1 KAYAH LI SIGN CWI..KAYAH LI SIGN SHYA +A930..A953 ; valid # 5.1 REJANG LETTER KA..REJANG VIRAMA +A954..A95E ; disallowed # NA .. +A95F ; valid ; ; NV8 # 5.1 REJANG SECTION MARK +A960..A97C ; valid ; ; NV8 # 5.2 HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH +A97D..A97F ; disallowed # NA .. +A980..A9C0 ; valid # 5.2 JAVANESE SIGN PANYANGGA..JAVANESE PANGKON +A9C1..A9CD ; valid ; ; NV8 # 5.2 JAVANESE LEFT RERENGGAN..JAVANESE TURNED PADA PISELEH +A9CE ; disallowed # NA +A9CF..A9D9 ; valid # 5.2 JAVANESE PANGRANGKEP..JAVANESE DIGIT NINE +A9DA..A9DD ; disallowed # NA .. +A9DE..A9DF ; valid ; ; NV8 # 5.2 JAVANESE PADA TIRTA TUMETES..JAVANESE PADA ISEN-ISEN +A9E0..A9FE ; valid # 7.0 MYANMAR LETTER SHAN GHA..MYANMAR LETTER TAI LAING BHA +A9FF ; disallowed # NA +AA00..AA36 ; valid # 5.1 CHAM LETTER A..CHAM CONSONANT SIGN WA +AA37..AA3F ; disallowed # NA .. +AA40..AA4D ; valid # 5.1 CHAM LETTER FINAL K..CHAM CONSONANT SIGN FINAL H +AA4E..AA4F ; disallowed # NA .. +AA50..AA59 ; valid # 5.1 CHAM DIGIT ZERO..CHAM DIGIT NINE +AA5A..AA5B ; disallowed # NA .. +AA5C..AA5F ; valid ; ; NV8 # 5.1 CHAM PUNCTUATION SPIRAL..CHAM PUNCTUATION TRIPLE DANDA +AA60..AA76 ; valid # 5.2 MYANMAR LETTER KHAMTI GA..MYANMAR LOGOGRAM KHAMTI HM +AA77..AA79 ; valid ; ; NV8 # 5.2 MYANMAR SYMBOL AITON EXCLAMATION..MYANMAR SYMBOL AITON TWO +AA7A..AA7B ; valid # 5.2 MYANMAR LETTER AITON RA..MYANMAR SIGN PAO KAREN TONE +AA7C..AA7F ; valid # 7.0 MYANMAR SIGN TAI LAING TONE-2..MYANMAR LETTER SHWE PALAUNG SHA +AA80..AAC2 ; valid # 5.2 TAI VIET LETTER LOW KO..TAI VIET TONE MAI SONG +AAC3..AADA ; disallowed # NA .. +AADB..AADD ; valid # 5.2 TAI VIET SYMBOL KON..TAI VIET SYMBOL SAM +AADE..AADF ; valid ; ; NV8 # 5.2 TAI VIET SYMBOL HO HOI..TAI VIET SYMBOL KOI KOI +AAE0..AAEF ; valid # 6.1 MEETEI MAYEK LETTER E..MEETEI MAYEK VOWEL SIGN AAU +AAF0..AAF1 ; valid ; ; NV8 # 6.1 MEETEI MAYEK CHEIKHAN..MEETEI MAYEK AHANG KHUDAM +AAF2..AAF6 ; valid # 6.1 MEETEI MAYEK ANJI..MEETEI MAYEK VIRAMA +AAF7..AB00 ; disallowed # NA .. +AB01..AB06 ; valid # 6.0 ETHIOPIC SYLLABLE TTHU..ETHIOPIC SYLLABLE TTHO +AB07..AB08 ; disallowed # NA .. +AB09..AB0E ; valid # 6.0 ETHIOPIC SYLLABLE DDHU..ETHIOPIC SYLLABLE DDHO +AB0F..AB10 ; disallowed # NA .. +AB11..AB16 ; valid # 6.0 ETHIOPIC SYLLABLE DZU..ETHIOPIC SYLLABLE DZO +AB17..AB1F ; disallowed # NA .. +AB20..AB26 ; valid # 6.0 ETHIOPIC SYLLABLE CCHHA..ETHIOPIC SYLLABLE CCHHO +AB27 ; disallowed # NA +AB28..AB2E ; valid # 6.0 ETHIOPIC SYLLABLE BBA..ETHIOPIC SYLLABLE BBO +AB2F ; disallowed # NA +AB30..AB5A ; valid # 7.0 LATIN SMALL LETTER BARRED ALPHA..LATIN SMALL LETTER Y WITH SHORT RIGHT LEG +AB5B ; valid ; ; NV8 # 7.0 MODIFIER BREVE WITH INVERTED BREVE +AB5C ; mapped ; A727 # 7.0 MODIFIER LETTER SMALL HENG +AB5D ; mapped ; AB37 # 7.0 MODIFIER LETTER SMALL L WITH INVERTED LAZY S +AB5E ; mapped ; 026B # 7.0 MODIFIER LETTER SMALL L WITH MIDDLE TILDE +AB5F ; mapped ; AB52 # 7.0 MODIFIER LETTER SMALL U WITH LEFT HOOK +AB60..AB63 ; valid # 8.0 LATIN SMALL LETTER SAKHA YAT..LATIN SMALL LETTER UO +AB64..AB65 ; valid # 7.0 LATIN SMALL LETTER INVERTED ALPHA..GREEK LETTER SMALL CAPITAL OMEGA +AB66..AB67 ; valid # 12.0 LATIN SMALL LETTER DZ DIGRAPH WITH RETROFLEX HOOK..LATIN SMALL LETTER TS DIGRAPH WITH RETROFLEX HOOK +AB68 ; valid # 13.0 LATIN SMALL LETTER TURNED R WITH MIDDLE TILDE +AB69 ; mapped ; 028D # 13.0 MODIFIER LETTER SMALL TURNED W +AB6A..AB6B ; valid ; ; NV8 # 13.0 MODIFIER LETTER LEFT TACK..MODIFIER LETTER RIGHT TACK +AB6C..AB6F ; disallowed # NA .. +AB70 ; mapped ; 13A0 # 8.0 CHEROKEE SMALL LETTER A +AB71 ; mapped ; 13A1 # 8.0 CHEROKEE SMALL LETTER E +AB72 ; mapped ; 13A2 # 8.0 CHEROKEE SMALL LETTER I +AB73 ; mapped ; 13A3 # 8.0 CHEROKEE SMALL LETTER O +AB74 ; mapped ; 13A4 # 8.0 CHEROKEE SMALL LETTER U +AB75 ; mapped ; 13A5 # 8.0 CHEROKEE SMALL LETTER V +AB76 ; mapped ; 13A6 # 8.0 CHEROKEE SMALL LETTER GA +AB77 ; mapped ; 13A7 # 8.0 CHEROKEE SMALL LETTER KA +AB78 ; mapped ; 13A8 # 8.0 CHEROKEE SMALL LETTER GE +AB79 ; mapped ; 13A9 # 8.0 CHEROKEE SMALL LETTER GI +AB7A ; mapped ; 13AA # 8.0 CHEROKEE SMALL LETTER GO +AB7B ; mapped ; 13AB # 8.0 CHEROKEE SMALL LETTER GU +AB7C ; mapped ; 13AC # 8.0 CHEROKEE SMALL LETTER GV +AB7D ; mapped ; 13AD # 8.0 CHEROKEE SMALL LETTER HA +AB7E ; mapped ; 13AE # 8.0 CHEROKEE SMALL LETTER HE +AB7F ; mapped ; 13AF # 8.0 CHEROKEE SMALL LETTER HI +AB80 ; mapped ; 13B0 # 8.0 CHEROKEE SMALL LETTER HO +AB81 ; mapped ; 13B1 # 8.0 CHEROKEE SMALL LETTER HU +AB82 ; mapped ; 13B2 # 8.0 CHEROKEE SMALL LETTER HV +AB83 ; mapped ; 13B3 # 8.0 CHEROKEE SMALL LETTER LA +AB84 ; mapped ; 13B4 # 8.0 CHEROKEE SMALL LETTER LE +AB85 ; mapped ; 13B5 # 8.0 CHEROKEE SMALL LETTER LI +AB86 ; mapped ; 13B6 # 8.0 CHEROKEE SMALL LETTER LO +AB87 ; mapped ; 13B7 # 8.0 CHEROKEE SMALL LETTER LU +AB88 ; mapped ; 13B8 # 8.0 CHEROKEE SMALL LETTER LV +AB89 ; mapped ; 13B9 # 8.0 CHEROKEE SMALL LETTER MA +AB8A ; mapped ; 13BA # 8.0 CHEROKEE SMALL LETTER ME +AB8B ; mapped ; 13BB # 8.0 CHEROKEE SMALL LETTER MI +AB8C ; mapped ; 13BC # 8.0 CHEROKEE SMALL LETTER MO +AB8D ; mapped ; 13BD # 8.0 CHEROKEE SMALL LETTER MU +AB8E ; mapped ; 13BE # 8.0 CHEROKEE SMALL LETTER NA +AB8F ; mapped ; 13BF # 8.0 CHEROKEE SMALL LETTER HNA +AB90 ; mapped ; 13C0 # 8.0 CHEROKEE SMALL LETTER NAH +AB91 ; mapped ; 13C1 # 8.0 CHEROKEE SMALL LETTER NE +AB92 ; mapped ; 13C2 # 8.0 CHEROKEE SMALL LETTER NI +AB93 ; mapped ; 13C3 # 8.0 CHEROKEE SMALL LETTER NO +AB94 ; mapped ; 13C4 # 8.0 CHEROKEE SMALL LETTER NU +AB95 ; mapped ; 13C5 # 8.0 CHEROKEE SMALL LETTER NV +AB96 ; mapped ; 13C6 # 8.0 CHEROKEE SMALL LETTER QUA +AB97 ; mapped ; 13C7 # 8.0 CHEROKEE SMALL LETTER QUE +AB98 ; mapped ; 13C8 # 8.0 CHEROKEE SMALL LETTER QUI +AB99 ; mapped ; 13C9 # 8.0 CHEROKEE SMALL LETTER QUO +AB9A ; mapped ; 13CA # 8.0 CHEROKEE SMALL LETTER QUU +AB9B ; mapped ; 13CB # 8.0 CHEROKEE SMALL LETTER QUV +AB9C ; mapped ; 13CC # 8.0 CHEROKEE SMALL LETTER SA +AB9D ; mapped ; 13CD # 8.0 CHEROKEE SMALL LETTER S +AB9E ; mapped ; 13CE # 8.0 CHEROKEE SMALL LETTER SE +AB9F ; mapped ; 13CF # 8.0 CHEROKEE SMALL LETTER SI +ABA0 ; mapped ; 13D0 # 8.0 CHEROKEE SMALL LETTER SO +ABA1 ; mapped ; 13D1 # 8.0 CHEROKEE SMALL LETTER SU +ABA2 ; mapped ; 13D2 # 8.0 CHEROKEE SMALL LETTER SV +ABA3 ; mapped ; 13D3 # 8.0 CHEROKEE SMALL LETTER DA +ABA4 ; mapped ; 13D4 # 8.0 CHEROKEE SMALL LETTER TA +ABA5 ; mapped ; 13D5 # 8.0 CHEROKEE SMALL LETTER DE +ABA6 ; mapped ; 13D6 # 8.0 CHEROKEE SMALL LETTER TE +ABA7 ; mapped ; 13D7 # 8.0 CHEROKEE SMALL LETTER DI +ABA8 ; mapped ; 13D8 # 8.0 CHEROKEE SMALL LETTER TI +ABA9 ; mapped ; 13D9 # 8.0 CHEROKEE SMALL LETTER DO +ABAA ; mapped ; 13DA # 8.0 CHEROKEE SMALL LETTER DU +ABAB ; mapped ; 13DB # 8.0 CHEROKEE SMALL LETTER DV +ABAC ; mapped ; 13DC # 8.0 CHEROKEE SMALL LETTER DLA +ABAD ; mapped ; 13DD # 8.0 CHEROKEE SMALL LETTER TLA +ABAE ; mapped ; 13DE # 8.0 CHEROKEE SMALL LETTER TLE +ABAF ; mapped ; 13DF # 8.0 CHEROKEE SMALL LETTER TLI +ABB0 ; mapped ; 13E0 # 8.0 CHEROKEE SMALL LETTER TLO +ABB1 ; mapped ; 13E1 # 8.0 CHEROKEE SMALL LETTER TLU +ABB2 ; mapped ; 13E2 # 8.0 CHEROKEE SMALL LETTER TLV +ABB3 ; mapped ; 13E3 # 8.0 CHEROKEE SMALL LETTER TSA +ABB4 ; mapped ; 13E4 # 8.0 CHEROKEE SMALL LETTER TSE +ABB5 ; mapped ; 13E5 # 8.0 CHEROKEE SMALL LETTER TSI +ABB6 ; mapped ; 13E6 # 8.0 CHEROKEE SMALL LETTER TSO +ABB7 ; mapped ; 13E7 # 8.0 CHEROKEE SMALL LETTER TSU +ABB8 ; mapped ; 13E8 # 8.0 CHEROKEE SMALL LETTER TSV +ABB9 ; mapped ; 13E9 # 8.0 CHEROKEE SMALL LETTER WA +ABBA ; mapped ; 13EA # 8.0 CHEROKEE SMALL LETTER WE +ABBB ; mapped ; 13EB # 8.0 CHEROKEE SMALL LETTER WI +ABBC ; mapped ; 13EC # 8.0 CHEROKEE SMALL LETTER WO +ABBD ; mapped ; 13ED # 8.0 CHEROKEE SMALL LETTER WU +ABBE ; mapped ; 13EE # 8.0 CHEROKEE SMALL LETTER WV +ABBF ; mapped ; 13EF # 8.0 CHEROKEE SMALL LETTER YA +ABC0..ABEA ; valid # 5.2 MEETEI MAYEK LETTER KOK..MEETEI MAYEK VOWEL SIGN NUNG +ABEB ; valid ; ; NV8 # 5.2 MEETEI MAYEK CHEIKHEI +ABEC..ABED ; valid # 5.2 MEETEI MAYEK LUM IYEK..MEETEI MAYEK APUN IYEK +ABEE..ABEF ; disallowed # NA .. +ABF0..ABF9 ; valid # 5.2 MEETEI MAYEK DIGIT ZERO..MEETEI MAYEK DIGIT NINE +ABFA..ABFF ; disallowed # NA .. +AC00..D7A3 ; valid # 2.0 HANGUL SYLLABLE GA..HANGUL SYLLABLE HIH +D7A4..D7AF ; disallowed # NA .. +D7B0..D7C6 ; valid ; ; NV8 # 5.2 HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E +D7C7..D7CA ; disallowed # NA .. +D7CB..D7FB ; valid ; ; NV8 # 5.2 HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH +D7FC..D7FF ; disallowed # NA .. +D800..DFFF ; disallowed # 2.0 .. +E000..F8FF ; disallowed # 1.1 .. +F900 ; mapped ; 8C48 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F900 +F901 ; mapped ; 66F4 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F901 +F902 ; mapped ; 8ECA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F902 +F903 ; mapped ; 8CC8 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F903 +F904 ; mapped ; 6ED1 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F904 +F905 ; mapped ; 4E32 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F905 +F906 ; mapped ; 53E5 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F906 +F907..F908 ; mapped ; 9F9C # 1.1 CJK COMPATIBILITY IDEOGRAPH-F907..CJK COMPATIBILITY IDEOGRAPH-F908 +F909 ; mapped ; 5951 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F909 +F90A ; mapped ; 91D1 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F90A +F90B ; mapped ; 5587 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F90B +F90C ; mapped ; 5948 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F90C +F90D ; mapped ; 61F6 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F90D +F90E ; mapped ; 7669 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F90E +F90F ; mapped ; 7F85 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F90F +F910 ; mapped ; 863F # 1.1 CJK COMPATIBILITY IDEOGRAPH-F910 +F911 ; mapped ; 87BA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F911 +F912 ; mapped ; 88F8 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F912 +F913 ; mapped ; 908F # 1.1 CJK COMPATIBILITY IDEOGRAPH-F913 +F914 ; mapped ; 6A02 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F914 +F915 ; mapped ; 6D1B # 1.1 CJK COMPATIBILITY IDEOGRAPH-F915 +F916 ; mapped ; 70D9 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F916 +F917 ; mapped ; 73DE # 1.1 CJK COMPATIBILITY IDEOGRAPH-F917 +F918 ; mapped ; 843D # 1.1 CJK COMPATIBILITY IDEOGRAPH-F918 +F919 ; mapped ; 916A # 1.1 CJK COMPATIBILITY IDEOGRAPH-F919 +F91A ; mapped ; 99F1 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F91A +F91B ; mapped ; 4E82 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F91B +F91C ; mapped ; 5375 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F91C +F91D ; mapped ; 6B04 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F91D +F91E ; mapped ; 721B # 1.1 CJK COMPATIBILITY IDEOGRAPH-F91E +F91F ; mapped ; 862D # 1.1 CJK COMPATIBILITY IDEOGRAPH-F91F +F920 ; mapped ; 9E1E # 1.1 CJK COMPATIBILITY IDEOGRAPH-F920 +F921 ; mapped ; 5D50 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F921 +F922 ; mapped ; 6FEB # 1.1 CJK COMPATIBILITY IDEOGRAPH-F922 +F923 ; mapped ; 85CD # 1.1 CJK COMPATIBILITY IDEOGRAPH-F923 +F924 ; mapped ; 8964 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F924 +F925 ; mapped ; 62C9 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F925 +F926 ; mapped ; 81D8 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F926 +F927 ; mapped ; 881F # 1.1 CJK COMPATIBILITY IDEOGRAPH-F927 +F928 ; mapped ; 5ECA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F928 +F929 ; mapped ; 6717 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F929 +F92A ; mapped ; 6D6A # 1.1 CJK COMPATIBILITY IDEOGRAPH-F92A +F92B ; mapped ; 72FC # 1.1 CJK COMPATIBILITY IDEOGRAPH-F92B +F92C ; mapped ; 90CE # 1.1 CJK COMPATIBILITY IDEOGRAPH-F92C +F92D ; mapped ; 4F86 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F92D +F92E ; mapped ; 51B7 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F92E +F92F ; mapped ; 52DE # 1.1 CJK COMPATIBILITY IDEOGRAPH-F92F +F930 ; mapped ; 64C4 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F930 +F931 ; mapped ; 6AD3 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F931 +F932 ; mapped ; 7210 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F932 +F933 ; mapped ; 76E7 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F933 +F934 ; mapped ; 8001 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F934 +F935 ; mapped ; 8606 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F935 +F936 ; mapped ; 865C # 1.1 CJK COMPATIBILITY IDEOGRAPH-F936 +F937 ; mapped ; 8DEF # 1.1 CJK COMPATIBILITY IDEOGRAPH-F937 +F938 ; mapped ; 9732 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F938 +F939 ; mapped ; 9B6F # 1.1 CJK COMPATIBILITY IDEOGRAPH-F939 +F93A ; mapped ; 9DFA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F93A +F93B ; mapped ; 788C # 1.1 CJK COMPATIBILITY IDEOGRAPH-F93B +F93C ; mapped ; 797F # 1.1 CJK COMPATIBILITY IDEOGRAPH-F93C +F93D ; mapped ; 7DA0 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F93D +F93E ; mapped ; 83C9 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F93E +F93F ; mapped ; 9304 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F93F +F940 ; mapped ; 9E7F # 1.1 CJK COMPATIBILITY IDEOGRAPH-F940 +F941 ; mapped ; 8AD6 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F941 +F942 ; mapped ; 58DF # 1.1 CJK COMPATIBILITY IDEOGRAPH-F942 +F943 ; mapped ; 5F04 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F943 +F944 ; mapped ; 7C60 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F944 +F945 ; mapped ; 807E # 1.1 CJK COMPATIBILITY IDEOGRAPH-F945 +F946 ; mapped ; 7262 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F946 +F947 ; mapped ; 78CA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F947 +F948 ; mapped ; 8CC2 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F948 +F949 ; mapped ; 96F7 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F949 +F94A ; mapped ; 58D8 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F94A +F94B ; mapped ; 5C62 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F94B +F94C ; mapped ; 6A13 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F94C +F94D ; mapped ; 6DDA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F94D +F94E ; mapped ; 6F0F # 1.1 CJK COMPATIBILITY IDEOGRAPH-F94E +F94F ; mapped ; 7D2F # 1.1 CJK COMPATIBILITY IDEOGRAPH-F94F +F950 ; mapped ; 7E37 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F950 +F951 ; mapped ; 964B # 1.1 CJK COMPATIBILITY IDEOGRAPH-F951 +F952 ; mapped ; 52D2 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F952 +F953 ; mapped ; 808B # 1.1 CJK COMPATIBILITY IDEOGRAPH-F953 +F954 ; mapped ; 51DC # 1.1 CJK COMPATIBILITY IDEOGRAPH-F954 +F955 ; mapped ; 51CC # 1.1 CJK COMPATIBILITY IDEOGRAPH-F955 +F956 ; mapped ; 7A1C # 1.1 CJK COMPATIBILITY IDEOGRAPH-F956 +F957 ; mapped ; 7DBE # 1.1 CJK COMPATIBILITY IDEOGRAPH-F957 +F958 ; mapped ; 83F1 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F958 +F959 ; mapped ; 9675 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F959 +F95A ; mapped ; 8B80 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F95A +F95B ; mapped ; 62CF # 1.1 CJK COMPATIBILITY IDEOGRAPH-F95B +F95C ; mapped ; 6A02 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F95C +F95D ; mapped ; 8AFE # 1.1 CJK COMPATIBILITY IDEOGRAPH-F95D +F95E ; mapped ; 4E39 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F95E +F95F ; mapped ; 5BE7 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F95F +F960 ; mapped ; 6012 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F960 +F961 ; mapped ; 7387 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F961 +F962 ; mapped ; 7570 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F962 +F963 ; mapped ; 5317 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F963 +F964 ; mapped ; 78FB # 1.1 CJK COMPATIBILITY IDEOGRAPH-F964 +F965 ; mapped ; 4FBF # 1.1 CJK COMPATIBILITY IDEOGRAPH-F965 +F966 ; mapped ; 5FA9 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F966 +F967 ; mapped ; 4E0D # 1.1 CJK COMPATIBILITY IDEOGRAPH-F967 +F968 ; mapped ; 6CCC # 1.1 CJK COMPATIBILITY IDEOGRAPH-F968 +F969 ; mapped ; 6578 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F969 +F96A ; mapped ; 7D22 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F96A +F96B ; mapped ; 53C3 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F96B +F96C ; mapped ; 585E # 1.1 CJK COMPATIBILITY IDEOGRAPH-F96C +F96D ; mapped ; 7701 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F96D +F96E ; mapped ; 8449 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F96E +F96F ; mapped ; 8AAA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F96F +F970 ; mapped ; 6BBA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F970 +F971 ; mapped ; 8FB0 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F971 +F972 ; mapped ; 6C88 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F972 +F973 ; mapped ; 62FE # 1.1 CJK COMPATIBILITY IDEOGRAPH-F973 +F974 ; mapped ; 82E5 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F974 +F975 ; mapped ; 63A0 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F975 +F976 ; mapped ; 7565 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F976 +F977 ; mapped ; 4EAE # 1.1 CJK COMPATIBILITY IDEOGRAPH-F977 +F978 ; mapped ; 5169 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F978 +F979 ; mapped ; 51C9 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F979 +F97A ; mapped ; 6881 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F97A +F97B ; mapped ; 7CE7 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F97B +F97C ; mapped ; 826F # 1.1 CJK COMPATIBILITY IDEOGRAPH-F97C +F97D ; mapped ; 8AD2 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F97D +F97E ; mapped ; 91CF # 1.1 CJK COMPATIBILITY IDEOGRAPH-F97E +F97F ; mapped ; 52F5 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F97F +F980 ; mapped ; 5442 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F980 +F981 ; mapped ; 5973 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F981 +F982 ; mapped ; 5EEC # 1.1 CJK COMPATIBILITY IDEOGRAPH-F982 +F983 ; mapped ; 65C5 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F983 +F984 ; mapped ; 6FFE # 1.1 CJK COMPATIBILITY IDEOGRAPH-F984 +F985 ; mapped ; 792A # 1.1 CJK COMPATIBILITY IDEOGRAPH-F985 +F986 ; mapped ; 95AD # 1.1 CJK COMPATIBILITY IDEOGRAPH-F986 +F987 ; mapped ; 9A6A # 1.1 CJK COMPATIBILITY IDEOGRAPH-F987 +F988 ; mapped ; 9E97 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F988 +F989 ; mapped ; 9ECE # 1.1 CJK COMPATIBILITY IDEOGRAPH-F989 +F98A ; mapped ; 529B # 1.1 CJK COMPATIBILITY IDEOGRAPH-F98A +F98B ; mapped ; 66C6 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F98B +F98C ; mapped ; 6B77 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F98C +F98D ; mapped ; 8F62 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F98D +F98E ; mapped ; 5E74 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F98E +F98F ; mapped ; 6190 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F98F +F990 ; mapped ; 6200 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F990 +F991 ; mapped ; 649A # 1.1 CJK COMPATIBILITY IDEOGRAPH-F991 +F992 ; mapped ; 6F23 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F992 +F993 ; mapped ; 7149 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F993 +F994 ; mapped ; 7489 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F994 +F995 ; mapped ; 79CA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F995 +F996 ; mapped ; 7DF4 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F996 +F997 ; mapped ; 806F # 1.1 CJK COMPATIBILITY IDEOGRAPH-F997 +F998 ; mapped ; 8F26 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F998 +F999 ; mapped ; 84EE # 1.1 CJK COMPATIBILITY IDEOGRAPH-F999 +F99A ; mapped ; 9023 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F99A +F99B ; mapped ; 934A # 1.1 CJK COMPATIBILITY IDEOGRAPH-F99B +F99C ; mapped ; 5217 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F99C +F99D ; mapped ; 52A3 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F99D +F99E ; mapped ; 54BD # 1.1 CJK COMPATIBILITY IDEOGRAPH-F99E +F99F ; mapped ; 70C8 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F99F +F9A0 ; mapped ; 88C2 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9A0 +F9A1 ; mapped ; 8AAA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9A1 +F9A2 ; mapped ; 5EC9 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9A2 +F9A3 ; mapped ; 5FF5 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9A3 +F9A4 ; mapped ; 637B # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9A4 +F9A5 ; mapped ; 6BAE # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9A5 +F9A6 ; mapped ; 7C3E # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9A6 +F9A7 ; mapped ; 7375 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9A7 +F9A8 ; mapped ; 4EE4 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9A8 +F9A9 ; mapped ; 56F9 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9A9 +F9AA ; mapped ; 5BE7 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9AA +F9AB ; mapped ; 5DBA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9AB +F9AC ; mapped ; 601C # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9AC +F9AD ; mapped ; 73B2 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9AD +F9AE ; mapped ; 7469 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9AE +F9AF ; mapped ; 7F9A # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9AF +F9B0 ; mapped ; 8046 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9B0 +F9B1 ; mapped ; 9234 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9B1 +F9B2 ; mapped ; 96F6 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9B2 +F9B3 ; mapped ; 9748 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9B3 +F9B4 ; mapped ; 9818 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9B4 +F9B5 ; mapped ; 4F8B # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9B5 +F9B6 ; mapped ; 79AE # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9B6 +F9B7 ; mapped ; 91B4 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9B7 +F9B8 ; mapped ; 96B8 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9B8 +F9B9 ; mapped ; 60E1 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9B9 +F9BA ; mapped ; 4E86 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9BA +F9BB ; mapped ; 50DA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9BB +F9BC ; mapped ; 5BEE # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9BC +F9BD ; mapped ; 5C3F # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9BD +F9BE ; mapped ; 6599 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9BE +F9BF ; mapped ; 6A02 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9BF +F9C0 ; mapped ; 71CE # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9C0 +F9C1 ; mapped ; 7642 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9C1 +F9C2 ; mapped ; 84FC # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9C2 +F9C3 ; mapped ; 907C # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9C3 +F9C4 ; mapped ; 9F8D # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9C4 +F9C5 ; mapped ; 6688 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9C5 +F9C6 ; mapped ; 962E # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9C6 +F9C7 ; mapped ; 5289 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9C7 +F9C8 ; mapped ; 677B # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9C8 +F9C9 ; mapped ; 67F3 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9C9 +F9CA ; mapped ; 6D41 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9CA +F9CB ; mapped ; 6E9C # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9CB +F9CC ; mapped ; 7409 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9CC +F9CD ; mapped ; 7559 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9CD +F9CE ; mapped ; 786B # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9CE +F9CF ; mapped ; 7D10 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9CF +F9D0 ; mapped ; 985E # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9D0 +F9D1 ; mapped ; 516D # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9D1 +F9D2 ; mapped ; 622E # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9D2 +F9D3 ; mapped ; 9678 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9D3 +F9D4 ; mapped ; 502B # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9D4 +F9D5 ; mapped ; 5D19 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9D5 +F9D6 ; mapped ; 6DEA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9D6 +F9D7 ; mapped ; 8F2A # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9D7 +F9D8 ; mapped ; 5F8B # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9D8 +F9D9 ; mapped ; 6144 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9D9 +F9DA ; mapped ; 6817 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9DA +F9DB ; mapped ; 7387 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9DB +F9DC ; mapped ; 9686 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9DC +F9DD ; mapped ; 5229 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9DD +F9DE ; mapped ; 540F # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9DE +F9DF ; mapped ; 5C65 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9DF +F9E0 ; mapped ; 6613 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9E0 +F9E1 ; mapped ; 674E # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9E1 +F9E2 ; mapped ; 68A8 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9E2 +F9E3 ; mapped ; 6CE5 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9E3 +F9E4 ; mapped ; 7406 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9E4 +F9E5 ; mapped ; 75E2 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9E5 +F9E6 ; mapped ; 7F79 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9E6 +F9E7 ; mapped ; 88CF # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9E7 +F9E8 ; mapped ; 88E1 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9E8 +F9E9 ; mapped ; 91CC # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9E9 +F9EA ; mapped ; 96E2 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9EA +F9EB ; mapped ; 533F # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9EB +F9EC ; mapped ; 6EBA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9EC +F9ED ; mapped ; 541D # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9ED +F9EE ; mapped ; 71D0 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9EE +F9EF ; mapped ; 7498 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9EF +F9F0 ; mapped ; 85FA # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9F0 +F9F1 ; mapped ; 96A3 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9F1 +F9F2 ; mapped ; 9C57 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9F2 +F9F3 ; mapped ; 9E9F # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9F3 +F9F4 ; mapped ; 6797 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9F4 +F9F5 ; mapped ; 6DCB # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9F5 +F9F6 ; mapped ; 81E8 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9F6 +F9F7 ; mapped ; 7ACB # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9F7 +F9F8 ; mapped ; 7B20 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9F8 +F9F9 ; mapped ; 7C92 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9F9 +F9FA ; mapped ; 72C0 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9FA +F9FB ; mapped ; 7099 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9FB +F9FC ; mapped ; 8B58 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9FC +F9FD ; mapped ; 4EC0 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9FD +F9FE ; mapped ; 8336 # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9FE +F9FF ; mapped ; 523A # 1.1 CJK COMPATIBILITY IDEOGRAPH-F9FF +FA00 ; mapped ; 5207 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA00 +FA01 ; mapped ; 5EA6 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA01 +FA02 ; mapped ; 62D3 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA02 +FA03 ; mapped ; 7CD6 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA03 +FA04 ; mapped ; 5B85 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA04 +FA05 ; mapped ; 6D1E # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA05 +FA06 ; mapped ; 66B4 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA06 +FA07 ; mapped ; 8F3B # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA07 +FA08 ; mapped ; 884C # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA08 +FA09 ; mapped ; 964D # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA09 +FA0A ; mapped ; 898B # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA0A +FA0B ; mapped ; 5ED3 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA0B +FA0C ; mapped ; 5140 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA0C +FA0D ; mapped ; 55C0 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA0D +FA0E..FA0F ; valid # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA0E..CJK COMPATIBILITY IDEOGRAPH-FA0F +FA10 ; mapped ; 585A # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA10 +FA11 ; valid # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA11 +FA12 ; mapped ; 6674 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA12 +FA13..FA14 ; valid # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA13..CJK COMPATIBILITY IDEOGRAPH-FA14 +FA15 ; mapped ; 51DE # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA15 +FA16 ; mapped ; 732A # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA16 +FA17 ; mapped ; 76CA # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA17 +FA18 ; mapped ; 793C # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA18 +FA19 ; mapped ; 795E # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA19 +FA1A ; mapped ; 7965 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA1A +FA1B ; mapped ; 798F # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA1B +FA1C ; mapped ; 9756 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA1C +FA1D ; mapped ; 7CBE # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA1D +FA1E ; mapped ; 7FBD # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA1E +FA1F ; valid # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA1F +FA20 ; mapped ; 8612 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA20 +FA21 ; valid # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA21 +FA22 ; mapped ; 8AF8 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA22 +FA23..FA24 ; valid # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA23..CJK COMPATIBILITY IDEOGRAPH-FA24 +FA25 ; mapped ; 9038 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA25 +FA26 ; mapped ; 90FD # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA26 +FA27..FA29 ; valid # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA27..CJK COMPATIBILITY IDEOGRAPH-FA29 +FA2A ; mapped ; 98EF # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA2A +FA2B ; mapped ; 98FC # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA2B +FA2C ; mapped ; 9928 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA2C +FA2D ; mapped ; 9DB4 # 1.1 CJK COMPATIBILITY IDEOGRAPH-FA2D +FA2E ; mapped ; 90DE # 6.1 CJK COMPATIBILITY IDEOGRAPH-FA2E +FA2F ; mapped ; 96B7 # 6.1 CJK COMPATIBILITY IDEOGRAPH-FA2F +FA30 ; mapped ; 4FAE # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA30 +FA31 ; mapped ; 50E7 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA31 +FA32 ; mapped ; 514D # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA32 +FA33 ; mapped ; 52C9 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA33 +FA34 ; mapped ; 52E4 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA34 +FA35 ; mapped ; 5351 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA35 +FA36 ; mapped ; 559D # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA36 +FA37 ; mapped ; 5606 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA37 +FA38 ; mapped ; 5668 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA38 +FA39 ; mapped ; 5840 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA39 +FA3A ; mapped ; 58A8 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA3A +FA3B ; mapped ; 5C64 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA3B +FA3C ; mapped ; 5C6E # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA3C +FA3D ; mapped ; 6094 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA3D +FA3E ; mapped ; 6168 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA3E +FA3F ; mapped ; 618E # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA3F +FA40 ; mapped ; 61F2 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA40 +FA41 ; mapped ; 654F # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA41 +FA42 ; mapped ; 65E2 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA42 +FA43 ; mapped ; 6691 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA43 +FA44 ; mapped ; 6885 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA44 +FA45 ; mapped ; 6D77 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA45 +FA46 ; mapped ; 6E1A # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA46 +FA47 ; mapped ; 6F22 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA47 +FA48 ; mapped ; 716E # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA48 +FA49 ; mapped ; 722B # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA49 +FA4A ; mapped ; 7422 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA4A +FA4B ; mapped ; 7891 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA4B +FA4C ; mapped ; 793E # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA4C +FA4D ; mapped ; 7949 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA4D +FA4E ; mapped ; 7948 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA4E +FA4F ; mapped ; 7950 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA4F +FA50 ; mapped ; 7956 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA50 +FA51 ; mapped ; 795D # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA51 +FA52 ; mapped ; 798D # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA52 +FA53 ; mapped ; 798E # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA53 +FA54 ; mapped ; 7A40 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA54 +FA55 ; mapped ; 7A81 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA55 +FA56 ; mapped ; 7BC0 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA56 +FA57 ; mapped ; 7DF4 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA57 +FA58 ; mapped ; 7E09 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA58 +FA59 ; mapped ; 7E41 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA59 +FA5A ; mapped ; 7F72 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA5A +FA5B ; mapped ; 8005 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA5B +FA5C ; mapped ; 81ED # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA5C +FA5D..FA5E ; mapped ; 8279 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA5D..CJK COMPATIBILITY IDEOGRAPH-FA5E +FA5F ; mapped ; 8457 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA5F +FA60 ; mapped ; 8910 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA60 +FA61 ; mapped ; 8996 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA61 +FA62 ; mapped ; 8B01 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA62 +FA63 ; mapped ; 8B39 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA63 +FA64 ; mapped ; 8CD3 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA64 +FA65 ; mapped ; 8D08 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA65 +FA66 ; mapped ; 8FB6 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA66 +FA67 ; mapped ; 9038 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA67 +FA68 ; mapped ; 96E3 # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA68 +FA69 ; mapped ; 97FF # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA69 +FA6A ; mapped ; 983B # 3.2 CJK COMPATIBILITY IDEOGRAPH-FA6A +FA6B ; mapped ; 6075 # 5.2 CJK COMPATIBILITY IDEOGRAPH-FA6B +FA6C ; mapped ; 242EE # 5.2 CJK COMPATIBILITY IDEOGRAPH-FA6C +FA6D ; mapped ; 8218 # 5.2 CJK COMPATIBILITY IDEOGRAPH-FA6D +FA6E..FA6F ; disallowed # NA .. +FA70 ; mapped ; 4E26 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA70 +FA71 ; mapped ; 51B5 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA71 +FA72 ; mapped ; 5168 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA72 +FA73 ; mapped ; 4F80 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA73 +FA74 ; mapped ; 5145 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA74 +FA75 ; mapped ; 5180 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA75 +FA76 ; mapped ; 52C7 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA76 +FA77 ; mapped ; 52FA # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA77 +FA78 ; mapped ; 559D # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA78 +FA79 ; mapped ; 5555 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA79 +FA7A ; mapped ; 5599 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA7A +FA7B ; mapped ; 55E2 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA7B +FA7C ; mapped ; 585A # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA7C +FA7D ; mapped ; 58B3 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA7D +FA7E ; mapped ; 5944 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA7E +FA7F ; mapped ; 5954 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA7F +FA80 ; mapped ; 5A62 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA80 +FA81 ; mapped ; 5B28 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA81 +FA82 ; mapped ; 5ED2 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA82 +FA83 ; mapped ; 5ED9 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA83 +FA84 ; mapped ; 5F69 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA84 +FA85 ; mapped ; 5FAD # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA85 +FA86 ; mapped ; 60D8 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA86 +FA87 ; mapped ; 614E # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA87 +FA88 ; mapped ; 6108 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA88 +FA89 ; mapped ; 618E # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA89 +FA8A ; mapped ; 6160 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA8A +FA8B ; mapped ; 61F2 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA8B +FA8C ; mapped ; 6234 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA8C +FA8D ; mapped ; 63C4 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA8D +FA8E ; mapped ; 641C # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA8E +FA8F ; mapped ; 6452 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA8F +FA90 ; mapped ; 6556 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA90 +FA91 ; mapped ; 6674 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA91 +FA92 ; mapped ; 6717 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA92 +FA93 ; mapped ; 671B # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA93 +FA94 ; mapped ; 6756 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA94 +FA95 ; mapped ; 6B79 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA95 +FA96 ; mapped ; 6BBA # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA96 +FA97 ; mapped ; 6D41 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA97 +FA98 ; mapped ; 6EDB # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA98 +FA99 ; mapped ; 6ECB # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA99 +FA9A ; mapped ; 6F22 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA9A +FA9B ; mapped ; 701E # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA9B +FA9C ; mapped ; 716E # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA9C +FA9D ; mapped ; 77A7 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA9D +FA9E ; mapped ; 7235 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA9E +FA9F ; mapped ; 72AF # 4.1 CJK COMPATIBILITY IDEOGRAPH-FA9F +FAA0 ; mapped ; 732A # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAA0 +FAA1 ; mapped ; 7471 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAA1 +FAA2 ; mapped ; 7506 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAA2 +FAA3 ; mapped ; 753B # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAA3 +FAA4 ; mapped ; 761D # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAA4 +FAA5 ; mapped ; 761F # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAA5 +FAA6 ; mapped ; 76CA # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAA6 +FAA7 ; mapped ; 76DB # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAA7 +FAA8 ; mapped ; 76F4 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAA8 +FAA9 ; mapped ; 774A # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAA9 +FAAA ; mapped ; 7740 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAAA +FAAB ; mapped ; 78CC # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAAB +FAAC ; mapped ; 7AB1 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAAC +FAAD ; mapped ; 7BC0 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAAD +FAAE ; mapped ; 7C7B # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAAE +FAAF ; mapped ; 7D5B # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAAF +FAB0 ; mapped ; 7DF4 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAB0 +FAB1 ; mapped ; 7F3E # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAB1 +FAB2 ; mapped ; 8005 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAB2 +FAB3 ; mapped ; 8352 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAB3 +FAB4 ; mapped ; 83EF # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAB4 +FAB5 ; mapped ; 8779 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAB5 +FAB6 ; mapped ; 8941 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAB6 +FAB7 ; mapped ; 8986 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAB7 +FAB8 ; mapped ; 8996 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAB8 +FAB9 ; mapped ; 8ABF # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAB9 +FABA ; mapped ; 8AF8 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FABA +FABB ; mapped ; 8ACB # 4.1 CJK COMPATIBILITY IDEOGRAPH-FABB +FABC ; mapped ; 8B01 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FABC +FABD ; mapped ; 8AFE # 4.1 CJK COMPATIBILITY IDEOGRAPH-FABD +FABE ; mapped ; 8AED # 4.1 CJK COMPATIBILITY IDEOGRAPH-FABE +FABF ; mapped ; 8B39 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FABF +FAC0 ; mapped ; 8B8A # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAC0 +FAC1 ; mapped ; 8D08 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAC1 +FAC2 ; mapped ; 8F38 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAC2 +FAC3 ; mapped ; 9072 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAC3 +FAC4 ; mapped ; 9199 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAC4 +FAC5 ; mapped ; 9276 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAC5 +FAC6 ; mapped ; 967C # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAC6 +FAC7 ; mapped ; 96E3 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAC7 +FAC8 ; mapped ; 9756 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAC8 +FAC9 ; mapped ; 97DB # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAC9 +FACA ; mapped ; 97FF # 4.1 CJK COMPATIBILITY IDEOGRAPH-FACA +FACB ; mapped ; 980B # 4.1 CJK COMPATIBILITY IDEOGRAPH-FACB +FACC ; mapped ; 983B # 4.1 CJK COMPATIBILITY IDEOGRAPH-FACC +FACD ; mapped ; 9B12 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FACD +FACE ; mapped ; 9F9C # 4.1 CJK COMPATIBILITY IDEOGRAPH-FACE +FACF ; mapped ; 2284A # 4.1 CJK COMPATIBILITY IDEOGRAPH-FACF +FAD0 ; mapped ; 22844 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAD0 +FAD1 ; mapped ; 233D5 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAD1 +FAD2 ; mapped ; 3B9D # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAD2 +FAD3 ; mapped ; 4018 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAD3 +FAD4 ; mapped ; 4039 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAD4 +FAD5 ; mapped ; 25249 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAD5 +FAD6 ; mapped ; 25CD0 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAD6 +FAD7 ; mapped ; 27ED3 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAD7 +FAD8 ; mapped ; 9F43 # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAD8 +FAD9 ; mapped ; 9F8E # 4.1 CJK COMPATIBILITY IDEOGRAPH-FAD9 +FADA..FAFF ; disallowed # NA .. +FB00 ; mapped ; 0066 0066 # 1.1 LATIN SMALL LIGATURE FF +FB01 ; mapped ; 0066 0069 # 1.1 LATIN SMALL LIGATURE FI +FB02 ; mapped ; 0066 006C # 1.1 LATIN SMALL LIGATURE FL +FB03 ; mapped ; 0066 0066 0069 #1.1 LATIN SMALL LIGATURE FFI +FB04 ; mapped ; 0066 0066 006C #1.1 LATIN SMALL LIGATURE FFL +FB05..FB06 ; mapped ; 0073 0074 # 1.1 LATIN SMALL LIGATURE LONG S T..LATIN SMALL LIGATURE ST +FB07..FB12 ; disallowed # NA .. +FB13 ; mapped ; 0574 0576 # 1.1 ARMENIAN SMALL LIGATURE MEN NOW +FB14 ; mapped ; 0574 0565 # 1.1 ARMENIAN SMALL LIGATURE MEN ECH +FB15 ; mapped ; 0574 056B # 1.1 ARMENIAN SMALL LIGATURE MEN INI +FB16 ; mapped ; 057E 0576 # 1.1 ARMENIAN SMALL LIGATURE VEW NOW +FB17 ; mapped ; 0574 056D # 1.1 ARMENIAN SMALL LIGATURE MEN XEH +FB18..FB1C ; disallowed # NA .. +FB1D ; mapped ; 05D9 05B4 # 3.0 HEBREW LETTER YOD WITH HIRIQ +FB1E ; valid # 1.1 HEBREW POINT JUDEO-SPANISH VARIKA +FB1F ; mapped ; 05F2 05B7 # 1.1 HEBREW LIGATURE YIDDISH YOD YOD PATAH +FB20 ; mapped ; 05E2 # 1.1 HEBREW LETTER ALTERNATIVE AYIN +FB21 ; mapped ; 05D0 # 1.1 HEBREW LETTER WIDE ALEF +FB22 ; mapped ; 05D3 # 1.1 HEBREW LETTER WIDE DALET +FB23 ; mapped ; 05D4 # 1.1 HEBREW LETTER WIDE HE +FB24 ; mapped ; 05DB # 1.1 HEBREW LETTER WIDE KAF +FB25 ; mapped ; 05DC # 1.1 HEBREW LETTER WIDE LAMED +FB26 ; mapped ; 05DD # 1.1 HEBREW LETTER WIDE FINAL MEM +FB27 ; mapped ; 05E8 # 1.1 HEBREW LETTER WIDE RESH +FB28 ; mapped ; 05EA # 1.1 HEBREW LETTER WIDE TAV +FB29 ; disallowed_STD3_mapped ; 002B # 1.1 HEBREW LETTER ALTERNATIVE PLUS SIGN +FB2A ; mapped ; 05E9 05C1 # 1.1 HEBREW LETTER SHIN WITH SHIN DOT +FB2B ; mapped ; 05E9 05C2 # 1.1 HEBREW LETTER SHIN WITH SIN DOT +FB2C ; mapped ; 05E9 05BC 05C1 #1.1 HEBREW LETTER SHIN WITH DAGESH AND SHIN DOT +FB2D ; mapped ; 05E9 05BC 05C2 #1.1 HEBREW LETTER SHIN WITH DAGESH AND SIN DOT +FB2E ; mapped ; 05D0 05B7 # 1.1 HEBREW LETTER ALEF WITH PATAH +FB2F ; mapped ; 05D0 05B8 # 1.1 HEBREW LETTER ALEF WITH QAMATS +FB30 ; mapped ; 05D0 05BC # 1.1 HEBREW LETTER ALEF WITH MAPIQ +FB31 ; mapped ; 05D1 05BC # 1.1 HEBREW LETTER BET WITH DAGESH +FB32 ; mapped ; 05D2 05BC # 1.1 HEBREW LETTER GIMEL WITH DAGESH +FB33 ; mapped ; 05D3 05BC # 1.1 HEBREW LETTER DALET WITH DAGESH +FB34 ; mapped ; 05D4 05BC # 1.1 HEBREW LETTER HE WITH MAPIQ +FB35 ; mapped ; 05D5 05BC # 1.1 HEBREW LETTER VAV WITH DAGESH +FB36 ; mapped ; 05D6 05BC # 1.1 HEBREW LETTER ZAYIN WITH DAGESH +FB37 ; disallowed # NA +FB38 ; mapped ; 05D8 05BC # 1.1 HEBREW LETTER TET WITH DAGESH +FB39 ; mapped ; 05D9 05BC # 1.1 HEBREW LETTER YOD WITH DAGESH +FB3A ; mapped ; 05DA 05BC # 1.1 HEBREW LETTER FINAL KAF WITH DAGESH +FB3B ; mapped ; 05DB 05BC # 1.1 HEBREW LETTER KAF WITH DAGESH +FB3C ; mapped ; 05DC 05BC # 1.1 HEBREW LETTER LAMED WITH DAGESH +FB3D ; disallowed # NA +FB3E ; mapped ; 05DE 05BC # 1.1 HEBREW LETTER MEM WITH DAGESH +FB3F ; disallowed # NA +FB40 ; mapped ; 05E0 05BC # 1.1 HEBREW LETTER NUN WITH DAGESH +FB41 ; mapped ; 05E1 05BC # 1.1 HEBREW LETTER SAMEKH WITH DAGESH +FB42 ; disallowed # NA +FB43 ; mapped ; 05E3 05BC # 1.1 HEBREW LETTER FINAL PE WITH DAGESH +FB44 ; mapped ; 05E4 05BC # 1.1 HEBREW LETTER PE WITH DAGESH +FB45 ; disallowed # NA +FB46 ; mapped ; 05E6 05BC # 1.1 HEBREW LETTER TSADI WITH DAGESH +FB47 ; mapped ; 05E7 05BC # 1.1 HEBREW LETTER QOF WITH DAGESH +FB48 ; mapped ; 05E8 05BC # 1.1 HEBREW LETTER RESH WITH DAGESH +FB49 ; mapped ; 05E9 05BC # 1.1 HEBREW LETTER SHIN WITH DAGESH +FB4A ; mapped ; 05EA 05BC # 1.1 HEBREW LETTER TAV WITH DAGESH +FB4B ; mapped ; 05D5 05B9 # 1.1 HEBREW LETTER VAV WITH HOLAM +FB4C ; mapped ; 05D1 05BF # 1.1 HEBREW LETTER BET WITH RAFE +FB4D ; mapped ; 05DB 05BF # 1.1 HEBREW LETTER KAF WITH RAFE +FB4E ; mapped ; 05E4 05BF # 1.1 HEBREW LETTER PE WITH RAFE +FB4F ; mapped ; 05D0 05DC # 1.1 HEBREW LIGATURE ALEF LAMED +FB50..FB51 ; mapped ; 0671 # 1.1 ARABIC LETTER ALEF WASLA ISOLATED FORM..ARABIC LETTER ALEF WASLA FINAL FORM +FB52..FB55 ; mapped ; 067B # 1.1 ARABIC LETTER BEEH ISOLATED FORM..ARABIC LETTER BEEH MEDIAL FORM +FB56..FB59 ; mapped ; 067E # 1.1 ARABIC LETTER PEH ISOLATED FORM..ARABIC LETTER PEH MEDIAL FORM +FB5A..FB5D ; mapped ; 0680 # 1.1 ARABIC LETTER BEHEH ISOLATED FORM..ARABIC LETTER BEHEH MEDIAL FORM +FB5E..FB61 ; mapped ; 067A # 1.1 ARABIC LETTER TTEHEH ISOLATED FORM..ARABIC LETTER TTEHEH MEDIAL FORM +FB62..FB65 ; mapped ; 067F # 1.1 ARABIC LETTER TEHEH ISOLATED FORM..ARABIC LETTER TEHEH MEDIAL FORM +FB66..FB69 ; mapped ; 0679 # 1.1 ARABIC LETTER TTEH ISOLATED FORM..ARABIC LETTER TTEH MEDIAL FORM +FB6A..FB6D ; mapped ; 06A4 # 1.1 ARABIC LETTER VEH ISOLATED FORM..ARABIC LETTER VEH MEDIAL FORM +FB6E..FB71 ; mapped ; 06A6 # 1.1 ARABIC LETTER PEHEH ISOLATED FORM..ARABIC LETTER PEHEH MEDIAL FORM +FB72..FB75 ; mapped ; 0684 # 1.1 ARABIC LETTER DYEH ISOLATED FORM..ARABIC LETTER DYEH MEDIAL FORM +FB76..FB79 ; mapped ; 0683 # 1.1 ARABIC LETTER NYEH ISOLATED FORM..ARABIC LETTER NYEH MEDIAL FORM +FB7A..FB7D ; mapped ; 0686 # 1.1 ARABIC LETTER TCHEH ISOLATED FORM..ARABIC LETTER TCHEH MEDIAL FORM +FB7E..FB81 ; mapped ; 0687 # 1.1 ARABIC LETTER TCHEHEH ISOLATED FORM..ARABIC LETTER TCHEHEH MEDIAL FORM +FB82..FB83 ; mapped ; 068D # 1.1 ARABIC LETTER DDAHAL ISOLATED FORM..ARABIC LETTER DDAHAL FINAL FORM +FB84..FB85 ; mapped ; 068C # 1.1 ARABIC LETTER DAHAL ISOLATED FORM..ARABIC LETTER DAHAL FINAL FORM +FB86..FB87 ; mapped ; 068E # 1.1 ARABIC LETTER DUL ISOLATED FORM..ARABIC LETTER DUL FINAL FORM +FB88..FB89 ; mapped ; 0688 # 1.1 ARABIC LETTER DDAL ISOLATED FORM..ARABIC LETTER DDAL FINAL FORM +FB8A..FB8B ; mapped ; 0698 # 1.1 ARABIC LETTER JEH ISOLATED FORM..ARABIC LETTER JEH FINAL FORM +FB8C..FB8D ; mapped ; 0691 # 1.1 ARABIC LETTER RREH ISOLATED FORM..ARABIC LETTER RREH FINAL FORM +FB8E..FB91 ; mapped ; 06A9 # 1.1 ARABIC LETTER KEHEH ISOLATED FORM..ARABIC LETTER KEHEH MEDIAL FORM +FB92..FB95 ; mapped ; 06AF # 1.1 ARABIC LETTER GAF ISOLATED FORM..ARABIC LETTER GAF MEDIAL FORM +FB96..FB99 ; mapped ; 06B3 # 1.1 ARABIC LETTER GUEH ISOLATED FORM..ARABIC LETTER GUEH MEDIAL FORM +FB9A..FB9D ; mapped ; 06B1 # 1.1 ARABIC LETTER NGOEH ISOLATED FORM..ARABIC LETTER NGOEH MEDIAL FORM +FB9E..FB9F ; mapped ; 06BA # 1.1 ARABIC LETTER NOON GHUNNA ISOLATED FORM..ARABIC LETTER NOON GHUNNA FINAL FORM +FBA0..FBA3 ; mapped ; 06BB # 1.1 ARABIC LETTER RNOON ISOLATED FORM..ARABIC LETTER RNOON MEDIAL FORM +FBA4..FBA5 ; mapped ; 06C0 # 1.1 ARABIC LETTER HEH WITH YEH ABOVE ISOLATED FORM..ARABIC LETTER HEH WITH YEH ABOVE FINAL FORM +FBA6..FBA9 ; mapped ; 06C1 # 1.1 ARABIC LETTER HEH GOAL ISOLATED FORM..ARABIC LETTER HEH GOAL MEDIAL FORM +FBAA..FBAD ; mapped ; 06BE # 1.1 ARABIC LETTER HEH DOACHASHMEE ISOLATED FORM..ARABIC LETTER HEH DOACHASHMEE MEDIAL FORM +FBAE..FBAF ; mapped ; 06D2 # 1.1 ARABIC LETTER YEH BARREE ISOLATED FORM..ARABIC LETTER YEH BARREE FINAL FORM +FBB0..FBB1 ; mapped ; 06D3 # 1.1 ARABIC LETTER YEH BARREE WITH HAMZA ABOVE ISOLATED FORM..ARABIC LETTER YEH BARREE WITH HAMZA ABOVE FINAL FORM +FBB2..FBC1 ; valid ; ; NV8 # 6.0 ARABIC SYMBOL DOT ABOVE..ARABIC SYMBOL SMALL TAH BELOW +FBC2 ; valid ; ; NV8 # 14.0 ARABIC SYMBOL WASLA ABOVE +FBC3..FBD2 ; disallowed # NA .. +FBD3..FBD6 ; mapped ; 06AD # 1.1 ARABIC LETTER NG ISOLATED FORM..ARABIC LETTER NG MEDIAL FORM +FBD7..FBD8 ; mapped ; 06C7 # 1.1 ARABIC LETTER U ISOLATED FORM..ARABIC LETTER U FINAL FORM +FBD9..FBDA ; mapped ; 06C6 # 1.1 ARABIC LETTER OE ISOLATED FORM..ARABIC LETTER OE FINAL FORM +FBDB..FBDC ; mapped ; 06C8 # 1.1 ARABIC LETTER YU ISOLATED FORM..ARABIC LETTER YU FINAL FORM +FBDD ; mapped ; 06C7 0674 # 1.1 ARABIC LETTER U WITH HAMZA ABOVE ISOLATED FORM +FBDE..FBDF ; mapped ; 06CB # 1.1 ARABIC LETTER VE ISOLATED FORM..ARABIC LETTER VE FINAL FORM +FBE0..FBE1 ; mapped ; 06C5 # 1.1 ARABIC LETTER KIRGHIZ OE ISOLATED FORM..ARABIC LETTER KIRGHIZ OE FINAL FORM +FBE2..FBE3 ; mapped ; 06C9 # 1.1 ARABIC LETTER KIRGHIZ YU ISOLATED FORM..ARABIC LETTER KIRGHIZ YU FINAL FORM +FBE4..FBE7 ; mapped ; 06D0 # 1.1 ARABIC LETTER E ISOLATED FORM..ARABIC LETTER E MEDIAL FORM +FBE8..FBE9 ; mapped ; 0649 # 1.1 ARABIC LETTER UIGHUR KAZAKH KIRGHIZ ALEF MAKSURA INITIAL FORM..ARABIC LETTER UIGHUR KAZAKH KIRGHIZ ALEF MAKSURA MEDIAL FORM +FBEA..FBEB ; mapped ; 0626 0627 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF ISOLATED FORM..ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF FINAL FORM +FBEC..FBED ; mapped ; 0626 06D5 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH AE ISOLATED FORM..ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH AE FINAL FORM +FBEE..FBEF ; mapped ; 0626 0648 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH WAW ISOLATED FORM..ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH WAW FINAL FORM +FBF0..FBF1 ; mapped ; 0626 06C7 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH U ISOLATED FORM..ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH U FINAL FORM +FBF2..FBF3 ; mapped ; 0626 06C6 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH OE ISOLATED FORM..ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH OE FINAL FORM +FBF4..FBF5 ; mapped ; 0626 06C8 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH YU ISOLATED FORM..ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH YU FINAL FORM +FBF6..FBF8 ; mapped ; 0626 06D0 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH E ISOLATED FORM..ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH E INITIAL FORM +FBF9..FBFB ; mapped ; 0626 0649 # 1.1 ARABIC LIGATURE UIGHUR KIRGHIZ YEH WITH HAMZA ABOVE WITH ALEF MAKSURA ISOLATED FORM..ARABIC LIGATURE UIGHUR KIRGHIZ YEH WITH HAMZA ABOVE WITH ALEF MAKSURA INITIAL FORM +FBFC..FBFF ; mapped ; 06CC # 1.1 ARABIC LETTER FARSI YEH ISOLATED FORM..ARABIC LETTER FARSI YEH MEDIAL FORM +FC00 ; mapped ; 0626 062C # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH JEEM ISOLATED FORM +FC01 ; mapped ; 0626 062D # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH HAH ISOLATED FORM +FC02 ; mapped ; 0626 0645 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH MEEM ISOLATED FORM +FC03 ; mapped ; 0626 0649 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF MAKSURA ISOLATED FORM +FC04 ; mapped ; 0626 064A # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH YEH ISOLATED FORM +FC05 ; mapped ; 0628 062C # 1.1 ARABIC LIGATURE BEH WITH JEEM ISOLATED FORM +FC06 ; mapped ; 0628 062D # 1.1 ARABIC LIGATURE BEH WITH HAH ISOLATED FORM +FC07 ; mapped ; 0628 062E # 1.1 ARABIC LIGATURE BEH WITH KHAH ISOLATED FORM +FC08 ; mapped ; 0628 0645 # 1.1 ARABIC LIGATURE BEH WITH MEEM ISOLATED FORM +FC09 ; mapped ; 0628 0649 # 1.1 ARABIC LIGATURE BEH WITH ALEF MAKSURA ISOLATED FORM +FC0A ; mapped ; 0628 064A # 1.1 ARABIC LIGATURE BEH WITH YEH ISOLATED FORM +FC0B ; mapped ; 062A 062C # 1.1 ARABIC LIGATURE TEH WITH JEEM ISOLATED FORM +FC0C ; mapped ; 062A 062D # 1.1 ARABIC LIGATURE TEH WITH HAH ISOLATED FORM +FC0D ; mapped ; 062A 062E # 1.1 ARABIC LIGATURE TEH WITH KHAH ISOLATED FORM +FC0E ; mapped ; 062A 0645 # 1.1 ARABIC LIGATURE TEH WITH MEEM ISOLATED FORM +FC0F ; mapped ; 062A 0649 # 1.1 ARABIC LIGATURE TEH WITH ALEF MAKSURA ISOLATED FORM +FC10 ; mapped ; 062A 064A # 1.1 ARABIC LIGATURE TEH WITH YEH ISOLATED FORM +FC11 ; mapped ; 062B 062C # 1.1 ARABIC LIGATURE THEH WITH JEEM ISOLATED FORM +FC12 ; mapped ; 062B 0645 # 1.1 ARABIC LIGATURE THEH WITH MEEM ISOLATED FORM +FC13 ; mapped ; 062B 0649 # 1.1 ARABIC LIGATURE THEH WITH ALEF MAKSURA ISOLATED FORM +FC14 ; mapped ; 062B 064A # 1.1 ARABIC LIGATURE THEH WITH YEH ISOLATED FORM +FC15 ; mapped ; 062C 062D # 1.1 ARABIC LIGATURE JEEM WITH HAH ISOLATED FORM +FC16 ; mapped ; 062C 0645 # 1.1 ARABIC LIGATURE JEEM WITH MEEM ISOLATED FORM +FC17 ; mapped ; 062D 062C # 1.1 ARABIC LIGATURE HAH WITH JEEM ISOLATED FORM +FC18 ; mapped ; 062D 0645 # 1.1 ARABIC LIGATURE HAH WITH MEEM ISOLATED FORM +FC19 ; mapped ; 062E 062C # 1.1 ARABIC LIGATURE KHAH WITH JEEM ISOLATED FORM +FC1A ; mapped ; 062E 062D # 1.1 ARABIC LIGATURE KHAH WITH HAH ISOLATED FORM +FC1B ; mapped ; 062E 0645 # 1.1 ARABIC LIGATURE KHAH WITH MEEM ISOLATED FORM +FC1C ; mapped ; 0633 062C # 1.1 ARABIC LIGATURE SEEN WITH JEEM ISOLATED FORM +FC1D ; mapped ; 0633 062D # 1.1 ARABIC LIGATURE SEEN WITH HAH ISOLATED FORM +FC1E ; mapped ; 0633 062E # 1.1 ARABIC LIGATURE SEEN WITH KHAH ISOLATED FORM +FC1F ; mapped ; 0633 0645 # 1.1 ARABIC LIGATURE SEEN WITH MEEM ISOLATED FORM +FC20 ; mapped ; 0635 062D # 1.1 ARABIC LIGATURE SAD WITH HAH ISOLATED FORM +FC21 ; mapped ; 0635 0645 # 1.1 ARABIC LIGATURE SAD WITH MEEM ISOLATED FORM +FC22 ; mapped ; 0636 062C # 1.1 ARABIC LIGATURE DAD WITH JEEM ISOLATED FORM +FC23 ; mapped ; 0636 062D # 1.1 ARABIC LIGATURE DAD WITH HAH ISOLATED FORM +FC24 ; mapped ; 0636 062E # 1.1 ARABIC LIGATURE DAD WITH KHAH ISOLATED FORM +FC25 ; mapped ; 0636 0645 # 1.1 ARABIC LIGATURE DAD WITH MEEM ISOLATED FORM +FC26 ; mapped ; 0637 062D # 1.1 ARABIC LIGATURE TAH WITH HAH ISOLATED FORM +FC27 ; mapped ; 0637 0645 # 1.1 ARABIC LIGATURE TAH WITH MEEM ISOLATED FORM +FC28 ; mapped ; 0638 0645 # 1.1 ARABIC LIGATURE ZAH WITH MEEM ISOLATED FORM +FC29 ; mapped ; 0639 062C # 1.1 ARABIC LIGATURE AIN WITH JEEM ISOLATED FORM +FC2A ; mapped ; 0639 0645 # 1.1 ARABIC LIGATURE AIN WITH MEEM ISOLATED FORM +FC2B ; mapped ; 063A 062C # 1.1 ARABIC LIGATURE GHAIN WITH JEEM ISOLATED FORM +FC2C ; mapped ; 063A 0645 # 1.1 ARABIC LIGATURE GHAIN WITH MEEM ISOLATED FORM +FC2D ; mapped ; 0641 062C # 1.1 ARABIC LIGATURE FEH WITH JEEM ISOLATED FORM +FC2E ; mapped ; 0641 062D # 1.1 ARABIC LIGATURE FEH WITH HAH ISOLATED FORM +FC2F ; mapped ; 0641 062E # 1.1 ARABIC LIGATURE FEH WITH KHAH ISOLATED FORM +FC30 ; mapped ; 0641 0645 # 1.1 ARABIC LIGATURE FEH WITH MEEM ISOLATED FORM +FC31 ; mapped ; 0641 0649 # 1.1 ARABIC LIGATURE FEH WITH ALEF MAKSURA ISOLATED FORM +FC32 ; mapped ; 0641 064A # 1.1 ARABIC LIGATURE FEH WITH YEH ISOLATED FORM +FC33 ; mapped ; 0642 062D # 1.1 ARABIC LIGATURE QAF WITH HAH ISOLATED FORM +FC34 ; mapped ; 0642 0645 # 1.1 ARABIC LIGATURE QAF WITH MEEM ISOLATED FORM +FC35 ; mapped ; 0642 0649 # 1.1 ARABIC LIGATURE QAF WITH ALEF MAKSURA ISOLATED FORM +FC36 ; mapped ; 0642 064A # 1.1 ARABIC LIGATURE QAF WITH YEH ISOLATED FORM +FC37 ; mapped ; 0643 0627 # 1.1 ARABIC LIGATURE KAF WITH ALEF ISOLATED FORM +FC38 ; mapped ; 0643 062C # 1.1 ARABIC LIGATURE KAF WITH JEEM ISOLATED FORM +FC39 ; mapped ; 0643 062D # 1.1 ARABIC LIGATURE KAF WITH HAH ISOLATED FORM +FC3A ; mapped ; 0643 062E # 1.1 ARABIC LIGATURE KAF WITH KHAH ISOLATED FORM +FC3B ; mapped ; 0643 0644 # 1.1 ARABIC LIGATURE KAF WITH LAM ISOLATED FORM +FC3C ; mapped ; 0643 0645 # 1.1 ARABIC LIGATURE KAF WITH MEEM ISOLATED FORM +FC3D ; mapped ; 0643 0649 # 1.1 ARABIC LIGATURE KAF WITH ALEF MAKSURA ISOLATED FORM +FC3E ; mapped ; 0643 064A # 1.1 ARABIC LIGATURE KAF WITH YEH ISOLATED FORM +FC3F ; mapped ; 0644 062C # 1.1 ARABIC LIGATURE LAM WITH JEEM ISOLATED FORM +FC40 ; mapped ; 0644 062D # 1.1 ARABIC LIGATURE LAM WITH HAH ISOLATED FORM +FC41 ; mapped ; 0644 062E # 1.1 ARABIC LIGATURE LAM WITH KHAH ISOLATED FORM +FC42 ; mapped ; 0644 0645 # 1.1 ARABIC LIGATURE LAM WITH MEEM ISOLATED FORM +FC43 ; mapped ; 0644 0649 # 1.1 ARABIC LIGATURE LAM WITH ALEF MAKSURA ISOLATED FORM +FC44 ; mapped ; 0644 064A # 1.1 ARABIC LIGATURE LAM WITH YEH ISOLATED FORM +FC45 ; mapped ; 0645 062C # 1.1 ARABIC LIGATURE MEEM WITH JEEM ISOLATED FORM +FC46 ; mapped ; 0645 062D # 1.1 ARABIC LIGATURE MEEM WITH HAH ISOLATED FORM +FC47 ; mapped ; 0645 062E # 1.1 ARABIC LIGATURE MEEM WITH KHAH ISOLATED FORM +FC48 ; mapped ; 0645 0645 # 1.1 ARABIC LIGATURE MEEM WITH MEEM ISOLATED FORM +FC49 ; mapped ; 0645 0649 # 1.1 ARABIC LIGATURE MEEM WITH ALEF MAKSURA ISOLATED FORM +FC4A ; mapped ; 0645 064A # 1.1 ARABIC LIGATURE MEEM WITH YEH ISOLATED FORM +FC4B ; mapped ; 0646 062C # 1.1 ARABIC LIGATURE NOON WITH JEEM ISOLATED FORM +FC4C ; mapped ; 0646 062D # 1.1 ARABIC LIGATURE NOON WITH HAH ISOLATED FORM +FC4D ; mapped ; 0646 062E # 1.1 ARABIC LIGATURE NOON WITH KHAH ISOLATED FORM +FC4E ; mapped ; 0646 0645 # 1.1 ARABIC LIGATURE NOON WITH MEEM ISOLATED FORM +FC4F ; mapped ; 0646 0649 # 1.1 ARABIC LIGATURE NOON WITH ALEF MAKSURA ISOLATED FORM +FC50 ; mapped ; 0646 064A # 1.1 ARABIC LIGATURE NOON WITH YEH ISOLATED FORM +FC51 ; mapped ; 0647 062C # 1.1 ARABIC LIGATURE HEH WITH JEEM ISOLATED FORM +FC52 ; mapped ; 0647 0645 # 1.1 ARABIC LIGATURE HEH WITH MEEM ISOLATED FORM +FC53 ; mapped ; 0647 0649 # 1.1 ARABIC LIGATURE HEH WITH ALEF MAKSURA ISOLATED FORM +FC54 ; mapped ; 0647 064A # 1.1 ARABIC LIGATURE HEH WITH YEH ISOLATED FORM +FC55 ; mapped ; 064A 062C # 1.1 ARABIC LIGATURE YEH WITH JEEM ISOLATED FORM +FC56 ; mapped ; 064A 062D # 1.1 ARABIC LIGATURE YEH WITH HAH ISOLATED FORM +FC57 ; mapped ; 064A 062E # 1.1 ARABIC LIGATURE YEH WITH KHAH ISOLATED FORM +FC58 ; mapped ; 064A 0645 # 1.1 ARABIC LIGATURE YEH WITH MEEM ISOLATED FORM +FC59 ; mapped ; 064A 0649 # 1.1 ARABIC LIGATURE YEH WITH ALEF MAKSURA ISOLATED FORM +FC5A ; mapped ; 064A 064A # 1.1 ARABIC LIGATURE YEH WITH YEH ISOLATED FORM +FC5B ; mapped ; 0630 0670 # 1.1 ARABIC LIGATURE THAL WITH SUPERSCRIPT ALEF ISOLATED FORM +FC5C ; mapped ; 0631 0670 # 1.1 ARABIC LIGATURE REH WITH SUPERSCRIPT ALEF ISOLATED FORM +FC5D ; mapped ; 0649 0670 # 1.1 ARABIC LIGATURE ALEF MAKSURA WITH SUPERSCRIPT ALEF ISOLATED FORM +FC5E ; disallowed_STD3_mapped ; 0020 064C 0651 #1.1 ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM +FC5F ; disallowed_STD3_mapped ; 0020 064D 0651 #1.1 ARABIC LIGATURE SHADDA WITH KASRATAN ISOLATED FORM +FC60 ; disallowed_STD3_mapped ; 0020 064E 0651 #1.1 ARABIC LIGATURE SHADDA WITH FATHA ISOLATED FORM +FC61 ; disallowed_STD3_mapped ; 0020 064F 0651 #1.1 ARABIC LIGATURE SHADDA WITH DAMMA ISOLATED FORM +FC62 ; disallowed_STD3_mapped ; 0020 0650 0651 #1.1 ARABIC LIGATURE SHADDA WITH KASRA ISOLATED FORM +FC63 ; disallowed_STD3_mapped ; 0020 0651 0670 #1.1 ARABIC LIGATURE SHADDA WITH SUPERSCRIPT ALEF ISOLATED FORM +FC64 ; mapped ; 0626 0631 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH REH FINAL FORM +FC65 ; mapped ; 0626 0632 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ZAIN FINAL FORM +FC66 ; mapped ; 0626 0645 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH MEEM FINAL FORM +FC67 ; mapped ; 0626 0646 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH NOON FINAL FORM +FC68 ; mapped ; 0626 0649 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF MAKSURA FINAL FORM +FC69 ; mapped ; 0626 064A # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH YEH FINAL FORM +FC6A ; mapped ; 0628 0631 # 1.1 ARABIC LIGATURE BEH WITH REH FINAL FORM +FC6B ; mapped ; 0628 0632 # 1.1 ARABIC LIGATURE BEH WITH ZAIN FINAL FORM +FC6C ; mapped ; 0628 0645 # 1.1 ARABIC LIGATURE BEH WITH MEEM FINAL FORM +FC6D ; mapped ; 0628 0646 # 1.1 ARABIC LIGATURE BEH WITH NOON FINAL FORM +FC6E ; mapped ; 0628 0649 # 1.1 ARABIC LIGATURE BEH WITH ALEF MAKSURA FINAL FORM +FC6F ; mapped ; 0628 064A # 1.1 ARABIC LIGATURE BEH WITH YEH FINAL FORM +FC70 ; mapped ; 062A 0631 # 1.1 ARABIC LIGATURE TEH WITH REH FINAL FORM +FC71 ; mapped ; 062A 0632 # 1.1 ARABIC LIGATURE TEH WITH ZAIN FINAL FORM +FC72 ; mapped ; 062A 0645 # 1.1 ARABIC LIGATURE TEH WITH MEEM FINAL FORM +FC73 ; mapped ; 062A 0646 # 1.1 ARABIC LIGATURE TEH WITH NOON FINAL FORM +FC74 ; mapped ; 062A 0649 # 1.1 ARABIC LIGATURE TEH WITH ALEF MAKSURA FINAL FORM +FC75 ; mapped ; 062A 064A # 1.1 ARABIC LIGATURE TEH WITH YEH FINAL FORM +FC76 ; mapped ; 062B 0631 # 1.1 ARABIC LIGATURE THEH WITH REH FINAL FORM +FC77 ; mapped ; 062B 0632 # 1.1 ARABIC LIGATURE THEH WITH ZAIN FINAL FORM +FC78 ; mapped ; 062B 0645 # 1.1 ARABIC LIGATURE THEH WITH MEEM FINAL FORM +FC79 ; mapped ; 062B 0646 # 1.1 ARABIC LIGATURE THEH WITH NOON FINAL FORM +FC7A ; mapped ; 062B 0649 # 1.1 ARABIC LIGATURE THEH WITH ALEF MAKSURA FINAL FORM +FC7B ; mapped ; 062B 064A # 1.1 ARABIC LIGATURE THEH WITH YEH FINAL FORM +FC7C ; mapped ; 0641 0649 # 1.1 ARABIC LIGATURE FEH WITH ALEF MAKSURA FINAL FORM +FC7D ; mapped ; 0641 064A # 1.1 ARABIC LIGATURE FEH WITH YEH FINAL FORM +FC7E ; mapped ; 0642 0649 # 1.1 ARABIC LIGATURE QAF WITH ALEF MAKSURA FINAL FORM +FC7F ; mapped ; 0642 064A # 1.1 ARABIC LIGATURE QAF WITH YEH FINAL FORM +FC80 ; mapped ; 0643 0627 # 1.1 ARABIC LIGATURE KAF WITH ALEF FINAL FORM +FC81 ; mapped ; 0643 0644 # 1.1 ARABIC LIGATURE KAF WITH LAM FINAL FORM +FC82 ; mapped ; 0643 0645 # 1.1 ARABIC LIGATURE KAF WITH MEEM FINAL FORM +FC83 ; mapped ; 0643 0649 # 1.1 ARABIC LIGATURE KAF WITH ALEF MAKSURA FINAL FORM +FC84 ; mapped ; 0643 064A # 1.1 ARABIC LIGATURE KAF WITH YEH FINAL FORM +FC85 ; mapped ; 0644 0645 # 1.1 ARABIC LIGATURE LAM WITH MEEM FINAL FORM +FC86 ; mapped ; 0644 0649 # 1.1 ARABIC LIGATURE LAM WITH ALEF MAKSURA FINAL FORM +FC87 ; mapped ; 0644 064A # 1.1 ARABIC LIGATURE LAM WITH YEH FINAL FORM +FC88 ; mapped ; 0645 0627 # 1.1 ARABIC LIGATURE MEEM WITH ALEF FINAL FORM +FC89 ; mapped ; 0645 0645 # 1.1 ARABIC LIGATURE MEEM WITH MEEM FINAL FORM +FC8A ; mapped ; 0646 0631 # 1.1 ARABIC LIGATURE NOON WITH REH FINAL FORM +FC8B ; mapped ; 0646 0632 # 1.1 ARABIC LIGATURE NOON WITH ZAIN FINAL FORM +FC8C ; mapped ; 0646 0645 # 1.1 ARABIC LIGATURE NOON WITH MEEM FINAL FORM +FC8D ; mapped ; 0646 0646 # 1.1 ARABIC LIGATURE NOON WITH NOON FINAL FORM +FC8E ; mapped ; 0646 0649 # 1.1 ARABIC LIGATURE NOON WITH ALEF MAKSURA FINAL FORM +FC8F ; mapped ; 0646 064A # 1.1 ARABIC LIGATURE NOON WITH YEH FINAL FORM +FC90 ; mapped ; 0649 0670 # 1.1 ARABIC LIGATURE ALEF MAKSURA WITH SUPERSCRIPT ALEF FINAL FORM +FC91 ; mapped ; 064A 0631 # 1.1 ARABIC LIGATURE YEH WITH REH FINAL FORM +FC92 ; mapped ; 064A 0632 # 1.1 ARABIC LIGATURE YEH WITH ZAIN FINAL FORM +FC93 ; mapped ; 064A 0645 # 1.1 ARABIC LIGATURE YEH WITH MEEM FINAL FORM +FC94 ; mapped ; 064A 0646 # 1.1 ARABIC LIGATURE YEH WITH NOON FINAL FORM +FC95 ; mapped ; 064A 0649 # 1.1 ARABIC LIGATURE YEH WITH ALEF MAKSURA FINAL FORM +FC96 ; mapped ; 064A 064A # 1.1 ARABIC LIGATURE YEH WITH YEH FINAL FORM +FC97 ; mapped ; 0626 062C # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH JEEM INITIAL FORM +FC98 ; mapped ; 0626 062D # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH HAH INITIAL FORM +FC99 ; mapped ; 0626 062E # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH KHAH INITIAL FORM +FC9A ; mapped ; 0626 0645 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH MEEM INITIAL FORM +FC9B ; mapped ; 0626 0647 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH HEH INITIAL FORM +FC9C ; mapped ; 0628 062C # 1.1 ARABIC LIGATURE BEH WITH JEEM INITIAL FORM +FC9D ; mapped ; 0628 062D # 1.1 ARABIC LIGATURE BEH WITH HAH INITIAL FORM +FC9E ; mapped ; 0628 062E # 1.1 ARABIC LIGATURE BEH WITH KHAH INITIAL FORM +FC9F ; mapped ; 0628 0645 # 1.1 ARABIC LIGATURE BEH WITH MEEM INITIAL FORM +FCA0 ; mapped ; 0628 0647 # 1.1 ARABIC LIGATURE BEH WITH HEH INITIAL FORM +FCA1 ; mapped ; 062A 062C # 1.1 ARABIC LIGATURE TEH WITH JEEM INITIAL FORM +FCA2 ; mapped ; 062A 062D # 1.1 ARABIC LIGATURE TEH WITH HAH INITIAL FORM +FCA3 ; mapped ; 062A 062E # 1.1 ARABIC LIGATURE TEH WITH KHAH INITIAL FORM +FCA4 ; mapped ; 062A 0645 # 1.1 ARABIC LIGATURE TEH WITH MEEM INITIAL FORM +FCA5 ; mapped ; 062A 0647 # 1.1 ARABIC LIGATURE TEH WITH HEH INITIAL FORM +FCA6 ; mapped ; 062B 0645 # 1.1 ARABIC LIGATURE THEH WITH MEEM INITIAL FORM +FCA7 ; mapped ; 062C 062D # 1.1 ARABIC LIGATURE JEEM WITH HAH INITIAL FORM +FCA8 ; mapped ; 062C 0645 # 1.1 ARABIC LIGATURE JEEM WITH MEEM INITIAL FORM +FCA9 ; mapped ; 062D 062C # 1.1 ARABIC LIGATURE HAH WITH JEEM INITIAL FORM +FCAA ; mapped ; 062D 0645 # 1.1 ARABIC LIGATURE HAH WITH MEEM INITIAL FORM +FCAB ; mapped ; 062E 062C # 1.1 ARABIC LIGATURE KHAH WITH JEEM INITIAL FORM +FCAC ; mapped ; 062E 0645 # 1.1 ARABIC LIGATURE KHAH WITH MEEM INITIAL FORM +FCAD ; mapped ; 0633 062C # 1.1 ARABIC LIGATURE SEEN WITH JEEM INITIAL FORM +FCAE ; mapped ; 0633 062D # 1.1 ARABIC LIGATURE SEEN WITH HAH INITIAL FORM +FCAF ; mapped ; 0633 062E # 1.1 ARABIC LIGATURE SEEN WITH KHAH INITIAL FORM +FCB0 ; mapped ; 0633 0645 # 1.1 ARABIC LIGATURE SEEN WITH MEEM INITIAL FORM +FCB1 ; mapped ; 0635 062D # 1.1 ARABIC LIGATURE SAD WITH HAH INITIAL FORM +FCB2 ; mapped ; 0635 062E # 1.1 ARABIC LIGATURE SAD WITH KHAH INITIAL FORM +FCB3 ; mapped ; 0635 0645 # 1.1 ARABIC LIGATURE SAD WITH MEEM INITIAL FORM +FCB4 ; mapped ; 0636 062C # 1.1 ARABIC LIGATURE DAD WITH JEEM INITIAL FORM +FCB5 ; mapped ; 0636 062D # 1.1 ARABIC LIGATURE DAD WITH HAH INITIAL FORM +FCB6 ; mapped ; 0636 062E # 1.1 ARABIC LIGATURE DAD WITH KHAH INITIAL FORM +FCB7 ; mapped ; 0636 0645 # 1.1 ARABIC LIGATURE DAD WITH MEEM INITIAL FORM +FCB8 ; mapped ; 0637 062D # 1.1 ARABIC LIGATURE TAH WITH HAH INITIAL FORM +FCB9 ; mapped ; 0638 0645 # 1.1 ARABIC LIGATURE ZAH WITH MEEM INITIAL FORM +FCBA ; mapped ; 0639 062C # 1.1 ARABIC LIGATURE AIN WITH JEEM INITIAL FORM +FCBB ; mapped ; 0639 0645 # 1.1 ARABIC LIGATURE AIN WITH MEEM INITIAL FORM +FCBC ; mapped ; 063A 062C # 1.1 ARABIC LIGATURE GHAIN WITH JEEM INITIAL FORM +FCBD ; mapped ; 063A 0645 # 1.1 ARABIC LIGATURE GHAIN WITH MEEM INITIAL FORM +FCBE ; mapped ; 0641 062C # 1.1 ARABIC LIGATURE FEH WITH JEEM INITIAL FORM +FCBF ; mapped ; 0641 062D # 1.1 ARABIC LIGATURE FEH WITH HAH INITIAL FORM +FCC0 ; mapped ; 0641 062E # 1.1 ARABIC LIGATURE FEH WITH KHAH INITIAL FORM +FCC1 ; mapped ; 0641 0645 # 1.1 ARABIC LIGATURE FEH WITH MEEM INITIAL FORM +FCC2 ; mapped ; 0642 062D # 1.1 ARABIC LIGATURE QAF WITH HAH INITIAL FORM +FCC3 ; mapped ; 0642 0645 # 1.1 ARABIC LIGATURE QAF WITH MEEM INITIAL FORM +FCC4 ; mapped ; 0643 062C # 1.1 ARABIC LIGATURE KAF WITH JEEM INITIAL FORM +FCC5 ; mapped ; 0643 062D # 1.1 ARABIC LIGATURE KAF WITH HAH INITIAL FORM +FCC6 ; mapped ; 0643 062E # 1.1 ARABIC LIGATURE KAF WITH KHAH INITIAL FORM +FCC7 ; mapped ; 0643 0644 # 1.1 ARABIC LIGATURE KAF WITH LAM INITIAL FORM +FCC8 ; mapped ; 0643 0645 # 1.1 ARABIC LIGATURE KAF WITH MEEM INITIAL FORM +FCC9 ; mapped ; 0644 062C # 1.1 ARABIC LIGATURE LAM WITH JEEM INITIAL FORM +FCCA ; mapped ; 0644 062D # 1.1 ARABIC LIGATURE LAM WITH HAH INITIAL FORM +FCCB ; mapped ; 0644 062E # 1.1 ARABIC LIGATURE LAM WITH KHAH INITIAL FORM +FCCC ; mapped ; 0644 0645 # 1.1 ARABIC LIGATURE LAM WITH MEEM INITIAL FORM +FCCD ; mapped ; 0644 0647 # 1.1 ARABIC LIGATURE LAM WITH HEH INITIAL FORM +FCCE ; mapped ; 0645 062C # 1.1 ARABIC LIGATURE MEEM WITH JEEM INITIAL FORM +FCCF ; mapped ; 0645 062D # 1.1 ARABIC LIGATURE MEEM WITH HAH INITIAL FORM +FCD0 ; mapped ; 0645 062E # 1.1 ARABIC LIGATURE MEEM WITH KHAH INITIAL FORM +FCD1 ; mapped ; 0645 0645 # 1.1 ARABIC LIGATURE MEEM WITH MEEM INITIAL FORM +FCD2 ; mapped ; 0646 062C # 1.1 ARABIC LIGATURE NOON WITH JEEM INITIAL FORM +FCD3 ; mapped ; 0646 062D # 1.1 ARABIC LIGATURE NOON WITH HAH INITIAL FORM +FCD4 ; mapped ; 0646 062E # 1.1 ARABIC LIGATURE NOON WITH KHAH INITIAL FORM +FCD5 ; mapped ; 0646 0645 # 1.1 ARABIC LIGATURE NOON WITH MEEM INITIAL FORM +FCD6 ; mapped ; 0646 0647 # 1.1 ARABIC LIGATURE NOON WITH HEH INITIAL FORM +FCD7 ; mapped ; 0647 062C # 1.1 ARABIC LIGATURE HEH WITH JEEM INITIAL FORM +FCD8 ; mapped ; 0647 0645 # 1.1 ARABIC LIGATURE HEH WITH MEEM INITIAL FORM +FCD9 ; mapped ; 0647 0670 # 1.1 ARABIC LIGATURE HEH WITH SUPERSCRIPT ALEF INITIAL FORM +FCDA ; mapped ; 064A 062C # 1.1 ARABIC LIGATURE YEH WITH JEEM INITIAL FORM +FCDB ; mapped ; 064A 062D # 1.1 ARABIC LIGATURE YEH WITH HAH INITIAL FORM +FCDC ; mapped ; 064A 062E # 1.1 ARABIC LIGATURE YEH WITH KHAH INITIAL FORM +FCDD ; mapped ; 064A 0645 # 1.1 ARABIC LIGATURE YEH WITH MEEM INITIAL FORM +FCDE ; mapped ; 064A 0647 # 1.1 ARABIC LIGATURE YEH WITH HEH INITIAL FORM +FCDF ; mapped ; 0626 0645 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH MEEM MEDIAL FORM +FCE0 ; mapped ; 0626 0647 # 1.1 ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH HEH MEDIAL FORM +FCE1 ; mapped ; 0628 0645 # 1.1 ARABIC LIGATURE BEH WITH MEEM MEDIAL FORM +FCE2 ; mapped ; 0628 0647 # 1.1 ARABIC LIGATURE BEH WITH HEH MEDIAL FORM +FCE3 ; mapped ; 062A 0645 # 1.1 ARABIC LIGATURE TEH WITH MEEM MEDIAL FORM +FCE4 ; mapped ; 062A 0647 # 1.1 ARABIC LIGATURE TEH WITH HEH MEDIAL FORM +FCE5 ; mapped ; 062B 0645 # 1.1 ARABIC LIGATURE THEH WITH MEEM MEDIAL FORM +FCE6 ; mapped ; 062B 0647 # 1.1 ARABIC LIGATURE THEH WITH HEH MEDIAL FORM +FCE7 ; mapped ; 0633 0645 # 1.1 ARABIC LIGATURE SEEN WITH MEEM MEDIAL FORM +FCE8 ; mapped ; 0633 0647 # 1.1 ARABIC LIGATURE SEEN WITH HEH MEDIAL FORM +FCE9 ; mapped ; 0634 0645 # 1.1 ARABIC LIGATURE SHEEN WITH MEEM MEDIAL FORM +FCEA ; mapped ; 0634 0647 # 1.1 ARABIC LIGATURE SHEEN WITH HEH MEDIAL FORM +FCEB ; mapped ; 0643 0644 # 1.1 ARABIC LIGATURE KAF WITH LAM MEDIAL FORM +FCEC ; mapped ; 0643 0645 # 1.1 ARABIC LIGATURE KAF WITH MEEM MEDIAL FORM +FCED ; mapped ; 0644 0645 # 1.1 ARABIC LIGATURE LAM WITH MEEM MEDIAL FORM +FCEE ; mapped ; 0646 0645 # 1.1 ARABIC LIGATURE NOON WITH MEEM MEDIAL FORM +FCEF ; mapped ; 0646 0647 # 1.1 ARABIC LIGATURE NOON WITH HEH MEDIAL FORM +FCF0 ; mapped ; 064A 0645 # 1.1 ARABIC LIGATURE YEH WITH MEEM MEDIAL FORM +FCF1 ; mapped ; 064A 0647 # 1.1 ARABIC LIGATURE YEH WITH HEH MEDIAL FORM +FCF2 ; mapped ; 0640 064E 0651 #1.1 ARABIC LIGATURE SHADDA WITH FATHA MEDIAL FORM +FCF3 ; mapped ; 0640 064F 0651 #1.1 ARABIC LIGATURE SHADDA WITH DAMMA MEDIAL FORM +FCF4 ; mapped ; 0640 0650 0651 #1.1 ARABIC LIGATURE SHADDA WITH KASRA MEDIAL FORM +FCF5 ; mapped ; 0637 0649 # 1.1 ARABIC LIGATURE TAH WITH ALEF MAKSURA ISOLATED FORM +FCF6 ; mapped ; 0637 064A # 1.1 ARABIC LIGATURE TAH WITH YEH ISOLATED FORM +FCF7 ; mapped ; 0639 0649 # 1.1 ARABIC LIGATURE AIN WITH ALEF MAKSURA ISOLATED FORM +FCF8 ; mapped ; 0639 064A # 1.1 ARABIC LIGATURE AIN WITH YEH ISOLATED FORM +FCF9 ; mapped ; 063A 0649 # 1.1 ARABIC LIGATURE GHAIN WITH ALEF MAKSURA ISOLATED FORM +FCFA ; mapped ; 063A 064A # 1.1 ARABIC LIGATURE GHAIN WITH YEH ISOLATED FORM +FCFB ; mapped ; 0633 0649 # 1.1 ARABIC LIGATURE SEEN WITH ALEF MAKSURA ISOLATED FORM +FCFC ; mapped ; 0633 064A # 1.1 ARABIC LIGATURE SEEN WITH YEH ISOLATED FORM +FCFD ; mapped ; 0634 0649 # 1.1 ARABIC LIGATURE SHEEN WITH ALEF MAKSURA ISOLATED FORM +FCFE ; mapped ; 0634 064A # 1.1 ARABIC LIGATURE SHEEN WITH YEH ISOLATED FORM +FCFF ; mapped ; 062D 0649 # 1.1 ARABIC LIGATURE HAH WITH ALEF MAKSURA ISOLATED FORM +FD00 ; mapped ; 062D 064A # 1.1 ARABIC LIGATURE HAH WITH YEH ISOLATED FORM +FD01 ; mapped ; 062C 0649 # 1.1 ARABIC LIGATURE JEEM WITH ALEF MAKSURA ISOLATED FORM +FD02 ; mapped ; 062C 064A # 1.1 ARABIC LIGATURE JEEM WITH YEH ISOLATED FORM +FD03 ; mapped ; 062E 0649 # 1.1 ARABIC LIGATURE KHAH WITH ALEF MAKSURA ISOLATED FORM +FD04 ; mapped ; 062E 064A # 1.1 ARABIC LIGATURE KHAH WITH YEH ISOLATED FORM +FD05 ; mapped ; 0635 0649 # 1.1 ARABIC LIGATURE SAD WITH ALEF MAKSURA ISOLATED FORM +FD06 ; mapped ; 0635 064A # 1.1 ARABIC LIGATURE SAD WITH YEH ISOLATED FORM +FD07 ; mapped ; 0636 0649 # 1.1 ARABIC LIGATURE DAD WITH ALEF MAKSURA ISOLATED FORM +FD08 ; mapped ; 0636 064A # 1.1 ARABIC LIGATURE DAD WITH YEH ISOLATED FORM +FD09 ; mapped ; 0634 062C # 1.1 ARABIC LIGATURE SHEEN WITH JEEM ISOLATED FORM +FD0A ; mapped ; 0634 062D # 1.1 ARABIC LIGATURE SHEEN WITH HAH ISOLATED FORM +FD0B ; mapped ; 0634 062E # 1.1 ARABIC LIGATURE SHEEN WITH KHAH ISOLATED FORM +FD0C ; mapped ; 0634 0645 # 1.1 ARABIC LIGATURE SHEEN WITH MEEM ISOLATED FORM +FD0D ; mapped ; 0634 0631 # 1.1 ARABIC LIGATURE SHEEN WITH REH ISOLATED FORM +FD0E ; mapped ; 0633 0631 # 1.1 ARABIC LIGATURE SEEN WITH REH ISOLATED FORM +FD0F ; mapped ; 0635 0631 # 1.1 ARABIC LIGATURE SAD WITH REH ISOLATED FORM +FD10 ; mapped ; 0636 0631 # 1.1 ARABIC LIGATURE DAD WITH REH ISOLATED FORM +FD11 ; mapped ; 0637 0649 # 1.1 ARABIC LIGATURE TAH WITH ALEF MAKSURA FINAL FORM +FD12 ; mapped ; 0637 064A # 1.1 ARABIC LIGATURE TAH WITH YEH FINAL FORM +FD13 ; mapped ; 0639 0649 # 1.1 ARABIC LIGATURE AIN WITH ALEF MAKSURA FINAL FORM +FD14 ; mapped ; 0639 064A # 1.1 ARABIC LIGATURE AIN WITH YEH FINAL FORM +FD15 ; mapped ; 063A 0649 # 1.1 ARABIC LIGATURE GHAIN WITH ALEF MAKSURA FINAL FORM +FD16 ; mapped ; 063A 064A # 1.1 ARABIC LIGATURE GHAIN WITH YEH FINAL FORM +FD17 ; mapped ; 0633 0649 # 1.1 ARABIC LIGATURE SEEN WITH ALEF MAKSURA FINAL FORM +FD18 ; mapped ; 0633 064A # 1.1 ARABIC LIGATURE SEEN WITH YEH FINAL FORM +FD19 ; mapped ; 0634 0649 # 1.1 ARABIC LIGATURE SHEEN WITH ALEF MAKSURA FINAL FORM +FD1A ; mapped ; 0634 064A # 1.1 ARABIC LIGATURE SHEEN WITH YEH FINAL FORM +FD1B ; mapped ; 062D 0649 # 1.1 ARABIC LIGATURE HAH WITH ALEF MAKSURA FINAL FORM +FD1C ; mapped ; 062D 064A # 1.1 ARABIC LIGATURE HAH WITH YEH FINAL FORM +FD1D ; mapped ; 062C 0649 # 1.1 ARABIC LIGATURE JEEM WITH ALEF MAKSURA FINAL FORM +FD1E ; mapped ; 062C 064A # 1.1 ARABIC LIGATURE JEEM WITH YEH FINAL FORM +FD1F ; mapped ; 062E 0649 # 1.1 ARABIC LIGATURE KHAH WITH ALEF MAKSURA FINAL FORM +FD20 ; mapped ; 062E 064A # 1.1 ARABIC LIGATURE KHAH WITH YEH FINAL FORM +FD21 ; mapped ; 0635 0649 # 1.1 ARABIC LIGATURE SAD WITH ALEF MAKSURA FINAL FORM +FD22 ; mapped ; 0635 064A # 1.1 ARABIC LIGATURE SAD WITH YEH FINAL FORM +FD23 ; mapped ; 0636 0649 # 1.1 ARABIC LIGATURE DAD WITH ALEF MAKSURA FINAL FORM +FD24 ; mapped ; 0636 064A # 1.1 ARABIC LIGATURE DAD WITH YEH FINAL FORM +FD25 ; mapped ; 0634 062C # 1.1 ARABIC LIGATURE SHEEN WITH JEEM FINAL FORM +FD26 ; mapped ; 0634 062D # 1.1 ARABIC LIGATURE SHEEN WITH HAH FINAL FORM +FD27 ; mapped ; 0634 062E # 1.1 ARABIC LIGATURE SHEEN WITH KHAH FINAL FORM +FD28 ; mapped ; 0634 0645 # 1.1 ARABIC LIGATURE SHEEN WITH MEEM FINAL FORM +FD29 ; mapped ; 0634 0631 # 1.1 ARABIC LIGATURE SHEEN WITH REH FINAL FORM +FD2A ; mapped ; 0633 0631 # 1.1 ARABIC LIGATURE SEEN WITH REH FINAL FORM +FD2B ; mapped ; 0635 0631 # 1.1 ARABIC LIGATURE SAD WITH REH FINAL FORM +FD2C ; mapped ; 0636 0631 # 1.1 ARABIC LIGATURE DAD WITH REH FINAL FORM +FD2D ; mapped ; 0634 062C # 1.1 ARABIC LIGATURE SHEEN WITH JEEM INITIAL FORM +FD2E ; mapped ; 0634 062D # 1.1 ARABIC LIGATURE SHEEN WITH HAH INITIAL FORM +FD2F ; mapped ; 0634 062E # 1.1 ARABIC LIGATURE SHEEN WITH KHAH INITIAL FORM +FD30 ; mapped ; 0634 0645 # 1.1 ARABIC LIGATURE SHEEN WITH MEEM INITIAL FORM +FD31 ; mapped ; 0633 0647 # 1.1 ARABIC LIGATURE SEEN WITH HEH INITIAL FORM +FD32 ; mapped ; 0634 0647 # 1.1 ARABIC LIGATURE SHEEN WITH HEH INITIAL FORM +FD33 ; mapped ; 0637 0645 # 1.1 ARABIC LIGATURE TAH WITH MEEM INITIAL FORM +FD34 ; mapped ; 0633 062C # 1.1 ARABIC LIGATURE SEEN WITH JEEM MEDIAL FORM +FD35 ; mapped ; 0633 062D # 1.1 ARABIC LIGATURE SEEN WITH HAH MEDIAL FORM +FD36 ; mapped ; 0633 062E # 1.1 ARABIC LIGATURE SEEN WITH KHAH MEDIAL FORM +FD37 ; mapped ; 0634 062C # 1.1 ARABIC LIGATURE SHEEN WITH JEEM MEDIAL FORM +FD38 ; mapped ; 0634 062D # 1.1 ARABIC LIGATURE SHEEN WITH HAH MEDIAL FORM +FD39 ; mapped ; 0634 062E # 1.1 ARABIC LIGATURE SHEEN WITH KHAH MEDIAL FORM +FD3A ; mapped ; 0637 0645 # 1.1 ARABIC LIGATURE TAH WITH MEEM MEDIAL FORM +FD3B ; mapped ; 0638 0645 # 1.1 ARABIC LIGATURE ZAH WITH MEEM MEDIAL FORM +FD3C..FD3D ; mapped ; 0627 064B # 1.1 ARABIC LIGATURE ALEF WITH FATHATAN FINAL FORM..ARABIC LIGATURE ALEF WITH FATHATAN ISOLATED FORM +FD3E..FD3F ; valid ; ; NV8 # 1.1 ORNATE LEFT PARENTHESIS..ORNATE RIGHT PARENTHESIS +FD40..FD4F ; valid ; ; NV8 # 14.0 ARABIC LIGATURE RAHIMAHU ALLAAH..ARABIC LIGATURE RAHIMAHUM ALLAAH +FD50 ; mapped ; 062A 062C 0645 #1.1 ARABIC LIGATURE TEH WITH JEEM WITH MEEM INITIAL FORM +FD51..FD52 ; mapped ; 062A 062D 062C #1.1 ARABIC LIGATURE TEH WITH HAH WITH JEEM FINAL FORM..ARABIC LIGATURE TEH WITH HAH WITH JEEM INITIAL FORM +FD53 ; mapped ; 062A 062D 0645 #1.1 ARABIC LIGATURE TEH WITH HAH WITH MEEM INITIAL FORM +FD54 ; mapped ; 062A 062E 0645 #1.1 ARABIC LIGATURE TEH WITH KHAH WITH MEEM INITIAL FORM +FD55 ; mapped ; 062A 0645 062C #1.1 ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM +FD56 ; mapped ; 062A 0645 062D #1.1 ARABIC LIGATURE TEH WITH MEEM WITH HAH INITIAL FORM +FD57 ; mapped ; 062A 0645 062E #1.1 ARABIC LIGATURE TEH WITH MEEM WITH KHAH INITIAL FORM +FD58..FD59 ; mapped ; 062C 0645 062D #1.1 ARABIC LIGATURE JEEM WITH MEEM WITH HAH FINAL FORM..ARABIC LIGATURE JEEM WITH MEEM WITH HAH INITIAL FORM +FD5A ; mapped ; 062D 0645 064A #1.1 ARABIC LIGATURE HAH WITH MEEM WITH YEH FINAL FORM +FD5B ; mapped ; 062D 0645 0649 #1.1 ARABIC LIGATURE HAH WITH MEEM WITH ALEF MAKSURA FINAL FORM +FD5C ; mapped ; 0633 062D 062C #1.1 ARABIC LIGATURE SEEN WITH HAH WITH JEEM INITIAL FORM +FD5D ; mapped ; 0633 062C 062D #1.1 ARABIC LIGATURE SEEN WITH JEEM WITH HAH INITIAL FORM +FD5E ; mapped ; 0633 062C 0649 #1.1 ARABIC LIGATURE SEEN WITH JEEM WITH ALEF MAKSURA FINAL FORM +FD5F..FD60 ; mapped ; 0633 0645 062D #1.1 ARABIC LIGATURE SEEN WITH MEEM WITH HAH FINAL FORM..ARABIC LIGATURE SEEN WITH MEEM WITH HAH INITIAL FORM +FD61 ; mapped ; 0633 0645 062C #1.1 ARABIC LIGATURE SEEN WITH MEEM WITH JEEM INITIAL FORM +FD62..FD63 ; mapped ; 0633 0645 0645 #1.1 ARABIC LIGATURE SEEN WITH MEEM WITH MEEM FINAL FORM..ARABIC LIGATURE SEEN WITH MEEM WITH MEEM INITIAL FORM +FD64..FD65 ; mapped ; 0635 062D 062D #1.1 ARABIC LIGATURE SAD WITH HAH WITH HAH FINAL FORM..ARABIC LIGATURE SAD WITH HAH WITH HAH INITIAL FORM +FD66 ; mapped ; 0635 0645 0645 #1.1 ARABIC LIGATURE SAD WITH MEEM WITH MEEM FINAL FORM +FD67..FD68 ; mapped ; 0634 062D 0645 #1.1 ARABIC LIGATURE SHEEN WITH HAH WITH MEEM FINAL FORM..ARABIC LIGATURE SHEEN WITH HAH WITH MEEM INITIAL FORM +FD69 ; mapped ; 0634 062C 064A #1.1 ARABIC LIGATURE SHEEN WITH JEEM WITH YEH FINAL FORM +FD6A..FD6B ; mapped ; 0634 0645 062E #1.1 ARABIC LIGATURE SHEEN WITH MEEM WITH KHAH FINAL FORM..ARABIC LIGATURE SHEEN WITH MEEM WITH KHAH INITIAL FORM +FD6C..FD6D ; mapped ; 0634 0645 0645 #1.1 ARABIC LIGATURE SHEEN WITH MEEM WITH MEEM FINAL FORM..ARABIC LIGATURE SHEEN WITH MEEM WITH MEEM INITIAL FORM +FD6E ; mapped ; 0636 062D 0649 #1.1 ARABIC LIGATURE DAD WITH HAH WITH ALEF MAKSURA FINAL FORM +FD6F..FD70 ; mapped ; 0636 062E 0645 #1.1 ARABIC LIGATURE DAD WITH KHAH WITH MEEM FINAL FORM..ARABIC LIGATURE DAD WITH KHAH WITH MEEM INITIAL FORM +FD71..FD72 ; mapped ; 0637 0645 062D #1.1 ARABIC LIGATURE TAH WITH MEEM WITH HAH FINAL FORM..ARABIC LIGATURE TAH WITH MEEM WITH HAH INITIAL FORM +FD73 ; mapped ; 0637 0645 0645 #1.1 ARABIC LIGATURE TAH WITH MEEM WITH MEEM INITIAL FORM +FD74 ; mapped ; 0637 0645 064A #1.1 ARABIC LIGATURE TAH WITH MEEM WITH YEH FINAL FORM +FD75 ; mapped ; 0639 062C 0645 #1.1 ARABIC LIGATURE AIN WITH JEEM WITH MEEM FINAL FORM +FD76..FD77 ; mapped ; 0639 0645 0645 #1.1 ARABIC LIGATURE AIN WITH MEEM WITH MEEM FINAL FORM..ARABIC LIGATURE AIN WITH MEEM WITH MEEM INITIAL FORM +FD78 ; mapped ; 0639 0645 0649 #1.1 ARABIC LIGATURE AIN WITH MEEM WITH ALEF MAKSURA FINAL FORM +FD79 ; mapped ; 063A 0645 0645 #1.1 ARABIC LIGATURE GHAIN WITH MEEM WITH MEEM FINAL FORM +FD7A ; mapped ; 063A 0645 064A #1.1 ARABIC LIGATURE GHAIN WITH MEEM WITH YEH FINAL FORM +FD7B ; mapped ; 063A 0645 0649 #1.1 ARABIC LIGATURE GHAIN WITH MEEM WITH ALEF MAKSURA FINAL FORM +FD7C..FD7D ; mapped ; 0641 062E 0645 #1.1 ARABIC LIGATURE FEH WITH KHAH WITH MEEM FINAL FORM..ARABIC LIGATURE FEH WITH KHAH WITH MEEM INITIAL FORM +FD7E ; mapped ; 0642 0645 062D #1.1 ARABIC LIGATURE QAF WITH MEEM WITH HAH FINAL FORM +FD7F ; mapped ; 0642 0645 0645 #1.1 ARABIC LIGATURE QAF WITH MEEM WITH MEEM FINAL FORM +FD80 ; mapped ; 0644 062D 0645 #1.1 ARABIC LIGATURE LAM WITH HAH WITH MEEM FINAL FORM +FD81 ; mapped ; 0644 062D 064A #1.1 ARABIC LIGATURE LAM WITH HAH WITH YEH FINAL FORM +FD82 ; mapped ; 0644 062D 0649 #1.1 ARABIC LIGATURE LAM WITH HAH WITH ALEF MAKSURA FINAL FORM +FD83..FD84 ; mapped ; 0644 062C 062C #1.1 ARABIC LIGATURE LAM WITH JEEM WITH JEEM INITIAL FORM..ARABIC LIGATURE LAM WITH JEEM WITH JEEM FINAL FORM +FD85..FD86 ; mapped ; 0644 062E 0645 #1.1 ARABIC LIGATURE LAM WITH KHAH WITH MEEM FINAL FORM..ARABIC LIGATURE LAM WITH KHAH WITH MEEM INITIAL FORM +FD87..FD88 ; mapped ; 0644 0645 062D #1.1 ARABIC LIGATURE LAM WITH MEEM WITH HAH FINAL FORM..ARABIC LIGATURE LAM WITH MEEM WITH HAH INITIAL FORM +FD89 ; mapped ; 0645 062D 062C #1.1 ARABIC LIGATURE MEEM WITH HAH WITH JEEM INITIAL FORM +FD8A ; mapped ; 0645 062D 0645 #1.1 ARABIC LIGATURE MEEM WITH HAH WITH MEEM INITIAL FORM +FD8B ; mapped ; 0645 062D 064A #1.1 ARABIC LIGATURE MEEM WITH HAH WITH YEH FINAL FORM +FD8C ; mapped ; 0645 062C 062D #1.1 ARABIC LIGATURE MEEM WITH JEEM WITH HAH INITIAL FORM +FD8D ; mapped ; 0645 062C 0645 #1.1 ARABIC LIGATURE MEEM WITH JEEM WITH MEEM INITIAL FORM +FD8E ; mapped ; 0645 062E 062C #1.1 ARABIC LIGATURE MEEM WITH KHAH WITH JEEM INITIAL FORM +FD8F ; mapped ; 0645 062E 0645 #1.1 ARABIC LIGATURE MEEM WITH KHAH WITH MEEM INITIAL FORM +FD90..FD91 ; disallowed # NA .. +FD92 ; mapped ; 0645 062C 062E #1.1 ARABIC LIGATURE MEEM WITH JEEM WITH KHAH INITIAL FORM +FD93 ; mapped ; 0647 0645 062C #1.1 ARABIC LIGATURE HEH WITH MEEM WITH JEEM INITIAL FORM +FD94 ; mapped ; 0647 0645 0645 #1.1 ARABIC LIGATURE HEH WITH MEEM WITH MEEM INITIAL FORM +FD95 ; mapped ; 0646 062D 0645 #1.1 ARABIC LIGATURE NOON WITH HAH WITH MEEM INITIAL FORM +FD96 ; mapped ; 0646 062D 0649 #1.1 ARABIC LIGATURE NOON WITH HAH WITH ALEF MAKSURA FINAL FORM +FD97..FD98 ; mapped ; 0646 062C 0645 #1.1 ARABIC LIGATURE NOON WITH JEEM WITH MEEM FINAL FORM..ARABIC LIGATURE NOON WITH JEEM WITH MEEM INITIAL FORM +FD99 ; mapped ; 0646 062C 0649 #1.1 ARABIC LIGATURE NOON WITH JEEM WITH ALEF MAKSURA FINAL FORM +FD9A ; mapped ; 0646 0645 064A #1.1 ARABIC LIGATURE NOON WITH MEEM WITH YEH FINAL FORM +FD9B ; mapped ; 0646 0645 0649 #1.1 ARABIC LIGATURE NOON WITH MEEM WITH ALEF MAKSURA FINAL FORM +FD9C..FD9D ; mapped ; 064A 0645 0645 #1.1 ARABIC LIGATURE YEH WITH MEEM WITH MEEM FINAL FORM..ARABIC LIGATURE YEH WITH MEEM WITH MEEM INITIAL FORM +FD9E ; mapped ; 0628 062E 064A #1.1 ARABIC LIGATURE BEH WITH KHAH WITH YEH FINAL FORM +FD9F ; mapped ; 062A 062C 064A #1.1 ARABIC LIGATURE TEH WITH JEEM WITH YEH FINAL FORM +FDA0 ; mapped ; 062A 062C 0649 #1.1 ARABIC LIGATURE TEH WITH JEEM WITH ALEF MAKSURA FINAL FORM +FDA1 ; mapped ; 062A 062E 064A #1.1 ARABIC LIGATURE TEH WITH KHAH WITH YEH FINAL FORM +FDA2 ; mapped ; 062A 062E 0649 #1.1 ARABIC LIGATURE TEH WITH KHAH WITH ALEF MAKSURA FINAL FORM +FDA3 ; mapped ; 062A 0645 064A #1.1 ARABIC LIGATURE TEH WITH MEEM WITH YEH FINAL FORM +FDA4 ; mapped ; 062A 0645 0649 #1.1 ARABIC LIGATURE TEH WITH MEEM WITH ALEF MAKSURA FINAL FORM +FDA5 ; mapped ; 062C 0645 064A #1.1 ARABIC LIGATURE JEEM WITH MEEM WITH YEH FINAL FORM +FDA6 ; mapped ; 062C 062D 0649 #1.1 ARABIC LIGATURE JEEM WITH HAH WITH ALEF MAKSURA FINAL FORM +FDA7 ; mapped ; 062C 0645 0649 #1.1 ARABIC LIGATURE JEEM WITH MEEM WITH ALEF MAKSURA FINAL FORM +FDA8 ; mapped ; 0633 062E 0649 #1.1 ARABIC LIGATURE SEEN WITH KHAH WITH ALEF MAKSURA FINAL FORM +FDA9 ; mapped ; 0635 062D 064A #1.1 ARABIC LIGATURE SAD WITH HAH WITH YEH FINAL FORM +FDAA ; mapped ; 0634 062D 064A #1.1 ARABIC LIGATURE SHEEN WITH HAH WITH YEH FINAL FORM +FDAB ; mapped ; 0636 062D 064A #1.1 ARABIC LIGATURE DAD WITH HAH WITH YEH FINAL FORM +FDAC ; mapped ; 0644 062C 064A #1.1 ARABIC LIGATURE LAM WITH JEEM WITH YEH FINAL FORM +FDAD ; mapped ; 0644 0645 064A #1.1 ARABIC LIGATURE LAM WITH MEEM WITH YEH FINAL FORM +FDAE ; mapped ; 064A 062D 064A #1.1 ARABIC LIGATURE YEH WITH HAH WITH YEH FINAL FORM +FDAF ; mapped ; 064A 062C 064A #1.1 ARABIC LIGATURE YEH WITH JEEM WITH YEH FINAL FORM +FDB0 ; mapped ; 064A 0645 064A #1.1 ARABIC LIGATURE YEH WITH MEEM WITH YEH FINAL FORM +FDB1 ; mapped ; 0645 0645 064A #1.1 ARABIC LIGATURE MEEM WITH MEEM WITH YEH FINAL FORM +FDB2 ; mapped ; 0642 0645 064A #1.1 ARABIC LIGATURE QAF WITH MEEM WITH YEH FINAL FORM +FDB3 ; mapped ; 0646 062D 064A #1.1 ARABIC LIGATURE NOON WITH HAH WITH YEH FINAL FORM +FDB4 ; mapped ; 0642 0645 062D #1.1 ARABIC LIGATURE QAF WITH MEEM WITH HAH INITIAL FORM +FDB5 ; mapped ; 0644 062D 0645 #1.1 ARABIC LIGATURE LAM WITH HAH WITH MEEM INITIAL FORM +FDB6 ; mapped ; 0639 0645 064A #1.1 ARABIC LIGATURE AIN WITH MEEM WITH YEH FINAL FORM +FDB7 ; mapped ; 0643 0645 064A #1.1 ARABIC LIGATURE KAF WITH MEEM WITH YEH FINAL FORM +FDB8 ; mapped ; 0646 062C 062D #1.1 ARABIC LIGATURE NOON WITH JEEM WITH HAH INITIAL FORM +FDB9 ; mapped ; 0645 062E 064A #1.1 ARABIC LIGATURE MEEM WITH KHAH WITH YEH FINAL FORM +FDBA ; mapped ; 0644 062C 0645 #1.1 ARABIC LIGATURE LAM WITH JEEM WITH MEEM INITIAL FORM +FDBB ; mapped ; 0643 0645 0645 #1.1 ARABIC LIGATURE KAF WITH MEEM WITH MEEM FINAL FORM +FDBC ; mapped ; 0644 062C 0645 #1.1 ARABIC LIGATURE LAM WITH JEEM WITH MEEM FINAL FORM +FDBD ; mapped ; 0646 062C 062D #1.1 ARABIC LIGATURE NOON WITH JEEM WITH HAH FINAL FORM +FDBE ; mapped ; 062C 062D 064A #1.1 ARABIC LIGATURE JEEM WITH HAH WITH YEH FINAL FORM +FDBF ; mapped ; 062D 062C 064A #1.1 ARABIC LIGATURE HAH WITH JEEM WITH YEH FINAL FORM +FDC0 ; mapped ; 0645 062C 064A #1.1 ARABIC LIGATURE MEEM WITH JEEM WITH YEH FINAL FORM +FDC1 ; mapped ; 0641 0645 064A #1.1 ARABIC LIGATURE FEH WITH MEEM WITH YEH FINAL FORM +FDC2 ; mapped ; 0628 062D 064A #1.1 ARABIC LIGATURE BEH WITH HAH WITH YEH FINAL FORM +FDC3 ; mapped ; 0643 0645 0645 #1.1 ARABIC LIGATURE KAF WITH MEEM WITH MEEM INITIAL FORM +FDC4 ; mapped ; 0639 062C 0645 #1.1 ARABIC LIGATURE AIN WITH JEEM WITH MEEM INITIAL FORM +FDC5 ; mapped ; 0635 0645 0645 #1.1 ARABIC LIGATURE SAD WITH MEEM WITH MEEM INITIAL FORM +FDC6 ; mapped ; 0633 062E 064A #1.1 ARABIC LIGATURE SEEN WITH KHAH WITH YEH FINAL FORM +FDC7 ; mapped ; 0646 062C 064A #1.1 ARABIC LIGATURE NOON WITH JEEM WITH YEH FINAL FORM +FDC8..FDCE ; disallowed # NA .. +FDCF ; valid ; ; NV8 # 14.0 ARABIC LIGATURE SALAAMUHU ALAYNAA +FDD0..FDEF ; disallowed # 3.1 .. +FDF0 ; mapped ; 0635 0644 06D2 #1.1 ARABIC LIGATURE SALLA USED AS KORANIC STOP SIGN ISOLATED FORM +FDF1 ; mapped ; 0642 0644 06D2 #1.1 ARABIC LIGATURE QALA USED AS KORANIC STOP SIGN ISOLATED FORM +FDF2 ; mapped ; 0627 0644 0644 0647 #1.1 ARABIC LIGATURE ALLAH ISOLATED FORM +FDF3 ; mapped ; 0627 0643 0628 0631 #1.1 ARABIC LIGATURE AKBAR ISOLATED FORM +FDF4 ; mapped ; 0645 062D 0645 062F #1.1 ARABIC LIGATURE MOHAMMAD ISOLATED FORM +FDF5 ; mapped ; 0635 0644 0639 0645 #1.1 ARABIC LIGATURE SALAM ISOLATED FORM +FDF6 ; mapped ; 0631 0633 0648 0644 #1.1 ARABIC LIGATURE RASOUL ISOLATED FORM +FDF7 ; mapped ; 0639 0644 064A 0647 #1.1 ARABIC LIGATURE ALAYHE ISOLATED FORM +FDF8 ; mapped ; 0648 0633 0644 0645 #1.1 ARABIC LIGATURE WASALLAM ISOLATED FORM +FDF9 ; mapped ; 0635 0644 0649 #1.1 ARABIC LIGATURE SALLA ISOLATED FORM +FDFA ; disallowed_STD3_mapped ; 0635 0644 0649 0020 0627 0644 0644 0647 0020 0639 0644 064A 0647 0020 0648 0633 0644 0645 #1.1 ARABIC LIGATURE SALLALLAHOU ALAYHE WASALLAM +FDFB ; disallowed_STD3_mapped ; 062C 0644 0020 062C 0644 0627 0644 0647 #1.1 ARABIC LIGATURE JALLAJALALOUHOU +FDFC ; mapped ; 0631 06CC 0627 0644 #3.2 RIAL SIGN +FDFD ; valid ; ; NV8 # 4.0 ARABIC LIGATURE BISMILLAH AR-RAHMAN AR-RAHEEM +FDFE..FDFF ; valid ; ; NV8 # 14.0 ARABIC LIGATURE SUBHAANAHU WA TAAALAA..ARABIC LIGATURE AZZA WA JALL +FE00..FE0F ; ignored # 3.2 VARIATION SELECTOR-1..VARIATION SELECTOR-16 +FE10 ; disallowed_STD3_mapped ; 002C # 4.1 PRESENTATION FORM FOR VERTICAL COMMA +FE11 ; mapped ; 3001 # 4.1 PRESENTATION FORM FOR VERTICAL IDEOGRAPHIC COMMA +FE12 ; disallowed # 4.1 PRESENTATION FORM FOR VERTICAL IDEOGRAPHIC FULL STOP +FE13 ; disallowed_STD3_mapped ; 003A # 4.1 PRESENTATION FORM FOR VERTICAL COLON +FE14 ; disallowed_STD3_mapped ; 003B # 4.1 PRESENTATION FORM FOR VERTICAL SEMICOLON +FE15 ; disallowed_STD3_mapped ; 0021 # 4.1 PRESENTATION FORM FOR VERTICAL EXCLAMATION MARK +FE16 ; disallowed_STD3_mapped ; 003F # 4.1 PRESENTATION FORM FOR VERTICAL QUESTION MARK +FE17 ; mapped ; 3016 # 4.1 PRESENTATION FORM FOR VERTICAL LEFT WHITE LENTICULAR BRACKET +FE18 ; mapped ; 3017 # 4.1 PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRAKCET +FE19 ; disallowed # 4.1 PRESENTATION FORM FOR VERTICAL HORIZONTAL ELLIPSIS +FE1A..FE1F ; disallowed # NA .. +FE20..FE23 ; valid # 1.1 COMBINING LIGATURE LEFT HALF..COMBINING DOUBLE TILDE RIGHT HALF +FE24..FE26 ; valid # 5.1 COMBINING MACRON LEFT HALF..COMBINING CONJOINING MACRON +FE27..FE2D ; valid # 7.0 COMBINING LIGATURE LEFT HALF BELOW..COMBINING CONJOINING MACRON BELOW +FE2E..FE2F ; valid # 8.0 COMBINING CYRILLIC TITLO LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF +FE30 ; disallowed # 1.1 PRESENTATION FORM FOR VERTICAL TWO DOT LEADER +FE31 ; mapped ; 2014 # 1.1 PRESENTATION FORM FOR VERTICAL EM DASH +FE32 ; mapped ; 2013 # 1.1 PRESENTATION FORM FOR VERTICAL EN DASH +FE33..FE34 ; disallowed_STD3_mapped ; 005F # 1.1 PRESENTATION FORM FOR VERTICAL LOW LINE..PRESENTATION FORM FOR VERTICAL WAVY LOW LINE +FE35 ; disallowed_STD3_mapped ; 0028 # 1.1 PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS +FE36 ; disallowed_STD3_mapped ; 0029 # 1.1 PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS +FE37 ; disallowed_STD3_mapped ; 007B # 1.1 PRESENTATION FORM FOR VERTICAL LEFT CURLY BRACKET +FE38 ; disallowed_STD3_mapped ; 007D # 1.1 PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET +FE39 ; mapped ; 3014 # 1.1 PRESENTATION FORM FOR VERTICAL LEFT TORTOISE SHELL BRACKET +FE3A ; mapped ; 3015 # 1.1 PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET +FE3B ; mapped ; 3010 # 1.1 PRESENTATION FORM FOR VERTICAL LEFT BLACK LENTICULAR BRACKET +FE3C ; mapped ; 3011 # 1.1 PRESENTATION FORM FOR VERTICAL RIGHT BLACK LENTICULAR BRACKET +FE3D ; mapped ; 300A # 1.1 PRESENTATION FORM FOR VERTICAL LEFT DOUBLE ANGLE BRACKET +FE3E ; mapped ; 300B # 1.1 PRESENTATION FORM FOR VERTICAL RIGHT DOUBLE ANGLE BRACKET +FE3F ; mapped ; 3008 # 1.1 PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET +FE40 ; mapped ; 3009 # 1.1 PRESENTATION FORM FOR VERTICAL RIGHT ANGLE BRACKET +FE41 ; mapped ; 300C # 1.1 PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET +FE42 ; mapped ; 300D # 1.1 PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET +FE43 ; mapped ; 300E # 1.1 PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET +FE44 ; mapped ; 300F # 1.1 PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET +FE45..FE46 ; valid ; ; NV8 # 3.2 SESAME DOT..WHITE SESAME DOT +FE47 ; disallowed_STD3_mapped ; 005B # 4.0 PRESENTATION FORM FOR VERTICAL LEFT SQUARE BRACKET +FE48 ; disallowed_STD3_mapped ; 005D # 4.0 PRESENTATION FORM FOR VERTICAL RIGHT SQUARE BRACKET +FE49..FE4C ; disallowed_STD3_mapped ; 0020 0305 # 1.1 DASHED OVERLINE..DOUBLE WAVY OVERLINE +FE4D..FE4F ; disallowed_STD3_mapped ; 005F # 1.1 DASHED LOW LINE..WAVY LOW LINE +FE50 ; disallowed_STD3_mapped ; 002C # 1.1 SMALL COMMA +FE51 ; mapped ; 3001 # 1.1 SMALL IDEOGRAPHIC COMMA +FE52 ; disallowed # 1.1 SMALL FULL STOP +FE53 ; disallowed # NA +FE54 ; disallowed_STD3_mapped ; 003B # 1.1 SMALL SEMICOLON +FE55 ; disallowed_STD3_mapped ; 003A # 1.1 SMALL COLON +FE56 ; disallowed_STD3_mapped ; 003F # 1.1 SMALL QUESTION MARK +FE57 ; disallowed_STD3_mapped ; 0021 # 1.1 SMALL EXCLAMATION MARK +FE58 ; mapped ; 2014 # 1.1 SMALL EM DASH +FE59 ; disallowed_STD3_mapped ; 0028 # 1.1 SMALL LEFT PARENTHESIS +FE5A ; disallowed_STD3_mapped ; 0029 # 1.1 SMALL RIGHT PARENTHESIS +FE5B ; disallowed_STD3_mapped ; 007B # 1.1 SMALL LEFT CURLY BRACKET +FE5C ; disallowed_STD3_mapped ; 007D # 1.1 SMALL RIGHT CURLY BRACKET +FE5D ; mapped ; 3014 # 1.1 SMALL LEFT TORTOISE SHELL BRACKET +FE5E ; mapped ; 3015 # 1.1 SMALL RIGHT TORTOISE SHELL BRACKET +FE5F ; disallowed_STD3_mapped ; 0023 # 1.1 SMALL NUMBER SIGN +FE60 ; disallowed_STD3_mapped ; 0026 # 1.1 SMALL AMPERSAND +FE61 ; disallowed_STD3_mapped ; 002A # 1.1 SMALL ASTERISK +FE62 ; disallowed_STD3_mapped ; 002B # 1.1 SMALL PLUS SIGN +FE63 ; mapped ; 002D # 1.1 SMALL HYPHEN-MINUS +FE64 ; disallowed_STD3_mapped ; 003C # 1.1 SMALL LESS-THAN SIGN +FE65 ; disallowed_STD3_mapped ; 003E # 1.1 SMALL GREATER-THAN SIGN +FE66 ; disallowed_STD3_mapped ; 003D # 1.1 SMALL EQUALS SIGN +FE67 ; disallowed # NA +FE68 ; disallowed_STD3_mapped ; 005C # 1.1 SMALL REVERSE SOLIDUS +FE69 ; disallowed_STD3_mapped ; 0024 # 1.1 SMALL DOLLAR SIGN +FE6A ; disallowed_STD3_mapped ; 0025 # 1.1 SMALL PERCENT SIGN +FE6B ; disallowed_STD3_mapped ; 0040 # 1.1 SMALL COMMERCIAL AT +FE6C..FE6F ; disallowed # NA .. +FE70 ; disallowed_STD3_mapped ; 0020 064B # 1.1 ARABIC FATHATAN ISOLATED FORM +FE71 ; mapped ; 0640 064B # 1.1 ARABIC TATWEEL WITH FATHATAN ABOVE +FE72 ; disallowed_STD3_mapped ; 0020 064C # 1.1 ARABIC DAMMATAN ISOLATED FORM +FE73 ; valid # 3.2 ARABIC TAIL FRAGMENT +FE74 ; disallowed_STD3_mapped ; 0020 064D # 1.1 ARABIC KASRATAN ISOLATED FORM +FE75 ; disallowed # NA +FE76 ; disallowed_STD3_mapped ; 0020 064E # 1.1 ARABIC FATHA ISOLATED FORM +FE77 ; mapped ; 0640 064E # 1.1 ARABIC FATHA MEDIAL FORM +FE78 ; disallowed_STD3_mapped ; 0020 064F # 1.1 ARABIC DAMMA ISOLATED FORM +FE79 ; mapped ; 0640 064F # 1.1 ARABIC DAMMA MEDIAL FORM +FE7A ; disallowed_STD3_mapped ; 0020 0650 # 1.1 ARABIC KASRA ISOLATED FORM +FE7B ; mapped ; 0640 0650 # 1.1 ARABIC KASRA MEDIAL FORM +FE7C ; disallowed_STD3_mapped ; 0020 0651 # 1.1 ARABIC SHADDA ISOLATED FORM +FE7D ; mapped ; 0640 0651 # 1.1 ARABIC SHADDA MEDIAL FORM +FE7E ; disallowed_STD3_mapped ; 0020 0652 # 1.1 ARABIC SUKUN ISOLATED FORM +FE7F ; mapped ; 0640 0652 # 1.1 ARABIC SUKUN MEDIAL FORM +FE80 ; mapped ; 0621 # 1.1 ARABIC LETTER HAMZA ISOLATED FORM +FE81..FE82 ; mapped ; 0622 # 1.1 ARABIC LETTER ALEF WITH MADDA ABOVE ISOLATED FORM..ARABIC LETTER ALEF WITH MADDA ABOVE FINAL FORM +FE83..FE84 ; mapped ; 0623 # 1.1 ARABIC LETTER ALEF WITH HAMZA ABOVE ISOLATED FORM..ARABIC LETTER ALEF WITH HAMZA ABOVE FINAL FORM +FE85..FE86 ; mapped ; 0624 # 1.1 ARABIC LETTER WAW WITH HAMZA ABOVE ISOLATED FORM..ARABIC LETTER WAW WITH HAMZA ABOVE FINAL FORM +FE87..FE88 ; mapped ; 0625 # 1.1 ARABIC LETTER ALEF WITH HAMZA BELOW ISOLATED FORM..ARABIC LETTER ALEF WITH HAMZA BELOW FINAL FORM +FE89..FE8C ; mapped ; 0626 # 1.1 ARABIC LETTER YEH WITH HAMZA ABOVE ISOLATED FORM..ARABIC LETTER YEH WITH HAMZA ABOVE MEDIAL FORM +FE8D..FE8E ; mapped ; 0627 # 1.1 ARABIC LETTER ALEF ISOLATED FORM..ARABIC LETTER ALEF FINAL FORM +FE8F..FE92 ; mapped ; 0628 # 1.1 ARABIC LETTER BEH ISOLATED FORM..ARABIC LETTER BEH MEDIAL FORM +FE93..FE94 ; mapped ; 0629 # 1.1 ARABIC LETTER TEH MARBUTA ISOLATED FORM..ARABIC LETTER TEH MARBUTA FINAL FORM +FE95..FE98 ; mapped ; 062A # 1.1 ARABIC LETTER TEH ISOLATED FORM..ARABIC LETTER TEH MEDIAL FORM +FE99..FE9C ; mapped ; 062B # 1.1 ARABIC LETTER THEH ISOLATED FORM..ARABIC LETTER THEH MEDIAL FORM +FE9D..FEA0 ; mapped ; 062C # 1.1 ARABIC LETTER JEEM ISOLATED FORM..ARABIC LETTER JEEM MEDIAL FORM +FEA1..FEA4 ; mapped ; 062D # 1.1 ARABIC LETTER HAH ISOLATED FORM..ARABIC LETTER HAH MEDIAL FORM +FEA5..FEA8 ; mapped ; 062E # 1.1 ARABIC LETTER KHAH ISOLATED FORM..ARABIC LETTER KHAH MEDIAL FORM +FEA9..FEAA ; mapped ; 062F # 1.1 ARABIC LETTER DAL ISOLATED FORM..ARABIC LETTER DAL FINAL FORM +FEAB..FEAC ; mapped ; 0630 # 1.1 ARABIC LETTER THAL ISOLATED FORM..ARABIC LETTER THAL FINAL FORM +FEAD..FEAE ; mapped ; 0631 # 1.1 ARABIC LETTER REH ISOLATED FORM..ARABIC LETTER REH FINAL FORM +FEAF..FEB0 ; mapped ; 0632 # 1.1 ARABIC LETTER ZAIN ISOLATED FORM..ARABIC LETTER ZAIN FINAL FORM +FEB1..FEB4 ; mapped ; 0633 # 1.1 ARABIC LETTER SEEN ISOLATED FORM..ARABIC LETTER SEEN MEDIAL FORM +FEB5..FEB8 ; mapped ; 0634 # 1.1 ARABIC LETTER SHEEN ISOLATED FORM..ARABIC LETTER SHEEN MEDIAL FORM +FEB9..FEBC ; mapped ; 0635 # 1.1 ARABIC LETTER SAD ISOLATED FORM..ARABIC LETTER SAD MEDIAL FORM +FEBD..FEC0 ; mapped ; 0636 # 1.1 ARABIC LETTER DAD ISOLATED FORM..ARABIC LETTER DAD MEDIAL FORM +FEC1..FEC4 ; mapped ; 0637 # 1.1 ARABIC LETTER TAH ISOLATED FORM..ARABIC LETTER TAH MEDIAL FORM +FEC5..FEC8 ; mapped ; 0638 # 1.1 ARABIC LETTER ZAH ISOLATED FORM..ARABIC LETTER ZAH MEDIAL FORM +FEC9..FECC ; mapped ; 0639 # 1.1 ARABIC LETTER AIN ISOLATED FORM..ARABIC LETTER AIN MEDIAL FORM +FECD..FED0 ; mapped ; 063A # 1.1 ARABIC LETTER GHAIN ISOLATED FORM..ARABIC LETTER GHAIN MEDIAL FORM +FED1..FED4 ; mapped ; 0641 # 1.1 ARABIC LETTER FEH ISOLATED FORM..ARABIC LETTER FEH MEDIAL FORM +FED5..FED8 ; mapped ; 0642 # 1.1 ARABIC LETTER QAF ISOLATED FORM..ARABIC LETTER QAF MEDIAL FORM +FED9..FEDC ; mapped ; 0643 # 1.1 ARABIC LETTER KAF ISOLATED FORM..ARABIC LETTER KAF MEDIAL FORM +FEDD..FEE0 ; mapped ; 0644 # 1.1 ARABIC LETTER LAM ISOLATED FORM..ARABIC LETTER LAM MEDIAL FORM +FEE1..FEE4 ; mapped ; 0645 # 1.1 ARABIC LETTER MEEM ISOLATED FORM..ARABIC LETTER MEEM MEDIAL FORM +FEE5..FEE8 ; mapped ; 0646 # 1.1 ARABIC LETTER NOON ISOLATED FORM..ARABIC LETTER NOON MEDIAL FORM +FEE9..FEEC ; mapped ; 0647 # 1.1 ARABIC LETTER HEH ISOLATED FORM..ARABIC LETTER HEH MEDIAL FORM +FEED..FEEE ; mapped ; 0648 # 1.1 ARABIC LETTER WAW ISOLATED FORM..ARABIC LETTER WAW FINAL FORM +FEEF..FEF0 ; mapped ; 0649 # 1.1 ARABIC LETTER ALEF MAKSURA ISOLATED FORM..ARABIC LETTER ALEF MAKSURA FINAL FORM +FEF1..FEF4 ; mapped ; 064A # 1.1 ARABIC LETTER YEH ISOLATED FORM..ARABIC LETTER YEH MEDIAL FORM +FEF5..FEF6 ; mapped ; 0644 0622 # 1.1 ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM..ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM +FEF7..FEF8 ; mapped ; 0644 0623 # 1.1 ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM..ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM +FEF9..FEFA ; mapped ; 0644 0625 # 1.1 ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM..ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM +FEFB..FEFC ; mapped ; 0644 0627 # 1.1 ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM..ARABIC LIGATURE LAM WITH ALEF FINAL FORM +FEFD..FEFE ; disallowed # NA .. +FEFF ; ignored # 1.1 ZERO WIDTH NO-BREAK SPACE +FF00 ; disallowed # NA +FF01 ; disallowed_STD3_mapped ; 0021 # 1.1 FULLWIDTH EXCLAMATION MARK +FF02 ; disallowed_STD3_mapped ; 0022 # 1.1 FULLWIDTH QUOTATION MARK +FF03 ; disallowed_STD3_mapped ; 0023 # 1.1 FULLWIDTH NUMBER SIGN +FF04 ; disallowed_STD3_mapped ; 0024 # 1.1 FULLWIDTH DOLLAR SIGN +FF05 ; disallowed_STD3_mapped ; 0025 # 1.1 FULLWIDTH PERCENT SIGN +FF06 ; disallowed_STD3_mapped ; 0026 # 1.1 FULLWIDTH AMPERSAND +FF07 ; disallowed_STD3_mapped ; 0027 # 1.1 FULLWIDTH APOSTROPHE +FF08 ; disallowed_STD3_mapped ; 0028 # 1.1 FULLWIDTH LEFT PARENTHESIS +FF09 ; disallowed_STD3_mapped ; 0029 # 1.1 FULLWIDTH RIGHT PARENTHESIS +FF0A ; disallowed_STD3_mapped ; 002A # 1.1 FULLWIDTH ASTERISK +FF0B ; disallowed_STD3_mapped ; 002B # 1.1 FULLWIDTH PLUS SIGN +FF0C ; disallowed_STD3_mapped ; 002C # 1.1 FULLWIDTH COMMA +FF0D ; mapped ; 002D # 1.1 FULLWIDTH HYPHEN-MINUS +FF0E ; mapped ; 002E # 1.1 FULLWIDTH FULL STOP +FF0F ; disallowed_STD3_mapped ; 002F # 1.1 FULLWIDTH SOLIDUS +FF10 ; mapped ; 0030 # 1.1 FULLWIDTH DIGIT ZERO +FF11 ; mapped ; 0031 # 1.1 FULLWIDTH DIGIT ONE +FF12 ; mapped ; 0032 # 1.1 FULLWIDTH DIGIT TWO +FF13 ; mapped ; 0033 # 1.1 FULLWIDTH DIGIT THREE +FF14 ; mapped ; 0034 # 1.1 FULLWIDTH DIGIT FOUR +FF15 ; mapped ; 0035 # 1.1 FULLWIDTH DIGIT FIVE +FF16 ; mapped ; 0036 # 1.1 FULLWIDTH DIGIT SIX +FF17 ; mapped ; 0037 # 1.1 FULLWIDTH DIGIT SEVEN +FF18 ; mapped ; 0038 # 1.1 FULLWIDTH DIGIT EIGHT +FF19 ; mapped ; 0039 # 1.1 FULLWIDTH DIGIT NINE +FF1A ; disallowed_STD3_mapped ; 003A # 1.1 FULLWIDTH COLON +FF1B ; disallowed_STD3_mapped ; 003B # 1.1 FULLWIDTH SEMICOLON +FF1C ; disallowed_STD3_mapped ; 003C # 1.1 FULLWIDTH LESS-THAN SIGN +FF1D ; disallowed_STD3_mapped ; 003D # 1.1 FULLWIDTH EQUALS SIGN +FF1E ; disallowed_STD3_mapped ; 003E # 1.1 FULLWIDTH GREATER-THAN SIGN +FF1F ; disallowed_STD3_mapped ; 003F # 1.1 FULLWIDTH QUESTION MARK +FF20 ; disallowed_STD3_mapped ; 0040 # 1.1 FULLWIDTH COMMERCIAL AT +FF21 ; mapped ; 0061 # 1.1 FULLWIDTH LATIN CAPITAL LETTER A +FF22 ; mapped ; 0062 # 1.1 FULLWIDTH LATIN CAPITAL LETTER B +FF23 ; mapped ; 0063 # 1.1 FULLWIDTH LATIN CAPITAL LETTER C +FF24 ; mapped ; 0064 # 1.1 FULLWIDTH LATIN CAPITAL LETTER D +FF25 ; mapped ; 0065 # 1.1 FULLWIDTH LATIN CAPITAL LETTER E +FF26 ; mapped ; 0066 # 1.1 FULLWIDTH LATIN CAPITAL LETTER F +FF27 ; mapped ; 0067 # 1.1 FULLWIDTH LATIN CAPITAL LETTER G +FF28 ; mapped ; 0068 # 1.1 FULLWIDTH LATIN CAPITAL LETTER H +FF29 ; mapped ; 0069 # 1.1 FULLWIDTH LATIN CAPITAL LETTER I +FF2A ; mapped ; 006A # 1.1 FULLWIDTH LATIN CAPITAL LETTER J +FF2B ; mapped ; 006B # 1.1 FULLWIDTH LATIN CAPITAL LETTER K +FF2C ; mapped ; 006C # 1.1 FULLWIDTH LATIN CAPITAL LETTER L +FF2D ; mapped ; 006D # 1.1 FULLWIDTH LATIN CAPITAL LETTER M +FF2E ; mapped ; 006E # 1.1 FULLWIDTH LATIN CAPITAL LETTER N +FF2F ; mapped ; 006F # 1.1 FULLWIDTH LATIN CAPITAL LETTER O +FF30 ; mapped ; 0070 # 1.1 FULLWIDTH LATIN CAPITAL LETTER P +FF31 ; mapped ; 0071 # 1.1 FULLWIDTH LATIN CAPITAL LETTER Q +FF32 ; mapped ; 0072 # 1.1 FULLWIDTH LATIN CAPITAL LETTER R +FF33 ; mapped ; 0073 # 1.1 FULLWIDTH LATIN CAPITAL LETTER S +FF34 ; mapped ; 0074 # 1.1 FULLWIDTH LATIN CAPITAL LETTER T +FF35 ; mapped ; 0075 # 1.1 FULLWIDTH LATIN CAPITAL LETTER U +FF36 ; mapped ; 0076 # 1.1 FULLWIDTH LATIN CAPITAL LETTER V +FF37 ; mapped ; 0077 # 1.1 FULLWIDTH LATIN CAPITAL LETTER W +FF38 ; mapped ; 0078 # 1.1 FULLWIDTH LATIN CAPITAL LETTER X +FF39 ; mapped ; 0079 # 1.1 FULLWIDTH LATIN CAPITAL LETTER Y +FF3A ; mapped ; 007A # 1.1 FULLWIDTH LATIN CAPITAL LETTER Z +FF3B ; disallowed_STD3_mapped ; 005B # 1.1 FULLWIDTH LEFT SQUARE BRACKET +FF3C ; disallowed_STD3_mapped ; 005C # 1.1 FULLWIDTH REVERSE SOLIDUS +FF3D ; disallowed_STD3_mapped ; 005D # 1.1 FULLWIDTH RIGHT SQUARE BRACKET +FF3E ; disallowed_STD3_mapped ; 005E # 1.1 FULLWIDTH CIRCUMFLEX ACCENT +FF3F ; disallowed_STD3_mapped ; 005F # 1.1 FULLWIDTH LOW LINE +FF40 ; disallowed_STD3_mapped ; 0060 # 1.1 FULLWIDTH GRAVE ACCENT +FF41 ; mapped ; 0061 # 1.1 FULLWIDTH LATIN SMALL LETTER A +FF42 ; mapped ; 0062 # 1.1 FULLWIDTH LATIN SMALL LETTER B +FF43 ; mapped ; 0063 # 1.1 FULLWIDTH LATIN SMALL LETTER C +FF44 ; mapped ; 0064 # 1.1 FULLWIDTH LATIN SMALL LETTER D +FF45 ; mapped ; 0065 # 1.1 FULLWIDTH LATIN SMALL LETTER E +FF46 ; mapped ; 0066 # 1.1 FULLWIDTH LATIN SMALL LETTER F +FF47 ; mapped ; 0067 # 1.1 FULLWIDTH LATIN SMALL LETTER G +FF48 ; mapped ; 0068 # 1.1 FULLWIDTH LATIN SMALL LETTER H +FF49 ; mapped ; 0069 # 1.1 FULLWIDTH LATIN SMALL LETTER I +FF4A ; mapped ; 006A # 1.1 FULLWIDTH LATIN SMALL LETTER J +FF4B ; mapped ; 006B # 1.1 FULLWIDTH LATIN SMALL LETTER K +FF4C ; mapped ; 006C # 1.1 FULLWIDTH LATIN SMALL LETTER L +FF4D ; mapped ; 006D # 1.1 FULLWIDTH LATIN SMALL LETTER M +FF4E ; mapped ; 006E # 1.1 FULLWIDTH LATIN SMALL LETTER N +FF4F ; mapped ; 006F # 1.1 FULLWIDTH LATIN SMALL LETTER O +FF50 ; mapped ; 0070 # 1.1 FULLWIDTH LATIN SMALL LETTER P +FF51 ; mapped ; 0071 # 1.1 FULLWIDTH LATIN SMALL LETTER Q +FF52 ; mapped ; 0072 # 1.1 FULLWIDTH LATIN SMALL LETTER R +FF53 ; mapped ; 0073 # 1.1 FULLWIDTH LATIN SMALL LETTER S +FF54 ; mapped ; 0074 # 1.1 FULLWIDTH LATIN SMALL LETTER T +FF55 ; mapped ; 0075 # 1.1 FULLWIDTH LATIN SMALL LETTER U +FF56 ; mapped ; 0076 # 1.1 FULLWIDTH LATIN SMALL LETTER V +FF57 ; mapped ; 0077 # 1.1 FULLWIDTH LATIN SMALL LETTER W +FF58 ; mapped ; 0078 # 1.1 FULLWIDTH LATIN SMALL LETTER X +FF59 ; mapped ; 0079 # 1.1 FULLWIDTH LATIN SMALL LETTER Y +FF5A ; mapped ; 007A # 1.1 FULLWIDTH LATIN SMALL LETTER Z +FF5B ; disallowed_STD3_mapped ; 007B # 1.1 FULLWIDTH LEFT CURLY BRACKET +FF5C ; disallowed_STD3_mapped ; 007C # 1.1 FULLWIDTH VERTICAL LINE +FF5D ; disallowed_STD3_mapped ; 007D # 1.1 FULLWIDTH RIGHT CURLY BRACKET +FF5E ; disallowed_STD3_mapped ; 007E # 1.1 FULLWIDTH TILDE +FF5F ; mapped ; 2985 # 3.2 FULLWIDTH LEFT WHITE PARENTHESIS +FF60 ; mapped ; 2986 # 3.2 FULLWIDTH RIGHT WHITE PARENTHESIS +FF61 ; mapped ; 002E # 1.1 HALFWIDTH IDEOGRAPHIC FULL STOP +FF62 ; mapped ; 300C # 1.1 HALFWIDTH LEFT CORNER BRACKET +FF63 ; mapped ; 300D # 1.1 HALFWIDTH RIGHT CORNER BRACKET +FF64 ; mapped ; 3001 # 1.1 HALFWIDTH IDEOGRAPHIC COMMA +FF65 ; mapped ; 30FB # 1.1 HALFWIDTH KATAKANA MIDDLE DOT +FF66 ; mapped ; 30F2 # 1.1 HALFWIDTH KATAKANA LETTER WO +FF67 ; mapped ; 30A1 # 1.1 HALFWIDTH KATAKANA LETTER SMALL A +FF68 ; mapped ; 30A3 # 1.1 HALFWIDTH KATAKANA LETTER SMALL I +FF69 ; mapped ; 30A5 # 1.1 HALFWIDTH KATAKANA LETTER SMALL U +FF6A ; mapped ; 30A7 # 1.1 HALFWIDTH KATAKANA LETTER SMALL E +FF6B ; mapped ; 30A9 # 1.1 HALFWIDTH KATAKANA LETTER SMALL O +FF6C ; mapped ; 30E3 # 1.1 HALFWIDTH KATAKANA LETTER SMALL YA +FF6D ; mapped ; 30E5 # 1.1 HALFWIDTH KATAKANA LETTER SMALL YU +FF6E ; mapped ; 30E7 # 1.1 HALFWIDTH KATAKANA LETTER SMALL YO +FF6F ; mapped ; 30C3 # 1.1 HALFWIDTH KATAKANA LETTER SMALL TU +FF70 ; mapped ; 30FC # 1.1 HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK +FF71 ; mapped ; 30A2 # 1.1 HALFWIDTH KATAKANA LETTER A +FF72 ; mapped ; 30A4 # 1.1 HALFWIDTH KATAKANA LETTER I +FF73 ; mapped ; 30A6 # 1.1 HALFWIDTH KATAKANA LETTER U +FF74 ; mapped ; 30A8 # 1.1 HALFWIDTH KATAKANA LETTER E +FF75 ; mapped ; 30AA # 1.1 HALFWIDTH KATAKANA LETTER O +FF76 ; mapped ; 30AB # 1.1 HALFWIDTH KATAKANA LETTER KA +FF77 ; mapped ; 30AD # 1.1 HALFWIDTH KATAKANA LETTER KI +FF78 ; mapped ; 30AF # 1.1 HALFWIDTH KATAKANA LETTER KU +FF79 ; mapped ; 30B1 # 1.1 HALFWIDTH KATAKANA LETTER KE +FF7A ; mapped ; 30B3 # 1.1 HALFWIDTH KATAKANA LETTER KO +FF7B ; mapped ; 30B5 # 1.1 HALFWIDTH KATAKANA LETTER SA +FF7C ; mapped ; 30B7 # 1.1 HALFWIDTH KATAKANA LETTER SI +FF7D ; mapped ; 30B9 # 1.1 HALFWIDTH KATAKANA LETTER SU +FF7E ; mapped ; 30BB # 1.1 HALFWIDTH KATAKANA LETTER SE +FF7F ; mapped ; 30BD # 1.1 HALFWIDTH KATAKANA LETTER SO +FF80 ; mapped ; 30BF # 1.1 HALFWIDTH KATAKANA LETTER TA +FF81 ; mapped ; 30C1 # 1.1 HALFWIDTH KATAKANA LETTER TI +FF82 ; mapped ; 30C4 # 1.1 HALFWIDTH KATAKANA LETTER TU +FF83 ; mapped ; 30C6 # 1.1 HALFWIDTH KATAKANA LETTER TE +FF84 ; mapped ; 30C8 # 1.1 HALFWIDTH KATAKANA LETTER TO +FF85 ; mapped ; 30CA # 1.1 HALFWIDTH KATAKANA LETTER NA +FF86 ; mapped ; 30CB # 1.1 HALFWIDTH KATAKANA LETTER NI +FF87 ; mapped ; 30CC # 1.1 HALFWIDTH KATAKANA LETTER NU +FF88 ; mapped ; 30CD # 1.1 HALFWIDTH KATAKANA LETTER NE +FF89 ; mapped ; 30CE # 1.1 HALFWIDTH KATAKANA LETTER NO +FF8A ; mapped ; 30CF # 1.1 HALFWIDTH KATAKANA LETTER HA +FF8B ; mapped ; 30D2 # 1.1 HALFWIDTH KATAKANA LETTER HI +FF8C ; mapped ; 30D5 # 1.1 HALFWIDTH KATAKANA LETTER HU +FF8D ; mapped ; 30D8 # 1.1 HALFWIDTH KATAKANA LETTER HE +FF8E ; mapped ; 30DB # 1.1 HALFWIDTH KATAKANA LETTER HO +FF8F ; mapped ; 30DE # 1.1 HALFWIDTH KATAKANA LETTER MA +FF90 ; mapped ; 30DF # 1.1 HALFWIDTH KATAKANA LETTER MI +FF91 ; mapped ; 30E0 # 1.1 HALFWIDTH KATAKANA LETTER MU +FF92 ; mapped ; 30E1 # 1.1 HALFWIDTH KATAKANA LETTER ME +FF93 ; mapped ; 30E2 # 1.1 HALFWIDTH KATAKANA LETTER MO +FF94 ; mapped ; 30E4 # 1.1 HALFWIDTH KATAKANA LETTER YA +FF95 ; mapped ; 30E6 # 1.1 HALFWIDTH KATAKANA LETTER YU +FF96 ; mapped ; 30E8 # 1.1 HALFWIDTH KATAKANA LETTER YO +FF97 ; mapped ; 30E9 # 1.1 HALFWIDTH KATAKANA LETTER RA +FF98 ; mapped ; 30EA # 1.1 HALFWIDTH KATAKANA LETTER RI +FF99 ; mapped ; 30EB # 1.1 HALFWIDTH KATAKANA LETTER RU +FF9A ; mapped ; 30EC # 1.1 HALFWIDTH KATAKANA LETTER RE +FF9B ; mapped ; 30ED # 1.1 HALFWIDTH KATAKANA LETTER RO +FF9C ; mapped ; 30EF # 1.1 HALFWIDTH KATAKANA LETTER WA +FF9D ; mapped ; 30F3 # 1.1 HALFWIDTH KATAKANA LETTER N +FF9E ; mapped ; 3099 # 1.1 HALFWIDTH KATAKANA VOICED SOUND MARK +FF9F ; mapped ; 309A # 1.1 HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK +FFA0 ; disallowed # 1.1 HALFWIDTH HANGUL FILLER +FFA1 ; mapped ; 1100 # 1.1 HALFWIDTH HANGUL LETTER KIYEOK +FFA2 ; mapped ; 1101 # 1.1 HALFWIDTH HANGUL LETTER SSANGKIYEOK +FFA3 ; mapped ; 11AA # 1.1 HALFWIDTH HANGUL LETTER KIYEOK-SIOS +FFA4 ; mapped ; 1102 # 1.1 HALFWIDTH HANGUL LETTER NIEUN +FFA5 ; mapped ; 11AC # 1.1 HALFWIDTH HANGUL LETTER NIEUN-CIEUC +FFA6 ; mapped ; 11AD # 1.1 HALFWIDTH HANGUL LETTER NIEUN-HIEUH +FFA7 ; mapped ; 1103 # 1.1 HALFWIDTH HANGUL LETTER TIKEUT +FFA8 ; mapped ; 1104 # 1.1 HALFWIDTH HANGUL LETTER SSANGTIKEUT +FFA9 ; mapped ; 1105 # 1.1 HALFWIDTH HANGUL LETTER RIEUL +FFAA ; mapped ; 11B0 # 1.1 HALFWIDTH HANGUL LETTER RIEUL-KIYEOK +FFAB ; mapped ; 11B1 # 1.1 HALFWIDTH HANGUL LETTER RIEUL-MIEUM +FFAC ; mapped ; 11B2 # 1.1 HALFWIDTH HANGUL LETTER RIEUL-PIEUP +FFAD ; mapped ; 11B3 # 1.1 HALFWIDTH HANGUL LETTER RIEUL-SIOS +FFAE ; mapped ; 11B4 # 1.1 HALFWIDTH HANGUL LETTER RIEUL-THIEUTH +FFAF ; mapped ; 11B5 # 1.1 HALFWIDTH HANGUL LETTER RIEUL-PHIEUPH +FFB0 ; mapped ; 111A # 1.1 HALFWIDTH HANGUL LETTER RIEUL-HIEUH +FFB1 ; mapped ; 1106 # 1.1 HALFWIDTH HANGUL LETTER MIEUM +FFB2 ; mapped ; 1107 # 1.1 HALFWIDTH HANGUL LETTER PIEUP +FFB3 ; mapped ; 1108 # 1.1 HALFWIDTH HANGUL LETTER SSANGPIEUP +FFB4 ; mapped ; 1121 # 1.1 HALFWIDTH HANGUL LETTER PIEUP-SIOS +FFB5 ; mapped ; 1109 # 1.1 HALFWIDTH HANGUL LETTER SIOS +FFB6 ; mapped ; 110A # 1.1 HALFWIDTH HANGUL LETTER SSANGSIOS +FFB7 ; mapped ; 110B # 1.1 HALFWIDTH HANGUL LETTER IEUNG +FFB8 ; mapped ; 110C # 1.1 HALFWIDTH HANGUL LETTER CIEUC +FFB9 ; mapped ; 110D # 1.1 HALFWIDTH HANGUL LETTER SSANGCIEUC +FFBA ; mapped ; 110E # 1.1 HALFWIDTH HANGUL LETTER CHIEUCH +FFBB ; mapped ; 110F # 1.1 HALFWIDTH HANGUL LETTER KHIEUKH +FFBC ; mapped ; 1110 # 1.1 HALFWIDTH HANGUL LETTER THIEUTH +FFBD ; mapped ; 1111 # 1.1 HALFWIDTH HANGUL LETTER PHIEUPH +FFBE ; mapped ; 1112 # 1.1 HALFWIDTH HANGUL LETTER HIEUH +FFBF..FFC1 ; disallowed # NA .. +FFC2 ; mapped ; 1161 # 1.1 HALFWIDTH HANGUL LETTER A +FFC3 ; mapped ; 1162 # 1.1 HALFWIDTH HANGUL LETTER AE +FFC4 ; mapped ; 1163 # 1.1 HALFWIDTH HANGUL LETTER YA +FFC5 ; mapped ; 1164 # 1.1 HALFWIDTH HANGUL LETTER YAE +FFC6 ; mapped ; 1165 # 1.1 HALFWIDTH HANGUL LETTER EO +FFC7 ; mapped ; 1166 # 1.1 HALFWIDTH HANGUL LETTER E +FFC8..FFC9 ; disallowed # NA .. +FFCA ; mapped ; 1167 # 1.1 HALFWIDTH HANGUL LETTER YEO +FFCB ; mapped ; 1168 # 1.1 HALFWIDTH HANGUL LETTER YE +FFCC ; mapped ; 1169 # 1.1 HALFWIDTH HANGUL LETTER O +FFCD ; mapped ; 116A # 1.1 HALFWIDTH HANGUL LETTER WA +FFCE ; mapped ; 116B # 1.1 HALFWIDTH HANGUL LETTER WAE +FFCF ; mapped ; 116C # 1.1 HALFWIDTH HANGUL LETTER OE +FFD0..FFD1 ; disallowed # NA .. +FFD2 ; mapped ; 116D # 1.1 HALFWIDTH HANGUL LETTER YO +FFD3 ; mapped ; 116E # 1.1 HALFWIDTH HANGUL LETTER U +FFD4 ; mapped ; 116F # 1.1 HALFWIDTH HANGUL LETTER WEO +FFD5 ; mapped ; 1170 # 1.1 HALFWIDTH HANGUL LETTER WE +FFD6 ; mapped ; 1171 # 1.1 HALFWIDTH HANGUL LETTER WI +FFD7 ; mapped ; 1172 # 1.1 HALFWIDTH HANGUL LETTER YU +FFD8..FFD9 ; disallowed # NA .. +FFDA ; mapped ; 1173 # 1.1 HALFWIDTH HANGUL LETTER EU +FFDB ; mapped ; 1174 # 1.1 HALFWIDTH HANGUL LETTER YI +FFDC ; mapped ; 1175 # 1.1 HALFWIDTH HANGUL LETTER I +FFDD..FFDF ; disallowed # NA .. +FFE0 ; mapped ; 00A2 # 1.1 FULLWIDTH CENT SIGN +FFE1 ; mapped ; 00A3 # 1.1 FULLWIDTH POUND SIGN +FFE2 ; mapped ; 00AC # 1.1 FULLWIDTH NOT SIGN +FFE3 ; disallowed_STD3_mapped ; 0020 0304 # 1.1 FULLWIDTH MACRON +FFE4 ; mapped ; 00A6 # 1.1 FULLWIDTH BROKEN BAR +FFE5 ; mapped ; 00A5 # 1.1 FULLWIDTH YEN SIGN +FFE6 ; mapped ; 20A9 # 1.1 FULLWIDTH WON SIGN +FFE7 ; disallowed # NA +FFE8 ; mapped ; 2502 # 1.1 HALFWIDTH FORMS LIGHT VERTICAL +FFE9 ; mapped ; 2190 # 1.1 HALFWIDTH LEFTWARDS ARROW +FFEA ; mapped ; 2191 # 1.1 HALFWIDTH UPWARDS ARROW +FFEB ; mapped ; 2192 # 1.1 HALFWIDTH RIGHTWARDS ARROW +FFEC ; mapped ; 2193 # 1.1 HALFWIDTH DOWNWARDS ARROW +FFED ; mapped ; 25A0 # 1.1 HALFWIDTH BLACK SQUARE +FFEE ; mapped ; 25CB # 1.1 HALFWIDTH WHITE CIRCLE +FFEF..FFF8 ; disallowed # NA .. +FFF9..FFFB ; disallowed # 3.0 INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR +FFFC ; disallowed # 2.1 OBJECT REPLACEMENT CHARACTER +FFFD ; disallowed # 1.1 REPLACEMENT CHARACTER +FFFE..FFFF ; disallowed # 1.1 .. +10000..1000B ; valid # 4.0 LINEAR B SYLLABLE B008 A..LINEAR B SYLLABLE B046 JE +1000C ; disallowed # NA +1000D..10026 ; valid # 4.0 LINEAR B SYLLABLE B036 JO..LINEAR B SYLLABLE B032 QO +10027 ; disallowed # NA +10028..1003A ; valid # 4.0 LINEAR B SYLLABLE B060 RA..LINEAR B SYLLABLE B042 WO +1003B ; disallowed # NA +1003C..1003D ; valid # 4.0 LINEAR B SYLLABLE B017 ZA..LINEAR B SYLLABLE B074 ZE +1003E ; disallowed # NA +1003F..1004D ; valid # 4.0 LINEAR B SYLLABLE B020 ZO..LINEAR B SYLLABLE B091 TWO +1004E..1004F ; disallowed # NA .. +10050..1005D ; valid # 4.0 LINEAR B SYMBOL B018..LINEAR B SYMBOL B089 +1005E..1007F ; disallowed # NA .. +10080..100FA ; valid # 4.0 LINEAR B IDEOGRAM B100 MAN..LINEAR B IDEOGRAM VESSEL B305 +100FB..100FF ; disallowed # NA .. +10100..10102 ; valid ; ; NV8 # 4.0 AEGEAN WORD SEPARATOR LINE..AEGEAN CHECK MARK +10103..10106 ; disallowed # NA .. +10107..10133 ; valid ; ; NV8 # 4.0 AEGEAN NUMBER ONE..AEGEAN NUMBER NINETY THOUSAND +10134..10136 ; disallowed # NA .. +10137..1013F ; valid ; ; NV8 # 4.0 AEGEAN WEIGHT BASE UNIT..AEGEAN MEASURE THIRD SUBUNIT +10140..1018A ; valid ; ; NV8 # 4.1 GREEK ACROPHONIC ATTIC ONE QUARTER..GREEK ZERO SIGN +1018B..1018C ; valid ; ; NV8 # 7.0 GREEK ONE QUARTER SIGN..GREEK SINUSOID SIGN +1018D..1018E ; valid ; ; NV8 # 9.0 GREEK INDICTION SIGN..NOMISMA SIGN +1018F ; disallowed # NA +10190..1019B ; valid ; ; NV8 # 5.1 ROMAN SEXTANS SIGN..ROMAN CENTURIAL SIGN +1019C ; valid ; ; NV8 # 13.0 ASCIA SYMBOL +1019D..1019F ; disallowed # NA .. +101A0 ; valid ; ; NV8 # 7.0 GREEK SYMBOL TAU RHO +101A1..101CF ; disallowed # NA .. +101D0..101FC ; valid ; ; NV8 # 5.1 PHAISTOS DISC SIGN PEDESTRIAN..PHAISTOS DISC SIGN WAVY BAND +101FD ; valid # 5.1 PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE +101FE..1027F ; disallowed # NA .. +10280..1029C ; valid # 5.1 LYCIAN LETTER A..LYCIAN LETTER X +1029D..1029F ; disallowed # NA .. +102A0..102D0 ; valid # 5.1 CARIAN LETTER A..CARIAN LETTER UUU3 +102D1..102DF ; disallowed # NA .. +102E0 ; valid # 7.0 COPTIC EPACT THOUSANDS MARK +102E1..102FB ; valid ; ; NV8 # 7.0 COPTIC EPACT DIGIT ONE..COPTIC EPACT NUMBER NINE HUNDRED +102FC..102FF ; disallowed # NA .. +10300..1031E ; valid # 3.1 OLD ITALIC LETTER A..OLD ITALIC LETTER UU +1031F ; valid # 7.0 OLD ITALIC LETTER ESS +10320..10323 ; valid ; ; NV8 # 3.1 OLD ITALIC NUMERAL ONE..OLD ITALIC NUMERAL FIFTY +10324..1032C ; disallowed # NA .. +1032D..1032F ; valid # 10.0 OLD ITALIC LETTER YE..OLD ITALIC LETTER SOUTHERN TSE +10330..10340 ; valid # 3.1 GOTHIC LETTER AHSA..GOTHIC LETTER PAIRTHRA +10341 ; valid ; ; NV8 # 3.1 GOTHIC LETTER NINETY +10342..10349 ; valid # 3.1 GOTHIC LETTER RAIDA..GOTHIC LETTER OTHAL +1034A ; valid ; ; NV8 # 3.1 GOTHIC LETTER NINE HUNDRED +1034B..1034F ; disallowed # NA .. +10350..1037A ; valid # 7.0 OLD PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII +1037B..1037F ; disallowed # NA .. +10380..1039D ; valid # 4.0 UGARITIC LETTER ALPA..UGARITIC LETTER SSU +1039E ; disallowed # NA +1039F ; valid ; ; NV8 # 4.0 UGARITIC WORD DIVIDER +103A0..103C3 ; valid # 4.1 OLD PERSIAN SIGN A..OLD PERSIAN SIGN HA +103C4..103C7 ; disallowed # NA .. +103C8..103CF ; valid # 4.1 OLD PERSIAN SIGN AURAMAZDAA..OLD PERSIAN SIGN BUUMISH +103D0..103D5 ; valid ; ; NV8 # 4.1 OLD PERSIAN WORD DIVIDER..OLD PERSIAN NUMBER HUNDRED +103D6..103FF ; disallowed # NA .. +10400 ; mapped ; 10428 # 3.1 DESERET CAPITAL LETTER LONG I +10401 ; mapped ; 10429 # 3.1 DESERET CAPITAL LETTER LONG E +10402 ; mapped ; 1042A # 3.1 DESERET CAPITAL LETTER LONG A +10403 ; mapped ; 1042B # 3.1 DESERET CAPITAL LETTER LONG AH +10404 ; mapped ; 1042C # 3.1 DESERET CAPITAL LETTER LONG O +10405 ; mapped ; 1042D # 3.1 DESERET CAPITAL LETTER LONG OO +10406 ; mapped ; 1042E # 3.1 DESERET CAPITAL LETTER SHORT I +10407 ; mapped ; 1042F # 3.1 DESERET CAPITAL LETTER SHORT E +10408 ; mapped ; 10430 # 3.1 DESERET CAPITAL LETTER SHORT A +10409 ; mapped ; 10431 # 3.1 DESERET CAPITAL LETTER SHORT AH +1040A ; mapped ; 10432 # 3.1 DESERET CAPITAL LETTER SHORT O +1040B ; mapped ; 10433 # 3.1 DESERET CAPITAL LETTER SHORT OO +1040C ; mapped ; 10434 # 3.1 DESERET CAPITAL LETTER AY +1040D ; mapped ; 10435 # 3.1 DESERET CAPITAL LETTER OW +1040E ; mapped ; 10436 # 3.1 DESERET CAPITAL LETTER WU +1040F ; mapped ; 10437 # 3.1 DESERET CAPITAL LETTER YEE +10410 ; mapped ; 10438 # 3.1 DESERET CAPITAL LETTER H +10411 ; mapped ; 10439 # 3.1 DESERET CAPITAL LETTER PEE +10412 ; mapped ; 1043A # 3.1 DESERET CAPITAL LETTER BEE +10413 ; mapped ; 1043B # 3.1 DESERET CAPITAL LETTER TEE +10414 ; mapped ; 1043C # 3.1 DESERET CAPITAL LETTER DEE +10415 ; mapped ; 1043D # 3.1 DESERET CAPITAL LETTER CHEE +10416 ; mapped ; 1043E # 3.1 DESERET CAPITAL LETTER JEE +10417 ; mapped ; 1043F # 3.1 DESERET CAPITAL LETTER KAY +10418 ; mapped ; 10440 # 3.1 DESERET CAPITAL LETTER GAY +10419 ; mapped ; 10441 # 3.1 DESERET CAPITAL LETTER EF +1041A ; mapped ; 10442 # 3.1 DESERET CAPITAL LETTER VEE +1041B ; mapped ; 10443 # 3.1 DESERET CAPITAL LETTER ETH +1041C ; mapped ; 10444 # 3.1 DESERET CAPITAL LETTER THEE +1041D ; mapped ; 10445 # 3.1 DESERET CAPITAL LETTER ES +1041E ; mapped ; 10446 # 3.1 DESERET CAPITAL LETTER ZEE +1041F ; mapped ; 10447 # 3.1 DESERET CAPITAL LETTER ESH +10420 ; mapped ; 10448 # 3.1 DESERET CAPITAL LETTER ZHEE +10421 ; mapped ; 10449 # 3.1 DESERET CAPITAL LETTER ER +10422 ; mapped ; 1044A # 3.1 DESERET CAPITAL LETTER EL +10423 ; mapped ; 1044B # 3.1 DESERET CAPITAL LETTER EM +10424 ; mapped ; 1044C # 3.1 DESERET CAPITAL LETTER EN +10425 ; mapped ; 1044D # 3.1 DESERET CAPITAL LETTER ENG +10426 ; mapped ; 1044E # 4.0 DESERET CAPITAL LETTER OI +10427 ; mapped ; 1044F # 4.0 DESERET CAPITAL LETTER EW +10428..1044D ; valid # 3.1 DESERET SMALL LETTER LONG I..DESERET SMALL LETTER ENG +1044E..1049D ; valid # 4.0 DESERET SMALL LETTER OI..OSMANYA LETTER OO +1049E..1049F ; disallowed # NA .. +104A0..104A9 ; valid # 4.0 OSMANYA DIGIT ZERO..OSMANYA DIGIT NINE +104AA..104AF ; disallowed # NA .. +104B0 ; mapped ; 104D8 # 9.0 OSAGE CAPITAL LETTER A +104B1 ; mapped ; 104D9 # 9.0 OSAGE CAPITAL LETTER AI +104B2 ; mapped ; 104DA # 9.0 OSAGE CAPITAL LETTER AIN +104B3 ; mapped ; 104DB # 9.0 OSAGE CAPITAL LETTER AH +104B4 ; mapped ; 104DC # 9.0 OSAGE CAPITAL LETTER BRA +104B5 ; mapped ; 104DD # 9.0 OSAGE CAPITAL LETTER CHA +104B6 ; mapped ; 104DE # 9.0 OSAGE CAPITAL LETTER EHCHA +104B7 ; mapped ; 104DF # 9.0 OSAGE CAPITAL LETTER E +104B8 ; mapped ; 104E0 # 9.0 OSAGE CAPITAL LETTER EIN +104B9 ; mapped ; 104E1 # 9.0 OSAGE CAPITAL LETTER HA +104BA ; mapped ; 104E2 # 9.0 OSAGE CAPITAL LETTER HYA +104BB ; mapped ; 104E3 # 9.0 OSAGE CAPITAL LETTER I +104BC ; mapped ; 104E4 # 9.0 OSAGE CAPITAL LETTER KA +104BD ; mapped ; 104E5 # 9.0 OSAGE CAPITAL LETTER EHKA +104BE ; mapped ; 104E6 # 9.0 OSAGE CAPITAL LETTER KYA +104BF ; mapped ; 104E7 # 9.0 OSAGE CAPITAL LETTER LA +104C0 ; mapped ; 104E8 # 9.0 OSAGE CAPITAL LETTER MA +104C1 ; mapped ; 104E9 # 9.0 OSAGE CAPITAL LETTER NA +104C2 ; mapped ; 104EA # 9.0 OSAGE CAPITAL LETTER O +104C3 ; mapped ; 104EB # 9.0 OSAGE CAPITAL LETTER OIN +104C4 ; mapped ; 104EC # 9.0 OSAGE CAPITAL LETTER PA +104C5 ; mapped ; 104ED # 9.0 OSAGE CAPITAL LETTER EHPA +104C6 ; mapped ; 104EE # 9.0 OSAGE CAPITAL LETTER SA +104C7 ; mapped ; 104EF # 9.0 OSAGE CAPITAL LETTER SHA +104C8 ; mapped ; 104F0 # 9.0 OSAGE CAPITAL LETTER TA +104C9 ; mapped ; 104F1 # 9.0 OSAGE CAPITAL LETTER EHTA +104CA ; mapped ; 104F2 # 9.0 OSAGE CAPITAL LETTER TSA +104CB ; mapped ; 104F3 # 9.0 OSAGE CAPITAL LETTER EHTSA +104CC ; mapped ; 104F4 # 9.0 OSAGE CAPITAL LETTER TSHA +104CD ; mapped ; 104F5 # 9.0 OSAGE CAPITAL LETTER DHA +104CE ; mapped ; 104F6 # 9.0 OSAGE CAPITAL LETTER U +104CF ; mapped ; 104F7 # 9.0 OSAGE CAPITAL LETTER WA +104D0 ; mapped ; 104F8 # 9.0 OSAGE CAPITAL LETTER KHA +104D1 ; mapped ; 104F9 # 9.0 OSAGE CAPITAL LETTER GHA +104D2 ; mapped ; 104FA # 9.0 OSAGE CAPITAL LETTER ZA +104D3 ; mapped ; 104FB # 9.0 OSAGE CAPITAL LETTER ZHA +104D4..104D7 ; disallowed # NA .. +104D8..104FB ; valid # 9.0 OSAGE SMALL LETTER A..OSAGE SMALL LETTER ZHA +104FC..104FF ; disallowed # NA .. +10500..10527 ; valid # 7.0 ELBASAN LETTER A..ELBASAN LETTER KHE +10528..1052F ; disallowed # NA .. +10530..10563 ; valid # 7.0 CAUCASIAN ALBANIAN LETTER ALT..CAUCASIAN ALBANIAN LETTER KIW +10564..1056E ; disallowed # NA .. +1056F ; valid ; ; NV8 # 7.0 CAUCASIAN ALBANIAN CITATION MARK +10570 ; mapped ; 10597 # 14.0 VITHKUQI CAPITAL LETTER A +10571 ; mapped ; 10598 # 14.0 VITHKUQI CAPITAL LETTER BBE +10572 ; mapped ; 10599 # 14.0 VITHKUQI CAPITAL LETTER BE +10573 ; mapped ; 1059A # 14.0 VITHKUQI CAPITAL LETTER CE +10574 ; mapped ; 1059B # 14.0 VITHKUQI CAPITAL LETTER CHE +10575 ; mapped ; 1059C # 14.0 VITHKUQI CAPITAL LETTER DE +10576 ; mapped ; 1059D # 14.0 VITHKUQI CAPITAL LETTER DHE +10577 ; mapped ; 1059E # 14.0 VITHKUQI CAPITAL LETTER EI +10578 ; mapped ; 1059F # 14.0 VITHKUQI CAPITAL LETTER E +10579 ; mapped ; 105A0 # 14.0 VITHKUQI CAPITAL LETTER FE +1057A ; mapped ; 105A1 # 14.0 VITHKUQI CAPITAL LETTER GA +1057B ; disallowed # NA +1057C ; mapped ; 105A3 # 14.0 VITHKUQI CAPITAL LETTER HA +1057D ; mapped ; 105A4 # 14.0 VITHKUQI CAPITAL LETTER HHA +1057E ; mapped ; 105A5 # 14.0 VITHKUQI CAPITAL LETTER I +1057F ; mapped ; 105A6 # 14.0 VITHKUQI CAPITAL LETTER IJE +10580 ; mapped ; 105A7 # 14.0 VITHKUQI CAPITAL LETTER JE +10581 ; mapped ; 105A8 # 14.0 VITHKUQI CAPITAL LETTER KA +10582 ; mapped ; 105A9 # 14.0 VITHKUQI CAPITAL LETTER LA +10583 ; mapped ; 105AA # 14.0 VITHKUQI CAPITAL LETTER LLA +10584 ; mapped ; 105AB # 14.0 VITHKUQI CAPITAL LETTER ME +10585 ; mapped ; 105AC # 14.0 VITHKUQI CAPITAL LETTER NE +10586 ; mapped ; 105AD # 14.0 VITHKUQI CAPITAL LETTER NJE +10587 ; mapped ; 105AE # 14.0 VITHKUQI CAPITAL LETTER O +10588 ; mapped ; 105AF # 14.0 VITHKUQI CAPITAL LETTER PE +10589 ; mapped ; 105B0 # 14.0 VITHKUQI CAPITAL LETTER QA +1058A ; mapped ; 105B1 # 14.0 VITHKUQI CAPITAL LETTER RE +1058B ; disallowed # NA +1058C ; mapped ; 105B3 # 14.0 VITHKUQI CAPITAL LETTER SE +1058D ; mapped ; 105B4 # 14.0 VITHKUQI CAPITAL LETTER SHE +1058E ; mapped ; 105B5 # 14.0 VITHKUQI CAPITAL LETTER TE +1058F ; mapped ; 105B6 # 14.0 VITHKUQI CAPITAL LETTER THE +10590 ; mapped ; 105B7 # 14.0 VITHKUQI CAPITAL LETTER U +10591 ; mapped ; 105B8 # 14.0 VITHKUQI CAPITAL LETTER VE +10592 ; mapped ; 105B9 # 14.0 VITHKUQI CAPITAL LETTER XE +10593 ; disallowed # NA +10594 ; mapped ; 105BB # 14.0 VITHKUQI CAPITAL LETTER Y +10595 ; mapped ; 105BC # 14.0 VITHKUQI CAPITAL LETTER ZE +10596 ; disallowed # NA +10597..105A1 ; valid # 14.0 VITHKUQI SMALL LETTER A..VITHKUQI SMALL LETTER GA +105A2 ; disallowed # NA +105A3..105B1 ; valid # 14.0 VITHKUQI SMALL LETTER HA..VITHKUQI SMALL LETTER RE +105B2 ; disallowed # NA +105B3..105B9 ; valid # 14.0 VITHKUQI SMALL LETTER SE..VITHKUQI SMALL LETTER XE +105BA ; disallowed # NA +105BB..105BC ; valid # 14.0 VITHKUQI SMALL LETTER Y..VITHKUQI SMALL LETTER ZE +105BD..105FF ; disallowed # NA .. +10600..10736 ; valid # 7.0 LINEAR A SIGN AB001..LINEAR A SIGN A664 +10737..1073F ; disallowed # NA .. +10740..10755 ; valid # 7.0 LINEAR A SIGN A701 A..LINEAR A SIGN A732 JE +10756..1075F ; disallowed # NA .. +10760..10767 ; valid # 7.0 LINEAR A SIGN A800..LINEAR A SIGN A807 +10768..1077F ; disallowed # NA .. +10780 ; valid # 14.0 MODIFIER LETTER SMALL CAPITAL AA +10781 ; mapped ; 02D0 # 14.0 MODIFIER LETTER SUPERSCRIPT TRIANGULAR COLON +10782 ; mapped ; 02D1 # 14.0 MODIFIER LETTER SUPERSCRIPT HALF TRIANGULAR COLON +10783 ; mapped ; 00E6 # 14.0 MODIFIER LETTER SMALL AE +10784 ; mapped ; 0299 # 14.0 MODIFIER LETTER SMALL CAPITAL B +10785 ; mapped ; 0253 # 14.0 MODIFIER LETTER SMALL B WITH HOOK +10786 ; disallowed # NA +10787 ; mapped ; 02A3 # 14.0 MODIFIER LETTER SMALL DZ DIGRAPH +10788 ; mapped ; AB66 # 14.0 MODIFIER LETTER SMALL DZ DIGRAPH WITH RETROFLEX HOOK +10789 ; mapped ; 02A5 # 14.0 MODIFIER LETTER SMALL DZ DIGRAPH WITH CURL +1078A ; mapped ; 02A4 # 14.0 MODIFIER LETTER SMALL DEZH DIGRAPH +1078B ; mapped ; 0256 # 14.0 MODIFIER LETTER SMALL D WITH TAIL +1078C ; mapped ; 0257 # 14.0 MODIFIER LETTER SMALL D WITH HOOK +1078D ; mapped ; 1D91 # 14.0 MODIFIER LETTER SMALL D WITH HOOK AND TAIL +1078E ; mapped ; 0258 # 14.0 MODIFIER LETTER SMALL REVERSED E +1078F ; mapped ; 025E # 14.0 MODIFIER LETTER SMALL CLOSED REVERSED OPEN E +10790 ; mapped ; 02A9 # 14.0 MODIFIER LETTER SMALL FENG DIGRAPH +10791 ; mapped ; 0264 # 14.0 MODIFIER LETTER SMALL RAMS HORN +10792 ; mapped ; 0262 # 14.0 MODIFIER LETTER SMALL CAPITAL G +10793 ; mapped ; 0260 # 14.0 MODIFIER LETTER SMALL G WITH HOOK +10794 ; mapped ; 029B # 14.0 MODIFIER LETTER SMALL CAPITAL G WITH HOOK +10795 ; mapped ; 0127 # 14.0 MODIFIER LETTER SMALL H WITH STROKE +10796 ; mapped ; 029C # 14.0 MODIFIER LETTER SMALL CAPITAL H +10797 ; mapped ; 0267 # 14.0 MODIFIER LETTER SMALL HENG WITH HOOK +10798 ; mapped ; 0284 # 14.0 MODIFIER LETTER SMALL DOTLESS J WITH STROKE AND HOOK +10799 ; mapped ; 02AA # 14.0 MODIFIER LETTER SMALL LS DIGRAPH +1079A ; mapped ; 02AB # 14.0 MODIFIER LETTER SMALL LZ DIGRAPH +1079B ; mapped ; 026C # 14.0 MODIFIER LETTER SMALL L WITH BELT +1079C ; mapped ; 1DF04 # 14.0 MODIFIER LETTER SMALL CAPITAL L WITH BELT +1079D ; mapped ; A78E # 14.0 MODIFIER LETTER SMALL L WITH RETROFLEX HOOK AND BELT +1079E ; mapped ; 026E # 14.0 MODIFIER LETTER SMALL LEZH +1079F ; mapped ; 1DF05 # 14.0 MODIFIER LETTER SMALL LEZH WITH RETROFLEX HOOK +107A0 ; mapped ; 028E # 14.0 MODIFIER LETTER SMALL TURNED Y +107A1 ; mapped ; 1DF06 # 14.0 MODIFIER LETTER SMALL TURNED Y WITH BELT +107A2 ; mapped ; 00F8 # 14.0 MODIFIER LETTER SMALL O WITH STROKE +107A3 ; mapped ; 0276 # 14.0 MODIFIER LETTER SMALL CAPITAL OE +107A4 ; mapped ; 0277 # 14.0 MODIFIER LETTER SMALL CLOSED OMEGA +107A5 ; mapped ; 0071 # 14.0 MODIFIER LETTER SMALL Q +107A6 ; mapped ; 027A # 14.0 MODIFIER LETTER SMALL TURNED R WITH LONG LEG +107A7 ; mapped ; 1DF08 # 14.0 MODIFIER LETTER SMALL TURNED R WITH LONG LEG AND RETROFLEX HOOK +107A8 ; mapped ; 027D # 14.0 MODIFIER LETTER SMALL R WITH TAIL +107A9 ; mapped ; 027E # 14.0 MODIFIER LETTER SMALL R WITH FISHHOOK +107AA ; mapped ; 0280 # 14.0 MODIFIER LETTER SMALL CAPITAL R +107AB ; mapped ; 02A8 # 14.0 MODIFIER LETTER SMALL TC DIGRAPH WITH CURL +107AC ; mapped ; 02A6 # 14.0 MODIFIER LETTER SMALL TS DIGRAPH +107AD ; mapped ; AB67 # 14.0 MODIFIER LETTER SMALL TS DIGRAPH WITH RETROFLEX HOOK +107AE ; mapped ; 02A7 # 14.0 MODIFIER LETTER SMALL TESH DIGRAPH +107AF ; mapped ; 0288 # 14.0 MODIFIER LETTER SMALL T WITH RETROFLEX HOOK +107B0 ; mapped ; 2C71 # 14.0 MODIFIER LETTER SMALL V WITH RIGHT HOOK +107B1 ; disallowed # NA +107B2 ; mapped ; 028F # 14.0 MODIFIER LETTER SMALL CAPITAL Y +107B3 ; mapped ; 02A1 # 14.0 MODIFIER LETTER GLOTTAL STOP WITH STROKE +107B4 ; mapped ; 02A2 # 14.0 MODIFIER LETTER REVERSED GLOTTAL STOP WITH STROKE +107B5 ; mapped ; 0298 # 14.0 MODIFIER LETTER BILABIAL CLICK +107B6 ; mapped ; 01C0 # 14.0 MODIFIER LETTER DENTAL CLICK +107B7 ; mapped ; 01C1 # 14.0 MODIFIER LETTER LATERAL CLICK +107B8 ; mapped ; 01C2 # 14.0 MODIFIER LETTER ALVEOLAR CLICK +107B9 ; mapped ; 1DF0A # 14.0 MODIFIER LETTER RETROFLEX CLICK WITH RETROFLEX HOOK +107BA ; mapped ; 1DF1E # 14.0 MODIFIER LETTER SMALL S WITH CURL +107BB..107FF ; disallowed # NA .. +10800..10805 ; valid # 4.0 CYPRIOT SYLLABLE A..CYPRIOT SYLLABLE JA +10806..10807 ; disallowed # NA .. +10808 ; valid # 4.0 CYPRIOT SYLLABLE JO +10809 ; disallowed # NA +1080A..10835 ; valid # 4.0 CYPRIOT SYLLABLE KA..CYPRIOT SYLLABLE WO +10836 ; disallowed # NA +10837..10838 ; valid # 4.0 CYPRIOT SYLLABLE XA..CYPRIOT SYLLABLE XE +10839..1083B ; disallowed # NA .. +1083C ; valid # 4.0 CYPRIOT SYLLABLE ZA +1083D..1083E ; disallowed # NA .. +1083F ; valid # 4.0 CYPRIOT SYLLABLE ZO +10840..10855 ; valid # 5.2 IMPERIAL ARAMAIC LETTER ALEPH..IMPERIAL ARAMAIC LETTER TAW +10856 ; disallowed # NA +10857..1085F ; valid ; ; NV8 # 5.2 IMPERIAL ARAMAIC SECTION SIGN..IMPERIAL ARAMAIC NUMBER TEN THOUSAND +10860..10876 ; valid # 7.0 PALMYRENE LETTER ALEPH..PALMYRENE LETTER TAW +10877..1087F ; valid ; ; NV8 # 7.0 PALMYRENE LEFT-POINTING FLEURON..PALMYRENE NUMBER TWENTY +10880..1089E ; valid # 7.0 NABATAEAN LETTER FINAL ALEPH..NABATAEAN LETTER TAW +1089F..108A6 ; disallowed # NA .. +108A7..108AF ; valid ; ; NV8 # 7.0 NABATAEAN NUMBER ONE..NABATAEAN NUMBER ONE HUNDRED +108B0..108DF ; disallowed # NA .. +108E0..108F2 ; valid # 8.0 HATRAN LETTER ALEPH..HATRAN LETTER QOPH +108F3 ; disallowed # NA +108F4..108F5 ; valid # 8.0 HATRAN LETTER SHIN..HATRAN LETTER TAW +108F6..108FA ; disallowed # NA .. +108FB..108FF ; valid ; ; NV8 # 8.0 HATRAN NUMBER ONE..HATRAN NUMBER ONE HUNDRED +10900..10915 ; valid # 5.0 PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU +10916..10919 ; valid ; ; NV8 # 5.0 PHOENICIAN NUMBER ONE..PHOENICIAN NUMBER ONE HUNDRED +1091A..1091B ; valid ; ; NV8 # 5.2 PHOENICIAN NUMBER TWO..PHOENICIAN NUMBER THREE +1091C..1091E ; disallowed # NA .. +1091F ; valid ; ; NV8 # 5.0 PHOENICIAN WORD SEPARATOR +10920..10939 ; valid # 5.1 LYDIAN LETTER A..LYDIAN LETTER C +1093A..1093E ; disallowed # NA .. +1093F ; valid ; ; NV8 # 5.1 LYDIAN TRIANGULAR MARK +10940..1097F ; disallowed # NA .. +10980..109B7 ; valid # 6.1 MEROITIC HIEROGLYPHIC LETTER A..MEROITIC CURSIVE LETTER DA +109B8..109BB ; disallowed # NA .. +109BC..109BD ; valid ; ; NV8 # 8.0 MEROITIC CURSIVE FRACTION ELEVEN TWELFTHS..MEROITIC CURSIVE FRACTION ONE HALF +109BE..109BF ; valid # 6.1 MEROITIC CURSIVE LOGOGRAM RMT..MEROITIC CURSIVE LOGOGRAM IMN +109C0..109CF ; valid ; ; NV8 # 8.0 MEROITIC CURSIVE NUMBER ONE..MEROITIC CURSIVE NUMBER SEVENTY +109D0..109D1 ; disallowed # NA .. +109D2..109FF ; valid ; ; NV8 # 8.0 MEROITIC CURSIVE NUMBER ONE HUNDRED..MEROITIC CURSIVE FRACTION TEN TWELFTHS +10A00..10A03 ; valid # 4.1 KHAROSHTHI LETTER A..KHAROSHTHI VOWEL SIGN VOCALIC R +10A04 ; disallowed # NA +10A05..10A06 ; valid # 4.1 KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O +10A07..10A0B ; disallowed # NA .. +10A0C..10A13 ; valid # 4.1 KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI LETTER GHA +10A14 ; disallowed # NA +10A15..10A17 ; valid # 4.1 KHAROSHTHI LETTER CA..KHAROSHTHI LETTER JA +10A18 ; disallowed # NA +10A19..10A33 ; valid # 4.1 KHAROSHTHI LETTER NYA..KHAROSHTHI LETTER TTTHA +10A34..10A35 ; valid # 11.0 KHAROSHTHI LETTER TTTA..KHAROSHTHI LETTER VHA +10A36..10A37 ; disallowed # NA .. +10A38..10A3A ; valid # 4.1 KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW +10A3B..10A3E ; disallowed # NA .. +10A3F ; valid # 4.1 KHAROSHTHI VIRAMA +10A40..10A47 ; valid ; ; NV8 # 4.1 KHAROSHTHI DIGIT ONE..KHAROSHTHI NUMBER ONE THOUSAND +10A48 ; valid ; ; NV8 # 11.0 KHAROSHTHI FRACTION ONE HALF +10A49..10A4F ; disallowed # NA .. +10A50..10A58 ; valid ; ; NV8 # 4.1 KHAROSHTHI PUNCTUATION DOT..KHAROSHTHI PUNCTUATION LINES +10A59..10A5F ; disallowed # NA .. +10A60..10A7C ; valid # 5.2 OLD SOUTH ARABIAN LETTER HE..OLD SOUTH ARABIAN LETTER THETH +10A7D..10A7F ; valid ; ; NV8 # 5.2 OLD SOUTH ARABIAN NUMBER ONE..OLD SOUTH ARABIAN NUMERIC INDICATOR +10A80..10A9C ; valid # 7.0 OLD NORTH ARABIAN LETTER HEH..OLD NORTH ARABIAN LETTER ZAH +10A9D..10A9F ; valid ; ; NV8 # 7.0 OLD NORTH ARABIAN NUMBER ONE..OLD NORTH ARABIAN NUMBER TWENTY +10AA0..10ABF ; disallowed # NA .. +10AC0..10AC7 ; valid # 7.0 MANICHAEAN LETTER ALEPH..MANICHAEAN LETTER WAW +10AC8 ; valid ; ; NV8 # 7.0 MANICHAEAN SIGN UD +10AC9..10AE6 ; valid # 7.0 MANICHAEAN LETTER ZAYIN..MANICHAEAN ABBREVIATION MARK BELOW +10AE7..10AEA ; disallowed # NA .. +10AEB..10AF6 ; valid ; ; NV8 # 7.0 MANICHAEAN NUMBER ONE..MANICHAEAN PUNCTUATION LINE FILLER +10AF7..10AFF ; disallowed # NA .. +10B00..10B35 ; valid # 5.2 AVESTAN LETTER A..AVESTAN LETTER HE +10B36..10B38 ; disallowed # NA .. +10B39..10B3F ; valid ; ; NV8 # 5.2 AVESTAN ABBREVIATION MARK..LARGE ONE RING OVER TWO RINGS PUNCTUATION +10B40..10B55 ; valid # 5.2 INSCRIPTIONAL PARTHIAN LETTER ALEPH..INSCRIPTIONAL PARTHIAN LETTER TAW +10B56..10B57 ; disallowed # NA .. +10B58..10B5F ; valid ; ; NV8 # 5.2 INSCRIPTIONAL PARTHIAN NUMBER ONE..INSCRIPTIONAL PARTHIAN NUMBER ONE THOUSAND +10B60..10B72 ; valid # 5.2 INSCRIPTIONAL PAHLAVI LETTER ALEPH..INSCRIPTIONAL PAHLAVI LETTER TAW +10B73..10B77 ; disallowed # NA .. +10B78..10B7F ; valid ; ; NV8 # 5.2 INSCRIPTIONAL PAHLAVI NUMBER ONE..INSCRIPTIONAL PAHLAVI NUMBER ONE THOUSAND +10B80..10B91 ; valid # 7.0 PSALTER PAHLAVI LETTER ALEPH..PSALTER PAHLAVI LETTER TAW +10B92..10B98 ; disallowed # NA .. +10B99..10B9C ; valid ; ; NV8 # 7.0 PSALTER PAHLAVI SECTION MARK..PSALTER PAHLAVI FOUR DOTS WITH DOT +10B9D..10BA8 ; disallowed # NA .. +10BA9..10BAF ; valid ; ; NV8 # 7.0 PSALTER PAHLAVI NUMBER ONE..PSALTER PAHLAVI NUMBER ONE HUNDRED +10BB0..10BFF ; disallowed # NA .. +10C00..10C48 ; valid # 5.2 OLD TURKIC LETTER ORKHON A..OLD TURKIC LETTER ORKHON BASH +10C49..10C7F ; disallowed # NA .. +10C80 ; mapped ; 10CC0 # 8.0 OLD HUNGARIAN CAPITAL LETTER A +10C81 ; mapped ; 10CC1 # 8.0 OLD HUNGARIAN CAPITAL LETTER AA +10C82 ; mapped ; 10CC2 # 8.0 OLD HUNGARIAN CAPITAL LETTER EB +10C83 ; mapped ; 10CC3 # 8.0 OLD HUNGARIAN CAPITAL LETTER AMB +10C84 ; mapped ; 10CC4 # 8.0 OLD HUNGARIAN CAPITAL LETTER EC +10C85 ; mapped ; 10CC5 # 8.0 OLD HUNGARIAN CAPITAL LETTER ENC +10C86 ; mapped ; 10CC6 # 8.0 OLD HUNGARIAN CAPITAL LETTER ECS +10C87 ; mapped ; 10CC7 # 8.0 OLD HUNGARIAN CAPITAL LETTER ED +10C88 ; mapped ; 10CC8 # 8.0 OLD HUNGARIAN CAPITAL LETTER AND +10C89 ; mapped ; 10CC9 # 8.0 OLD HUNGARIAN CAPITAL LETTER E +10C8A ; mapped ; 10CCA # 8.0 OLD HUNGARIAN CAPITAL LETTER CLOSE E +10C8B ; mapped ; 10CCB # 8.0 OLD HUNGARIAN CAPITAL LETTER EE +10C8C ; mapped ; 10CCC # 8.0 OLD HUNGARIAN CAPITAL LETTER EF +10C8D ; mapped ; 10CCD # 8.0 OLD HUNGARIAN CAPITAL LETTER EG +10C8E ; mapped ; 10CCE # 8.0 OLD HUNGARIAN CAPITAL LETTER EGY +10C8F ; mapped ; 10CCF # 8.0 OLD HUNGARIAN CAPITAL LETTER EH +10C90 ; mapped ; 10CD0 # 8.0 OLD HUNGARIAN CAPITAL LETTER I +10C91 ; mapped ; 10CD1 # 8.0 OLD HUNGARIAN CAPITAL LETTER II +10C92 ; mapped ; 10CD2 # 8.0 OLD HUNGARIAN CAPITAL LETTER EJ +10C93 ; mapped ; 10CD3 # 8.0 OLD HUNGARIAN CAPITAL LETTER EK +10C94 ; mapped ; 10CD4 # 8.0 OLD HUNGARIAN CAPITAL LETTER AK +10C95 ; mapped ; 10CD5 # 8.0 OLD HUNGARIAN CAPITAL LETTER UNK +10C96 ; mapped ; 10CD6 # 8.0 OLD HUNGARIAN CAPITAL LETTER EL +10C97 ; mapped ; 10CD7 # 8.0 OLD HUNGARIAN CAPITAL LETTER ELY +10C98 ; mapped ; 10CD8 # 8.0 OLD HUNGARIAN CAPITAL LETTER EM +10C99 ; mapped ; 10CD9 # 8.0 OLD HUNGARIAN CAPITAL LETTER EN +10C9A ; mapped ; 10CDA # 8.0 OLD HUNGARIAN CAPITAL LETTER ENY +10C9B ; mapped ; 10CDB # 8.0 OLD HUNGARIAN CAPITAL LETTER O +10C9C ; mapped ; 10CDC # 8.0 OLD HUNGARIAN CAPITAL LETTER OO +10C9D ; mapped ; 10CDD # 8.0 OLD HUNGARIAN CAPITAL LETTER NIKOLSBURG OE +10C9E ; mapped ; 10CDE # 8.0 OLD HUNGARIAN CAPITAL LETTER RUDIMENTA OE +10C9F ; mapped ; 10CDF # 8.0 OLD HUNGARIAN CAPITAL LETTER OEE +10CA0 ; mapped ; 10CE0 # 8.0 OLD HUNGARIAN CAPITAL LETTER EP +10CA1 ; mapped ; 10CE1 # 8.0 OLD HUNGARIAN CAPITAL LETTER EMP +10CA2 ; mapped ; 10CE2 # 8.0 OLD HUNGARIAN CAPITAL LETTER ER +10CA3 ; mapped ; 10CE3 # 8.0 OLD HUNGARIAN CAPITAL LETTER SHORT ER +10CA4 ; mapped ; 10CE4 # 8.0 OLD HUNGARIAN CAPITAL LETTER ES +10CA5 ; mapped ; 10CE5 # 8.0 OLD HUNGARIAN CAPITAL LETTER ESZ +10CA6 ; mapped ; 10CE6 # 8.0 OLD HUNGARIAN CAPITAL LETTER ET +10CA7 ; mapped ; 10CE7 # 8.0 OLD HUNGARIAN CAPITAL LETTER ENT +10CA8 ; mapped ; 10CE8 # 8.0 OLD HUNGARIAN CAPITAL LETTER ETY +10CA9 ; mapped ; 10CE9 # 8.0 OLD HUNGARIAN CAPITAL LETTER ECH +10CAA ; mapped ; 10CEA # 8.0 OLD HUNGARIAN CAPITAL LETTER U +10CAB ; mapped ; 10CEB # 8.0 OLD HUNGARIAN CAPITAL LETTER UU +10CAC ; mapped ; 10CEC # 8.0 OLD HUNGARIAN CAPITAL LETTER NIKOLSBURG UE +10CAD ; mapped ; 10CED # 8.0 OLD HUNGARIAN CAPITAL LETTER RUDIMENTA UE +10CAE ; mapped ; 10CEE # 8.0 OLD HUNGARIAN CAPITAL LETTER EV +10CAF ; mapped ; 10CEF # 8.0 OLD HUNGARIAN CAPITAL LETTER EZ +10CB0 ; mapped ; 10CF0 # 8.0 OLD HUNGARIAN CAPITAL LETTER EZS +10CB1 ; mapped ; 10CF1 # 8.0 OLD HUNGARIAN CAPITAL LETTER ENT-SHAPED SIGN +10CB2 ; mapped ; 10CF2 # 8.0 OLD HUNGARIAN CAPITAL LETTER US +10CB3..10CBF ; disallowed # NA .. +10CC0..10CF2 ; valid # 8.0 OLD HUNGARIAN SMALL LETTER A..OLD HUNGARIAN SMALL LETTER US +10CF3..10CF9 ; disallowed # NA .. +10CFA..10CFF ; valid ; ; NV8 # 8.0 OLD HUNGARIAN NUMBER ONE..OLD HUNGARIAN NUMBER ONE THOUSAND +10D00..10D27 ; valid # 11.0 HANIFI ROHINGYA LETTER A..HANIFI ROHINGYA SIGN TASSI +10D28..10D2F ; disallowed # NA .. +10D30..10D39 ; valid # 11.0 HANIFI ROHINGYA DIGIT ZERO..HANIFI ROHINGYA DIGIT NINE +10D3A..10E5F ; disallowed # NA .. +10E60..10E7E ; valid ; ; NV8 # 5.2 RUMI DIGIT ONE..RUMI FRACTION TWO THIRDS +10E7F ; disallowed # NA +10E80..10EA9 ; valid # 13.0 YEZIDI LETTER ELIF..YEZIDI LETTER ET +10EAA ; disallowed # NA +10EAB..10EAC ; valid # 13.0 YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK +10EAD ; valid ; ; NV8 # 13.0 YEZIDI HYPHENATION MARK +10EAE..10EAF ; disallowed # NA .. +10EB0..10EB1 ; valid # 13.0 YEZIDI LETTER LAM WITH DOT ABOVE..YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE +10EB2..10EFC ; disallowed # NA .. +10EFD..10EFF ; valid # 15.0 ARABIC SMALL LOW WORD SAKTA..ARABIC SMALL LOW WORD MADDA +10F00..10F1C ; valid # 11.0 OLD SOGDIAN LETTER ALEPH..OLD SOGDIAN LETTER FINAL TAW WITH VERTICAL TAIL +10F1D..10F26 ; valid ; ; NV8 # 11.0 OLD SOGDIAN NUMBER ONE..OLD SOGDIAN FRACTION ONE HALF +10F27 ; valid # 11.0 OLD SOGDIAN LIGATURE AYIN-DALETH +10F28..10F2F ; disallowed # NA .. +10F30..10F50 ; valid # 11.0 SOGDIAN LETTER ALEPH..SOGDIAN COMBINING STROKE BELOW +10F51..10F59 ; valid ; ; NV8 # 11.0 SOGDIAN NUMBER ONE..SOGDIAN PUNCTUATION HALF CIRCLE WITH DOT +10F5A..10F6F ; disallowed # NA .. +10F70..10F85 ; valid # 14.0 OLD UYGHUR LETTER ALEPH..OLD UYGHUR COMBINING TWO DOTS BELOW +10F86..10F89 ; valid ; ; NV8 # 14.0 OLD UYGHUR PUNCTUATION BAR..OLD UYGHUR PUNCTUATION FOUR DOTS +10F8A..10FAF ; disallowed # NA .. +10FB0..10FC4 ; valid # 13.0 CHORASMIAN LETTER ALEPH..CHORASMIAN LETTER TAW +10FC5..10FCB ; valid ; ; NV8 # 13.0 CHORASMIAN NUMBER ONE..CHORASMIAN NUMBER ONE HUNDRED +10FCC..10FDF ; disallowed # NA .. +10FE0..10FF6 ; valid # 12.0 ELYMAIC LETTER ALEPH..ELYMAIC LIGATURE ZAYIN-YODH +10FF7..10FFF ; disallowed # NA .. +11000..11046 ; valid # 6.0 BRAHMI SIGN CANDRABINDU..BRAHMI VIRAMA +11047..1104D ; valid ; ; NV8 # 6.0 BRAHMI DANDA..BRAHMI PUNCTUATION LOTUS +1104E..11051 ; disallowed # NA .. +11052..11065 ; valid ; ; NV8 # 6.0 BRAHMI NUMBER ONE..BRAHMI NUMBER ONE THOUSAND +11066..1106F ; valid # 6.0 BRAHMI DIGIT ZERO..BRAHMI DIGIT NINE +11070..11075 ; valid # 14.0 BRAHMI SIGN OLD TAMIL VIRAMA..BRAHMI LETTER OLD TAMIL LLA +11076..1107E ; disallowed # NA .. +1107F ; valid # 7.0 BRAHMI NUMBER JOINER +11080..110BA ; valid # 5.2 KAITHI SIGN CANDRABINDU..KAITHI SIGN NUKTA +110BB..110BC ; valid ; ; NV8 # 5.2 KAITHI ABBREVIATION SIGN..KAITHI ENUMERATION SIGN +110BD ; disallowed # 5.2 KAITHI NUMBER SIGN +110BE..110C1 ; valid ; ; NV8 # 5.2 KAITHI SECTION MARK..KAITHI DOUBLE DANDA +110C2 ; valid # 14.0 KAITHI VOWEL SIGN VOCALIC R +110C3..110CC ; disallowed # NA .. +110CD ; disallowed # 11.0 KAITHI NUMBER SIGN ABOVE +110CE..110CF ; disallowed # NA .. +110D0..110E8 ; valid # 6.1 SORA SOMPENG LETTER SAH..SORA SOMPENG LETTER MAE +110E9..110EF ; disallowed # NA .. +110F0..110F9 ; valid # 6.1 SORA SOMPENG DIGIT ZERO..SORA SOMPENG DIGIT NINE +110FA..110FF ; disallowed # NA .. +11100..11134 ; valid # 6.1 CHAKMA SIGN CANDRABINDU..CHAKMA MAAYYAA +11135 ; disallowed # NA +11136..1113F ; valid # 6.1 CHAKMA DIGIT ZERO..CHAKMA DIGIT NINE +11140..11143 ; valid ; ; NV8 # 6.1 CHAKMA SECTION MARK..CHAKMA QUESTION MARK +11144..11146 ; valid # 11.0 CHAKMA LETTER LHAA..CHAKMA VOWEL SIGN EI +11147 ; valid # 13.0 CHAKMA LETTER VAA +11148..1114F ; disallowed # NA .. +11150..11173 ; valid # 7.0 MAHAJANI LETTER A..MAHAJANI SIGN NUKTA +11174..11175 ; valid ; ; NV8 # 7.0 MAHAJANI ABBREVIATION SIGN..MAHAJANI SECTION MARK +11176 ; valid # 7.0 MAHAJANI LIGATURE SHRI +11177..1117F ; disallowed # NA .. +11180..111C4 ; valid # 6.1 SHARADA SIGN CANDRABINDU..SHARADA OM +111C5..111C8 ; valid ; ; NV8 # 6.1 SHARADA DANDA..SHARADA SEPARATOR +111C9..111CC ; valid # 8.0 SHARADA SANDHI MARK..SHARADA EXTRA SHORT VOWEL MARK +111CD ; valid ; ; NV8 # 7.0 SHARADA SUTRA MARK +111CE..111CF ; valid # 13.0 SHARADA VOWEL SIGN PRISHTHAMATRA E..SHARADA SIGN INVERTED CANDRABINDU +111D0..111D9 ; valid # 6.1 SHARADA DIGIT ZERO..SHARADA DIGIT NINE +111DA ; valid # 7.0 SHARADA EKAM +111DB ; valid ; ; NV8 # 8.0 SHARADA SIGN SIDDHAM +111DC ; valid # 8.0 SHARADA HEADSTROKE +111DD..111DF ; valid ; ; NV8 # 8.0 SHARADA CONTINUATION SIGN..SHARADA SECTION MARK-2 +111E0 ; disallowed # NA +111E1..111F4 ; valid ; ; NV8 # 7.0 SINHALA ARCHAIC DIGIT ONE..SINHALA ARCHAIC NUMBER ONE THOUSAND +111F5..111FF ; disallowed # NA .. +11200..11211 ; valid # 7.0 KHOJKI LETTER A..KHOJKI LETTER JJA +11212 ; disallowed # NA +11213..11237 ; valid # 7.0 KHOJKI LETTER NYA..KHOJKI SIGN SHADDA +11238..1123D ; valid ; ; NV8 # 7.0 KHOJKI DANDA..KHOJKI ABBREVIATION SIGN +1123E ; valid # 9.0 KHOJKI SIGN SUKUN +1123F..11241 ; valid # 15.0 KHOJKI LETTER QA..KHOJKI VOWEL SIGN VOCALIC R +11242..1127F ; disallowed # NA .. +11280..11286 ; valid # 8.0 MULTANI LETTER A..MULTANI LETTER GA +11287 ; disallowed # NA +11288 ; valid # 8.0 MULTANI LETTER GHA +11289 ; disallowed # NA +1128A..1128D ; valid # 8.0 MULTANI LETTER CA..MULTANI LETTER JJA +1128E ; disallowed # NA +1128F..1129D ; valid # 8.0 MULTANI LETTER NYA..MULTANI LETTER BA +1129E ; disallowed # NA +1129F..112A8 ; valid # 8.0 MULTANI LETTER BHA..MULTANI LETTER RHA +112A9 ; valid ; ; NV8 # 8.0 MULTANI SECTION MARK +112AA..112AF ; disallowed # NA .. +112B0..112EA ; valid # 7.0 KHUDAWADI LETTER A..KHUDAWADI SIGN VIRAMA +112EB..112EF ; disallowed # NA .. +112F0..112F9 ; valid # 7.0 KHUDAWADI DIGIT ZERO..KHUDAWADI DIGIT NINE +112FA..112FF ; disallowed # NA .. +11300 ; valid # 8.0 GRANTHA SIGN COMBINING ANUSVARA ABOVE +11301..11303 ; valid # 7.0 GRANTHA SIGN CANDRABINDU..GRANTHA SIGN VISARGA +11304 ; disallowed # NA +11305..1130C ; valid # 7.0 GRANTHA LETTER A..GRANTHA LETTER VOCALIC L +1130D..1130E ; disallowed # NA .. +1130F..11310 ; valid # 7.0 GRANTHA LETTER EE..GRANTHA LETTER AI +11311..11312 ; disallowed # NA .. +11313..11328 ; valid # 7.0 GRANTHA LETTER OO..GRANTHA LETTER NA +11329 ; disallowed # NA +1132A..11330 ; valid # 7.0 GRANTHA LETTER PA..GRANTHA LETTER RA +11331 ; disallowed # NA +11332..11333 ; valid # 7.0 GRANTHA LETTER LA..GRANTHA LETTER LLA +11334 ; disallowed # NA +11335..11339 ; valid # 7.0 GRANTHA LETTER VA..GRANTHA LETTER HA +1133A ; disallowed # NA +1133B ; valid # 11.0 COMBINING BINDU BELOW +1133C..11344 ; valid # 7.0 GRANTHA SIGN NUKTA..GRANTHA VOWEL SIGN VOCALIC RR +11345..11346 ; disallowed # NA .. +11347..11348 ; valid # 7.0 GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI +11349..1134A ; disallowed # NA .. +1134B..1134D ; valid # 7.0 GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA +1134E..1134F ; disallowed # NA .. +11350 ; valid # 8.0 GRANTHA OM +11351..11356 ; disallowed # NA .. +11357 ; valid # 7.0 GRANTHA AU LENGTH MARK +11358..1135C ; disallowed # NA .. +1135D..11363 ; valid # 7.0 GRANTHA SIGN PLUTA..GRANTHA VOWEL SIGN VOCALIC LL +11364..11365 ; disallowed # NA .. +11366..1136C ; valid # 7.0 COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX +1136D..1136F ; disallowed # NA .. +11370..11374 ; valid # 7.0 COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA +11375..113FF ; disallowed # NA .. +11400..1144A ; valid # 9.0 NEWA LETTER A..NEWA SIDDHI +1144B..1144F ; valid ; ; NV8 # 9.0 NEWA DANDA..NEWA ABBREVIATION SIGN +11450..11459 ; valid # 9.0 NEWA DIGIT ZERO..NEWA DIGIT NINE +1145A ; valid ; ; NV8 # 13.0 NEWA DOUBLE COMMA +1145B ; valid ; ; NV8 # 9.0 NEWA PLACEHOLDER MARK +1145C ; disallowed # NA +1145D ; valid ; ; NV8 # 9.0 NEWA INSERTION SIGN +1145E ; valid # 11.0 NEWA SANDHI MARK +1145F ; valid # 12.0 NEWA LETTER VEDIC ANUSVARA +11460..11461 ; valid # 13.0 NEWA SIGN JIHVAMULIYA..NEWA SIGN UPADHMANIYA +11462..1147F ; disallowed # NA .. +11480..114C5 ; valid # 7.0 TIRHUTA ANJI..TIRHUTA GVANG +114C6 ; valid ; ; NV8 # 7.0 TIRHUTA ABBREVIATION SIGN +114C7 ; valid # 7.0 TIRHUTA OM +114C8..114CF ; disallowed # NA .. +114D0..114D9 ; valid # 7.0 TIRHUTA DIGIT ZERO..TIRHUTA DIGIT NINE +114DA..1157F ; disallowed # NA .. +11580..115B5 ; valid # 7.0 SIDDHAM LETTER A..SIDDHAM VOWEL SIGN VOCALIC RR +115B6..115B7 ; disallowed # NA .. +115B8..115C0 ; valid # 7.0 SIDDHAM VOWEL SIGN E..SIDDHAM SIGN NUKTA +115C1..115C9 ; valid ; ; NV8 # 7.0 SIDDHAM SIGN SIDDHAM..SIDDHAM END OF TEXT MARK +115CA..115D7 ; valid ; ; NV8 # 8.0 SIDDHAM SECTION MARK WITH TRIDENT AND U-SHAPED ORNAMENTS..SIDDHAM SECTION MARK WITH CIRCLES AND FOUR ENCLOSURES +115D8..115DD ; valid # 8.0 SIDDHAM LETTER THREE-CIRCLE ALTERNATE I..SIDDHAM VOWEL SIGN ALTERNATE UU +115DE..115FF ; disallowed # NA .. +11600..11640 ; valid # 7.0 MODI LETTER A..MODI SIGN ARDHACANDRA +11641..11643 ; valid ; ; NV8 # 7.0 MODI DANDA..MODI ABBREVIATION SIGN +11644 ; valid # 7.0 MODI SIGN HUVA +11645..1164F ; disallowed # NA .. +11650..11659 ; valid # 7.0 MODI DIGIT ZERO..MODI DIGIT NINE +1165A..1165F ; disallowed # NA .. +11660..1166C ; valid ; ; NV8 # 9.0 MONGOLIAN BIRGA WITH ORNAMENT..MONGOLIAN TURNED SWIRL BIRGA WITH DOUBLE ORNAMENT +1166D..1167F ; disallowed # NA .. +11680..116B7 ; valid # 6.1 TAKRI LETTER A..TAKRI SIGN NUKTA +116B8 ; valid # 12.0 TAKRI LETTER ARCHAIC KHA +116B9 ; valid ; ; NV8 # 14.0 TAKRI ABBREVIATION SIGN +116BA..116BF ; disallowed # NA .. +116C0..116C9 ; valid # 6.1 TAKRI DIGIT ZERO..TAKRI DIGIT NINE +116CA..116FF ; disallowed # NA .. +11700..11719 ; valid # 8.0 AHOM LETTER KA..AHOM LETTER JHA +1171A ; valid # 11.0 AHOM LETTER ALTERNATE BA +1171B..1171C ; disallowed # NA .. +1171D..1172B ; valid # 8.0 AHOM CONSONANT SIGN MEDIAL LA..AHOM SIGN KILLER +1172C..1172F ; disallowed # NA .. +11730..11739 ; valid # 8.0 AHOM DIGIT ZERO..AHOM DIGIT NINE +1173A..1173F ; valid ; ; NV8 # 8.0 AHOM NUMBER TEN..AHOM SYMBOL VI +11740..11746 ; valid # 14.0 AHOM LETTER CA..AHOM LETTER LLA +11747..117FF ; disallowed # NA .. +11800..1183A ; valid # 11.0 DOGRA LETTER A..DOGRA SIGN NUKTA +1183B ; valid ; ; NV8 # 11.0 DOGRA ABBREVIATION SIGN +1183C..1189F ; disallowed # NA .. +118A0 ; mapped ; 118C0 # 7.0 WARANG CITI CAPITAL LETTER NGAA +118A1 ; mapped ; 118C1 # 7.0 WARANG CITI CAPITAL LETTER A +118A2 ; mapped ; 118C2 # 7.0 WARANG CITI CAPITAL LETTER WI +118A3 ; mapped ; 118C3 # 7.0 WARANG CITI CAPITAL LETTER YU +118A4 ; mapped ; 118C4 # 7.0 WARANG CITI CAPITAL LETTER YA +118A5 ; mapped ; 118C5 # 7.0 WARANG CITI CAPITAL LETTER YO +118A6 ; mapped ; 118C6 # 7.0 WARANG CITI CAPITAL LETTER II +118A7 ; mapped ; 118C7 # 7.0 WARANG CITI CAPITAL LETTER UU +118A8 ; mapped ; 118C8 # 7.0 WARANG CITI CAPITAL LETTER E +118A9 ; mapped ; 118C9 # 7.0 WARANG CITI CAPITAL LETTER O +118AA ; mapped ; 118CA # 7.0 WARANG CITI CAPITAL LETTER ANG +118AB ; mapped ; 118CB # 7.0 WARANG CITI CAPITAL LETTER GA +118AC ; mapped ; 118CC # 7.0 WARANG CITI CAPITAL LETTER KO +118AD ; mapped ; 118CD # 7.0 WARANG CITI CAPITAL LETTER ENY +118AE ; mapped ; 118CE # 7.0 WARANG CITI CAPITAL LETTER YUJ +118AF ; mapped ; 118CF # 7.0 WARANG CITI CAPITAL LETTER UC +118B0 ; mapped ; 118D0 # 7.0 WARANG CITI CAPITAL LETTER ENN +118B1 ; mapped ; 118D1 # 7.0 WARANG CITI CAPITAL LETTER ODD +118B2 ; mapped ; 118D2 # 7.0 WARANG CITI CAPITAL LETTER TTE +118B3 ; mapped ; 118D3 # 7.0 WARANG CITI CAPITAL LETTER NUNG +118B4 ; mapped ; 118D4 # 7.0 WARANG CITI CAPITAL LETTER DA +118B5 ; mapped ; 118D5 # 7.0 WARANG CITI CAPITAL LETTER AT +118B6 ; mapped ; 118D6 # 7.0 WARANG CITI CAPITAL LETTER AM +118B7 ; mapped ; 118D7 # 7.0 WARANG CITI CAPITAL LETTER BU +118B8 ; mapped ; 118D8 # 7.0 WARANG CITI CAPITAL LETTER PU +118B9 ; mapped ; 118D9 # 7.0 WARANG CITI CAPITAL LETTER HIYO +118BA ; mapped ; 118DA # 7.0 WARANG CITI CAPITAL LETTER HOLO +118BB ; mapped ; 118DB # 7.0 WARANG CITI CAPITAL LETTER HORR +118BC ; mapped ; 118DC # 7.0 WARANG CITI CAPITAL LETTER HAR +118BD ; mapped ; 118DD # 7.0 WARANG CITI CAPITAL LETTER SSUU +118BE ; mapped ; 118DE # 7.0 WARANG CITI CAPITAL LETTER SII +118BF ; mapped ; 118DF # 7.0 WARANG CITI CAPITAL LETTER VIYO +118C0..118E9 ; valid # 7.0 WARANG CITI SMALL LETTER NGAA..WARANG CITI DIGIT NINE +118EA..118F2 ; valid ; ; NV8 # 7.0 WARANG CITI NUMBER TEN..WARANG CITI NUMBER NINETY +118F3..118FE ; disallowed # NA .. +118FF ; valid # 7.0 WARANG CITI OM +11900..11906 ; valid # 13.0 DIVES AKURU LETTER A..DIVES AKURU LETTER E +11907..11908 ; disallowed # NA .. +11909 ; valid # 13.0 DIVES AKURU LETTER O +1190A..1190B ; disallowed # NA .. +1190C..11913 ; valid # 13.0 DIVES AKURU LETTER KA..DIVES AKURU LETTER JA +11914 ; disallowed # NA +11915..11916 ; valid # 13.0 DIVES AKURU LETTER NYA..DIVES AKURU LETTER TTA +11917 ; disallowed # NA +11918..11935 ; valid # 13.0 DIVES AKURU LETTER DDA..DIVES AKURU VOWEL SIGN E +11936 ; disallowed # NA +11937..11938 ; valid # 13.0 DIVES AKURU VOWEL SIGN AI..DIVES AKURU VOWEL SIGN O +11939..1193A ; disallowed # NA .. +1193B..11943 ; valid # 13.0 DIVES AKURU SIGN ANUSVARA..DIVES AKURU SIGN NUKTA +11944..11946 ; valid ; ; NV8 # 13.0 DIVES AKURU DOUBLE DANDA..DIVES AKURU END OF TEXT MARK +11947..1194F ; disallowed # NA .. +11950..11959 ; valid # 13.0 DIVES AKURU DIGIT ZERO..DIVES AKURU DIGIT NINE +1195A..1199F ; disallowed # NA .. +119A0..119A7 ; valid # 12.0 NANDINAGARI LETTER A..NANDINAGARI LETTER VOCALIC RR +119A8..119A9 ; disallowed # NA .. +119AA..119D7 ; valid # 12.0 NANDINAGARI LETTER E..NANDINAGARI VOWEL SIGN VOCALIC RR +119D8..119D9 ; disallowed # NA .. +119DA..119E1 ; valid # 12.0 NANDINAGARI VOWEL SIGN E..NANDINAGARI SIGN AVAGRAHA +119E2 ; valid ; ; NV8 # 12.0 NANDINAGARI SIGN SIDDHAM +119E3..119E4 ; valid # 12.0 NANDINAGARI HEADSTROKE..NANDINAGARI VOWEL SIGN PRISHTHAMATRA E +119E5..119FF ; disallowed # NA .. +11A00..11A3E ; valid # 10.0 ZANABAZAR SQUARE LETTER A..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA +11A3F..11A46 ; valid ; ; NV8 # 10.0 ZANABAZAR SQUARE INITIAL HEAD MARK..ZANABAZAR SQUARE CLOSING DOUBLE-LINED HEAD MARK +11A47 ; valid # 10.0 ZANABAZAR SQUARE SUBJOINER +11A48..11A4F ; disallowed # NA .. +11A50..11A83 ; valid # 10.0 SOYOMBO LETTER A..SOYOMBO LETTER KSSA +11A84..11A85 ; valid # 12.0 SOYOMBO SIGN JIHVAMULIYA..SOYOMBO SIGN UPADHMANIYA +11A86..11A99 ; valid # 10.0 SOYOMBO CLUSTER-INITIAL LETTER RA..SOYOMBO SUBJOINER +11A9A..11A9C ; valid ; ; NV8 # 10.0 SOYOMBO MARK TSHEG..SOYOMBO MARK DOUBLE SHAD +11A9D ; valid # 11.0 SOYOMBO MARK PLUTA +11A9E..11AA2 ; valid ; ; NV8 # 10.0 SOYOMBO HEAD MARK WITH MOON AND SUN AND TRIPLE FLAME..SOYOMBO TERMINAL MARK-2 +11AA3..11AAF ; disallowed # NA .. +11AB0..11ABF ; valid # 14.0 CANADIAN SYLLABICS NATTILIK HI..CANADIAN SYLLABICS SPA +11AC0..11AF8 ; valid # 7.0 PAU CIN HAU LETTER PA..PAU CIN HAU GLOTTAL STOP FINAL +11AF9..11AFF ; disallowed # NA .. +11B00..11B09 ; valid ; ; NV8 # 15.0 DEVANAGARI HEAD MARK..DEVANAGARI SIGN MINDU +11B0A..11BFF ; disallowed # NA .. +11C00..11C08 ; valid # 9.0 BHAIKSUKI LETTER A..BHAIKSUKI LETTER VOCALIC L +11C09 ; disallowed # NA +11C0A..11C36 ; valid # 9.0 BHAIKSUKI LETTER E..BHAIKSUKI VOWEL SIGN VOCALIC L +11C37 ; disallowed # NA +11C38..11C40 ; valid # 9.0 BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN AVAGRAHA +11C41..11C45 ; valid ; ; NV8 # 9.0 BHAIKSUKI DANDA..BHAIKSUKI GAP FILLER-2 +11C46..11C4F ; disallowed # NA .. +11C50..11C59 ; valid # 9.0 BHAIKSUKI DIGIT ZERO..BHAIKSUKI DIGIT NINE +11C5A..11C6C ; valid ; ; NV8 # 9.0 BHAIKSUKI NUMBER ONE..BHAIKSUKI HUNDREDS UNIT MARK +11C6D..11C6F ; disallowed # NA .. +11C70..11C71 ; valid ; ; NV8 # 9.0 MARCHEN HEAD MARK..MARCHEN MARK SHAD +11C72..11C8F ; valid # 9.0 MARCHEN LETTER KA..MARCHEN LETTER A +11C90..11C91 ; disallowed # NA .. +11C92..11CA7 ; valid # 9.0 MARCHEN SUBJOINED LETTER KA..MARCHEN SUBJOINED LETTER ZA +11CA8 ; disallowed # NA +11CA9..11CB6 ; valid # 9.0 MARCHEN SUBJOINED LETTER YA..MARCHEN SIGN CANDRABINDU +11CB7..11CFF ; disallowed # NA .. +11D00..11D06 ; valid # 10.0 MASARAM GONDI LETTER A..MASARAM GONDI LETTER E +11D07 ; disallowed # NA +11D08..11D09 ; valid # 10.0 MASARAM GONDI LETTER AI..MASARAM GONDI LETTER O +11D0A ; disallowed # NA +11D0B..11D36 ; valid # 10.0 MASARAM GONDI LETTER AU..MASARAM GONDI VOWEL SIGN VOCALIC R +11D37..11D39 ; disallowed # NA .. +11D3A ; valid # 10.0 MASARAM GONDI VOWEL SIGN E +11D3B ; disallowed # NA +11D3C..11D3D ; valid # 10.0 MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O +11D3E ; disallowed # NA +11D3F..11D47 ; valid # 10.0 MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI RA-KARA +11D48..11D4F ; disallowed # NA .. +11D50..11D59 ; valid # 10.0 MASARAM GONDI DIGIT ZERO..MASARAM GONDI DIGIT NINE +11D5A..11D5F ; disallowed # NA .. +11D60..11D65 ; valid # 11.0 GUNJALA GONDI LETTER A..GUNJALA GONDI LETTER UU +11D66 ; disallowed # NA +11D67..11D68 ; valid # 11.0 GUNJALA GONDI LETTER EE..GUNJALA GONDI LETTER AI +11D69 ; disallowed # NA +11D6A..11D8E ; valid # 11.0 GUNJALA GONDI LETTER OO..GUNJALA GONDI VOWEL SIGN UU +11D8F ; disallowed # NA +11D90..11D91 ; valid # 11.0 GUNJALA GONDI VOWEL SIGN EE..GUNJALA GONDI VOWEL SIGN AI +11D92 ; disallowed # NA +11D93..11D98 ; valid # 11.0 GUNJALA GONDI VOWEL SIGN OO..GUNJALA GONDI OM +11D99..11D9F ; disallowed # NA .. +11DA0..11DA9 ; valid # 11.0 GUNJALA GONDI DIGIT ZERO..GUNJALA GONDI DIGIT NINE +11DAA..11EDF ; disallowed # NA .. +11EE0..11EF6 ; valid # 11.0 MAKASAR LETTER KA..MAKASAR VOWEL SIGN O +11EF7..11EF8 ; valid ; ; NV8 # 11.0 MAKASAR PASSIMBANG..MAKASAR END OF SECTION +11EF9..11EFF ; disallowed # NA .. +11F00..11F10 ; valid # 15.0 KAWI SIGN CANDRABINDU..KAWI LETTER O +11F11 ; disallowed # NA +11F12..11F3A ; valid # 15.0 KAWI LETTER KA..KAWI VOWEL SIGN VOCALIC R +11F3B..11F3D ; disallowed # NA .. +11F3E..11F42 ; valid # 15.0 KAWI VOWEL SIGN E..KAWI CONJOINER +11F43..11F4F ; valid ; ; NV8 # 15.0 KAWI DANDA..KAWI PUNCTUATION CLOSING SPIRAL +11F50..11F59 ; valid # 15.0 KAWI DIGIT ZERO..KAWI DIGIT NINE +11F5A..11FAF ; disallowed # NA .. +11FB0 ; valid # 13.0 LISU LETTER YHA +11FB1..11FBF ; disallowed # NA .. +11FC0..11FF1 ; valid ; ; NV8 # 12.0 TAMIL FRACTION ONE THREE-HUNDRED-AND-TWENTIETH..TAMIL SIGN VAKAIYARAA +11FF2..11FFE ; disallowed # NA .. +11FFF ; valid ; ; NV8 # 12.0 TAMIL PUNCTUATION END OF TEXT +12000..1236E ; valid # 5.0 CUNEIFORM SIGN A..CUNEIFORM SIGN ZUM +1236F..12398 ; valid # 7.0 CUNEIFORM SIGN KAP ELAMITE..CUNEIFORM SIGN UM TIMES ME +12399 ; valid # 8.0 CUNEIFORM SIGN U U +1239A..123FF ; disallowed # NA .. +12400..12462 ; valid ; ; NV8 # 5.0 CUNEIFORM NUMERIC SIGN TWO ASH..CUNEIFORM NUMERIC SIGN OLD ASSYRIAN ONE QUARTER +12463..1246E ; valid ; ; NV8 # 7.0 CUNEIFORM NUMERIC SIGN ONE QUARTER GUR..CUNEIFORM NUMERIC SIGN NINE U VARIANT FORM +1246F ; disallowed # NA +12470..12473 ; valid ; ; NV8 # 5.0 CUNEIFORM PUNCTUATION SIGN OLD ASSYRIAN WORD DIVIDER..CUNEIFORM PUNCTUATION SIGN DIAGONAL TRICOLON +12474 ; valid ; ; NV8 # 7.0 CUNEIFORM PUNCTUATION SIGN DIAGONAL QUADCOLON +12475..1247F ; disallowed # NA .. +12480..12543 ; valid # 8.0 CUNEIFORM SIGN AB TIMES NUN TENU..CUNEIFORM SIGN ZU5 TIMES THREE DISH TENU +12544..12F8F ; disallowed # NA .. +12F90..12FF0 ; valid # 14.0 CYPRO-MINOAN SIGN CM001..CYPRO-MINOAN SIGN CM114 +12FF1..12FF2 ; valid ; ; NV8 # 14.0 CYPRO-MINOAN SIGN CM301..CYPRO-MINOAN SIGN CM302 +12FF3..12FFF ; disallowed # NA .. +13000..1342E ; valid # 5.2 EGYPTIAN HIEROGLYPH A001..EGYPTIAN HIEROGLYPH AA032 +1342F ; valid # 15.0 EGYPTIAN HIEROGLYPH V011D +13430..13438 ; disallowed # 12.0 EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH END SEGMENT +13439..1343F ; disallowed # 15.0 EGYPTIAN HIEROGLYPH INSERT AT MIDDLE..EGYPTIAN HIEROGLYPH END WALLED ENCLOSURE +13440..13455 ; valid # 15.0 EGYPTIAN HIEROGLYPH MIRROR HORIZONTALLY..EGYPTIAN HIEROGLYPH MODIFIER DAMAGED +13456..143FF ; disallowed # NA .. +14400..14646 ; valid # 8.0 ANATOLIAN HIEROGLYPH A001..ANATOLIAN HIEROGLYPH A530 +14647..167FF ; disallowed # NA .. +16800..16A38 ; valid # 6.0 BAMUM LETTER PHASE-A NGKUE MFON..BAMUM LETTER PHASE-F VUEQ +16A39..16A3F ; disallowed # NA .. +16A40..16A5E ; valid # 7.0 MRO LETTER TA..MRO LETTER TEK +16A5F ; disallowed # NA +16A60..16A69 ; valid # 7.0 MRO DIGIT ZERO..MRO DIGIT NINE +16A6A..16A6D ; disallowed # NA .. +16A6E..16A6F ; valid ; ; NV8 # 7.0 MRO DANDA..MRO DOUBLE DANDA +16A70..16ABE ; valid # 14.0 TANGSA LETTER OZ..TANGSA LETTER ZA +16ABF ; disallowed # NA +16AC0..16AC9 ; valid # 14.0 TANGSA DIGIT ZERO..TANGSA DIGIT NINE +16ACA..16ACF ; disallowed # NA .. +16AD0..16AED ; valid # 7.0 BASSA VAH LETTER ENNI..BASSA VAH LETTER I +16AEE..16AEF ; disallowed # NA .. +16AF0..16AF4 ; valid # 7.0 BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE +16AF5 ; valid ; ; NV8 # 7.0 BASSA VAH FULL STOP +16AF6..16AFF ; disallowed # NA .. +16B00..16B36 ; valid # 7.0 PAHAWH HMONG VOWEL KEEB..PAHAWH HMONG MARK CIM TAUM +16B37..16B3F ; valid ; ; NV8 # 7.0 PAHAWH HMONG SIGN VOS THOM..PAHAWH HMONG SIGN XYEEM FAIB +16B40..16B43 ; valid # 7.0 PAHAWH HMONG SIGN VOS SEEV..PAHAWH HMONG SIGN IB YAM +16B44..16B45 ; valid ; ; NV8 # 7.0 PAHAWH HMONG SIGN XAUS..PAHAWH HMONG SIGN CIM TSOV ROG +16B46..16B4F ; disallowed # NA .. +16B50..16B59 ; valid # 7.0 PAHAWH HMONG DIGIT ZERO..PAHAWH HMONG DIGIT NINE +16B5A ; disallowed # NA +16B5B..16B61 ; valid ; ; NV8 # 7.0 PAHAWH HMONG NUMBER TENS..PAHAWH HMONG NUMBER TRILLIONS +16B62 ; disallowed # NA +16B63..16B77 ; valid # 7.0 PAHAWH HMONG SIGN VOS LUB..PAHAWH HMONG SIGN CIM NRES TOS +16B78..16B7C ; disallowed # NA .. +16B7D..16B8F ; valid # 7.0 PAHAWH HMONG CLAN SIGN TSHEEJ..PAHAWH HMONG CLAN SIGN VWJ +16B90..16E3F ; disallowed # NA .. +16E40 ; mapped ; 16E60 # 11.0 MEDEFAIDRIN CAPITAL LETTER M +16E41 ; mapped ; 16E61 # 11.0 MEDEFAIDRIN CAPITAL LETTER S +16E42 ; mapped ; 16E62 # 11.0 MEDEFAIDRIN CAPITAL LETTER V +16E43 ; mapped ; 16E63 # 11.0 MEDEFAIDRIN CAPITAL LETTER W +16E44 ; mapped ; 16E64 # 11.0 MEDEFAIDRIN CAPITAL LETTER ATIU +16E45 ; mapped ; 16E65 # 11.0 MEDEFAIDRIN CAPITAL LETTER Z +16E46 ; mapped ; 16E66 # 11.0 MEDEFAIDRIN CAPITAL LETTER KP +16E47 ; mapped ; 16E67 # 11.0 MEDEFAIDRIN CAPITAL LETTER P +16E48 ; mapped ; 16E68 # 11.0 MEDEFAIDRIN CAPITAL LETTER T +16E49 ; mapped ; 16E69 # 11.0 MEDEFAIDRIN CAPITAL LETTER G +16E4A ; mapped ; 16E6A # 11.0 MEDEFAIDRIN CAPITAL LETTER F +16E4B ; mapped ; 16E6B # 11.0 MEDEFAIDRIN CAPITAL LETTER I +16E4C ; mapped ; 16E6C # 11.0 MEDEFAIDRIN CAPITAL LETTER K +16E4D ; mapped ; 16E6D # 11.0 MEDEFAIDRIN CAPITAL LETTER A +16E4E ; mapped ; 16E6E # 11.0 MEDEFAIDRIN CAPITAL LETTER J +16E4F ; mapped ; 16E6F # 11.0 MEDEFAIDRIN CAPITAL LETTER E +16E50 ; mapped ; 16E70 # 11.0 MEDEFAIDRIN CAPITAL LETTER B +16E51 ; mapped ; 16E71 # 11.0 MEDEFAIDRIN CAPITAL LETTER C +16E52 ; mapped ; 16E72 # 11.0 MEDEFAIDRIN CAPITAL LETTER U +16E53 ; mapped ; 16E73 # 11.0 MEDEFAIDRIN CAPITAL LETTER YU +16E54 ; mapped ; 16E74 # 11.0 MEDEFAIDRIN CAPITAL LETTER L +16E55 ; mapped ; 16E75 # 11.0 MEDEFAIDRIN CAPITAL LETTER Q +16E56 ; mapped ; 16E76 # 11.0 MEDEFAIDRIN CAPITAL LETTER HP +16E57 ; mapped ; 16E77 # 11.0 MEDEFAIDRIN CAPITAL LETTER NY +16E58 ; mapped ; 16E78 # 11.0 MEDEFAIDRIN CAPITAL LETTER X +16E59 ; mapped ; 16E79 # 11.0 MEDEFAIDRIN CAPITAL LETTER D +16E5A ; mapped ; 16E7A # 11.0 MEDEFAIDRIN CAPITAL LETTER OE +16E5B ; mapped ; 16E7B # 11.0 MEDEFAIDRIN CAPITAL LETTER N +16E5C ; mapped ; 16E7C # 11.0 MEDEFAIDRIN CAPITAL LETTER R +16E5D ; mapped ; 16E7D # 11.0 MEDEFAIDRIN CAPITAL LETTER O +16E5E ; mapped ; 16E7E # 11.0 MEDEFAIDRIN CAPITAL LETTER AI +16E5F ; mapped ; 16E7F # 11.0 MEDEFAIDRIN CAPITAL LETTER Y +16E60..16E7F ; valid # 11.0 MEDEFAIDRIN SMALL LETTER M..MEDEFAIDRIN SMALL LETTER Y +16E80..16E9A ; valid ; ; NV8 # 11.0 MEDEFAIDRIN DIGIT ZERO..MEDEFAIDRIN EXCLAMATION OH +16E9B..16EFF ; disallowed # NA .. +16F00..16F44 ; valid # 6.1 MIAO LETTER PA..MIAO LETTER HHA +16F45..16F4A ; valid # 12.0 MIAO LETTER BRI..MIAO LETTER RTE +16F4B..16F4E ; disallowed # NA .. +16F4F ; valid # 12.0 MIAO SIGN CONSONANT MODIFIER BAR +16F50..16F7E ; valid # 6.1 MIAO LETTER NASALIZATION..MIAO VOWEL SIGN NG +16F7F..16F87 ; valid # 12.0 MIAO VOWEL SIGN UOG..MIAO VOWEL SIGN UI +16F88..16F8E ; disallowed # NA .. +16F8F..16F9F ; valid # 6.1 MIAO TONE RIGHT..MIAO LETTER REFORMED TONE-8 +16FA0..16FDF ; disallowed # NA .. +16FE0 ; valid # 9.0 TANGUT ITERATION MARK +16FE1 ; valid # 10.0 NUSHU ITERATION MARK +16FE2 ; valid ; ; NV8 # 12.0 OLD CHINESE HOOK MARK +16FE3 ; valid # 12.0 OLD CHINESE ITERATION MARK +16FE4 ; valid # 13.0 KHITAN SMALL SCRIPT FILLER +16FE5..16FEF ; disallowed # NA .. +16FF0..16FF1 ; valid # 13.0 VIETNAMESE ALTERNATE READING MARK CA..VIETNAMESE ALTERNATE READING MARK NHAY +16FF2..16FFF ; disallowed # NA .. +17000..187EC ; valid # 9.0 TANGUT IDEOGRAPH-17000..TANGUT IDEOGRAPH-187EC +187ED..187F1 ; valid # 11.0 TANGUT IDEOGRAPH-187ED..TANGUT IDEOGRAPH-187F1 +187F2..187F7 ; valid # 12.0 TANGUT IDEOGRAPH-187F2..TANGUT IDEOGRAPH-187F7 +187F8..187FF ; disallowed # NA .. +18800..18AF2 ; valid # 9.0 TANGUT COMPONENT-001..TANGUT COMPONENT-755 +18AF3..18CD5 ; valid # 13.0 TANGUT COMPONENT-756..KHITAN SMALL SCRIPT CHARACTER-18CD5 +18CD6..18CFF ; disallowed # NA .. +18D00..18D08 ; valid # 13.0 TANGUT IDEOGRAPH-18D00..TANGUT IDEOGRAPH-18D08 +18D09..1AFEF ; disallowed # NA .. +1AFF0..1AFF3 ; valid # 14.0 KATAKANA LETTER MINNAN TONE-2..KATAKANA LETTER MINNAN TONE-5 +1AFF4 ; disallowed # NA +1AFF5..1AFFB ; valid # 14.0 KATAKANA LETTER MINNAN TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-5 +1AFFC ; disallowed # NA +1AFFD..1AFFE ; valid # 14.0 KATAKANA LETTER MINNAN NASALIZED TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-8 +1AFFF ; disallowed # NA +1B000..1B001 ; valid # 6.0 KATAKANA LETTER ARCHAIC E..HIRAGANA LETTER ARCHAIC YE +1B002..1B11E ; valid # 10.0 HENTAIGANA LETTER A-1..HENTAIGANA LETTER N-MU-MO-2 +1B11F..1B122 ; valid # 14.0 HIRAGANA LETTER ARCHAIC WU..KATAKANA LETTER ARCHAIC WU +1B123..1B131 ; disallowed # NA .. +1B132 ; valid # 15.0 HIRAGANA LETTER SMALL KO +1B133..1B14F ; disallowed # NA .. +1B150..1B152 ; valid # 12.0 HIRAGANA LETTER SMALL WI..HIRAGANA LETTER SMALL WO +1B153..1B154 ; disallowed # NA .. +1B155 ; valid # 15.0 KATAKANA LETTER SMALL KO +1B156..1B163 ; disallowed # NA .. +1B164..1B167 ; valid # 12.0 KATAKANA LETTER SMALL WI..KATAKANA LETTER SMALL N +1B168..1B16F ; disallowed # NA .. +1B170..1B2FB ; valid # 10.0 NUSHU CHARACTER-1B170..NUSHU CHARACTER-1B2FB +1B2FC..1BBFF ; disallowed # NA .. +1BC00..1BC6A ; valid # 7.0 DUPLOYAN LETTER H..DUPLOYAN LETTER VOCALIC M +1BC6B..1BC6F ; disallowed # NA .. +1BC70..1BC7C ; valid # 7.0 DUPLOYAN AFFIX LEFT HORIZONTAL SECANT..DUPLOYAN AFFIX ATTACHED TANGENT HOOK +1BC7D..1BC7F ; disallowed # NA .. +1BC80..1BC88 ; valid # 7.0 DUPLOYAN AFFIX HIGH ACUTE..DUPLOYAN AFFIX HIGH VERTICAL +1BC89..1BC8F ; disallowed # NA .. +1BC90..1BC99 ; valid # 7.0 DUPLOYAN AFFIX LOW ACUTE..DUPLOYAN AFFIX LOW ARROW +1BC9A..1BC9B ; disallowed # NA .. +1BC9C ; valid ; ; NV8 # 7.0 DUPLOYAN SIGN O WITH CROSS +1BC9D..1BC9E ; valid # 7.0 DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK +1BC9F ; valid ; ; NV8 # 7.0 DUPLOYAN PUNCTUATION CHINOOK FULL STOP +1BCA0..1BCA3 ; ignored # 7.0 SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP +1BCA4..1CEFF ; disallowed # NA .. +1CF00..1CF2D ; valid # 14.0 ZNAMENNY COMBINING MARK GORAZDO NIZKO S KRYZHEM ON LEFT..ZNAMENNY COMBINING MARK KRYZH ON LEFT +1CF2E..1CF2F ; disallowed # NA .. +1CF30..1CF46 ; valid # 14.0 ZNAMENNY COMBINING TONAL RANGE MARK MRACHNO..ZNAMENNY PRIZNAK MODIFIER ROG +1CF47..1CF4F ; disallowed # NA .. +1CF50..1CFC3 ; valid ; ; NV8 # 14.0 ZNAMENNY NEUME KRYUK..ZNAMENNY NEUME PAUK +1CFC4..1CFFF ; disallowed # NA .. +1D000..1D0F5 ; valid ; ; NV8 # 3.1 BYZANTINE MUSICAL SYMBOL PSILI..BYZANTINE MUSICAL SYMBOL GORGON NEO KATO +1D0F6..1D0FF ; disallowed # NA .. +1D100..1D126 ; valid ; ; NV8 # 3.1 MUSICAL SYMBOL SINGLE BARLINE..MUSICAL SYMBOL DRUM CLEF-2 +1D127..1D128 ; disallowed # NA .. +1D129 ; valid ; ; NV8 # 5.1 MUSICAL SYMBOL MULTIPLE MEASURE REST +1D12A..1D15D ; valid ; ; NV8 # 3.1 MUSICAL SYMBOL DOUBLE SHARP..MUSICAL SYMBOL WHOLE NOTE +1D15E ; mapped ; 1D157 1D165 # 3.1 MUSICAL SYMBOL HALF NOTE +1D15F ; mapped ; 1D158 1D165 # 3.1 MUSICAL SYMBOL QUARTER NOTE +1D160 ; mapped ; 1D158 1D165 1D16E #3.1 MUSICAL SYMBOL EIGHTH NOTE +1D161 ; mapped ; 1D158 1D165 1D16F #3.1 MUSICAL SYMBOL SIXTEENTH NOTE +1D162 ; mapped ; 1D158 1D165 1D170 #3.1 MUSICAL SYMBOL THIRTY-SECOND NOTE +1D163 ; mapped ; 1D158 1D165 1D171 #3.1 MUSICAL SYMBOL SIXTY-FOURTH NOTE +1D164 ; mapped ; 1D158 1D165 1D172 #3.1 MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE +1D165..1D172 ; valid ; ; NV8 # 3.1 MUSICAL SYMBOL COMBINING STEM..MUSICAL SYMBOL COMBINING FLAG-5 +1D173..1D17A ; disallowed # 3.1 MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE +1D17B..1D1BA ; valid ; ; NV8 # 3.1 MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL SEMIBREVIS BLACK +1D1BB ; mapped ; 1D1B9 1D165 # 3.1 MUSICAL SYMBOL MINIMA +1D1BC ; mapped ; 1D1BA 1D165 # 3.1 MUSICAL SYMBOL MINIMA BLACK +1D1BD ; mapped ; 1D1B9 1D165 1D16E #3.1 MUSICAL SYMBOL SEMIMINIMA WHITE +1D1BE ; mapped ; 1D1BA 1D165 1D16E #3.1 MUSICAL SYMBOL SEMIMINIMA BLACK +1D1BF ; mapped ; 1D1B9 1D165 1D16F #3.1 MUSICAL SYMBOL FUSA WHITE +1D1C0 ; mapped ; 1D1BA 1D165 1D16F #3.1 MUSICAL SYMBOL FUSA BLACK +1D1C1..1D1DD ; valid ; ; NV8 # 3.1 MUSICAL SYMBOL LONGA PERFECTA REST..MUSICAL SYMBOL PES SUBPUNCTIS +1D1DE..1D1E8 ; valid ; ; NV8 # 8.0 MUSICAL SYMBOL KIEVAN C CLEF..MUSICAL SYMBOL KIEVAN FLAT SIGN +1D1E9..1D1EA ; valid ; ; NV8 # 14.0 MUSICAL SYMBOL SORI..MUSICAL SYMBOL KORON +1D1EB..1D1FF ; disallowed # NA .. +1D200..1D245 ; valid ; ; NV8 # 4.1 GREEK VOCAL NOTATION SYMBOL-1..GREEK MUSICAL LEIMMA +1D246..1D2BF ; disallowed # NA .. +1D2C0..1D2D3 ; valid ; ; NV8 # 15.0 KAKTOVIK NUMERAL ZERO..KAKTOVIK NUMERAL NINETEEN +1D2D4..1D2DF ; disallowed # NA .. +1D2E0..1D2F3 ; valid ; ; NV8 # 11.0 MAYAN NUMERAL ZERO..MAYAN NUMERAL NINETEEN +1D2F4..1D2FF ; disallowed # NA .. +1D300..1D356 ; valid ; ; NV8 # 4.0 MONOGRAM FOR EARTH..TETRAGRAM FOR FOSTERING +1D357..1D35F ; disallowed # NA .. +1D360..1D371 ; valid ; ; NV8 # 5.0 COUNTING ROD UNIT DIGIT ONE..COUNTING ROD TENS DIGIT NINE +1D372..1D378 ; valid ; ; NV8 # 11.0 IDEOGRAPHIC TALLY MARK ONE..TALLY MARK FIVE +1D379..1D3FF ; disallowed # NA .. +1D400 ; mapped ; 0061 # 3.1 MATHEMATICAL BOLD CAPITAL A +1D401 ; mapped ; 0062 # 3.1 MATHEMATICAL BOLD CAPITAL B +1D402 ; mapped ; 0063 # 3.1 MATHEMATICAL BOLD CAPITAL C +1D403 ; mapped ; 0064 # 3.1 MATHEMATICAL BOLD CAPITAL D +1D404 ; mapped ; 0065 # 3.1 MATHEMATICAL BOLD CAPITAL E +1D405 ; mapped ; 0066 # 3.1 MATHEMATICAL BOLD CAPITAL F +1D406 ; mapped ; 0067 # 3.1 MATHEMATICAL BOLD CAPITAL G +1D407 ; mapped ; 0068 # 3.1 MATHEMATICAL BOLD CAPITAL H +1D408 ; mapped ; 0069 # 3.1 MATHEMATICAL BOLD CAPITAL I +1D409 ; mapped ; 006A # 3.1 MATHEMATICAL BOLD CAPITAL J +1D40A ; mapped ; 006B # 3.1 MATHEMATICAL BOLD CAPITAL K +1D40B ; mapped ; 006C # 3.1 MATHEMATICAL BOLD CAPITAL L +1D40C ; mapped ; 006D # 3.1 MATHEMATICAL BOLD CAPITAL M +1D40D ; mapped ; 006E # 3.1 MATHEMATICAL BOLD CAPITAL N +1D40E ; mapped ; 006F # 3.1 MATHEMATICAL BOLD CAPITAL O +1D40F ; mapped ; 0070 # 3.1 MATHEMATICAL BOLD CAPITAL P +1D410 ; mapped ; 0071 # 3.1 MATHEMATICAL BOLD CAPITAL Q +1D411 ; mapped ; 0072 # 3.1 MATHEMATICAL BOLD CAPITAL R +1D412 ; mapped ; 0073 # 3.1 MATHEMATICAL BOLD CAPITAL S +1D413 ; mapped ; 0074 # 3.1 MATHEMATICAL BOLD CAPITAL T +1D414 ; mapped ; 0075 # 3.1 MATHEMATICAL BOLD CAPITAL U +1D415 ; mapped ; 0076 # 3.1 MATHEMATICAL BOLD CAPITAL V +1D416 ; mapped ; 0077 # 3.1 MATHEMATICAL BOLD CAPITAL W +1D417 ; mapped ; 0078 # 3.1 MATHEMATICAL BOLD CAPITAL X +1D418 ; mapped ; 0079 # 3.1 MATHEMATICAL BOLD CAPITAL Y +1D419 ; mapped ; 007A # 3.1 MATHEMATICAL BOLD CAPITAL Z +1D41A ; mapped ; 0061 # 3.1 MATHEMATICAL BOLD SMALL A +1D41B ; mapped ; 0062 # 3.1 MATHEMATICAL BOLD SMALL B +1D41C ; mapped ; 0063 # 3.1 MATHEMATICAL BOLD SMALL C +1D41D ; mapped ; 0064 # 3.1 MATHEMATICAL BOLD SMALL D +1D41E ; mapped ; 0065 # 3.1 MATHEMATICAL BOLD SMALL E +1D41F ; mapped ; 0066 # 3.1 MATHEMATICAL BOLD SMALL F +1D420 ; mapped ; 0067 # 3.1 MATHEMATICAL BOLD SMALL G +1D421 ; mapped ; 0068 # 3.1 MATHEMATICAL BOLD SMALL H +1D422 ; mapped ; 0069 # 3.1 MATHEMATICAL BOLD SMALL I +1D423 ; mapped ; 006A # 3.1 MATHEMATICAL BOLD SMALL J +1D424 ; mapped ; 006B # 3.1 MATHEMATICAL BOLD SMALL K +1D425 ; mapped ; 006C # 3.1 MATHEMATICAL BOLD SMALL L +1D426 ; mapped ; 006D # 3.1 MATHEMATICAL BOLD SMALL M +1D427 ; mapped ; 006E # 3.1 MATHEMATICAL BOLD SMALL N +1D428 ; mapped ; 006F # 3.1 MATHEMATICAL BOLD SMALL O +1D429 ; mapped ; 0070 # 3.1 MATHEMATICAL BOLD SMALL P +1D42A ; mapped ; 0071 # 3.1 MATHEMATICAL BOLD SMALL Q +1D42B ; mapped ; 0072 # 3.1 MATHEMATICAL BOLD SMALL R +1D42C ; mapped ; 0073 # 3.1 MATHEMATICAL BOLD SMALL S +1D42D ; mapped ; 0074 # 3.1 MATHEMATICAL BOLD SMALL T +1D42E ; mapped ; 0075 # 3.1 MATHEMATICAL BOLD SMALL U +1D42F ; mapped ; 0076 # 3.1 MATHEMATICAL BOLD SMALL V +1D430 ; mapped ; 0077 # 3.1 MATHEMATICAL BOLD SMALL W +1D431 ; mapped ; 0078 # 3.1 MATHEMATICAL BOLD SMALL X +1D432 ; mapped ; 0079 # 3.1 MATHEMATICAL BOLD SMALL Y +1D433 ; mapped ; 007A # 3.1 MATHEMATICAL BOLD SMALL Z +1D434 ; mapped ; 0061 # 3.1 MATHEMATICAL ITALIC CAPITAL A +1D435 ; mapped ; 0062 # 3.1 MATHEMATICAL ITALIC CAPITAL B +1D436 ; mapped ; 0063 # 3.1 MATHEMATICAL ITALIC CAPITAL C +1D437 ; mapped ; 0064 # 3.1 MATHEMATICAL ITALIC CAPITAL D +1D438 ; mapped ; 0065 # 3.1 MATHEMATICAL ITALIC CAPITAL E +1D439 ; mapped ; 0066 # 3.1 MATHEMATICAL ITALIC CAPITAL F +1D43A ; mapped ; 0067 # 3.1 MATHEMATICAL ITALIC CAPITAL G +1D43B ; mapped ; 0068 # 3.1 MATHEMATICAL ITALIC CAPITAL H +1D43C ; mapped ; 0069 # 3.1 MATHEMATICAL ITALIC CAPITAL I +1D43D ; mapped ; 006A # 3.1 MATHEMATICAL ITALIC CAPITAL J +1D43E ; mapped ; 006B # 3.1 MATHEMATICAL ITALIC CAPITAL K +1D43F ; mapped ; 006C # 3.1 MATHEMATICAL ITALIC CAPITAL L +1D440 ; mapped ; 006D # 3.1 MATHEMATICAL ITALIC CAPITAL M +1D441 ; mapped ; 006E # 3.1 MATHEMATICAL ITALIC CAPITAL N +1D442 ; mapped ; 006F # 3.1 MATHEMATICAL ITALIC CAPITAL O +1D443 ; mapped ; 0070 # 3.1 MATHEMATICAL ITALIC CAPITAL P +1D444 ; mapped ; 0071 # 3.1 MATHEMATICAL ITALIC CAPITAL Q +1D445 ; mapped ; 0072 # 3.1 MATHEMATICAL ITALIC CAPITAL R +1D446 ; mapped ; 0073 # 3.1 MATHEMATICAL ITALIC CAPITAL S +1D447 ; mapped ; 0074 # 3.1 MATHEMATICAL ITALIC CAPITAL T +1D448 ; mapped ; 0075 # 3.1 MATHEMATICAL ITALIC CAPITAL U +1D449 ; mapped ; 0076 # 3.1 MATHEMATICAL ITALIC CAPITAL V +1D44A ; mapped ; 0077 # 3.1 MATHEMATICAL ITALIC CAPITAL W +1D44B ; mapped ; 0078 # 3.1 MATHEMATICAL ITALIC CAPITAL X +1D44C ; mapped ; 0079 # 3.1 MATHEMATICAL ITALIC CAPITAL Y +1D44D ; mapped ; 007A # 3.1 MATHEMATICAL ITALIC CAPITAL Z +1D44E ; mapped ; 0061 # 3.1 MATHEMATICAL ITALIC SMALL A +1D44F ; mapped ; 0062 # 3.1 MATHEMATICAL ITALIC SMALL B +1D450 ; mapped ; 0063 # 3.1 MATHEMATICAL ITALIC SMALL C +1D451 ; mapped ; 0064 # 3.1 MATHEMATICAL ITALIC SMALL D +1D452 ; mapped ; 0065 # 3.1 MATHEMATICAL ITALIC SMALL E +1D453 ; mapped ; 0066 # 3.1 MATHEMATICAL ITALIC SMALL F +1D454 ; mapped ; 0067 # 3.1 MATHEMATICAL ITALIC SMALL G +1D455 ; disallowed # NA +1D456 ; mapped ; 0069 # 3.1 MATHEMATICAL ITALIC SMALL I +1D457 ; mapped ; 006A # 3.1 MATHEMATICAL ITALIC SMALL J +1D458 ; mapped ; 006B # 3.1 MATHEMATICAL ITALIC SMALL K +1D459 ; mapped ; 006C # 3.1 MATHEMATICAL ITALIC SMALL L +1D45A ; mapped ; 006D # 3.1 MATHEMATICAL ITALIC SMALL M +1D45B ; mapped ; 006E # 3.1 MATHEMATICAL ITALIC SMALL N +1D45C ; mapped ; 006F # 3.1 MATHEMATICAL ITALIC SMALL O +1D45D ; mapped ; 0070 # 3.1 MATHEMATICAL ITALIC SMALL P +1D45E ; mapped ; 0071 # 3.1 MATHEMATICAL ITALIC SMALL Q +1D45F ; mapped ; 0072 # 3.1 MATHEMATICAL ITALIC SMALL R +1D460 ; mapped ; 0073 # 3.1 MATHEMATICAL ITALIC SMALL S +1D461 ; mapped ; 0074 # 3.1 MATHEMATICAL ITALIC SMALL T +1D462 ; mapped ; 0075 # 3.1 MATHEMATICAL ITALIC SMALL U +1D463 ; mapped ; 0076 # 3.1 MATHEMATICAL ITALIC SMALL V +1D464 ; mapped ; 0077 # 3.1 MATHEMATICAL ITALIC SMALL W +1D465 ; mapped ; 0078 # 3.1 MATHEMATICAL ITALIC SMALL X +1D466 ; mapped ; 0079 # 3.1 MATHEMATICAL ITALIC SMALL Y +1D467 ; mapped ; 007A # 3.1 MATHEMATICAL ITALIC SMALL Z +1D468 ; mapped ; 0061 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL A +1D469 ; mapped ; 0062 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL B +1D46A ; mapped ; 0063 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL C +1D46B ; mapped ; 0064 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL D +1D46C ; mapped ; 0065 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL E +1D46D ; mapped ; 0066 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL F +1D46E ; mapped ; 0067 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL G +1D46F ; mapped ; 0068 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL H +1D470 ; mapped ; 0069 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL I +1D471 ; mapped ; 006A # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL J +1D472 ; mapped ; 006B # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL K +1D473 ; mapped ; 006C # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL L +1D474 ; mapped ; 006D # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL M +1D475 ; mapped ; 006E # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL N +1D476 ; mapped ; 006F # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL O +1D477 ; mapped ; 0070 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL P +1D478 ; mapped ; 0071 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL Q +1D479 ; mapped ; 0072 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL R +1D47A ; mapped ; 0073 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL S +1D47B ; mapped ; 0074 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL T +1D47C ; mapped ; 0075 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL U +1D47D ; mapped ; 0076 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL V +1D47E ; mapped ; 0077 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL W +1D47F ; mapped ; 0078 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL X +1D480 ; mapped ; 0079 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL Y +1D481 ; mapped ; 007A # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL Z +1D482 ; mapped ; 0061 # 3.1 MATHEMATICAL BOLD ITALIC SMALL A +1D483 ; mapped ; 0062 # 3.1 MATHEMATICAL BOLD ITALIC SMALL B +1D484 ; mapped ; 0063 # 3.1 MATHEMATICAL BOLD ITALIC SMALL C +1D485 ; mapped ; 0064 # 3.1 MATHEMATICAL BOLD ITALIC SMALL D +1D486 ; mapped ; 0065 # 3.1 MATHEMATICAL BOLD ITALIC SMALL E +1D487 ; mapped ; 0066 # 3.1 MATHEMATICAL BOLD ITALIC SMALL F +1D488 ; mapped ; 0067 # 3.1 MATHEMATICAL BOLD ITALIC SMALL G +1D489 ; mapped ; 0068 # 3.1 MATHEMATICAL BOLD ITALIC SMALL H +1D48A ; mapped ; 0069 # 3.1 MATHEMATICAL BOLD ITALIC SMALL I +1D48B ; mapped ; 006A # 3.1 MATHEMATICAL BOLD ITALIC SMALL J +1D48C ; mapped ; 006B # 3.1 MATHEMATICAL BOLD ITALIC SMALL K +1D48D ; mapped ; 006C # 3.1 MATHEMATICAL BOLD ITALIC SMALL L +1D48E ; mapped ; 006D # 3.1 MATHEMATICAL BOLD ITALIC SMALL M +1D48F ; mapped ; 006E # 3.1 MATHEMATICAL BOLD ITALIC SMALL N +1D490 ; mapped ; 006F # 3.1 MATHEMATICAL BOLD ITALIC SMALL O +1D491 ; mapped ; 0070 # 3.1 MATHEMATICAL BOLD ITALIC SMALL P +1D492 ; mapped ; 0071 # 3.1 MATHEMATICAL BOLD ITALIC SMALL Q +1D493 ; mapped ; 0072 # 3.1 MATHEMATICAL BOLD ITALIC SMALL R +1D494 ; mapped ; 0073 # 3.1 MATHEMATICAL BOLD ITALIC SMALL S +1D495 ; mapped ; 0074 # 3.1 MATHEMATICAL BOLD ITALIC SMALL T +1D496 ; mapped ; 0075 # 3.1 MATHEMATICAL BOLD ITALIC SMALL U +1D497 ; mapped ; 0076 # 3.1 MATHEMATICAL BOLD ITALIC SMALL V +1D498 ; mapped ; 0077 # 3.1 MATHEMATICAL BOLD ITALIC SMALL W +1D499 ; mapped ; 0078 # 3.1 MATHEMATICAL BOLD ITALIC SMALL X +1D49A ; mapped ; 0079 # 3.1 MATHEMATICAL BOLD ITALIC SMALL Y +1D49B ; mapped ; 007A # 3.1 MATHEMATICAL BOLD ITALIC SMALL Z +1D49C ; mapped ; 0061 # 3.1 MATHEMATICAL SCRIPT CAPITAL A +1D49D ; disallowed # NA +1D49E ; mapped ; 0063 # 3.1 MATHEMATICAL SCRIPT CAPITAL C +1D49F ; mapped ; 0064 # 3.1 MATHEMATICAL SCRIPT CAPITAL D +1D4A0..1D4A1 ; disallowed # NA .. +1D4A2 ; mapped ; 0067 # 3.1 MATHEMATICAL SCRIPT CAPITAL G +1D4A3..1D4A4 ; disallowed # NA .. +1D4A5 ; mapped ; 006A # 3.1 MATHEMATICAL SCRIPT CAPITAL J +1D4A6 ; mapped ; 006B # 3.1 MATHEMATICAL SCRIPT CAPITAL K +1D4A7..1D4A8 ; disallowed # NA .. +1D4A9 ; mapped ; 006E # 3.1 MATHEMATICAL SCRIPT CAPITAL N +1D4AA ; mapped ; 006F # 3.1 MATHEMATICAL SCRIPT CAPITAL O +1D4AB ; mapped ; 0070 # 3.1 MATHEMATICAL SCRIPT CAPITAL P +1D4AC ; mapped ; 0071 # 3.1 MATHEMATICAL SCRIPT CAPITAL Q +1D4AD ; disallowed # NA +1D4AE ; mapped ; 0073 # 3.1 MATHEMATICAL SCRIPT CAPITAL S +1D4AF ; mapped ; 0074 # 3.1 MATHEMATICAL SCRIPT CAPITAL T +1D4B0 ; mapped ; 0075 # 3.1 MATHEMATICAL SCRIPT CAPITAL U +1D4B1 ; mapped ; 0076 # 3.1 MATHEMATICAL SCRIPT CAPITAL V +1D4B2 ; mapped ; 0077 # 3.1 MATHEMATICAL SCRIPT CAPITAL W +1D4B3 ; mapped ; 0078 # 3.1 MATHEMATICAL SCRIPT CAPITAL X +1D4B4 ; mapped ; 0079 # 3.1 MATHEMATICAL SCRIPT CAPITAL Y +1D4B5 ; mapped ; 007A # 3.1 MATHEMATICAL SCRIPT CAPITAL Z +1D4B6 ; mapped ; 0061 # 3.1 MATHEMATICAL SCRIPT SMALL A +1D4B7 ; mapped ; 0062 # 3.1 MATHEMATICAL SCRIPT SMALL B +1D4B8 ; mapped ; 0063 # 3.1 MATHEMATICAL SCRIPT SMALL C +1D4B9 ; mapped ; 0064 # 3.1 MATHEMATICAL SCRIPT SMALL D +1D4BA ; disallowed # NA +1D4BB ; mapped ; 0066 # 3.1 MATHEMATICAL SCRIPT SMALL F +1D4BC ; disallowed # NA +1D4BD ; mapped ; 0068 # 3.1 MATHEMATICAL SCRIPT SMALL H +1D4BE ; mapped ; 0069 # 3.1 MATHEMATICAL SCRIPT SMALL I +1D4BF ; mapped ; 006A # 3.1 MATHEMATICAL SCRIPT SMALL J +1D4C0 ; mapped ; 006B # 3.1 MATHEMATICAL SCRIPT SMALL K +1D4C1 ; mapped ; 006C # 4.0 MATHEMATICAL SCRIPT SMALL L +1D4C2 ; mapped ; 006D # 3.1 MATHEMATICAL SCRIPT SMALL M +1D4C3 ; mapped ; 006E # 3.1 MATHEMATICAL SCRIPT SMALL N +1D4C4 ; disallowed # NA +1D4C5 ; mapped ; 0070 # 3.1 MATHEMATICAL SCRIPT SMALL P +1D4C6 ; mapped ; 0071 # 3.1 MATHEMATICAL SCRIPT SMALL Q +1D4C7 ; mapped ; 0072 # 3.1 MATHEMATICAL SCRIPT SMALL R +1D4C8 ; mapped ; 0073 # 3.1 MATHEMATICAL SCRIPT SMALL S +1D4C9 ; mapped ; 0074 # 3.1 MATHEMATICAL SCRIPT SMALL T +1D4CA ; mapped ; 0075 # 3.1 MATHEMATICAL SCRIPT SMALL U +1D4CB ; mapped ; 0076 # 3.1 MATHEMATICAL SCRIPT SMALL V +1D4CC ; mapped ; 0077 # 3.1 MATHEMATICAL SCRIPT SMALL W +1D4CD ; mapped ; 0078 # 3.1 MATHEMATICAL SCRIPT SMALL X +1D4CE ; mapped ; 0079 # 3.1 MATHEMATICAL SCRIPT SMALL Y +1D4CF ; mapped ; 007A # 3.1 MATHEMATICAL SCRIPT SMALL Z +1D4D0 ; mapped ; 0061 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL A +1D4D1 ; mapped ; 0062 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL B +1D4D2 ; mapped ; 0063 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL C +1D4D3 ; mapped ; 0064 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL D +1D4D4 ; mapped ; 0065 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL E +1D4D5 ; mapped ; 0066 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL F +1D4D6 ; mapped ; 0067 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL G +1D4D7 ; mapped ; 0068 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL H +1D4D8 ; mapped ; 0069 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL I +1D4D9 ; mapped ; 006A # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL J +1D4DA ; mapped ; 006B # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL K +1D4DB ; mapped ; 006C # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL L +1D4DC ; mapped ; 006D # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL M +1D4DD ; mapped ; 006E # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL N +1D4DE ; mapped ; 006F # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL O +1D4DF ; mapped ; 0070 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL P +1D4E0 ; mapped ; 0071 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL Q +1D4E1 ; mapped ; 0072 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL R +1D4E2 ; mapped ; 0073 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL S +1D4E3 ; mapped ; 0074 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL T +1D4E4 ; mapped ; 0075 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL U +1D4E5 ; mapped ; 0076 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL V +1D4E6 ; mapped ; 0077 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL W +1D4E7 ; mapped ; 0078 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL X +1D4E8 ; mapped ; 0079 # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL Y +1D4E9 ; mapped ; 007A # 3.1 MATHEMATICAL BOLD SCRIPT CAPITAL Z +1D4EA ; mapped ; 0061 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL A +1D4EB ; mapped ; 0062 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL B +1D4EC ; mapped ; 0063 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL C +1D4ED ; mapped ; 0064 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL D +1D4EE ; mapped ; 0065 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL E +1D4EF ; mapped ; 0066 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL F +1D4F0 ; mapped ; 0067 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL G +1D4F1 ; mapped ; 0068 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL H +1D4F2 ; mapped ; 0069 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL I +1D4F3 ; mapped ; 006A # 3.1 MATHEMATICAL BOLD SCRIPT SMALL J +1D4F4 ; mapped ; 006B # 3.1 MATHEMATICAL BOLD SCRIPT SMALL K +1D4F5 ; mapped ; 006C # 3.1 MATHEMATICAL BOLD SCRIPT SMALL L +1D4F6 ; mapped ; 006D # 3.1 MATHEMATICAL BOLD SCRIPT SMALL M +1D4F7 ; mapped ; 006E # 3.1 MATHEMATICAL BOLD SCRIPT SMALL N +1D4F8 ; mapped ; 006F # 3.1 MATHEMATICAL BOLD SCRIPT SMALL O +1D4F9 ; mapped ; 0070 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL P +1D4FA ; mapped ; 0071 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL Q +1D4FB ; mapped ; 0072 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL R +1D4FC ; mapped ; 0073 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL S +1D4FD ; mapped ; 0074 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL T +1D4FE ; mapped ; 0075 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL U +1D4FF ; mapped ; 0076 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL V +1D500 ; mapped ; 0077 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL W +1D501 ; mapped ; 0078 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL X +1D502 ; mapped ; 0079 # 3.1 MATHEMATICAL BOLD SCRIPT SMALL Y +1D503 ; mapped ; 007A # 3.1 MATHEMATICAL BOLD SCRIPT SMALL Z +1D504 ; mapped ; 0061 # 3.1 MATHEMATICAL FRAKTUR CAPITAL A +1D505 ; mapped ; 0062 # 3.1 MATHEMATICAL FRAKTUR CAPITAL B +1D506 ; disallowed # NA +1D507 ; mapped ; 0064 # 3.1 MATHEMATICAL FRAKTUR CAPITAL D +1D508 ; mapped ; 0065 # 3.1 MATHEMATICAL FRAKTUR CAPITAL E +1D509 ; mapped ; 0066 # 3.1 MATHEMATICAL FRAKTUR CAPITAL F +1D50A ; mapped ; 0067 # 3.1 MATHEMATICAL FRAKTUR CAPITAL G +1D50B..1D50C ; disallowed # NA .. +1D50D ; mapped ; 006A # 3.1 MATHEMATICAL FRAKTUR CAPITAL J +1D50E ; mapped ; 006B # 3.1 MATHEMATICAL FRAKTUR CAPITAL K +1D50F ; mapped ; 006C # 3.1 MATHEMATICAL FRAKTUR CAPITAL L +1D510 ; mapped ; 006D # 3.1 MATHEMATICAL FRAKTUR CAPITAL M +1D511 ; mapped ; 006E # 3.1 MATHEMATICAL FRAKTUR CAPITAL N +1D512 ; mapped ; 006F # 3.1 MATHEMATICAL FRAKTUR CAPITAL O +1D513 ; mapped ; 0070 # 3.1 MATHEMATICAL FRAKTUR CAPITAL P +1D514 ; mapped ; 0071 # 3.1 MATHEMATICAL FRAKTUR CAPITAL Q +1D515 ; disallowed # NA +1D516 ; mapped ; 0073 # 3.1 MATHEMATICAL FRAKTUR CAPITAL S +1D517 ; mapped ; 0074 # 3.1 MATHEMATICAL FRAKTUR CAPITAL T +1D518 ; mapped ; 0075 # 3.1 MATHEMATICAL FRAKTUR CAPITAL U +1D519 ; mapped ; 0076 # 3.1 MATHEMATICAL FRAKTUR CAPITAL V +1D51A ; mapped ; 0077 # 3.1 MATHEMATICAL FRAKTUR CAPITAL W +1D51B ; mapped ; 0078 # 3.1 MATHEMATICAL FRAKTUR CAPITAL X +1D51C ; mapped ; 0079 # 3.1 MATHEMATICAL FRAKTUR CAPITAL Y +1D51D ; disallowed # NA +1D51E ; mapped ; 0061 # 3.1 MATHEMATICAL FRAKTUR SMALL A +1D51F ; mapped ; 0062 # 3.1 MATHEMATICAL FRAKTUR SMALL B +1D520 ; mapped ; 0063 # 3.1 MATHEMATICAL FRAKTUR SMALL C +1D521 ; mapped ; 0064 # 3.1 MATHEMATICAL FRAKTUR SMALL D +1D522 ; mapped ; 0065 # 3.1 MATHEMATICAL FRAKTUR SMALL E +1D523 ; mapped ; 0066 # 3.1 MATHEMATICAL FRAKTUR SMALL F +1D524 ; mapped ; 0067 # 3.1 MATHEMATICAL FRAKTUR SMALL G +1D525 ; mapped ; 0068 # 3.1 MATHEMATICAL FRAKTUR SMALL H +1D526 ; mapped ; 0069 # 3.1 MATHEMATICAL FRAKTUR SMALL I +1D527 ; mapped ; 006A # 3.1 MATHEMATICAL FRAKTUR SMALL J +1D528 ; mapped ; 006B # 3.1 MATHEMATICAL FRAKTUR SMALL K +1D529 ; mapped ; 006C # 3.1 MATHEMATICAL FRAKTUR SMALL L +1D52A ; mapped ; 006D # 3.1 MATHEMATICAL FRAKTUR SMALL M +1D52B ; mapped ; 006E # 3.1 MATHEMATICAL FRAKTUR SMALL N +1D52C ; mapped ; 006F # 3.1 MATHEMATICAL FRAKTUR SMALL O +1D52D ; mapped ; 0070 # 3.1 MATHEMATICAL FRAKTUR SMALL P +1D52E ; mapped ; 0071 # 3.1 MATHEMATICAL FRAKTUR SMALL Q +1D52F ; mapped ; 0072 # 3.1 MATHEMATICAL FRAKTUR SMALL R +1D530 ; mapped ; 0073 # 3.1 MATHEMATICAL FRAKTUR SMALL S +1D531 ; mapped ; 0074 # 3.1 MATHEMATICAL FRAKTUR SMALL T +1D532 ; mapped ; 0075 # 3.1 MATHEMATICAL FRAKTUR SMALL U +1D533 ; mapped ; 0076 # 3.1 MATHEMATICAL FRAKTUR SMALL V +1D534 ; mapped ; 0077 # 3.1 MATHEMATICAL FRAKTUR SMALL W +1D535 ; mapped ; 0078 # 3.1 MATHEMATICAL FRAKTUR SMALL X +1D536 ; mapped ; 0079 # 3.1 MATHEMATICAL FRAKTUR SMALL Y +1D537 ; mapped ; 007A # 3.1 MATHEMATICAL FRAKTUR SMALL Z +1D538 ; mapped ; 0061 # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL A +1D539 ; mapped ; 0062 # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL B +1D53A ; disallowed # NA +1D53B ; mapped ; 0064 # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL D +1D53C ; mapped ; 0065 # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL E +1D53D ; mapped ; 0066 # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL F +1D53E ; mapped ; 0067 # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL G +1D53F ; disallowed # NA +1D540 ; mapped ; 0069 # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL I +1D541 ; mapped ; 006A # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL J +1D542 ; mapped ; 006B # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL K +1D543 ; mapped ; 006C # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL L +1D544 ; mapped ; 006D # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL M +1D545 ; disallowed # NA +1D546 ; mapped ; 006F # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL O +1D547..1D549 ; disallowed # NA .. +1D54A ; mapped ; 0073 # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL S +1D54B ; mapped ; 0074 # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL T +1D54C ; mapped ; 0075 # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL U +1D54D ; mapped ; 0076 # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL V +1D54E ; mapped ; 0077 # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL W +1D54F ; mapped ; 0078 # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL X +1D550 ; mapped ; 0079 # 3.1 MATHEMATICAL DOUBLE-STRUCK CAPITAL Y +1D551 ; disallowed # NA +1D552 ; mapped ; 0061 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL A +1D553 ; mapped ; 0062 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL B +1D554 ; mapped ; 0063 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL C +1D555 ; mapped ; 0064 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL D +1D556 ; mapped ; 0065 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL E +1D557 ; mapped ; 0066 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL F +1D558 ; mapped ; 0067 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL G +1D559 ; mapped ; 0068 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL H +1D55A ; mapped ; 0069 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL I +1D55B ; mapped ; 006A # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL J +1D55C ; mapped ; 006B # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL K +1D55D ; mapped ; 006C # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL L +1D55E ; mapped ; 006D # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL M +1D55F ; mapped ; 006E # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL N +1D560 ; mapped ; 006F # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL O +1D561 ; mapped ; 0070 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL P +1D562 ; mapped ; 0071 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL Q +1D563 ; mapped ; 0072 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL R +1D564 ; mapped ; 0073 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL S +1D565 ; mapped ; 0074 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL T +1D566 ; mapped ; 0075 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL U +1D567 ; mapped ; 0076 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL V +1D568 ; mapped ; 0077 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL W +1D569 ; mapped ; 0078 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL X +1D56A ; mapped ; 0079 # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL Y +1D56B ; mapped ; 007A # 3.1 MATHEMATICAL DOUBLE-STRUCK SMALL Z +1D56C ; mapped ; 0061 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL A +1D56D ; mapped ; 0062 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL B +1D56E ; mapped ; 0063 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL C +1D56F ; mapped ; 0064 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL D +1D570 ; mapped ; 0065 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL E +1D571 ; mapped ; 0066 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL F +1D572 ; mapped ; 0067 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL G +1D573 ; mapped ; 0068 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL H +1D574 ; mapped ; 0069 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL I +1D575 ; mapped ; 006A # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL J +1D576 ; mapped ; 006B # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL K +1D577 ; mapped ; 006C # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL L +1D578 ; mapped ; 006D # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL M +1D579 ; mapped ; 006E # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL N +1D57A ; mapped ; 006F # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL O +1D57B ; mapped ; 0070 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL P +1D57C ; mapped ; 0071 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL Q +1D57D ; mapped ; 0072 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL R +1D57E ; mapped ; 0073 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL S +1D57F ; mapped ; 0074 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL T +1D580 ; mapped ; 0075 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL U +1D581 ; mapped ; 0076 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL V +1D582 ; mapped ; 0077 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL W +1D583 ; mapped ; 0078 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL X +1D584 ; mapped ; 0079 # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL Y +1D585 ; mapped ; 007A # 3.1 MATHEMATICAL BOLD FRAKTUR CAPITAL Z +1D586 ; mapped ; 0061 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL A +1D587 ; mapped ; 0062 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL B +1D588 ; mapped ; 0063 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL C +1D589 ; mapped ; 0064 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL D +1D58A ; mapped ; 0065 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL E +1D58B ; mapped ; 0066 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL F +1D58C ; mapped ; 0067 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL G +1D58D ; mapped ; 0068 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL H +1D58E ; mapped ; 0069 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL I +1D58F ; mapped ; 006A # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL J +1D590 ; mapped ; 006B # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL K +1D591 ; mapped ; 006C # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL L +1D592 ; mapped ; 006D # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL M +1D593 ; mapped ; 006E # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL N +1D594 ; mapped ; 006F # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL O +1D595 ; mapped ; 0070 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL P +1D596 ; mapped ; 0071 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL Q +1D597 ; mapped ; 0072 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL R +1D598 ; mapped ; 0073 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL S +1D599 ; mapped ; 0074 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL T +1D59A ; mapped ; 0075 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL U +1D59B ; mapped ; 0076 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL V +1D59C ; mapped ; 0077 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL W +1D59D ; mapped ; 0078 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL X +1D59E ; mapped ; 0079 # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL Y +1D59F ; mapped ; 007A # 3.1 MATHEMATICAL BOLD FRAKTUR SMALL Z +1D5A0 ; mapped ; 0061 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL A +1D5A1 ; mapped ; 0062 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL B +1D5A2 ; mapped ; 0063 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL C +1D5A3 ; mapped ; 0064 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL D +1D5A4 ; mapped ; 0065 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL E +1D5A5 ; mapped ; 0066 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL F +1D5A6 ; mapped ; 0067 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL G +1D5A7 ; mapped ; 0068 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL H +1D5A8 ; mapped ; 0069 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL I +1D5A9 ; mapped ; 006A # 3.1 MATHEMATICAL SANS-SERIF CAPITAL J +1D5AA ; mapped ; 006B # 3.1 MATHEMATICAL SANS-SERIF CAPITAL K +1D5AB ; mapped ; 006C # 3.1 MATHEMATICAL SANS-SERIF CAPITAL L +1D5AC ; mapped ; 006D # 3.1 MATHEMATICAL SANS-SERIF CAPITAL M +1D5AD ; mapped ; 006E # 3.1 MATHEMATICAL SANS-SERIF CAPITAL N +1D5AE ; mapped ; 006F # 3.1 MATHEMATICAL SANS-SERIF CAPITAL O +1D5AF ; mapped ; 0070 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL P +1D5B0 ; mapped ; 0071 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL Q +1D5B1 ; mapped ; 0072 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL R +1D5B2 ; mapped ; 0073 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL S +1D5B3 ; mapped ; 0074 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL T +1D5B4 ; mapped ; 0075 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL U +1D5B5 ; mapped ; 0076 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL V +1D5B6 ; mapped ; 0077 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL W +1D5B7 ; mapped ; 0078 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL X +1D5B8 ; mapped ; 0079 # 3.1 MATHEMATICAL SANS-SERIF CAPITAL Y +1D5B9 ; mapped ; 007A # 3.1 MATHEMATICAL SANS-SERIF CAPITAL Z +1D5BA ; mapped ; 0061 # 3.1 MATHEMATICAL SANS-SERIF SMALL A +1D5BB ; mapped ; 0062 # 3.1 MATHEMATICAL SANS-SERIF SMALL B +1D5BC ; mapped ; 0063 # 3.1 MATHEMATICAL SANS-SERIF SMALL C +1D5BD ; mapped ; 0064 # 3.1 MATHEMATICAL SANS-SERIF SMALL D +1D5BE ; mapped ; 0065 # 3.1 MATHEMATICAL SANS-SERIF SMALL E +1D5BF ; mapped ; 0066 # 3.1 MATHEMATICAL SANS-SERIF SMALL F +1D5C0 ; mapped ; 0067 # 3.1 MATHEMATICAL SANS-SERIF SMALL G +1D5C1 ; mapped ; 0068 # 3.1 MATHEMATICAL SANS-SERIF SMALL H +1D5C2 ; mapped ; 0069 # 3.1 MATHEMATICAL SANS-SERIF SMALL I +1D5C3 ; mapped ; 006A # 3.1 MATHEMATICAL SANS-SERIF SMALL J +1D5C4 ; mapped ; 006B # 3.1 MATHEMATICAL SANS-SERIF SMALL K +1D5C5 ; mapped ; 006C # 3.1 MATHEMATICAL SANS-SERIF SMALL L +1D5C6 ; mapped ; 006D # 3.1 MATHEMATICAL SANS-SERIF SMALL M +1D5C7 ; mapped ; 006E # 3.1 MATHEMATICAL SANS-SERIF SMALL N +1D5C8 ; mapped ; 006F # 3.1 MATHEMATICAL SANS-SERIF SMALL O +1D5C9 ; mapped ; 0070 # 3.1 MATHEMATICAL SANS-SERIF SMALL P +1D5CA ; mapped ; 0071 # 3.1 MATHEMATICAL SANS-SERIF SMALL Q +1D5CB ; mapped ; 0072 # 3.1 MATHEMATICAL SANS-SERIF SMALL R +1D5CC ; mapped ; 0073 # 3.1 MATHEMATICAL SANS-SERIF SMALL S +1D5CD ; mapped ; 0074 # 3.1 MATHEMATICAL SANS-SERIF SMALL T +1D5CE ; mapped ; 0075 # 3.1 MATHEMATICAL SANS-SERIF SMALL U +1D5CF ; mapped ; 0076 # 3.1 MATHEMATICAL SANS-SERIF SMALL V +1D5D0 ; mapped ; 0077 # 3.1 MATHEMATICAL SANS-SERIF SMALL W +1D5D1 ; mapped ; 0078 # 3.1 MATHEMATICAL SANS-SERIF SMALL X +1D5D2 ; mapped ; 0079 # 3.1 MATHEMATICAL SANS-SERIF SMALL Y +1D5D3 ; mapped ; 007A # 3.1 MATHEMATICAL SANS-SERIF SMALL Z +1D5D4 ; mapped ; 0061 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL A +1D5D5 ; mapped ; 0062 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL B +1D5D6 ; mapped ; 0063 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL C +1D5D7 ; mapped ; 0064 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL D +1D5D8 ; mapped ; 0065 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL E +1D5D9 ; mapped ; 0066 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL F +1D5DA ; mapped ; 0067 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL G +1D5DB ; mapped ; 0068 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL H +1D5DC ; mapped ; 0069 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL I +1D5DD ; mapped ; 006A # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL J +1D5DE ; mapped ; 006B # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL K +1D5DF ; mapped ; 006C # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL L +1D5E0 ; mapped ; 006D # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL M +1D5E1 ; mapped ; 006E # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL N +1D5E2 ; mapped ; 006F # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL O +1D5E3 ; mapped ; 0070 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL P +1D5E4 ; mapped ; 0071 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL Q +1D5E5 ; mapped ; 0072 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL R +1D5E6 ; mapped ; 0073 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL S +1D5E7 ; mapped ; 0074 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL T +1D5E8 ; mapped ; 0075 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL U +1D5E9 ; mapped ; 0076 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL V +1D5EA ; mapped ; 0077 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL W +1D5EB ; mapped ; 0078 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL X +1D5EC ; mapped ; 0079 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL Y +1D5ED ; mapped ; 007A # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL Z +1D5EE ; mapped ; 0061 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL A +1D5EF ; mapped ; 0062 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL B +1D5F0 ; mapped ; 0063 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL C +1D5F1 ; mapped ; 0064 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL D +1D5F2 ; mapped ; 0065 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL E +1D5F3 ; mapped ; 0066 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL F +1D5F4 ; mapped ; 0067 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL G +1D5F5 ; mapped ; 0068 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL H +1D5F6 ; mapped ; 0069 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL I +1D5F7 ; mapped ; 006A # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL J +1D5F8 ; mapped ; 006B # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL K +1D5F9 ; mapped ; 006C # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL L +1D5FA ; mapped ; 006D # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL M +1D5FB ; mapped ; 006E # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL N +1D5FC ; mapped ; 006F # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL O +1D5FD ; mapped ; 0070 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL P +1D5FE ; mapped ; 0071 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL Q +1D5FF ; mapped ; 0072 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL R +1D600 ; mapped ; 0073 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL S +1D601 ; mapped ; 0074 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL T +1D602 ; mapped ; 0075 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL U +1D603 ; mapped ; 0076 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL V +1D604 ; mapped ; 0077 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL W +1D605 ; mapped ; 0078 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL X +1D606 ; mapped ; 0079 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL Y +1D607 ; mapped ; 007A # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL Z +1D608 ; mapped ; 0061 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL A +1D609 ; mapped ; 0062 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL B +1D60A ; mapped ; 0063 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL C +1D60B ; mapped ; 0064 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL D +1D60C ; mapped ; 0065 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL E +1D60D ; mapped ; 0066 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL F +1D60E ; mapped ; 0067 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL G +1D60F ; mapped ; 0068 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL H +1D610 ; mapped ; 0069 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL I +1D611 ; mapped ; 006A # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL J +1D612 ; mapped ; 006B # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL K +1D613 ; mapped ; 006C # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL L +1D614 ; mapped ; 006D # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL M +1D615 ; mapped ; 006E # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL N +1D616 ; mapped ; 006F # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL O +1D617 ; mapped ; 0070 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL P +1D618 ; mapped ; 0071 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL Q +1D619 ; mapped ; 0072 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL R +1D61A ; mapped ; 0073 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL S +1D61B ; mapped ; 0074 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL T +1D61C ; mapped ; 0075 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL U +1D61D ; mapped ; 0076 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL V +1D61E ; mapped ; 0077 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL W +1D61F ; mapped ; 0078 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL X +1D620 ; mapped ; 0079 # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL Y +1D621 ; mapped ; 007A # 3.1 MATHEMATICAL SANS-SERIF ITALIC CAPITAL Z +1D622 ; mapped ; 0061 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL A +1D623 ; mapped ; 0062 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL B +1D624 ; mapped ; 0063 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL C +1D625 ; mapped ; 0064 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL D +1D626 ; mapped ; 0065 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL E +1D627 ; mapped ; 0066 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL F +1D628 ; mapped ; 0067 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL G +1D629 ; mapped ; 0068 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL H +1D62A ; mapped ; 0069 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL I +1D62B ; mapped ; 006A # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL J +1D62C ; mapped ; 006B # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL K +1D62D ; mapped ; 006C # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL L +1D62E ; mapped ; 006D # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL M +1D62F ; mapped ; 006E # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL N +1D630 ; mapped ; 006F # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL O +1D631 ; mapped ; 0070 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL P +1D632 ; mapped ; 0071 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL Q +1D633 ; mapped ; 0072 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL R +1D634 ; mapped ; 0073 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL S +1D635 ; mapped ; 0074 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL T +1D636 ; mapped ; 0075 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL U +1D637 ; mapped ; 0076 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL V +1D638 ; mapped ; 0077 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL W +1D639 ; mapped ; 0078 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL X +1D63A ; mapped ; 0079 # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL Y +1D63B ; mapped ; 007A # 3.1 MATHEMATICAL SANS-SERIF ITALIC SMALL Z +1D63C ; mapped ; 0061 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL A +1D63D ; mapped ; 0062 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL B +1D63E ; mapped ; 0063 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL C +1D63F ; mapped ; 0064 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL D +1D640 ; mapped ; 0065 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL E +1D641 ; mapped ; 0066 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL F +1D642 ; mapped ; 0067 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL G +1D643 ; mapped ; 0068 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL H +1D644 ; mapped ; 0069 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL I +1D645 ; mapped ; 006A # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL J +1D646 ; mapped ; 006B # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL K +1D647 ; mapped ; 006C # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL L +1D648 ; mapped ; 006D # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL M +1D649 ; mapped ; 006E # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL N +1D64A ; mapped ; 006F # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL O +1D64B ; mapped ; 0070 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL P +1D64C ; mapped ; 0071 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Q +1D64D ; mapped ; 0072 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL R +1D64E ; mapped ; 0073 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL S +1D64F ; mapped ; 0074 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL T +1D650 ; mapped ; 0075 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL U +1D651 ; mapped ; 0076 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL V +1D652 ; mapped ; 0077 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL W +1D653 ; mapped ; 0078 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL X +1D654 ; mapped ; 0079 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Y +1D655 ; mapped ; 007A # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Z +1D656 ; mapped ; 0061 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL A +1D657 ; mapped ; 0062 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL B +1D658 ; mapped ; 0063 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL C +1D659 ; mapped ; 0064 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL D +1D65A ; mapped ; 0065 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL E +1D65B ; mapped ; 0066 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL F +1D65C ; mapped ; 0067 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL G +1D65D ; mapped ; 0068 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL H +1D65E ; mapped ; 0069 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL I +1D65F ; mapped ; 006A # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL J +1D660 ; mapped ; 006B # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL K +1D661 ; mapped ; 006C # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL L +1D662 ; mapped ; 006D # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL M +1D663 ; mapped ; 006E # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL N +1D664 ; mapped ; 006F # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL O +1D665 ; mapped ; 0070 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL P +1D666 ; mapped ; 0071 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Q +1D667 ; mapped ; 0072 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL R +1D668 ; mapped ; 0073 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL S +1D669 ; mapped ; 0074 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL T +1D66A ; mapped ; 0075 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL U +1D66B ; mapped ; 0076 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL V +1D66C ; mapped ; 0077 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL W +1D66D ; mapped ; 0078 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL X +1D66E ; mapped ; 0079 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Y +1D66F ; mapped ; 007A # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Z +1D670 ; mapped ; 0061 # 3.1 MATHEMATICAL MONOSPACE CAPITAL A +1D671 ; mapped ; 0062 # 3.1 MATHEMATICAL MONOSPACE CAPITAL B +1D672 ; mapped ; 0063 # 3.1 MATHEMATICAL MONOSPACE CAPITAL C +1D673 ; mapped ; 0064 # 3.1 MATHEMATICAL MONOSPACE CAPITAL D +1D674 ; mapped ; 0065 # 3.1 MATHEMATICAL MONOSPACE CAPITAL E +1D675 ; mapped ; 0066 # 3.1 MATHEMATICAL MONOSPACE CAPITAL F +1D676 ; mapped ; 0067 # 3.1 MATHEMATICAL MONOSPACE CAPITAL G +1D677 ; mapped ; 0068 # 3.1 MATHEMATICAL MONOSPACE CAPITAL H +1D678 ; mapped ; 0069 # 3.1 MATHEMATICAL MONOSPACE CAPITAL I +1D679 ; mapped ; 006A # 3.1 MATHEMATICAL MONOSPACE CAPITAL J +1D67A ; mapped ; 006B # 3.1 MATHEMATICAL MONOSPACE CAPITAL K +1D67B ; mapped ; 006C # 3.1 MATHEMATICAL MONOSPACE CAPITAL L +1D67C ; mapped ; 006D # 3.1 MATHEMATICAL MONOSPACE CAPITAL M +1D67D ; mapped ; 006E # 3.1 MATHEMATICAL MONOSPACE CAPITAL N +1D67E ; mapped ; 006F # 3.1 MATHEMATICAL MONOSPACE CAPITAL O +1D67F ; mapped ; 0070 # 3.1 MATHEMATICAL MONOSPACE CAPITAL P +1D680 ; mapped ; 0071 # 3.1 MATHEMATICAL MONOSPACE CAPITAL Q +1D681 ; mapped ; 0072 # 3.1 MATHEMATICAL MONOSPACE CAPITAL R +1D682 ; mapped ; 0073 # 3.1 MATHEMATICAL MONOSPACE CAPITAL S +1D683 ; mapped ; 0074 # 3.1 MATHEMATICAL MONOSPACE CAPITAL T +1D684 ; mapped ; 0075 # 3.1 MATHEMATICAL MONOSPACE CAPITAL U +1D685 ; mapped ; 0076 # 3.1 MATHEMATICAL MONOSPACE CAPITAL V +1D686 ; mapped ; 0077 # 3.1 MATHEMATICAL MONOSPACE CAPITAL W +1D687 ; mapped ; 0078 # 3.1 MATHEMATICAL MONOSPACE CAPITAL X +1D688 ; mapped ; 0079 # 3.1 MATHEMATICAL MONOSPACE CAPITAL Y +1D689 ; mapped ; 007A # 3.1 MATHEMATICAL MONOSPACE CAPITAL Z +1D68A ; mapped ; 0061 # 3.1 MATHEMATICAL MONOSPACE SMALL A +1D68B ; mapped ; 0062 # 3.1 MATHEMATICAL MONOSPACE SMALL B +1D68C ; mapped ; 0063 # 3.1 MATHEMATICAL MONOSPACE SMALL C +1D68D ; mapped ; 0064 # 3.1 MATHEMATICAL MONOSPACE SMALL D +1D68E ; mapped ; 0065 # 3.1 MATHEMATICAL MONOSPACE SMALL E +1D68F ; mapped ; 0066 # 3.1 MATHEMATICAL MONOSPACE SMALL F +1D690 ; mapped ; 0067 # 3.1 MATHEMATICAL MONOSPACE SMALL G +1D691 ; mapped ; 0068 # 3.1 MATHEMATICAL MONOSPACE SMALL H +1D692 ; mapped ; 0069 # 3.1 MATHEMATICAL MONOSPACE SMALL I +1D693 ; mapped ; 006A # 3.1 MATHEMATICAL MONOSPACE SMALL J +1D694 ; mapped ; 006B # 3.1 MATHEMATICAL MONOSPACE SMALL K +1D695 ; mapped ; 006C # 3.1 MATHEMATICAL MONOSPACE SMALL L +1D696 ; mapped ; 006D # 3.1 MATHEMATICAL MONOSPACE SMALL M +1D697 ; mapped ; 006E # 3.1 MATHEMATICAL MONOSPACE SMALL N +1D698 ; mapped ; 006F # 3.1 MATHEMATICAL MONOSPACE SMALL O +1D699 ; mapped ; 0070 # 3.1 MATHEMATICAL MONOSPACE SMALL P +1D69A ; mapped ; 0071 # 3.1 MATHEMATICAL MONOSPACE SMALL Q +1D69B ; mapped ; 0072 # 3.1 MATHEMATICAL MONOSPACE SMALL R +1D69C ; mapped ; 0073 # 3.1 MATHEMATICAL MONOSPACE SMALL S +1D69D ; mapped ; 0074 # 3.1 MATHEMATICAL MONOSPACE SMALL T +1D69E ; mapped ; 0075 # 3.1 MATHEMATICAL MONOSPACE SMALL U +1D69F ; mapped ; 0076 # 3.1 MATHEMATICAL MONOSPACE SMALL V +1D6A0 ; mapped ; 0077 # 3.1 MATHEMATICAL MONOSPACE SMALL W +1D6A1 ; mapped ; 0078 # 3.1 MATHEMATICAL MONOSPACE SMALL X +1D6A2 ; mapped ; 0079 # 3.1 MATHEMATICAL MONOSPACE SMALL Y +1D6A3 ; mapped ; 007A # 3.1 MATHEMATICAL MONOSPACE SMALL Z +1D6A4 ; mapped ; 0131 # 4.1 MATHEMATICAL ITALIC SMALL DOTLESS I +1D6A5 ; mapped ; 0237 # 4.1 MATHEMATICAL ITALIC SMALL DOTLESS J +1D6A6..1D6A7 ; disallowed # NA .. +1D6A8 ; mapped ; 03B1 # 3.1 MATHEMATICAL BOLD CAPITAL ALPHA +1D6A9 ; mapped ; 03B2 # 3.1 MATHEMATICAL BOLD CAPITAL BETA +1D6AA ; mapped ; 03B3 # 3.1 MATHEMATICAL BOLD CAPITAL GAMMA +1D6AB ; mapped ; 03B4 # 3.1 MATHEMATICAL BOLD CAPITAL DELTA +1D6AC ; mapped ; 03B5 # 3.1 MATHEMATICAL BOLD CAPITAL EPSILON +1D6AD ; mapped ; 03B6 # 3.1 MATHEMATICAL BOLD CAPITAL ZETA +1D6AE ; mapped ; 03B7 # 3.1 MATHEMATICAL BOLD CAPITAL ETA +1D6AF ; mapped ; 03B8 # 3.1 MATHEMATICAL BOLD CAPITAL THETA +1D6B0 ; mapped ; 03B9 # 3.1 MATHEMATICAL BOLD CAPITAL IOTA +1D6B1 ; mapped ; 03BA # 3.1 MATHEMATICAL BOLD CAPITAL KAPPA +1D6B2 ; mapped ; 03BB # 3.1 MATHEMATICAL BOLD CAPITAL LAMDA +1D6B3 ; mapped ; 03BC # 3.1 MATHEMATICAL BOLD CAPITAL MU +1D6B4 ; mapped ; 03BD # 3.1 MATHEMATICAL BOLD CAPITAL NU +1D6B5 ; mapped ; 03BE # 3.1 MATHEMATICAL BOLD CAPITAL XI +1D6B6 ; mapped ; 03BF # 3.1 MATHEMATICAL BOLD CAPITAL OMICRON +1D6B7 ; mapped ; 03C0 # 3.1 MATHEMATICAL BOLD CAPITAL PI +1D6B8 ; mapped ; 03C1 # 3.1 MATHEMATICAL BOLD CAPITAL RHO +1D6B9 ; mapped ; 03B8 # 3.1 MATHEMATICAL BOLD CAPITAL THETA SYMBOL +1D6BA ; mapped ; 03C3 # 3.1 MATHEMATICAL BOLD CAPITAL SIGMA +1D6BB ; mapped ; 03C4 # 3.1 MATHEMATICAL BOLD CAPITAL TAU +1D6BC ; mapped ; 03C5 # 3.1 MATHEMATICAL BOLD CAPITAL UPSILON +1D6BD ; mapped ; 03C6 # 3.1 MATHEMATICAL BOLD CAPITAL PHI +1D6BE ; mapped ; 03C7 # 3.1 MATHEMATICAL BOLD CAPITAL CHI +1D6BF ; mapped ; 03C8 # 3.1 MATHEMATICAL BOLD CAPITAL PSI +1D6C0 ; mapped ; 03C9 # 3.1 MATHEMATICAL BOLD CAPITAL OMEGA +1D6C1 ; mapped ; 2207 # 3.1 MATHEMATICAL BOLD NABLA +1D6C2 ; mapped ; 03B1 # 3.1 MATHEMATICAL BOLD SMALL ALPHA +1D6C3 ; mapped ; 03B2 # 3.1 MATHEMATICAL BOLD SMALL BETA +1D6C4 ; mapped ; 03B3 # 3.1 MATHEMATICAL BOLD SMALL GAMMA +1D6C5 ; mapped ; 03B4 # 3.1 MATHEMATICAL BOLD SMALL DELTA +1D6C6 ; mapped ; 03B5 # 3.1 MATHEMATICAL BOLD SMALL EPSILON +1D6C7 ; mapped ; 03B6 # 3.1 MATHEMATICAL BOLD SMALL ZETA +1D6C8 ; mapped ; 03B7 # 3.1 MATHEMATICAL BOLD SMALL ETA +1D6C9 ; mapped ; 03B8 # 3.1 MATHEMATICAL BOLD SMALL THETA +1D6CA ; mapped ; 03B9 # 3.1 MATHEMATICAL BOLD SMALL IOTA +1D6CB ; mapped ; 03BA # 3.1 MATHEMATICAL BOLD SMALL KAPPA +1D6CC ; mapped ; 03BB # 3.1 MATHEMATICAL BOLD SMALL LAMDA +1D6CD ; mapped ; 03BC # 3.1 MATHEMATICAL BOLD SMALL MU +1D6CE ; mapped ; 03BD # 3.1 MATHEMATICAL BOLD SMALL NU +1D6CF ; mapped ; 03BE # 3.1 MATHEMATICAL BOLD SMALL XI +1D6D0 ; mapped ; 03BF # 3.1 MATHEMATICAL BOLD SMALL OMICRON +1D6D1 ; mapped ; 03C0 # 3.1 MATHEMATICAL BOLD SMALL PI +1D6D2 ; mapped ; 03C1 # 3.1 MATHEMATICAL BOLD SMALL RHO +1D6D3..1D6D4 ; mapped ; 03C3 # 3.1 MATHEMATICAL BOLD SMALL FINAL SIGMA..MATHEMATICAL BOLD SMALL SIGMA +1D6D5 ; mapped ; 03C4 # 3.1 MATHEMATICAL BOLD SMALL TAU +1D6D6 ; mapped ; 03C5 # 3.1 MATHEMATICAL BOLD SMALL UPSILON +1D6D7 ; mapped ; 03C6 # 3.1 MATHEMATICAL BOLD SMALL PHI +1D6D8 ; mapped ; 03C7 # 3.1 MATHEMATICAL BOLD SMALL CHI +1D6D9 ; mapped ; 03C8 # 3.1 MATHEMATICAL BOLD SMALL PSI +1D6DA ; mapped ; 03C9 # 3.1 MATHEMATICAL BOLD SMALL OMEGA +1D6DB ; mapped ; 2202 # 3.1 MATHEMATICAL BOLD PARTIAL DIFFERENTIAL +1D6DC ; mapped ; 03B5 # 3.1 MATHEMATICAL BOLD EPSILON SYMBOL +1D6DD ; mapped ; 03B8 # 3.1 MATHEMATICAL BOLD THETA SYMBOL +1D6DE ; mapped ; 03BA # 3.1 MATHEMATICAL BOLD KAPPA SYMBOL +1D6DF ; mapped ; 03C6 # 3.1 MATHEMATICAL BOLD PHI SYMBOL +1D6E0 ; mapped ; 03C1 # 3.1 MATHEMATICAL BOLD RHO SYMBOL +1D6E1 ; mapped ; 03C0 # 3.1 MATHEMATICAL BOLD PI SYMBOL +1D6E2 ; mapped ; 03B1 # 3.1 MATHEMATICAL ITALIC CAPITAL ALPHA +1D6E3 ; mapped ; 03B2 # 3.1 MATHEMATICAL ITALIC CAPITAL BETA +1D6E4 ; mapped ; 03B3 # 3.1 MATHEMATICAL ITALIC CAPITAL GAMMA +1D6E5 ; mapped ; 03B4 # 3.1 MATHEMATICAL ITALIC CAPITAL DELTA +1D6E6 ; mapped ; 03B5 # 3.1 MATHEMATICAL ITALIC CAPITAL EPSILON +1D6E7 ; mapped ; 03B6 # 3.1 MATHEMATICAL ITALIC CAPITAL ZETA +1D6E8 ; mapped ; 03B7 # 3.1 MATHEMATICAL ITALIC CAPITAL ETA +1D6E9 ; mapped ; 03B8 # 3.1 MATHEMATICAL ITALIC CAPITAL THETA +1D6EA ; mapped ; 03B9 # 3.1 MATHEMATICAL ITALIC CAPITAL IOTA +1D6EB ; mapped ; 03BA # 3.1 MATHEMATICAL ITALIC CAPITAL KAPPA +1D6EC ; mapped ; 03BB # 3.1 MATHEMATICAL ITALIC CAPITAL LAMDA +1D6ED ; mapped ; 03BC # 3.1 MATHEMATICAL ITALIC CAPITAL MU +1D6EE ; mapped ; 03BD # 3.1 MATHEMATICAL ITALIC CAPITAL NU +1D6EF ; mapped ; 03BE # 3.1 MATHEMATICAL ITALIC CAPITAL XI +1D6F0 ; mapped ; 03BF # 3.1 MATHEMATICAL ITALIC CAPITAL OMICRON +1D6F1 ; mapped ; 03C0 # 3.1 MATHEMATICAL ITALIC CAPITAL PI +1D6F2 ; mapped ; 03C1 # 3.1 MATHEMATICAL ITALIC CAPITAL RHO +1D6F3 ; mapped ; 03B8 # 3.1 MATHEMATICAL ITALIC CAPITAL THETA SYMBOL +1D6F4 ; mapped ; 03C3 # 3.1 MATHEMATICAL ITALIC CAPITAL SIGMA +1D6F5 ; mapped ; 03C4 # 3.1 MATHEMATICAL ITALIC CAPITAL TAU +1D6F6 ; mapped ; 03C5 # 3.1 MATHEMATICAL ITALIC CAPITAL UPSILON +1D6F7 ; mapped ; 03C6 # 3.1 MATHEMATICAL ITALIC CAPITAL PHI +1D6F8 ; mapped ; 03C7 # 3.1 MATHEMATICAL ITALIC CAPITAL CHI +1D6F9 ; mapped ; 03C8 # 3.1 MATHEMATICAL ITALIC CAPITAL PSI +1D6FA ; mapped ; 03C9 # 3.1 MATHEMATICAL ITALIC CAPITAL OMEGA +1D6FB ; mapped ; 2207 # 3.1 MATHEMATICAL ITALIC NABLA +1D6FC ; mapped ; 03B1 # 3.1 MATHEMATICAL ITALIC SMALL ALPHA +1D6FD ; mapped ; 03B2 # 3.1 MATHEMATICAL ITALIC SMALL BETA +1D6FE ; mapped ; 03B3 # 3.1 MATHEMATICAL ITALIC SMALL GAMMA +1D6FF ; mapped ; 03B4 # 3.1 MATHEMATICAL ITALIC SMALL DELTA +1D700 ; mapped ; 03B5 # 3.1 MATHEMATICAL ITALIC SMALL EPSILON +1D701 ; mapped ; 03B6 # 3.1 MATHEMATICAL ITALIC SMALL ZETA +1D702 ; mapped ; 03B7 # 3.1 MATHEMATICAL ITALIC SMALL ETA +1D703 ; mapped ; 03B8 # 3.1 MATHEMATICAL ITALIC SMALL THETA +1D704 ; mapped ; 03B9 # 3.1 MATHEMATICAL ITALIC SMALL IOTA +1D705 ; mapped ; 03BA # 3.1 MATHEMATICAL ITALIC SMALL KAPPA +1D706 ; mapped ; 03BB # 3.1 MATHEMATICAL ITALIC SMALL LAMDA +1D707 ; mapped ; 03BC # 3.1 MATHEMATICAL ITALIC SMALL MU +1D708 ; mapped ; 03BD # 3.1 MATHEMATICAL ITALIC SMALL NU +1D709 ; mapped ; 03BE # 3.1 MATHEMATICAL ITALIC SMALL XI +1D70A ; mapped ; 03BF # 3.1 MATHEMATICAL ITALIC SMALL OMICRON +1D70B ; mapped ; 03C0 # 3.1 MATHEMATICAL ITALIC SMALL PI +1D70C ; mapped ; 03C1 # 3.1 MATHEMATICAL ITALIC SMALL RHO +1D70D..1D70E ; mapped ; 03C3 # 3.1 MATHEMATICAL ITALIC SMALL FINAL SIGMA..MATHEMATICAL ITALIC SMALL SIGMA +1D70F ; mapped ; 03C4 # 3.1 MATHEMATICAL ITALIC SMALL TAU +1D710 ; mapped ; 03C5 # 3.1 MATHEMATICAL ITALIC SMALL UPSILON +1D711 ; mapped ; 03C6 # 3.1 MATHEMATICAL ITALIC SMALL PHI +1D712 ; mapped ; 03C7 # 3.1 MATHEMATICAL ITALIC SMALL CHI +1D713 ; mapped ; 03C8 # 3.1 MATHEMATICAL ITALIC SMALL PSI +1D714 ; mapped ; 03C9 # 3.1 MATHEMATICAL ITALIC SMALL OMEGA +1D715 ; mapped ; 2202 # 3.1 MATHEMATICAL ITALIC PARTIAL DIFFERENTIAL +1D716 ; mapped ; 03B5 # 3.1 MATHEMATICAL ITALIC EPSILON SYMBOL +1D717 ; mapped ; 03B8 # 3.1 MATHEMATICAL ITALIC THETA SYMBOL +1D718 ; mapped ; 03BA # 3.1 MATHEMATICAL ITALIC KAPPA SYMBOL +1D719 ; mapped ; 03C6 # 3.1 MATHEMATICAL ITALIC PHI SYMBOL +1D71A ; mapped ; 03C1 # 3.1 MATHEMATICAL ITALIC RHO SYMBOL +1D71B ; mapped ; 03C0 # 3.1 MATHEMATICAL ITALIC PI SYMBOL +1D71C ; mapped ; 03B1 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL ALPHA +1D71D ; mapped ; 03B2 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL BETA +1D71E ; mapped ; 03B3 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL GAMMA +1D71F ; mapped ; 03B4 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL DELTA +1D720 ; mapped ; 03B5 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL EPSILON +1D721 ; mapped ; 03B6 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL ZETA +1D722 ; mapped ; 03B7 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL ETA +1D723 ; mapped ; 03B8 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL THETA +1D724 ; mapped ; 03B9 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL IOTA +1D725 ; mapped ; 03BA # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL KAPPA +1D726 ; mapped ; 03BB # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL LAMDA +1D727 ; mapped ; 03BC # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL MU +1D728 ; mapped ; 03BD # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL NU +1D729 ; mapped ; 03BE # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL XI +1D72A ; mapped ; 03BF # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL OMICRON +1D72B ; mapped ; 03C0 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL PI +1D72C ; mapped ; 03C1 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL RHO +1D72D ; mapped ; 03B8 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL THETA SYMBOL +1D72E ; mapped ; 03C3 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL SIGMA +1D72F ; mapped ; 03C4 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL TAU +1D730 ; mapped ; 03C5 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL UPSILON +1D731 ; mapped ; 03C6 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL PHI +1D732 ; mapped ; 03C7 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL CHI +1D733 ; mapped ; 03C8 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL PSI +1D734 ; mapped ; 03C9 # 3.1 MATHEMATICAL BOLD ITALIC CAPITAL OMEGA +1D735 ; mapped ; 2207 # 3.1 MATHEMATICAL BOLD ITALIC NABLA +1D736 ; mapped ; 03B1 # 3.1 MATHEMATICAL BOLD ITALIC SMALL ALPHA +1D737 ; mapped ; 03B2 # 3.1 MATHEMATICAL BOLD ITALIC SMALL BETA +1D738 ; mapped ; 03B3 # 3.1 MATHEMATICAL BOLD ITALIC SMALL GAMMA +1D739 ; mapped ; 03B4 # 3.1 MATHEMATICAL BOLD ITALIC SMALL DELTA +1D73A ; mapped ; 03B5 # 3.1 MATHEMATICAL BOLD ITALIC SMALL EPSILON +1D73B ; mapped ; 03B6 # 3.1 MATHEMATICAL BOLD ITALIC SMALL ZETA +1D73C ; mapped ; 03B7 # 3.1 MATHEMATICAL BOLD ITALIC SMALL ETA +1D73D ; mapped ; 03B8 # 3.1 MATHEMATICAL BOLD ITALIC SMALL THETA +1D73E ; mapped ; 03B9 # 3.1 MATHEMATICAL BOLD ITALIC SMALL IOTA +1D73F ; mapped ; 03BA # 3.1 MATHEMATICAL BOLD ITALIC SMALL KAPPA +1D740 ; mapped ; 03BB # 3.1 MATHEMATICAL BOLD ITALIC SMALL LAMDA +1D741 ; mapped ; 03BC # 3.1 MATHEMATICAL BOLD ITALIC SMALL MU +1D742 ; mapped ; 03BD # 3.1 MATHEMATICAL BOLD ITALIC SMALL NU +1D743 ; mapped ; 03BE # 3.1 MATHEMATICAL BOLD ITALIC SMALL XI +1D744 ; mapped ; 03BF # 3.1 MATHEMATICAL BOLD ITALIC SMALL OMICRON +1D745 ; mapped ; 03C0 # 3.1 MATHEMATICAL BOLD ITALIC SMALL PI +1D746 ; mapped ; 03C1 # 3.1 MATHEMATICAL BOLD ITALIC SMALL RHO +1D747..1D748 ; mapped ; 03C3 # 3.1 MATHEMATICAL BOLD ITALIC SMALL FINAL SIGMA..MATHEMATICAL BOLD ITALIC SMALL SIGMA +1D749 ; mapped ; 03C4 # 3.1 MATHEMATICAL BOLD ITALIC SMALL TAU +1D74A ; mapped ; 03C5 # 3.1 MATHEMATICAL BOLD ITALIC SMALL UPSILON +1D74B ; mapped ; 03C6 # 3.1 MATHEMATICAL BOLD ITALIC SMALL PHI +1D74C ; mapped ; 03C7 # 3.1 MATHEMATICAL BOLD ITALIC SMALL CHI +1D74D ; mapped ; 03C8 # 3.1 MATHEMATICAL BOLD ITALIC SMALL PSI +1D74E ; mapped ; 03C9 # 3.1 MATHEMATICAL BOLD ITALIC SMALL OMEGA +1D74F ; mapped ; 2202 # 3.1 MATHEMATICAL BOLD ITALIC PARTIAL DIFFERENTIAL +1D750 ; mapped ; 03B5 # 3.1 MATHEMATICAL BOLD ITALIC EPSILON SYMBOL +1D751 ; mapped ; 03B8 # 3.1 MATHEMATICAL BOLD ITALIC THETA SYMBOL +1D752 ; mapped ; 03BA # 3.1 MATHEMATICAL BOLD ITALIC KAPPA SYMBOL +1D753 ; mapped ; 03C6 # 3.1 MATHEMATICAL BOLD ITALIC PHI SYMBOL +1D754 ; mapped ; 03C1 # 3.1 MATHEMATICAL BOLD ITALIC RHO SYMBOL +1D755 ; mapped ; 03C0 # 3.1 MATHEMATICAL BOLD ITALIC PI SYMBOL +1D756 ; mapped ; 03B1 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL ALPHA +1D757 ; mapped ; 03B2 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL BETA +1D758 ; mapped ; 03B3 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL GAMMA +1D759 ; mapped ; 03B4 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL DELTA +1D75A ; mapped ; 03B5 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL EPSILON +1D75B ; mapped ; 03B6 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL ZETA +1D75C ; mapped ; 03B7 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL ETA +1D75D ; mapped ; 03B8 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA +1D75E ; mapped ; 03B9 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL IOTA +1D75F ; mapped ; 03BA # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL KAPPA +1D760 ; mapped ; 03BB # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL LAMDA +1D761 ; mapped ; 03BC # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL MU +1D762 ; mapped ; 03BD # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL NU +1D763 ; mapped ; 03BE # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL XI +1D764 ; mapped ; 03BF # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL OMICRON +1D765 ; mapped ; 03C0 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL PI +1D766 ; mapped ; 03C1 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL RHO +1D767 ; mapped ; 03B8 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA SYMBOL +1D768 ; mapped ; 03C3 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL SIGMA +1D769 ; mapped ; 03C4 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL TAU +1D76A ; mapped ; 03C5 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL UPSILON +1D76B ; mapped ; 03C6 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL PHI +1D76C ; mapped ; 03C7 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL CHI +1D76D ; mapped ; 03C8 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL PSI +1D76E ; mapped ; 03C9 # 3.1 MATHEMATICAL SANS-SERIF BOLD CAPITAL OMEGA +1D76F ; mapped ; 2207 # 3.1 MATHEMATICAL SANS-SERIF BOLD NABLA +1D770 ; mapped ; 03B1 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL ALPHA +1D771 ; mapped ; 03B2 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL BETA +1D772 ; mapped ; 03B3 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL GAMMA +1D773 ; mapped ; 03B4 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL DELTA +1D774 ; mapped ; 03B5 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL EPSILON +1D775 ; mapped ; 03B6 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL ZETA +1D776 ; mapped ; 03B7 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL ETA +1D777 ; mapped ; 03B8 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL THETA +1D778 ; mapped ; 03B9 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL IOTA +1D779 ; mapped ; 03BA # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL KAPPA +1D77A ; mapped ; 03BB # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL LAMDA +1D77B ; mapped ; 03BC # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL MU +1D77C ; mapped ; 03BD # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL NU +1D77D ; mapped ; 03BE # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL XI +1D77E ; mapped ; 03BF # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL OMICRON +1D77F ; mapped ; 03C0 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL PI +1D780 ; mapped ; 03C1 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL RHO +1D781..1D782 ; mapped ; 03C3 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL FINAL SIGMA..MATHEMATICAL SANS-SERIF BOLD SMALL SIGMA +1D783 ; mapped ; 03C4 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL TAU +1D784 ; mapped ; 03C5 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL UPSILON +1D785 ; mapped ; 03C6 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL PHI +1D786 ; mapped ; 03C7 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL CHI +1D787 ; mapped ; 03C8 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL PSI +1D788 ; mapped ; 03C9 # 3.1 MATHEMATICAL SANS-SERIF BOLD SMALL OMEGA +1D789 ; mapped ; 2202 # 3.1 MATHEMATICAL SANS-SERIF BOLD PARTIAL DIFFERENTIAL +1D78A ; mapped ; 03B5 # 3.1 MATHEMATICAL SANS-SERIF BOLD EPSILON SYMBOL +1D78B ; mapped ; 03B8 # 3.1 MATHEMATICAL SANS-SERIF BOLD THETA SYMBOL +1D78C ; mapped ; 03BA # 3.1 MATHEMATICAL SANS-SERIF BOLD KAPPA SYMBOL +1D78D ; mapped ; 03C6 # 3.1 MATHEMATICAL SANS-SERIF BOLD PHI SYMBOL +1D78E ; mapped ; 03C1 # 3.1 MATHEMATICAL SANS-SERIF BOLD RHO SYMBOL +1D78F ; mapped ; 03C0 # 3.1 MATHEMATICAL SANS-SERIF BOLD PI SYMBOL +1D790 ; mapped ; 03B1 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ALPHA +1D791 ; mapped ; 03B2 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL BETA +1D792 ; mapped ; 03B3 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL GAMMA +1D793 ; mapped ; 03B4 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL DELTA +1D794 ; mapped ; 03B5 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL EPSILON +1D795 ; mapped ; 03B6 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ZETA +1D796 ; mapped ; 03B7 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ETA +1D797 ; mapped ; 03B8 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA +1D798 ; mapped ; 03B9 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL IOTA +1D799 ; mapped ; 03BA # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL KAPPA +1D79A ; mapped ; 03BB # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL LAMDA +1D79B ; mapped ; 03BC # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL MU +1D79C ; mapped ; 03BD # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL NU +1D79D ; mapped ; 03BE # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL XI +1D79E ; mapped ; 03BF # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMICRON +1D79F ; mapped ; 03C0 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PI +1D7A0 ; mapped ; 03C1 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL RHO +1D7A1 ; mapped ; 03B8 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA SYMBOL +1D7A2 ; mapped ; 03C3 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL SIGMA +1D7A3 ; mapped ; 03C4 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL TAU +1D7A4 ; mapped ; 03C5 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL UPSILON +1D7A5 ; mapped ; 03C6 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PHI +1D7A6 ; mapped ; 03C7 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL CHI +1D7A7 ; mapped ; 03C8 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PSI +1D7A8 ; mapped ; 03C9 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMEGA +1D7A9 ; mapped ; 2207 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC NABLA +1D7AA ; mapped ; 03B1 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ALPHA +1D7AB ; mapped ; 03B2 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL BETA +1D7AC ; mapped ; 03B3 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL GAMMA +1D7AD ; mapped ; 03B4 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL DELTA +1D7AE ; mapped ; 03B5 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL EPSILON +1D7AF ; mapped ; 03B6 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ZETA +1D7B0 ; mapped ; 03B7 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ETA +1D7B1 ; mapped ; 03B8 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL THETA +1D7B2 ; mapped ; 03B9 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL IOTA +1D7B3 ; mapped ; 03BA # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL KAPPA +1D7B4 ; mapped ; 03BB # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL LAMDA +1D7B5 ; mapped ; 03BC # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL MU +1D7B6 ; mapped ; 03BD # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL NU +1D7B7 ; mapped ; 03BE # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL XI +1D7B8 ; mapped ; 03BF # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMICRON +1D7B9 ; mapped ; 03C0 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PI +1D7BA ; mapped ; 03C1 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL RHO +1D7BB..1D7BC ; mapped ; 03C3 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL FINAL SIGMA..MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL SIGMA +1D7BD ; mapped ; 03C4 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL TAU +1D7BE ; mapped ; 03C5 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL UPSILON +1D7BF ; mapped ; 03C6 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PHI +1D7C0 ; mapped ; 03C7 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL CHI +1D7C1 ; mapped ; 03C8 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PSI +1D7C2 ; mapped ; 03C9 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMEGA +1D7C3 ; mapped ; 2202 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC PARTIAL DIFFERENTIAL +1D7C4 ; mapped ; 03B5 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL +1D7C5 ; mapped ; 03B8 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC THETA SYMBOL +1D7C6 ; mapped ; 03BA # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC KAPPA SYMBOL +1D7C7 ; mapped ; 03C6 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC PHI SYMBOL +1D7C8 ; mapped ; 03C1 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC RHO SYMBOL +1D7C9 ; mapped ; 03C0 # 3.1 MATHEMATICAL SANS-SERIF BOLD ITALIC PI SYMBOL +1D7CA..1D7CB ; mapped ; 03DD # 5.0 MATHEMATICAL BOLD CAPITAL DIGAMMA..MATHEMATICAL BOLD SMALL DIGAMMA +1D7CC..1D7CD ; disallowed # NA .. +1D7CE ; mapped ; 0030 # 3.1 MATHEMATICAL BOLD DIGIT ZERO +1D7CF ; mapped ; 0031 # 3.1 MATHEMATICAL BOLD DIGIT ONE +1D7D0 ; mapped ; 0032 # 3.1 MATHEMATICAL BOLD DIGIT TWO +1D7D1 ; mapped ; 0033 # 3.1 MATHEMATICAL BOLD DIGIT THREE +1D7D2 ; mapped ; 0034 # 3.1 MATHEMATICAL BOLD DIGIT FOUR +1D7D3 ; mapped ; 0035 # 3.1 MATHEMATICAL BOLD DIGIT FIVE +1D7D4 ; mapped ; 0036 # 3.1 MATHEMATICAL BOLD DIGIT SIX +1D7D5 ; mapped ; 0037 # 3.1 MATHEMATICAL BOLD DIGIT SEVEN +1D7D6 ; mapped ; 0038 # 3.1 MATHEMATICAL BOLD DIGIT EIGHT +1D7D7 ; mapped ; 0039 # 3.1 MATHEMATICAL BOLD DIGIT NINE +1D7D8 ; mapped ; 0030 # 3.1 MATHEMATICAL DOUBLE-STRUCK DIGIT ZERO +1D7D9 ; mapped ; 0031 # 3.1 MATHEMATICAL DOUBLE-STRUCK DIGIT ONE +1D7DA ; mapped ; 0032 # 3.1 MATHEMATICAL DOUBLE-STRUCK DIGIT TWO +1D7DB ; mapped ; 0033 # 3.1 MATHEMATICAL DOUBLE-STRUCK DIGIT THREE +1D7DC ; mapped ; 0034 # 3.1 MATHEMATICAL DOUBLE-STRUCK DIGIT FOUR +1D7DD ; mapped ; 0035 # 3.1 MATHEMATICAL DOUBLE-STRUCK DIGIT FIVE +1D7DE ; mapped ; 0036 # 3.1 MATHEMATICAL DOUBLE-STRUCK DIGIT SIX +1D7DF ; mapped ; 0037 # 3.1 MATHEMATICAL DOUBLE-STRUCK DIGIT SEVEN +1D7E0 ; mapped ; 0038 # 3.1 MATHEMATICAL DOUBLE-STRUCK DIGIT EIGHT +1D7E1 ; mapped ; 0039 # 3.1 MATHEMATICAL DOUBLE-STRUCK DIGIT NINE +1D7E2 ; mapped ; 0030 # 3.1 MATHEMATICAL SANS-SERIF DIGIT ZERO +1D7E3 ; mapped ; 0031 # 3.1 MATHEMATICAL SANS-SERIF DIGIT ONE +1D7E4 ; mapped ; 0032 # 3.1 MATHEMATICAL SANS-SERIF DIGIT TWO +1D7E5 ; mapped ; 0033 # 3.1 MATHEMATICAL SANS-SERIF DIGIT THREE +1D7E6 ; mapped ; 0034 # 3.1 MATHEMATICAL SANS-SERIF DIGIT FOUR +1D7E7 ; mapped ; 0035 # 3.1 MATHEMATICAL SANS-SERIF DIGIT FIVE +1D7E8 ; mapped ; 0036 # 3.1 MATHEMATICAL SANS-SERIF DIGIT SIX +1D7E9 ; mapped ; 0037 # 3.1 MATHEMATICAL SANS-SERIF DIGIT SEVEN +1D7EA ; mapped ; 0038 # 3.1 MATHEMATICAL SANS-SERIF DIGIT EIGHT +1D7EB ; mapped ; 0039 # 3.1 MATHEMATICAL SANS-SERIF DIGIT NINE +1D7EC ; mapped ; 0030 # 3.1 MATHEMATICAL SANS-SERIF BOLD DIGIT ZERO +1D7ED ; mapped ; 0031 # 3.1 MATHEMATICAL SANS-SERIF BOLD DIGIT ONE +1D7EE ; mapped ; 0032 # 3.1 MATHEMATICAL SANS-SERIF BOLD DIGIT TWO +1D7EF ; mapped ; 0033 # 3.1 MATHEMATICAL SANS-SERIF BOLD DIGIT THREE +1D7F0 ; mapped ; 0034 # 3.1 MATHEMATICAL SANS-SERIF BOLD DIGIT FOUR +1D7F1 ; mapped ; 0035 # 3.1 MATHEMATICAL SANS-SERIF BOLD DIGIT FIVE +1D7F2 ; mapped ; 0036 # 3.1 MATHEMATICAL SANS-SERIF BOLD DIGIT SIX +1D7F3 ; mapped ; 0037 # 3.1 MATHEMATICAL SANS-SERIF BOLD DIGIT SEVEN +1D7F4 ; mapped ; 0038 # 3.1 MATHEMATICAL SANS-SERIF BOLD DIGIT EIGHT +1D7F5 ; mapped ; 0039 # 3.1 MATHEMATICAL SANS-SERIF BOLD DIGIT NINE +1D7F6 ; mapped ; 0030 # 3.1 MATHEMATICAL MONOSPACE DIGIT ZERO +1D7F7 ; mapped ; 0031 # 3.1 MATHEMATICAL MONOSPACE DIGIT ONE +1D7F8 ; mapped ; 0032 # 3.1 MATHEMATICAL MONOSPACE DIGIT TWO +1D7F9 ; mapped ; 0033 # 3.1 MATHEMATICAL MONOSPACE DIGIT THREE +1D7FA ; mapped ; 0034 # 3.1 MATHEMATICAL MONOSPACE DIGIT FOUR +1D7FB ; mapped ; 0035 # 3.1 MATHEMATICAL MONOSPACE DIGIT FIVE +1D7FC ; mapped ; 0036 # 3.1 MATHEMATICAL MONOSPACE DIGIT SIX +1D7FD ; mapped ; 0037 # 3.1 MATHEMATICAL MONOSPACE DIGIT SEVEN +1D7FE ; mapped ; 0038 # 3.1 MATHEMATICAL MONOSPACE DIGIT EIGHT +1D7FF ; mapped ; 0039 # 3.1 MATHEMATICAL MONOSPACE DIGIT NINE +1D800..1D9FF ; valid ; ; NV8 # 8.0 SIGNWRITING HAND-FIST INDEX..SIGNWRITING HEAD +1DA00..1DA36 ; valid # 8.0 SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN +1DA37..1DA3A ; valid ; ; NV8 # 8.0 SIGNWRITING AIR BLOW SMALL ROTATIONS..SIGNWRITING BREATH EXHALE +1DA3B..1DA6C ; valid # 8.0 SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT +1DA6D..1DA74 ; valid ; ; NV8 # 8.0 SIGNWRITING SHOULDER HIP SPINE..SIGNWRITING TORSO-FLOORPLANE TWISTING +1DA75 ; valid # 8.0 SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS +1DA76..1DA83 ; valid ; ; NV8 # 8.0 SIGNWRITING LIMB COMBINATION..SIGNWRITING LOCATION DEPTH +1DA84 ; valid # 8.0 SIGNWRITING LOCATION HEAD NECK +1DA85..1DA8B ; valid ; ; NV8 # 8.0 SIGNWRITING LOCATION TORSO..SIGNWRITING PARENTHESIS +1DA8C..1DA9A ; disallowed # NA .. +1DA9B..1DA9F ; valid # 8.0 SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6 +1DAA0 ; disallowed # NA +1DAA1..1DAAF ; valid # 8.0 SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16 +1DAB0..1DEFF ; disallowed # NA .. +1DF00..1DF1E ; valid # 14.0 LATIN SMALL LETTER FENG DIGRAPH WITH TRILL..LATIN SMALL LETTER S WITH CURL +1DF1F..1DF24 ; disallowed # NA .. +1DF25..1DF2A ; valid # 15.0 LATIN SMALL LETTER D WITH MID-HEIGHT LEFT HOOK..LATIN SMALL LETTER T WITH MID-HEIGHT LEFT HOOK +1DF2B..1DFFF ; disallowed # NA .. +1E000..1E006 ; valid # 9.0 COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE +1E007 ; disallowed # NA +1E008..1E018 ; valid # 9.0 COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU +1E019..1E01A ; disallowed # NA .. +1E01B..1E021 ; valid # 9.0 COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI +1E022 ; disallowed # NA +1E023..1E024 ; valid # 9.0 COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS +1E025 ; disallowed # NA +1E026..1E02A ; valid # 9.0 COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA +1E02B..1E02F ; disallowed # NA .. +1E030 ; mapped ; 0430 # 15.0 MODIFIER LETTER CYRILLIC SMALL A +1E031 ; mapped ; 0431 # 15.0 MODIFIER LETTER CYRILLIC SMALL BE +1E032 ; mapped ; 0432 # 15.0 MODIFIER LETTER CYRILLIC SMALL VE +1E033 ; mapped ; 0433 # 15.0 MODIFIER LETTER CYRILLIC SMALL GHE +1E034 ; mapped ; 0434 # 15.0 MODIFIER LETTER CYRILLIC SMALL DE +1E035 ; mapped ; 0435 # 15.0 MODIFIER LETTER CYRILLIC SMALL IE +1E036 ; mapped ; 0436 # 15.0 MODIFIER LETTER CYRILLIC SMALL ZHE +1E037 ; mapped ; 0437 # 15.0 MODIFIER LETTER CYRILLIC SMALL ZE +1E038 ; mapped ; 0438 # 15.0 MODIFIER LETTER CYRILLIC SMALL I +1E039 ; mapped ; 043A # 15.0 MODIFIER LETTER CYRILLIC SMALL KA +1E03A ; mapped ; 043B # 15.0 MODIFIER LETTER CYRILLIC SMALL EL +1E03B ; mapped ; 043C # 15.0 MODIFIER LETTER CYRILLIC SMALL EM +1E03C ; mapped ; 043E # 15.0 MODIFIER LETTER CYRILLIC SMALL O +1E03D ; mapped ; 043F # 15.0 MODIFIER LETTER CYRILLIC SMALL PE +1E03E ; mapped ; 0440 # 15.0 MODIFIER LETTER CYRILLIC SMALL ER +1E03F ; mapped ; 0441 # 15.0 MODIFIER LETTER CYRILLIC SMALL ES +1E040 ; mapped ; 0442 # 15.0 MODIFIER LETTER CYRILLIC SMALL TE +1E041 ; mapped ; 0443 # 15.0 MODIFIER LETTER CYRILLIC SMALL U +1E042 ; mapped ; 0444 # 15.0 MODIFIER LETTER CYRILLIC SMALL EF +1E043 ; mapped ; 0445 # 15.0 MODIFIER LETTER CYRILLIC SMALL HA +1E044 ; mapped ; 0446 # 15.0 MODIFIER LETTER CYRILLIC SMALL TSE +1E045 ; mapped ; 0447 # 15.0 MODIFIER LETTER CYRILLIC SMALL CHE +1E046 ; mapped ; 0448 # 15.0 MODIFIER LETTER CYRILLIC SMALL SHA +1E047 ; mapped ; 044B # 15.0 MODIFIER LETTER CYRILLIC SMALL YERU +1E048 ; mapped ; 044D # 15.0 MODIFIER LETTER CYRILLIC SMALL E +1E049 ; mapped ; 044E # 15.0 MODIFIER LETTER CYRILLIC SMALL YU +1E04A ; mapped ; A689 # 15.0 MODIFIER LETTER CYRILLIC SMALL DZZE +1E04B ; mapped ; 04D9 # 15.0 MODIFIER LETTER CYRILLIC SMALL SCHWA +1E04C ; mapped ; 0456 # 15.0 MODIFIER LETTER CYRILLIC SMALL BYELORUSSIAN-UKRAINIAN I +1E04D ; mapped ; 0458 # 15.0 MODIFIER LETTER CYRILLIC SMALL JE +1E04E ; mapped ; 04E9 # 15.0 MODIFIER LETTER CYRILLIC SMALL BARRED O +1E04F ; mapped ; 04AF # 15.0 MODIFIER LETTER CYRILLIC SMALL STRAIGHT U +1E050 ; mapped ; 04CF # 15.0 MODIFIER LETTER CYRILLIC SMALL PALOCHKA +1E051 ; mapped ; 0430 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER A +1E052 ; mapped ; 0431 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER BE +1E053 ; mapped ; 0432 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER VE +1E054 ; mapped ; 0433 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER GHE +1E055 ; mapped ; 0434 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER DE +1E056 ; mapped ; 0435 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER IE +1E057 ; mapped ; 0436 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER ZHE +1E058 ; mapped ; 0437 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER ZE +1E059 ; mapped ; 0438 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER I +1E05A ; mapped ; 043A # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER KA +1E05B ; mapped ; 043B # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER EL +1E05C ; mapped ; 043E # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER O +1E05D ; mapped ; 043F # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER PE +1E05E ; mapped ; 0441 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER ES +1E05F ; mapped ; 0443 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER U +1E060 ; mapped ; 0444 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER EF +1E061 ; mapped ; 0445 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER HA +1E062 ; mapped ; 0446 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER TSE +1E063 ; mapped ; 0447 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER CHE +1E064 ; mapped ; 0448 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER SHA +1E065 ; mapped ; 044A # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER HARD SIGN +1E066 ; mapped ; 044B # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER YERU +1E067 ; mapped ; 0491 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER GHE WITH UPTURN +1E068 ; mapped ; 0456 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER BYELORUSSIAN-UKRAINIAN I +1E069 ; mapped ; 0455 # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER DZE +1E06A ; mapped ; 045F # 15.0 CYRILLIC SUBSCRIPT SMALL LETTER DZHE +1E06B ; mapped ; 04AB # 15.0 MODIFIER LETTER CYRILLIC SMALL ES WITH DESCENDER +1E06C ; mapped ; A651 # 15.0 MODIFIER LETTER CYRILLIC SMALL YERU WITH BACK YER +1E06D ; mapped ; 04B1 # 15.0 MODIFIER LETTER CYRILLIC SMALL STRAIGHT U WITH STROKE +1E06E..1E08E ; disallowed # NA .. +1E08F ; valid # 15.0 COMBINING CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I +1E090..1E0FF ; disallowed # NA .. +1E100..1E12C ; valid # 12.0 NYIAKENG PUACHUE HMONG LETTER MA..NYIAKENG PUACHUE HMONG LETTER W +1E12D..1E12F ; disallowed # NA .. +1E130..1E13D ; valid # 12.0 NYIAKENG PUACHUE HMONG TONE-B..NYIAKENG PUACHUE HMONG SYLLABLE LENGTHENER +1E13E..1E13F ; disallowed # NA .. +1E140..1E149 ; valid # 12.0 NYIAKENG PUACHUE HMONG DIGIT ZERO..NYIAKENG PUACHUE HMONG DIGIT NINE +1E14A..1E14D ; disallowed # NA .. +1E14E ; valid # 12.0 NYIAKENG PUACHUE HMONG LOGOGRAM NYAJ +1E14F ; valid ; ; NV8 # 12.0 NYIAKENG PUACHUE HMONG CIRCLED CA +1E150..1E28F ; disallowed # NA .. +1E290..1E2AE ; valid # 14.0 TOTO LETTER PA..TOTO SIGN RISING TONE +1E2AF..1E2BF ; disallowed # NA .. +1E2C0..1E2F9 ; valid # 12.0 WANCHO LETTER AA..WANCHO DIGIT NINE +1E2FA..1E2FE ; disallowed # NA .. +1E2FF ; valid ; ; NV8 # 12.0 WANCHO NGUN SIGN +1E300..1E4CF ; disallowed # NA .. +1E4D0..1E4F9 ; valid # 15.0 NAG MUNDARI LETTER O..NAG MUNDARI DIGIT NINE +1E4FA..1E7DF ; disallowed # NA .. +1E7E0..1E7E6 ; valid # 14.0 ETHIOPIC SYLLABLE HHYA..ETHIOPIC SYLLABLE HHYO +1E7E7 ; disallowed # NA +1E7E8..1E7EB ; valid # 14.0 ETHIOPIC SYLLABLE GURAGE HHWA..ETHIOPIC SYLLABLE HHWE +1E7EC ; disallowed # NA +1E7ED..1E7EE ; valid # 14.0 ETHIOPIC SYLLABLE GURAGE MWI..ETHIOPIC SYLLABLE GURAGE MWEE +1E7EF ; disallowed # NA +1E7F0..1E7FE ; valid # 14.0 ETHIOPIC SYLLABLE GURAGE QWI..ETHIOPIC SYLLABLE GURAGE PWEE +1E7FF ; disallowed # NA +1E800..1E8C4 ; valid # 7.0 MENDE KIKAKUI SYLLABLE M001 KI..MENDE KIKAKUI SYLLABLE M060 NYON +1E8C5..1E8C6 ; disallowed # NA .. +1E8C7..1E8CF ; valid ; ; NV8 # 7.0 MENDE KIKAKUI DIGIT ONE..MENDE KIKAKUI DIGIT NINE +1E8D0..1E8D6 ; valid # 7.0 MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS +1E8D7..1E8FF ; disallowed # NA .. +1E900 ; mapped ; 1E922 # 9.0 ADLAM CAPITAL LETTER ALIF +1E901 ; mapped ; 1E923 # 9.0 ADLAM CAPITAL LETTER DAALI +1E902 ; mapped ; 1E924 # 9.0 ADLAM CAPITAL LETTER LAAM +1E903 ; mapped ; 1E925 # 9.0 ADLAM CAPITAL LETTER MIIM +1E904 ; mapped ; 1E926 # 9.0 ADLAM CAPITAL LETTER BA +1E905 ; mapped ; 1E927 # 9.0 ADLAM CAPITAL LETTER SINNYIIYHE +1E906 ; mapped ; 1E928 # 9.0 ADLAM CAPITAL LETTER PE +1E907 ; mapped ; 1E929 # 9.0 ADLAM CAPITAL LETTER BHE +1E908 ; mapped ; 1E92A # 9.0 ADLAM CAPITAL LETTER RA +1E909 ; mapped ; 1E92B # 9.0 ADLAM CAPITAL LETTER E +1E90A ; mapped ; 1E92C # 9.0 ADLAM CAPITAL LETTER FA +1E90B ; mapped ; 1E92D # 9.0 ADLAM CAPITAL LETTER I +1E90C ; mapped ; 1E92E # 9.0 ADLAM CAPITAL LETTER O +1E90D ; mapped ; 1E92F # 9.0 ADLAM CAPITAL LETTER DHA +1E90E ; mapped ; 1E930 # 9.0 ADLAM CAPITAL LETTER YHE +1E90F ; mapped ; 1E931 # 9.0 ADLAM CAPITAL LETTER WAW +1E910 ; mapped ; 1E932 # 9.0 ADLAM CAPITAL LETTER NUN +1E911 ; mapped ; 1E933 # 9.0 ADLAM CAPITAL LETTER KAF +1E912 ; mapped ; 1E934 # 9.0 ADLAM CAPITAL LETTER YA +1E913 ; mapped ; 1E935 # 9.0 ADLAM CAPITAL LETTER U +1E914 ; mapped ; 1E936 # 9.0 ADLAM CAPITAL LETTER JIIM +1E915 ; mapped ; 1E937 # 9.0 ADLAM CAPITAL LETTER CHI +1E916 ; mapped ; 1E938 # 9.0 ADLAM CAPITAL LETTER HA +1E917 ; mapped ; 1E939 # 9.0 ADLAM CAPITAL LETTER QAAF +1E918 ; mapped ; 1E93A # 9.0 ADLAM CAPITAL LETTER GA +1E919 ; mapped ; 1E93B # 9.0 ADLAM CAPITAL LETTER NYA +1E91A ; mapped ; 1E93C # 9.0 ADLAM CAPITAL LETTER TU +1E91B ; mapped ; 1E93D # 9.0 ADLAM CAPITAL LETTER NHA +1E91C ; mapped ; 1E93E # 9.0 ADLAM CAPITAL LETTER VA +1E91D ; mapped ; 1E93F # 9.0 ADLAM CAPITAL LETTER KHA +1E91E ; mapped ; 1E940 # 9.0 ADLAM CAPITAL LETTER GBE +1E91F ; mapped ; 1E941 # 9.0 ADLAM CAPITAL LETTER ZAL +1E920 ; mapped ; 1E942 # 9.0 ADLAM CAPITAL LETTER KPO +1E921 ; mapped ; 1E943 # 9.0 ADLAM CAPITAL LETTER SHA +1E922..1E94A ; valid # 9.0 ADLAM SMALL LETTER ALIF..ADLAM NUKTA +1E94B ; valid # 12.0 ADLAM NASALIZATION MARK +1E94C..1E94F ; disallowed # NA .. +1E950..1E959 ; valid # 9.0 ADLAM DIGIT ZERO..ADLAM DIGIT NINE +1E95A..1E95D ; disallowed # NA .. +1E95E..1E95F ; valid ; ; NV8 # 9.0 ADLAM INITIAL EXCLAMATION MARK..ADLAM INITIAL QUESTION MARK +1E960..1EC70 ; disallowed # NA .. +1EC71..1ECB4 ; valid ; ; NV8 # 11.0 INDIC SIYAQ NUMBER ONE..INDIC SIYAQ ALTERNATE LAKH MARK +1ECB5..1ED00 ; disallowed # NA .. +1ED01..1ED3D ; valid ; ; NV8 # 12.0 OTTOMAN SIYAQ NUMBER ONE..OTTOMAN SIYAQ FRACTION ONE SIXTH +1ED3E..1EDFF ; disallowed # NA .. +1EE00 ; mapped ; 0627 # 6.1 ARABIC MATHEMATICAL ALEF +1EE01 ; mapped ; 0628 # 6.1 ARABIC MATHEMATICAL BEH +1EE02 ; mapped ; 062C # 6.1 ARABIC MATHEMATICAL JEEM +1EE03 ; mapped ; 062F # 6.1 ARABIC MATHEMATICAL DAL +1EE04 ; disallowed # NA +1EE05 ; mapped ; 0648 # 6.1 ARABIC MATHEMATICAL WAW +1EE06 ; mapped ; 0632 # 6.1 ARABIC MATHEMATICAL ZAIN +1EE07 ; mapped ; 062D # 6.1 ARABIC MATHEMATICAL HAH +1EE08 ; mapped ; 0637 # 6.1 ARABIC MATHEMATICAL TAH +1EE09 ; mapped ; 064A # 6.1 ARABIC MATHEMATICAL YEH +1EE0A ; mapped ; 0643 # 6.1 ARABIC MATHEMATICAL KAF +1EE0B ; mapped ; 0644 # 6.1 ARABIC MATHEMATICAL LAM +1EE0C ; mapped ; 0645 # 6.1 ARABIC MATHEMATICAL MEEM +1EE0D ; mapped ; 0646 # 6.1 ARABIC MATHEMATICAL NOON +1EE0E ; mapped ; 0633 # 6.1 ARABIC MATHEMATICAL SEEN +1EE0F ; mapped ; 0639 # 6.1 ARABIC MATHEMATICAL AIN +1EE10 ; mapped ; 0641 # 6.1 ARABIC MATHEMATICAL FEH +1EE11 ; mapped ; 0635 # 6.1 ARABIC MATHEMATICAL SAD +1EE12 ; mapped ; 0642 # 6.1 ARABIC MATHEMATICAL QAF +1EE13 ; mapped ; 0631 # 6.1 ARABIC MATHEMATICAL REH +1EE14 ; mapped ; 0634 # 6.1 ARABIC MATHEMATICAL SHEEN +1EE15 ; mapped ; 062A # 6.1 ARABIC MATHEMATICAL TEH +1EE16 ; mapped ; 062B # 6.1 ARABIC MATHEMATICAL THEH +1EE17 ; mapped ; 062E # 6.1 ARABIC MATHEMATICAL KHAH +1EE18 ; mapped ; 0630 # 6.1 ARABIC MATHEMATICAL THAL +1EE19 ; mapped ; 0636 # 6.1 ARABIC MATHEMATICAL DAD +1EE1A ; mapped ; 0638 # 6.1 ARABIC MATHEMATICAL ZAH +1EE1B ; mapped ; 063A # 6.1 ARABIC MATHEMATICAL GHAIN +1EE1C ; mapped ; 066E # 6.1 ARABIC MATHEMATICAL DOTLESS BEH +1EE1D ; mapped ; 06BA # 6.1 ARABIC MATHEMATICAL DOTLESS NOON +1EE1E ; mapped ; 06A1 # 6.1 ARABIC MATHEMATICAL DOTLESS FEH +1EE1F ; mapped ; 066F # 6.1 ARABIC MATHEMATICAL DOTLESS QAF +1EE20 ; disallowed # NA +1EE21 ; mapped ; 0628 # 6.1 ARABIC MATHEMATICAL INITIAL BEH +1EE22 ; mapped ; 062C # 6.1 ARABIC MATHEMATICAL INITIAL JEEM +1EE23 ; disallowed # NA +1EE24 ; mapped ; 0647 # 6.1 ARABIC MATHEMATICAL INITIAL HEH +1EE25..1EE26 ; disallowed # NA .. +1EE27 ; mapped ; 062D # 6.1 ARABIC MATHEMATICAL INITIAL HAH +1EE28 ; disallowed # NA +1EE29 ; mapped ; 064A # 6.1 ARABIC MATHEMATICAL INITIAL YEH +1EE2A ; mapped ; 0643 # 6.1 ARABIC MATHEMATICAL INITIAL KAF +1EE2B ; mapped ; 0644 # 6.1 ARABIC MATHEMATICAL INITIAL LAM +1EE2C ; mapped ; 0645 # 6.1 ARABIC MATHEMATICAL INITIAL MEEM +1EE2D ; mapped ; 0646 # 6.1 ARABIC MATHEMATICAL INITIAL NOON +1EE2E ; mapped ; 0633 # 6.1 ARABIC MATHEMATICAL INITIAL SEEN +1EE2F ; mapped ; 0639 # 6.1 ARABIC MATHEMATICAL INITIAL AIN +1EE30 ; mapped ; 0641 # 6.1 ARABIC MATHEMATICAL INITIAL FEH +1EE31 ; mapped ; 0635 # 6.1 ARABIC MATHEMATICAL INITIAL SAD +1EE32 ; mapped ; 0642 # 6.1 ARABIC MATHEMATICAL INITIAL QAF +1EE33 ; disallowed # NA +1EE34 ; mapped ; 0634 # 6.1 ARABIC MATHEMATICAL INITIAL SHEEN +1EE35 ; mapped ; 062A # 6.1 ARABIC MATHEMATICAL INITIAL TEH +1EE36 ; mapped ; 062B # 6.1 ARABIC MATHEMATICAL INITIAL THEH +1EE37 ; mapped ; 062E # 6.1 ARABIC MATHEMATICAL INITIAL KHAH +1EE38 ; disallowed # NA +1EE39 ; mapped ; 0636 # 6.1 ARABIC MATHEMATICAL INITIAL DAD +1EE3A ; disallowed # NA +1EE3B ; mapped ; 063A # 6.1 ARABIC MATHEMATICAL INITIAL GHAIN +1EE3C..1EE41 ; disallowed # NA .. +1EE42 ; mapped ; 062C # 6.1 ARABIC MATHEMATICAL TAILED JEEM +1EE43..1EE46 ; disallowed # NA .. +1EE47 ; mapped ; 062D # 6.1 ARABIC MATHEMATICAL TAILED HAH +1EE48 ; disallowed # NA +1EE49 ; mapped ; 064A # 6.1 ARABIC MATHEMATICAL TAILED YEH +1EE4A ; disallowed # NA +1EE4B ; mapped ; 0644 # 6.1 ARABIC MATHEMATICAL TAILED LAM +1EE4C ; disallowed # NA +1EE4D ; mapped ; 0646 # 6.1 ARABIC MATHEMATICAL TAILED NOON +1EE4E ; mapped ; 0633 # 6.1 ARABIC MATHEMATICAL TAILED SEEN +1EE4F ; mapped ; 0639 # 6.1 ARABIC MATHEMATICAL TAILED AIN +1EE50 ; disallowed # NA +1EE51 ; mapped ; 0635 # 6.1 ARABIC MATHEMATICAL TAILED SAD +1EE52 ; mapped ; 0642 # 6.1 ARABIC MATHEMATICAL TAILED QAF +1EE53 ; disallowed # NA +1EE54 ; mapped ; 0634 # 6.1 ARABIC MATHEMATICAL TAILED SHEEN +1EE55..1EE56 ; disallowed # NA .. +1EE57 ; mapped ; 062E # 6.1 ARABIC MATHEMATICAL TAILED KHAH +1EE58 ; disallowed # NA +1EE59 ; mapped ; 0636 # 6.1 ARABIC MATHEMATICAL TAILED DAD +1EE5A ; disallowed # NA +1EE5B ; mapped ; 063A # 6.1 ARABIC MATHEMATICAL TAILED GHAIN +1EE5C ; disallowed # NA +1EE5D ; mapped ; 06BA # 6.1 ARABIC MATHEMATICAL TAILED DOTLESS NOON +1EE5E ; disallowed # NA +1EE5F ; mapped ; 066F # 6.1 ARABIC MATHEMATICAL TAILED DOTLESS QAF +1EE60 ; disallowed # NA +1EE61 ; mapped ; 0628 # 6.1 ARABIC MATHEMATICAL STRETCHED BEH +1EE62 ; mapped ; 062C # 6.1 ARABIC MATHEMATICAL STRETCHED JEEM +1EE63 ; disallowed # NA +1EE64 ; mapped ; 0647 # 6.1 ARABIC MATHEMATICAL STRETCHED HEH +1EE65..1EE66 ; disallowed # NA .. +1EE67 ; mapped ; 062D # 6.1 ARABIC MATHEMATICAL STRETCHED HAH +1EE68 ; mapped ; 0637 # 6.1 ARABIC MATHEMATICAL STRETCHED TAH +1EE69 ; mapped ; 064A # 6.1 ARABIC MATHEMATICAL STRETCHED YEH +1EE6A ; mapped ; 0643 # 6.1 ARABIC MATHEMATICAL STRETCHED KAF +1EE6B ; disallowed # NA +1EE6C ; mapped ; 0645 # 6.1 ARABIC MATHEMATICAL STRETCHED MEEM +1EE6D ; mapped ; 0646 # 6.1 ARABIC MATHEMATICAL STRETCHED NOON +1EE6E ; mapped ; 0633 # 6.1 ARABIC MATHEMATICAL STRETCHED SEEN +1EE6F ; mapped ; 0639 # 6.1 ARABIC MATHEMATICAL STRETCHED AIN +1EE70 ; mapped ; 0641 # 6.1 ARABIC MATHEMATICAL STRETCHED FEH +1EE71 ; mapped ; 0635 # 6.1 ARABIC MATHEMATICAL STRETCHED SAD +1EE72 ; mapped ; 0642 # 6.1 ARABIC MATHEMATICAL STRETCHED QAF +1EE73 ; disallowed # NA +1EE74 ; mapped ; 0634 # 6.1 ARABIC MATHEMATICAL STRETCHED SHEEN +1EE75 ; mapped ; 062A # 6.1 ARABIC MATHEMATICAL STRETCHED TEH +1EE76 ; mapped ; 062B # 6.1 ARABIC MATHEMATICAL STRETCHED THEH +1EE77 ; mapped ; 062E # 6.1 ARABIC MATHEMATICAL STRETCHED KHAH +1EE78 ; disallowed # NA +1EE79 ; mapped ; 0636 # 6.1 ARABIC MATHEMATICAL STRETCHED DAD +1EE7A ; mapped ; 0638 # 6.1 ARABIC MATHEMATICAL STRETCHED ZAH +1EE7B ; mapped ; 063A # 6.1 ARABIC MATHEMATICAL STRETCHED GHAIN +1EE7C ; mapped ; 066E # 6.1 ARABIC MATHEMATICAL STRETCHED DOTLESS BEH +1EE7D ; disallowed # NA +1EE7E ; mapped ; 06A1 # 6.1 ARABIC MATHEMATICAL STRETCHED DOTLESS FEH +1EE7F ; disallowed # NA +1EE80 ; mapped ; 0627 # 6.1 ARABIC MATHEMATICAL LOOPED ALEF +1EE81 ; mapped ; 0628 # 6.1 ARABIC MATHEMATICAL LOOPED BEH +1EE82 ; mapped ; 062C # 6.1 ARABIC MATHEMATICAL LOOPED JEEM +1EE83 ; mapped ; 062F # 6.1 ARABIC MATHEMATICAL LOOPED DAL +1EE84 ; mapped ; 0647 # 6.1 ARABIC MATHEMATICAL LOOPED HEH +1EE85 ; mapped ; 0648 # 6.1 ARABIC MATHEMATICAL LOOPED WAW +1EE86 ; mapped ; 0632 # 6.1 ARABIC MATHEMATICAL LOOPED ZAIN +1EE87 ; mapped ; 062D # 6.1 ARABIC MATHEMATICAL LOOPED HAH +1EE88 ; mapped ; 0637 # 6.1 ARABIC MATHEMATICAL LOOPED TAH +1EE89 ; mapped ; 064A # 6.1 ARABIC MATHEMATICAL LOOPED YEH +1EE8A ; disallowed # NA +1EE8B ; mapped ; 0644 # 6.1 ARABIC MATHEMATICAL LOOPED LAM +1EE8C ; mapped ; 0645 # 6.1 ARABIC MATHEMATICAL LOOPED MEEM +1EE8D ; mapped ; 0646 # 6.1 ARABIC MATHEMATICAL LOOPED NOON +1EE8E ; mapped ; 0633 # 6.1 ARABIC MATHEMATICAL LOOPED SEEN +1EE8F ; mapped ; 0639 # 6.1 ARABIC MATHEMATICAL LOOPED AIN +1EE90 ; mapped ; 0641 # 6.1 ARABIC MATHEMATICAL LOOPED FEH +1EE91 ; mapped ; 0635 # 6.1 ARABIC MATHEMATICAL LOOPED SAD +1EE92 ; mapped ; 0642 # 6.1 ARABIC MATHEMATICAL LOOPED QAF +1EE93 ; mapped ; 0631 # 6.1 ARABIC MATHEMATICAL LOOPED REH +1EE94 ; mapped ; 0634 # 6.1 ARABIC MATHEMATICAL LOOPED SHEEN +1EE95 ; mapped ; 062A # 6.1 ARABIC MATHEMATICAL LOOPED TEH +1EE96 ; mapped ; 062B # 6.1 ARABIC MATHEMATICAL LOOPED THEH +1EE97 ; mapped ; 062E # 6.1 ARABIC MATHEMATICAL LOOPED KHAH +1EE98 ; mapped ; 0630 # 6.1 ARABIC MATHEMATICAL LOOPED THAL +1EE99 ; mapped ; 0636 # 6.1 ARABIC MATHEMATICAL LOOPED DAD +1EE9A ; mapped ; 0638 # 6.1 ARABIC MATHEMATICAL LOOPED ZAH +1EE9B ; mapped ; 063A # 6.1 ARABIC MATHEMATICAL LOOPED GHAIN +1EE9C..1EEA0 ; disallowed # NA .. +1EEA1 ; mapped ; 0628 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK BEH +1EEA2 ; mapped ; 062C # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK JEEM +1EEA3 ; mapped ; 062F # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK DAL +1EEA4 ; disallowed # NA +1EEA5 ; mapped ; 0648 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK WAW +1EEA6 ; mapped ; 0632 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK ZAIN +1EEA7 ; mapped ; 062D # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK HAH +1EEA8 ; mapped ; 0637 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK TAH +1EEA9 ; mapped ; 064A # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK YEH +1EEAA ; disallowed # NA +1EEAB ; mapped ; 0644 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK LAM +1EEAC ; mapped ; 0645 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK MEEM +1EEAD ; mapped ; 0646 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK NOON +1EEAE ; mapped ; 0633 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK SEEN +1EEAF ; mapped ; 0639 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK AIN +1EEB0 ; mapped ; 0641 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK FEH +1EEB1 ; mapped ; 0635 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK SAD +1EEB2 ; mapped ; 0642 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK QAF +1EEB3 ; mapped ; 0631 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK REH +1EEB4 ; mapped ; 0634 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK SHEEN +1EEB5 ; mapped ; 062A # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK TEH +1EEB6 ; mapped ; 062B # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK THEH +1EEB7 ; mapped ; 062E # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK KHAH +1EEB8 ; mapped ; 0630 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK THAL +1EEB9 ; mapped ; 0636 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK DAD +1EEBA ; mapped ; 0638 # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK ZAH +1EEBB ; mapped ; 063A # 6.1 ARABIC MATHEMATICAL DOUBLE-STRUCK GHAIN +1EEBC..1EEEF ; disallowed # NA .. +1EEF0..1EEF1 ; valid ; ; NV8 # 6.1 ARABIC MATHEMATICAL OPERATOR MEEM WITH HAH WITH TATWEEL..ARABIC MATHEMATICAL OPERATOR HAH WITH DAL +1EEF2..1EFFF ; disallowed # NA .. +1F000..1F02B ; valid ; ; NV8 # 5.1 MAHJONG TILE EAST WIND..MAHJONG TILE BACK +1F02C..1F02F ; disallowed # NA .. +1F030..1F093 ; valid ; ; NV8 # 5.1 DOMINO TILE HORIZONTAL BACK..DOMINO TILE VERTICAL-06-06 +1F094..1F09F ; disallowed # NA .. +1F0A0..1F0AE ; valid ; ; NV8 # 6.0 PLAYING CARD BACK..PLAYING CARD KING OF SPADES +1F0AF..1F0B0 ; disallowed # NA .. +1F0B1..1F0BE ; valid ; ; NV8 # 6.0 PLAYING CARD ACE OF HEARTS..PLAYING CARD KING OF HEARTS +1F0BF ; valid ; ; NV8 # 7.0 PLAYING CARD RED JOKER +1F0C0 ; disallowed # NA +1F0C1..1F0CF ; valid ; ; NV8 # 6.0 PLAYING CARD ACE OF DIAMONDS..PLAYING CARD BLACK JOKER +1F0D0 ; disallowed # NA +1F0D1..1F0DF ; valid ; ; NV8 # 6.0 PLAYING CARD ACE OF CLUBS..PLAYING CARD WHITE JOKER +1F0E0..1F0F5 ; valid ; ; NV8 # 7.0 PLAYING CARD FOOL..PLAYING CARD TRUMP-21 +1F0F6..1F0FF ; disallowed # NA .. +1F100 ; disallowed # 5.2 DIGIT ZERO FULL STOP +1F101 ; disallowed_STD3_mapped ; 0030 002C # 5.2 DIGIT ZERO COMMA +1F102 ; disallowed_STD3_mapped ; 0031 002C # 5.2 DIGIT ONE COMMA +1F103 ; disallowed_STD3_mapped ; 0032 002C # 5.2 DIGIT TWO COMMA +1F104 ; disallowed_STD3_mapped ; 0033 002C # 5.2 DIGIT THREE COMMA +1F105 ; disallowed_STD3_mapped ; 0034 002C # 5.2 DIGIT FOUR COMMA +1F106 ; disallowed_STD3_mapped ; 0035 002C # 5.2 DIGIT FIVE COMMA +1F107 ; disallowed_STD3_mapped ; 0036 002C # 5.2 DIGIT SIX COMMA +1F108 ; disallowed_STD3_mapped ; 0037 002C # 5.2 DIGIT SEVEN COMMA +1F109 ; disallowed_STD3_mapped ; 0038 002C # 5.2 DIGIT EIGHT COMMA +1F10A ; disallowed_STD3_mapped ; 0039 002C # 5.2 DIGIT NINE COMMA +1F10B..1F10C ; valid ; ; NV8 # 7.0 DINGBAT CIRCLED SANS-SERIF DIGIT ZERO..DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ZERO +1F10D..1F10F ; valid ; ; NV8 # 13.0 CIRCLED ZERO WITH SLASH..CIRCLED DOLLAR SIGN WITH OVERLAID BACKSLASH +1F110 ; disallowed_STD3_mapped ; 0028 0061 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER A +1F111 ; disallowed_STD3_mapped ; 0028 0062 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER B +1F112 ; disallowed_STD3_mapped ; 0028 0063 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER C +1F113 ; disallowed_STD3_mapped ; 0028 0064 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER D +1F114 ; disallowed_STD3_mapped ; 0028 0065 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER E +1F115 ; disallowed_STD3_mapped ; 0028 0066 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER F +1F116 ; disallowed_STD3_mapped ; 0028 0067 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER G +1F117 ; disallowed_STD3_mapped ; 0028 0068 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER H +1F118 ; disallowed_STD3_mapped ; 0028 0069 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER I +1F119 ; disallowed_STD3_mapped ; 0028 006A 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER J +1F11A ; disallowed_STD3_mapped ; 0028 006B 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER K +1F11B ; disallowed_STD3_mapped ; 0028 006C 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER L +1F11C ; disallowed_STD3_mapped ; 0028 006D 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER M +1F11D ; disallowed_STD3_mapped ; 0028 006E 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER N +1F11E ; disallowed_STD3_mapped ; 0028 006F 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER O +1F11F ; disallowed_STD3_mapped ; 0028 0070 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER P +1F120 ; disallowed_STD3_mapped ; 0028 0071 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER Q +1F121 ; disallowed_STD3_mapped ; 0028 0072 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER R +1F122 ; disallowed_STD3_mapped ; 0028 0073 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER S +1F123 ; disallowed_STD3_mapped ; 0028 0074 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER T +1F124 ; disallowed_STD3_mapped ; 0028 0075 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER U +1F125 ; disallowed_STD3_mapped ; 0028 0076 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER V +1F126 ; disallowed_STD3_mapped ; 0028 0077 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER W +1F127 ; disallowed_STD3_mapped ; 0028 0078 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER X +1F128 ; disallowed_STD3_mapped ; 0028 0079 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER Y +1F129 ; disallowed_STD3_mapped ; 0028 007A 0029 #5.2 PARENTHESIZED LATIN CAPITAL LETTER Z +1F12A ; mapped ; 3014 0073 3015 #5.2 TORTOISE SHELL BRACKETED LATIN CAPITAL LETTER S +1F12B ; mapped ; 0063 # 5.2 CIRCLED ITALIC LATIN CAPITAL LETTER C +1F12C ; mapped ; 0072 # 5.2 CIRCLED ITALIC LATIN CAPITAL LETTER R +1F12D ; mapped ; 0063 0064 # 5.2 CIRCLED CD +1F12E ; mapped ; 0077 007A # 5.2 CIRCLED WZ +1F12F ; valid ; ; NV8 # 11.0 COPYLEFT SYMBOL +1F130 ; mapped ; 0061 # 6.0 SQUARED LATIN CAPITAL LETTER A +1F131 ; mapped ; 0062 # 5.2 SQUARED LATIN CAPITAL LETTER B +1F132 ; mapped ; 0063 # 6.0 SQUARED LATIN CAPITAL LETTER C +1F133 ; mapped ; 0064 # 6.0 SQUARED LATIN CAPITAL LETTER D +1F134 ; mapped ; 0065 # 6.0 SQUARED LATIN CAPITAL LETTER E +1F135 ; mapped ; 0066 # 6.0 SQUARED LATIN CAPITAL LETTER F +1F136 ; mapped ; 0067 # 6.0 SQUARED LATIN CAPITAL LETTER G +1F137 ; mapped ; 0068 # 6.0 SQUARED LATIN CAPITAL LETTER H +1F138 ; mapped ; 0069 # 6.0 SQUARED LATIN CAPITAL LETTER I +1F139 ; mapped ; 006A # 6.0 SQUARED LATIN CAPITAL LETTER J +1F13A ; mapped ; 006B # 6.0 SQUARED LATIN CAPITAL LETTER K +1F13B ; mapped ; 006C # 6.0 SQUARED LATIN CAPITAL LETTER L +1F13C ; mapped ; 006D # 6.0 SQUARED LATIN CAPITAL LETTER M +1F13D ; mapped ; 006E # 5.2 SQUARED LATIN CAPITAL LETTER N +1F13E ; mapped ; 006F # 6.0 SQUARED LATIN CAPITAL LETTER O +1F13F ; mapped ; 0070 # 5.2 SQUARED LATIN CAPITAL LETTER P +1F140 ; mapped ; 0071 # 6.0 SQUARED LATIN CAPITAL LETTER Q +1F141 ; mapped ; 0072 # 6.0 SQUARED LATIN CAPITAL LETTER R +1F142 ; mapped ; 0073 # 5.2 SQUARED LATIN CAPITAL LETTER S +1F143 ; mapped ; 0074 # 6.0 SQUARED LATIN CAPITAL LETTER T +1F144 ; mapped ; 0075 # 6.0 SQUARED LATIN CAPITAL LETTER U +1F145 ; mapped ; 0076 # 6.0 SQUARED LATIN CAPITAL LETTER V +1F146 ; mapped ; 0077 # 5.2 SQUARED LATIN CAPITAL LETTER W +1F147 ; mapped ; 0078 # 6.0 SQUARED LATIN CAPITAL LETTER X +1F148 ; mapped ; 0079 # 6.0 SQUARED LATIN CAPITAL LETTER Y +1F149 ; mapped ; 007A # 6.0 SQUARED LATIN CAPITAL LETTER Z +1F14A ; mapped ; 0068 0076 # 5.2 SQUARED HV +1F14B ; mapped ; 006D 0076 # 5.2 SQUARED MV +1F14C ; mapped ; 0073 0064 # 5.2 SQUARED SD +1F14D ; mapped ; 0073 0073 # 5.2 SQUARED SS +1F14E ; mapped ; 0070 0070 0076 #5.2 SQUARED PPV +1F14F ; mapped ; 0077 0063 # 6.0 SQUARED WC +1F150..1F156 ; valid ; ; NV8 # 6.0 NEGATIVE CIRCLED LATIN CAPITAL LETTER A..NEGATIVE CIRCLED LATIN CAPITAL LETTER G +1F157 ; valid ; ; NV8 # 5.2 NEGATIVE CIRCLED LATIN CAPITAL LETTER H +1F158..1F15E ; valid ; ; NV8 # 6.0 NEGATIVE CIRCLED LATIN CAPITAL LETTER I..NEGATIVE CIRCLED LATIN CAPITAL LETTER O +1F15F ; valid ; ; NV8 # 5.2 NEGATIVE CIRCLED LATIN CAPITAL LETTER P +1F160..1F169 ; valid ; ; NV8 # 6.0 NEGATIVE CIRCLED LATIN CAPITAL LETTER Q..NEGATIVE CIRCLED LATIN CAPITAL LETTER Z +1F16A ; mapped ; 006D 0063 # 6.1 RAISED MC SIGN +1F16B ; mapped ; 006D 0064 # 6.1 RAISED MD SIGN +1F16C ; mapped ; 006D 0072 # 12.0 RAISED MR SIGN +1F16D..1F16F ; valid ; ; NV8 # 13.0 CIRCLED CC..CIRCLED HUMAN FIGURE +1F170..1F178 ; valid ; ; NV8 # 6.0 NEGATIVE SQUARED LATIN CAPITAL LETTER A..NEGATIVE SQUARED LATIN CAPITAL LETTER I +1F179 ; valid ; ; NV8 # 5.2 NEGATIVE SQUARED LATIN CAPITAL LETTER J +1F17A ; valid ; ; NV8 # 6.0 NEGATIVE SQUARED LATIN CAPITAL LETTER K +1F17B..1F17C ; valid ; ; NV8 # 5.2 NEGATIVE SQUARED LATIN CAPITAL LETTER L..NEGATIVE SQUARED LATIN CAPITAL LETTER M +1F17D..1F17E ; valid ; ; NV8 # 6.0 NEGATIVE SQUARED LATIN CAPITAL LETTER N..NEGATIVE SQUARED LATIN CAPITAL LETTER O +1F17F ; valid ; ; NV8 # 5.2 NEGATIVE SQUARED LATIN CAPITAL LETTER P +1F180..1F189 ; valid ; ; NV8 # 6.0 NEGATIVE SQUARED LATIN CAPITAL LETTER Q..NEGATIVE SQUARED LATIN CAPITAL LETTER Z +1F18A..1F18D ; valid ; ; NV8 # 5.2 CROSSED NEGATIVE SQUARED LATIN CAPITAL LETTER P..NEGATIVE SQUARED SA +1F18E..1F18F ; valid ; ; NV8 # 6.0 NEGATIVE SQUARED AB..NEGATIVE SQUARED WC +1F190 ; mapped ; 0064 006A # 5.2 SQUARE DJ +1F191..1F19A ; valid ; ; NV8 # 6.0 SQUARED CL..SQUARED VS +1F19B..1F1AC ; valid ; ; NV8 # 9.0 SQUARED THREE D..SQUARED VOD +1F1AD ; valid ; ; NV8 # 13.0 MASK WORK SYMBOL +1F1AE..1F1E5 ; disallowed # NA .. +1F1E6..1F1FF ; valid ; ; NV8 # 6.0 REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z +1F200 ; mapped ; 307B 304B # 5.2 SQUARE HIRAGANA HOKA +1F201 ; mapped ; 30B3 30B3 # 6.0 SQUARED KATAKANA KOKO +1F202 ; mapped ; 30B5 # 6.0 SQUARED KATAKANA SA +1F203..1F20F ; disallowed # NA .. +1F210 ; mapped ; 624B # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-624B +1F211 ; mapped ; 5B57 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-5B57 +1F212 ; mapped ; 53CC # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-53CC +1F213 ; mapped ; 30C7 # 5.2 SQUARED KATAKANA DE +1F214 ; mapped ; 4E8C # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-4E8C +1F215 ; mapped ; 591A # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-591A +1F216 ; mapped ; 89E3 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-89E3 +1F217 ; mapped ; 5929 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-5929 +1F218 ; mapped ; 4EA4 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-4EA4 +1F219 ; mapped ; 6620 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-6620 +1F21A ; mapped ; 7121 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-7121 +1F21B ; mapped ; 6599 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-6599 +1F21C ; mapped ; 524D # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-524D +1F21D ; mapped ; 5F8C # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-5F8C +1F21E ; mapped ; 518D # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-518D +1F21F ; mapped ; 65B0 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-65B0 +1F220 ; mapped ; 521D # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-521D +1F221 ; mapped ; 7D42 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-7D42 +1F222 ; mapped ; 751F # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-751F +1F223 ; mapped ; 8CA9 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-8CA9 +1F224 ; mapped ; 58F0 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-58F0 +1F225 ; mapped ; 5439 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-5439 +1F226 ; mapped ; 6F14 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-6F14 +1F227 ; mapped ; 6295 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-6295 +1F228 ; mapped ; 6355 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-6355 +1F229 ; mapped ; 4E00 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-4E00 +1F22A ; mapped ; 4E09 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-4E09 +1F22B ; mapped ; 904A # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-904A +1F22C ; mapped ; 5DE6 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-5DE6 +1F22D ; mapped ; 4E2D # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-4E2D +1F22E ; mapped ; 53F3 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-53F3 +1F22F ; mapped ; 6307 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-6307 +1F230 ; mapped ; 8D70 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-8D70 +1F231 ; mapped ; 6253 # 5.2 SQUARED CJK UNIFIED IDEOGRAPH-6253 +1F232 ; mapped ; 7981 # 6.0 SQUARED CJK UNIFIED IDEOGRAPH-7981 +1F233 ; mapped ; 7A7A # 6.0 SQUARED CJK UNIFIED IDEOGRAPH-7A7A +1F234 ; mapped ; 5408 # 6.0 SQUARED CJK UNIFIED IDEOGRAPH-5408 +1F235 ; mapped ; 6E80 # 6.0 SQUARED CJK UNIFIED IDEOGRAPH-6E80 +1F236 ; mapped ; 6709 # 6.0 SQUARED CJK UNIFIED IDEOGRAPH-6709 +1F237 ; mapped ; 6708 # 6.0 SQUARED CJK UNIFIED IDEOGRAPH-6708 +1F238 ; mapped ; 7533 # 6.0 SQUARED CJK UNIFIED IDEOGRAPH-7533 +1F239 ; mapped ; 5272 # 6.0 SQUARED CJK UNIFIED IDEOGRAPH-5272 +1F23A ; mapped ; 55B6 # 6.0 SQUARED CJK UNIFIED IDEOGRAPH-55B6 +1F23B ; mapped ; 914D # 9.0 SQUARED CJK UNIFIED IDEOGRAPH-914D +1F23C..1F23F ; disallowed # NA .. +1F240 ; mapped ; 3014 672C 3015 #5.2 TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-672C +1F241 ; mapped ; 3014 4E09 3015 #5.2 TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-4E09 +1F242 ; mapped ; 3014 4E8C 3015 #5.2 TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-4E8C +1F243 ; mapped ; 3014 5B89 3015 #5.2 TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-5B89 +1F244 ; mapped ; 3014 70B9 3015 #5.2 TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-70B9 +1F245 ; mapped ; 3014 6253 3015 #5.2 TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-6253 +1F246 ; mapped ; 3014 76D7 3015 #5.2 TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-76D7 +1F247 ; mapped ; 3014 52DD 3015 #5.2 TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-52DD +1F248 ; mapped ; 3014 6557 3015 #5.2 TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-6557 +1F249..1F24F ; disallowed # NA .. +1F250 ; mapped ; 5F97 # 6.0 CIRCLED IDEOGRAPH ADVANTAGE +1F251 ; mapped ; 53EF # 6.0 CIRCLED IDEOGRAPH ACCEPT +1F252..1F25F ; disallowed # NA .. +1F260..1F265 ; valid ; ; NV8 # 10.0 ROUNDED SYMBOL FOR FU..ROUNDED SYMBOL FOR CAI +1F266..1F2FF ; disallowed # NA .. +1F300..1F320 ; valid ; ; NV8 # 6.0 CYCLONE..SHOOTING STAR +1F321..1F32C ; valid ; ; NV8 # 7.0 THERMOMETER..WIND BLOWING FACE +1F32D..1F32F ; valid ; ; NV8 # 8.0 HOT DOG..BURRITO +1F330..1F335 ; valid ; ; NV8 # 6.0 CHESTNUT..CACTUS +1F336 ; valid ; ; NV8 # 7.0 HOT PEPPER +1F337..1F37C ; valid ; ; NV8 # 6.0 TULIP..BABY BOTTLE +1F37D ; valid ; ; NV8 # 7.0 FORK AND KNIFE WITH PLATE +1F37E..1F37F ; valid ; ; NV8 # 8.0 BOTTLE WITH POPPING CORK..POPCORN +1F380..1F393 ; valid ; ; NV8 # 6.0 RIBBON..GRADUATION CAP +1F394..1F39F ; valid ; ; NV8 # 7.0 HEART WITH TIP ON THE LEFT..ADMISSION TICKETS +1F3A0..1F3C4 ; valid ; ; NV8 # 6.0 CAROUSEL HORSE..SURFER +1F3C5 ; valid ; ; NV8 # 7.0 SPORTS MEDAL +1F3C6..1F3CA ; valid ; ; NV8 # 6.0 TROPHY..SWIMMER +1F3CB..1F3CE ; valid ; ; NV8 # 7.0 WEIGHT LIFTER..RACING CAR +1F3CF..1F3D3 ; valid ; ; NV8 # 8.0 CRICKET BAT AND BALL..TABLE TENNIS PADDLE AND BALL +1F3D4..1F3DF ; valid ; ; NV8 # 7.0 SNOW CAPPED MOUNTAIN..STADIUM +1F3E0..1F3F0 ; valid ; ; NV8 # 6.0 HOUSE BUILDING..EUROPEAN CASTLE +1F3F1..1F3F7 ; valid ; ; NV8 # 7.0 WHITE PENNANT..LABEL +1F3F8..1F3FF ; valid ; ; NV8 # 8.0 BADMINTON RACQUET AND SHUTTLECOCK..EMOJI MODIFIER FITZPATRICK TYPE-6 +1F400..1F43E ; valid ; ; NV8 # 6.0 RAT..PAW PRINTS +1F43F ; valid ; ; NV8 # 7.0 CHIPMUNK +1F440 ; valid ; ; NV8 # 6.0 EYES +1F441 ; valid ; ; NV8 # 7.0 EYE +1F442..1F4F7 ; valid ; ; NV8 # 6.0 EAR..CAMERA +1F4F8 ; valid ; ; NV8 # 7.0 CAMERA WITH FLASH +1F4F9..1F4FC ; valid ; ; NV8 # 6.0 VIDEO CAMERA..VIDEOCASSETTE +1F4FD..1F4FE ; valid ; ; NV8 # 7.0 FILM PROJECTOR..PORTABLE STEREO +1F4FF ; valid ; ; NV8 # 8.0 PRAYER BEADS +1F500..1F53D ; valid ; ; NV8 # 6.0 TWISTED RIGHTWARDS ARROWS..DOWN-POINTING SMALL RED TRIANGLE +1F53E..1F53F ; valid ; ; NV8 # 7.0 LOWER RIGHT SHADOWED WHITE CIRCLE..UPPER RIGHT SHADOWED WHITE CIRCLE +1F540..1F543 ; valid ; ; NV8 # 6.1 CIRCLED CROSS POMMEE..NOTCHED LEFT SEMICIRCLE WITH THREE DOTS +1F544..1F54A ; valid ; ; NV8 # 7.0 NOTCHED RIGHT SEMICIRCLE WITH THREE DOTS..DOVE OF PEACE +1F54B..1F54F ; valid ; ; NV8 # 8.0 KAABA..BOWL OF HYGIEIA +1F550..1F567 ; valid ; ; NV8 # 6.0 CLOCK FACE ONE OCLOCK..CLOCK FACE TWELVE-THIRTY +1F568..1F579 ; valid ; ; NV8 # 7.0 RIGHT SPEAKER..JOYSTICK +1F57A ; valid ; ; NV8 # 9.0 MAN DANCING +1F57B..1F5A3 ; valid ; ; NV8 # 7.0 LEFT HAND TELEPHONE RECEIVER..BLACK DOWN POINTING BACKHAND INDEX +1F5A4 ; valid ; ; NV8 # 9.0 BLACK HEART +1F5A5..1F5FA ; valid ; ; NV8 # 7.0 DESKTOP COMPUTER..WORLD MAP +1F5FB..1F5FF ; valid ; ; NV8 # 6.0 MOUNT FUJI..MOYAI +1F600 ; valid ; ; NV8 # 6.1 GRINNING FACE +1F601..1F610 ; valid ; ; NV8 # 6.0 GRINNING FACE WITH SMILING EYES..NEUTRAL FACE +1F611 ; valid ; ; NV8 # 6.1 EXPRESSIONLESS FACE +1F612..1F614 ; valid ; ; NV8 # 6.0 UNAMUSED FACE..PENSIVE FACE +1F615 ; valid ; ; NV8 # 6.1 CONFUSED FACE +1F616 ; valid ; ; NV8 # 6.0 CONFOUNDED FACE +1F617 ; valid ; ; NV8 # 6.1 KISSING FACE +1F618 ; valid ; ; NV8 # 6.0 FACE THROWING A KISS +1F619 ; valid ; ; NV8 # 6.1 KISSING FACE WITH SMILING EYES +1F61A ; valid ; ; NV8 # 6.0 KISSING FACE WITH CLOSED EYES +1F61B ; valid ; ; NV8 # 6.1 FACE WITH STUCK-OUT TONGUE +1F61C..1F61E ; valid ; ; NV8 # 6.0 FACE WITH STUCK-OUT TONGUE AND WINKING EYE..DISAPPOINTED FACE +1F61F ; valid ; ; NV8 # 6.1 WORRIED FACE +1F620..1F625 ; valid ; ; NV8 # 6.0 ANGRY FACE..DISAPPOINTED BUT RELIEVED FACE +1F626..1F627 ; valid ; ; NV8 # 6.1 FROWNING FACE WITH OPEN MOUTH..ANGUISHED FACE +1F628..1F62B ; valid ; ; NV8 # 6.0 FEARFUL FACE..TIRED FACE +1F62C ; valid ; ; NV8 # 6.1 GRIMACING FACE +1F62D ; valid ; ; NV8 # 6.0 LOUDLY CRYING FACE +1F62E..1F62F ; valid ; ; NV8 # 6.1 FACE WITH OPEN MOUTH..HUSHED FACE +1F630..1F633 ; valid ; ; NV8 # 6.0 FACE WITH OPEN MOUTH AND COLD SWEAT..FLUSHED FACE +1F634 ; valid ; ; NV8 # 6.1 SLEEPING FACE +1F635..1F640 ; valid ; ; NV8 # 6.0 DIZZY FACE..WEARY CAT FACE +1F641..1F642 ; valid ; ; NV8 # 7.0 SLIGHTLY FROWNING FACE..SLIGHTLY SMILING FACE +1F643..1F644 ; valid ; ; NV8 # 8.0 UPSIDE-DOWN FACE..FACE WITH ROLLING EYES +1F645..1F64F ; valid ; ; NV8 # 6.0 FACE WITH NO GOOD GESTURE..PERSON WITH FOLDED HANDS +1F650..1F67F ; valid ; ; NV8 # 7.0 NORTH WEST POINTING LEAF..REVERSE CHECKER BOARD +1F680..1F6C5 ; valid ; ; NV8 # 6.0 ROCKET..LEFT LUGGAGE +1F6C6..1F6CF ; valid ; ; NV8 # 7.0 TRIANGLE WITH ROUNDED CORNERS..BED +1F6D0 ; valid ; ; NV8 # 8.0 PLACE OF WORSHIP +1F6D1..1F6D2 ; valid ; ; NV8 # 9.0 OCTAGONAL SIGN..SHOPPING TROLLEY +1F6D3..1F6D4 ; valid ; ; NV8 # 10.0 STUPA..PAGODA +1F6D5 ; valid ; ; NV8 # 12.0 HINDU TEMPLE +1F6D6..1F6D7 ; valid ; ; NV8 # 13.0 HUT..ELEVATOR +1F6D8..1F6DB ; disallowed # NA .. +1F6DC ; valid ; ; NV8 # 15.0 WIRELESS +1F6DD..1F6DF ; valid ; ; NV8 # 14.0 PLAYGROUND SLIDE..RING BUOY +1F6E0..1F6EC ; valid ; ; NV8 # 7.0 HAMMER AND WRENCH..AIRPLANE ARRIVING +1F6ED..1F6EF ; disallowed # NA .. +1F6F0..1F6F3 ; valid ; ; NV8 # 7.0 SATELLITE..PASSENGER SHIP +1F6F4..1F6F6 ; valid ; ; NV8 # 9.0 SCOOTER..CANOE +1F6F7..1F6F8 ; valid ; ; NV8 # 10.0 SLED..FLYING SAUCER +1F6F9 ; valid ; ; NV8 # 11.0 SKATEBOARD +1F6FA ; valid ; ; NV8 # 12.0 AUTO RICKSHAW +1F6FB..1F6FC ; valid ; ; NV8 # 13.0 PICKUP TRUCK..ROLLER SKATE +1F6FD..1F6FF ; disallowed # NA .. +1F700..1F773 ; valid ; ; NV8 # 6.0 ALCHEMICAL SYMBOL FOR QUINTESSENCE..ALCHEMICAL SYMBOL FOR HALF OUNCE +1F774..1F776 ; valid ; ; NV8 # 15.0 LOT OF FORTUNE..LUNAR ECLIPSE +1F777..1F77A ; disallowed # NA .. +1F77B..1F77F ; valid ; ; NV8 # 15.0 HAUMEA..ORCUS +1F780..1F7D4 ; valid ; ; NV8 # 7.0 BLACK LEFT-POINTING ISOSCELES RIGHT TRIANGLE..HEAVY TWELVE POINTED PINWHEEL STAR +1F7D5..1F7D8 ; valid ; ; NV8 # 11.0 CIRCLED TRIANGLE..NEGATIVE CIRCLED SQUARE +1F7D9 ; valid ; ; NV8 # 15.0 NINE POINTED WHITE STAR +1F7DA..1F7DF ; disallowed # NA .. +1F7E0..1F7EB ; valid ; ; NV8 # 12.0 LARGE ORANGE CIRCLE..LARGE BROWN SQUARE +1F7EC..1F7EF ; disallowed # NA .. +1F7F0 ; valid ; ; NV8 # 14.0 HEAVY EQUALS SIGN +1F7F1..1F7FF ; disallowed # NA .. +1F800..1F80B ; valid ; ; NV8 # 7.0 LEFTWARDS ARROW WITH SMALL TRIANGLE ARROWHEAD..DOWNWARDS ARROW WITH LARGE TRIANGLE ARROWHEAD +1F80C..1F80F ; disallowed # NA .. +1F810..1F847 ; valid ; ; NV8 # 7.0 LEFTWARDS ARROW WITH SMALL EQUILATERAL ARROWHEAD..DOWNWARDS HEAVY ARROW +1F848..1F84F ; disallowed # NA .. +1F850..1F859 ; valid ; ; NV8 # 7.0 LEFTWARDS SANS-SERIF ARROW..UP DOWN SANS-SERIF ARROW +1F85A..1F85F ; disallowed # NA .. +1F860..1F887 ; valid ; ; NV8 # 7.0 WIDE-HEADED LEFTWARDS LIGHT BARB ARROW..WIDE-HEADED SOUTH WEST VERY HEAVY BARB ARROW +1F888..1F88F ; disallowed # NA .. +1F890..1F8AD ; valid ; ; NV8 # 7.0 LEFTWARDS TRIANGLE ARROWHEAD..WHITE ARROW SHAFT WIDTH TWO THIRDS +1F8AE..1F8AF ; disallowed # NA .. +1F8B0..1F8B1 ; valid ; ; NV8 # 13.0 ARROW POINTING UPWARDS THEN NORTH WEST..ARROW POINTING RIGHTWARDS THEN CURVING SOUTH WEST +1F8B2..1F8FF ; disallowed # NA .. +1F900..1F90B ; valid ; ; NV8 # 10.0 CIRCLED CROSS FORMEE WITH FOUR DOTS..DOWNWARD FACING NOTCHED HOOK WITH DOT +1F90C ; valid ; ; NV8 # 13.0 PINCHED FINGERS +1F90D..1F90F ; valid ; ; NV8 # 12.0 WHITE HEART..PINCHING HAND +1F910..1F918 ; valid ; ; NV8 # 8.0 ZIPPER-MOUTH FACE..SIGN OF THE HORNS +1F919..1F91E ; valid ; ; NV8 # 9.0 CALL ME HAND..HAND WITH INDEX AND MIDDLE FINGERS CROSSED +1F91F ; valid ; ; NV8 # 10.0 I LOVE YOU HAND SIGN +1F920..1F927 ; valid ; ; NV8 # 9.0 FACE WITH COWBOY HAT..SNEEZING FACE +1F928..1F92F ; valid ; ; NV8 # 10.0 FACE WITH ONE EYEBROW RAISED..SHOCKED FACE WITH EXPLODING HEAD +1F930 ; valid ; ; NV8 # 9.0 PREGNANT WOMAN +1F931..1F932 ; valid ; ; NV8 # 10.0 BREAST-FEEDING..PALMS UP TOGETHER +1F933..1F93E ; valid ; ; NV8 # 9.0 SELFIE..HANDBALL +1F93F ; valid ; ; NV8 # 12.0 DIVING MASK +1F940..1F94B ; valid ; ; NV8 # 9.0 WILTED FLOWER..MARTIAL ARTS UNIFORM +1F94C ; valid ; ; NV8 # 10.0 CURLING STONE +1F94D..1F94F ; valid ; ; NV8 # 11.0 LACROSSE STICK AND BALL..FLYING DISC +1F950..1F95E ; valid ; ; NV8 # 9.0 CROISSANT..PANCAKES +1F95F..1F96B ; valid ; ; NV8 # 10.0 DUMPLING..CANNED FOOD +1F96C..1F970 ; valid ; ; NV8 # 11.0 LEAFY GREEN..SMILING FACE WITH SMILING EYES AND THREE HEARTS +1F971 ; valid ; ; NV8 # 12.0 YAWNING FACE +1F972 ; valid ; ; NV8 # 13.0 SMILING FACE WITH TEAR +1F973..1F976 ; valid ; ; NV8 # 11.0 FACE WITH PARTY HORN AND PARTY HAT..FREEZING FACE +1F977..1F978 ; valid ; ; NV8 # 13.0 NINJA..DISGUISED FACE +1F979 ; valid ; ; NV8 # 14.0 FACE HOLDING BACK TEARS +1F97A ; valid ; ; NV8 # 11.0 FACE WITH PLEADING EYES +1F97B ; valid ; ; NV8 # 12.0 SARI +1F97C..1F97F ; valid ; ; NV8 # 11.0 LAB COAT..FLAT SHOE +1F980..1F984 ; valid ; ; NV8 # 8.0 CRAB..UNICORN FACE +1F985..1F991 ; valid ; ; NV8 # 9.0 EAGLE..SQUID +1F992..1F997 ; valid ; ; NV8 # 10.0 GIRAFFE FACE..CRICKET +1F998..1F9A2 ; valid ; ; NV8 # 11.0 KANGAROO..SWAN +1F9A3..1F9A4 ; valid ; ; NV8 # 13.0 MAMMOTH..DODO +1F9A5..1F9AA ; valid ; ; NV8 # 12.0 SLOTH..OYSTER +1F9AB..1F9AD ; valid ; ; NV8 # 13.0 BEAVER..SEAL +1F9AE..1F9AF ; valid ; ; NV8 # 12.0 GUIDE DOG..PROBING CANE +1F9B0..1F9B9 ; valid ; ; NV8 # 11.0 EMOJI COMPONENT RED HAIR..SUPERVILLAIN +1F9BA..1F9BF ; valid ; ; NV8 # 12.0 SAFETY VEST..MECHANICAL LEG +1F9C0 ; valid ; ; NV8 # 8.0 CHEESE WEDGE +1F9C1..1F9C2 ; valid ; ; NV8 # 11.0 CUPCAKE..SALT SHAKER +1F9C3..1F9CA ; valid ; ; NV8 # 12.0 BEVERAGE BOX..ICE CUBE +1F9CB ; valid ; ; NV8 # 13.0 BUBBLE TEA +1F9CC ; valid ; ; NV8 # 14.0 TROLL +1F9CD..1F9CF ; valid ; ; NV8 # 12.0 STANDING PERSON..DEAF PERSON +1F9D0..1F9E6 ; valid ; ; NV8 # 10.0 FACE WITH MONOCLE..SOCKS +1F9E7..1F9FF ; valid ; ; NV8 # 11.0 RED GIFT ENVELOPE..NAZAR AMULET +1FA00..1FA53 ; valid ; ; NV8 # 12.0 NEUTRAL CHESS KING..BLACK CHESS KNIGHT-BISHOP +1FA54..1FA5F ; disallowed # NA .. +1FA60..1FA6D ; valid ; ; NV8 # 11.0 XIANGQI RED GENERAL..XIANGQI BLACK SOLDIER +1FA6E..1FA6F ; disallowed # NA .. +1FA70..1FA73 ; valid ; ; NV8 # 12.0 BALLET SHOES..SHORTS +1FA74 ; valid ; ; NV8 # 13.0 THONG SANDAL +1FA75..1FA77 ; valid ; ; NV8 # 15.0 LIGHT BLUE HEART..PINK HEART +1FA78..1FA7A ; valid ; ; NV8 # 12.0 DROP OF BLOOD..STETHOSCOPE +1FA7B..1FA7C ; valid ; ; NV8 # 14.0 X-RAY..CRUTCH +1FA7D..1FA7F ; disallowed # NA .. +1FA80..1FA82 ; valid ; ; NV8 # 12.0 YO-YO..PARACHUTE +1FA83..1FA86 ; valid ; ; NV8 # 13.0 BOOMERANG..NESTING DOLLS +1FA87..1FA88 ; valid ; ; NV8 # 15.0 MARACAS..FLUTE +1FA89..1FA8F ; disallowed # NA .. +1FA90..1FA95 ; valid ; ; NV8 # 12.0 RINGED PLANET..BANJO +1FA96..1FAA8 ; valid ; ; NV8 # 13.0 MILITARY HELMET..ROCK +1FAA9..1FAAC ; valid ; ; NV8 # 14.0 MIRROR BALL..HAMSA +1FAAD..1FAAF ; valid ; ; NV8 # 15.0 FOLDING HAND FAN..KHANDA +1FAB0..1FAB6 ; valid ; ; NV8 # 13.0 FLY..FEATHER +1FAB7..1FABA ; valid ; ; NV8 # 14.0 LOTUS..NEST WITH EGGS +1FABB..1FABD ; valid ; ; NV8 # 15.0 HYACINTH..WING +1FABE ; disallowed # NA +1FABF ; valid ; ; NV8 # 15.0 GOOSE +1FAC0..1FAC2 ; valid ; ; NV8 # 13.0 ANATOMICAL HEART..PEOPLE HUGGING +1FAC3..1FAC5 ; valid ; ; NV8 # 14.0 PREGNANT MAN..PERSON WITH CROWN +1FAC6..1FACD ; disallowed # NA .. +1FACE..1FACF ; valid ; ; NV8 # 15.0 MOOSE..DONKEY +1FAD0..1FAD6 ; valid ; ; NV8 # 13.0 BLUEBERRIES..TEAPOT +1FAD7..1FAD9 ; valid ; ; NV8 # 14.0 POURING LIQUID..JAR +1FADA..1FADB ; valid ; ; NV8 # 15.0 GINGER ROOT..PEA POD +1FADC..1FADF ; disallowed # NA .. +1FAE0..1FAE7 ; valid ; ; NV8 # 14.0 MELTING FACE..BUBBLES +1FAE8 ; valid ; ; NV8 # 15.0 SHAKING FACE +1FAE9..1FAEF ; disallowed # NA .. +1FAF0..1FAF6 ; valid ; ; NV8 # 14.0 HAND WITH INDEX FINGER AND THUMB CROSSED..HEART HANDS +1FAF7..1FAF8 ; valid ; ; NV8 # 15.0 LEFTWARDS PUSHING HAND..RIGHTWARDS PUSHING HAND +1FAF9..1FAFF ; disallowed # NA .. +1FB00..1FB92 ; valid ; ; NV8 # 13.0 BLOCK SEXTANT-1..UPPER HALF INVERSE MEDIUM SHADE AND LOWER HALF BLOCK +1FB93 ; disallowed # NA +1FB94..1FBCA ; valid ; ; NV8 # 13.0 LEFT HALF INVERSE MEDIUM SHADE AND RIGHT HALF BLOCK..WHITE UP-POINTING CHEVRON +1FBCB..1FBEF ; disallowed # NA .. +1FBF0 ; mapped ; 0030 # 13.0 SEGMENTED DIGIT ZERO +1FBF1 ; mapped ; 0031 # 13.0 SEGMENTED DIGIT ONE +1FBF2 ; mapped ; 0032 # 13.0 SEGMENTED DIGIT TWO +1FBF3 ; mapped ; 0033 # 13.0 SEGMENTED DIGIT THREE +1FBF4 ; mapped ; 0034 # 13.0 SEGMENTED DIGIT FOUR +1FBF5 ; mapped ; 0035 # 13.0 SEGMENTED DIGIT FIVE +1FBF6 ; mapped ; 0036 # 13.0 SEGMENTED DIGIT SIX +1FBF7 ; mapped ; 0037 # 13.0 SEGMENTED DIGIT SEVEN +1FBF8 ; mapped ; 0038 # 13.0 SEGMENTED DIGIT EIGHT +1FBF9 ; mapped ; 0039 # 13.0 SEGMENTED DIGIT NINE +1FBFA..1FFFD ; disallowed # NA .. +1FFFE..1FFFF ; disallowed # 2.0 .. +20000..2A6D6 ; valid # 3.1 CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6D6 +2A6D7..2A6DD ; valid # 13.0 CJK UNIFIED IDEOGRAPH-2A6D7..CJK UNIFIED IDEOGRAPH-2A6DD +2A6DE..2A6DF ; valid # 14.0 CJK UNIFIED IDEOGRAPH-2A6DE..CJK UNIFIED IDEOGRAPH-2A6DF +2A6E0..2A6FF ; disallowed # NA .. +2A700..2B734 ; valid # 5.2 CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B734 +2B735..2B738 ; valid # 14.0 CJK UNIFIED IDEOGRAPH-2B735..CJK UNIFIED IDEOGRAPH-2B738 +2B739 ; valid # 15.0 CJK UNIFIED IDEOGRAPH-2B739 +2B73A..2B73F ; disallowed # NA .. +2B740..2B81D ; valid # 6.0 CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D +2B81E..2B81F ; disallowed # NA .. +2B820..2CEA1 ; valid # 8.0 CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1 +2CEA2..2CEAF ; disallowed # NA .. +2CEB0..2EBE0 ; valid # 10.0 CJK UNIFIED IDEOGRAPH-2CEB0..CJK UNIFIED IDEOGRAPH-2EBE0 +2EBE1..2F7FF ; disallowed # NA .. +2F800 ; mapped ; 4E3D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F800 +2F801 ; mapped ; 4E38 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F801 +2F802 ; mapped ; 4E41 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F802 +2F803 ; mapped ; 20122 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F803 +2F804 ; mapped ; 4F60 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F804 +2F805 ; mapped ; 4FAE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F805 +2F806 ; mapped ; 4FBB # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F806 +2F807 ; mapped ; 5002 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F807 +2F808 ; mapped ; 507A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F808 +2F809 ; mapped ; 5099 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F809 +2F80A ; mapped ; 50E7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F80A +2F80B ; mapped ; 50CF # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F80B +2F80C ; mapped ; 349E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F80C +2F80D ; mapped ; 2063A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F80D +2F80E ; mapped ; 514D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F80E +2F80F ; mapped ; 5154 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F80F +2F810 ; mapped ; 5164 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F810 +2F811 ; mapped ; 5177 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F811 +2F812 ; mapped ; 2051C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F812 +2F813 ; mapped ; 34B9 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F813 +2F814 ; mapped ; 5167 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F814 +2F815 ; mapped ; 518D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F815 +2F816 ; mapped ; 2054B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F816 +2F817 ; mapped ; 5197 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F817 +2F818 ; mapped ; 51A4 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F818 +2F819 ; mapped ; 4ECC # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F819 +2F81A ; mapped ; 51AC # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F81A +2F81B ; mapped ; 51B5 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F81B +2F81C ; mapped ; 291DF # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F81C +2F81D ; mapped ; 51F5 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F81D +2F81E ; mapped ; 5203 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F81E +2F81F ; mapped ; 34DF # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F81F +2F820 ; mapped ; 523B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F820 +2F821 ; mapped ; 5246 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F821 +2F822 ; mapped ; 5272 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F822 +2F823 ; mapped ; 5277 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F823 +2F824 ; mapped ; 3515 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F824 +2F825 ; mapped ; 52C7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F825 +2F826 ; mapped ; 52C9 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F826 +2F827 ; mapped ; 52E4 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F827 +2F828 ; mapped ; 52FA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F828 +2F829 ; mapped ; 5305 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F829 +2F82A ; mapped ; 5306 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F82A +2F82B ; mapped ; 5317 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F82B +2F82C ; mapped ; 5349 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F82C +2F82D ; mapped ; 5351 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F82D +2F82E ; mapped ; 535A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F82E +2F82F ; mapped ; 5373 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F82F +2F830 ; mapped ; 537D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F830 +2F831..2F833 ; mapped ; 537F # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F831..CJK COMPATIBILITY IDEOGRAPH-2F833 +2F834 ; mapped ; 20A2C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F834 +2F835 ; mapped ; 7070 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F835 +2F836 ; mapped ; 53CA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F836 +2F837 ; mapped ; 53DF # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F837 +2F838 ; mapped ; 20B63 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F838 +2F839 ; mapped ; 53EB # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F839 +2F83A ; mapped ; 53F1 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F83A +2F83B ; mapped ; 5406 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F83B +2F83C ; mapped ; 549E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F83C +2F83D ; mapped ; 5438 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F83D +2F83E ; mapped ; 5448 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F83E +2F83F ; mapped ; 5468 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F83F +2F840 ; mapped ; 54A2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F840 +2F841 ; mapped ; 54F6 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F841 +2F842 ; mapped ; 5510 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F842 +2F843 ; mapped ; 5553 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F843 +2F844 ; mapped ; 5563 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F844 +2F845..2F846 ; mapped ; 5584 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F845..CJK COMPATIBILITY IDEOGRAPH-2F846 +2F847 ; mapped ; 5599 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F847 +2F848 ; mapped ; 55AB # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F848 +2F849 ; mapped ; 55B3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F849 +2F84A ; mapped ; 55C2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F84A +2F84B ; mapped ; 5716 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F84B +2F84C ; mapped ; 5606 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F84C +2F84D ; mapped ; 5717 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F84D +2F84E ; mapped ; 5651 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F84E +2F84F ; mapped ; 5674 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F84F +2F850 ; mapped ; 5207 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F850 +2F851 ; mapped ; 58EE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F851 +2F852 ; mapped ; 57CE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F852 +2F853 ; mapped ; 57F4 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F853 +2F854 ; mapped ; 580D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F854 +2F855 ; mapped ; 578B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F855 +2F856 ; mapped ; 5832 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F856 +2F857 ; mapped ; 5831 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F857 +2F858 ; mapped ; 58AC # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F858 +2F859 ; mapped ; 214E4 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F859 +2F85A ; mapped ; 58F2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F85A +2F85B ; mapped ; 58F7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F85B +2F85C ; mapped ; 5906 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F85C +2F85D ; mapped ; 591A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F85D +2F85E ; mapped ; 5922 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F85E +2F85F ; mapped ; 5962 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F85F +2F860 ; mapped ; 216A8 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F860 +2F861 ; mapped ; 216EA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F861 +2F862 ; mapped ; 59EC # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F862 +2F863 ; mapped ; 5A1B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F863 +2F864 ; mapped ; 5A27 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F864 +2F865 ; mapped ; 59D8 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F865 +2F866 ; mapped ; 5A66 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F866 +2F867 ; mapped ; 36EE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F867 +2F868 ; disallowed # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F868 +2F869 ; mapped ; 5B08 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F869 +2F86A..2F86B ; mapped ; 5B3E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F86A..CJK COMPATIBILITY IDEOGRAPH-2F86B +2F86C ; mapped ; 219C8 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F86C +2F86D ; mapped ; 5BC3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F86D +2F86E ; mapped ; 5BD8 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F86E +2F86F ; mapped ; 5BE7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F86F +2F870 ; mapped ; 5BF3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F870 +2F871 ; mapped ; 21B18 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F871 +2F872 ; mapped ; 5BFF # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F872 +2F873 ; mapped ; 5C06 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F873 +2F874 ; disallowed # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F874 +2F875 ; mapped ; 5C22 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F875 +2F876 ; mapped ; 3781 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F876 +2F877 ; mapped ; 5C60 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F877 +2F878 ; mapped ; 5C6E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F878 +2F879 ; mapped ; 5CC0 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F879 +2F87A ; mapped ; 5C8D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F87A +2F87B ; mapped ; 21DE4 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F87B +2F87C ; mapped ; 5D43 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F87C +2F87D ; mapped ; 21DE6 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F87D +2F87E ; mapped ; 5D6E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F87E +2F87F ; mapped ; 5D6B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F87F +2F880 ; mapped ; 5D7C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F880 +2F881 ; mapped ; 5DE1 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F881 +2F882 ; mapped ; 5DE2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F882 +2F883 ; mapped ; 382F # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F883 +2F884 ; mapped ; 5DFD # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F884 +2F885 ; mapped ; 5E28 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F885 +2F886 ; mapped ; 5E3D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F886 +2F887 ; mapped ; 5E69 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F887 +2F888 ; mapped ; 3862 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F888 +2F889 ; mapped ; 22183 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F889 +2F88A ; mapped ; 387C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F88A +2F88B ; mapped ; 5EB0 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F88B +2F88C ; mapped ; 5EB3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F88C +2F88D ; mapped ; 5EB6 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F88D +2F88E ; mapped ; 5ECA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F88E +2F88F ; mapped ; 2A392 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F88F +2F890 ; mapped ; 5EFE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F890 +2F891..2F892 ; mapped ; 22331 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F891..CJK COMPATIBILITY IDEOGRAPH-2F892 +2F893 ; mapped ; 8201 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F893 +2F894..2F895 ; mapped ; 5F22 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F894..CJK COMPATIBILITY IDEOGRAPH-2F895 +2F896 ; mapped ; 38C7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F896 +2F897 ; mapped ; 232B8 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F897 +2F898 ; mapped ; 261DA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F898 +2F899 ; mapped ; 5F62 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F899 +2F89A ; mapped ; 5F6B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F89A +2F89B ; mapped ; 38E3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F89B +2F89C ; mapped ; 5F9A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F89C +2F89D ; mapped ; 5FCD # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F89D +2F89E ; mapped ; 5FD7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F89E +2F89F ; mapped ; 5FF9 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F89F +2F8A0 ; mapped ; 6081 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8A0 +2F8A1 ; mapped ; 393A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8A1 +2F8A2 ; mapped ; 391C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8A2 +2F8A3 ; mapped ; 6094 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8A3 +2F8A4 ; mapped ; 226D4 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8A4 +2F8A5 ; mapped ; 60C7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8A5 +2F8A6 ; mapped ; 6148 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8A6 +2F8A7 ; mapped ; 614C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8A7 +2F8A8 ; mapped ; 614E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8A8 +2F8A9 ; mapped ; 614C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8A9 +2F8AA ; mapped ; 617A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8AA +2F8AB ; mapped ; 618E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8AB +2F8AC ; mapped ; 61B2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8AC +2F8AD ; mapped ; 61A4 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8AD +2F8AE ; mapped ; 61AF # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8AE +2F8AF ; mapped ; 61DE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8AF +2F8B0 ; mapped ; 61F2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8B0 +2F8B1 ; mapped ; 61F6 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8B1 +2F8B2 ; mapped ; 6210 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8B2 +2F8B3 ; mapped ; 621B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8B3 +2F8B4 ; mapped ; 625D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8B4 +2F8B5 ; mapped ; 62B1 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8B5 +2F8B6 ; mapped ; 62D4 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8B6 +2F8B7 ; mapped ; 6350 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8B7 +2F8B8 ; mapped ; 22B0C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8B8 +2F8B9 ; mapped ; 633D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8B9 +2F8BA ; mapped ; 62FC # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8BA +2F8BB ; mapped ; 6368 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8BB +2F8BC ; mapped ; 6383 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8BC +2F8BD ; mapped ; 63E4 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8BD +2F8BE ; mapped ; 22BF1 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8BE +2F8BF ; mapped ; 6422 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8BF +2F8C0 ; mapped ; 63C5 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8C0 +2F8C1 ; mapped ; 63A9 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8C1 +2F8C2 ; mapped ; 3A2E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8C2 +2F8C3 ; mapped ; 6469 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8C3 +2F8C4 ; mapped ; 647E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8C4 +2F8C5 ; mapped ; 649D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8C5 +2F8C6 ; mapped ; 6477 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8C6 +2F8C7 ; mapped ; 3A6C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8C7 +2F8C8 ; mapped ; 654F # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8C8 +2F8C9 ; mapped ; 656C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8C9 +2F8CA ; mapped ; 2300A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8CA +2F8CB ; mapped ; 65E3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8CB +2F8CC ; mapped ; 66F8 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8CC +2F8CD ; mapped ; 6649 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8CD +2F8CE ; mapped ; 3B19 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8CE +2F8CF ; mapped ; 6691 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8CF +2F8D0 ; mapped ; 3B08 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8D0 +2F8D1 ; mapped ; 3AE4 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8D1 +2F8D2 ; mapped ; 5192 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8D2 +2F8D3 ; mapped ; 5195 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8D3 +2F8D4 ; mapped ; 6700 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8D4 +2F8D5 ; mapped ; 669C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8D5 +2F8D6 ; mapped ; 80AD # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8D6 +2F8D7 ; mapped ; 43D9 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8D7 +2F8D8 ; mapped ; 6717 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8D8 +2F8D9 ; mapped ; 671B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8D9 +2F8DA ; mapped ; 6721 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8DA +2F8DB ; mapped ; 675E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8DB +2F8DC ; mapped ; 6753 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8DC +2F8DD ; mapped ; 233C3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8DD +2F8DE ; mapped ; 3B49 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8DE +2F8DF ; mapped ; 67FA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8DF +2F8E0 ; mapped ; 6785 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8E0 +2F8E1 ; mapped ; 6852 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8E1 +2F8E2 ; mapped ; 6885 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8E2 +2F8E3 ; mapped ; 2346D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8E3 +2F8E4 ; mapped ; 688E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8E4 +2F8E5 ; mapped ; 681F # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8E5 +2F8E6 ; mapped ; 6914 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8E6 +2F8E7 ; mapped ; 3B9D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8E7 +2F8E8 ; mapped ; 6942 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8E8 +2F8E9 ; mapped ; 69A3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8E9 +2F8EA ; mapped ; 69EA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8EA +2F8EB ; mapped ; 6AA8 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8EB +2F8EC ; mapped ; 236A3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8EC +2F8ED ; mapped ; 6ADB # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8ED +2F8EE ; mapped ; 3C18 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8EE +2F8EF ; mapped ; 6B21 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8EF +2F8F0 ; mapped ; 238A7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8F0 +2F8F1 ; mapped ; 6B54 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8F1 +2F8F2 ; mapped ; 3C4E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8F2 +2F8F3 ; mapped ; 6B72 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8F3 +2F8F4 ; mapped ; 6B9F # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8F4 +2F8F5 ; mapped ; 6BBA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8F5 +2F8F6 ; mapped ; 6BBB # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8F6 +2F8F7 ; mapped ; 23A8D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8F7 +2F8F8 ; mapped ; 21D0B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8F8 +2F8F9 ; mapped ; 23AFA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8F9 +2F8FA ; mapped ; 6C4E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8FA +2F8FB ; mapped ; 23CBC # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8FB +2F8FC ; mapped ; 6CBF # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8FC +2F8FD ; mapped ; 6CCD # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8FD +2F8FE ; mapped ; 6C67 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8FE +2F8FF ; mapped ; 6D16 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F8FF +2F900 ; mapped ; 6D3E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F900 +2F901 ; mapped ; 6D77 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F901 +2F902 ; mapped ; 6D41 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F902 +2F903 ; mapped ; 6D69 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F903 +2F904 ; mapped ; 6D78 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F904 +2F905 ; mapped ; 6D85 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F905 +2F906 ; mapped ; 23D1E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F906 +2F907 ; mapped ; 6D34 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F907 +2F908 ; mapped ; 6E2F # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F908 +2F909 ; mapped ; 6E6E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F909 +2F90A ; mapped ; 3D33 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F90A +2F90B ; mapped ; 6ECB # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F90B +2F90C ; mapped ; 6EC7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F90C +2F90D ; mapped ; 23ED1 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F90D +2F90E ; mapped ; 6DF9 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F90E +2F90F ; mapped ; 6F6E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F90F +2F910 ; mapped ; 23F5E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F910 +2F911 ; mapped ; 23F8E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F911 +2F912 ; mapped ; 6FC6 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F912 +2F913 ; mapped ; 7039 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F913 +2F914 ; mapped ; 701E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F914 +2F915 ; mapped ; 701B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F915 +2F916 ; mapped ; 3D96 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F916 +2F917 ; mapped ; 704A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F917 +2F918 ; mapped ; 707D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F918 +2F919 ; mapped ; 7077 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F919 +2F91A ; mapped ; 70AD # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F91A +2F91B ; mapped ; 20525 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F91B +2F91C ; mapped ; 7145 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F91C +2F91D ; mapped ; 24263 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F91D +2F91E ; mapped ; 719C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F91E +2F91F ; disallowed # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F91F +2F920 ; mapped ; 7228 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F920 +2F921 ; mapped ; 7235 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F921 +2F922 ; mapped ; 7250 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F922 +2F923 ; mapped ; 24608 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F923 +2F924 ; mapped ; 7280 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F924 +2F925 ; mapped ; 7295 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F925 +2F926 ; mapped ; 24735 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F926 +2F927 ; mapped ; 24814 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F927 +2F928 ; mapped ; 737A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F928 +2F929 ; mapped ; 738B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F929 +2F92A ; mapped ; 3EAC # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F92A +2F92B ; mapped ; 73A5 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F92B +2F92C..2F92D ; mapped ; 3EB8 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F92C..CJK COMPATIBILITY IDEOGRAPH-2F92D +2F92E ; mapped ; 7447 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F92E +2F92F ; mapped ; 745C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F92F +2F930 ; mapped ; 7471 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F930 +2F931 ; mapped ; 7485 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F931 +2F932 ; mapped ; 74CA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F932 +2F933 ; mapped ; 3F1B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F933 +2F934 ; mapped ; 7524 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F934 +2F935 ; mapped ; 24C36 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F935 +2F936 ; mapped ; 753E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F936 +2F937 ; mapped ; 24C92 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F937 +2F938 ; mapped ; 7570 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F938 +2F939 ; mapped ; 2219F # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F939 +2F93A ; mapped ; 7610 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F93A +2F93B ; mapped ; 24FA1 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F93B +2F93C ; mapped ; 24FB8 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F93C +2F93D ; mapped ; 25044 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F93D +2F93E ; mapped ; 3FFC # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F93E +2F93F ; mapped ; 4008 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F93F +2F940 ; mapped ; 76F4 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F940 +2F941 ; mapped ; 250F3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F941 +2F942 ; mapped ; 250F2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F942 +2F943 ; mapped ; 25119 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F943 +2F944 ; mapped ; 25133 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F944 +2F945 ; mapped ; 771E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F945 +2F946..2F947 ; mapped ; 771F # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F946..CJK COMPATIBILITY IDEOGRAPH-2F947 +2F948 ; mapped ; 774A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F948 +2F949 ; mapped ; 4039 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F949 +2F94A ; mapped ; 778B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F94A +2F94B ; mapped ; 4046 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F94B +2F94C ; mapped ; 4096 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F94C +2F94D ; mapped ; 2541D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F94D +2F94E ; mapped ; 784E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F94E +2F94F ; mapped ; 788C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F94F +2F950 ; mapped ; 78CC # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F950 +2F951 ; mapped ; 40E3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F951 +2F952 ; mapped ; 25626 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F952 +2F953 ; mapped ; 7956 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F953 +2F954 ; mapped ; 2569A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F954 +2F955 ; mapped ; 256C5 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F955 +2F956 ; mapped ; 798F # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F956 +2F957 ; mapped ; 79EB # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F957 +2F958 ; mapped ; 412F # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F958 +2F959 ; mapped ; 7A40 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F959 +2F95A ; mapped ; 7A4A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F95A +2F95B ; mapped ; 7A4F # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F95B +2F95C ; mapped ; 2597C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F95C +2F95D..2F95E ; mapped ; 25AA7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F95D..CJK COMPATIBILITY IDEOGRAPH-2F95E +2F95F ; disallowed # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F95F +2F960 ; mapped ; 4202 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F960 +2F961 ; mapped ; 25BAB # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F961 +2F962 ; mapped ; 7BC6 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F962 +2F963 ; mapped ; 7BC9 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F963 +2F964 ; mapped ; 4227 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F964 +2F965 ; mapped ; 25C80 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F965 +2F966 ; mapped ; 7CD2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F966 +2F967 ; mapped ; 42A0 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F967 +2F968 ; mapped ; 7CE8 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F968 +2F969 ; mapped ; 7CE3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F969 +2F96A ; mapped ; 7D00 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F96A +2F96B ; mapped ; 25F86 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F96B +2F96C ; mapped ; 7D63 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F96C +2F96D ; mapped ; 4301 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F96D +2F96E ; mapped ; 7DC7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F96E +2F96F ; mapped ; 7E02 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F96F +2F970 ; mapped ; 7E45 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F970 +2F971 ; mapped ; 4334 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F971 +2F972 ; mapped ; 26228 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F972 +2F973 ; mapped ; 26247 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F973 +2F974 ; mapped ; 4359 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F974 +2F975 ; mapped ; 262D9 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F975 +2F976 ; mapped ; 7F7A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F976 +2F977 ; mapped ; 2633E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F977 +2F978 ; mapped ; 7F95 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F978 +2F979 ; mapped ; 7FFA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F979 +2F97A ; mapped ; 8005 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F97A +2F97B ; mapped ; 264DA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F97B +2F97C ; mapped ; 26523 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F97C +2F97D ; mapped ; 8060 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F97D +2F97E ; mapped ; 265A8 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F97E +2F97F ; mapped ; 8070 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F97F +2F980 ; mapped ; 2335F # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F980 +2F981 ; mapped ; 43D5 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F981 +2F982 ; mapped ; 80B2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F982 +2F983 ; mapped ; 8103 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F983 +2F984 ; mapped ; 440B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F984 +2F985 ; mapped ; 813E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F985 +2F986 ; mapped ; 5AB5 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F986 +2F987 ; mapped ; 267A7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F987 +2F988 ; mapped ; 267B5 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F988 +2F989 ; mapped ; 23393 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F989 +2F98A ; mapped ; 2339C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F98A +2F98B ; mapped ; 8201 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F98B +2F98C ; mapped ; 8204 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F98C +2F98D ; mapped ; 8F9E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F98D +2F98E ; mapped ; 446B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F98E +2F98F ; mapped ; 8291 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F98F +2F990 ; mapped ; 828B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F990 +2F991 ; mapped ; 829D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F991 +2F992 ; mapped ; 52B3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F992 +2F993 ; mapped ; 82B1 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F993 +2F994 ; mapped ; 82B3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F994 +2F995 ; mapped ; 82BD # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F995 +2F996 ; mapped ; 82E6 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F996 +2F997 ; mapped ; 26B3C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F997 +2F998 ; mapped ; 82E5 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F998 +2F999 ; mapped ; 831D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F999 +2F99A ; mapped ; 8363 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F99A +2F99B ; mapped ; 83AD # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F99B +2F99C ; mapped ; 8323 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F99C +2F99D ; mapped ; 83BD # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F99D +2F99E ; mapped ; 83E7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F99E +2F99F ; mapped ; 8457 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F99F +2F9A0 ; mapped ; 8353 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9A0 +2F9A1 ; mapped ; 83CA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9A1 +2F9A2 ; mapped ; 83CC # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9A2 +2F9A3 ; mapped ; 83DC # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9A3 +2F9A4 ; mapped ; 26C36 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9A4 +2F9A5 ; mapped ; 26D6B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9A5 +2F9A6 ; mapped ; 26CD5 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9A6 +2F9A7 ; mapped ; 452B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9A7 +2F9A8 ; mapped ; 84F1 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9A8 +2F9A9 ; mapped ; 84F3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9A9 +2F9AA ; mapped ; 8516 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9AA +2F9AB ; mapped ; 273CA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9AB +2F9AC ; mapped ; 8564 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9AC +2F9AD ; mapped ; 26F2C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9AD +2F9AE ; mapped ; 455D # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9AE +2F9AF ; mapped ; 4561 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9AF +2F9B0 ; mapped ; 26FB1 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9B0 +2F9B1 ; mapped ; 270D2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9B1 +2F9B2 ; mapped ; 456B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9B2 +2F9B3 ; mapped ; 8650 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9B3 +2F9B4 ; mapped ; 865C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9B4 +2F9B5 ; mapped ; 8667 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9B5 +2F9B6 ; mapped ; 8669 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9B6 +2F9B7 ; mapped ; 86A9 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9B7 +2F9B8 ; mapped ; 8688 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9B8 +2F9B9 ; mapped ; 870E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9B9 +2F9BA ; mapped ; 86E2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9BA +2F9BB ; mapped ; 8779 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9BB +2F9BC ; mapped ; 8728 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9BC +2F9BD ; mapped ; 876B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9BD +2F9BE ; mapped ; 8786 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9BE +2F9BF ; disallowed # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9BF +2F9C0 ; mapped ; 87E1 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9C0 +2F9C1 ; mapped ; 8801 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9C1 +2F9C2 ; mapped ; 45F9 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9C2 +2F9C3 ; mapped ; 8860 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9C3 +2F9C4 ; mapped ; 8863 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9C4 +2F9C5 ; mapped ; 27667 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9C5 +2F9C6 ; mapped ; 88D7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9C6 +2F9C7 ; mapped ; 88DE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9C7 +2F9C8 ; mapped ; 4635 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9C8 +2F9C9 ; mapped ; 88FA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9C9 +2F9CA ; mapped ; 34BB # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9CA +2F9CB ; mapped ; 278AE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9CB +2F9CC ; mapped ; 27966 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9CC +2F9CD ; mapped ; 46BE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9CD +2F9CE ; mapped ; 46C7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9CE +2F9CF ; mapped ; 8AA0 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9CF +2F9D0 ; mapped ; 8AED # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9D0 +2F9D1 ; mapped ; 8B8A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9D1 +2F9D2 ; mapped ; 8C55 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9D2 +2F9D3 ; mapped ; 27CA8 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9D3 +2F9D4 ; mapped ; 8CAB # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9D4 +2F9D5 ; mapped ; 8CC1 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9D5 +2F9D6 ; mapped ; 8D1B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9D6 +2F9D7 ; mapped ; 8D77 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9D7 +2F9D8 ; mapped ; 27F2F # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9D8 +2F9D9 ; mapped ; 20804 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9D9 +2F9DA ; mapped ; 8DCB # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9DA +2F9DB ; mapped ; 8DBC # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9DB +2F9DC ; mapped ; 8DF0 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9DC +2F9DD ; mapped ; 208DE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9DD +2F9DE ; mapped ; 8ED4 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9DE +2F9DF ; mapped ; 8F38 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9DF +2F9E0 ; mapped ; 285D2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9E0 +2F9E1 ; mapped ; 285ED # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9E1 +2F9E2 ; mapped ; 9094 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9E2 +2F9E3 ; mapped ; 90F1 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9E3 +2F9E4 ; mapped ; 9111 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9E4 +2F9E5 ; mapped ; 2872E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9E5 +2F9E6 ; mapped ; 911B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9E6 +2F9E7 ; mapped ; 9238 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9E7 +2F9E8 ; mapped ; 92D7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9E8 +2F9E9 ; mapped ; 92D8 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9E9 +2F9EA ; mapped ; 927C # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9EA +2F9EB ; mapped ; 93F9 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9EB +2F9EC ; mapped ; 9415 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9EC +2F9ED ; mapped ; 28BFA # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9ED +2F9EE ; mapped ; 958B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9EE +2F9EF ; mapped ; 4995 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9EF +2F9F0 ; mapped ; 95B7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9F0 +2F9F1 ; mapped ; 28D77 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9F1 +2F9F2 ; mapped ; 49E6 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9F2 +2F9F3 ; mapped ; 96C3 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9F3 +2F9F4 ; mapped ; 5DB2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9F4 +2F9F5 ; mapped ; 9723 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9F5 +2F9F6 ; mapped ; 29145 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9F6 +2F9F7 ; mapped ; 2921A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9F7 +2F9F8 ; mapped ; 4A6E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9F8 +2F9F9 ; mapped ; 4A76 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9F9 +2F9FA ; mapped ; 97E0 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9FA +2F9FB ; mapped ; 2940A # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9FB +2F9FC ; mapped ; 4AB2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9FC +2F9FD ; mapped ; 29496 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9FD +2F9FE..2F9FF ; mapped ; 980B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2F9FE..CJK COMPATIBILITY IDEOGRAPH-2F9FF +2FA00 ; mapped ; 9829 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA00 +2FA01 ; mapped ; 295B6 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA01 +2FA02 ; mapped ; 98E2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA02 +2FA03 ; mapped ; 4B33 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA03 +2FA04 ; mapped ; 9929 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA04 +2FA05 ; mapped ; 99A7 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA05 +2FA06 ; mapped ; 99C2 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA06 +2FA07 ; mapped ; 99FE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA07 +2FA08 ; mapped ; 4BCE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA08 +2FA09 ; mapped ; 29B30 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA09 +2FA0A ; mapped ; 9B12 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA0A +2FA0B ; mapped ; 9C40 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA0B +2FA0C ; mapped ; 9CFD # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA0C +2FA0D ; mapped ; 4CCE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA0D +2FA0E ; mapped ; 4CED # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA0E +2FA0F ; mapped ; 9D67 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA0F +2FA10 ; mapped ; 2A0CE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA10 +2FA11 ; mapped ; 4CF8 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA11 +2FA12 ; mapped ; 2A105 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA12 +2FA13 ; mapped ; 2A20E # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA13 +2FA14 ; mapped ; 2A291 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA14 +2FA15 ; mapped ; 9EBB # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA15 +2FA16 ; mapped ; 4D56 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA16 +2FA17 ; mapped ; 9EF9 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA17 +2FA18 ; mapped ; 9EFE # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA18 +2FA19 ; mapped ; 9F05 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA19 +2FA1A ; mapped ; 9F0F # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA1A +2FA1B ; mapped ; 9F16 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA1B +2FA1C ; mapped ; 9F3B # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA1C +2FA1D ; mapped ; 2A600 # 3.1 CJK COMPATIBILITY IDEOGRAPH-2FA1D +2FA1E..2FFFD ; disallowed # NA .. +2FFFE..2FFFF ; disallowed # 2.0 .. +30000..3134A ; valid # 13.0 CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A +3134B..3134F ; disallowed # NA .. +31350..323AF ; valid # 15.0 CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF +323B0..3FFFD ; disallowed # NA .. +3FFFE..3FFFF ; disallowed # 2.0 .. +40000..4FFFD ; disallowed # NA .. +4FFFE..4FFFF ; disallowed # 2.0 .. +50000..5FFFD ; disallowed # NA .. +5FFFE..5FFFF ; disallowed # 2.0 .. +60000..6FFFD ; disallowed # NA .. +6FFFE..6FFFF ; disallowed # 2.0 .. +70000..7FFFD ; disallowed # NA .. +7FFFE..7FFFF ; disallowed # 2.0 .. +80000..8FFFD ; disallowed # NA .. +8FFFE..8FFFF ; disallowed # 2.0 .. +90000..9FFFD ; disallowed # NA .. +9FFFE..9FFFF ; disallowed # 2.0 .. +A0000..AFFFD ; disallowed # NA .. +AFFFE..AFFFF ; disallowed # 2.0 .. +B0000..BFFFD ; disallowed # NA .. +BFFFE..BFFFF ; disallowed # 2.0 .. +C0000..CFFFD ; disallowed # NA .. +CFFFE..CFFFF ; disallowed # 2.0 .. +D0000..DFFFD ; disallowed # NA .. +DFFFE..DFFFF ; disallowed # 2.0 .. +E0000 ; disallowed # NA +E0001 ; disallowed # 3.1 LANGUAGE TAG +E0002..E001F ; disallowed # NA .. +E0020..E007F ; disallowed # 3.1 TAG SPACE..CANCEL TAG +E0080..E00FF ; disallowed # NA .. +E0100..E01EF ; ignored # 4.0 VARIATION SELECTOR-17..VARIATION SELECTOR-256 +E01F0..EFFFD ; disallowed # NA .. +EFFFE..EFFFF ; disallowed # 2.0 .. +F0000..FFFFD ; disallowed # 2.0 .. +FFFFE..FFFFF ; disallowed # 2.0 .. +100000..10FFFD; disallowed # 2.0 .. +10FFFE..10FFFF; disallowed # 2.0 .. + +# Total code points: 1114112 From 2c62859d53052f59299b6fb00dc966a08f455635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Wed, 16 Nov 2022 12:45:51 +0100 Subject: [PATCH 12/34] Validate host parsing according to upstream URL living standard tests --- tests/test_url.py | 15 ++++++++------- w3lib/_url.py | 11 ++++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index 9c5f27c6..d2038848 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -20,6 +20,7 @@ _C0_CONTROL_PERCENT_ENCODE_SET, _parse_url, _percent_encode_after_encoding, + _serialize_host, # _serialize_url, _SPECIAL_SCHEMES, ) @@ -79,7 +80,7 @@ def test_parse_url(input, base, failure, href, protocol, username, password, hos assert url.scheme == (protocol[:-1] if protocol else None) assert url.username == username assert url.password == password - # assert url.hostname == hostname + assert _serialize_host(url.hostname) == hostname # TODO: Cover additional fields # assert _serialize_url(url) == href @@ -182,9 +183,9 @@ def test_percent_encode_after_encoding(input, output): and chr(value) not in ":/?#\\" ) ) -USERNAME_ENCODED = "".join(f"%{ord(char):X}" for char in USERNAME_TO_ENCODE) +USERNAME_ENCODED = "".join(f"%{ord(char):02X}" for char in USERNAME_TO_ENCODE) PASSWORD_TO_ENCODE = USERNAME_TO_ENCODE + ":" -PASSWORD_ENCODED = "".join(f"%{ord(char):X}" for char in PASSWORD_TO_ENCODE) +PASSWORD_ENCODED = "".join(f"%{ord(char):02X}" for char in PASSWORD_TO_ENCODE) # Path characters that do not need escaping. # Removed for RFC 2396 and RFC 3986: %[\]^| @@ -198,7 +199,7 @@ def test_percent_encode_after_encoding(input, output): and chr(value) not in "?#\\" ) ) -PATH_ENCODED = "".join(f"%{ord(char):X}" for char in PATH_TO_ENCODE) +PATH_ENCODED = "".join(f"%{ord(char):02X}" for char in PATH_TO_ENCODE) # Query characters that do not need escaping. # Removed for RFC 2396 and RFC 3986: %[\]^`{|} @@ -213,7 +214,7 @@ def test_percent_encode_after_encoding(input, output): and chr(value) not in "#" ) ) -QUERY_ENCODED = "".join(f"%{ord(char):X}" for char in QUERY_TO_ENCODE) +QUERY_ENCODED = "".join(f"%{ord(char):02X}" for char in QUERY_TO_ENCODE) SPECIAL_QUERY_SAFE = QUERY_SAFE.replace("'", "") SPECIAL_QUERY_TO_ENCODE = "".join( chr(value) @@ -224,7 +225,7 @@ def test_percent_encode_after_encoding(input, output): and chr(value) not in "#" ) ) -SPECIAL_QUERY_ENCODED = "".join(f"%{ord(char):X}" for char in SPECIAL_QUERY_TO_ENCODE) +SPECIAL_QUERY_ENCODED = "".join(f"%{ord(char):02X}" for char in SPECIAL_QUERY_TO_ENCODE) # Fragment characters that do not need escaping. # Removed for RFC 2396 and RFC 3986: #%[\\]^{|} @@ -234,7 +235,7 @@ def test_percent_encode_after_encoding(input, output): for value in range(0x80) if (chr(value) not in _C0_CONTROL_OR_SPACE and chr(value) not in FRAGMENT_SAFE) ) -FRAGMENT_ENCODED = "".join(f"%{ord(char):X}" for char in FRAGMENT_TO_ENCODE) +FRAGMENT_ENCODED = "".join(f"%{ord(char):02X}" for char in FRAGMENT_TO_ENCODE) # Test cases for URL-to-safe-URL conversions with only a URL as input parameter diff --git a/w3lib/_url.py b/w3lib/_url.py index 32e848ee..1f86d506 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -97,7 +97,7 @@ class _URL: scheme: str = "" username: str = "" password: str = "" - hostname: Union[None, int, List[int], str] = None + hostname: Union[int, List[int], str] = "" port: Optional[int] = None path: Union[str, List[str]] query: Optional[str] = None @@ -192,7 +192,7 @@ def _percent_encode_after_encoding( else: output += "%" else: - output += f"%{byte[0]:X}" + output += f"%{byte[0]:02X}" if potential_error is not None: assert isinstance(potential_error, _PotentialError) assert isinstance(potential_error.code_point, (bytes, str)) @@ -665,9 +665,10 @@ def _parse_url( elif state == _State.RELATIVE: assert isinstance(base, _URL) url.scheme = base.scheme - if c == "/": - state = _State.RELATIVE - elif url.is_special() and c == "\\": + if ( + c == "/" + or url.is_special() and c == "\\" + ): state = _State.RELATIVE_SLASH else: url.username = base.username From 3623c3547e32a1a653e27d9617c9ab956122b066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 17 Nov 2022 18:06:20 +0100 Subject: [PATCH 13/34] Cover port and path in upstream tests --- tests/test_url.py | 18 +++++++++++++++--- w3lib/_url.py | 8 +++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index d2038848..bbb5cfb7 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -22,6 +22,7 @@ _percent_encode_after_encoding, _serialize_host, # _serialize_url, + _serialize_url_path, _SPECIAL_SCHEMES, ) from w3lib.url import ( @@ -42,14 +43,17 @@ ) URL_TEST_DATA_FILE_PATH = Path(__file__).parent / "url-test-data.json" -URL_TEST_DATA_KNOWN_ISSUES = () +URL_TEST_DATA_KNOWN_ISSUES = ( + # https://github.com/web-platform-tests/wpt/issues/37010 + "http://example.com/\ud800\U000107fe\udfff\ufdd0\ufdcf\ufdefﷰ\ufffe\uffff?\ud800\U000107fe\udfff\ufdd0\ufdcf\ufdefﷰ\ufffe\uffff", +) with open(URL_TEST_DATA_FILE_PATH, encoding="utf-8") as input: URL_TEST_DATA = json.load(input) @pytest.mark.parametrize( - "input,base,failure,href,protocol,username,password,hostname", + "input,base,failure,href,protocol,username,password,hostname,port,pathname", ( case if case[0] not in URL_TEST_DATA_KNOWN_ISSUES @@ -64,13 +68,17 @@ i.get("username"), i.get("password"), i.get("hostname"), + i.get("port"), + i.get("pathname"), ) for i in URL_TEST_DATA if not isinstance(i, str) ) ), ) -def test_parse_url(input, base, failure, href, protocol, username, password, hostname): +def test_parse_url( + input, base, failure, href, protocol, username, password, hostname, port, pathname +): if failure: with pytest.raises(ValueError): _parse_url(input, base_url=base) @@ -81,6 +89,10 @@ def test_parse_url(input, base, failure, href, protocol, username, password, hos assert url.username == username assert url.password == password assert _serialize_host(url.hostname) == hostname + assert url.port == (None if not port else int(port)) + # TODO: Find out why we do not always get right whether path is supposed to + # be / or an empty string. + assert (_serialize_url_path(url) or "/") == (pathname or "/") # TODO: Cover additional fields # assert _serialize_url(url) == href diff --git a/w3lib/_url.py b/w3lib/_url.py index 1f86d506..697ed94c 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -514,7 +514,8 @@ def _is_double_dot_path_segment(input: str) -> bool: # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment def _is_single_dot_path_segment(input: str) -> bool: return input in ( - "." "%2e", + ".", + "%2e", "%2E", ) @@ -665,10 +666,7 @@ def _parse_url( elif state == _State.RELATIVE: assert isinstance(base, _URL) url.scheme = base.scheme - if ( - c == "/" - or url.is_special() and c == "\\" - ): + if c == "/" or url.is_special() and c == "\\": state = _State.RELATIVE_SLASH else: url.username = base.username From 2513ea1b62c025cfe41d4e896f0547b60b416246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 17 Nov 2022 18:16:00 +0100 Subject: [PATCH 14/34] Cover query and fragment in upstream tests --- tests/test_url.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index bbb5cfb7..6df2eb5e 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -53,7 +53,7 @@ @pytest.mark.parametrize( - "input,base,failure,href,protocol,username,password,hostname,port,pathname", + "input,base,failure,href,protocol,username,password,hostname,port,pathname,search,hash", ( case if case[0] not in URL_TEST_DATA_KNOWN_ISSUES @@ -70,6 +70,8 @@ i.get("hostname"), i.get("port"), i.get("pathname"), + i.get("search"), + i.get("hash"), ) for i in URL_TEST_DATA if not isinstance(i, str) @@ -77,7 +79,18 @@ ), ) def test_parse_url( - input, base, failure, href, protocol, username, password, hostname, port, pathname + input, + base, + failure, + href, + protocol, + username, + password, + hostname, + port, + pathname, + search, + hash, ): if failure: with pytest.raises(ValueError): @@ -93,7 +106,13 @@ def test_parse_url( # TODO: Find out why we do not always get right whether path is supposed to # be / or an empty string. assert (_serialize_url_path(url) or "/") == (pathname or "/") - # TODO: Cover additional fields + # TODO: Find out why we do not always get right whether query is supposed + # to be an empty string or None. + assert (url.query or "") == (search[1:] if search else "") + # TODO: Find out why we do not always get right whether fragment is + # supposed to be an empty string or None. + assert (url.fragment or "") == (hash[1:] if hash else "") + # TODO: Address the TODOs above. # assert _serialize_url(url) == href From 7d9274048e453c9b16169aa0ecb0c7aeb73b7268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 17 Nov 2022 18:36:26 +0100 Subject: [PATCH 15/34] Add upstream tests for domain_to_ascii --- tests/test_url.py | 38 ++++++++++++++++++++++++++++++++++++++ tests/url-test-data.json | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/tests/test_url.py b/tests/test_url.py index 6df2eb5e..31284c66 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -18,6 +18,7 @@ ) from w3lib._url import ( _C0_CONTROL_PERCENT_ENCODE_SET, + _domain_to_ascii, _parse_url, _percent_encode_after_encoding, _serialize_host, @@ -42,6 +43,43 @@ url_query_cleaner, ) + +TO_ASCII_TEST_DATA_FILE_PATH = Path(__file__).parent / "to-ascii-test-data.json" +TO_ASCII_TEST_DATA_KNOWN_ISSUES = ( + # TODO: Investigate. + "xn--a-yoc", + "a%C2%ADb", + "%C2%AD", +) + +with open(TO_ASCII_TEST_DATA_FILE_PATH, encoding="utf-8") as input: + TO_ASCII_TEST_DATA = json.load(input) + + +@pytest.mark.parametrize( + "input,output", + ( + case + if case[0] not in TO_ASCII_TEST_DATA_KNOWN_ISSUES + else pytest.param(*case, marks=pytest.mark.xfail(strict=True)) + for case in ( + ( + i["input"], + i["output"], + ) + for i in TO_ASCII_TEST_DATA + if not isinstance(i, str) + ) + ), +) +def test_domain_to_ascii(input, output): + if output is not None: + assert _domain_to_ascii(input) == output + return + with pytest.raises(ValueError): + _domain_to_ascii(input) + + URL_TEST_DATA_FILE_PATH = Path(__file__).parent / "url-test-data.json" URL_TEST_DATA_KNOWN_ISSUES = ( # https://github.com/web-platform-tests/wpt/issues/37010 diff --git a/tests/url-test-data.json b/tests/url-test-data.json index 75e0387f..dd00c245 100644 --- a/tests/url-test-data.json +++ b/tests/url-test-data.json @@ -1,5 +1,5 @@ [ - "# Source: https://github.com/web-platform-tests/wpt/blob/master/url/resources/urltestdata.json", + "# Source: https://github.com/web-platform-tests/wpt/blob/77d95d52351ebf51bc80ee21eea455de31a5e356/url/resources/urltestdata.json", "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js", { From 6a080da0368b075ef4bb6bc0cd9bee1128b7e75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 17 Nov 2022 18:51:16 +0100 Subject: [PATCH 16/34] Add upstream tests for percent encoding --- tests/percent-encoding-test-data.json | 50 ++++++++ tests/test_url.py | 46 ++++++- tests/to-ascii-test-data.json | 178 ++++++++++++++++++++++++++ 3 files changed, 268 insertions(+), 6 deletions(-) create mode 100644 tests/percent-encoding-test-data.json create mode 100644 tests/to-ascii-test-data.json diff --git a/tests/percent-encoding-test-data.json b/tests/percent-encoding-test-data.json new file mode 100644 index 00000000..c0b98ba2 --- /dev/null +++ b/tests/percent-encoding-test-data.json @@ -0,0 +1,50 @@ +[ + "Source: https://github.com/web-platform-tests/wpt/blob/77d95d52351ebf51bc80ee21eea455de31a5e356/url/resources/percent-encoding.json", + + "Tests for percent-encoding.", + { + "input": "\u2020", + "output": { + "big5": "%26%238224%3B", + "euc-kr": "%A2%D3", + "utf-8": "%E2%80%A0", + "windows-1252": "%86" + } + }, + "This uses a trailing A to prevent the URL parser from trimming the C0 control.", + { + "input": "\u000EA", + "output": { + "big5": "%0EA", + "iso-2022-jp": "%26%2365533%3BA", + "utf-8": "%0EA" + } + }, + { + "input": "\u203E\u005C", + "output": { + "iso-2022-jp": "%1B(J~%1B(B\\", + "utf-8": "%E2%80%BE\\" + } + }, + { + "input": "\uE5E5", + "output": { + "gb18030": "%26%2358853%3B", + "utf-8": "%EE%97%A5" + } + }, + { + "input": "\u2212", + "output": { + "shift_jis": "%81|", + "utf-8": "%E2%88%92" + } + }, + { + "input": "á|", + "output": { + "utf-8": "%C3%A1|" + } + } + ] \ No newline at end of file diff --git a/tests/test_url.py b/tests/test_url.py index 31284c66..342669bd 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -24,6 +24,7 @@ _serialize_host, # _serialize_url, _serialize_url_path, + _SPECIAL_QUERY_PERCENT_ENCODE_SET, _SPECIAL_SCHEMES, ) from w3lib.url import ( @@ -154,18 +155,51 @@ def test_parse_url( # assert _serialize_url(url) == href +PERCENT_ENCODE_TEST_DATA_FILE_PATH = ( + Path(__file__).parent / "percent-encoding-test-data.json" +) +PERCENT_ENCODE_TEST_DATA_KNOWN_ISSUES = { + # TODO: Investigate. + ("\x0eA", "iso-2022-jp"), + ("\ue5e5", "gb18030"), +} + +with open(PERCENT_ENCODE_TEST_DATA_FILE_PATH, encoding="utf-8") as input: + PERCENT_ENCODE_TEST_DATA = json.load(input) + + @pytest.mark.parametrize( - "input,output", + "input,output,encoding,percent_encode_set", ( - ("", ""), - ("a", "a"), + ("", "", "utf-8", _C0_CONTROL_PERCENT_ENCODE_SET), + ("a", "a", "utf-8", _C0_CONTROL_PERCENT_ENCODE_SET), + *( + (input, output, encoding, _SPECIAL_QUERY_PERCENT_ENCODE_SET) + if (input, encoding) not in PERCENT_ENCODE_TEST_DATA_KNOWN_ISSUES + else pytest.param( + input, + output, + encoding, + _SPECIAL_QUERY_PERCENT_ENCODE_SET, + marks=pytest.mark.xfail(strict=True), + ) + for input, _output in ( + ( + i["input"], + i["output"], + ) + for i in PERCENT_ENCODE_TEST_DATA + if not isinstance(i, str) + ) + for encoding, output in _output.items() + ), ), ) -def test_percent_encode_after_encoding(input, output): +def test_percent_encode_after_encoding(input, output, encoding, percent_encode_set): actual = _percent_encode_after_encoding( input, - encoding="utf-8", - percent_encode_set=_C0_CONTROL_PERCENT_ENCODE_SET, + encoding=encoding, + percent_encode_set=percent_encode_set, ) assert actual == output diff --git a/tests/to-ascii-test-data.json b/tests/to-ascii-test-data.json new file mode 100644 index 00000000..8a6e176e --- /dev/null +++ b/tests/to-ascii-test-data.json @@ -0,0 +1,178 @@ +[ + "Source: https://github.com/web-platform-tests/wpt/blob/77d95d52351ebf51bc80ee21eea455de31a5e356/url/resources/toascii.json", + + "This resource is focused on highlighting issues with UTS #46 ToASCII", + { + "comment": "Label with hyphens in 3rd and 4th position", + "input": "aa--", + "output": "aa--" + }, + { + "input": "a†--", + "output": "xn--a---kp0a" + }, + { + "input": "ab--c", + "output": "ab--c" + }, + { + "comment": "Label with leading hyphen", + "input": "-x", + "output": "-x" + }, + { + "input": "-†", + "output": "xn----xhn" + }, + { + "input": "-x.xn--zca", + "output": "-x.xn--zca" + }, + { + "input": "-x.ß", + "output": "-x.xn--zca" + }, + { + "comment": "Label with trailing hyphen", + "input": "x-.xn--zca", + "output": "x-.xn--zca" + }, + { + "input": "x-.ß", + "output": "x-.xn--zca" + }, + { + "comment": "Empty labels", + "input": "x..xn--zca", + "output": "x..xn--zca" + }, + { + "input": "x..ß", + "output": "x..xn--zca" + }, + { + "comment": "Invalid Punycode", + "input": "xn--a", + "output": null + }, + { + "input": "xn--a.xn--zca", + "output": null + }, + { + "input": "xn--a.ß", + "output": null + }, + { + "comment": "Invalid Punycode (contains non-ASCII character)", + "input": "xn--tešla", + "output": null + }, + { + "comment": "Valid Punycode", + "input": "xn--zca.xn--zca", + "output": "xn--zca.xn--zca" + }, + { + "comment": "Mixed", + "input": "xn--zca.ß", + "output": "xn--zca.xn--zca" + }, + { + "input": "ab--c.xn--zca", + "output": "ab--c.xn--zca" + }, + { + "input": "ab--c.ß", + "output": "ab--c.xn--zca" + }, + { + "comment": "CheckJoiners is true", + "input": "\u200D.example", + "output": null + }, + { + "input": "xn--1ug.example", + "output": null + }, + { + "comment": "CheckBidi is true", + "input": "يa", + "output": null + }, + { + "input": "xn--a-yoc", + "output": null + }, + { + "comment": "processing_option is Nontransitional_Processing", + "input": "ශ්‍රී", + "output": "xn--10cl1a0b660p" + }, + { + "input": "نامه‌ای", + "output": "xn--mgba3gch31f060k" + }, + { + "comment": "U+FFFD", + "input": "\uFFFD.com", + "output": null + }, + { + "comment": "U+FFFD character encoded in Punycode", + "input": "xn--zn7c.com", + "output": null + }, + { + "comment": "Label longer than 63 code points", + "input": "x01234567890123456789012345678901234567890123456789012345678901x", + "output": "x01234567890123456789012345678901234567890123456789012345678901x" + }, + { + "input": "x01234567890123456789012345678901234567890123456789012345678901†", + "output": "xn--x01234567890123456789012345678901234567890123456789012345678901-6963b" + }, + { + "input": "x01234567890123456789012345678901234567890123456789012345678901x.xn--zca", + "output": "x01234567890123456789012345678901234567890123456789012345678901x.xn--zca" + }, + { + "input": "x01234567890123456789012345678901234567890123456789012345678901x.ß", + "output": "x01234567890123456789012345678901234567890123456789012345678901x.xn--zca" + }, + { + "comment": "Domain excluding TLD longer than 253 code points", + "input": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.x", + "output": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.x" + }, + { + "input": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.xn--zca", + "output": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.xn--zca" + }, + { + "input": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.ß", + "output": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.xn--zca" + }, + { + "comment": "IDNA ignored code points", + "input": "a\u00ADb", + "output": "ab" + }, + { + "input": "a%C2%ADb", + "output": "ab" + }, + { + "comment": "Empty host after domain to ASCII", + "input": "\u00AD", + "output": null + }, + { + "input": "%C2%AD", + "output": null + }, + { + "input": "xn--", + "output": null + } + ] \ No newline at end of file From 79eafeb16bb7df3bd2f59a92baf8f9ea8650d1ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 17 Nov 2022 19:28:33 +0100 Subject: [PATCH 17/34] Add a performance test --- tests/test_url.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/test_url.py b/tests/test_url.py index 342669bd..be2889a6 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -6,6 +6,7 @@ from itertools import tee from pathlib import Path from platform import python_implementation +from timeit import timeit from urllib.parse import urlparse import pytest @@ -509,7 +510,7 @@ def _test_safe_url_func(url, *, encoding=UNSET, output, func): def _test_safe_url(url, *, encoding=UNSET, output): - return _test_safe_url_func( + _test_safe_url_func( url, encoding=encoding, output=output, @@ -625,6 +626,35 @@ def test_safe_url_string_url(url, output): _test_safe_url_string(url, output=output) +@pytest.mark.parametrize( + "url", + tuple( + case[0] + for case in SAFE_URL_URL_CASES + if ( + case[0] not in KNOWN_SAFE_URL_STRING_URL_ISSUES and isinstance(case[1], str) + ) + ), +) +def test_safe_url_performance(url): + # As you increase number, safe_url_string starts gaining by far, + # presummably due to caching by urllib. + number = 1 # TODO: Increase? How much? + # Make sure the new implementation is at most this number of times as slow. + multiplier = 200 # TODO: Lower as close to 1 as possible. + + time1 = timeit( + f"safe_url({url!r})", "from w3lib.url import safe_url", number=number + ) + time2 = timeit( + f"safe_url_string({url!r})", + "from w3lib.url import safe_url_string", + number=number, + ) + + assert time1 <= time2 * multiplier + + # If this is ever fixed upstream, decide what to do with our workaround. We # currently provide a tee Python implementation for PyPy, which we should # probably stop doing on PyPy versions where the bug is no longer present, but From 302816556e062b45170d347c02a63267d8721b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 17 Nov 2022 19:53:40 +0100 Subject: [PATCH 18/34] Add idna.txt to source distribution --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index 37facf1b..16ac8554 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -10,3 +10,4 @@ include NEWS include README.rst include pytest.ini include tox.ini +include w3lib/idna.txt From 091905e3bec7a148c37edc6ead442c3a1b01e689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 17 Nov 2022 22:47:19 +0100 Subject: [PATCH 19/34] 2x speed-up at the cost of mishandling invalid code points --- tests/test_url.py | 4 +- w3lib/_encoding.py | 145 ++------------------------------------------- w3lib/_url.py | 59 +++++++----------- 3 files changed, 32 insertions(+), 176 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index be2889a6..63ee4831 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -163,6 +163,8 @@ def test_parse_url( # TODO: Investigate. ("\x0eA", "iso-2022-jp"), ("\ue5e5", "gb18030"), + # TODO: Fix the escaping of unsupported code points. + ("†", "big5"), } with open(PERCENT_ENCODE_TEST_DATA_FILE_PATH, encoding="utf-8") as input: @@ -641,7 +643,7 @@ def test_safe_url_performance(url): # presummably due to caching by urllib. number = 1 # TODO: Increase? How much? # Make sure the new implementation is at most this number of times as slow. - multiplier = 200 # TODO: Lower as close to 1 as possible. + multiplier = 100 # TODO: Lower as close to 1 as possible. time1 = timeit( f"safe_url({url!r})", "from w3lib.url import safe_url", number=number diff --git a/w3lib/_encoding.py b/w3lib/_encoding.py index 9dca92ce..f712b40c 100644 --- a/w3lib/_encoding.py +++ b/w3lib/_encoding.py @@ -1,15 +1,15 @@ # https://encoding.spec.whatwg.org/ import codecs -from collections import deque -from typing import AnyStr, Callable, Dict, List, Optional, Tuple, Union +from functools import cache +from typing import AnyStr, Callable, Dict, Tuple from ._infra import _ASCII_WHITESPACE CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] DecodeFunction = Callable[[bytes], Tuple[str, int]] -EncodeFunction = Callable[[str], Tuple[bytes, int]] +EncodeFunction = Callable[[str, str], Tuple[bytes, int]] def _short_windows_125(last_digit: int) -> Dict[str, str]: @@ -412,152 +412,18 @@ def _short_windows_125(last_digit: int) -> Dict[str, str]: } -class _PotentialError: - def __init__( - self, - *, - _continue: bool = False, - error: bool = False, - error_code_point: Union[bytes, str, None] = None, - finished: bool = False, - items: Union[bytes, str, None] = None, - ) -> None: - self.code_point: Union[bytes, str, None] = error_code_point - self._continue = _continue - self._error = error - self._finished = finished - if isinstance(items, bytes): - _items: List[Union[bytes, str]] = [b"%c" % byte for byte in items] - elif items is not None: - _items = list(items) - else: - _items = [] - self.items: List[Union[bytes, str]] = _items - - def is_continue(self) -> bool: - return self._continue - - def is_finished(self) -> bool: - return self._finished - - def is_error(self) -> bool: - return self._error - - -# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#handler -def _handle_codec( - *, codec: CodecFunction, item: Union[bytes, str, None] -) -> _PotentialError: - if item is None: - return _PotentialError(finished=True) - try: - items, _ = codec(item) - except UnicodeError: - return _PotentialError(error=True, error_code_point=item) - else: - if items: - return _PotentialError(items=items) - else: - return _PotentialError(_continue=True) - - -# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-stream-read -def _read(input: deque) -> Union[bytes, str, None]: - if not input: - return None - return input.popleft() - - -# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-process -def _process_item( - item: Union[bytes, str, None], *, codec: CodecFunction, output: deque, mode: str -) -> _PotentialError: - result = _handle_codec(codec=codec, item=item) - if result.is_finished(): - return result - if result.items: - for result_item in result.items: - output.append(result_item) - elif result.is_error(): - assert result.code_point is not None - if mode == "replacement": - output.append("\uFFFD") - elif mode == "html": - output.append(b"&#%i;" % ord(result.code_point)) - elif mode == "fatal": - return result - return _PotentialError(_continue=True) - - -# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#utf-8-decode-without-bom-or-fail -def _utf_8_decode_without_bom_or_fail( - *, - input: deque, - output: Optional[deque] = None, -) -> deque: - if output is None: - output = deque() - potential_error = _process_queue( - input=input, - output=output, - codec=_UTF_8_DECODER, - error_mode="fatal", - ) - if potential_error.is_error(): - raise ValueError - return output - - -# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-run -def _process_queue( - *, - input: deque, - codec: CodecFunction, - output: deque, - error_mode: str, -) -> _PotentialError: - while True: - result = _process_item( - _read(input), - codec=codec, - output=output, - mode=error_mode, - ) - if not result.is_continue(): - return result - - -# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#encode-or-fail -def _encode_or_fail( - *, input: deque, encoder: EncodeFunction, output: deque -) -> Optional[_PotentialError]: - potential_error = _process_queue( - input=input, - codec=encoder, - output=output, - error_mode="fatal", - ) - if potential_error.is_error(): - return potential_error - return None - - -def _get_decoder(encoding: str) -> DecodeFunction: - codec_info = codecs.lookup(encoding) - return codec_info.decode - - # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder +@cache def _get_encoder(encoding: str) -> EncodeFunction: codec_info = codecs.lookup(encoding) return codec_info.encode -_UTF_8_DECODER = _get_decoder("utf-8") _UTF_8_ENCODER = _get_encoder("utf-8") # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get +@cache def _get_encoding(label: str) -> str: label = label.strip(_ASCII_WHITESPACE).lower() try: @@ -579,6 +445,7 @@ def _get_encoding(label: str) -> str: # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings +@cache def _get_output_encoding(encoding: str) -> str: encoding = _get_encoding(encoding) if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: diff --git a/w3lib/_url.py b/w3lib/_url.py index 697ed94c..8ec05f48 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -11,10 +11,8 @@ from . import _utr46 from ._encoding import ( - _encode_or_fail, _get_encoder, _get_output_encoding, - _PotentialError, ) from ._infra import ( _ASCII_ALPHA, @@ -144,7 +142,7 @@ def _shorten_path(url: _URL) -> None: url.path = path[:-1] -def by_threes(iterable: deque) -> Iterator: +def by_threes(iterable: Iterable) -> Iterator: a, b, c = tee(iterable, 3) next(b, None) next(c, None) @@ -162,41 +160,30 @@ def _percent_encode_after_encoding( space_as_plus: bool = False, ) -> str: encoder = _get_encoder(encoding) - input_queue = deque(input) output = "" - potential_error: Union[int, _PotentialError, None] = 0 - - while potential_error is not None: - encode_output: deque = deque() - potential_error = _encode_or_fail( - input=input_queue, - encoder=encoder, - output=encode_output, - ) - for three_bytes in by_threes(encode_output): - byte = three_bytes[0] - if space_as_plus and byte == b" ": - output += "+" - continue - isomorph = chr(ord(byte)) - if isomorph not in percent_encode_set: - output += isomorph - elif isomorph == "%": - if ( - three_bytes[1] is None - or chr(ord(three_bytes[1])) not in _ASCII_HEX_DIGIT - or three_bytes[2] is None - or chr(ord(three_bytes[2])) not in _ASCII_HEX_DIGIT - ): - output += "%25" - else: - output += "%" + # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B + # instead of &#NNN; + encode_output, _ = encoder(input, "xmlcharrefreplace") + for three_bytes in by_threes(encode_output): + byte = three_bytes[0] + if space_as_plus and byte == b" ": + output += "+" + continue + isomorph = chr(byte) + if isomorph not in percent_encode_set: + output += isomorph + elif isomorph == "%": + if ( + three_bytes[1] is None + or chr(three_bytes[1]) not in _ASCII_HEX_DIGIT + or three_bytes[2] is None + or chr(three_bytes[2]) not in _ASCII_HEX_DIGIT + ): + output += "%25" else: - output += f"%{byte[0]:02X}" - if potential_error is not None: - assert isinstance(potential_error, _PotentialError) - assert isinstance(potential_error.code_point, (bytes, str)) - output += f"%26%23{ord(potential_error.code_point)}%3B" + output += "%" + else: + output += f"%{byte:02X}" return output From fea33a6b43c30903e097b99d60f39526ec4a844e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 17 Nov 2022 23:03:07 +0100 Subject: [PATCH 20/34] _percent_encode_after_encoding: 0.2 speed-up --- w3lib/_url.py | 50 ++++++++------------------------------------------ 1 file changed, 8 insertions(+), 42 deletions(-) diff --git a/w3lib/_url.py b/w3lib/_url.py index 8ec05f48..02d972bd 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -2,12 +2,10 @@ # https://url.spec.whatwg.org/ -from collections import deque from enum import auto, Enum -from itertools import chain, zip_longest +from itertools import chain from math import floor -from platform import python_implementation -from typing import Iterable, Iterator, List, Optional, Tuple, TypeVar, Union +from typing import List, Optional, Tuple, Union from . import _utr46 from ._encoding import ( @@ -27,29 +25,6 @@ ) from ._util import _PercentEncodeSet -T = TypeVar("T") - -if python_implementation() != "PyPy": - from itertools import tee # pylint: disable=ungrouped-imports -else: - # https://foss.heptapod.net/pypy/pypy/-/issues/3852 - def tee(__iterable: Iterable[T], __n: int = 2) -> Tuple[Iterator[T], ...]: - it = iter(__iterable) - deques: List[deque] = [deque() for i in range(__n)] - - def gen(mydeque: deque) -> Iterator: - while True: - if not mydeque: # when the local deque is empty - try: - newval = next(it) # fetch a new value and - except StopIteration: - return - for d in deques: # load it to all the deques - d.append(newval) - yield mydeque.popleft() - - return tuple(gen(d) for d in deques) - _ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { ord(char): None for char in _ASCII_TAB_OR_NEWLINE @@ -142,14 +117,6 @@ def _shorten_path(url: _URL) -> None: url.path = path[:-1] -def by_threes(iterable: Iterable) -> Iterator: - a, b, c = tee(iterable, 3) - next(b, None) - next(c, None) - next(c, None) - return zip_longest(a, b, c) - - # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode # Extended to handled cases where % is to be percent-encoded. def _percent_encode_after_encoding( @@ -164,9 +131,9 @@ def _percent_encode_after_encoding( # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B # instead of &#NNN; encode_output, _ = encoder(input, "xmlcharrefreplace") - for three_bytes in by_threes(encode_output): - byte = three_bytes[0] - if space_as_plus and byte == b" ": + for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + byte = encode_output[i] + if space_as_plus and byte == 0x20: output += "+" continue isomorph = chr(byte) @@ -174,10 +141,9 @@ def _percent_encode_after_encoding( output += isomorph elif isomorph == "%": if ( - three_bytes[1] is None - or chr(three_bytes[1]) not in _ASCII_HEX_DIGIT - or three_bytes[2] is None - or chr(three_bytes[2]) not in _ASCII_HEX_DIGIT + len(encode_output) <= i + 2 + or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT + or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT ): output += "%25" else: From 184e5a77be064b71819782bec0c325ed1bf1bea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 17 Nov 2022 23:24:53 +0100 Subject: [PATCH 21/34] 0.1 speed-up --- tests/test_url.py | 2 +- w3lib/_encoding.py | 8 ++++---- w3lib/_rfc5892.py | 7 ++++++- w3lib/_url.py | 45 ++++++++++++++++++++++++++------------------- 4 files changed, 37 insertions(+), 25 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index 63ee4831..5361c139 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -643,7 +643,7 @@ def test_safe_url_performance(url): # presummably due to caching by urllib. number = 1 # TODO: Increase? How much? # Make sure the new implementation is at most this number of times as slow. - multiplier = 100 # TODO: Lower as close to 1 as possible. + multiplier = 90 # TODO: Lower as close to 1 as possible. time1 = timeit( f"safe_url({url!r})", "from w3lib.url import safe_url", number=number diff --git a/w3lib/_encoding.py b/w3lib/_encoding.py index f712b40c..2172bbf6 100644 --- a/w3lib/_encoding.py +++ b/w3lib/_encoding.py @@ -1,7 +1,7 @@ # https://encoding.spec.whatwg.org/ import codecs -from functools import cache +from functools import lru_cache from typing import AnyStr, Callable, Dict, Tuple from ._infra import _ASCII_WHITESPACE @@ -413,7 +413,7 @@ def _short_windows_125(last_digit: int) -> Dict[str, str]: # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder -@cache +@lru_cache(maxsize=None) def _get_encoder(encoding: str) -> EncodeFunction: codec_info = codecs.lookup(encoding) return codec_info.encode @@ -423,7 +423,7 @@ def _get_encoder(encoding: str) -> EncodeFunction: # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get -@cache +@lru_cache(maxsize=None) def _get_encoding(label: str) -> str: label = label.strip(_ASCII_WHITESPACE).lower() try: @@ -445,7 +445,7 @@ def _get_encoding(label: str) -> str: # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings -@cache +@lru_cache(maxsize=None) def _get_output_encoding(encoding: str) -> str: encoding = _get_encoding(encoding) if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: diff --git a/w3lib/_rfc5892.py b/w3lib/_rfc5892.py index 869455b0..86cf31d7 100644 --- a/w3lib/_rfc5892.py +++ b/w3lib/_rfc5892.py @@ -1,9 +1,14 @@ # https://www.rfc-editor.org/rfc/rfc5892.txt -from idna import intranges_contain, valid_contextj +from functools import lru_cache + +from idna import intranges_contain as _intranges_contain, valid_contextj from idna.idnadata import codepoint_classes +intranges_contain = lru_cache(maxsize=None)(_intranges_contain) + + def _check_contextj_rules(label: str) -> None: for i, code_point in enumerate(label): value = ord(code_point) diff --git a/w3lib/_url.py b/w3lib/_url.py index 02d972bd..904c23bd 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -67,7 +67,7 @@ class _State(Enum): class _URL: - scheme: str = "" + _scheme: str = "" username: str = "" password: str = "" hostname: Union[int, List[int], str] = "" @@ -98,12 +98,19 @@ class _URL: def __init__(self) -> None: self.path = [] + self.is_special = False def has_opaque_path(self) -> bool: return isinstance(self.path, str) - def is_special(self) -> bool: - return self.scheme in _SPECIAL_SCHEMES + @property + def scheme(self) -> str: + return self._scheme + + @scheme.setter + def scheme(self, value: str) -> None: + self._scheme = value + self.is_special = value in _SPECIAL_SCHEMES _SCHEME_CHARS = _ASCII_ALPHANUMERIC + "+-." @@ -567,7 +574,7 @@ def _parse_url( buffer = "" if url.scheme == "file": state = _State.FILE - elif url.is_special(): + elif url.is_special: if base is not None and base.scheme == url.scheme: state = _State.SPECIAL_RELATIVE_OR_AUTHORITY else: @@ -619,7 +626,7 @@ def _parse_url( elif state == _State.RELATIVE: assert isinstance(base, _URL) url.scheme = base.scheme - if c == "/" or url.is_special() and c == "\\": + if c == "/" or url.is_special and c == "\\": state = _State.RELATIVE_SLASH else: url.username = base.username @@ -642,7 +649,7 @@ def _parse_url( elif state == _State.RELATIVE_SLASH: assert isinstance(base, _URL) - if url.is_special() and c is not None and c in "/\\": + if url.is_special and c is not None and c in "/\\": assert isinstance(c, str) state = _State.SPECIAL_AUTHORITY_IGNORE_SLASHES elif c == "/": @@ -687,7 +694,7 @@ def _parse_url( else: url.username += encoded_code_points buffer = "" - elif c is None or c in "/?#" or url.is_special() and c == "\\": + elif c is None or c in "/?#" or url.is_special and c == "\\": if at_sign_seen and not buffer: raise ValueError pointer -= len(buffer) + 1 @@ -700,16 +707,16 @@ def _parse_url( if c == ":" and not inside_brackets: if not buffer: raise ValueError - host = _parse_host(buffer, is_special=url.is_special()) + host = _parse_host(buffer, is_special=url.is_special) url.hostname = host buffer = "" state = _State.PORT url._port_token_seen = True - elif c is None or c in "/?#" or url.is_special() and c == "\\": + elif c is None or c in "/?#" or url.is_special and c == "\\": pointer -= 1 - if url.is_special() and not buffer: + if url.is_special and not buffer: raise ValueError - host = _parse_host(buffer, is_special=url.is_special()) + host = _parse_host(buffer, is_special=url.is_special) url.hostname = host buffer = "" state = _State.PATH_START @@ -724,7 +731,7 @@ def _parse_url( if c is not None and c in _ASCII_DIGIT: assert isinstance(c, str) buffer += c - elif c is None or c in "/?#" or url.is_special() and c == "\\": + elif c is None or c in "/?#" or url.is_special and c == "\\": if buffer: port = int(buffer) if port > 2**16 - 1: @@ -790,7 +797,7 @@ def _parse_url( url.hostname = "" state = _State.PATH_START else: - host = _parse_host(buffer, is_special=url.is_special()) + host = _parse_host(buffer, is_special=url.is_special) if host == "localhost": host = "" url.hostname = host @@ -801,7 +808,7 @@ def _parse_url( buffer += c elif state == _State.PATH_START: - if url.is_special(): + if url.is_special: state = _State.PATH if c is not None and c not in "/\\": assert isinstance(c, str) @@ -820,13 +827,13 @@ def _parse_url( elif state == _State.PATH: assert isinstance(url.path, list) - if c is None or c == "/" or (url.is_special() and c == "\\") or c in "?#": + if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": if _is_double_dot_path_segment(buffer): _shorten_path(url) - if c != "/" and not (url.is_special() and c == "\\"): + if c != "/" and not (url.is_special and c == "\\"): url.path.append("") elif _is_single_dot_path_segment(buffer): - if c != "/" and not (url.is_special() and c == "\\"): + if c != "/" and not (url.is_special and c == "\\"): url.path.append("") else: if ( @@ -878,13 +885,13 @@ def _parse_url( elif state == _State.QUERY: assert isinstance(url.query, str) if encoding != "utf-8" and ( - not url.is_special() or url.scheme in ("ws", "wss") + not url.is_special or url.scheme in ("ws", "wss") ): encoding = "utf-8" if c == "#" or c is None: percent_encode_set = ( special_query_percent_encode_set - if url.is_special() + if url.is_special else query_percent_encode_set ) url.query += _percent_encode_after_encoding( From 4c21a0e07c98910cd98ae713c52e740b07e15478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 17 Nov 2022 23:44:10 +0100 Subject: [PATCH 22/34] x1.2 speed up --- tests/test_url.py | 2 +- w3lib/_url.py | 181 +++++++++++++++++++++++----------------------- 2 files changed, 90 insertions(+), 93 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index 5361c139..29b9cc57 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -643,7 +643,7 @@ def test_safe_url_performance(url): # presummably due to caching by urllib. number = 1 # TODO: Increase? How much? # Make sure the new implementation is at most this number of times as slow. - multiplier = 90 # TODO: Lower as close to 1 as possible. + multiplier = 75 # TODO: Lower as close to 1 as possible. time1 = timeit( f"safe_url({url!r})", "from w3lib.url import safe_url", number=number diff --git a/w3lib/_url.py b/w3lib/_url.py index 904c23bd..fe006ba9 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -2,7 +2,6 @@ # https://url.spec.whatwg.org/ -from enum import auto, Enum from itertools import chain from math import floor from typing import List, Optional, Tuple, Union @@ -30,28 +29,26 @@ ord(char): None for char in _ASCII_TAB_OR_NEWLINE } - -class _State(Enum): - SCHEME_START = auto() - SCHEME = auto() - NO_SCHEME = auto() - SPECIAL_RELATIVE_OR_AUTHORITY = auto() - PATH_OR_AUTHORITY = auto() - RELATIVE = auto() - RELATIVE_SLASH = auto() - SPECIAL_AUTHORITY_SLASHES = auto() - SPECIAL_AUTHORITY_IGNORE_SLASHES = auto() - AUTHORITY = auto() - HOST = auto() - PORT = auto() - FILE = auto() - FILE_SLASH = auto() - FILE_HOST = auto() - PATH_START = auto() - PATH = auto() - OPAQUE_PATH = auto() - QUERY = auto() - FRAGMENT = auto() +SCHEME_START = 0 +SCHEME = 1 +NO_SCHEME = 2 +SPECIAL_RELATIVE_OR_AUTHORITY = 3 +PATH_OR_AUTHORITY = 4 +RELATIVE = 5 +RELATIVE_SLASH = 6 +SPECIAL_AUTHORITY_SLASHES = 7 +SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 +AUTHORITY = 9 +HOST = 10 +PORT = 11 +FILE = 12 +FILE_SLASH = 13 +FILE_HOST = 14 +PATH_START = 15 +PATH = 16 +OPAQUE_PATH = 17 +QUERY = 18 +FRAGMENT = 19 # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#default-port @@ -541,7 +538,7 @@ def _parse_url( encoding = _get_output_encoding(encoding) url = _URL() - state = _State.SCHEME_START + state = SCHEME_START buffer = "" at_sign_seen = inside_brackets = False pointer = 0 @@ -556,16 +553,16 @@ def _parse_url( except IndexError: c = None - if state == _State.SCHEME_START: + if state == SCHEME_START: if c is not None and c in _ASCII_ALPHA: assert isinstance(c, str) buffer += c.lower() - state = _State.SCHEME + state = SCHEME else: - state = _State.NO_SCHEME + state = NO_SCHEME pointer -= 1 - elif state == _State.SCHEME: + elif state == SCHEME: if c is not None and c in _SCHEME_CHARS: assert isinstance(c, str) buffer += c.lower() @@ -573,24 +570,24 @@ def _parse_url( url.scheme = buffer buffer = "" if url.scheme == "file": - state = _State.FILE + state = FILE elif url.is_special: if base is not None and base.scheme == url.scheme: - state = _State.SPECIAL_RELATIVE_OR_AUTHORITY + state = SPECIAL_RELATIVE_OR_AUTHORITY else: - state = _State.SPECIAL_AUTHORITY_SLASHES + state = SPECIAL_AUTHORITY_SLASHES elif pointer + 1 < len(input) and input[pointer + 1] == "/": - state = _State.PATH_OR_AUTHORITY + state = PATH_OR_AUTHORITY pointer += 1 else: url.path = "" - state = _State.OPAQUE_PATH + state = OPAQUE_PATH else: buffer = "" - state = _State.NO_SCHEME + state = NO_SCHEME pointer = -1 - elif state == _State.NO_SCHEME: + elif state == NO_SCHEME: if base is None: raise ValueError if base.has_opaque_path(): @@ -600,34 +597,34 @@ def _parse_url( url.path = base.path url.query = base.query url.fragment = "" - state = _State.FRAGMENT + state = FRAGMENT else: if base.scheme != "file": - state = _State.RELATIVE + state = RELATIVE else: - state = _State.FILE + state = FILE pointer -= 1 - elif state == _State.SPECIAL_RELATIVE_OR_AUTHORITY: + elif state == SPECIAL_RELATIVE_OR_AUTHORITY: if c == "/" and input[pointer + 1] == "/": - state = _State.SPECIAL_AUTHORITY_IGNORE_SLASHES + state = SPECIAL_AUTHORITY_IGNORE_SLASHES pointer += 1 else: - state = _State.RELATIVE + state = RELATIVE pointer -= 1 - elif state == _State.PATH_OR_AUTHORITY: + elif state == PATH_OR_AUTHORITY: if c == "/": - state = _State.AUTHORITY + state = AUTHORITY else: - state = _State.PATH + state = PATH pointer -= 1 - elif state == _State.RELATIVE: + elif state == RELATIVE: assert isinstance(base, _URL) url.scheme = base.scheme if c == "/" or url.is_special and c == "\\": - state = _State.RELATIVE_SLASH + state = RELATIVE_SLASH else: url.username = base.username url.password = base.password @@ -637,45 +634,45 @@ def _parse_url( url.query = base.query if c == "?": url.query = "" - state = _State.QUERY + state = QUERY elif c == "#": url.fragment = "" - state = _State.FRAGMENT + state = FRAGMENT elif pointer < input_length: url.query = None _shorten_path(url) - state = _State.PATH + state = PATH pointer -= 1 - elif state == _State.RELATIVE_SLASH: + elif state == RELATIVE_SLASH: assert isinstance(base, _URL) if url.is_special and c is not None and c in "/\\": assert isinstance(c, str) - state = _State.SPECIAL_AUTHORITY_IGNORE_SLASHES + state = SPECIAL_AUTHORITY_IGNORE_SLASHES elif c == "/": - state = _State.AUTHORITY + state = AUTHORITY else: url.username = base.username url.password = base.password url.hostname = base.hostname url.port = base.port - state = _State.PATH + state = PATH pointer -= 1 - elif state == _State.SPECIAL_AUTHORITY_SLASHES: + elif state == SPECIAL_AUTHORITY_SLASHES: if c == "/" and input[pointer + 1] == "/": - state = _State.SPECIAL_AUTHORITY_IGNORE_SLASHES + state = SPECIAL_AUTHORITY_IGNORE_SLASHES pointer += 1 else: - state = _State.SPECIAL_AUTHORITY_IGNORE_SLASHES + state = SPECIAL_AUTHORITY_IGNORE_SLASHES pointer -= 1 - elif state == _State.SPECIAL_AUTHORITY_IGNORE_SLASHES: + elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: if c is None or c not in "/\\": - state = _State.AUTHORITY + state = AUTHORITY pointer -= 1 - elif state == _State.AUTHORITY: + elif state == AUTHORITY: if c == "@": if at_sign_seen: buffer = "%40" + buffer @@ -699,18 +696,18 @@ def _parse_url( raise ValueError pointer -= len(buffer) + 1 buffer = "" - state = _State.HOST + state = HOST else: buffer += c - elif state == _State.HOST: + elif state == HOST: if c == ":" and not inside_brackets: if not buffer: raise ValueError host = _parse_host(buffer, is_special=url.is_special) url.hostname = host buffer = "" - state = _State.PORT + state = PORT url._port_token_seen = True elif c is None or c in "/?#" or url.is_special and c == "\\": pointer -= 1 @@ -719,7 +716,7 @@ def _parse_url( host = _parse_host(buffer, is_special=url.is_special) url.hostname = host buffer = "" - state = _State.PATH_START + state = PATH_START else: if c == "[": inside_brackets = True @@ -727,7 +724,7 @@ def _parse_url( inside_brackets = False buffer += c - elif state == _State.PORT: + elif state == PORT: if c is not None and c in _ASCII_DIGIT: assert isinstance(c, str) buffer += c @@ -739,27 +736,27 @@ def _parse_url( url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port url._default_port_seen = url.port is None buffer = "" - state = _State.PATH_START + state = PATH_START pointer -= 1 else: raise ValueError - elif state == _State.FILE: + elif state == FILE: url.scheme = "file" url.hostname = "" if c is not None and c in "/\\": assert isinstance(c, str) - state = _State.FILE_SLASH + state = FILE_SLASH elif base is not None and base.scheme == "file": url.hostname = base.hostname url.path = base.path url.query = base.query if c == "?": url.query = "" - state = _State.QUERY + state = QUERY elif c == "#": url.fragment = "" - state = _State.FRAGMENT + state = FRAGMENT elif c is not None: assert isinstance(c, str) url.query = None @@ -767,17 +764,17 @@ def _parse_url( _shorten_path(url) else: url.path = [] - state = _State.PATH + state = PATH pointer -= 1 else: - state = _State.PATH + state = PATH pointer -= 1 - elif state == _State.FILE_SLASH: + elif state == FILE_SLASH: assert isinstance(url.path, list) if c is not None and c in "/\\": assert isinstance(c, str) - state = _State.FILE_HOST + state = FILE_HOST else: if base is not None and base.scheme == "file": url.hostname = base.hostname @@ -785,47 +782,47 @@ def _parse_url( input[pointer:] ) and _is_windows_drive_letter(base.path[0]): url.path.append(base.path[0]) - state = _State.PATH + state = PATH pointer -= 1 - elif state == _State.FILE_HOST: + elif state == FILE_HOST: if c is None or c in "/\\?#": pointer -= 1 if _is_windows_drive_letter(buffer): - state = _State.PATH + state = PATH elif not buffer: url.hostname = "" - state = _State.PATH_START + state = PATH_START else: host = _parse_host(buffer, is_special=url.is_special) if host == "localhost": host = "" url.hostname = host buffer = "" - state = _State.PATH_START + state = PATH_START else: assert isinstance(c, str) buffer += c - elif state == _State.PATH_START: + elif state == PATH_START: if url.is_special: - state = _State.PATH + state = PATH if c is not None and c not in "/\\": assert isinstance(c, str) pointer -= 1 elif c == "?": url.query = "" - state = _State.QUERY + state = QUERY elif c == "#": url.fragment = "" - state = _State.FRAGMENT + state = FRAGMENT elif c is not None: assert isinstance(c, str) - state = _State.PATH + state = PATH if c != "/": pointer -= 1 - elif state == _State.PATH: + elif state == PATH: assert isinstance(url.path, list) if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": if _is_double_dot_path_segment(buffer): @@ -854,10 +851,10 @@ def _parse_url( buffer = "" if c == "?": url.query = "" - state = _State.QUERY + state = QUERY elif c == "#": url.fragment = "" - state = _State.FRAGMENT + state = FRAGMENT else: assert isinstance(c, str) buffer += _idempotent_utf_8_percent_encode( @@ -866,14 +863,14 @@ def _parse_url( encode_set=path_percent_encode_set, ) - elif state == _State.OPAQUE_PATH: + elif state == OPAQUE_PATH: assert isinstance(url.path, str) if c == "?": url.query = "" - state = _State.QUERY + state = QUERY elif c == "#": url.fragment = "" - state = _State.FRAGMENT + state = FRAGMENT elif c is not None: assert isinstance(c, str) encoded = _utf_8_percent_encode( @@ -882,7 +879,7 @@ def _parse_url( ) url.path += encoded - elif state == _State.QUERY: + elif state == QUERY: assert isinstance(url.query, str) if encoding != "utf-8" and ( not url.is_special or url.scheme in ("ws", "wss") @@ -902,12 +899,12 @@ def _parse_url( buffer = "" if c == "#": url.fragment = "" - state = _State.FRAGMENT + state = FRAGMENT elif c is not None: assert isinstance(c, str) buffer += c - elif state == _State.FRAGMENT: + elif state == FRAGMENT: assert isinstance(url.fragment, str) if c is not None: assert isinstance(c, str) From c317f9eaf423b009d9df3b6cd9882371706dc4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Fri, 18 Nov 2022 00:23:15 +0100 Subject: [PATCH 23/34] x1.67 speed up --- tests/test_url.py | 20 +------------------- w3lib/_url.py | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index 29b9cc57..1d6cbbf4 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -1,11 +1,7 @@ import json import os import unittest -from collections import deque -from collections.abc import Iterator -from itertools import tee from pathlib import Path -from platform import python_implementation from timeit import timeit from urllib.parse import urlparse @@ -643,7 +639,7 @@ def test_safe_url_performance(url): # presummably due to caching by urllib. number = 1 # TODO: Increase? How much? # Make sure the new implementation is at most this number of times as slow. - multiplier = 75 # TODO: Lower as close to 1 as possible. + multiplier = 45 # TODO: Lower as close to 1 as possible. time1 = timeit( f"safe_url({url!r})", "from w3lib.url import safe_url", number=number @@ -657,20 +653,6 @@ def test_safe_url_performance(url): assert time1 <= time2 * multiplier -# If this is ever fixed upstream, decide what to do with our workaround. We -# currently provide a tee Python implementation for PyPy, which we should -# probably stop doing on PyPy versions where the bug is no longer present, but -# we still may want the implementation on other PyPy versions. -@pytest.mark.xfail( - python_implementation() == "PyPy", - reason="https://foss.heptapod.net/pypy/pypy/-/issues/3852", - strict=True, -) -def test_tee(): - iterator1, _ = tee(deque([b""])) - assert isinstance(iterator1, Iterator) - - class UrlTests(unittest.TestCase): def test_safe_url_string_path_encoding(self): safeurl = safe_url_string("http://www.example.com/£", path_encoding="latin-1") diff --git a/w3lib/_url.py b/w3lib/_url.py index fe006ba9..fcf04f3e 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -540,7 +540,7 @@ def _parse_url( url = _URL() state = SCHEME_START buffer = "" - at_sign_seen = inside_brackets = False + at_sign_seen = inside_brackets = skip_authority_shortcut = False pointer = 0 input = input.strip(_C0_CONTROL_OR_SPACE) @@ -556,7 +556,7 @@ def _parse_url( if state == SCHEME_START: if c is not None and c in _ASCII_ALPHA: assert isinstance(c, str) - buffer += c.lower() + buffer += c state = SCHEME else: state = NO_SCHEME @@ -565,9 +565,9 @@ def _parse_url( elif state == SCHEME: if c is not None and c in _SCHEME_CHARS: assert isinstance(c, str) - buffer += c.lower() + buffer += c elif c == ":": - url.scheme = buffer + url.scheme = buffer.lower() buffer = "" if url.scheme == "file": state = FILE @@ -673,7 +673,14 @@ def _parse_url( pointer -= 1 elif state == AUTHORITY: - if c == "@": + if not skip_authority_shortcut: + at_sign_index = input.find("@", pointer) + if at_sign_index == -1: + state = HOST + else: + skip_authority_shortcut = True + pointer -= 1 + elif c == "@": if at_sign_seen: buffer = "%40" + buffer at_sign_seen = True From 7152d0b8905adca5e44bfc2489733b95fa01d764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Fri, 18 Nov 2022 00:48:30 +0100 Subject: [PATCH 24/34] Remove unused code --- w3lib/_infra.py | 47 ----------------------------------------------- w3lib/_url.py | 2 -- 2 files changed, 49 deletions(-) diff --git a/w3lib/_infra.py b/w3lib/_infra.py index 758b9443..f18437eb 100644 --- a/w3lib/_infra.py +++ b/w3lib/_infra.py @@ -11,50 +11,3 @@ _ASCII_HEX_DIGIT = string.hexdigits _ASCII_ALPHA = string.ascii_letters _ASCII_ALPHANUMERIC = string.ascii_letters + string.digits - - -# https://infra.spec.whatwg.org/commit-snapshots/59e0d16c1e3ba0e77c6a60bfc69a0929b8ffaa5d/#surrogate -def _is_surrogate_code_point_id(code_point_id: int) -> bool: - return 0xD800 <= code_point_id <= 0xDFFF - - -# https://infra.spec.whatwg.org/commit-snapshots/59e0d16c1e3ba0e77c6a60bfc69a0929b8ffaa5d/#noncharacter -def _is_noncharacter_code_point_id(code_point_id: int) -> bool: - if 0xFDD0 <= code_point_id <= 0xFDEF: - return True - return code_point_id in ( - 0xFFFE, - 0xFFFF, - 0x1FFFE, - 0x1FFFF, - 0x2FFFE, - 0x2FFFF, - 0x3FFFE, - 0x3FFFF, - 0x4FFFE, - 0x4FFFF, - 0x5FFFE, - 0x5FFFF, - 0x6FFFE, - 0x6FFFF, - 0x7FFFE, - 0x7FFFF, - 0x8FFFE, - 0x8FFFF, - 0x9FFFE, - 0x9FFFF, - 0xAFFFE, - 0xAFFFF, - 0xBFFFE, - 0xBFFFF, - 0xCFFFE, - 0xCFFFF, - 0xDFFFE, - 0xDFFFF, - 0xEFFFE, - 0xEFFFF, - 0xFFFFE, - 0xFFFFF, - 0x10FFFE, - 0x10FFFF, - ) diff --git a/w3lib/_url.py b/w3lib/_url.py index fcf04f3e..7a695088 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -19,8 +19,6 @@ _ASCII_TAB_OR_NEWLINE, _C0_CONTROL, _C0_CONTROL_OR_SPACE, - _is_noncharacter_code_point_id, - _is_surrogate_code_point_id, ) from ._util import _PercentEncodeSet From 9daca878be5a5652f9a3d245b3491bda4e4d66c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Fri, 18 Nov 2022 00:59:20 +0100 Subject: [PATCH 25/34] x1.125 speed up --- tests/test_url.py | 2 +- w3lib/_rfc5892.py | 2 ++ w3lib/_url.py | 19 ------------------- w3lib/_utr46.py | 2 +- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index 1d6cbbf4..0bd5c179 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -639,7 +639,7 @@ def test_safe_url_performance(url): # presummably due to caching by urllib. number = 1 # TODO: Increase? How much? # Make sure the new implementation is at most this number of times as slow. - multiplier = 45 # TODO: Lower as close to 1 as possible. + multiplier = 40 # TODO: Lower as close to 1 as possible. time1 = timeit( f"safe_url({url!r})", "from w3lib.url import safe_url", number=number diff --git a/w3lib/_rfc5892.py b/w3lib/_rfc5892.py index 86cf31d7..2c55ecbb 100644 --- a/w3lib/_rfc5892.py +++ b/w3lib/_rfc5892.py @@ -10,6 +10,8 @@ def _check_contextj_rules(label: str) -> None: + if label.isascii(): + return for i, code_point in enumerate(label): value = ord(code_point) if not intranges_contain(value, codepoint_classes["CONTEXTJ"]): diff --git a/w3lib/_url.py b/w3lib/_url.py index 7a695088..474bbb88 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -432,25 +432,6 @@ def _starts_with_windows_drive_letter(input: str) -> bool: ) -_ASCII_URL_CODE_POINTS = _ASCII_ALPHANUMERIC + "!$&'()*+,-./:;=?@_~" - - -# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-code-points -def _is_url_code_point(code_point: str) -> bool: - if code_point in _ASCII_URL_CODE_POINTS: - return True - code_point_id = ord(code_point) - if code_point_id < 0xA0: - return False - if code_point_id > 0x10FFFD: - return False - if _is_surrogate_code_point_id(code_point_id): - return False - if _is_noncharacter_code_point_id(code_point_id): - return False - return True - - # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment def _is_double_dot_path_segment(input: str) -> bool: return input in ( diff --git a/w3lib/_utr46.py b/w3lib/_utr46.py index 8d729635..b9f723ef 100644 --- a/w3lib/_utr46.py +++ b/w3lib/_utr46.py @@ -256,7 +256,7 @@ def _process( def _convert_label(label: str) -> str: - if not any(ord(code_point) >= 0x80 for code_point in label): + if label.isascii(): return label return f"xn--{label.encode('punycode').decode()}" From 88f32ae4a08aa448dd7fc52f92b6c8a63b59a90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Fri, 18 Nov 2022 01:08:34 +0100 Subject: [PATCH 26/34] Use urllib.parse.unquote --- w3lib/_url.py | 43 ++----------------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/w3lib/_url.py b/w3lib/_url.py index 474bbb88..f1fe7a81 100644 --- a/w3lib/_url.py +++ b/w3lib/_url.py @@ -2,9 +2,9 @@ # https://url.spec.whatwg.org/ -from itertools import chain from math import floor from typing import List, Optional, Tuple, Union +from urllib.parse import unquote from . import _utr46 from ._encoding import ( @@ -277,45 +277,6 @@ def _parse_opaque_host(input: str) -> str: return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) -_ASCII_HEX_BYTES = tuple( - chain( - range(0x30, 0x39 + 1), - range(0x41, 0x46 + 1), - range(0x61, 0x66 + 1), - ) -) - - -# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#percent-decode -def _percent_decode(input: bytes) -> bytes: - output = b"" - pointer = 0 - input_length = len(input) - while pointer < input_length: - byte = input[pointer] - if byte != 0x25 or ( - byte == 0x25 - and ( - pointer + 2 >= input_length - or input[pointer + 1] not in _ASCII_HEX_BYTES - or input[pointer + 2] not in _ASCII_HEX_BYTES - ) - ): - output += b"%c" % byte - else: - byte_hex = b"%c%c" % (input[pointer + 1], input[pointer + 2]) - byte_point = int(byte_hex, base=16) - output += b"%c" % byte_point - pointer += 2 - pointer += 1 - return output - - -# https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#string-percent-decode -def _percent_decode_string(input: str) -> bytes: - return _percent_decode(input.encode()) - - # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser def _parse_ipv4_number(input: str) -> Tuple[int, bool]: if not input: @@ -407,7 +368,7 @@ def _parse_host( return _parse_ipv6(input[1:-1]) if not is_special: return _parse_opaque_host(input) - domain = _percent_decode_string(input).decode() + domain = unquote(input) ascii_domain = _domain_to_ascii(domain) for code_point in ascii_domain: if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: From 63a2f2f8ef343f55f0372786af8449c2d88767b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Mon, 12 Feb 2024 16:04:33 +0100 Subject: [PATCH 27/34] Initial use of Cython (x7 speedup) --- .gitignore | 1 + MANIFEST.in | 3 + setup.py | 37 +- tests/test_url.py | 2 +- w3lib/_url.c | 31612 ++++++++++++++++++++++++++++++++++ w3lib/{_url.py => _url.pyx} | 0 6 files changed, 31653 insertions(+), 2 deletions(-) create mode 100644 w3lib/_url.c rename w3lib/{_url.py => _url.pyx} (100%) diff --git a/.gitignore b/.gitignore index 714a9be8..ed4d9137 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ coverage.xml /index.txt .dmypy.json .hypothesis/ +*.so diff --git a/MANIFEST.in b/MANIFEST.in index 16ac8554..30c070aa 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,6 @@ +# Include C and Cython files +include **/*.c **/*.pyx + # Include tests into distribution recursive-include tests *.py *.txt diff --git a/setup.py b/setup.py index fe6a845d..637b739e 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,39 @@ -from setuptools import setup, find_packages +import os +from setuptools import setup, find_packages, Extension +try: + from Cython.Build import cythonize +except ImportError: + cythonize = None + + +# https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#distributing-cython-modules +def no_cythonize(extensions, **_ignore): + for extension in extensions: + sources = [] + for sfile in extension.sources: + path, ext = os.path.splitext(sfile) + if ext in (".pyx", ".py"): + if extension.language == "c++": + ext = ".cpp" + else: + ext = ".c" + sfile = path + ext + sources.append(sfile) + extension.sources[:] = sources + return extensions + +extensions = [ + Extension("w3lib._url", ["w3lib/_url.pyx"]), +] + +CYTHONIZE = bool(int(os.getenv("CYTHONIZE", 0))) and cythonize is not None + +if CYTHONIZE: + compiler_directives = {"language_level": 3, "embedsignature": True} + extensions = cythonize(extensions, compiler_directives=compiler_directives) +else: + extensions = no_cythonize(extensions) setup( name="w3lib", @@ -20,6 +54,7 @@ install_requires=[ "idna", ], + ext_modules=extensions, classifiers=[ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: BSD License", diff --git a/tests/test_url.py b/tests/test_url.py index 0bd5c179..d85eb46b 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -639,7 +639,7 @@ def test_safe_url_performance(url): # presummably due to caching by urllib. number = 1 # TODO: Increase? How much? # Make sure the new implementation is at most this number of times as slow. - multiplier = 40 # TODO: Lower as close to 1 as possible. + multiplier = 6 # TODO: Lower as close to 1 as possible. time1 = timeit( f"safe_url({url!r})", "from w3lib.url import safe_url", number=number diff --git a/w3lib/_url.c b/w3lib/_url.c new file mode 100644 index 00000000..b2216d84 --- /dev/null +++ b/w3lib/_url.c @@ -0,0 +1,31612 @@ +/* Generated by Cython 3.0.8 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "name": "w3lib._url", + "sources": [ + "w3lib/_url.pyx" + ] + }, + "module_name": "w3lib._url" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API +#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#else +#define __PYX_EXTRA_ABI_MODULE_NAME "" +#endif +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030008F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #ifdef Py_LIMITED_API + #undef __PYX_LIMITED_VERSION_HEX + #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API + #endif + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_USE_CPP_STD_MOVE + #if defined(__cplusplus) && (\ + __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) + #define CYTHON_USE_CPP_STD_MOVE 1 + #else + #define CYTHON_USE_CPP_STD_MOVE 0 + #endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #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 +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if CYTHON_COMPILING_IN_LIMITED_API + static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } + #ifndef CO_OPTIMIZED + #define CO_OPTIMIZED 0x0001 + #endif + #ifndef CO_NEWLOCALS + #define CO_NEWLOCALS 0x0002 + #endif + #ifndef CO_VARARGS + #define CO_VARARGS 0x0004 + #endif + #ifndef CO_VARKEYWORDS + #define CO_VARKEYWORDS 0x0008 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x0200 + #endif + #ifndef CO_GENERATOR + #define CO_GENERATOR 0x0020 + #endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x0080 + #endif +#elif PY_VERSION_HEX >= 0x030B0000 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); + if (!empty_bytes) return NULL; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); + Py_DECREF(empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_MAJOR_VERSION >= 0x030900B1 +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) +#else +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) +#endif +#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) +#elif !CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) +static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { + return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; +} +#endif +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API + return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; +#else + return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +#endif +} +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) +#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) +#else + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) +#endif +#if PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__w3lib___url +#define __PYX_HAVE_API__w3lib___url +/* Early includes */ +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#include +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#include +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "w3lib/_url.pyx", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* #### Code section: numeric_typedefs ### */ +/* #### Code section: complex_type_declarations ### */ +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ +struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr; +struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr; +struct __pyx_defaults; +typedef struct __pyx_defaults __pyx_defaults; +struct __pyx_defaults1; +typedef struct __pyx_defaults1 __pyx_defaults1; +struct __pyx_defaults { + PyObject *__pyx_arg_userinfo_percent_encode_set; + PyObject *__pyx_arg_path_percent_encode_set; + PyObject *__pyx_arg_query_percent_encode_set; + PyObject *__pyx_arg_special_query_percent_encode_set; + PyObject *__pyx_arg_fragment_percent_encode_set; +}; +struct __pyx_defaults1 { + PyObject *__pyx_arg_min_length; +}; + +/* "w3lib/_url.pyx":309 + * parts = parts[:-1] + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< + * return True + * try: + */ +struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr { + PyObject_HEAD + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_code_point; +}; + + +/* "w3lib/_url.pyx":329 + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): + */ +struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr { + PyObject_HEAD + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_item; +}; + +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#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 + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* TupleAndListFromArray.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* fastcall.proto */ +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#else + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) +#endif +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) + #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) +#else + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) +#endif +#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) +#define __Pyx_KwValues_VARARGS(args, nargs) NULL +#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) +#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) +#if CYTHON_METH_FASTCALL + #define __Pyx_Arg_FASTCALL(args, i) args[i] + #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) + static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + #else + #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) + #endif + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) +#else + #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS + #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS + #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS + #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS + #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) + #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* RaiseUnexpectedTypeError.proto */ +static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#if !CYTHON_VECTORCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if !CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03080000 + #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #define __Pxy_PyFrame_Initialize_Offsets() + #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) +#else + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif +#endif +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectFastCall.proto */ +#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); + +/* 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); + +/* RaiseKeywordRequired.proto */ +static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name); + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* PyIntCompare.proto */ +static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + +/* PyObjectFormat.proto */ +#if CYTHON_USE_UNICODE_WRITER +static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f); +#else +#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) +#endif + +/* AssertionsEnabled.proto */ +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define __Pyx_init_assertions_enabled() (0) + #define __pyx_assertions_enabled() (1) +#elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) + static int __pyx_assertions_enabled_flag; + #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) + static int __Pyx_init_assertions_enabled(void) { + PyObject *builtins, *debug, *debug_str; + int flag; + builtins = PyEval_GetBuiltins(); + if (!builtins) goto bad; + debug_str = PyUnicode_FromStringAndSize("__debug__", 9); + if (!debug_str) goto bad; + debug = PyObject_GetItem(builtins, debug_str); + Py_DECREF(debug_str); + if (!debug) goto bad; + flag = PyObject_IsTrue(debug); + Py_DECREF(debug); + if (flag == -1) goto bad; + __pyx_assertions_enabled_flag = flag; + return 0; + bad: + __pyx_assertions_enabled_flag = 1; + return -1; + } +#else + #define __Pyx_init_assertions_enabled() (0) + #define __pyx_assertions_enabled() (!Py_OptimizeFlag) +#endif + +/* PyIntCompare.proto */ +static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) +#endif + +/* unicode_iter.proto */ +static CYTHON_INLINE int __Pyx_init_unicode_iteration( + PyObject* ustring, Py_ssize_t *length, void** data, int *kind); + +/* PyUnicode_Substring.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring( + PyObject* text, Py_ssize_t start, Py_ssize_t stop); + +/* GetItemIntUnicode.proto */ +#define __Pyx_GetItemInt_Unicode(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Unicode_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "string index out of range"), (Py_UCS4)-1)) +static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i, + int wraparound, int boundscheck); + +/* RaiseUnboundLocalError.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* pep479.proto */ +static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + L->ob_item[len] = x; + #else + PyList_SET_ITEM(list, len, x); + #endif + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* SliceTupleAndList.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); +#else +#define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) +#define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) +#endif + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_SubtractCObj(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) +#endif + +/* PyObjectFormatAndDecref.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); + +/* JoinPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char); + +/* unicode_tailmatch.proto */ +static int __Pyx_PyUnicode_Tailmatch( + PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod1.proto */ +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + +/* PyUnicodeContains.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_ContainsTF(PyObject* substring, PyObject* text, int eq) { + int result = PyUnicode_Contains(text, substring); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* PyObjectCall2Args.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* append.proto */ +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); + +/* PyObject_Str.proto */ +#define __Pyx_PyObject_Str(obj)\ + (likely(PyString_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_RemainderObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2)) +#endif + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) +#endif + +/* UnicodeConcatInPlace.proto */ +# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_REFNANNY + #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) + #else + #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right) + #endif + static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right + #if CYTHON_REFNANNY + , void* __pyx_refnanny + #endif + ); +#else +#define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat +#endif +#define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right)) + +/* PyObjectFormatSimple.proto */ +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#elif PY_MAJOR_VERSION < 3 + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ + PyObject_Format(s, f)) +#elif CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\ + likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\ + PyObject_Format(s, f)) +#else + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#endif + +/* IncludeStructmemberH.proto */ +#include + +/* FixUpExtensionType.proto */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); +#endif + +/* PyObjectCallNoArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* ValidateBasesTuple.proto */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); +#endif + +/* PyType_Ready.proto */ +CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* 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); + +/* SetNameInClass.proto */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) +#elif CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) +#else +#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) +#endif + +/* FetchSharedCythonModule.proto */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); + +/* FetchCommonType.proto */ +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); +#else +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +#endif + +/* PyMethodNew.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + typesModule = PyImport_ImportModule("types"); + if (!typesModule) return NULL; + methodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + if (!methodType) return NULL; + result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); + Py_DECREF(methodType); + return result; +} +#elif PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#else + #define __Pyx_PyMethod_New PyMethod_New +#endif + +/* PyVectorcallFastCallDict.proto */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); +#endif + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CYFUNCTION_COROUTINE 0x08 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#else + #define __Pyx_CyFunction_GetClassObj(f)\ + ((PyObject*) ((PyCMethodObject *) (f))->mm_class) +#endif +#define __Pyx_CyFunction_SetClassObj(f, classobj)\ + __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject_HEAD + PyObject *func; +#elif PY_VERSION_HEX < 0x030900B1 + PyCFunctionObject func; +#else + PyCMethodObject func; +#endif +#if CYTHON_BACKPORT_VECTORCALL + __pyx_vectorcallfunc func_vectorcall; +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_classobj; +#endif + void *defaults; + int defaults_pyobjects; + size_t defaults_size; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; + PyObject *func_is_coroutine; +} __pyx_CyFunctionObject; +#undef __Pyx_CyOrPyCFunction_Check +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); +#undef __Pyx_IsSameCFunction +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(PyObject *module); +#if CYTHON_METH_FASTCALL +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#if CYTHON_BACKPORT_VECTORCALL +#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) +#else +#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) +#endif +#endif + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + +/* CalculateMetaclass.proto */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +/* PyObjectLookupSpecial.proto */ +#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) +#define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) +static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); +#else +#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +/* Py3ClassCreate.proto */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); + +/* CLineInTraceback.proto */ +#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 */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* PyUCS4InUnicode.proto */ +static CYTHON_INLINE int __Pyx_UnicodeContainsUCS4(PyObject* unicode, 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 *); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* CoroutineBase.proto */ +struct __pyx_CoroutineObject; +typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_ExcInfoStruct _PyErr_StackItem +#else +typedef struct { + PyObject *exc_type; + PyObject *exc_value; + PyObject *exc_traceback; +} __Pyx_ExcInfoStruct; +#endif +typedef struct __pyx_CoroutineObject { + PyObject_HEAD + __pyx_coroutine_body_t body; + PyObject *closure; + __Pyx_ExcInfoStruct gi_exc_state; + PyObject *gi_weakreflist; + PyObject *classobj; + PyObject *yieldfrom; + PyObject *gi_name; + PyObject *gi_qualname; + PyObject *gi_modulename; + PyObject *gi_code; + PyObject *gi_frame; + int resume_label; + char is_running; +} __pyx_CoroutineObject; +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); +static int __Pyx_Coroutine_clear(PyObject *self); +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); +static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_Coroutine_SwapException(self) +#define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) +#else +#define __Pyx_Coroutine_SwapException(self) {\ + __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ + __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ + } +#define __Pyx_Coroutine_ResetAndClearException(self) {\ + __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ + (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ + } +#endif +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) +#endif +static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); + +/* PatchModuleWithCoroutine.proto */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); + +/* PatchGeneratorABC.proto */ +static int __Pyx_patch_abc(void); + +/* Generator.proto */ +#define __Pyx_Generator_USED +#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) +#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ + __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) +static PyObject *__Pyx_Generator_Next(PyObject *self); +static int __pyx_Generator_init(PyObject *module); + +/* CheckBinaryVersion.proto */ +static unsigned long __Pyx_get_runtime_version(void); +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ + +/* Module declarations from "w3lib._url" */ +static PyObject *__pyx_7genexpr__pyx_v_5w3lib_4_url_char; +/* #### Code section: typeinfo ### */ +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "w3lib._url" +extern int __pyx_module_is_main_w3lib___url; +int __pyx_module_is_main_w3lib___url = 0; + +/* Implementation of "w3lib._url" */ +/* #### Code section: global_var ### */ +static PyObject *__pyx_builtin_property; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_chr; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_AssertionError; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_builtin_enumerate; +/* #### Code section: string_decls ### */ +static const char __pyx_k_c[] = "c"; +static const char __pyx_k_i[] = "i"; +static const char __pyx_k_n[] = "n"; +static const char __pyx_k_r[] = "r"; +static const char __pyx_k_x[] = "x"; +static const char __pyx_k_0X[] = "0X"; +static const char __pyx_k_0x[] = "0x"; +static const char __pyx_k_25[] = "%25"; +static const char __pyx_k_2E[] = ".%2E"; +static const char __pyx_k_2e[] = ".%2e"; +static const char __pyx_k_40[] = "%40"; +static const char __pyx_k__2[] = ""; +static const char __pyx_k__3[] = "+"; +static const char __pyx_k__4[] = "%"; +static const char __pyx_k__5[] = ":"; +static const char __pyx_k__6[] = "."; +static const char __pyx_k__8[] = "["; +static const char __pyx_k__9[] = "]"; +static const char __pyx_k_gc[] = "gc"; +static const char __pyx_k_ws[] = "ws"; +static const char __pyx_k_02X[] = "02X"; +static const char __pyx_k_URL[] = "_URL"; +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__14[] = "?"; +static const char __pyx_k__15[] = "/\\"; +static const char __pyx_k__16[] = "@"; +static const char __pyx_k__17[] = "/?#"; +static const char __pyx_k__18[] = "/\\?#"; +static const char __pyx_k__19[] = "?#"; +static const char __pyx_k__21[] = "::"; +static const char __pyx_k__22[] = "//"; +static const char __pyx_k__23[] = "/."; +static const char __pyx_k__30[] = "+-."; +static const char __pyx_k__33[] = "_"; +static const char __pyx_k__36[] = "~"; +static const char __pyx_k__37[] = " \"<>`"; +static const char __pyx_k__38[] = " \"#<>"; +static const char __pyx_k__39[] = "'"; +static const char __pyx_k__40[] = "?`{}"; +static const char __pyx_k__41[] = "/:;=@[\\]^|"; +static const char __pyx_k__42[] = "\000\t\n\r #/:<>?@[\\]^|"; +static const char __pyx_k__43[] = "%"; +static const char __pyx_k_chr[] = "chr"; +static const char __pyx_k_doc[] = "__doc__"; +static const char __pyx_k_ftp[] = "ftp"; +static const char __pyx_k_get[] = "get"; +static const char __pyx_k_int[] = "int"; +static const char __pyx_k_str[] = "str"; +static const char __pyx_k_url[] = "url"; +static const char __pyx_k_wss[] = "wss"; +static const char __pyx_k_2E_2[] = "%2E."; +static const char __pyx_k_2E_3[] = "%2E"; +static const char __pyx_k_2e_2[] = "%2e."; +static const char __pyx_k_2e_3[] = "%2e"; +static const char __pyx_k_FILE[] = "FILE"; +static const char __pyx_k_HOST[] = "HOST"; +static const char __pyx_k_List[] = "List"; +static const char __pyx_k_None[] = "None"; +static const char __pyx_k_PATH[] = "PATH"; +static const char __pyx_k_PORT[] = "PORT"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_base[] = "base"; +static const char __pyx_k_bool[] = "bool"; +static const char __pyx_k_byte[] = "byte"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_file[] = "file"; +static const char __pyx_k_host[] = "host"; +static const char __pyx_k_http[] = "http"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_ipv4[] = "ipv4"; +static const char __pyx_k_keys[] = "keys"; +static const char __pyx_k_last[] = "last"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_math[] = "math"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_part[] = "part"; +static const char __pyx_k_path[] = "path"; +static const char __pyx_k_port[] = "port"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_send[] = "send"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_util[] = "_util"; +static const char __pyx_k_2E_2E[] = "%2E%2E"; +static const char __pyx_k_2E_2e[] = "%2E%2e"; +static const char __pyx_k_2e_2E[] = "%2e%2E"; +static const char __pyx_k_2e_2e[] = "%2e%2e"; +static const char __pyx_k_QUERY[] = "QUERY"; +static const char __pyx_k_Tuple[] = "Tuple"; +static const char __pyx_k_Union[] = "Union"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_floor[] = "floor"; +static const char __pyx_k_https[] = "https"; +static const char __pyx_k_index[] = "index"; +static const char __pyx_k_infra[] = "_infra"; +static const char __pyx_k_input[] = "input"; +static const char __pyx_k_lower[] = "lower"; +static const char __pyx_k_parts[] = "parts"; +static const char __pyx_k_piece[] = "piece"; +static const char __pyx_k_query[] = "query"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_state[] = "state"; +static const char __pyx_k_strip[] = "strip"; +static const char __pyx_k_super[] = "super"; +static const char __pyx_k_swaps[] = "swaps"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_utf_8[] = "utf-8"; +static const char __pyx_k_utr46[] = "_utr46"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_SCHEME[] = "SCHEME"; +static const char __pyx_k_append[] = "append"; +static const char __pyx_k_buffer[] = "buffer"; +static const char __pyx_k_domain[] = "domain"; +static const char __pyx_k_enable[] = "enable"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_length[] = "length"; +static const char __pyx_k_module[] = "__module__"; +static const char __pyx_k_number[] = "number"; +static const char __pyx_k_output[] = "output"; +static const char __pyx_k_result[] = "result"; +static const char __pyx_k_return[] = "return"; +static const char __pyx_k_scheme[] = "_scheme"; +static const char __pyx_k_setter[] = "setter"; +static const char __pyx_k_typing[] = "typing"; +static const char __pyx_k_address[] = "address"; +static const char __pyx_k_counter[] = "counter"; +static const char __pyx_k_disable[] = "disable"; +static const char __pyx_k_encoded[] = "encoded"; +static const char __pyx_k_encoder[] = "encoder"; +static const char __pyx_k_genexpr[] = "genexpr"; +static const char __pyx_k_ignore0[] = "ignore0"; +static const char __pyx_k_numbers[] = "numbers"; +static const char __pyx_k_pointer[] = "pointer"; +static const char __pyx_k_prepare[] = "__prepare__"; +static const char __pyx_k_segment[] = "segment"; +static const char __pyx_k_unquote[] = "unquote"; +static const char __pyx_k_FRAGMENT[] = "FRAGMENT"; +static const char __pyx_k_List_int[] = "List[int]"; +static const char __pyx_k_Optional[] = "Optional"; +static const char __pyx_k_RELATIVE[] = "RELATIVE"; +static const char __pyx_k_base_url[] = "base_url"; +static const char __pyx_k_compress[] = "compress"; +static const char __pyx_k_encoding[] = "encoding"; +static const char __pyx_k_fragment[] = "fragment"; +static const char __pyx_k_hostname[] = "hostname"; +static const char __pyx_k_isomorph[] = "isomorph"; +static const char __pyx_k_password[] = "password"; +static const char __pyx_k_property[] = "property"; +static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_scheme_2[] = "scheme"; +static const char __pyx_k_set_name[] = "__set_name__"; +static const char __pyx_k_to_ascii[] = "_to_ascii"; +static const char __pyx_k_username[] = "username"; +static const char __pyx_k_AUTHORITY[] = "AUTHORITY"; +static const char __pyx_k_FILE_HOST[] = "FILE_HOST"; +static const char __pyx_k_NO_SCHEME[] = "NO_SCHEME"; +static const char __pyx_k_be_strict[] = "be_strict"; +static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_isenabled[] = "isenabled"; +static const char __pyx_k_localhost[] = "localhost"; +static const char __pyx_k_metaclass[] = "__metaclass__"; +static const char __pyx_k_parse_url[] = "_parse_url"; +static const char __pyx_k_separator[] = "separator"; +static const char __pyx_k_translate[] = "translate"; +static const char __pyx_k_C0_CONTROL[] = "_C0_CONTROL"; +static const char __pyx_k_FILE_SLASH[] = "FILE_SLASH"; +static const char __pyx_k_IndexError[] = "IndexError"; +static const char __pyx_k_PATH_START[] = "PATH_START"; +static const char __pyx_k_URL___init[] = "_URL.__init__"; +static const char __pyx_k_URL_scheme[] = "_URL.scheme"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_check_bidi[] = "check_bidi"; +static const char __pyx_k_code_point[] = "code_point"; +static const char __pyx_k_encode_set[] = "encode_set"; +static const char __pyx_k_encoding_2[] = "_encoding"; +static const char __pyx_k_ipv4_piece[] = "ipv4_piece"; +static const char __pyx_k_is_special[] = "is_special"; +static const char __pyx_k_min_length[] = "min_length"; +static const char __pyx_k_parse_host[] = "_parse_host"; +static const char __pyx_k_parse_ipv4[] = "_parse_ipv4"; +static const char __pyx_k_parse_ipv6[] = "_parse_ipv6"; +static const char __pyx_k_w3lib__url[] = "w3lib._url"; +static const char __pyx_k_ASCII_ALPHA[] = "_ASCII_ALPHA"; +static const char __pyx_k_ASCII_DIGIT[] = "_ASCII_DIGIT"; +static const char __pyx_k_Domain_name[] = "Domain name "; +static const char __pyx_k_OPAQUE_PATH[] = "OPAQUE_PATH"; +static const char __pyx_k_annotations[] = "__annotations__"; +static const char __pyx_k_get_encoder[] = "_get_encoder"; +static const char __pyx_k_piece_index[] = "piece_index"; +static const char __pyx_k_Optional_int[] = "Optional[int]"; +static const char __pyx_k_Optional_str[] = "Optional[str]"; +static const char __pyx_k_SCHEME_CHARS[] = "_SCHEME_CHARS"; +static const char __pyx_k_SCHEME_START[] = "SCHEME_START"; +static const char __pyx_k_ascii_domain[] = "ascii_domain"; +static const char __pyx_k_at_sign_seen[] = "at_sign_seen"; +static const char __pyx_k_canonicalize[] = "canonicalize"; +static const char __pyx_k_greater_than[] = "greater_than"; +static const char __pyx_k_index_length[] = "index_length"; +static const char __pyx_k_input_lenght[] = "input_lenght"; +static const char __pyx_k_input_length[] = "input_length"; +static const char __pyx_k_is_coroutine[] = "_is_coroutine"; +static const char __pyx_k_numbers_seen[] = "numbers_seen"; +static const char __pyx_k_shorten_path[] = "_shorten_path"; +static const char __pyx_k_urllib_parse[] = "urllib.parse"; +static const char __pyx_k_DEFAULT_PORTS[] = "_DEFAULT_PORTS"; +static const char __pyx_k_Optional_bool[] = "Optional[bool]"; +static const char __pyx_k_at_sign_index[] = "at_sign_index"; +static const char __pyx_k_check_hyphens[] = "check_hyphens"; +static const char __pyx_k_check_joiners[] = "check_joiners"; +static const char __pyx_k_class_getitem[] = "__class_getitem__"; +static const char __pyx_k_current_index[] = "current_index"; +static const char __pyx_k_encode_output[] = "encode_output"; +static const char __pyx_k_init_subclass[] = "__init_subclass__"; +static const char __pyx_k_serialize_url[] = "_serialize_url"; +static const char __pyx_k_space_as_plus[] = "space_as_plus"; +static const char __pyx_k_AssertionError[] = "AssertionError"; +static const char __pyx_k_RELATIVE_SLASH[] = "RELATIVE_SLASH"; +static const char __pyx_k_Tuple_int_bool[] = "Tuple[int, bool]"; +static const char __pyx_k_current_length[] = "current_length"; +static const char __pyx_k_ends_in_number[] = "_ends_in_number"; +static const char __pyx_k_serialize_host[] = "_serialize_host"; +static const char __pyx_k_serialize_ipv4[] = "_serialize_ipv4"; +static const char __pyx_k_serialize_ipv6[] = "_serialize_ipv6"; +static const char __pyx_k_w3lib__url_pyx[] = "w3lib/_url.pyx"; +static const char __pyx_k_ASCII_HEX_DIGIT[] = "_ASCII_HEX_DIGIT"; +static const char __pyx_k_SPECIAL_SCHEMES[] = "_SPECIAL_SCHEMES"; +static const char __pyx_k_domain_to_ascii[] = "_domain_to_ascii"; +static const char __pyx_k_has_opaque_path[] = "has_opaque_path"; +static const char __pyx_k_inside_brackets[] = "inside_brackets"; +static const char __pyx_k_path_token_seen[] = "_path_token_seen"; +static const char __pyx_k_port_token_seen[] = "_port_token_seen"; +static const char __pyx_k_PercentEncodeSet[] = "_PercentEncodeSet"; +static const char __pyx_k_exclude_fragment[] = "exclude_fragment"; +static const char __pyx_k_validation_error[] = "validation_error"; +static const char __pyx_k_PATH_OR_AUTHORITY[] = "PATH_OR_AUTHORITY"; +static const char __pyx_k_default_port_seen[] = "_default_port_seen"; +static const char __pyx_k_parse_ipv4_number[] = "_parse_ipv4_number"; +static const char __pyx_k_parse_opaque_host[] = "_parse_opaque_host"; +static const char __pyx_k_verify_dns_length[] = "verify_dns_length"; +static const char __pyx_k_xmlcharrefreplace[] = "xmlcharrefreplace"; +static const char __pyx_k_ASCII_ALPHANUMERIC[] = "_ASCII_ALPHANUMERIC"; +static const char __pyx_k_Union_str_List_str[] = "Union[str, List[str]]"; +static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_percent_encode_set[] = "percent_encode_set"; +static const char __pyx_k_serialize_url_path[] = "_serialize_url_path"; +static const char __pyx_k_C0_CONTROL_OR_SPACE[] = "_C0_CONTROL_OR_SPACE"; +static const char __pyx_k_URL_has_opaque_path[] = "_URL.has_opaque_path"; +static const char __pyx_k_encoded_code_points[] = "encoded_code_points"; +static const char __pyx_k_get_output_encoding[] = "_get_output_encoding"; +static const char __pyx_k_password_token_seen[] = "_password_token_seen"; +static const char __pyx_k_ASCII_TAB_OR_NEWLINE[] = "_ASCII_TAB_OR_NEWLINE"; +static const char __pyx_k_use_std3_ascii_rules[] = "use_std3_ascii_rules"; +static const char __pyx_k_utf_8_percent_encode[] = "_utf_8_percent_encode"; +static const char __pyx_k_Union_int_List_int_str[] = "Union[int, List[int], str]"; +static const char __pyx_k_Union_str_int_List_int[] = "Union[str, int, List[int]]"; +static const char __pyx_k_PATH_PERCENT_ENCODE_SET[] = "_PATH_PERCENT_ENCODE_SET"; +static const char __pyx_k_is_windows_drive_letter[] = "_is_windows_drive_letter"; +static const char __pyx_k_path_percent_encode_set[] = "path_percent_encode_set"; +static const char __pyx_k_skip_authority_shortcut[] = "skip_authority_shortcut"; +static const char __pyx_k_transitional_processing[] = "transitional_processing"; +static const char __pyx_k_QUERY_PERCENT_ENCODE_SET[] = "_QUERY_PERCENT_ENCODE_SET"; +static const char __pyx_k_query_percent_encode_set[] = "query_percent_encode_set"; +static const char __pyx_k_SPECIAL_AUTHORITY_SLASHES[] = "SPECIAL_AUTHORITY_SLASHES"; +static const char __pyx_k_parse_ipv4_locals_genexpr[] = "_parse_ipv4..genexpr"; +static const char __pyx_k_FORBIDDEN_HOST_CODE_POINTS[] = "_FORBIDDEN_HOST_CODE_POINTS"; +static const char __pyx_k_is_double_dot_path_segment[] = "_is_double_dot_path_segment"; +static const char __pyx_k_is_single_dot_path_segment[] = "_is_single_dot_path_segment"; +static const char __pyx_k_FRAGMENT_PERCENT_ENCODE_SET[] = "_FRAGMENT_PERCENT_ENCODE_SET"; +static const char __pyx_k_USERINFO_PERCENT_ENCODE_SET[] = "_USERINFO_PERCENT_ENCODE_SET"; +static const char __pyx_k_fragment_percent_encode_set[] = "fragment_percent_encode_set"; +static const char __pyx_k_userinfo_percent_encode_set[] = "userinfo_percent_encode_set"; +static const char __pyx_k_FORBIDDEN_DOMAIN_CODE_POINTS[] = "_FORBIDDEN_DOMAIN_CODE_POINTS"; +static const char __pyx_k_C0_CONTROL_PERCENT_ENCODE_SET[] = "_C0_CONTROL_PERCENT_ENCODE_SET"; +static const char __pyx_k_SPECIAL_RELATIVE_OR_AUTHORITY[] = "SPECIAL_RELATIVE_OR_AUTHORITY"; +static const char __pyx_k_ends_in_number_locals_genexpr[] = "_ends_in_number..genexpr"; +static const char __pyx_k_percent_encode_after_encoding[] = "_percent_encode_after_encoding"; +static const char __pyx_k_get_ipv6_first_longest_0_piece[] = "_get_ipv6_first_longest_0_piece_index"; +static const char __pyx_k_ASCII_TAB_OR_NEWLINE_TRANSLATIO[] = "_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE"; +static const char __pyx_k_SPECIAL_QUERY_PERCENT_ENCODE_SE[] = "_SPECIAL_QUERY_PERCENT_ENCODE_SET"; +static const char __pyx_k_idempotent_utf_8_percent_encode[] = "_idempotent_utf_8_percent_encode"; +static const char __pyx_k_is_an_empty_string_after_conver[] = " is an empty string after conversion to ASCII, which makes for an invalid domain name."; +static const char __pyx_k_starts_with_windows_drive_lette[] = "_starts_with_windows_drive_letter"; +static const char __pyx_k_SPECIAL_AUTHORITY_IGNORE_SLASHES[] = "SPECIAL_AUTHORITY_IGNORE_SLASHES"; +static const char __pyx_k_special_query_percent_encode_set[] = "special_query_percent_encode_set"; +/* #### Code section: decls ### */ +static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_4_URL_4scheme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_4_URL_6scheme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url__shorten_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set, PyObject *__pyx_v_space_as_plus); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_6_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_8_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_16_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, PyObject *__pyx_v_be_strict); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_is_special); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_20_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_24_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_26_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_44__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_base_url, PyObject *__pyx_v_encoding, PyObject *__pyx_v_userinfo_percent_encode_set, PyObject *__pyx_v_path_percent_encode_set, PyObject *__pyx_v_query_percent_encode_set, PyObject *__pyx_v_special_query_percent_encode_set, PyObject *__pyx_v_fragment_percent_encode_set); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_32_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_46__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_canonicalize); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_exclude_fragment, PyObject *__pyx_v_canonicalize); /* proto */ +static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_strip = {0, 0, 0, 0, 0}; +static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_translate = {0, 0, 0, 0, 0}; +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + PyObject *__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr; + PyObject *__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr; + #endif + PyTypeObject *__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr; + PyTypeObject *__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr; + PyObject *__pyx_kp_u_02X; + PyObject *__pyx_kp_u_0X; + PyObject *__pyx_kp_u_0x; + PyObject *__pyx_kp_u_25; + PyObject *__pyx_kp_u_2E; + PyObject *__pyx_kp_u_2E_2; + PyObject *__pyx_kp_u_2E_2E; + PyObject *__pyx_kp_u_2E_2e; + PyObject *__pyx_kp_u_2E_3; + PyObject *__pyx_kp_u_2e; + PyObject *__pyx_kp_u_2e_2; + PyObject *__pyx_kp_u_2e_2E; + PyObject *__pyx_kp_u_2e_2e; + PyObject *__pyx_kp_u_2e_3; + PyObject *__pyx_kp_u_40; + PyObject *__pyx_n_s_ASCII_ALPHA; + PyObject *__pyx_n_s_ASCII_ALPHANUMERIC; + PyObject *__pyx_n_s_ASCII_DIGIT; + PyObject *__pyx_n_s_ASCII_HEX_DIGIT; + PyObject *__pyx_n_s_ASCII_TAB_OR_NEWLINE; + PyObject *__pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO; + PyObject *__pyx_n_s_AUTHORITY; + PyObject *__pyx_n_s_AssertionError; + PyObject *__pyx_n_s_C0_CONTROL; + PyObject *__pyx_n_s_C0_CONTROL_OR_SPACE; + PyObject *__pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_DEFAULT_PORTS; + PyObject *__pyx_kp_u_Domain_name; + PyObject *__pyx_n_s_FILE; + PyObject *__pyx_n_s_FILE_HOST; + PyObject *__pyx_n_s_FILE_SLASH; + PyObject *__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS; + PyObject *__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS; + PyObject *__pyx_n_s_FRAGMENT; + PyObject *__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_HOST; + PyObject *__pyx_n_s_IndexError; + PyObject *__pyx_n_s_List; + PyObject *__pyx_kp_s_List_int; + PyObject *__pyx_n_s_NO_SCHEME; + PyObject *__pyx_n_s_None; + PyObject *__pyx_n_s_OPAQUE_PATH; + PyObject *__pyx_n_s_Optional; + PyObject *__pyx_kp_s_Optional_bool; + PyObject *__pyx_kp_s_Optional_int; + PyObject *__pyx_kp_s_Optional_str; + PyObject *__pyx_n_s_PATH; + PyObject *__pyx_n_s_PATH_OR_AUTHORITY; + PyObject *__pyx_n_s_PATH_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_PATH_START; + PyObject *__pyx_n_s_PORT; + PyObject *__pyx_n_s_PercentEncodeSet; + PyObject *__pyx_n_s_QUERY; + PyObject *__pyx_n_s_QUERY_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_RELATIVE; + PyObject *__pyx_n_s_RELATIVE_SLASH; + PyObject *__pyx_n_s_SCHEME; + PyObject *__pyx_n_s_SCHEME_CHARS; + PyObject *__pyx_n_s_SCHEME_START; + PyObject *__pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES; + PyObject *__pyx_n_s_SPECIAL_AUTHORITY_SLASHES; + PyObject *__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE; + PyObject *__pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY; + PyObject *__pyx_n_s_SPECIAL_SCHEMES; + PyObject *__pyx_n_s_Tuple; + PyObject *__pyx_kp_s_Tuple_int_bool; + PyObject *__pyx_n_s_URL; + PyObject *__pyx_n_s_URL___init; + PyObject *__pyx_n_s_URL_has_opaque_path; + PyObject *__pyx_n_s_URL_scheme; + PyObject *__pyx_n_s_USERINFO_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_Union; + PyObject *__pyx_kp_s_Union_int_List_int_str; + PyObject *__pyx_kp_s_Union_str_List_str; + PyObject *__pyx_kp_s_Union_str_int_List_int; + PyObject *__pyx_n_s_ValueError; + PyObject *__pyx_kp_u__10; + PyObject *__pyx_kp_u__11; + PyObject *__pyx_kp_u__12; + PyObject *__pyx_kp_u__13; + PyObject *__pyx_n_s__14; + PyObject *__pyx_kp_u__14; + PyObject *__pyx_kp_u__15; + PyObject *__pyx_kp_u__16; + PyObject *__pyx_kp_u__17; + PyObject *__pyx_kp_u__18; + PyObject *__pyx_kp_u__19; + PyObject *__pyx_n_s__2; + PyObject *__pyx_kp_u__2; + PyObject *__pyx_kp_u__21; + PyObject *__pyx_kp_u__22; + PyObject *__pyx_kp_u__23; + PyObject *__pyx_kp_u__3; + PyObject *__pyx_kp_u__30; + PyObject *__pyx_n_s__33; + PyObject *__pyx_kp_u__36; + PyObject *__pyx_kp_u__37; + PyObject *__pyx_kp_u__38; + PyObject *__pyx_kp_u__39; + PyObject *__pyx_kp_u__4; + PyObject *__pyx_kp_u__40; + PyObject *__pyx_kp_u__41; + PyObject *__pyx_kp_u__42; + PyObject *__pyx_kp_u__43; + PyObject *__pyx_kp_u__5; + PyObject *__pyx_kp_u__6; + PyObject *__pyx_kp_u__8; + PyObject *__pyx_kp_u__9; + PyObject *__pyx_n_s_address; + PyObject *__pyx_n_s_annotations; + PyObject *__pyx_n_s_append; + PyObject *__pyx_n_s_args; + PyObject *__pyx_n_s_ascii_domain; + PyObject *__pyx_n_s_asyncio_coroutines; + PyObject *__pyx_n_s_at_sign_index; + PyObject *__pyx_n_s_at_sign_seen; + PyObject *__pyx_n_s_base; + PyObject *__pyx_n_s_base_url; + PyObject *__pyx_n_s_be_strict; + PyObject *__pyx_n_s_bool; + PyObject *__pyx_n_s_buffer; + PyObject *__pyx_n_s_byte; + PyObject *__pyx_n_s_c; + PyObject *__pyx_n_s_canonicalize; + PyObject *__pyx_n_s_check_bidi; + PyObject *__pyx_n_s_check_hyphens; + PyObject *__pyx_n_s_check_joiners; + PyObject *__pyx_n_s_chr; + PyObject *__pyx_n_s_class_getitem; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_close; + PyObject *__pyx_n_s_code_point; + PyObject *__pyx_n_s_compress; + PyObject *__pyx_n_s_counter; + PyObject *__pyx_n_s_current_index; + PyObject *__pyx_n_s_current_length; + PyObject *__pyx_n_s_default_port_seen; + PyObject *__pyx_n_s_dict; + PyObject *__pyx_kp_u_disable; + PyObject *__pyx_n_s_doc; + PyObject *__pyx_n_s_domain; + PyObject *__pyx_n_s_domain_to_ascii; + PyObject *__pyx_kp_u_enable; + PyObject *__pyx_n_s_encode_output; + PyObject *__pyx_n_s_encode_set; + PyObject *__pyx_n_s_encoded; + PyObject *__pyx_n_s_encoded_code_points; + PyObject *__pyx_n_s_encoder; + PyObject *__pyx_n_s_encoding; + PyObject *__pyx_n_s_encoding_2; + PyObject *__pyx_n_s_ends_in_number; + PyObject *__pyx_n_s_ends_in_number_locals_genexpr; + PyObject *__pyx_n_s_enumerate; + PyObject *__pyx_n_s_exclude_fragment; + PyObject *__pyx_n_u_file; + PyObject *__pyx_n_s_floor; + PyObject *__pyx_n_s_fragment; + PyObject *__pyx_n_s_fragment_percent_encode_set; + PyObject *__pyx_n_u_ftp; + PyObject *__pyx_kp_u_gc; + PyObject *__pyx_n_s_genexpr; + PyObject *__pyx_n_s_get; + PyObject *__pyx_n_s_get_encoder; + PyObject *__pyx_n_s_get_ipv6_first_longest_0_piece; + PyObject *__pyx_n_s_get_output_encoding; + PyObject *__pyx_n_s_greater_than; + PyObject *__pyx_n_s_has_opaque_path; + PyObject *__pyx_n_s_host; + PyObject *__pyx_n_s_hostname; + PyObject *__pyx_n_u_http; + PyObject *__pyx_n_u_https; + PyObject *__pyx_n_s_i; + PyObject *__pyx_n_s_idempotent_utf_8_percent_encode; + PyObject *__pyx_n_s_ignore0; + PyObject *__pyx_n_s_import; + PyObject *__pyx_n_s_index; + PyObject *__pyx_n_s_index_length; + PyObject *__pyx_n_s_infra; + PyObject *__pyx_n_s_init; + PyObject *__pyx_n_s_init_subclass; + PyObject *__pyx_n_s_input; + PyObject *__pyx_n_s_input_lenght; + PyObject *__pyx_n_s_input_length; + PyObject *__pyx_n_s_inside_brackets; + PyObject *__pyx_n_s_int; + PyObject *__pyx_n_s_ipv4; + PyObject *__pyx_n_s_ipv4_piece; + PyObject *__pyx_kp_u_is_an_empty_string_after_conver; + PyObject *__pyx_n_s_is_coroutine; + PyObject *__pyx_n_s_is_double_dot_path_segment; + PyObject *__pyx_n_s_is_single_dot_path_segment; + PyObject *__pyx_n_s_is_special; + PyObject *__pyx_n_s_is_windows_drive_letter; + PyObject *__pyx_kp_u_isenabled; + PyObject *__pyx_n_s_isomorph; + PyObject *__pyx_n_s_keys; + PyObject *__pyx_n_s_last; + PyObject *__pyx_n_s_length; + PyObject *__pyx_n_u_localhost; + PyObject *__pyx_n_s_lower; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_math; + PyObject *__pyx_n_s_metaclass; + PyObject *__pyx_n_s_min_length; + PyObject *__pyx_n_s_module; + PyObject *__pyx_n_s_n; + PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_number; + PyObject *__pyx_n_s_numbers; + PyObject *__pyx_n_s_numbers_seen; + PyObject *__pyx_n_s_output; + PyObject *__pyx_n_s_parse_host; + PyObject *__pyx_n_s_parse_ipv4; + PyObject *__pyx_n_s_parse_ipv4_locals_genexpr; + PyObject *__pyx_n_s_parse_ipv4_number; + PyObject *__pyx_n_s_parse_ipv6; + PyObject *__pyx_n_s_parse_opaque_host; + PyObject *__pyx_n_s_parse_url; + PyObject *__pyx_n_s_part; + PyObject *__pyx_n_s_parts; + PyObject *__pyx_n_s_password; + PyObject *__pyx_n_s_password_token_seen; + PyObject *__pyx_n_s_path; + PyObject *__pyx_n_s_path_percent_encode_set; + PyObject *__pyx_n_s_path_token_seen; + PyObject *__pyx_n_s_percent_encode_after_encoding; + PyObject *__pyx_n_s_percent_encode_set; + PyObject *__pyx_n_s_piece; + PyObject *__pyx_n_s_piece_index; + PyObject *__pyx_n_s_pointer; + PyObject *__pyx_n_s_port; + PyObject *__pyx_n_s_port_token_seen; + PyObject *__pyx_n_s_prepare; + PyObject *__pyx_n_s_property; + PyObject *__pyx_n_s_qualname; + PyObject *__pyx_n_s_query; + PyObject *__pyx_n_s_query_percent_encode_set; + PyObject *__pyx_n_s_r; + PyObject *__pyx_n_s_range; + PyObject *__pyx_n_s_result; + PyObject *__pyx_n_s_return; + PyObject *__pyx_n_s_scheme; + PyObject *__pyx_n_s_scheme_2; + PyObject *__pyx_n_s_segment; + PyObject *__pyx_n_s_self; + PyObject *__pyx_n_s_send; + PyObject *__pyx_n_s_separator; + PyObject *__pyx_n_s_serialize_host; + PyObject *__pyx_n_s_serialize_ipv4; + PyObject *__pyx_n_s_serialize_ipv6; + PyObject *__pyx_n_s_serialize_url; + PyObject *__pyx_n_s_serialize_url_path; + PyObject *__pyx_n_s_set_name; + PyObject *__pyx_n_s_setter; + PyObject *__pyx_n_s_shorten_path; + PyObject *__pyx_n_s_skip_authority_shortcut; + PyObject *__pyx_n_s_space_as_plus; + PyObject *__pyx_n_s_special_query_percent_encode_set; + PyObject *__pyx_n_s_starts_with_windows_drive_lette; + PyObject *__pyx_n_s_state; + PyObject *__pyx_n_s_str; + PyObject *__pyx_n_s_strip; + PyObject *__pyx_n_s_super; + PyObject *__pyx_n_s_swaps; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_throw; + PyObject *__pyx_n_s_to_ascii; + PyObject *__pyx_n_s_transitional_processing; + PyObject *__pyx_n_s_translate; + PyObject *__pyx_n_s_typing; + PyObject *__pyx_n_s_unquote; + PyObject *__pyx_n_s_url; + PyObject *__pyx_n_s_urllib_parse; + PyObject *__pyx_n_s_use_std3_ascii_rules; + PyObject *__pyx_n_s_userinfo_percent_encode_set; + PyObject *__pyx_n_s_username; + PyObject *__pyx_kp_u_utf_8; + PyObject *__pyx_n_s_utf_8_percent_encode; + PyObject *__pyx_n_s_util; + PyObject *__pyx_n_s_utr46; + PyObject *__pyx_n_s_validation_error; + PyObject *__pyx_n_s_value; + PyObject *__pyx_n_s_verify_dns_length; + PyObject *__pyx_n_s_w3lib__url; + PyObject *__pyx_kp_s_w3lib__url_pyx; + PyObject *__pyx_n_u_ws; + PyObject *__pyx_n_u_wss; + PyObject *__pyx_n_u_x; + PyObject *__pyx_n_u_xmlcharrefreplace; + PyObject *__pyx_int_0; + PyObject *__pyx_int_1; + PyObject *__pyx_int_2; + PyObject *__pyx_int_3; + PyObject *__pyx_int_4; + PyObject *__pyx_int_5; + PyObject *__pyx_int_6; + PyObject *__pyx_int_7; + PyObject *__pyx_int_8; + PyObject *__pyx_int_9; + PyObject *__pyx_int_10; + PyObject *__pyx_int_11; + PyObject *__pyx_int_12; + PyObject *__pyx_int_13; + PyObject *__pyx_int_14; + PyObject *__pyx_int_15; + PyObject *__pyx_int_16; + PyObject *__pyx_int_17; + PyObject *__pyx_int_18; + PyObject *__pyx_int_19; + PyObject *__pyx_int_21; + PyObject *__pyx_int_32; + PyObject *__pyx_int_80; + PyObject *__pyx_int_255; + PyObject *__pyx_int_256; + PyObject *__pyx_int_443; + PyObject *__pyx_int_65535; + PyObject *__pyx_int_neg_1; + PyObject *__pyx_slice_; + PyObject *__pyx_tuple__7; + PyObject *__pyx_slice__20; + PyObject *__pyx_tuple__24; + PyObject *__pyx_tuple__28; + PyObject *__pyx_tuple__31; + PyObject *__pyx_tuple__34; + PyObject *__pyx_tuple__44; + PyObject *__pyx_tuple__46; + PyObject *__pyx_tuple__48; + PyObject *__pyx_tuple__50; + PyObject *__pyx_tuple__52; + PyObject *__pyx_tuple__54; + PyObject *__pyx_tuple__56; + PyObject *__pyx_tuple__58; + PyObject *__pyx_tuple__60; + PyObject *__pyx_tuple__62; + PyObject *__pyx_tuple__66; + PyObject *__pyx_tuple__68; + PyObject *__pyx_tuple__70; + PyObject *__pyx_tuple__72; + PyObject *__pyx_tuple__74; + PyObject *__pyx_tuple__76; + PyObject *__pyx_tuple__78; + PyObject *__pyx_tuple__80; + PyObject *__pyx_codeobj__25; + PyObject *__pyx_codeobj__26; + PyObject *__pyx_codeobj__27; + PyObject *__pyx_codeobj__29; + PyObject *__pyx_codeobj__32; + PyObject *__pyx_codeobj__35; + PyObject *__pyx_codeobj__45; + PyObject *__pyx_codeobj__47; + PyObject *__pyx_codeobj__49; + PyObject *__pyx_codeobj__51; + PyObject *__pyx_codeobj__53; + PyObject *__pyx_codeobj__55; + PyObject *__pyx_codeobj__57; + PyObject *__pyx_codeobj__59; + PyObject *__pyx_codeobj__61; + PyObject *__pyx_codeobj__63; + PyObject *__pyx_codeobj__64; + PyObject *__pyx_codeobj__65; + PyObject *__pyx_codeobj__67; + PyObject *__pyx_codeobj__69; + PyObject *__pyx_codeobj__71; + PyObject *__pyx_codeobj__73; + PyObject *__pyx_codeobj__75; + PyObject *__pyx_codeobj__77; + PyObject *__pyx_codeobj__79; + PyObject *__pyx_codeobj__81; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr); + Py_CLEAR(clear_module_state->__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr); + Py_CLEAR(clear_module_state->__pyx_kp_u_02X); + Py_CLEAR(clear_module_state->__pyx_kp_u_0X); + Py_CLEAR(clear_module_state->__pyx_kp_u_0x); + Py_CLEAR(clear_module_state->__pyx_kp_u_25); + Py_CLEAR(clear_module_state->__pyx_kp_u_2E); + Py_CLEAR(clear_module_state->__pyx_kp_u_2E_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_2E_2E); + Py_CLEAR(clear_module_state->__pyx_kp_u_2E_2e); + Py_CLEAR(clear_module_state->__pyx_kp_u_2E_3); + Py_CLEAR(clear_module_state->__pyx_kp_u_2e); + Py_CLEAR(clear_module_state->__pyx_kp_u_2e_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_2e_2E); + Py_CLEAR(clear_module_state->__pyx_kp_u_2e_2e); + Py_CLEAR(clear_module_state->__pyx_kp_u_2e_3); + Py_CLEAR(clear_module_state->__pyx_kp_u_40); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_ALPHA); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_ALPHANUMERIC); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_DIGIT); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_HEX_DIGIT); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_TAB_OR_NEWLINE); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); + Py_CLEAR(clear_module_state->__pyx_n_s_AUTHORITY); + Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); + Py_CLEAR(clear_module_state->__pyx_n_s_C0_CONTROL); + Py_CLEAR(clear_module_state->__pyx_n_s_C0_CONTROL_OR_SPACE); + Py_CLEAR(clear_module_state->__pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_DEFAULT_PORTS); + Py_CLEAR(clear_module_state->__pyx_kp_u_Domain_name); + Py_CLEAR(clear_module_state->__pyx_n_s_FILE); + Py_CLEAR(clear_module_state->__pyx_n_s_FILE_HOST); + Py_CLEAR(clear_module_state->__pyx_n_s_FILE_SLASH); + Py_CLEAR(clear_module_state->__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); + Py_CLEAR(clear_module_state->__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); + Py_CLEAR(clear_module_state->__pyx_n_s_FRAGMENT); + Py_CLEAR(clear_module_state->__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_HOST); + Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); + Py_CLEAR(clear_module_state->__pyx_n_s_List); + Py_CLEAR(clear_module_state->__pyx_kp_s_List_int); + Py_CLEAR(clear_module_state->__pyx_n_s_NO_SCHEME); + Py_CLEAR(clear_module_state->__pyx_n_s_None); + Py_CLEAR(clear_module_state->__pyx_n_s_OPAQUE_PATH); + Py_CLEAR(clear_module_state->__pyx_n_s_Optional); + Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_bool); + Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_int); + Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_str); + Py_CLEAR(clear_module_state->__pyx_n_s_PATH); + Py_CLEAR(clear_module_state->__pyx_n_s_PATH_OR_AUTHORITY); + Py_CLEAR(clear_module_state->__pyx_n_s_PATH_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_PATH_START); + Py_CLEAR(clear_module_state->__pyx_n_s_PORT); + Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet); + Py_CLEAR(clear_module_state->__pyx_n_s_QUERY); + Py_CLEAR(clear_module_state->__pyx_n_s_QUERY_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_RELATIVE); + Py_CLEAR(clear_module_state->__pyx_n_s_RELATIVE_SLASH); + Py_CLEAR(clear_module_state->__pyx_n_s_SCHEME); + Py_CLEAR(clear_module_state->__pyx_n_s_SCHEME_CHARS); + Py_CLEAR(clear_module_state->__pyx_n_s_SCHEME_START); + Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); + Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_AUTHORITY_SLASHES); + Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); + Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY); + Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_SCHEMES); + Py_CLEAR(clear_module_state->__pyx_n_s_Tuple); + Py_CLEAR(clear_module_state->__pyx_kp_s_Tuple_int_bool); + Py_CLEAR(clear_module_state->__pyx_n_s_URL); + Py_CLEAR(clear_module_state->__pyx_n_s_URL___init); + Py_CLEAR(clear_module_state->__pyx_n_s_URL_has_opaque_path); + Py_CLEAR(clear_module_state->__pyx_n_s_URL_scheme); + Py_CLEAR(clear_module_state->__pyx_n_s_USERINFO_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_Union); + Py_CLEAR(clear_module_state->__pyx_kp_s_Union_int_List_int_str); + Py_CLEAR(clear_module_state->__pyx_kp_s_Union_str_List_str); + Py_CLEAR(clear_module_state->__pyx_kp_s_Union_str_int_List_int); + Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); + Py_CLEAR(clear_module_state->__pyx_kp_u__10); + Py_CLEAR(clear_module_state->__pyx_kp_u__11); + Py_CLEAR(clear_module_state->__pyx_kp_u__12); + Py_CLEAR(clear_module_state->__pyx_kp_u__13); + Py_CLEAR(clear_module_state->__pyx_n_s__14); + Py_CLEAR(clear_module_state->__pyx_kp_u__14); + Py_CLEAR(clear_module_state->__pyx_kp_u__15); + Py_CLEAR(clear_module_state->__pyx_kp_u__16); + Py_CLEAR(clear_module_state->__pyx_kp_u__17); + Py_CLEAR(clear_module_state->__pyx_kp_u__18); + Py_CLEAR(clear_module_state->__pyx_kp_u__19); + Py_CLEAR(clear_module_state->__pyx_n_s__2); + Py_CLEAR(clear_module_state->__pyx_kp_u__2); + Py_CLEAR(clear_module_state->__pyx_kp_u__21); + Py_CLEAR(clear_module_state->__pyx_kp_u__22); + Py_CLEAR(clear_module_state->__pyx_kp_u__23); + Py_CLEAR(clear_module_state->__pyx_kp_u__3); + Py_CLEAR(clear_module_state->__pyx_kp_u__30); + Py_CLEAR(clear_module_state->__pyx_n_s__33); + Py_CLEAR(clear_module_state->__pyx_kp_u__36); + Py_CLEAR(clear_module_state->__pyx_kp_u__37); + Py_CLEAR(clear_module_state->__pyx_kp_u__38); + Py_CLEAR(clear_module_state->__pyx_kp_u__39); + Py_CLEAR(clear_module_state->__pyx_kp_u__4); + Py_CLEAR(clear_module_state->__pyx_kp_u__40); + Py_CLEAR(clear_module_state->__pyx_kp_u__41); + Py_CLEAR(clear_module_state->__pyx_kp_u__42); + Py_CLEAR(clear_module_state->__pyx_kp_u__43); + Py_CLEAR(clear_module_state->__pyx_kp_u__5); + Py_CLEAR(clear_module_state->__pyx_kp_u__6); + Py_CLEAR(clear_module_state->__pyx_kp_u__8); + Py_CLEAR(clear_module_state->__pyx_kp_u__9); + Py_CLEAR(clear_module_state->__pyx_n_s_address); + Py_CLEAR(clear_module_state->__pyx_n_s_annotations); + Py_CLEAR(clear_module_state->__pyx_n_s_append); + Py_CLEAR(clear_module_state->__pyx_n_s_args); + Py_CLEAR(clear_module_state->__pyx_n_s_ascii_domain); + Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); + Py_CLEAR(clear_module_state->__pyx_n_s_at_sign_index); + Py_CLEAR(clear_module_state->__pyx_n_s_at_sign_seen); + Py_CLEAR(clear_module_state->__pyx_n_s_base); + Py_CLEAR(clear_module_state->__pyx_n_s_base_url); + Py_CLEAR(clear_module_state->__pyx_n_s_be_strict); + Py_CLEAR(clear_module_state->__pyx_n_s_bool); + Py_CLEAR(clear_module_state->__pyx_n_s_buffer); + Py_CLEAR(clear_module_state->__pyx_n_s_byte); + Py_CLEAR(clear_module_state->__pyx_n_s_c); + Py_CLEAR(clear_module_state->__pyx_n_s_canonicalize); + Py_CLEAR(clear_module_state->__pyx_n_s_check_bidi); + Py_CLEAR(clear_module_state->__pyx_n_s_check_hyphens); + Py_CLEAR(clear_module_state->__pyx_n_s_check_joiners); + Py_CLEAR(clear_module_state->__pyx_n_s_chr); + Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_close); + Py_CLEAR(clear_module_state->__pyx_n_s_code_point); + Py_CLEAR(clear_module_state->__pyx_n_s_compress); + Py_CLEAR(clear_module_state->__pyx_n_s_counter); + Py_CLEAR(clear_module_state->__pyx_n_s_current_index); + Py_CLEAR(clear_module_state->__pyx_n_s_current_length); + Py_CLEAR(clear_module_state->__pyx_n_s_default_port_seen); + Py_CLEAR(clear_module_state->__pyx_n_s_dict); + Py_CLEAR(clear_module_state->__pyx_kp_u_disable); + Py_CLEAR(clear_module_state->__pyx_n_s_doc); + Py_CLEAR(clear_module_state->__pyx_n_s_domain); + Py_CLEAR(clear_module_state->__pyx_n_s_domain_to_ascii); + Py_CLEAR(clear_module_state->__pyx_kp_u_enable); + Py_CLEAR(clear_module_state->__pyx_n_s_encode_output); + Py_CLEAR(clear_module_state->__pyx_n_s_encode_set); + Py_CLEAR(clear_module_state->__pyx_n_s_encoded); + Py_CLEAR(clear_module_state->__pyx_n_s_encoded_code_points); + Py_CLEAR(clear_module_state->__pyx_n_s_encoder); + Py_CLEAR(clear_module_state->__pyx_n_s_encoding); + Py_CLEAR(clear_module_state->__pyx_n_s_encoding_2); + Py_CLEAR(clear_module_state->__pyx_n_s_ends_in_number); + Py_CLEAR(clear_module_state->__pyx_n_s_ends_in_number_locals_genexpr); + Py_CLEAR(clear_module_state->__pyx_n_s_enumerate); + Py_CLEAR(clear_module_state->__pyx_n_s_exclude_fragment); + Py_CLEAR(clear_module_state->__pyx_n_u_file); + Py_CLEAR(clear_module_state->__pyx_n_s_floor); + Py_CLEAR(clear_module_state->__pyx_n_s_fragment); + Py_CLEAR(clear_module_state->__pyx_n_s_fragment_percent_encode_set); + Py_CLEAR(clear_module_state->__pyx_n_u_ftp); + Py_CLEAR(clear_module_state->__pyx_kp_u_gc); + Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); + Py_CLEAR(clear_module_state->__pyx_n_s_get); + Py_CLEAR(clear_module_state->__pyx_n_s_get_encoder); + Py_CLEAR(clear_module_state->__pyx_n_s_get_ipv6_first_longest_0_piece); + Py_CLEAR(clear_module_state->__pyx_n_s_get_output_encoding); + Py_CLEAR(clear_module_state->__pyx_n_s_greater_than); + Py_CLEAR(clear_module_state->__pyx_n_s_has_opaque_path); + Py_CLEAR(clear_module_state->__pyx_n_s_host); + Py_CLEAR(clear_module_state->__pyx_n_s_hostname); + Py_CLEAR(clear_module_state->__pyx_n_u_http); + Py_CLEAR(clear_module_state->__pyx_n_u_https); + Py_CLEAR(clear_module_state->__pyx_n_s_i); + Py_CLEAR(clear_module_state->__pyx_n_s_idempotent_utf_8_percent_encode); + Py_CLEAR(clear_module_state->__pyx_n_s_ignore0); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_n_s_index); + Py_CLEAR(clear_module_state->__pyx_n_s_index_length); + Py_CLEAR(clear_module_state->__pyx_n_s_infra); + Py_CLEAR(clear_module_state->__pyx_n_s_init); + Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); + Py_CLEAR(clear_module_state->__pyx_n_s_input); + Py_CLEAR(clear_module_state->__pyx_n_s_input_lenght); + Py_CLEAR(clear_module_state->__pyx_n_s_input_length); + Py_CLEAR(clear_module_state->__pyx_n_s_inside_brackets); + Py_CLEAR(clear_module_state->__pyx_n_s_int); + Py_CLEAR(clear_module_state->__pyx_n_s_ipv4); + Py_CLEAR(clear_module_state->__pyx_n_s_ipv4_piece); + Py_CLEAR(clear_module_state->__pyx_kp_u_is_an_empty_string_after_conver); + Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); + Py_CLEAR(clear_module_state->__pyx_n_s_is_double_dot_path_segment); + Py_CLEAR(clear_module_state->__pyx_n_s_is_single_dot_path_segment); + Py_CLEAR(clear_module_state->__pyx_n_s_is_special); + Py_CLEAR(clear_module_state->__pyx_n_s_is_windows_drive_letter); + Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); + Py_CLEAR(clear_module_state->__pyx_n_s_isomorph); + Py_CLEAR(clear_module_state->__pyx_n_s_keys); + Py_CLEAR(clear_module_state->__pyx_n_s_last); + Py_CLEAR(clear_module_state->__pyx_n_s_length); + Py_CLEAR(clear_module_state->__pyx_n_u_localhost); + Py_CLEAR(clear_module_state->__pyx_n_s_lower); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_math); + Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); + Py_CLEAR(clear_module_state->__pyx_n_s_min_length); + Py_CLEAR(clear_module_state->__pyx_n_s_module); + Py_CLEAR(clear_module_state->__pyx_n_s_n); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_number); + Py_CLEAR(clear_module_state->__pyx_n_s_numbers); + Py_CLEAR(clear_module_state->__pyx_n_s_numbers_seen); + Py_CLEAR(clear_module_state->__pyx_n_s_output); + Py_CLEAR(clear_module_state->__pyx_n_s_parse_host); + Py_CLEAR(clear_module_state->__pyx_n_s_parse_ipv4); + Py_CLEAR(clear_module_state->__pyx_n_s_parse_ipv4_locals_genexpr); + Py_CLEAR(clear_module_state->__pyx_n_s_parse_ipv4_number); + Py_CLEAR(clear_module_state->__pyx_n_s_parse_ipv6); + Py_CLEAR(clear_module_state->__pyx_n_s_parse_opaque_host); + Py_CLEAR(clear_module_state->__pyx_n_s_parse_url); + Py_CLEAR(clear_module_state->__pyx_n_s_part); + Py_CLEAR(clear_module_state->__pyx_n_s_parts); + Py_CLEAR(clear_module_state->__pyx_n_s_password); + Py_CLEAR(clear_module_state->__pyx_n_s_password_token_seen); + Py_CLEAR(clear_module_state->__pyx_n_s_path); + Py_CLEAR(clear_module_state->__pyx_n_s_path_percent_encode_set); + Py_CLEAR(clear_module_state->__pyx_n_s_path_token_seen); + Py_CLEAR(clear_module_state->__pyx_n_s_percent_encode_after_encoding); + Py_CLEAR(clear_module_state->__pyx_n_s_percent_encode_set); + Py_CLEAR(clear_module_state->__pyx_n_s_piece); + Py_CLEAR(clear_module_state->__pyx_n_s_piece_index); + Py_CLEAR(clear_module_state->__pyx_n_s_pointer); + Py_CLEAR(clear_module_state->__pyx_n_s_port); + Py_CLEAR(clear_module_state->__pyx_n_s_port_token_seen); + Py_CLEAR(clear_module_state->__pyx_n_s_prepare); + Py_CLEAR(clear_module_state->__pyx_n_s_property); + Py_CLEAR(clear_module_state->__pyx_n_s_qualname); + Py_CLEAR(clear_module_state->__pyx_n_s_query); + Py_CLEAR(clear_module_state->__pyx_n_s_query_percent_encode_set); + Py_CLEAR(clear_module_state->__pyx_n_s_r); + Py_CLEAR(clear_module_state->__pyx_n_s_range); + Py_CLEAR(clear_module_state->__pyx_n_s_result); + Py_CLEAR(clear_module_state->__pyx_n_s_return); + Py_CLEAR(clear_module_state->__pyx_n_s_scheme); + Py_CLEAR(clear_module_state->__pyx_n_s_scheme_2); + Py_CLEAR(clear_module_state->__pyx_n_s_segment); + Py_CLEAR(clear_module_state->__pyx_n_s_self); + Py_CLEAR(clear_module_state->__pyx_n_s_send); + Py_CLEAR(clear_module_state->__pyx_n_s_separator); + Py_CLEAR(clear_module_state->__pyx_n_s_serialize_host); + Py_CLEAR(clear_module_state->__pyx_n_s_serialize_ipv4); + Py_CLEAR(clear_module_state->__pyx_n_s_serialize_ipv6); + Py_CLEAR(clear_module_state->__pyx_n_s_serialize_url); + Py_CLEAR(clear_module_state->__pyx_n_s_serialize_url_path); + Py_CLEAR(clear_module_state->__pyx_n_s_set_name); + Py_CLEAR(clear_module_state->__pyx_n_s_setter); + Py_CLEAR(clear_module_state->__pyx_n_s_shorten_path); + Py_CLEAR(clear_module_state->__pyx_n_s_skip_authority_shortcut); + Py_CLEAR(clear_module_state->__pyx_n_s_space_as_plus); + Py_CLEAR(clear_module_state->__pyx_n_s_special_query_percent_encode_set); + Py_CLEAR(clear_module_state->__pyx_n_s_starts_with_windows_drive_lette); + Py_CLEAR(clear_module_state->__pyx_n_s_state); + Py_CLEAR(clear_module_state->__pyx_n_s_str); + Py_CLEAR(clear_module_state->__pyx_n_s_strip); + Py_CLEAR(clear_module_state->__pyx_n_s_super); + Py_CLEAR(clear_module_state->__pyx_n_s_swaps); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_throw); + Py_CLEAR(clear_module_state->__pyx_n_s_to_ascii); + Py_CLEAR(clear_module_state->__pyx_n_s_transitional_processing); + Py_CLEAR(clear_module_state->__pyx_n_s_translate); + Py_CLEAR(clear_module_state->__pyx_n_s_typing); + Py_CLEAR(clear_module_state->__pyx_n_s_unquote); + Py_CLEAR(clear_module_state->__pyx_n_s_url); + Py_CLEAR(clear_module_state->__pyx_n_s_urllib_parse); + Py_CLEAR(clear_module_state->__pyx_n_s_use_std3_ascii_rules); + Py_CLEAR(clear_module_state->__pyx_n_s_userinfo_percent_encode_set); + Py_CLEAR(clear_module_state->__pyx_n_s_username); + Py_CLEAR(clear_module_state->__pyx_kp_u_utf_8); + Py_CLEAR(clear_module_state->__pyx_n_s_utf_8_percent_encode); + Py_CLEAR(clear_module_state->__pyx_n_s_util); + Py_CLEAR(clear_module_state->__pyx_n_s_utr46); + Py_CLEAR(clear_module_state->__pyx_n_s_validation_error); + Py_CLEAR(clear_module_state->__pyx_n_s_value); + Py_CLEAR(clear_module_state->__pyx_n_s_verify_dns_length); + Py_CLEAR(clear_module_state->__pyx_n_s_w3lib__url); + Py_CLEAR(clear_module_state->__pyx_kp_s_w3lib__url_pyx); + Py_CLEAR(clear_module_state->__pyx_n_u_ws); + Py_CLEAR(clear_module_state->__pyx_n_u_wss); + Py_CLEAR(clear_module_state->__pyx_n_u_x); + Py_CLEAR(clear_module_state->__pyx_n_u_xmlcharrefreplace); + Py_CLEAR(clear_module_state->__pyx_int_0); + Py_CLEAR(clear_module_state->__pyx_int_1); + Py_CLEAR(clear_module_state->__pyx_int_2); + Py_CLEAR(clear_module_state->__pyx_int_3); + Py_CLEAR(clear_module_state->__pyx_int_4); + Py_CLEAR(clear_module_state->__pyx_int_5); + Py_CLEAR(clear_module_state->__pyx_int_6); + Py_CLEAR(clear_module_state->__pyx_int_7); + Py_CLEAR(clear_module_state->__pyx_int_8); + Py_CLEAR(clear_module_state->__pyx_int_9); + Py_CLEAR(clear_module_state->__pyx_int_10); + Py_CLEAR(clear_module_state->__pyx_int_11); + Py_CLEAR(clear_module_state->__pyx_int_12); + Py_CLEAR(clear_module_state->__pyx_int_13); + Py_CLEAR(clear_module_state->__pyx_int_14); + Py_CLEAR(clear_module_state->__pyx_int_15); + Py_CLEAR(clear_module_state->__pyx_int_16); + Py_CLEAR(clear_module_state->__pyx_int_17); + Py_CLEAR(clear_module_state->__pyx_int_18); + Py_CLEAR(clear_module_state->__pyx_int_19); + Py_CLEAR(clear_module_state->__pyx_int_21); + Py_CLEAR(clear_module_state->__pyx_int_32); + Py_CLEAR(clear_module_state->__pyx_int_80); + Py_CLEAR(clear_module_state->__pyx_int_255); + Py_CLEAR(clear_module_state->__pyx_int_256); + Py_CLEAR(clear_module_state->__pyx_int_443); + Py_CLEAR(clear_module_state->__pyx_int_65535); + Py_CLEAR(clear_module_state->__pyx_int_neg_1); + Py_CLEAR(clear_module_state->__pyx_slice_); + Py_CLEAR(clear_module_state->__pyx_tuple__7); + Py_CLEAR(clear_module_state->__pyx_slice__20); + Py_CLEAR(clear_module_state->__pyx_tuple__24); + Py_CLEAR(clear_module_state->__pyx_tuple__28); + Py_CLEAR(clear_module_state->__pyx_tuple__31); + Py_CLEAR(clear_module_state->__pyx_tuple__34); + Py_CLEAR(clear_module_state->__pyx_tuple__44); + Py_CLEAR(clear_module_state->__pyx_tuple__46); + Py_CLEAR(clear_module_state->__pyx_tuple__48); + Py_CLEAR(clear_module_state->__pyx_tuple__50); + Py_CLEAR(clear_module_state->__pyx_tuple__52); + Py_CLEAR(clear_module_state->__pyx_tuple__54); + Py_CLEAR(clear_module_state->__pyx_tuple__56); + Py_CLEAR(clear_module_state->__pyx_tuple__58); + Py_CLEAR(clear_module_state->__pyx_tuple__60); + Py_CLEAR(clear_module_state->__pyx_tuple__62); + Py_CLEAR(clear_module_state->__pyx_tuple__66); + Py_CLEAR(clear_module_state->__pyx_tuple__68); + Py_CLEAR(clear_module_state->__pyx_tuple__70); + Py_CLEAR(clear_module_state->__pyx_tuple__72); + Py_CLEAR(clear_module_state->__pyx_tuple__74); + Py_CLEAR(clear_module_state->__pyx_tuple__76); + Py_CLEAR(clear_module_state->__pyx_tuple__78); + Py_CLEAR(clear_module_state->__pyx_tuple__80); + Py_CLEAR(clear_module_state->__pyx_codeobj__25); + Py_CLEAR(clear_module_state->__pyx_codeobj__26); + Py_CLEAR(clear_module_state->__pyx_codeobj__27); + Py_CLEAR(clear_module_state->__pyx_codeobj__29); + Py_CLEAR(clear_module_state->__pyx_codeobj__32); + Py_CLEAR(clear_module_state->__pyx_codeobj__35); + Py_CLEAR(clear_module_state->__pyx_codeobj__45); + Py_CLEAR(clear_module_state->__pyx_codeobj__47); + Py_CLEAR(clear_module_state->__pyx_codeobj__49); + Py_CLEAR(clear_module_state->__pyx_codeobj__51); + Py_CLEAR(clear_module_state->__pyx_codeobj__53); + Py_CLEAR(clear_module_state->__pyx_codeobj__55); + Py_CLEAR(clear_module_state->__pyx_codeobj__57); + Py_CLEAR(clear_module_state->__pyx_codeobj__59); + Py_CLEAR(clear_module_state->__pyx_codeobj__61); + Py_CLEAR(clear_module_state->__pyx_codeobj__63); + Py_CLEAR(clear_module_state->__pyx_codeobj__64); + Py_CLEAR(clear_module_state->__pyx_codeobj__65); + Py_CLEAR(clear_module_state->__pyx_codeobj__67); + Py_CLEAR(clear_module_state->__pyx_codeobj__69); + Py_CLEAR(clear_module_state->__pyx_codeobj__71); + Py_CLEAR(clear_module_state->__pyx_codeobj__73); + Py_CLEAR(clear_module_state->__pyx_codeobj__75); + Py_CLEAR(clear_module_state->__pyx_codeobj__77); + Py_CLEAR(clear_module_state->__pyx_codeobj__79); + Py_CLEAR(clear_module_state->__pyx_codeobj__81); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr); + Py_VISIT(traverse_module_state->__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr); + Py_VISIT(traverse_module_state->__pyx_kp_u_02X); + Py_VISIT(traverse_module_state->__pyx_kp_u_0X); + Py_VISIT(traverse_module_state->__pyx_kp_u_0x); + Py_VISIT(traverse_module_state->__pyx_kp_u_25); + Py_VISIT(traverse_module_state->__pyx_kp_u_2E); + Py_VISIT(traverse_module_state->__pyx_kp_u_2E_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_2E_2E); + Py_VISIT(traverse_module_state->__pyx_kp_u_2E_2e); + Py_VISIT(traverse_module_state->__pyx_kp_u_2E_3); + Py_VISIT(traverse_module_state->__pyx_kp_u_2e); + Py_VISIT(traverse_module_state->__pyx_kp_u_2e_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_2e_2E); + Py_VISIT(traverse_module_state->__pyx_kp_u_2e_2e); + Py_VISIT(traverse_module_state->__pyx_kp_u_2e_3); + Py_VISIT(traverse_module_state->__pyx_kp_u_40); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_ALPHA); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_ALPHANUMERIC); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_DIGIT); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_HEX_DIGIT); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_TAB_OR_NEWLINE); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); + Py_VISIT(traverse_module_state->__pyx_n_s_AUTHORITY); + Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); + Py_VISIT(traverse_module_state->__pyx_n_s_C0_CONTROL); + Py_VISIT(traverse_module_state->__pyx_n_s_C0_CONTROL_OR_SPACE); + Py_VISIT(traverse_module_state->__pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_DEFAULT_PORTS); + Py_VISIT(traverse_module_state->__pyx_kp_u_Domain_name); + Py_VISIT(traverse_module_state->__pyx_n_s_FILE); + Py_VISIT(traverse_module_state->__pyx_n_s_FILE_HOST); + Py_VISIT(traverse_module_state->__pyx_n_s_FILE_SLASH); + Py_VISIT(traverse_module_state->__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); + Py_VISIT(traverse_module_state->__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); + Py_VISIT(traverse_module_state->__pyx_n_s_FRAGMENT); + Py_VISIT(traverse_module_state->__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_HOST); + Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); + Py_VISIT(traverse_module_state->__pyx_n_s_List); + Py_VISIT(traverse_module_state->__pyx_kp_s_List_int); + Py_VISIT(traverse_module_state->__pyx_n_s_NO_SCHEME); + Py_VISIT(traverse_module_state->__pyx_n_s_None); + Py_VISIT(traverse_module_state->__pyx_n_s_OPAQUE_PATH); + Py_VISIT(traverse_module_state->__pyx_n_s_Optional); + Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_bool); + Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_int); + Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_str); + Py_VISIT(traverse_module_state->__pyx_n_s_PATH); + Py_VISIT(traverse_module_state->__pyx_n_s_PATH_OR_AUTHORITY); + Py_VISIT(traverse_module_state->__pyx_n_s_PATH_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_PATH_START); + Py_VISIT(traverse_module_state->__pyx_n_s_PORT); + Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet); + Py_VISIT(traverse_module_state->__pyx_n_s_QUERY); + Py_VISIT(traverse_module_state->__pyx_n_s_QUERY_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_RELATIVE); + Py_VISIT(traverse_module_state->__pyx_n_s_RELATIVE_SLASH); + Py_VISIT(traverse_module_state->__pyx_n_s_SCHEME); + Py_VISIT(traverse_module_state->__pyx_n_s_SCHEME_CHARS); + Py_VISIT(traverse_module_state->__pyx_n_s_SCHEME_START); + Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); + Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_AUTHORITY_SLASHES); + Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); + Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY); + Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_SCHEMES); + Py_VISIT(traverse_module_state->__pyx_n_s_Tuple); + Py_VISIT(traverse_module_state->__pyx_kp_s_Tuple_int_bool); + Py_VISIT(traverse_module_state->__pyx_n_s_URL); + Py_VISIT(traverse_module_state->__pyx_n_s_URL___init); + Py_VISIT(traverse_module_state->__pyx_n_s_URL_has_opaque_path); + Py_VISIT(traverse_module_state->__pyx_n_s_URL_scheme); + Py_VISIT(traverse_module_state->__pyx_n_s_USERINFO_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_Union); + Py_VISIT(traverse_module_state->__pyx_kp_s_Union_int_List_int_str); + Py_VISIT(traverse_module_state->__pyx_kp_s_Union_str_List_str); + Py_VISIT(traverse_module_state->__pyx_kp_s_Union_str_int_List_int); + Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); + Py_VISIT(traverse_module_state->__pyx_kp_u__10); + Py_VISIT(traverse_module_state->__pyx_kp_u__11); + Py_VISIT(traverse_module_state->__pyx_kp_u__12); + Py_VISIT(traverse_module_state->__pyx_kp_u__13); + Py_VISIT(traverse_module_state->__pyx_n_s__14); + Py_VISIT(traverse_module_state->__pyx_kp_u__14); + Py_VISIT(traverse_module_state->__pyx_kp_u__15); + Py_VISIT(traverse_module_state->__pyx_kp_u__16); + Py_VISIT(traverse_module_state->__pyx_kp_u__17); + Py_VISIT(traverse_module_state->__pyx_kp_u__18); + Py_VISIT(traverse_module_state->__pyx_kp_u__19); + Py_VISIT(traverse_module_state->__pyx_n_s__2); + Py_VISIT(traverse_module_state->__pyx_kp_u__2); + Py_VISIT(traverse_module_state->__pyx_kp_u__21); + Py_VISIT(traverse_module_state->__pyx_kp_u__22); + Py_VISIT(traverse_module_state->__pyx_kp_u__23); + Py_VISIT(traverse_module_state->__pyx_kp_u__3); + Py_VISIT(traverse_module_state->__pyx_kp_u__30); + Py_VISIT(traverse_module_state->__pyx_n_s__33); + Py_VISIT(traverse_module_state->__pyx_kp_u__36); + Py_VISIT(traverse_module_state->__pyx_kp_u__37); + Py_VISIT(traverse_module_state->__pyx_kp_u__38); + Py_VISIT(traverse_module_state->__pyx_kp_u__39); + Py_VISIT(traverse_module_state->__pyx_kp_u__4); + Py_VISIT(traverse_module_state->__pyx_kp_u__40); + Py_VISIT(traverse_module_state->__pyx_kp_u__41); + Py_VISIT(traverse_module_state->__pyx_kp_u__42); + Py_VISIT(traverse_module_state->__pyx_kp_u__43); + Py_VISIT(traverse_module_state->__pyx_kp_u__5); + Py_VISIT(traverse_module_state->__pyx_kp_u__6); + Py_VISIT(traverse_module_state->__pyx_kp_u__8); + Py_VISIT(traverse_module_state->__pyx_kp_u__9); + Py_VISIT(traverse_module_state->__pyx_n_s_address); + Py_VISIT(traverse_module_state->__pyx_n_s_annotations); + Py_VISIT(traverse_module_state->__pyx_n_s_append); + Py_VISIT(traverse_module_state->__pyx_n_s_args); + Py_VISIT(traverse_module_state->__pyx_n_s_ascii_domain); + Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); + Py_VISIT(traverse_module_state->__pyx_n_s_at_sign_index); + Py_VISIT(traverse_module_state->__pyx_n_s_at_sign_seen); + Py_VISIT(traverse_module_state->__pyx_n_s_base); + Py_VISIT(traverse_module_state->__pyx_n_s_base_url); + Py_VISIT(traverse_module_state->__pyx_n_s_be_strict); + Py_VISIT(traverse_module_state->__pyx_n_s_bool); + Py_VISIT(traverse_module_state->__pyx_n_s_buffer); + Py_VISIT(traverse_module_state->__pyx_n_s_byte); + Py_VISIT(traverse_module_state->__pyx_n_s_c); + Py_VISIT(traverse_module_state->__pyx_n_s_canonicalize); + Py_VISIT(traverse_module_state->__pyx_n_s_check_bidi); + Py_VISIT(traverse_module_state->__pyx_n_s_check_hyphens); + Py_VISIT(traverse_module_state->__pyx_n_s_check_joiners); + Py_VISIT(traverse_module_state->__pyx_n_s_chr); + Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_close); + Py_VISIT(traverse_module_state->__pyx_n_s_code_point); + Py_VISIT(traverse_module_state->__pyx_n_s_compress); + Py_VISIT(traverse_module_state->__pyx_n_s_counter); + Py_VISIT(traverse_module_state->__pyx_n_s_current_index); + Py_VISIT(traverse_module_state->__pyx_n_s_current_length); + Py_VISIT(traverse_module_state->__pyx_n_s_default_port_seen); + Py_VISIT(traverse_module_state->__pyx_n_s_dict); + Py_VISIT(traverse_module_state->__pyx_kp_u_disable); + Py_VISIT(traverse_module_state->__pyx_n_s_doc); + Py_VISIT(traverse_module_state->__pyx_n_s_domain); + Py_VISIT(traverse_module_state->__pyx_n_s_domain_to_ascii); + Py_VISIT(traverse_module_state->__pyx_kp_u_enable); + Py_VISIT(traverse_module_state->__pyx_n_s_encode_output); + Py_VISIT(traverse_module_state->__pyx_n_s_encode_set); + Py_VISIT(traverse_module_state->__pyx_n_s_encoded); + Py_VISIT(traverse_module_state->__pyx_n_s_encoded_code_points); + Py_VISIT(traverse_module_state->__pyx_n_s_encoder); + Py_VISIT(traverse_module_state->__pyx_n_s_encoding); + Py_VISIT(traverse_module_state->__pyx_n_s_encoding_2); + Py_VISIT(traverse_module_state->__pyx_n_s_ends_in_number); + Py_VISIT(traverse_module_state->__pyx_n_s_ends_in_number_locals_genexpr); + Py_VISIT(traverse_module_state->__pyx_n_s_enumerate); + Py_VISIT(traverse_module_state->__pyx_n_s_exclude_fragment); + Py_VISIT(traverse_module_state->__pyx_n_u_file); + Py_VISIT(traverse_module_state->__pyx_n_s_floor); + Py_VISIT(traverse_module_state->__pyx_n_s_fragment); + Py_VISIT(traverse_module_state->__pyx_n_s_fragment_percent_encode_set); + Py_VISIT(traverse_module_state->__pyx_n_u_ftp); + Py_VISIT(traverse_module_state->__pyx_kp_u_gc); + Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); + Py_VISIT(traverse_module_state->__pyx_n_s_get); + Py_VISIT(traverse_module_state->__pyx_n_s_get_encoder); + Py_VISIT(traverse_module_state->__pyx_n_s_get_ipv6_first_longest_0_piece); + Py_VISIT(traverse_module_state->__pyx_n_s_get_output_encoding); + Py_VISIT(traverse_module_state->__pyx_n_s_greater_than); + Py_VISIT(traverse_module_state->__pyx_n_s_has_opaque_path); + Py_VISIT(traverse_module_state->__pyx_n_s_host); + Py_VISIT(traverse_module_state->__pyx_n_s_hostname); + Py_VISIT(traverse_module_state->__pyx_n_u_http); + Py_VISIT(traverse_module_state->__pyx_n_u_https); + Py_VISIT(traverse_module_state->__pyx_n_s_i); + Py_VISIT(traverse_module_state->__pyx_n_s_idempotent_utf_8_percent_encode); + Py_VISIT(traverse_module_state->__pyx_n_s_ignore0); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_n_s_index); + Py_VISIT(traverse_module_state->__pyx_n_s_index_length); + Py_VISIT(traverse_module_state->__pyx_n_s_infra); + Py_VISIT(traverse_module_state->__pyx_n_s_init); + Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); + Py_VISIT(traverse_module_state->__pyx_n_s_input); + Py_VISIT(traverse_module_state->__pyx_n_s_input_lenght); + Py_VISIT(traverse_module_state->__pyx_n_s_input_length); + Py_VISIT(traverse_module_state->__pyx_n_s_inside_brackets); + Py_VISIT(traverse_module_state->__pyx_n_s_int); + Py_VISIT(traverse_module_state->__pyx_n_s_ipv4); + Py_VISIT(traverse_module_state->__pyx_n_s_ipv4_piece); + Py_VISIT(traverse_module_state->__pyx_kp_u_is_an_empty_string_after_conver); + Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); + Py_VISIT(traverse_module_state->__pyx_n_s_is_double_dot_path_segment); + Py_VISIT(traverse_module_state->__pyx_n_s_is_single_dot_path_segment); + Py_VISIT(traverse_module_state->__pyx_n_s_is_special); + Py_VISIT(traverse_module_state->__pyx_n_s_is_windows_drive_letter); + Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); + Py_VISIT(traverse_module_state->__pyx_n_s_isomorph); + Py_VISIT(traverse_module_state->__pyx_n_s_keys); + Py_VISIT(traverse_module_state->__pyx_n_s_last); + Py_VISIT(traverse_module_state->__pyx_n_s_length); + Py_VISIT(traverse_module_state->__pyx_n_u_localhost); + Py_VISIT(traverse_module_state->__pyx_n_s_lower); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_math); + Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); + Py_VISIT(traverse_module_state->__pyx_n_s_min_length); + Py_VISIT(traverse_module_state->__pyx_n_s_module); + Py_VISIT(traverse_module_state->__pyx_n_s_n); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_number); + Py_VISIT(traverse_module_state->__pyx_n_s_numbers); + Py_VISIT(traverse_module_state->__pyx_n_s_numbers_seen); + Py_VISIT(traverse_module_state->__pyx_n_s_output); + Py_VISIT(traverse_module_state->__pyx_n_s_parse_host); + Py_VISIT(traverse_module_state->__pyx_n_s_parse_ipv4); + Py_VISIT(traverse_module_state->__pyx_n_s_parse_ipv4_locals_genexpr); + Py_VISIT(traverse_module_state->__pyx_n_s_parse_ipv4_number); + Py_VISIT(traverse_module_state->__pyx_n_s_parse_ipv6); + Py_VISIT(traverse_module_state->__pyx_n_s_parse_opaque_host); + Py_VISIT(traverse_module_state->__pyx_n_s_parse_url); + Py_VISIT(traverse_module_state->__pyx_n_s_part); + Py_VISIT(traverse_module_state->__pyx_n_s_parts); + Py_VISIT(traverse_module_state->__pyx_n_s_password); + Py_VISIT(traverse_module_state->__pyx_n_s_password_token_seen); + Py_VISIT(traverse_module_state->__pyx_n_s_path); + Py_VISIT(traverse_module_state->__pyx_n_s_path_percent_encode_set); + Py_VISIT(traverse_module_state->__pyx_n_s_path_token_seen); + Py_VISIT(traverse_module_state->__pyx_n_s_percent_encode_after_encoding); + Py_VISIT(traverse_module_state->__pyx_n_s_percent_encode_set); + Py_VISIT(traverse_module_state->__pyx_n_s_piece); + Py_VISIT(traverse_module_state->__pyx_n_s_piece_index); + Py_VISIT(traverse_module_state->__pyx_n_s_pointer); + Py_VISIT(traverse_module_state->__pyx_n_s_port); + Py_VISIT(traverse_module_state->__pyx_n_s_port_token_seen); + Py_VISIT(traverse_module_state->__pyx_n_s_prepare); + Py_VISIT(traverse_module_state->__pyx_n_s_property); + Py_VISIT(traverse_module_state->__pyx_n_s_qualname); + Py_VISIT(traverse_module_state->__pyx_n_s_query); + Py_VISIT(traverse_module_state->__pyx_n_s_query_percent_encode_set); + Py_VISIT(traverse_module_state->__pyx_n_s_r); + Py_VISIT(traverse_module_state->__pyx_n_s_range); + Py_VISIT(traverse_module_state->__pyx_n_s_result); + Py_VISIT(traverse_module_state->__pyx_n_s_return); + Py_VISIT(traverse_module_state->__pyx_n_s_scheme); + Py_VISIT(traverse_module_state->__pyx_n_s_scheme_2); + Py_VISIT(traverse_module_state->__pyx_n_s_segment); + Py_VISIT(traverse_module_state->__pyx_n_s_self); + Py_VISIT(traverse_module_state->__pyx_n_s_send); + Py_VISIT(traverse_module_state->__pyx_n_s_separator); + Py_VISIT(traverse_module_state->__pyx_n_s_serialize_host); + Py_VISIT(traverse_module_state->__pyx_n_s_serialize_ipv4); + Py_VISIT(traverse_module_state->__pyx_n_s_serialize_ipv6); + Py_VISIT(traverse_module_state->__pyx_n_s_serialize_url); + Py_VISIT(traverse_module_state->__pyx_n_s_serialize_url_path); + Py_VISIT(traverse_module_state->__pyx_n_s_set_name); + Py_VISIT(traverse_module_state->__pyx_n_s_setter); + Py_VISIT(traverse_module_state->__pyx_n_s_shorten_path); + Py_VISIT(traverse_module_state->__pyx_n_s_skip_authority_shortcut); + Py_VISIT(traverse_module_state->__pyx_n_s_space_as_plus); + Py_VISIT(traverse_module_state->__pyx_n_s_special_query_percent_encode_set); + Py_VISIT(traverse_module_state->__pyx_n_s_starts_with_windows_drive_lette); + Py_VISIT(traverse_module_state->__pyx_n_s_state); + Py_VISIT(traverse_module_state->__pyx_n_s_str); + Py_VISIT(traverse_module_state->__pyx_n_s_strip); + Py_VISIT(traverse_module_state->__pyx_n_s_super); + Py_VISIT(traverse_module_state->__pyx_n_s_swaps); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_throw); + Py_VISIT(traverse_module_state->__pyx_n_s_to_ascii); + Py_VISIT(traverse_module_state->__pyx_n_s_transitional_processing); + Py_VISIT(traverse_module_state->__pyx_n_s_translate); + Py_VISIT(traverse_module_state->__pyx_n_s_typing); + Py_VISIT(traverse_module_state->__pyx_n_s_unquote); + Py_VISIT(traverse_module_state->__pyx_n_s_url); + Py_VISIT(traverse_module_state->__pyx_n_s_urllib_parse); + Py_VISIT(traverse_module_state->__pyx_n_s_use_std3_ascii_rules); + Py_VISIT(traverse_module_state->__pyx_n_s_userinfo_percent_encode_set); + Py_VISIT(traverse_module_state->__pyx_n_s_username); + Py_VISIT(traverse_module_state->__pyx_kp_u_utf_8); + Py_VISIT(traverse_module_state->__pyx_n_s_utf_8_percent_encode); + Py_VISIT(traverse_module_state->__pyx_n_s_util); + Py_VISIT(traverse_module_state->__pyx_n_s_utr46); + Py_VISIT(traverse_module_state->__pyx_n_s_validation_error); + Py_VISIT(traverse_module_state->__pyx_n_s_value); + Py_VISIT(traverse_module_state->__pyx_n_s_verify_dns_length); + Py_VISIT(traverse_module_state->__pyx_n_s_w3lib__url); + Py_VISIT(traverse_module_state->__pyx_kp_s_w3lib__url_pyx); + Py_VISIT(traverse_module_state->__pyx_n_u_ws); + Py_VISIT(traverse_module_state->__pyx_n_u_wss); + Py_VISIT(traverse_module_state->__pyx_n_u_x); + Py_VISIT(traverse_module_state->__pyx_n_u_xmlcharrefreplace); + Py_VISIT(traverse_module_state->__pyx_int_0); + Py_VISIT(traverse_module_state->__pyx_int_1); + Py_VISIT(traverse_module_state->__pyx_int_2); + Py_VISIT(traverse_module_state->__pyx_int_3); + Py_VISIT(traverse_module_state->__pyx_int_4); + Py_VISIT(traverse_module_state->__pyx_int_5); + Py_VISIT(traverse_module_state->__pyx_int_6); + Py_VISIT(traverse_module_state->__pyx_int_7); + Py_VISIT(traverse_module_state->__pyx_int_8); + Py_VISIT(traverse_module_state->__pyx_int_9); + Py_VISIT(traverse_module_state->__pyx_int_10); + Py_VISIT(traverse_module_state->__pyx_int_11); + Py_VISIT(traverse_module_state->__pyx_int_12); + Py_VISIT(traverse_module_state->__pyx_int_13); + Py_VISIT(traverse_module_state->__pyx_int_14); + Py_VISIT(traverse_module_state->__pyx_int_15); + Py_VISIT(traverse_module_state->__pyx_int_16); + Py_VISIT(traverse_module_state->__pyx_int_17); + Py_VISIT(traverse_module_state->__pyx_int_18); + Py_VISIT(traverse_module_state->__pyx_int_19); + Py_VISIT(traverse_module_state->__pyx_int_21); + Py_VISIT(traverse_module_state->__pyx_int_32); + Py_VISIT(traverse_module_state->__pyx_int_80); + Py_VISIT(traverse_module_state->__pyx_int_255); + Py_VISIT(traverse_module_state->__pyx_int_256); + Py_VISIT(traverse_module_state->__pyx_int_443); + Py_VISIT(traverse_module_state->__pyx_int_65535); + Py_VISIT(traverse_module_state->__pyx_int_neg_1); + Py_VISIT(traverse_module_state->__pyx_slice_); + Py_VISIT(traverse_module_state->__pyx_tuple__7); + Py_VISIT(traverse_module_state->__pyx_slice__20); + Py_VISIT(traverse_module_state->__pyx_tuple__24); + Py_VISIT(traverse_module_state->__pyx_tuple__28); + Py_VISIT(traverse_module_state->__pyx_tuple__31); + Py_VISIT(traverse_module_state->__pyx_tuple__34); + Py_VISIT(traverse_module_state->__pyx_tuple__44); + Py_VISIT(traverse_module_state->__pyx_tuple__46); + Py_VISIT(traverse_module_state->__pyx_tuple__48); + Py_VISIT(traverse_module_state->__pyx_tuple__50); + Py_VISIT(traverse_module_state->__pyx_tuple__52); + Py_VISIT(traverse_module_state->__pyx_tuple__54); + Py_VISIT(traverse_module_state->__pyx_tuple__56); + Py_VISIT(traverse_module_state->__pyx_tuple__58); + Py_VISIT(traverse_module_state->__pyx_tuple__60); + Py_VISIT(traverse_module_state->__pyx_tuple__62); + Py_VISIT(traverse_module_state->__pyx_tuple__66); + Py_VISIT(traverse_module_state->__pyx_tuple__68); + Py_VISIT(traverse_module_state->__pyx_tuple__70); + Py_VISIT(traverse_module_state->__pyx_tuple__72); + Py_VISIT(traverse_module_state->__pyx_tuple__74); + Py_VISIT(traverse_module_state->__pyx_tuple__76); + Py_VISIT(traverse_module_state->__pyx_tuple__78); + Py_VISIT(traverse_module_state->__pyx_tuple__80); + Py_VISIT(traverse_module_state->__pyx_codeobj__25); + Py_VISIT(traverse_module_state->__pyx_codeobj__26); + Py_VISIT(traverse_module_state->__pyx_codeobj__27); + Py_VISIT(traverse_module_state->__pyx_codeobj__29); + Py_VISIT(traverse_module_state->__pyx_codeobj__32); + Py_VISIT(traverse_module_state->__pyx_codeobj__35); + Py_VISIT(traverse_module_state->__pyx_codeobj__45); + Py_VISIT(traverse_module_state->__pyx_codeobj__47); + Py_VISIT(traverse_module_state->__pyx_codeobj__49); + Py_VISIT(traverse_module_state->__pyx_codeobj__51); + Py_VISIT(traverse_module_state->__pyx_codeobj__53); + Py_VISIT(traverse_module_state->__pyx_codeobj__55); + Py_VISIT(traverse_module_state->__pyx_codeobj__57); + Py_VISIT(traverse_module_state->__pyx_codeobj__59); + Py_VISIT(traverse_module_state->__pyx_codeobj__61); + Py_VISIT(traverse_module_state->__pyx_codeobj__63); + Py_VISIT(traverse_module_state->__pyx_codeobj__64); + Py_VISIT(traverse_module_state->__pyx_codeobj__65); + Py_VISIT(traverse_module_state->__pyx_codeobj__67); + Py_VISIT(traverse_module_state->__pyx_codeobj__69); + Py_VISIT(traverse_module_state->__pyx_codeobj__71); + Py_VISIT(traverse_module_state->__pyx_codeobj__73); + Py_VISIT(traverse_module_state->__pyx_codeobj__75); + Py_VISIT(traverse_module_state->__pyx_codeobj__77); + Py_VISIT(traverse_module_state->__pyx_codeobj__79); + Py_VISIT(traverse_module_state->__pyx_codeobj__81); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#define __pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr +#define __pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr +#endif +#define __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr +#define __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr +#define __pyx_kp_u_02X __pyx_mstate_global->__pyx_kp_u_02X +#define __pyx_kp_u_0X __pyx_mstate_global->__pyx_kp_u_0X +#define __pyx_kp_u_0x __pyx_mstate_global->__pyx_kp_u_0x +#define __pyx_kp_u_25 __pyx_mstate_global->__pyx_kp_u_25 +#define __pyx_kp_u_2E __pyx_mstate_global->__pyx_kp_u_2E +#define __pyx_kp_u_2E_2 __pyx_mstate_global->__pyx_kp_u_2E_2 +#define __pyx_kp_u_2E_2E __pyx_mstate_global->__pyx_kp_u_2E_2E +#define __pyx_kp_u_2E_2e __pyx_mstate_global->__pyx_kp_u_2E_2e +#define __pyx_kp_u_2E_3 __pyx_mstate_global->__pyx_kp_u_2E_3 +#define __pyx_kp_u_2e __pyx_mstate_global->__pyx_kp_u_2e +#define __pyx_kp_u_2e_2 __pyx_mstate_global->__pyx_kp_u_2e_2 +#define __pyx_kp_u_2e_2E __pyx_mstate_global->__pyx_kp_u_2e_2E +#define __pyx_kp_u_2e_2e __pyx_mstate_global->__pyx_kp_u_2e_2e +#define __pyx_kp_u_2e_3 __pyx_mstate_global->__pyx_kp_u_2e_3 +#define __pyx_kp_u_40 __pyx_mstate_global->__pyx_kp_u_40 +#define __pyx_n_s_ASCII_ALPHA __pyx_mstate_global->__pyx_n_s_ASCII_ALPHA +#define __pyx_n_s_ASCII_ALPHANUMERIC __pyx_mstate_global->__pyx_n_s_ASCII_ALPHANUMERIC +#define __pyx_n_s_ASCII_DIGIT __pyx_mstate_global->__pyx_n_s_ASCII_DIGIT +#define __pyx_n_s_ASCII_HEX_DIGIT __pyx_mstate_global->__pyx_n_s_ASCII_HEX_DIGIT +#define __pyx_n_s_ASCII_TAB_OR_NEWLINE __pyx_mstate_global->__pyx_n_s_ASCII_TAB_OR_NEWLINE +#define __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO __pyx_mstate_global->__pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO +#define __pyx_n_s_AUTHORITY __pyx_mstate_global->__pyx_n_s_AUTHORITY +#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError +#define __pyx_n_s_C0_CONTROL __pyx_mstate_global->__pyx_n_s_C0_CONTROL +#define __pyx_n_s_C0_CONTROL_OR_SPACE __pyx_mstate_global->__pyx_n_s_C0_CONTROL_OR_SPACE +#define __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET +#define __pyx_n_s_DEFAULT_PORTS __pyx_mstate_global->__pyx_n_s_DEFAULT_PORTS +#define __pyx_kp_u_Domain_name __pyx_mstate_global->__pyx_kp_u_Domain_name +#define __pyx_n_s_FILE __pyx_mstate_global->__pyx_n_s_FILE +#define __pyx_n_s_FILE_HOST __pyx_mstate_global->__pyx_n_s_FILE_HOST +#define __pyx_n_s_FILE_SLASH __pyx_mstate_global->__pyx_n_s_FILE_SLASH +#define __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS __pyx_mstate_global->__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS +#define __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS __pyx_mstate_global->__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS +#define __pyx_n_s_FRAGMENT __pyx_mstate_global->__pyx_n_s_FRAGMENT +#define __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET +#define __pyx_n_s_HOST __pyx_mstate_global->__pyx_n_s_HOST +#define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError +#define __pyx_n_s_List __pyx_mstate_global->__pyx_n_s_List +#define __pyx_kp_s_List_int __pyx_mstate_global->__pyx_kp_s_List_int +#define __pyx_n_s_NO_SCHEME __pyx_mstate_global->__pyx_n_s_NO_SCHEME +#define __pyx_n_s_None __pyx_mstate_global->__pyx_n_s_None +#define __pyx_n_s_OPAQUE_PATH __pyx_mstate_global->__pyx_n_s_OPAQUE_PATH +#define __pyx_n_s_Optional __pyx_mstate_global->__pyx_n_s_Optional +#define __pyx_kp_s_Optional_bool __pyx_mstate_global->__pyx_kp_s_Optional_bool +#define __pyx_kp_s_Optional_int __pyx_mstate_global->__pyx_kp_s_Optional_int +#define __pyx_kp_s_Optional_str __pyx_mstate_global->__pyx_kp_s_Optional_str +#define __pyx_n_s_PATH __pyx_mstate_global->__pyx_n_s_PATH +#define __pyx_n_s_PATH_OR_AUTHORITY __pyx_mstate_global->__pyx_n_s_PATH_OR_AUTHORITY +#define __pyx_n_s_PATH_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_PATH_PERCENT_ENCODE_SET +#define __pyx_n_s_PATH_START __pyx_mstate_global->__pyx_n_s_PATH_START +#define __pyx_n_s_PORT __pyx_mstate_global->__pyx_n_s_PORT +#define __pyx_n_s_PercentEncodeSet __pyx_mstate_global->__pyx_n_s_PercentEncodeSet +#define __pyx_n_s_QUERY __pyx_mstate_global->__pyx_n_s_QUERY +#define __pyx_n_s_QUERY_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_QUERY_PERCENT_ENCODE_SET +#define __pyx_n_s_RELATIVE __pyx_mstate_global->__pyx_n_s_RELATIVE +#define __pyx_n_s_RELATIVE_SLASH __pyx_mstate_global->__pyx_n_s_RELATIVE_SLASH +#define __pyx_n_s_SCHEME __pyx_mstate_global->__pyx_n_s_SCHEME +#define __pyx_n_s_SCHEME_CHARS __pyx_mstate_global->__pyx_n_s_SCHEME_CHARS +#define __pyx_n_s_SCHEME_START __pyx_mstate_global->__pyx_n_s_SCHEME_START +#define __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES __pyx_mstate_global->__pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES +#define __pyx_n_s_SPECIAL_AUTHORITY_SLASHES __pyx_mstate_global->__pyx_n_s_SPECIAL_AUTHORITY_SLASHES +#define __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE __pyx_mstate_global->__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE +#define __pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY __pyx_mstate_global->__pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY +#define __pyx_n_s_SPECIAL_SCHEMES __pyx_mstate_global->__pyx_n_s_SPECIAL_SCHEMES +#define __pyx_n_s_Tuple __pyx_mstate_global->__pyx_n_s_Tuple +#define __pyx_kp_s_Tuple_int_bool __pyx_mstate_global->__pyx_kp_s_Tuple_int_bool +#define __pyx_n_s_URL __pyx_mstate_global->__pyx_n_s_URL +#define __pyx_n_s_URL___init __pyx_mstate_global->__pyx_n_s_URL___init +#define __pyx_n_s_URL_has_opaque_path __pyx_mstate_global->__pyx_n_s_URL_has_opaque_path +#define __pyx_n_s_URL_scheme __pyx_mstate_global->__pyx_n_s_URL_scheme +#define __pyx_n_s_USERINFO_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_USERINFO_PERCENT_ENCODE_SET +#define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union +#define __pyx_kp_s_Union_int_List_int_str __pyx_mstate_global->__pyx_kp_s_Union_int_List_int_str +#define __pyx_kp_s_Union_str_List_str __pyx_mstate_global->__pyx_kp_s_Union_str_List_str +#define __pyx_kp_s_Union_str_int_List_int __pyx_mstate_global->__pyx_kp_s_Union_str_int_List_int +#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError +#define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10 +#define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11 +#define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12 +#define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13 +#define __pyx_n_s__14 __pyx_mstate_global->__pyx_n_s__14 +#define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14 +#define __pyx_kp_u__15 __pyx_mstate_global->__pyx_kp_u__15 +#define __pyx_kp_u__16 __pyx_mstate_global->__pyx_kp_u__16 +#define __pyx_kp_u__17 __pyx_mstate_global->__pyx_kp_u__17 +#define __pyx_kp_u__18 __pyx_mstate_global->__pyx_kp_u__18 +#define __pyx_kp_u__19 __pyx_mstate_global->__pyx_kp_u__19 +#define __pyx_n_s__2 __pyx_mstate_global->__pyx_n_s__2 +#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 +#define __pyx_kp_u__21 __pyx_mstate_global->__pyx_kp_u__21 +#define __pyx_kp_u__22 __pyx_mstate_global->__pyx_kp_u__22 +#define __pyx_kp_u__23 __pyx_mstate_global->__pyx_kp_u__23 +#define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 +#define __pyx_kp_u__30 __pyx_mstate_global->__pyx_kp_u__30 +#define __pyx_n_s__33 __pyx_mstate_global->__pyx_n_s__33 +#define __pyx_kp_u__36 __pyx_mstate_global->__pyx_kp_u__36 +#define __pyx_kp_u__37 __pyx_mstate_global->__pyx_kp_u__37 +#define __pyx_kp_u__38 __pyx_mstate_global->__pyx_kp_u__38 +#define __pyx_kp_u__39 __pyx_mstate_global->__pyx_kp_u__39 +#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 +#define __pyx_kp_u__40 __pyx_mstate_global->__pyx_kp_u__40 +#define __pyx_kp_u__41 __pyx_mstate_global->__pyx_kp_u__41 +#define __pyx_kp_u__42 __pyx_mstate_global->__pyx_kp_u__42 +#define __pyx_kp_u__43 __pyx_mstate_global->__pyx_kp_u__43 +#define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 +#define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 +#define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8 +#define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9 +#define __pyx_n_s_address __pyx_mstate_global->__pyx_n_s_address +#define __pyx_n_s_annotations __pyx_mstate_global->__pyx_n_s_annotations +#define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append +#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args +#define __pyx_n_s_ascii_domain __pyx_mstate_global->__pyx_n_s_ascii_domain +#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines +#define __pyx_n_s_at_sign_index __pyx_mstate_global->__pyx_n_s_at_sign_index +#define __pyx_n_s_at_sign_seen __pyx_mstate_global->__pyx_n_s_at_sign_seen +#define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base +#define __pyx_n_s_base_url __pyx_mstate_global->__pyx_n_s_base_url +#define __pyx_n_s_be_strict __pyx_mstate_global->__pyx_n_s_be_strict +#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool +#define __pyx_n_s_buffer __pyx_mstate_global->__pyx_n_s_buffer +#define __pyx_n_s_byte __pyx_mstate_global->__pyx_n_s_byte +#define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c +#define __pyx_n_s_canonicalize __pyx_mstate_global->__pyx_n_s_canonicalize +#define __pyx_n_s_check_bidi __pyx_mstate_global->__pyx_n_s_check_bidi +#define __pyx_n_s_check_hyphens __pyx_mstate_global->__pyx_n_s_check_hyphens +#define __pyx_n_s_check_joiners __pyx_mstate_global->__pyx_n_s_check_joiners +#define __pyx_n_s_chr __pyx_mstate_global->__pyx_n_s_chr +#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close +#define __pyx_n_s_code_point __pyx_mstate_global->__pyx_n_s_code_point +#define __pyx_n_s_compress __pyx_mstate_global->__pyx_n_s_compress +#define __pyx_n_s_counter __pyx_mstate_global->__pyx_n_s_counter +#define __pyx_n_s_current_index __pyx_mstate_global->__pyx_n_s_current_index +#define __pyx_n_s_current_length __pyx_mstate_global->__pyx_n_s_current_length +#define __pyx_n_s_default_port_seen __pyx_mstate_global->__pyx_n_s_default_port_seen +#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict +#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable +#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc +#define __pyx_n_s_domain __pyx_mstate_global->__pyx_n_s_domain +#define __pyx_n_s_domain_to_ascii __pyx_mstate_global->__pyx_n_s_domain_to_ascii +#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable +#define __pyx_n_s_encode_output __pyx_mstate_global->__pyx_n_s_encode_output +#define __pyx_n_s_encode_set __pyx_mstate_global->__pyx_n_s_encode_set +#define __pyx_n_s_encoded __pyx_mstate_global->__pyx_n_s_encoded +#define __pyx_n_s_encoded_code_points __pyx_mstate_global->__pyx_n_s_encoded_code_points +#define __pyx_n_s_encoder __pyx_mstate_global->__pyx_n_s_encoder +#define __pyx_n_s_encoding __pyx_mstate_global->__pyx_n_s_encoding +#define __pyx_n_s_encoding_2 __pyx_mstate_global->__pyx_n_s_encoding_2 +#define __pyx_n_s_ends_in_number __pyx_mstate_global->__pyx_n_s_ends_in_number +#define __pyx_n_s_ends_in_number_locals_genexpr __pyx_mstate_global->__pyx_n_s_ends_in_number_locals_genexpr +#define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate +#define __pyx_n_s_exclude_fragment __pyx_mstate_global->__pyx_n_s_exclude_fragment +#define __pyx_n_u_file __pyx_mstate_global->__pyx_n_u_file +#define __pyx_n_s_floor __pyx_mstate_global->__pyx_n_s_floor +#define __pyx_n_s_fragment __pyx_mstate_global->__pyx_n_s_fragment +#define __pyx_n_s_fragment_percent_encode_set __pyx_mstate_global->__pyx_n_s_fragment_percent_encode_set +#define __pyx_n_u_ftp __pyx_mstate_global->__pyx_n_u_ftp +#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc +#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr +#define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get +#define __pyx_n_s_get_encoder __pyx_mstate_global->__pyx_n_s_get_encoder +#define __pyx_n_s_get_ipv6_first_longest_0_piece __pyx_mstate_global->__pyx_n_s_get_ipv6_first_longest_0_piece +#define __pyx_n_s_get_output_encoding __pyx_mstate_global->__pyx_n_s_get_output_encoding +#define __pyx_n_s_greater_than __pyx_mstate_global->__pyx_n_s_greater_than +#define __pyx_n_s_has_opaque_path __pyx_mstate_global->__pyx_n_s_has_opaque_path +#define __pyx_n_s_host __pyx_mstate_global->__pyx_n_s_host +#define __pyx_n_s_hostname __pyx_mstate_global->__pyx_n_s_hostname +#define __pyx_n_u_http __pyx_mstate_global->__pyx_n_u_http +#define __pyx_n_u_https __pyx_mstate_global->__pyx_n_u_https +#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i +#define __pyx_n_s_idempotent_utf_8_percent_encode __pyx_mstate_global->__pyx_n_s_idempotent_utf_8_percent_encode +#define __pyx_n_s_ignore0 __pyx_mstate_global->__pyx_n_s_ignore0 +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index +#define __pyx_n_s_index_length __pyx_mstate_global->__pyx_n_s_index_length +#define __pyx_n_s_infra __pyx_mstate_global->__pyx_n_s_infra +#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init +#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass +#define __pyx_n_s_input __pyx_mstate_global->__pyx_n_s_input +#define __pyx_n_s_input_lenght __pyx_mstate_global->__pyx_n_s_input_lenght +#define __pyx_n_s_input_length __pyx_mstate_global->__pyx_n_s_input_length +#define __pyx_n_s_inside_brackets __pyx_mstate_global->__pyx_n_s_inside_brackets +#define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int +#define __pyx_n_s_ipv4 __pyx_mstate_global->__pyx_n_s_ipv4 +#define __pyx_n_s_ipv4_piece __pyx_mstate_global->__pyx_n_s_ipv4_piece +#define __pyx_kp_u_is_an_empty_string_after_conver __pyx_mstate_global->__pyx_kp_u_is_an_empty_string_after_conver +#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine +#define __pyx_n_s_is_double_dot_path_segment __pyx_mstate_global->__pyx_n_s_is_double_dot_path_segment +#define __pyx_n_s_is_single_dot_path_segment __pyx_mstate_global->__pyx_n_s_is_single_dot_path_segment +#define __pyx_n_s_is_special __pyx_mstate_global->__pyx_n_s_is_special +#define __pyx_n_s_is_windows_drive_letter __pyx_mstate_global->__pyx_n_s_is_windows_drive_letter +#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled +#define __pyx_n_s_isomorph __pyx_mstate_global->__pyx_n_s_isomorph +#define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys +#define __pyx_n_s_last __pyx_mstate_global->__pyx_n_s_last +#define __pyx_n_s_length __pyx_mstate_global->__pyx_n_s_length +#define __pyx_n_u_localhost __pyx_mstate_global->__pyx_n_u_localhost +#define __pyx_n_s_lower __pyx_mstate_global->__pyx_n_s_lower +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_math __pyx_mstate_global->__pyx_n_s_math +#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass +#define __pyx_n_s_min_length __pyx_mstate_global->__pyx_n_s_min_length +#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module +#define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_number __pyx_mstate_global->__pyx_n_s_number +#define __pyx_n_s_numbers __pyx_mstate_global->__pyx_n_s_numbers +#define __pyx_n_s_numbers_seen __pyx_mstate_global->__pyx_n_s_numbers_seen +#define __pyx_n_s_output __pyx_mstate_global->__pyx_n_s_output +#define __pyx_n_s_parse_host __pyx_mstate_global->__pyx_n_s_parse_host +#define __pyx_n_s_parse_ipv4 __pyx_mstate_global->__pyx_n_s_parse_ipv4 +#define __pyx_n_s_parse_ipv4_locals_genexpr __pyx_mstate_global->__pyx_n_s_parse_ipv4_locals_genexpr +#define __pyx_n_s_parse_ipv4_number __pyx_mstate_global->__pyx_n_s_parse_ipv4_number +#define __pyx_n_s_parse_ipv6 __pyx_mstate_global->__pyx_n_s_parse_ipv6 +#define __pyx_n_s_parse_opaque_host __pyx_mstate_global->__pyx_n_s_parse_opaque_host +#define __pyx_n_s_parse_url __pyx_mstate_global->__pyx_n_s_parse_url +#define __pyx_n_s_part __pyx_mstate_global->__pyx_n_s_part +#define __pyx_n_s_parts __pyx_mstate_global->__pyx_n_s_parts +#define __pyx_n_s_password __pyx_mstate_global->__pyx_n_s_password +#define __pyx_n_s_password_token_seen __pyx_mstate_global->__pyx_n_s_password_token_seen +#define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path +#define __pyx_n_s_path_percent_encode_set __pyx_mstate_global->__pyx_n_s_path_percent_encode_set +#define __pyx_n_s_path_token_seen __pyx_mstate_global->__pyx_n_s_path_token_seen +#define __pyx_n_s_percent_encode_after_encoding __pyx_mstate_global->__pyx_n_s_percent_encode_after_encoding +#define __pyx_n_s_percent_encode_set __pyx_mstate_global->__pyx_n_s_percent_encode_set +#define __pyx_n_s_piece __pyx_mstate_global->__pyx_n_s_piece +#define __pyx_n_s_piece_index __pyx_mstate_global->__pyx_n_s_piece_index +#define __pyx_n_s_pointer __pyx_mstate_global->__pyx_n_s_pointer +#define __pyx_n_s_port __pyx_mstate_global->__pyx_n_s_port +#define __pyx_n_s_port_token_seen __pyx_mstate_global->__pyx_n_s_port_token_seen +#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare +#define __pyx_n_s_property __pyx_mstate_global->__pyx_n_s_property +#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname +#define __pyx_n_s_query __pyx_mstate_global->__pyx_n_s_query +#define __pyx_n_s_query_percent_encode_set __pyx_mstate_global->__pyx_n_s_query_percent_encode_set +#define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r +#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range +#define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result +#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return +#define __pyx_n_s_scheme __pyx_mstate_global->__pyx_n_s_scheme +#define __pyx_n_s_scheme_2 __pyx_mstate_global->__pyx_n_s_scheme_2 +#define __pyx_n_s_segment __pyx_mstate_global->__pyx_n_s_segment +#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self +#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send +#define __pyx_n_s_separator __pyx_mstate_global->__pyx_n_s_separator +#define __pyx_n_s_serialize_host __pyx_mstate_global->__pyx_n_s_serialize_host +#define __pyx_n_s_serialize_ipv4 __pyx_mstate_global->__pyx_n_s_serialize_ipv4 +#define __pyx_n_s_serialize_ipv6 __pyx_mstate_global->__pyx_n_s_serialize_ipv6 +#define __pyx_n_s_serialize_url __pyx_mstate_global->__pyx_n_s_serialize_url +#define __pyx_n_s_serialize_url_path __pyx_mstate_global->__pyx_n_s_serialize_url_path +#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name +#define __pyx_n_s_setter __pyx_mstate_global->__pyx_n_s_setter +#define __pyx_n_s_shorten_path __pyx_mstate_global->__pyx_n_s_shorten_path +#define __pyx_n_s_skip_authority_shortcut __pyx_mstate_global->__pyx_n_s_skip_authority_shortcut +#define __pyx_n_s_space_as_plus __pyx_mstate_global->__pyx_n_s_space_as_plus +#define __pyx_n_s_special_query_percent_encode_set __pyx_mstate_global->__pyx_n_s_special_query_percent_encode_set +#define __pyx_n_s_starts_with_windows_drive_lette __pyx_mstate_global->__pyx_n_s_starts_with_windows_drive_lette +#define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state +#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str +#define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip +#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super +#define __pyx_n_s_swaps __pyx_mstate_global->__pyx_n_s_swaps +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw +#define __pyx_n_s_to_ascii __pyx_mstate_global->__pyx_n_s_to_ascii +#define __pyx_n_s_transitional_processing __pyx_mstate_global->__pyx_n_s_transitional_processing +#define __pyx_n_s_translate __pyx_mstate_global->__pyx_n_s_translate +#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing +#define __pyx_n_s_unquote __pyx_mstate_global->__pyx_n_s_unquote +#define __pyx_n_s_url __pyx_mstate_global->__pyx_n_s_url +#define __pyx_n_s_urllib_parse __pyx_mstate_global->__pyx_n_s_urllib_parse +#define __pyx_n_s_use_std3_ascii_rules __pyx_mstate_global->__pyx_n_s_use_std3_ascii_rules +#define __pyx_n_s_userinfo_percent_encode_set __pyx_mstate_global->__pyx_n_s_userinfo_percent_encode_set +#define __pyx_n_s_username __pyx_mstate_global->__pyx_n_s_username +#define __pyx_kp_u_utf_8 __pyx_mstate_global->__pyx_kp_u_utf_8 +#define __pyx_n_s_utf_8_percent_encode __pyx_mstate_global->__pyx_n_s_utf_8_percent_encode +#define __pyx_n_s_util __pyx_mstate_global->__pyx_n_s_util +#define __pyx_n_s_utr46 __pyx_mstate_global->__pyx_n_s_utr46 +#define __pyx_n_s_validation_error __pyx_mstate_global->__pyx_n_s_validation_error +#define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value +#define __pyx_n_s_verify_dns_length __pyx_mstate_global->__pyx_n_s_verify_dns_length +#define __pyx_n_s_w3lib__url __pyx_mstate_global->__pyx_n_s_w3lib__url +#define __pyx_kp_s_w3lib__url_pyx __pyx_mstate_global->__pyx_kp_s_w3lib__url_pyx +#define __pyx_n_u_ws __pyx_mstate_global->__pyx_n_u_ws +#define __pyx_n_u_wss __pyx_mstate_global->__pyx_n_u_wss +#define __pyx_n_u_x __pyx_mstate_global->__pyx_n_u_x +#define __pyx_n_u_xmlcharrefreplace __pyx_mstate_global->__pyx_n_u_xmlcharrefreplace +#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 +#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 +#define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 +#define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 +#define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 +#define __pyx_int_5 __pyx_mstate_global->__pyx_int_5 +#define __pyx_int_6 __pyx_mstate_global->__pyx_int_6 +#define __pyx_int_7 __pyx_mstate_global->__pyx_int_7 +#define __pyx_int_8 __pyx_mstate_global->__pyx_int_8 +#define __pyx_int_9 __pyx_mstate_global->__pyx_int_9 +#define __pyx_int_10 __pyx_mstate_global->__pyx_int_10 +#define __pyx_int_11 __pyx_mstate_global->__pyx_int_11 +#define __pyx_int_12 __pyx_mstate_global->__pyx_int_12 +#define __pyx_int_13 __pyx_mstate_global->__pyx_int_13 +#define __pyx_int_14 __pyx_mstate_global->__pyx_int_14 +#define __pyx_int_15 __pyx_mstate_global->__pyx_int_15 +#define __pyx_int_16 __pyx_mstate_global->__pyx_int_16 +#define __pyx_int_17 __pyx_mstate_global->__pyx_int_17 +#define __pyx_int_18 __pyx_mstate_global->__pyx_int_18 +#define __pyx_int_19 __pyx_mstate_global->__pyx_int_19 +#define __pyx_int_21 __pyx_mstate_global->__pyx_int_21 +#define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 +#define __pyx_int_80 __pyx_mstate_global->__pyx_int_80 +#define __pyx_int_255 __pyx_mstate_global->__pyx_int_255 +#define __pyx_int_256 __pyx_mstate_global->__pyx_int_256 +#define __pyx_int_443 __pyx_mstate_global->__pyx_int_443 +#define __pyx_int_65535 __pyx_mstate_global->__pyx_int_65535 +#define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 +#define __pyx_slice_ __pyx_mstate_global->__pyx_slice_ +#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 +#define __pyx_slice__20 __pyx_mstate_global->__pyx_slice__20 +#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 +#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 +#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 +#define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 +#define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44 +#define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46 +#define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48 +#define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50 +#define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52 +#define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 +#define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 +#define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58 +#define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60 +#define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 +#define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 +#define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 +#define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70 +#define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72 +#define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74 +#define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 +#define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78 +#define __pyx_tuple__80 __pyx_mstate_global->__pyx_tuple__80 +#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 +#define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 +#define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 +#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 +#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 +#define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 +#define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45 +#define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 +#define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 +#define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 +#define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 +#define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 +#define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 +#define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 +#define __pyx_codeobj__61 __pyx_mstate_global->__pyx_codeobj__61 +#define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63 +#define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64 +#define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 +#define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67 +#define __pyx_codeobj__69 __pyx_mstate_global->__pyx_codeobj__69 +#define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71 +#define __pyx_codeobj__73 __pyx_mstate_global->__pyx_codeobj__73 +#define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75 +#define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77 +#define __pyx_codeobj__79 __pyx_mstate_global->__pyx_codeobj__79 +#define __pyx_codeobj__81 __pyx_mstate_global->__pyx_codeobj__81 +/* #### Code section: module_code ### */ + +/* "w3lib/_url.pyx":95 + * _path_token_seen: bool = False + * + * def __init__(self) -> None: # <<<<<<<<<<<<<< + * self.path = [] + * self.is_special = False + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_1__init__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_1__init__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 95, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 95, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._URL.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5w3lib_4_url_4_URL___init__(__pyx_self, __pyx_v_self); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 1); + + /* "w3lib/_url.pyx":96 + * + * def __init__(self) -> None: + * self.path = [] # <<<<<<<<<<<<<< + * self.is_special = False + * + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":97 + * def __init__(self) -> None: + * self.path = [] + * self.is_special = False # <<<<<<<<<<<<<< + * + * def has_opaque_path(self) -> bool: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, Py_False) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + + /* "w3lib/_url.pyx":95 + * _path_token_seen: bool = False + * + * def __init__(self) -> None: # <<<<<<<<<<<<<< + * self.path = [] + * self.is_special = False + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("w3lib._url._URL.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":99 + * self.is_special = False + * + * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< + * return isinstance(self.path, str) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_3has_opaque_path = {"has_opaque_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("has_opaque_path (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "has_opaque_path") < 0)) __PYX_ERR(0, 99, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("has_opaque_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 99, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._URL.has_opaque_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(__pyx_self, __pyx_v_self); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("has_opaque_path", 1); + + /* "w3lib/_url.pyx":100 + * + * def has_opaque_path(self) -> bool: + * return isinstance(self.path, str) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyUnicode_Check(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":99 + * self.is_special = False + * + * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< + * return isinstance(self.path, str) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("w3lib._url._URL.has_opaque_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":102 + * return isinstance(self.path, str) + * + * @property # <<<<<<<<<<<<<< + * def scheme(self) -> str: + * return self._scheme + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_5scheme(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_5scheme = {"scheme", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_5scheme, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_5scheme(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("scheme (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 102, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("scheme", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 102, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5w3lib_4_url_4_URL_4scheme(__pyx_self, __pyx_v_self); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_4_URL_4scheme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("scheme", 1); + + /* "w3lib/_url.pyx":104 + * @property + * def scheme(self) -> str: + * return self._scheme # <<<<<<<<<<<<<< + * + * @scheme.setter + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":102 + * return isinstance(self.path, str) + * + * @property # <<<<<<<<<<<<<< + * def scheme(self) -> str: + * return self._scheme + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":106 + * return self._scheme + * + * @scheme.setter # <<<<<<<<<<<<<< + * def scheme(self, value: str) -> None: + * self._scheme = value + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_7scheme(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_7scheme = {"scheme", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_7scheme, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_7scheme(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_value = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("scheme (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, 1); __PYX_ERR(0, 106, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 106, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_value = ((PyObject*)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 106, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyUnicode_Type), 0, "value", 1))) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_4_URL_6scheme(__pyx_self, __pyx_v_self, __pyx_v_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_4_URL_6scheme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("scheme", 1); + + /* "w3lib/_url.pyx":108 + * @scheme.setter + * def scheme(self, value: str) -> None: + * self._scheme = value # <<<<<<<<<<<<<< + * self.is_special = value in _SPECIAL_SCHEMES + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scheme, __pyx_v_value) < 0) __PYX_ERR(0, 108, __pyx_L1_error) + + /* "w3lib/_url.pyx":109 + * def scheme(self, value: str) -> None: + * self._scheme = value + * self.is_special = value in _SPECIAL_SCHEMES # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, __pyx_t_1) < 0) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":106 + * return self._scheme + * + * @scheme.setter # <<<<<<<<<<<<<< + * def scheme(self, value: str) -> None: + * self._scheme = value + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":116 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path + * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_1_shorten_path(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_1_shorten_path = {"_shorten_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_1_shorten_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_1_shorten_path(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_url = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_shorten_path (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_shorten_path") < 0)) __PYX_ERR(0, 116, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_url = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_shorten_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 116, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._shorten_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5w3lib_4_url__shorten_path(__pyx_self, __pyx_v_url); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url__shorten_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { + PyObject *__pyx_v_path = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_shorten_path", 1); + + /* "w3lib/_url.pyx":117 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path + * def _shorten_path(url: _URL) -> None: + * path = url.path # <<<<<<<<<<<<<< + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + * return + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_path = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":118 + * def _shorten_path(url: _URL) -> None: + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): # <<<<<<<<<<<<<< + * return + * url.path = path[:-1] + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = PyObject_Length(__pyx_v_path); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_4 == 1); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":119 + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + * return # <<<<<<<<<<<<<< + * url.path = path[:-1] + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "w3lib/_url.pyx":118 + * def _shorten_path(url: _URL) -> None: + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): # <<<<<<<<<<<<<< + * return + * url.path = path[:-1] + */ + } + + /* "w3lib/_url.pyx":120 + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + * return + * url.path = path[:-1] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":116 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path + * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._shorten_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_path); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":125 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode + * # Extended to handled cases where % is to be percent-encoded. + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_3_percent_encode_after_encoding(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_3_percent_encode_after_encoding = {"_percent_encode_after_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_3_percent_encode_after_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_3_percent_encode_after_encoding(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_percent_encode_set = 0; + PyObject *__pyx_v_space_as_plus = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_percent_encode_after_encoding (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_encoding,&__pyx_n_s_percent_encode_set,&__pyx_n_s_space_as_plus,0}; + + /* "w3lib/_url.pyx":130 + * encoding: str, + * percent_encode_set: _PercentEncodeSet, + * space_as_plus: bool = False, # <<<<<<<<<<<<<< + * ) -> str: + * encoder = _get_encoder(encoding) + */ + values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + if (likely(__pyx_kwds)) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 125, __pyx_L3_error) + } + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_percent_encode_set)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_percent_encode_set); __PYX_ERR(0, 125, __pyx_L3_error) + } + } + if (kw_args == 1) { + const Py_ssize_t index = 3; + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_percent_encode_after_encoding") < 0)) __PYX_ERR(0, 125, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 125, __pyx_L3_error) + } + __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_encoding = ((PyObject*)values[1]); + __pyx_v_percent_encode_set = values[2]; + __pyx_v_space_as_plus = values[3]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_percent_encode_after_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 125, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._percent_encode_after_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 126, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(__pyx_self, __pyx_v_input, __pyx_v_encoding, __pyx_v_percent_encode_set, __pyx_v_space_as_plus); + + /* "w3lib/_url.pyx":125 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode + * # Extended to handled cases where % is to be percent-encoded. + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set, PyObject *__pyx_v_space_as_plus) { + PyObject *__pyx_v_encoder = NULL; + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_v_encode_output = NULL; + CYTHON_UNUSED PyObject *__pyx_v__ = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_byte = NULL; + PyObject *__pyx_v_isomorph = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *(*__pyx_t_6)(PyObject *); + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_percent_encode_after_encoding", 1); + + /* "w3lib/_url.pyx":132 + * space_as_plus: bool = False, + * ) -> str: + * encoder = _get_encoder(encoding) # <<<<<<<<<<<<<< + * output = "" + * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_v_encoder = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":133 + * ) -> str: + * encoder = _get_encoder(encoding) + * output = "" # <<<<<<<<<<<<<< + * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B + * # instead of &#NNN; + */ + __Pyx_INCREF(__pyx_kp_u__2); + __pyx_v_output = __pyx_kp_u__2; + + /* "w3lib/_url.pyx":136 + * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B + * # instead of &#NNN; + * encode_output, _ = encoder(input, "xmlcharrefreplace") # <<<<<<<<<<<<<< + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + * byte = encode_output[i] + */ + __Pyx_INCREF(__pyx_v_encoder); + __pyx_t_2 = __pyx_v_encoder; __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_input, __pyx_n_u_xmlcharrefreplace}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 136, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); + index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_6 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_L4_unpacking_done:; + } + __pyx_v_encode_output = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v__ = __pyx_t_3; + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":137 + * # instead of &#NNN; + * encode_output, _ = encoder(input, "xmlcharrefreplace") + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: + */ + __pyx_t_7 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 137, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 137, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 137, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 137, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 137, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_8(__pyx_t_1); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 137, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":138 + * encode_output, _ = encoder(input, "xmlcharrefreplace") + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + * byte = encode_output[i] # <<<<<<<<<<<<<< + * if space_as_plus and byte == 0x20: + * output += "+" + */ + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_byte, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":139 + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< + * output += "+" + * continue + */ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_space_as_plus); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 139, __pyx_L1_error) + if (__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_10 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_byte, __pyx_int_32, 0x20, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_9 = __pyx_t_10; + __pyx_L8_bool_binop_done:; + if (__pyx_t_9) { + + /* "w3lib/_url.pyx":140 + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: + * output += "+" # <<<<<<<<<<<<<< + * continue + * isomorph = chr(byte) + */ + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":141 + * if space_as_plus and byte == 0x20: + * output += "+" + * continue # <<<<<<<<<<<<<< + * isomorph = chr(byte) + * if isomorph not in percent_encode_set: + */ + goto __pyx_L5_continue; + + /* "w3lib/_url.pyx":139 + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< + * output += "+" + * continue + */ + } + + /* "w3lib/_url.pyx":142 + * output += "+" + * continue + * isomorph = chr(byte) # <<<<<<<<<<<<<< + * if isomorph not in percent_encode_set: + * output += isomorph + */ + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_isomorph, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":143 + * continue + * isomorph = chr(byte) + * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< + * output += isomorph + * elif isomorph == "%": + */ + __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_isomorph, __pyx_v_percent_encode_set, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 143, __pyx_L1_error) + if (__pyx_t_9) { + + /* "w3lib/_url.pyx":144 + * isomorph = chr(byte) + * if isomorph not in percent_encode_set: + * output += isomorph # <<<<<<<<<<<<<< + * elif isomorph == "%": + * if ( + */ + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_v_isomorph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":143 + * continue + * isomorph = chr(byte) + * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< + * output += isomorph + * elif isomorph == "%": + */ + goto __pyx_L10; + } + + /* "w3lib/_url.pyx":145 + * if isomorph not in percent_encode_set: + * output += isomorph + * elif isomorph == "%": # <<<<<<<<<<<<<< + * if ( + * len(encode_output) <= i + 2 + */ + __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_isomorph, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 145, __pyx_L1_error) + if (__pyx_t_9) { + + /* "w3lib/_url.pyx":147 + * elif isomorph == "%": + * if ( + * len(encode_output) <= i + 2 # <<<<<<<<<<<<<< + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT + * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT + */ + __pyx_t_11 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L12_bool_binop_done; + } + + /* "w3lib/_url.pyx":148 + * if ( + * len(encode_output) <= i + 2 + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT + * ): + */ + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L12_bool_binop_done; + } + + /* "w3lib/_url.pyx":149 + * len(encode_output) <= i + 2 + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT + * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * ): + * output += "%25" + */ + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = __pyx_t_10; + __pyx_L12_bool_binop_done:; + + /* "w3lib/_url.pyx":146 + * output += isomorph + * elif isomorph == "%": + * if ( # <<<<<<<<<<<<<< + * len(encode_output) <= i + 2 + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT + */ + if (__pyx_t_9) { + + /* "w3lib/_url.pyx":151 + * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT + * ): + * output += "%25" # <<<<<<<<<<<<<< + * else: + * output += "%" + */ + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u_25); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":146 + * output += isomorph + * elif isomorph == "%": + * if ( # <<<<<<<<<<<<<< + * len(encode_output) <= i + 2 + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT + */ + goto __pyx_L11; + } + + /* "w3lib/_url.pyx":153 + * output += "%25" + * else: + * output += "%" # <<<<<<<<<<<<<< + * else: + * output += f"%{byte:02X}" + */ + /*else*/ { + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; + } + __pyx_L11:; + + /* "w3lib/_url.pyx":145 + * if isomorph not in percent_encode_set: + * output += isomorph + * elif isomorph == "%": # <<<<<<<<<<<<<< + * if ( + * len(encode_output) <= i + 2 + */ + goto __pyx_L10; + } + + /* "w3lib/_url.pyx":155 + * output += "%" + * else: + * output += f"%{byte:02X}" # <<<<<<<<<<<<<< + * + * return output + */ + /*else*/ { + __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_byte, __pyx_kp_u_02X); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; + } + __pyx_L10:; + + /* "w3lib/_url.pyx":137 + * # instead of &#NNN; + * encode_output, _ = encoder(input, "xmlcharrefreplace") + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: + */ + __pyx_L5_continue:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":157 + * output += f"%{byte:02X}" + * + * return output # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_output); + __pyx_r = ((PyObject*)__pyx_v_output); + goto __pyx_L0; + + /* "w3lib/_url.pyx":125 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode + * # Extended to handled cases where % is to be percent-encoded. + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("w3lib._url._percent_encode_after_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_encoder); + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XDECREF(__pyx_v_encode_output); + __Pyx_XDECREF(__pyx_v__); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_byte); + __Pyx_XDECREF(__pyx_v_isomorph); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":175 + * + * + * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< + * address = [0] * 8 + * piece_index = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_5_parse_ipv6(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_5_parse_ipv6 = {"_parse_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_5_parse_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_5_parse_ipv6(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_parse_ipv6 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv6") < 0)) __PYX_ERR(0, 175, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_parse_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 175, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._parse_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_4_parse_ipv6(__pyx_self, __pyx_v_input); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + PyObject *__pyx_v_address = NULL; + PyObject *__pyx_v_piece_index = NULL; + PyObject *__pyx_v_compress = NULL; + PyObject *__pyx_v_pointer = NULL; + Py_ssize_t __pyx_v_input_lenght; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_v_numbers_seen = NULL; + PyObject *__pyx_v_ipv4_piece = NULL; + PyObject *__pyx_v_number = NULL; + PyObject *__pyx_v_swaps = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_ipv6", 1); + + /* "w3lib/_url.pyx":176 + * + * def _parse_ipv6(input: str) -> List[int]: + * address = [0] * 8 # <<<<<<<<<<<<<< + * piece_index = 0 + * compress = None + */ + __pyx_t_1 = PyList_New(1 * 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < 8; __pyx_temp++) { + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0)) __PYX_ERR(0, 176, __pyx_L1_error); + } + } + __pyx_v_address = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":177 + * def _parse_ipv6(input: str) -> List[int]: + * address = [0] * 8 + * piece_index = 0 # <<<<<<<<<<<<<< + * compress = None + * pointer = 0 + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_piece_index = __pyx_int_0; + + /* "w3lib/_url.pyx":178 + * address = [0] * 8 + * piece_index = 0 + * compress = None # <<<<<<<<<<<<<< + * pointer = 0 + * input_lenght = len(input) + */ + __Pyx_INCREF(Py_None); + __pyx_v_compress = Py_None; + + /* "w3lib/_url.pyx":179 + * piece_index = 0 + * compress = None + * pointer = 0 # <<<<<<<<<<<<<< + * input_lenght = len(input) + * if pointer < input_lenght and input[pointer] == ":": + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_pointer = __pyx_int_0; + + /* "w3lib/_url.pyx":180 + * compress = None + * pointer = 0 + * input_lenght = len(input) # <<<<<<<<<<<<<< + * if pointer < input_lenght and input[pointer] == ":": + * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + */ + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_v_input_lenght = __pyx_t_2; + + /* "w3lib/_url.pyx":181 + * pointer = 0 + * input_lenght = len(input) + * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< + * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + * raise ValueError + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L4_bool_binop_done:; + if (__pyx_t_3) { + + /* "w3lib/_url.pyx":182 + * input_lenght = len(input) + * if pointer < input_lenght and input[pointer] == ":": + * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 2 + */ + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L7_bool_binop_done:; + if (unlikely(__pyx_t_3)) { + + /* "w3lib/_url.pyx":183 + * if pointer < input_lenght and input[pointer] == ":": + * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + * raise ValueError # <<<<<<<<<<<<<< + * pointer += 2 + * piece_index += 1 + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 183, __pyx_L1_error) + + /* "w3lib/_url.pyx":182 + * input_lenght = len(input) + * if pointer < input_lenght and input[pointer] == ":": + * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 2 + */ + } + + /* "w3lib/_url.pyx":184 + * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + * raise ValueError + * pointer += 2 # <<<<<<<<<<<<<< + * piece_index += 1 + * compress = piece_index + */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":185 + * raise ValueError + * pointer += 2 + * piece_index += 1 # <<<<<<<<<<<<<< + * compress = piece_index + * while pointer < input_lenght: + */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":186 + * pointer += 2 + * piece_index += 1 + * compress = piece_index # <<<<<<<<<<<<<< + * while pointer < input_lenght: + * if piece_index == 8: + */ + __Pyx_INCREF(__pyx_v_piece_index); + __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); + + /* "w3lib/_url.pyx":181 + * pointer = 0 + * input_lenght = len(input) + * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< + * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + * raise ValueError + */ + } + + /* "w3lib/_url.pyx":187 + * piece_index += 1 + * compress = piece_index + * while pointer < input_lenght: # <<<<<<<<<<<<<< + * if piece_index == 8: + * raise ValueError + */ + while (1) { + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_3) break; + + /* "w3lib/_url.pyx":188 + * compress = piece_index + * while pointer < input_lenght: + * if piece_index == 8: # <<<<<<<<<<<<<< + * raise ValueError + * if input[pointer] == ":": + */ + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 188, __pyx_L1_error) + if (unlikely(__pyx_t_3)) { + + /* "w3lib/_url.pyx":189 + * while pointer < input_lenght: + * if piece_index == 8: + * raise ValueError # <<<<<<<<<<<<<< + * if input[pointer] == ":": + * if compress is not None: + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 189, __pyx_L1_error) + + /* "w3lib/_url.pyx":188 + * compress = piece_index + * while pointer < input_lenght: + * if piece_index == 8: # <<<<<<<<<<<<<< + * raise ValueError + * if input[pointer] == ":": + */ + } + + /* "w3lib/_url.pyx":190 + * if piece_index == 8: + * raise ValueError + * if input[pointer] == ":": # <<<<<<<<<<<<<< + * if compress is not None: + * raise ValueError + */ + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_3) { + + /* "w3lib/_url.pyx":191 + * raise ValueError + * if input[pointer] == ":": + * if compress is not None: # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 1 + */ + __pyx_t_3 = (__pyx_v_compress != Py_None); + if (unlikely(__pyx_t_3)) { + + /* "w3lib/_url.pyx":192 + * if input[pointer] == ":": + * if compress is not None: + * raise ValueError # <<<<<<<<<<<<<< + * pointer += 1 + * piece_index += 1 + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 192, __pyx_L1_error) + + /* "w3lib/_url.pyx":191 + * raise ValueError + * if input[pointer] == ":": + * if compress is not None: # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 1 + */ + } + + /* "w3lib/_url.pyx":193 + * if compress is not None: + * raise ValueError + * pointer += 1 # <<<<<<<<<<<<<< + * piece_index += 1 + * compress = piece_index + */ + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_6); + __pyx_t_6 = 0; + + /* "w3lib/_url.pyx":194 + * raise ValueError + * pointer += 1 + * piece_index += 1 # <<<<<<<<<<<<<< + * compress = piece_index + * continue + */ + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_6); + __pyx_t_6 = 0; + + /* "w3lib/_url.pyx":195 + * pointer += 1 + * piece_index += 1 + * compress = piece_index # <<<<<<<<<<<<<< + * continue + * value = length = 0 + */ + __Pyx_INCREF(__pyx_v_piece_index); + __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); + + /* "w3lib/_url.pyx":196 + * piece_index += 1 + * compress = piece_index + * continue # <<<<<<<<<<<<<< + * value = length = 0 + * while ( + */ + goto __pyx_L9_continue; + + /* "w3lib/_url.pyx":190 + * if piece_index == 8: + * raise ValueError + * if input[pointer] == ":": # <<<<<<<<<<<<<< + * if compress is not None: + * raise ValueError + */ + } + + /* "w3lib/_url.pyx":197 + * compress = piece_index + * continue + * value = length = 0 # <<<<<<<<<<<<<< + * while ( + * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT + */ + __Pyx_INCREF(__pyx_int_0); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_int_0); + __Pyx_INCREF(__pyx_int_0); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_int_0); + + /* "w3lib/_url.pyx":198 + * continue + * value = length = 0 + * while ( # <<<<<<<<<<<<<< + * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT + * ): + */ + while (1) { + + /* "w3lib/_url.pyx":199 + * value = length = 0 + * while ( + * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * ): + * value = value * 0x10 + int(input[pointer], base=16) + */ + __pyx_t_6 = PyObject_RichCompare(__pyx_v_length, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L16_bool_binop_done:; + if (!__pyx_t_3) break; + + /* "w3lib/_url.pyx":201 + * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT + * ): + * value = value * 0x10 + int(input[pointer], base=16) # <<<<<<<<<<<<<< + * pointer += 1 + * length += 1 + */ + __pyx_t_6 = __Pyx_PyInt_MultiplyObjC(__pyx_v_value, __pyx_int_16, 0x10, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":202 + * ): + * value = value * 0x10 + int(input[pointer], base=16) + * pointer += 1 # <<<<<<<<<<<<<< + * length += 1 + * if pointer < input_lenght and input[pointer] == ".": + */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":203 + * value = value * 0x10 + int(input[pointer], base=16) + * pointer += 1 + * length += 1 # <<<<<<<<<<<<<< + * if pointer < input_lenght and input[pointer] == ".": + * if length == 0: + */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_length, __pyx_t_1); + __pyx_t_1 = 0; + } + + /* "w3lib/_url.pyx":204 + * pointer += 1 + * length += 1 + * if pointer < input_lenght and input[pointer] == ".": # <<<<<<<<<<<<<< + * if length == 0: + * raise ValueError + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L20_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L20_bool_binop_done:; + if (__pyx_t_3) { + + /* "w3lib/_url.pyx":205 + * length += 1 + * if pointer < input_lenght and input[pointer] == ".": + * if length == 0: # <<<<<<<<<<<<<< + * raise ValueError + * pointer -= length + */ + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_length, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 205, __pyx_L1_error) + if (unlikely(__pyx_t_3)) { + + /* "w3lib/_url.pyx":206 + * if pointer < input_lenght and input[pointer] == ".": + * if length == 0: + * raise ValueError # <<<<<<<<<<<<<< + * pointer -= length + * if piece_index > 6: + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 206, __pyx_L1_error) + + /* "w3lib/_url.pyx":205 + * length += 1 + * if pointer < input_lenght and input[pointer] == ".": + * if length == 0: # <<<<<<<<<<<<<< + * raise ValueError + * pointer -= length + */ + } + + /* "w3lib/_url.pyx":207 + * if length == 0: + * raise ValueError + * pointer -= length # <<<<<<<<<<<<<< + * if piece_index > 6: + * raise ValueError + */ + __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_v_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_7); + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":208 + * raise ValueError + * pointer -= length + * if piece_index > 6: # <<<<<<<<<<<<<< + * raise ValueError + * numbers_seen = 0 + */ + __pyx_t_7 = PyObject_RichCompare(__pyx_v_piece_index, __pyx_int_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__pyx_t_3)) { + + /* "w3lib/_url.pyx":209 + * pointer -= length + * if piece_index > 6: + * raise ValueError # <<<<<<<<<<<<<< + * numbers_seen = 0 + * while pointer < input_lenght: + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 209, __pyx_L1_error) + + /* "w3lib/_url.pyx":208 + * raise ValueError + * pointer -= length + * if piece_index > 6: # <<<<<<<<<<<<<< + * raise ValueError + * numbers_seen = 0 + */ + } + + /* "w3lib/_url.pyx":210 + * if piece_index > 6: + * raise ValueError + * numbers_seen = 0 # <<<<<<<<<<<<<< + * while pointer < input_lenght: + * ipv4_piece = None + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_numbers_seen = __pyx_int_0; + + /* "w3lib/_url.pyx":211 + * raise ValueError + * numbers_seen = 0 + * while pointer < input_lenght: # <<<<<<<<<<<<<< + * ipv4_piece = None + * if numbers_seen > 0: + */ + while (1) { + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_3) break; + + /* "w3lib/_url.pyx":212 + * numbers_seen = 0 + * while pointer < input_lenght: + * ipv4_piece = None # <<<<<<<<<<<<<< + * if numbers_seen > 0: + * if input[pointer] == "." and numbers_seen < 4: + */ + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_ipv4_piece, Py_None); + + /* "w3lib/_url.pyx":213 + * while pointer < input_lenght: + * ipv4_piece = None + * if numbers_seen > 0: # <<<<<<<<<<<<<< + * if input[pointer] == "." and numbers_seen < 4: + * pointer += 1 + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "w3lib/_url.pyx":214 + * ipv4_piece = None + * if numbers_seen > 0: + * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< + * pointer += 1 + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L28_bool_binop_done; + } + __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L28_bool_binop_done:; + if (likely(__pyx_t_3)) { + + /* "w3lib/_url.pyx":215 + * if numbers_seen > 0: + * if input[pointer] == "." and numbers_seen < 4: + * pointer += 1 # <<<<<<<<<<<<<< + * else: + * raise ValueError + */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":214 + * ipv4_piece = None + * if numbers_seen > 0: + * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< + * pointer += 1 + * else: + */ + goto __pyx_L27; + } + + /* "w3lib/_url.pyx":217 + * pointer += 1 + * else: + * raise ValueError # <<<<<<<<<<<<<< + * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: + * raise ValueError + */ + /*else*/ { + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 217, __pyx_L1_error) + } + __pyx_L27:; + + /* "w3lib/_url.pyx":213 + * while pointer < input_lenght: + * ipv4_piece = None + * if numbers_seen > 0: # <<<<<<<<<<<<<< + * if input[pointer] == "." and numbers_seen < 4: + * pointer += 1 + */ + } + + /* "w3lib/_url.pyx":218 + * else: + * raise ValueError + * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< + * raise ValueError + * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L31_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L31_bool_binop_done:; + if (unlikely(__pyx_t_3)) { + + /* "w3lib/_url.pyx":219 + * raise ValueError + * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: + * raise ValueError # <<<<<<<<<<<<<< + * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + * number = int(input[pointer]) + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 219, __pyx_L1_error) + + /* "w3lib/_url.pyx":218 + * else: + * raise ValueError + * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< + * raise ValueError + * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + */ + } + + /* "w3lib/_url.pyx":220 + * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: + * raise ValueError + * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: # <<<<<<<<<<<<<< + * number = int(input[pointer]) + * if ipv4_piece is None: + */ + while (1) { + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L35_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L35_bool_binop_done:; + if (!__pyx_t_3) break; + + /* "w3lib/_url.pyx":221 + * raise ValueError + * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + * number = int(input[pointer]) # <<<<<<<<<<<<<< + * if ipv4_piece is None: + * ipv4_piece = number + */ + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_number, __pyx_t_7); + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":222 + * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + * number = int(input[pointer]) + * if ipv4_piece is None: # <<<<<<<<<<<<<< + * ipv4_piece = number + * elif ipv4_piece == 0: + */ + __pyx_t_3 = (__pyx_v_ipv4_piece == Py_None); + if (__pyx_t_3) { + + /* "w3lib/_url.pyx":223 + * number = int(input[pointer]) + * if ipv4_piece is None: + * ipv4_piece = number # <<<<<<<<<<<<<< + * elif ipv4_piece == 0: + * raise ValueError + */ + __Pyx_INCREF(__pyx_v_number); + __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_v_number); + + /* "w3lib/_url.pyx":222 + * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + * number = int(input[pointer]) + * if ipv4_piece is None: # <<<<<<<<<<<<<< + * ipv4_piece = number + * elif ipv4_piece == 0: + */ + goto __pyx_L37; + } + + /* "w3lib/_url.pyx":224 + * if ipv4_piece is None: + * ipv4_piece = number + * elif ipv4_piece == 0: # <<<<<<<<<<<<<< + * raise ValueError + * else: + */ + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_ipv4_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 224, __pyx_L1_error) + if (unlikely(__pyx_t_3)) { + + /* "w3lib/_url.pyx":225 + * ipv4_piece = number + * elif ipv4_piece == 0: + * raise ValueError # <<<<<<<<<<<<<< + * else: + * ipv4_piece = ipv4_piece * 10 + number + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 225, __pyx_L1_error) + + /* "w3lib/_url.pyx":224 + * if ipv4_piece is None: + * ipv4_piece = number + * elif ipv4_piece == 0: # <<<<<<<<<<<<<< + * raise ValueError + * else: + */ + } + + /* "w3lib/_url.pyx":227 + * raise ValueError + * else: + * ipv4_piece = ipv4_piece * 10 + number # <<<<<<<<<<<<<< + * if ipv4_piece > 255: + * raise ValueError + */ + /*else*/ { + __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ipv4_piece, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L37:; + + /* "w3lib/_url.pyx":228 + * else: + * ipv4_piece = ipv4_piece * 10 + number + * if ipv4_piece > 255: # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 1 + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ipv4_piece, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_3)) { + + /* "w3lib/_url.pyx":229 + * ipv4_piece = ipv4_piece * 10 + number + * if ipv4_piece > 255: + * raise ValueError # <<<<<<<<<<<<<< + * pointer += 1 + * assert isinstance(ipv4_piece, int) + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 229, __pyx_L1_error) + + /* "w3lib/_url.pyx":228 + * else: + * ipv4_piece = ipv4_piece * 10 + number + * if ipv4_piece > 255: # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 1 + */ + } + + /* "w3lib/_url.pyx":230 + * if ipv4_piece > 255: + * raise ValueError + * pointer += 1 # <<<<<<<<<<<<<< + * assert isinstance(ipv4_piece, int) + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; + } + + /* "w3lib/_url.pyx":231 + * raise ValueError + * pointer += 1 + * assert isinstance(ipv4_piece, int) # <<<<<<<<<<<<<< + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + * numbers_seen += 1 + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_3 = PyInt_Check(__pyx_v_ipv4_piece); + if (unlikely(!__pyx_t_3)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 231, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 231, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":232 + * pointer += 1 + * assert isinstance(ipv4_piece, int) + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece # <<<<<<<<<<<<<< + * numbers_seen += 1 + * if numbers_seen in (2, 4): + */ + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_ipv4_piece); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_1) < 0))) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":233 + * assert isinstance(ipv4_piece, int) + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + * numbers_seen += 1 # <<<<<<<<<<<<<< + * if numbers_seen in (2, 4): + * piece_index += 1 + */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_numbers_seen, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_numbers_seen, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":234 + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + * numbers_seen += 1 + * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< + * piece_index += 1 + * if numbers_seen != 4: + */ + __Pyx_INCREF(__pyx_v_numbers_seen); + __pyx_t_1 = __pyx_v_numbers_seen; + __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 234, __pyx_L1_error) + if (!__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L40_bool_binop_done; + } + __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_3 = __pyx_t_5; + __pyx_L40_bool_binop_done:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __pyx_t_3; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":235 + * numbers_seen += 1 + * if numbers_seen in (2, 4): + * piece_index += 1 # <<<<<<<<<<<<<< + * if numbers_seen != 4: + * raise ValueError + */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":234 + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + * numbers_seen += 1 + * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< + * piece_index += 1 + * if numbers_seen != 4: + */ + } + } + + /* "w3lib/_url.pyx":236 + * if numbers_seen in (2, 4): + * piece_index += 1 + * if numbers_seen != 4: # <<<<<<<<<<<<<< + * raise ValueError + * break + */ + __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_numbers_seen, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 236, __pyx_L1_error) + if (unlikely(__pyx_t_5)) { + + /* "w3lib/_url.pyx":237 + * piece_index += 1 + * if numbers_seen != 4: + * raise ValueError # <<<<<<<<<<<<<< + * break + * if pointer < input_lenght and input[pointer] == ":": + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 237, __pyx_L1_error) + + /* "w3lib/_url.pyx":236 + * if numbers_seen in (2, 4): + * piece_index += 1 + * if numbers_seen != 4: # <<<<<<<<<<<<<< + * raise ValueError + * break + */ + } + + /* "w3lib/_url.pyx":238 + * if numbers_seen != 4: + * raise ValueError + * break # <<<<<<<<<<<<<< + * if pointer < input_lenght and input[pointer] == ":": + * pointer += 1 + */ + goto __pyx_L10_break; + + /* "w3lib/_url.pyx":204 + * pointer += 1 + * length += 1 + * if pointer < input_lenght and input[pointer] == ".": # <<<<<<<<<<<<<< + * if length == 0: + * raise ValueError + */ + } + + /* "w3lib/_url.pyx":239 + * raise ValueError + * break + * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< + * pointer += 1 + * if pointer >= input_lenght: + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_3) { + } else { + __pyx_t_5 = __pyx_t_3; + goto __pyx_L44_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __pyx_t_3; + __pyx_L44_bool_binop_done:; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":240 + * break + * if pointer < input_lenght and input[pointer] == ":": + * pointer += 1 # <<<<<<<<<<<<<< + * if pointer >= input_lenght: + * raise ValueError + */ + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_7); + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":241 + * if pointer < input_lenght and input[pointer] == ":": + * pointer += 1 + * if pointer >= input_lenght: # <<<<<<<<<<<<<< + * raise ValueError + * elif pointer < input_lenght: + */ + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_5)) { + + /* "w3lib/_url.pyx":242 + * pointer += 1 + * if pointer >= input_lenght: + * raise ValueError # <<<<<<<<<<<<<< + * elif pointer < input_lenght: + * raise ValueError + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 242, __pyx_L1_error) + + /* "w3lib/_url.pyx":241 + * if pointer < input_lenght and input[pointer] == ":": + * pointer += 1 + * if pointer >= input_lenght: # <<<<<<<<<<<<<< + * raise ValueError + * elif pointer < input_lenght: + */ + } + + /* "w3lib/_url.pyx":239 + * raise ValueError + * break + * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< + * pointer += 1 + * if pointer >= input_lenght: + */ + goto __pyx_L43; + } + + /* "w3lib/_url.pyx":243 + * if pointer >= input_lenght: + * raise ValueError + * elif pointer < input_lenght: # <<<<<<<<<<<<<< + * raise ValueError + * address[piece_index] = value + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__pyx_t_5)) { + + /* "w3lib/_url.pyx":244 + * raise ValueError + * elif pointer < input_lenght: + * raise ValueError # <<<<<<<<<<<<<< + * address[piece_index] = value + * piece_index += 1 + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 244, __pyx_L1_error) + + /* "w3lib/_url.pyx":243 + * if pointer >= input_lenght: + * raise ValueError + * elif pointer < input_lenght: # <<<<<<<<<<<<<< + * raise ValueError + * address[piece_index] = value + */ + } + __pyx_L43:; + + /* "w3lib/_url.pyx":245 + * elif pointer < input_lenght: + * raise ValueError + * address[piece_index] = value # <<<<<<<<<<<<<< + * piece_index += 1 + * if compress is not None: + */ + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_v_value) < 0))) __PYX_ERR(0, 245, __pyx_L1_error) + + /* "w3lib/_url.pyx":246 + * raise ValueError + * address[piece_index] = value + * piece_index += 1 # <<<<<<<<<<<<<< + * if compress is not None: + * swaps = piece_index - compress + */ + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_L9_continue:; + } + __pyx_L10_break:; + + /* "w3lib/_url.pyx":247 + * address[piece_index] = value + * piece_index += 1 + * if compress is not None: # <<<<<<<<<<<<<< + * swaps = piece_index - compress + * piece_index = 7 + */ + __pyx_t_5 = (__pyx_v_compress != Py_None); + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":248 + * piece_index += 1 + * if compress is not None: + * swaps = piece_index - compress # <<<<<<<<<<<<<< + * piece_index = 7 + * while piece_index != 0 and swaps > 0: + */ + __pyx_t_7 = PyNumber_Subtract(__pyx_v_piece_index, __pyx_v_compress); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_v_swaps = __pyx_t_7; + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":249 + * if compress is not None: + * swaps = piece_index - compress + * piece_index = 7 # <<<<<<<<<<<<<< + * while piece_index != 0 and swaps > 0: + * address[piece_index], address[compress + swaps - 1] = ( + */ + __Pyx_INCREF(__pyx_int_7); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_int_7); + + /* "w3lib/_url.pyx":250 + * swaps = piece_index - compress + * piece_index = 7 + * while piece_index != 0 and swaps > 0: # <<<<<<<<<<<<<< + * address[piece_index], address[compress + swaps - 1] = ( + * address[compress + swaps - 1], + */ + while (1) { + __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 250, __pyx_L1_error) + if (__pyx_t_3) { + } else { + __pyx_t_5 = __pyx_t_3; + goto __pyx_L50_bool_binop_done; + } + __pyx_t_7 = PyObject_RichCompare(__pyx_v_swaps, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __pyx_t_3; + __pyx_L50_bool_binop_done:; + if (!__pyx_t_5) break; + + /* "w3lib/_url.pyx":252 + * while piece_index != 0 and swaps > 0: + * address[piece_index], address[compress + swaps - 1] = ( + * address[compress + swaps - 1], # <<<<<<<<<<<<<< + * address[piece_index], + * ) + */ + __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":253 + * address[piece_index], address[compress + swaps - 1] = ( + * address[compress + swaps - 1], + * address[piece_index], # <<<<<<<<<<<<<< + * ) + * piece_index -= 1 + */ + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "w3lib/_url.pyx":251 + * piece_index = 7 + * while piece_index != 0 and swaps > 0: + * address[piece_index], address[compress + swaps - 1] = ( # <<<<<<<<<<<<<< + * address[compress + swaps - 1], + * address[piece_index], + */ + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_7) < 0))) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_t_6, __pyx_t_1) < 0))) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":255 + * address[piece_index], + * ) + * piece_index -= 1 # <<<<<<<<<<<<<< + * swaps -= 1 + * elif compress is None and piece_index != 8: + */ + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":256 + * ) + * piece_index -= 1 + * swaps -= 1 # <<<<<<<<<<<<<< + * elif compress is None and piece_index != 8: + * raise ValueError + */ + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_swaps, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_swaps, __pyx_t_1); + __pyx_t_1 = 0; + } + + /* "w3lib/_url.pyx":247 + * address[piece_index] = value + * piece_index += 1 + * if compress is not None: # <<<<<<<<<<<<<< + * swaps = piece_index - compress + * piece_index = 7 + */ + goto __pyx_L47; + } + + /* "w3lib/_url.pyx":257 + * piece_index -= 1 + * swaps -= 1 + * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< + * raise ValueError + * return address + */ + __pyx_t_3 = (__pyx_v_compress == Py_None); + if (__pyx_t_3) { + } else { + __pyx_t_5 = __pyx_t_3; + goto __pyx_L52_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_5 = __pyx_t_3; + __pyx_L52_bool_binop_done:; + if (unlikely(__pyx_t_5)) { + + /* "w3lib/_url.pyx":258 + * swaps -= 1 + * elif compress is None and piece_index != 8: + * raise ValueError # <<<<<<<<<<<<<< + * return address + * + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 258, __pyx_L1_error) + + /* "w3lib/_url.pyx":257 + * piece_index -= 1 + * swaps -= 1 + * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< + * raise ValueError + * return address + */ + } + __pyx_L47:; + + /* "w3lib/_url.pyx":259 + * elif compress is None and piece_index != 8: + * raise ValueError + * return address # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_address); + __pyx_r = __pyx_v_address; + goto __pyx_L0; + + /* "w3lib/_url.pyx":175 + * + * + * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< + * address = [0] * 8 + * piece_index = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._parse_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_address); + __Pyx_XDECREF(__pyx_v_piece_index); + __Pyx_XDECREF(__pyx_v_compress); + __Pyx_XDECREF(__pyx_v_pointer); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XDECREF(__pyx_v_numbers_seen); + __Pyx_XDECREF(__pyx_v_ipv4_piece); + __Pyx_XDECREF(__pyx_v_number); + __Pyx_XDECREF(__pyx_v_swaps); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":262 + * + * + * def _utf_8_percent_encode( # <<<<<<<<<<<<<< + * input: str, + * percent_encode_set: _PercentEncodeSet, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_7_utf_8_percent_encode(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_7_utf_8_percent_encode = {"_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_7_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_7_utf_8_percent_encode(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_percent_encode_set = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_utf_8_percent_encode (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_percent_encode_set,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_percent_encode_set)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, 1); __PYX_ERR(0, 262, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_utf_8_percent_encode") < 0)) __PYX_ERR(0, 262, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_percent_encode_set = values[1]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 262, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_6_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_percent_encode_set); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_6_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_utf_8_percent_encode", 1); + + /* "w3lib/_url.pyx":266 + * percent_encode_set: _PercentEncodeSet, + * ) -> str: + * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input, + * encoding="utf-8", + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "w3lib/_url.pyx":267 + * ) -> str: + * return _percent_encode_after_encoding( + * input, # <<<<<<<<<<<<<< + * encoding="utf-8", + * percent_encode_set=percent_encode_set, + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_input); + __Pyx_GIVEREF(__pyx_v_input); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input)) __PYX_ERR(0, 266, __pyx_L1_error); + + /* "w3lib/_url.pyx":268 + * return _percent_encode_after_encoding( + * input, + * encoding="utf-8", # <<<<<<<<<<<<<< + * percent_encode_set=percent_encode_set, + * ) + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 268, __pyx_L1_error) + + /* "w3lib/_url.pyx":269 + * input, + * encoding="utf-8", + * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< + * ) + * + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 268, __pyx_L1_error) + + /* "w3lib/_url.pyx":266 + * percent_encode_set: _PercentEncodeSet, + * ) -> str: + * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input, + * encoding="utf-8", + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":262 + * + * + * def _utf_8_percent_encode( # <<<<<<<<<<<<<< + * input: str, + * percent_encode_set: _PercentEncodeSet, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._url._utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":274 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser + * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_9_parse_opaque_host(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_9_parse_opaque_host = {"_parse_opaque_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_9_parse_opaque_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_9_parse_opaque_host(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_parse_opaque_host (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_opaque_host") < 0)) __PYX_ERR(0, 274, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_parse_opaque_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 274, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._parse_opaque_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_8_parse_opaque_host(__pyx_self, __pyx_v_input); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_8_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + Py_UCS4 __pyx_v_code_point; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + void *__pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_opaque_host", 1); + + /* "w3lib/_url.pyx":275 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser + * def _parse_opaque_host(input: str) -> str: + * for code_point in input: # <<<<<<<<<<<<<< + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + * raise ValueError + */ + __Pyx_INCREF(__pyx_v_input); + __pyx_t_1 = __pyx_v_input; + __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 275, __pyx_L1_error) + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) { + __pyx_t_2 = __pyx_t_7; + __pyx_v_code_point = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2); + + /* "w3lib/_url.pyx":276 + * def _parse_opaque_host(input: str) -> str: + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< + * raise ValueError + * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) + */ + __pyx_t_8 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__pyx_t_10)) { + + /* "w3lib/_url.pyx":277 + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + * raise ValueError # <<<<<<<<<<<<<< + * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) + * + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 277, __pyx_L1_error) + + /* "w3lib/_url.pyx":276 + * def _parse_opaque_host(input: str) -> str: + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< + * raise ValueError + * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) + */ + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":278 + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + * raise ValueError + * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_input, __pyx_t_11}; + __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_9))) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":274 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser + * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("w3lib._url._parse_opaque_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":282 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< + * if not input: + * raise ValueError + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv4_number(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_11_parse_ipv4_number = {"_parse_ipv4_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_11_parse_ipv4_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv4_number(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_parse_ipv4_number (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4_number") < 0)) __PYX_ERR(0, 282, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_parse_ipv4_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 282, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._parse_ipv4_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_10_parse_ipv4_number(__pyx_self, __pyx_v_input); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + int __pyx_v_validation_error; + long __pyx_v_r; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_UCS4 __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_ipv4_number", 0); + __Pyx_INCREF(__pyx_v_input); + + /* "w3lib/_url.pyx":283 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: + * if not input: # <<<<<<<<<<<<<< + * raise ValueError + * validation_error = False + */ + __pyx_t_1 = (__Pyx_PyUnicode_IS_TRUE(__pyx_v_input) != 0); + __pyx_t_2 = (!__pyx_t_1); + if (unlikely(__pyx_t_2)) { + + /* "w3lib/_url.pyx":284 + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: + * if not input: + * raise ValueError # <<<<<<<<<<<<<< + * validation_error = False + * r = 10 + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 284, __pyx_L1_error) + + /* "w3lib/_url.pyx":283 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: + * if not input: # <<<<<<<<<<<<<< + * raise ValueError + * validation_error = False + */ + } + + /* "w3lib/_url.pyx":285 + * if not input: + * raise ValueError + * validation_error = False # <<<<<<<<<<<<<< + * r = 10 + * if len(input) >= 2: + */ + __pyx_v_validation_error = 0; + + /* "w3lib/_url.pyx":286 + * raise ValueError + * validation_error = False + * r = 10 # <<<<<<<<<<<<<< + * if len(input) >= 2: + * if input[:2] in ("0X", "0x"): + */ + __pyx_v_r = 10; + + /* "w3lib/_url.pyx":287 + * validation_error = False + * r = 10 + * if len(input) >= 2: # <<<<<<<<<<<<<< + * if input[:2] in ("0X", "0x"): + * validation_error = True + */ + __pyx_t_3 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_3 >= 2); + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":288 + * r = 10 + * if len(input) >= 2: + * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< + * validation_error = True + * input = input[2:] + */ + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0X, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 288, __pyx_L1_error) + if (!__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0x, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1; + __pyx_L6_bool_binop_done:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_2; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":289 + * if len(input) >= 2: + * if input[:2] in ("0X", "0x"): + * validation_error = True # <<<<<<<<<<<<<< + * input = input[2:] + * r = 16 + */ + __pyx_v_validation_error = 1; + + /* "w3lib/_url.pyx":290 + * if input[:2] in ("0X", "0x"): + * validation_error = True + * input = input[2:] # <<<<<<<<<<<<<< + * r = 16 + * elif input[0] == "0": + */ + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":291 + * validation_error = True + * input = input[2:] + * r = 16 # <<<<<<<<<<<<<< + * elif input[0] == "0": + * validation_error = True + */ + __pyx_v_r = 16; + + /* "w3lib/_url.pyx":288 + * r = 10 + * if len(input) >= 2: + * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< + * validation_error = True + * input = input[2:] + */ + goto __pyx_L5; + } + + /* "w3lib/_url.pyx":292 + * input = input[2:] + * r = 16 + * elif input[0] == "0": # <<<<<<<<<<<<<< + * validation_error = True + * input = input[1:] + */ + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_5 == 48); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":293 + * r = 16 + * elif input[0] == "0": + * validation_error = True # <<<<<<<<<<<<<< + * input = input[1:] + * r = 8 + */ + __pyx_v_validation_error = 1; + + /* "w3lib/_url.pyx":294 + * elif input[0] == "0": + * validation_error = True + * input = input[1:] # <<<<<<<<<<<<<< + * r = 8 + * if not input: + */ + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":295 + * validation_error = True + * input = input[1:] + * r = 8 # <<<<<<<<<<<<<< + * if not input: + * return (0, True) + */ + __pyx_v_r = 8; + + /* "w3lib/_url.pyx":292 + * input = input[2:] + * r = 16 + * elif input[0] == "0": # <<<<<<<<<<<<<< + * validation_error = True + * input = input[1:] + */ + } + __pyx_L5:; + + /* "w3lib/_url.pyx":287 + * validation_error = False + * r = 10 + * if len(input) >= 2: # <<<<<<<<<<<<<< + * if input[:2] in ("0X", "0x"): + * validation_error = True + */ + } + + /* "w3lib/_url.pyx":296 + * input = input[1:] + * r = 8 + * if not input: # <<<<<<<<<<<<<< + * return (0, True) + * return (int(input, base=r), validation_error) + */ + __pyx_t_1 = (__Pyx_PyUnicode_IS_TRUE(__pyx_v_input) != 0); + __pyx_t_2 = (!__pyx_t_1); + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":297 + * r = 8 + * if not input: + * return (0, True) # <<<<<<<<<<<<<< + * return (int(input, base=r), validation_error) + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__7); + __pyx_r = __pyx_tuple__7; + goto __pyx_L0; + + /* "w3lib/_url.pyx":296 + * input = input[1:] + * r = 8 + * if not input: # <<<<<<<<<<<<<< + * return (0, True) + * return (int(input, base=r), validation_error) + */ + } + + /* "w3lib/_url.pyx":298 + * if not input: + * return (0, True) + * return (int(input, base=r), validation_error) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_input); + __Pyx_GIVEREF(__pyx_v_input); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_input)) __PYX_ERR(0, 298, __pyx_L1_error); + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base, __pyx_t_7) < 0) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_validation_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error); + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_r = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":282 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< + * if not input: + * raise ValueError + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._parse_ipv4_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_input); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":302 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and parts[-1] == "": + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_13_ends_in_number(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_13_ends_in_number = {"_ends_in_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_13_ends_in_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_13_ends_in_number(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_ends_in_number (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ends_in_number") < 0)) __PYX_ERR(0, 302, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_ends_in_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 302, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_12_ends_in_number(__pyx_self, __pyx_v_input); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "w3lib/_url.pyx":309 + * parts = parts[:-1] + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< + * return True + * try: + */ + +static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 309, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_15_ends_in_number_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ends_in_number_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("w3lib._url._ends_in_number.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 309, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 309, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 309, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_code_point); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":302 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and parts[-1] == "": + */ + +static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + PyObject *__pyx_v_parts = NULL; + PyObject *__pyx_v_last = NULL; + PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_ends_in_number", 1); + + /* "w3lib/_url.pyx":303 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: + * parts = input.split(".") # <<<<<<<<<<<<<< + * if parts and parts[-1] == "": + * if len(parts) == 1: + */ + __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_parts = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":304 + * def _ends_in_number(input: str) -> bool: + * parts = input.split(".") + * if parts and parts[-1] == "": # <<<<<<<<<<<<<< + * if len(parts) == 1: + * return False + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 304, __pyx_L1_error) + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":305 + * parts = input.split(".") + * if parts and parts[-1] == "": + * if len(parts) == 1: # <<<<<<<<<<<<<< + * return False + * parts = parts[:-1] + */ + __pyx_t_4 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_4 == 1); + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":306 + * if parts and parts[-1] == "": + * if len(parts) == 1: + * return False # <<<<<<<<<<<<<< + * parts = parts[:-1] + * last = parts[-1] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "w3lib/_url.pyx":305 + * parts = input.split(".") + * if parts and parts[-1] == "": + * if len(parts) == 1: # <<<<<<<<<<<<<< + * return False + * parts = parts[:-1] + */ + } + + /* "w3lib/_url.pyx":307 + * if len(parts) == 1: + * return False + * parts = parts[:-1] # <<<<<<<<<<<<<< + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + */ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":304 + * def _ends_in_number(input: str) -> bool: + * parts = input.split(".") + * if parts and parts[-1] == "": # <<<<<<<<<<<<<< + * if len(parts) == 1: + * return False + */ + } + + /* "w3lib/_url.pyx":308 + * return False + * parts = parts[:-1] + * last = parts[-1] # <<<<<<<<<<<<<< + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_last = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":309 + * parts = parts[:-1] + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< + * return True + * try: + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_last); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_1 = __pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(NULL, __pyx_v_last); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __pyx_t_3; + __pyx_L8_bool_binop_done:; + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":310 + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True # <<<<<<<<<<<<<< + * try: + * _parse_ipv4_number(last) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "w3lib/_url.pyx":309 + * parts = parts[:-1] + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< + * return True + * try: + */ + } + + /* "w3lib/_url.pyx":311 + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True + * try: # <<<<<<<<<<<<<< + * _parse_ipv4_number(last) + * except ValueError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "w3lib/_url.pyx":312 + * return True + * try: + * _parse_ipv4_number(last) # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_last}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":311 + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True + * try: # <<<<<<<<<<<<<< + * _parse_ipv4_number(last) + * except ValueError: + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L15_try_end; + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":313 + * try: + * _parse_ipv4_number(last) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_10) { + __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(0, 313, __pyx_L12_except_error) + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_9); + + /* "w3lib/_url.pyx":314 + * _parse_ipv4_number(last) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * return True + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L13_except_return; + } + goto __pyx_L12_except_error; + + /* "w3lib/_url.pyx":311 + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True + * try: # <<<<<<<<<<<<<< + * _parse_ipv4_number(last) + * except ValueError: + */ + __pyx_L12_except_error:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L13_except_return:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L0; + __pyx_L15_try_end:; + } + + /* "w3lib/_url.pyx":315 + * except ValueError: + * return False + * return True # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "w3lib/_url.pyx":302 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and parts[-1] == "": + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_parts); + __Pyx_XDECREF(__pyx_v_last); + __Pyx_XDECREF(__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":319 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and not parts[-1]: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_15_parse_ipv4(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_15_parse_ipv4 = {"_parse_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_15_parse_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_15_parse_ipv4(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_parse_ipv4 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4") < 0)) __PYX_ERR(0, 319, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_parse_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 319, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._parse_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_14_parse_ipv4(__pyx_self, __pyx_v_input); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "w3lib/_url.pyx":329 + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): + */ + +static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 329, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_ipv4_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("w3lib._url._parse_ipv4.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 329, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 329, __pyx_L1_error) } + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 329, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 329, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_item, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":319 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and not parts[-1]: + */ + +static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + PyObject *__pyx_v_parts = NULL; + PyObject *__pyx_v_numbers = NULL; + PyObject *__pyx_v_part = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_ipv4 = NULL; + PyObject *__pyx_v_counter = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1 = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_ipv4", 1); + + /* "w3lib/_url.pyx":320 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: + * parts = input.split(".") # <<<<<<<<<<<<<< + * if parts and not parts[-1]: + * parts = parts[:-1] + */ + __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_parts = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":321 + * def _parse_ipv4(input: str) -> int: + * parts = input.split(".") + * if parts and not parts[-1]: # <<<<<<<<<<<<<< + * parts = parts[:-1] + * if len(parts) > 4: + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 321, __pyx_L1_error) + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (!__pyx_t_3); + __pyx_t_2 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":322 + * parts = input.split(".") + * if parts and not parts[-1]: + * parts = parts[:-1] # <<<<<<<<<<<<<< + * if len(parts) > 4: + * raise ValueError + */ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":321 + * def _parse_ipv4(input: str) -> int: + * parts = input.split(".") + * if parts and not parts[-1]: # <<<<<<<<<<<<<< + * parts = parts[:-1] + * if len(parts) > 4: + */ + } + + /* "w3lib/_url.pyx":323 + * if parts and not parts[-1]: + * parts = parts[:-1] + * if len(parts) > 4: # <<<<<<<<<<<<<< + * raise ValueError + * numbers = [] + */ + __pyx_t_5 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_5 > 4); + if (unlikely(__pyx_t_2)) { + + /* "w3lib/_url.pyx":324 + * parts = parts[:-1] + * if len(parts) > 4: + * raise ValueError # <<<<<<<<<<<<<< + * numbers = [] + * for part in parts: + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 324, __pyx_L1_error) + + /* "w3lib/_url.pyx":323 + * if parts and not parts[-1]: + * parts = parts[:-1] + * if len(parts) > 4: # <<<<<<<<<<<<<< + * raise ValueError + * numbers = [] + */ + } + + /* "w3lib/_url.pyx":325 + * if len(parts) > 4: + * raise ValueError + * numbers = [] # <<<<<<<<<<<<<< + * for part in parts: + * result = _parse_ipv4_number(part) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_numbers = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":326 + * raise ValueError + * numbers = [] + * for part in parts: # <<<<<<<<<<<<<< + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) + */ + if (likely(PyList_CheckExact(__pyx_v_parts)) || PyTuple_CheckExact(__pyx_v_parts)) { + __pyx_t_1 = __pyx_v_parts; __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 326, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 326, __pyx_L1_error) + #else + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 326, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 326, __pyx_L1_error) + #else + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_1); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 326, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_part, __pyx_t_7); + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":327 + * numbers = [] + * for part in parts: + * result = _parse_ipv4_number(part) # <<<<<<<<<<<<<< + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): + */ + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_part}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_7); + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":328 + * for part in parts: + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) # <<<<<<<<<<<<<< + * if any(item > 255 for item in numbers[:-1]): + * raise ValueError + */ + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_numbers, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":326 + * raise ValueError + * numbers = [] + * for part in parts: # <<<<<<<<<<<<<< + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":329 + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): + */ + __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_2)) { + + /* "w3lib/_url.pyx":330 + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): + * raise ValueError # <<<<<<<<<<<<<< + * if numbers[-1] >= 256 ** (5 - len(numbers)): + * raise ValueError + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 330, __pyx_L1_error) + + /* "w3lib/_url.pyx":329 + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): + */ + } + + /* "w3lib/_url.pyx":331 + * if any(item > 255 for item in numbers[:-1]): + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< + * raise ValueError + * ipv4 = numbers[-1] + */ + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyList_GET_SIZE(__pyx_v_numbers); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(pow(256.0, ((double)(5 - __pyx_t_5)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(__pyx_t_2)) { + + /* "w3lib/_url.pyx":332 + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): + * raise ValueError # <<<<<<<<<<<<<< + * ipv4 = numbers[-1] + * counter = 0 + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 332, __pyx_L1_error) + + /* "w3lib/_url.pyx":331 + * if any(item > 255 for item in numbers[:-1]): + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< + * raise ValueError + * ipv4 = numbers[-1] + */ + } + + /* "w3lib/_url.pyx":333 + * if numbers[-1] >= 256 ** (5 - len(numbers)): + * raise ValueError + * ipv4 = numbers[-1] # <<<<<<<<<<<<<< + * counter = 0 + * for n in numbers[:-1]: + */ + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_ipv4 = __pyx_t_8; + __pyx_t_8 = 0; + + /* "w3lib/_url.pyx":334 + * raise ValueError + * ipv4 = numbers[-1] + * counter = 0 # <<<<<<<<<<<<<< + * for n in numbers[:-1]: + * ipv4 += n * 256 ** (3 - counter) + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_counter = __pyx_int_0; + + /* "w3lib/_url.pyx":335 + * ipv4 = numbers[-1] + * counter = 0 + * for n in numbers[:-1]: # <<<<<<<<<<<<<< + * ipv4 += n * 256 ** (3 - counter) + * counter += 1 + */ + __pyx_t_8 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); + __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 335, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 335, __pyx_L1_error) + #else + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; + + /* "w3lib/_url.pyx":336 + * counter = 0 + * for n in numbers[:-1]: + * ipv4 += n * 256 ** (3 - counter) # <<<<<<<<<<<<<< + * counter += 1 + * return ipv4 + */ + __pyx_t_8 = __Pyx_PyInt_SubtractCObj(__pyx_int_3, __pyx_v_counter, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyNumber_Power(__pyx_int_256, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ipv4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_ipv4, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":337 + * for n in numbers[:-1]: + * ipv4 += n * 256 ** (3 - counter) + * counter += 1 # <<<<<<<<<<<<<< + * return ipv4 + * + */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_counter, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_counter, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":335 + * ipv4 = numbers[-1] + * counter = 0 + * for n in numbers[:-1]: # <<<<<<<<<<<<<< + * ipv4 += n * 256 ** (3 - counter) + * counter += 1 + */ + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":338 + * ipv4 += n * 256 ** (3 - counter) + * counter += 1 + * return ipv4 # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_ipv4))||((__pyx_v_ipv4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_ipv4))) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_ipv4); + __pyx_r = ((PyObject*)__pyx_v_ipv4); + goto __pyx_L0; + + /* "w3lib/_url.pyx":319 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and not parts[-1]: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("w3lib._url._parse_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_parts); + __Pyx_XDECREF(__pyx_v_numbers); + __Pyx_XDECREF(__pyx_v_part); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_ipv4); + __Pyx_XDECREF(__pyx_v_counter); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":342 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< + * result = _utr46._to_ascii( + * domain, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_17_domain_to_ascii(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_17_domain_to_ascii = {"_domain_to_ascii", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_17_domain_to_ascii, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_17_domain_to_ascii(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_domain = 0; + PyObject *__pyx_v_be_strict = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_domain_to_ascii (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain,&__pyx_n_s_be_strict,0}; + values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domain)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_domain_to_ascii") < 0)) __PYX_ERR(0, 342, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_domain = ((PyObject*)values[0]); + __pyx_v_be_strict = values[1]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_domain_to_ascii", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 342, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._domain_to_ascii", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain), (&PyUnicode_Type), 0, "domain", 1))) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_16_domain_to_ascii(__pyx_self, __pyx_v_domain, __pyx_v_be_strict); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_16_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, PyObject *__pyx_v_be_strict) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_UCS4 __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_domain_to_ascii", 1); + + /* "w3lib/_url.pyx":343 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: + * result = _utr46._to_ascii( # <<<<<<<<<<<<<< + * domain, + * use_std3_ascii_rules=be_strict, + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utr46); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_ascii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":344 + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: + * result = _utr46._to_ascii( + * domain, # <<<<<<<<<<<<<< + * use_std3_ascii_rules=be_strict, + * check_hyphens=False, + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_domain); + __Pyx_GIVEREF(__pyx_v_domain); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domain)) __PYX_ERR(0, 343, __pyx_L1_error); + + /* "w3lib/_url.pyx":345 + * result = _utr46._to_ascii( + * domain, + * use_std3_ascii_rules=be_strict, # <<<<<<<<<<<<<< + * check_hyphens=False, + * check_bidi=True, + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_v_be_strict) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + + /* "w3lib/_url.pyx":346 + * domain, + * use_std3_ascii_rules=be_strict, + * check_hyphens=False, # <<<<<<<<<<<<<< + * check_bidi=True, + * check_joiners=True, + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, Py_False) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + + /* "w3lib/_url.pyx":347 + * use_std3_ascii_rules=be_strict, + * check_hyphens=False, + * check_bidi=True, # <<<<<<<<<<<<<< + * check_joiners=True, + * transitional_processing=False, + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, Py_True) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + + /* "w3lib/_url.pyx":348 + * check_hyphens=False, + * check_bidi=True, + * check_joiners=True, # <<<<<<<<<<<<<< + * transitional_processing=False, + * verify_dns_length=be_strict, + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, Py_True) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + + /* "w3lib/_url.pyx":349 + * check_bidi=True, + * check_joiners=True, + * transitional_processing=False, # <<<<<<<<<<<<<< + * verify_dns_length=be_strict, + * ) + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, Py_False) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + + /* "w3lib/_url.pyx":350 + * check_joiners=True, + * transitional_processing=False, + * verify_dns_length=be_strict, # <<<<<<<<<<<<<< + * ) + * if not result: + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_v_be_strict) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + + /* "w3lib/_url.pyx":343 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: + * result = _utr46._to_ascii( # <<<<<<<<<<<<<< + * domain, + * use_std3_ascii_rules=be_strict, + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":352 + * verify_dns_length=be_strict, + * ) + * if not result: # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name {domain!r} is an empty string after conversion to " + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_6 = (!__pyx_t_5); + if (unlikely(__pyx_t_6)) { + + /* "w3lib/_url.pyx":354 + * if not result: + * raise ValueError( + * f"Domain name {domain!r} is an empty string after conversion to " # <<<<<<<<<<<<<< + * f"ASCII, which makes for an invalid domain name." + * ) + */ + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = 0; + __pyx_t_8 = 127; + __Pyx_INCREF(__pyx_kp_u_Domain_name); + __pyx_t_7 += 12; + __Pyx_GIVEREF(__pyx_kp_u_Domain_name); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Domain_name); + __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8; + __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_kp_u_is_an_empty_string_after_conver); + __pyx_t_7 += 86; + __Pyx_GIVEREF(__pyx_kp_u_is_an_empty_string_after_conver); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_is_an_empty_string_after_conver); + __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":353 + * ) + * if not result: + * raise ValueError( # <<<<<<<<<<<<<< + * f"Domain name {domain!r} is an empty string after conversion to " + * f"ASCII, which makes for an invalid domain name." + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 353, __pyx_L1_error) + + /* "w3lib/_url.pyx":352 + * verify_dns_length=be_strict, + * ) + * if not result: # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name {domain!r} is an empty string after conversion to " + */ + } + + /* "w3lib/_url.pyx":357 + * f"ASCII, which makes for an invalid domain name." + * ) + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyUnicode_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_result))) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_result); + __pyx_r = ((PyObject*)__pyx_v_result); + goto __pyx_L0; + + /* "w3lib/_url.pyx":342 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< + * result = _utr46._to_ascii( + * domain, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._url._domain_to_ascii", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":361 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser + * def _parse_host( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_19_parse_host(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_19_parse_host = {"_parse_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_19_parse_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_19_parse_host(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_is_special = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_parse_host (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_is_special,0}; + + /* "w3lib/_url.pyx":364 + * input: str, + * *, + * is_special: bool = True, # <<<<<<<<<<<<<< + * ) -> Union[str, int, List[int]]: + * if input.startswith("["): + */ + values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error) + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_host") < 0)) __PYX_ERR(0, 361, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_is_special = values[1]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_parse_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 361, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._parse_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_18_parse_host(__pyx_self, __pyx_v_input, __pyx_v_is_special); + + /* "w3lib/_url.pyx":361 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser + * def _parse_host( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_is_special) { + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_ascii_domain = NULL; + PyObject *__pyx_v_code_point = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_host", 1); + + /* "w3lib/_url.pyx":366 + * is_special: bool = True, + * ) -> Union[str, int, List[int]]: + * if input.startswith("["): # <<<<<<<<<<<<<< + * if not input.endswith("]"): + * raise ValueError + */ + __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 366, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":367 + * ) -> Union[str, int, List[int]]: + * if input.startswith("["): + * if not input.endswith("]"): # <<<<<<<<<<<<<< + * raise ValueError + * return _parse_ipv6(input[1:-1]) + */ + __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__9, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_2 = (!__pyx_t_1); + if (unlikely(__pyx_t_2)) { + + /* "w3lib/_url.pyx":368 + * if input.startswith("["): + * if not input.endswith("]"): + * raise ValueError # <<<<<<<<<<<<<< + * return _parse_ipv6(input[1:-1]) + * if not is_special: + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 368, __pyx_L1_error) + + /* "w3lib/_url.pyx":367 + * ) -> Union[str, int, List[int]]: + * if input.startswith("["): + * if not input.endswith("]"): # <<<<<<<<<<<<<< + * raise ValueError + * return _parse_ipv6(input[1:-1]) + */ + } + + /* "w3lib/_url.pyx":369 + * if not input.endswith("]"): + * raise ValueError + * return _parse_ipv6(input[1:-1]) # <<<<<<<<<<<<<< + * if not is_special: + * return _parse_opaque_host(input) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":366 + * is_special: bool = True, + * ) -> Union[str, int, List[int]]: + * if input.startswith("["): # <<<<<<<<<<<<<< + * if not input.endswith("]"): + * raise ValueError + */ + } + + /* "w3lib/_url.pyx":370 + * raise ValueError + * return _parse_ipv6(input[1:-1]) + * if not is_special: # <<<<<<<<<<<<<< + * return _parse_opaque_host(input) + * domain = unquote(input) + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_is_special); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_1 = (!__pyx_t_2); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":371 + * return _parse_ipv6(input[1:-1]) + * if not is_special: + * return _parse_opaque_host(input) # <<<<<<<<<<<<<< + * domain = unquote(input) + * ascii_domain = _domain_to_ascii(domain) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_opaque_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":370 + * raise ValueError + * return _parse_ipv6(input[1:-1]) + * if not is_special: # <<<<<<<<<<<<<< + * return _parse_opaque_host(input) + * domain = unquote(input) + */ + } + + /* "w3lib/_url.pyx":372 + * if not is_special: + * return _parse_opaque_host(input) + * domain = unquote(input) # <<<<<<<<<<<<<< + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unquote); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_v_domain = __pyx_t_3; + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":373 + * return _parse_opaque_host(input) + * domain = unquote(input) + * ascii_domain = _domain_to_ascii(domain) # <<<<<<<<<<<<<< + * for code_point in ascii_domain: + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_domain_to_ascii); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_domain}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_v_ascii_domain = __pyx_t_3; + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":374 + * domain = unquote(input) + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: # <<<<<<<<<<<<<< + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError + */ + if (likely(PyList_CheckExact(__pyx_v_ascii_domain)) || PyTuple_CheckExact(__pyx_v_ascii_domain)) { + __pyx_t_3 = __pyx_v_ascii_domain; __Pyx_INCREF(__pyx_t_3); + __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ascii_domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 374, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 374, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 374, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 374, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 374, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_9(__pyx_t_3); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 374, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":375 + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< + * raise ValueError + * if _ends_in_number(ascii_domain): + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__pyx_t_1)) { + + /* "w3lib/_url.pyx":376 + * for code_point in ascii_domain: + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError # <<<<<<<<<<<<<< + * if _ends_in_number(ascii_domain): + * return _parse_ipv4(ascii_domain) + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 376, __pyx_L1_error) + + /* "w3lib/_url.pyx":375 + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< + * raise ValueError + * if _ends_in_number(ascii_domain): + */ + } + + /* "w3lib/_url.pyx":374 + * domain = unquote(input) + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: # <<<<<<<<<<<<<< + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":377 + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError + * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< + * return _parse_ipv4(ascii_domain) + * return ascii_domain + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ends_in_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 377, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":378 + * raise ValueError + * if _ends_in_number(ascii_domain): + * return _parse_ipv4(ascii_domain) # <<<<<<<<<<<<<< + * return ascii_domain + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":377 + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError + * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< + * return _parse_ipv4(ascii_domain) + * return ascii_domain + */ + } + + /* "w3lib/_url.pyx":379 + * if _ends_in_number(ascii_domain): + * return _parse_ipv4(ascii_domain) + * return ascii_domain # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ascii_domain); + __pyx_r = __pyx_v_ascii_domain; + goto __pyx_L0; + + /* "w3lib/_url.pyx":361 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser + * def _parse_host( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("w3lib._url._parse_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_ascii_domain); + __Pyx_XDECREF(__pyx_v_code_point); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":383 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter + * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_21_is_windows_drive_letter(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_21_is_windows_drive_letter = {"_is_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_21_is_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_21_is_windows_drive_letter(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_is_windows_drive_letter (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_windows_drive_letter") < 0)) __PYX_ERR(0, 383, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_is_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 383, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._is_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_20_is_windows_drive_letter(__pyx_self, __pyx_v_input); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_20_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_UCS4 __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_windows_drive_letter", 1); + + /* "w3lib/_url.pyx":384 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter + * def _is_windows_drive_letter(input: str) -> bool: + * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 == 2); + if (__pyx_t_3) { + } else { + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_3) { + } else { + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 384, __pyx_L1_error) + switch (__pyx_t_5) { + case 58: + case 0x7C: + __pyx_t_3 = 1; + break; + default: + __pyx_t_3 = 0; + break; + } + __pyx_t_7 = __pyx_t_3; + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __pyx_t_6; + __pyx_t_6 = 0; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":383 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter + * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("w3lib._url._is_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":388 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter + * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * input_length = len(input) + * return ( + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_23_starts_with_windows_drive_letter(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_23_starts_with_windows_drive_letter = {"_starts_with_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_23_starts_with_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_23_starts_with_windows_drive_letter(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_starts_with_windows_drive_letter (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_starts_with_windows_drive_letter") < 0)) __PYX_ERR(0, 388, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_starts_with_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 388, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._starts_with_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(__pyx_self, __pyx_v_input); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + Py_ssize_t __pyx_v_input_length; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + Py_UCS4 __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_starts_with_windows_drive_letter", 1); + + /* "w3lib/_url.pyx":389 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter + * def _starts_with_windows_drive_letter(input: str) -> bool: + * input_length = len(input) # <<<<<<<<<<<<<< + * return ( + * input_length >= 2 + */ + __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_v_input_length = __pyx_t_1; + + /* "w3lib/_url.pyx":390 + * def _starts_with_windows_drive_letter(input: str) -> bool: + * input_length = len(input) + * return ( # <<<<<<<<<<<<<< + * input_length >= 2 + * and _is_windows_drive_letter(input[:2]) + */ + __Pyx_XDECREF(__pyx_r); + + /* "w3lib/_url.pyx":391 + * input_length = len(input) + * return ( + * input_length >= 2 # <<<<<<<<<<<<<< + * and _is_windows_drive_letter(input[:2]) + * and (input_length == 2 or input[2] in "/\\?#") + */ + __pyx_t_3 = (__pyx_v_input_length >= 2); + if (__pyx_t_3) { + } else { + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3_bool_binop_done; + } + + /* "w3lib/_url.pyx":392 + * return ( + * input_length >= 2 + * and _is_windows_drive_letter(input[:2]) # <<<<<<<<<<<<<< + * and (input_length == 2 or input[2] in "/\\?#") + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 392, __pyx_L1_error) + if (__pyx_t_3) { + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L3_bool_binop_done; + } + + /* "w3lib/_url.pyx":393 + * input_length >= 2 + * and _is_windows_drive_letter(input[:2]) + * and (input_length == 2 or input[2] in "/\\?#") # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_3 = (__pyx_v_input_length == 2); + if (!__pyx_t_3) { + } else { + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_9 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == (Py_UCS4)-1)) __PYX_ERR(0, 393, __pyx_L1_error) + switch (__pyx_t_9) { + case 35: + case 47: + case 63: + case 92: + __pyx_t_3 = 1; + break; + default: + __pyx_t_3 = 0; + break; + } + __pyx_t_10 = __pyx_t_3; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":388 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter + * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * input_length = len(input) + * return ( + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._starts_with_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":398 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment + * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * "..", + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_25_is_double_dot_path_segment(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_25_is_double_dot_path_segment = {"_is_double_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_25_is_double_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_25_is_double_dot_path_segment(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_is_double_dot_path_segment (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_double_dot_path_segment") < 0)) __PYX_ERR(0, 398, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_is_double_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 398, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._is_double_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_24_is_double_dot_path_segment(__pyx_self, __pyx_v_input); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_24_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_double_dot_path_segment", 1); + + /* "w3lib/_url.pyx":399 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment + * def _is_double_dot_path_segment(input: str) -> bool: + * return input in ( # <<<<<<<<<<<<<< + * "..", + * ".%2e", + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_input); + __pyx_t_1 = __pyx_v_input; + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_2 = __pyx_t_3; + __pyx_L3_bool_binop_done:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":398 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment + * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * "..", + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._url._is_double_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":413 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment + * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * ".", + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_27_is_single_dot_path_segment(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_27_is_single_dot_path_segment = {"_is_single_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_27_is_single_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_27_is_single_dot_path_segment(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_is_single_dot_path_segment (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_single_dot_path_segment") < 0)) __PYX_ERR(0, 413, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_is_single_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 413, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._is_single_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_26_is_single_dot_path_segment(__pyx_self, __pyx_v_input); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_26_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_single_dot_path_segment", 1); + + /* "w3lib/_url.pyx":414 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment + * def _is_single_dot_path_segment(input: str) -> bool: + * return input in ( # <<<<<<<<<<<<<< + * ".", + * "%2e", + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_input); + __pyx_t_1 = __pyx_v_input; + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 414, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 414, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_2 = __pyx_t_3; + __pyx_L3_bool_binop_done:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":413 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment + * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * ".", + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._url._is_single_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":424 + * # to be escaped, they are escaped in an idempotent way (i.e. if they are + * # already part of an escape sequence, they are not re-encoded). + * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * *, input: str, pointer: int, encode_set: _PercentEncodeSet + * ) -> str: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_29_idempotent_utf_8_percent_encode(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_29_idempotent_utf_8_percent_encode = {"_idempotent_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_29_idempotent_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_29_idempotent_utf_8_percent_encode(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_pointer = 0; + PyObject *__pyx_v_encode_set = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_idempotent_utf_8_percent_encode (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_pointer,&__pyx_n_s_encode_set,0}; + if (likely(__pyx_kwds)) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 424, __pyx_L3_error) + } + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pointer)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_pointer); __PYX_ERR(0, 424, __pyx_L3_error) + } + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encode_set)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_encode_set); __PYX_ERR(0, 424, __pyx_L3_error) + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "_idempotent_utf_8_percent_encode") < 0)) __PYX_ERR(0, 424, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 0)) { + goto __pyx_L5_argtuple_error; + } else { + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 424, __pyx_L3_error) + } + __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_pointer = ((PyObject*)values[1]); + __pyx_v_encode_set = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_idempotent_utf_8_percent_encode", 1, 0, 0, __pyx_nargs); __PYX_ERR(0, 424, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._idempotent_utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 425, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pointer), (&PyInt_Type), 0, "pointer", 1))) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_pointer, __pyx_v_encode_set); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set) { + PyObject *__pyx_v_code_point = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_idempotent_utf_8_percent_encode", 1); + + /* "w3lib/_url.pyx":427 + * *, input: str, pointer: int, encode_set: _PercentEncodeSet + * ) -> str: + * code_point = input[pointer] # <<<<<<<<<<<<<< + * if code_point == "%" and "%" in encode_set: + * if ( + */ + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_v_code_point = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":428 + * ) -> str: + * code_point = input[pointer] + * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< + * if ( + * pointer + 2 >= len(input) + */ + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 428, __pyx_L1_error) + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__4, __pyx_v_encode_set, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":430 + * if code_point == "%" and "%" in encode_set: + * if ( + * pointer + 2 >= len(input) # <<<<<<<<<<<<<< + * or input[pointer + 1] not in _ASCII_HEX_DIGIT + * or input[pointer + 2] not in _ASCII_HEX_DIGIT + */ + __pyx_t_1 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L7_bool_binop_done; + } + + /* "w3lib/_url.pyx":431 + * if ( + * pointer + 2 >= len(input) + * or input[pointer + 1] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * or input[pointer + 2] not in _ASCII_HEX_DIGIT + * ): + */ + __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L7_bool_binop_done; + } + + /* "w3lib/_url.pyx":432 + * pointer + 2 >= len(input) + * or input[pointer + 1] not in _ASCII_HEX_DIGIT + * or input[pointer + 2] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * ): + * return "%25" + */ + __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __pyx_t_3; + __pyx_L7_bool_binop_done:; + + /* "w3lib/_url.pyx":429 + * code_point = input[pointer] + * if code_point == "%" and "%" in encode_set: + * if ( # <<<<<<<<<<<<<< + * pointer + 2 >= len(input) + * or input[pointer + 1] not in _ASCII_HEX_DIGIT + */ + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":434 + * or input[pointer + 2] not in _ASCII_HEX_DIGIT + * ): + * return "%25" # <<<<<<<<<<<<<< + * return "%" + * return _utf_8_percent_encode(code_point, encode_set) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_u_25); + __pyx_r = __pyx_kp_u_25; + goto __pyx_L0; + + /* "w3lib/_url.pyx":429 + * code_point = input[pointer] + * if code_point == "%" and "%" in encode_set: + * if ( # <<<<<<<<<<<<<< + * pointer + 2 >= len(input) + * or input[pointer + 1] not in _ASCII_HEX_DIGIT + */ + } + + /* "w3lib/_url.pyx":435 + * ): + * return "%25" + * return "%" # <<<<<<<<<<<<<< + * return _utf_8_percent_encode(code_point, encode_set) + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_u__4); + __pyx_r = __pyx_kp_u__4; + goto __pyx_L0; + + /* "w3lib/_url.pyx":428 + * ) -> str: + * code_point = input[pointer] + * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< + * if ( + * pointer + 2 >= len(input) + */ + } + + /* "w3lib/_url.pyx":436 + * return "%25" + * return "%" + * return _utf_8_percent_encode(code_point, encode_set) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_code_point, __pyx_v_encode_set}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_6))) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":424 + * # to be escaped, they are escaped in an idempotent way (i.e. if they are + * # already part of an escape sequence, they are not re-encoded). + * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * *, input: str, pointer: int, encode_set: _PercentEncodeSet + * ) -> str: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("w3lib._url._idempotent_utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_code_point); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":439 + * + * + * def _parse_url( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + +static PyObject *__pyx_pf_5w3lib_4_url_44__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "w3lib/_url.pyx":442 + * input: str, + * *, + * base_url: str = None, # <<<<<<<<<<<<<< + * encoding: str = "utf-8", + * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, Py_None) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, ((PyObject*)__pyx_kp_u_utf_8)) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + + /* "w3lib/_url.pyx":439 + * + * + * def _parse_url( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_userinfo_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_path_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_path_percent_encode_set) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_query_percent_encode_set) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_special_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_special_query_percent_encode_set) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fragment_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_fragment_percent_encode_set) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 439, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("w3lib._url.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_31_parse_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_30_parse_url, "Return a :class:`_URL` object built from *url*, *base_url* and\n *encoding*, following the URL parsing algorithm defined in the `URL living\n standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *userinfo_percent_encode_set* allows customizing which characters found\n in the user authroization part of the input URL need to be\n percent-encoded.\n "); +static PyMethodDef __pyx_mdef_5w3lib_4_url_31_parse_url = {"_parse_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_31_parse_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_30_parse_url}; +static PyObject *__pyx_pw_5w3lib_4_url_31_parse_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_base_url = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_userinfo_percent_encode_set = 0; + PyObject *__pyx_v_path_percent_encode_set = 0; + PyObject *__pyx_v_query_percent_encode_set = 0; + PyObject *__pyx_v_special_query_percent_encode_set = 0; + PyObject *__pyx_v_fragment_percent_encode_set = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[8] = {0,0,0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_parse_url (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_base_url,&__pyx_n_s_encoding,&__pyx_n_s_userinfo_percent_encode_set,&__pyx_n_s_path_percent_encode_set,&__pyx_n_s_query_percent_encode_set,&__pyx_n_s_special_query_percent_encode_set,&__pyx_n_s_fragment_percent_encode_set,0}; + __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); + + /* "w3lib/_url.pyx":442 + * input: str, + * *, + * base_url: str = None, # <<<<<<<<<<<<<< + * encoding: str = "utf-8", + * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, + */ + values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None)); + values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)((PyObject*)__pyx_kp_u_utf_8))); + values[3] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_userinfo_percent_encode_set); + values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_path_percent_encode_set); + values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_query_percent_encode_set); + values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_special_query_percent_encode_set); + values[7] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_fragment_percent_encode_set); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (kw_args > 0 && likely(kw_args <= 7)) { + Py_ssize_t index; + for (index = 1; index < 8 && kw_args > 0; index++) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_url") < 0)) __PYX_ERR(0, 439, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_base_url = ((PyObject*)values[1]); + __pyx_v_encoding = ((PyObject*)values[2]); + __pyx_v_userinfo_percent_encode_set = values[3]; + __pyx_v_path_percent_encode_set = values[4]; + __pyx_v_query_percent_encode_set = values[5]; + __pyx_v_special_query_percent_encode_set = values[6]; + __pyx_v_fragment_percent_encode_set = values[7]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_parse_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 439, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 440, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_base_url), (&PyUnicode_Type), 1, "base_url", 1))) __PYX_ERR(0, 442, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_30_parse_url(__pyx_self, __pyx_v_input, __pyx_v_base_url, __pyx_v_encoding, __pyx_v_userinfo_percent_encode_set, __pyx_v_path_percent_encode_set, __pyx_v_query_percent_encode_set, __pyx_v_special_query_percent_encode_set, __pyx_v_fragment_percent_encode_set); + + /* "w3lib/_url.pyx":439 + * + * + * def _parse_url( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_base_url, PyObject *__pyx_v_encoding, PyObject *__pyx_v_userinfo_percent_encode_set, PyObject *__pyx_v_path_percent_encode_set, PyObject *__pyx_v_query_percent_encode_set, PyObject *__pyx_v_special_query_percent_encode_set, PyObject *__pyx_v_fragment_percent_encode_set) { + PyObject *__pyx_v_base = NULL; + PyObject *__pyx_v_url = NULL; + PyObject *__pyx_v_state = NULL; + PyObject *__pyx_v_buffer = NULL; + int __pyx_v_at_sign_seen; + int __pyx_v_inside_brackets; + int __pyx_v_skip_authority_shortcut; + PyObject *__pyx_v_pointer = NULL; + Py_ssize_t __pyx_v_input_length; + PyObject *__pyx_v_c = 0; + PyObject *__pyx_v_at_sign_index = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_code_point = NULL; + PyObject *__pyx_v_encoded_code_points = NULL; + PyObject *__pyx_v_host = NULL; + PyObject *__pyx_v_port = NULL; + PyObject *__pyx_v_encoded = NULL; + PyObject *__pyx_v_percent_encode_set = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + PyObject *(*__pyx_t_13)(PyObject *); + int __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_url", 0); + __Pyx_INCREF(__pyx_v_input); + __Pyx_INCREF(__pyx_v_encoding); + + /* "w3lib/_url.pyx":475 + * # output can match the original parsed URL if desired. + * + * if base_url is not None: # <<<<<<<<<<<<<< + * base = _parse_url(base_url, encoding=encoding) + * else: + */ + __pyx_t_1 = (__pyx_v_base_url != ((PyObject*)Py_None)); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":476 + * + * if base_url is not None: + * base = _parse_url(base_url, encoding=encoding) # <<<<<<<<<<<<<< + * else: + * base = None + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_base_url); + __Pyx_GIVEREF(__pyx_v_base_url); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_base_url)) __PYX_ERR(0, 476, __pyx_L1_error); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_base = __pyx_t_5; + __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":475 + * # output can match the original parsed URL if desired. + * + * if base_url is not None: # <<<<<<<<<<<<<< + * base = _parse_url(base_url, encoding=encoding) + * else: + */ + goto __pyx_L3; + } + + /* "w3lib/_url.pyx":478 + * base = _parse_url(base_url, encoding=encoding) + * else: + * base = None # <<<<<<<<<<<<<< + * encoding = _get_output_encoding(encoding) + * + */ + /*else*/ { + __Pyx_INCREF(Py_None); + __pyx_v_base = Py_None; + } + __pyx_L3:; + + /* "w3lib/_url.pyx":479 + * else: + * base = None + * encoding = _get_output_encoding(encoding) # <<<<<<<<<<<<<< + * + * url = _URL() + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_output_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 479, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_encoding, ((PyObject*)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":481 + * encoding = _get_output_encoding(encoding) + * + * url = _URL() # <<<<<<<<<<<<<< + * state = SCHEME_START + * buffer = "" + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_URL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_v_url = __pyx_t_5; + __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":482 + * + * url = _URL() + * state = SCHEME_START # <<<<<<<<<<<<<< + * buffer = "" + * at_sign_seen = inside_brackets = skip_authority_shortcut = False + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SCHEME_START); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_state = __pyx_t_5; + __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":483 + * url = _URL() + * state = SCHEME_START + * buffer = "" # <<<<<<<<<<<<<< + * at_sign_seen = inside_brackets = skip_authority_shortcut = False + * pointer = 0 + */ + __Pyx_INCREF(__pyx_kp_u__2); + __pyx_v_buffer = __pyx_kp_u__2; + + /* "w3lib/_url.pyx":484 + * state = SCHEME_START + * buffer = "" + * at_sign_seen = inside_brackets = skip_authority_shortcut = False # <<<<<<<<<<<<<< + * pointer = 0 + * + */ + __pyx_v_at_sign_seen = 0; + __pyx_v_inside_brackets = 0; + __pyx_v_skip_authority_shortcut = 0; + + /* "w3lib/_url.pyx":485 + * buffer = "" + * at_sign_seen = inside_brackets = skip_authority_shortcut = False + * pointer = 0 # <<<<<<<<<<<<<< + * + * input = input.strip(_C0_CONTROL_OR_SPACE) + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_pointer = __pyx_int_0; + + /* "w3lib/_url.pyx":487 + * pointer = 0 + * + * input = input.strip(_C0_CONTROL_OR_SPACE) # <<<<<<<<<<<<<< + * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) + * input_length = len(input) + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_input, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 487, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":488 + * + * input = input.strip(_C0_CONTROL_OR_SPACE) + * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) # <<<<<<<<<<<<<< + * input_length = len(input) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_translate, __pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 488, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":489 + * input = input.strip(_C0_CONTROL_OR_SPACE) + * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) + * input_length = len(input) # <<<<<<<<<<<<<< + * + * while True: + */ + if (unlikely(__pyx_v_input == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 489, __pyx_L1_error) + } + __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 489, __pyx_L1_error) + __pyx_v_input_length = __pyx_t_7; + + /* "w3lib/_url.pyx":491 + * input_length = len(input) + * + * while True: # <<<<<<<<<<<<<< + * try: + * c: Optional[str] = input[pointer] + */ + while (1) { + + /* "w3lib/_url.pyx":492 + * + * while True: + * try: # <<<<<<<<<<<<<< + * c: Optional[str] = input[pointer] + * except IndexError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "w3lib/_url.pyx":493 + * while True: + * try: + * c: Optional[str] = input[pointer] # <<<<<<<<<<<<<< + * except IndexError: + * c = None + */ + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 493, __pyx_L6_error) + __Pyx_XDECREF_SET(__pyx_v_c, ((PyObject*)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":492 + * + * while True: + * try: # <<<<<<<<<<<<<< + * c: Optional[str] = input[pointer] + * except IndexError: + */ + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":494 + * try: + * c: Optional[str] = input[pointer] + * except IndexError: # <<<<<<<<<<<<<< + * c = None + * + */ + __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); + if (__pyx_t_6) { + __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 494, __pyx_L8_except_error) + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":495 + * c: Optional[str] = input[pointer] + * except IndexError: + * c = None # <<<<<<<<<<<<<< + * + * if state == SCHEME_START: + */ + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_c, ((PyObject*)Py_None)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + + /* "w3lib/_url.pyx":492 + * + * while True: + * try: # <<<<<<<<<<<<<< + * c: Optional[str] = input[pointer] + * except IndexError: + */ + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L13_try_end:; + } + + /* "w3lib/_url.pyx":497 + * c = None + * + * if state == SCHEME_START: # <<<<<<<<<<<<<< + * if c is not None and c in _ASCII_ALPHA: + * assert isinstance(c, str) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SCHEME_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":498 + * + * if state == SCHEME_START: + * if c is not None and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * buffer += c + */ + __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L18_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 498, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_11; + __pyx_L18_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":499 + * if state == SCHEME_START: + * if c is not None and c in _ASCII_ALPHA: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * buffer += c + * state = SCHEME + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 499, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 499, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":500 + * if c is not None and c in _ASCII_ALPHA: + * assert isinstance(c, str) + * buffer += c # <<<<<<<<<<<<<< + * state = SCHEME + * else: + */ + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":501 + * assert isinstance(c, str) + * buffer += c + * state = SCHEME # <<<<<<<<<<<<<< + * else: + * state = NO_SCHEME + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":498 + * + * if state == SCHEME_START: + * if c is not None and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * buffer += c + */ + goto __pyx_L17; + } + + /* "w3lib/_url.pyx":503 + * state = SCHEME + * else: + * state = NO_SCHEME # <<<<<<<<<<<<<< + * pointer -= 1 + * + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NO_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":504 + * else: + * state = NO_SCHEME + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == SCHEME: + */ + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L17:; + + /* "w3lib/_url.pyx":497 + * c = None + * + * if state == SCHEME_START: # <<<<<<<<<<<<<< + * if c is not None and c in _ASCII_ALPHA: + * assert isinstance(c, str) + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":506 + * pointer -= 1 + * + * elif state == SCHEME: # <<<<<<<<<<<<<< + * if c is not None and c in _SCHEME_CHARS: + * assert isinstance(c, str) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":507 + * + * elif state == SCHEME: + * if c is not None and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * buffer += c + */ + __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L21_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SCHEME_CHARS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 507, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_11; + __pyx_L21_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":508 + * elif state == SCHEME: + * if c is not None and c in _SCHEME_CHARS: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * buffer += c + * elif c == ":": + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 508, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 508, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":509 + * if c is not None and c in _SCHEME_CHARS: + * assert isinstance(c, str) + * buffer += c # <<<<<<<<<<<<<< + * elif c == ":": + * url.scheme = buffer.lower() + */ + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":507 + * + * elif state == SCHEME: + * if c is not None and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * buffer += c + */ + goto __pyx_L20; + } + + /* "w3lib/_url.pyx":510 + * assert isinstance(c, str) + * buffer += c + * elif c == ":": # <<<<<<<<<<<<<< + * url.scheme = buffer.lower() + * buffer = "" + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 510, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":511 + * buffer += c + * elif c == ":": + * url.scheme = buffer.lower() # <<<<<<<<<<<<<< + * buffer = "" + * if url.scheme == "file": + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_buffer, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 511, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":512 + * elif c == ":": + * url.scheme = buffer.lower() + * buffer = "" # <<<<<<<<<<<<<< + * if url.scheme == "file": + * state = FILE + */ + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + + /* "w3lib/_url.pyx":513 + * url.scheme = buffer.lower() + * buffer = "" + * if url.scheme == "file": # <<<<<<<<<<<<<< + * state = FILE + * elif url.is_special: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 513, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":514 + * buffer = "" + * if url.scheme == "file": + * state = FILE # <<<<<<<<<<<<<< + * elif url.is_special: + * if base is not None and base.scheme == url.scheme: + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FILE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":513 + * url.scheme = buffer.lower() + * buffer = "" + * if url.scheme == "file": # <<<<<<<<<<<<<< + * state = FILE + * elif url.is_special: + */ + goto __pyx_L23; + } + + /* "w3lib/_url.pyx":515 + * if url.scheme == "file": + * state = FILE + * elif url.is_special: # <<<<<<<<<<<<<< + * if base is not None and base.scheme == url.scheme: + * state = SPECIAL_RELATIVE_OR_AUTHORITY + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":516 + * state = FILE + * elif url.is_special: + * if base is not None and base.scheme == url.scheme: # <<<<<<<<<<<<<< + * state = SPECIAL_RELATIVE_OR_AUTHORITY + * else: + */ + __pyx_t_11 = (__pyx_v_base != Py_None); + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L25_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 516, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __pyx_t_11; + __pyx_L25_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":517 + * elif url.is_special: + * if base is not None and base.scheme == url.scheme: + * state = SPECIAL_RELATIVE_OR_AUTHORITY # <<<<<<<<<<<<<< + * else: + * state = SPECIAL_AUTHORITY_SLASHES + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_5); + __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":516 + * state = FILE + * elif url.is_special: + * if base is not None and base.scheme == url.scheme: # <<<<<<<<<<<<<< + * state = SPECIAL_RELATIVE_OR_AUTHORITY + * else: + */ + goto __pyx_L24; + } + + /* "w3lib/_url.pyx":519 + * state = SPECIAL_RELATIVE_OR_AUTHORITY + * else: + * state = SPECIAL_AUTHORITY_SLASHES # <<<<<<<<<<<<<< + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": + * state = PATH_OR_AUTHORITY + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SPECIAL_AUTHORITY_SLASHES); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_5); + __pyx_t_5 = 0; + } + __pyx_L24:; + + /* "w3lib/_url.pyx":515 + * if url.scheme == "file": + * state = FILE + * elif url.is_special: # <<<<<<<<<<<<<< + * if base is not None and base.scheme == url.scheme: + * state = SPECIAL_RELATIVE_OR_AUTHORITY + */ + goto __pyx_L23; + } + + /* "w3lib/_url.pyx":520 + * else: + * state = SPECIAL_AUTHORITY_SLASHES + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * state = PATH_OR_AUTHORITY + * pointer += 1 + */ + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__pyx_v_input == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 520, __pyx_L1_error) + } + __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L27_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_11; + __pyx_L27_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":521 + * state = SPECIAL_AUTHORITY_SLASHES + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": + * state = PATH_OR_AUTHORITY # <<<<<<<<<<<<<< + * pointer += 1 + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH_OR_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":522 + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": + * state = PATH_OR_AUTHORITY + * pointer += 1 # <<<<<<<<<<<<<< + * else: + * url.path = "" + */ + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":520 + * else: + * state = SPECIAL_AUTHORITY_SLASHES + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * state = PATH_OR_AUTHORITY + * pointer += 1 + */ + goto __pyx_L23; + } + + /* "w3lib/_url.pyx":524 + * pointer += 1 + * else: + * url.path = "" # <<<<<<<<<<<<<< + * state = OPAQUE_PATH + * else: + */ + /*else*/ { + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_kp_u__2) < 0) __PYX_ERR(0, 524, __pyx_L1_error) + + /* "w3lib/_url.pyx":525 + * else: + * url.path = "" + * state = OPAQUE_PATH # <<<<<<<<<<<<<< + * else: + * buffer = "" + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OPAQUE_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L23:; + + /* "w3lib/_url.pyx":510 + * assert isinstance(c, str) + * buffer += c + * elif c == ":": # <<<<<<<<<<<<<< + * url.scheme = buffer.lower() + * buffer = "" + */ + goto __pyx_L20; + } + + /* "w3lib/_url.pyx":527 + * state = OPAQUE_PATH + * else: + * buffer = "" # <<<<<<<<<<<<<< + * state = NO_SCHEME + * pointer = -1 + */ + /*else*/ { + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + + /* "w3lib/_url.pyx":528 + * else: + * buffer = "" + * state = NO_SCHEME # <<<<<<<<<<<<<< + * pointer = -1 + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NO_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":529 + * buffer = "" + * state = NO_SCHEME + * pointer = -1 # <<<<<<<<<<<<<< + * + * elif state == NO_SCHEME: + */ + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_int_neg_1); + } + __pyx_L20:; + + /* "w3lib/_url.pyx":506 + * pointer -= 1 + * + * elif state == SCHEME: # <<<<<<<<<<<<<< + * if c is not None and c in _SCHEME_CHARS: + * assert isinstance(c, str) + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":531 + * pointer = -1 + * + * elif state == NO_SCHEME: # <<<<<<<<<<<<<< + * if base is None: + * raise ValueError + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NO_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":532 + * + * elif state == NO_SCHEME: + * if base is None: # <<<<<<<<<<<<<< + * raise ValueError + * if base.has_opaque_path(): + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + if (unlikely(__pyx_t_1)) { + + /* "w3lib/_url.pyx":533 + * elif state == NO_SCHEME: + * if base is None: + * raise ValueError # <<<<<<<<<<<<<< + * if base.has_opaque_path(): + * if c != "#": + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 533, __pyx_L1_error) + + /* "w3lib/_url.pyx":532 + * + * elif state == NO_SCHEME: + * if base is None: # <<<<<<<<<<<<<< + * raise ValueError + * if base.has_opaque_path(): + */ + } + + /* "w3lib/_url.pyx":534 + * if base is None: + * raise ValueError + * if base.has_opaque_path(): # <<<<<<<<<<<<<< + * if c != "#": + * raise ValueError + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 534, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":535 + * raise ValueError + * if base.has_opaque_path(): + * if c != "#": # <<<<<<<<<<<<<< + * raise ValueError + * url.scheme = base.scheme + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 535, __pyx_L1_error) + if (unlikely(__pyx_t_1)) { + + /* "w3lib/_url.pyx":536 + * if base.has_opaque_path(): + * if c != "#": + * raise ValueError # <<<<<<<<<<<<<< + * url.scheme = base.scheme + * url.path = base.path + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 536, __pyx_L1_error) + + /* "w3lib/_url.pyx":535 + * raise ValueError + * if base.has_opaque_path(): + * if c != "#": # <<<<<<<<<<<<<< + * raise ValueError + * url.scheme = base.scheme + */ + } + + /* "w3lib/_url.pyx":537 + * if c != "#": + * raise ValueError + * url.scheme = base.scheme # <<<<<<<<<<<<<< + * url.path = base.path + * url.query = base.query + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":538 + * raise ValueError + * url.scheme = base.scheme + * url.path = base.path # <<<<<<<<<<<<<< + * url.query = base.query + * url.fragment = "" + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_3) < 0) __PYX_ERR(0, 538, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":539 + * url.scheme = base.scheme + * url.path = base.path + * url.query = base.query # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_3) < 0) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":540 + * url.path = base.path + * url.query = base.query + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * else: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 540, __pyx_L1_error) + + /* "w3lib/_url.pyx":541 + * url.query = base.query + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * else: + * if base.scheme != "file": + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":534 + * if base is None: + * raise ValueError + * if base.has_opaque_path(): # <<<<<<<<<<<<<< + * if c != "#": + * raise ValueError + */ + goto __pyx_L30; + } + + /* "w3lib/_url.pyx":543 + * state = FRAGMENT + * else: + * if base.scheme != "file": # <<<<<<<<<<<<<< + * state = RELATIVE + * else: + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":544 + * else: + * if base.scheme != "file": + * state = RELATIVE # <<<<<<<<<<<<<< + * else: + * state = FILE + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RELATIVE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":543 + * state = FRAGMENT + * else: + * if base.scheme != "file": # <<<<<<<<<<<<<< + * state = RELATIVE + * else: + */ + goto __pyx_L32; + } + + /* "w3lib/_url.pyx":546 + * state = RELATIVE + * else: + * state = FILE # <<<<<<<<<<<<<< + * pointer -= 1 + * + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FILE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L32:; + + /* "w3lib/_url.pyx":547 + * else: + * state = FILE + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: + */ + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L30:; + + /* "w3lib/_url.pyx":531 + * pointer = -1 + * + * elif state == NO_SCHEME: # <<<<<<<<<<<<<< + * if base is None: + * raise ValueError + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":549 + * pointer -= 1 + * + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":550 + * + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: + * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer += 1 + */ + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 550, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L34_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_11; + __pyx_L34_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":551 + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< + * pointer += 1 + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":552 + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer += 1 # <<<<<<<<<<<<<< + * else: + * state = RELATIVE + */ + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":550 + * + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: + * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer += 1 + */ + goto __pyx_L33; + } + + /* "w3lib/_url.pyx":554 + * pointer += 1 + * else: + * state = RELATIVE # <<<<<<<<<<<<<< + * pointer -= 1 + * + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RELATIVE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":555 + * else: + * state = RELATIVE + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == PATH_OR_AUTHORITY: + */ + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L33:; + + /* "w3lib/_url.pyx":549 + * pointer -= 1 + * + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":557 + * pointer -= 1 + * + * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< + * if c == "/": + * state = AUTHORITY + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_OR_AUTHORITY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":558 + * + * elif state == PATH_OR_AUTHORITY: + * if c == "/": # <<<<<<<<<<<<<< + * state = AUTHORITY + * else: + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 558, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":559 + * elif state == PATH_OR_AUTHORITY: + * if c == "/": + * state = AUTHORITY # <<<<<<<<<<<<<< + * else: + * state = PATH + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":558 + * + * elif state == PATH_OR_AUTHORITY: + * if c == "/": # <<<<<<<<<<<<<< + * state = AUTHORITY + * else: + */ + goto __pyx_L36; + } + + /* "w3lib/_url.pyx":561 + * state = AUTHORITY + * else: + * state = PATH # <<<<<<<<<<<<<< + * pointer -= 1 + * + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":562 + * else: + * state = PATH + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == RELATIVE: + */ + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L36:; + + /* "w3lib/_url.pyx":557 + * pointer -= 1 + * + * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< + * if c == "/": + * state = AUTHORITY + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":564 + * pointer -= 1 + * + * elif state == RELATIVE: # <<<<<<<<<<<<<< + * assert isinstance(base, _URL) + * url.scheme = base.scheme + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RELATIVE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":565 + * + * elif state == RELATIVE: + * assert isinstance(base, _URL) # <<<<<<<<<<<<<< + * url.scheme = base.scheme + * if c == "/" or url.is_special and c == "\\": + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_URL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_IsInstance(__pyx_v_base, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 565, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 565, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 565, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":566 + * elif state == RELATIVE: + * assert isinstance(base, _URL) + * url.scheme = base.scheme # <<<<<<<<<<<<<< + * if c == "/" or url.is_special and c == "\\": + * state = RELATIVE_SLASH + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":567 + * assert isinstance(base, _URL) + * url.scheme = base.scheme + * if c == "/" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * state = RELATIVE_SLASH + * else: + */ + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 567, __pyx_L1_error) + if (!__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L38_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 567, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L38_bool_binop_done; + } + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_1 = __pyx_t_11; + __pyx_L38_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":568 + * url.scheme = base.scheme + * if c == "/" or url.is_special and c == "\\": + * state = RELATIVE_SLASH # <<<<<<<<<<<<<< + * else: + * url.username = base.username + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RELATIVE_SLASH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":567 + * assert isinstance(base, _URL) + * url.scheme = base.scheme + * if c == "/" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * state = RELATIVE_SLASH + * else: + */ + goto __pyx_L37; + } + + /* "w3lib/_url.pyx":570 + * state = RELATIVE_SLASH + * else: + * url.username = base.username # <<<<<<<<<<<<<< + * url.password = base.password + * url.hostname = base.hostname + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_3) < 0) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":571 + * else: + * url.username = base.username + * url.password = base.password # <<<<<<<<<<<<<< + * url.hostname = base.hostname + * url.port = base.port + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_3) < 0) __PYX_ERR(0, 571, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":572 + * url.username = base.username + * url.password = base.password + * url.hostname = base.hostname # <<<<<<<<<<<<<< + * url.port = base.port + * url.path = base.path + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_3) < 0) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":573 + * url.password = base.password + * url.hostname = base.hostname + * url.port = base.port # <<<<<<<<<<<<<< + * url.path = base.path + * url.query = base.query + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_3) < 0) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":574 + * url.hostname = base.hostname + * url.port = base.port + * url.path = base.path # <<<<<<<<<<<<<< + * url.query = base.query + * if c == "?": + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_3) < 0) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":575 + * url.port = base.port + * url.path = base.path + * url.query = base.query # <<<<<<<<<<<<<< + * if c == "?": + * url.query = "" + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_3) < 0) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":576 + * url.path = base.path + * url.query = base.query + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 576, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":577 + * url.query = base.query + * if c == "?": + * url.query = "" # <<<<<<<<<<<<<< + * state = QUERY + * elif c == "#": + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 577, __pyx_L1_error) + + /* "w3lib/_url.pyx":578 + * if c == "?": + * url.query = "" + * state = QUERY # <<<<<<<<<<<<<< + * elif c == "#": + * url.fragment = "" + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":576 + * url.path = base.path + * url.query = base.query + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY + */ + goto __pyx_L41; + } + + /* "w3lib/_url.pyx":579 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 579, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":580 + * state = QUERY + * elif c == "#": + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * elif pointer < input_length: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + + /* "w3lib/_url.pyx":581 + * elif c == "#": + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * elif pointer < input_length: + * url.query = None + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":579 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + goto __pyx_L41; + } + + /* "w3lib/_url.pyx":582 + * url.fragment = "" + * state = FRAGMENT + * elif pointer < input_length: # <<<<<<<<<<<<<< + * url.query = None + * _shorten_path(url) + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 582, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":583 + * state = FRAGMENT + * elif pointer < input_length: + * url.query = None # <<<<<<<<<<<<<< + * _shorten_path(url) + * state = PATH + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 583, __pyx_L1_error) + + /* "w3lib/_url.pyx":584 + * elif pointer < input_length: + * url.query = None + * _shorten_path(url) # <<<<<<<<<<<<<< + * state = PATH + * pointer -= 1 + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_url}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":585 + * url.query = None + * _shorten_path(url) + * state = PATH # <<<<<<<<<<<<<< + * pointer -= 1 + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":586 + * _shorten_path(url) + * state = PATH + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == RELATIVE_SLASH: + */ + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":582 + * url.fragment = "" + * state = FRAGMENT + * elif pointer < input_length: # <<<<<<<<<<<<<< + * url.query = None + * _shorten_path(url) + */ + } + __pyx_L41:; + } + __pyx_L37:; + + /* "w3lib/_url.pyx":564 + * pointer -= 1 + * + * elif state == RELATIVE: # <<<<<<<<<<<<<< + * assert isinstance(base, _URL) + * url.scheme = base.scheme + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":588 + * pointer -= 1 + * + * elif state == RELATIVE_SLASH: # <<<<<<<<<<<<<< + * assert isinstance(base, _URL) + * if url.is_special and c is not None and c in "/\\": + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RELATIVE_SLASH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":589 + * + * elif state == RELATIVE_SLASH: + * assert isinstance(base, _URL) # <<<<<<<<<<<<<< + * if url.is_special and c is not None and c in "/\\": + * assert isinstance(c, str) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_URL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_IsInstance(__pyx_v_base, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 589, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 589, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":590 + * elif state == RELATIVE_SLASH: + * assert isinstance(base, _URL) + * if url.is_special and c is not None and c in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L43_bool_binop_done; + } + __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L43_bool_binop_done; + } + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_1 = __pyx_t_11; + __pyx_L43_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":591 + * assert isinstance(base, _URL) + * if url.is_special and c is not None and c in "/\\": + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * elif c == "/": + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 591, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 591, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":592 + * if url.is_special and c is not None and c in "/\\": + * assert isinstance(c, str) + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< + * elif c == "/": + * state = AUTHORITY + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":590 + * elif state == RELATIVE_SLASH: + * assert isinstance(base, _URL) + * if url.is_special and c is not None and c in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + */ + goto __pyx_L42; + } + + /* "w3lib/_url.pyx":593 + * assert isinstance(c, str) + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * elif c == "/": # <<<<<<<<<<<<<< + * state = AUTHORITY + * else: + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 593, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":594 + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * elif c == "/": + * state = AUTHORITY # <<<<<<<<<<<<<< + * else: + * url.username = base.username + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":593 + * assert isinstance(c, str) + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * elif c == "/": # <<<<<<<<<<<<<< + * state = AUTHORITY + * else: + */ + goto __pyx_L42; + } + + /* "w3lib/_url.pyx":596 + * state = AUTHORITY + * else: + * url.username = base.username # <<<<<<<<<<<<<< + * url.password = base.password + * url.hostname = base.hostname + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_3) < 0) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":597 + * else: + * url.username = base.username + * url.password = base.password # <<<<<<<<<<<<<< + * url.hostname = base.hostname + * url.port = base.port + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_3) < 0) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":598 + * url.username = base.username + * url.password = base.password + * url.hostname = base.hostname # <<<<<<<<<<<<<< + * url.port = base.port + * state = PATH + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_3) < 0) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":599 + * url.password = base.password + * url.hostname = base.hostname + * url.port = base.port # <<<<<<<<<<<<<< + * state = PATH + * pointer -= 1 + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_3) < 0) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":600 + * url.hostname = base.hostname + * url.port = base.port + * state = PATH # <<<<<<<<<<<<<< + * pointer -= 1 + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":601 + * url.port = base.port + * state = PATH + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == SPECIAL_AUTHORITY_SLASHES: + */ + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L42:; + + /* "w3lib/_url.pyx":588 + * pointer -= 1 + * + * elif state == RELATIVE_SLASH: # <<<<<<<<<<<<<< + * assert isinstance(base, _URL) + * if url.is_special and c is not None and c in "/\\": + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":603 + * pointer -= 1 + * + * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":604 + * + * elif state == SPECIAL_AUTHORITY_SLASHES: + * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer += 1 + */ + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 604, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L47_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_11; + __pyx_L47_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":605 + * elif state == SPECIAL_AUTHORITY_SLASHES: + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< + * pointer += 1 + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":606 + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer += 1 # <<<<<<<<<<<<<< + * else: + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + */ + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":604 + * + * elif state == SPECIAL_AUTHORITY_SLASHES: + * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer += 1 + */ + goto __pyx_L46; + } + + /* "w3lib/_url.pyx":608 + * pointer += 1 + * else: + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< + * pointer -= 1 + * + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":609 + * else: + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: + */ + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L46:; + + /* "w3lib/_url.pyx":603 + * pointer -= 1 + * + * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":611 + * pointer -= 1 + * + * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< + * if c is None or c not in "/\\": + * state = AUTHORITY + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":612 + * + * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: + * if c is None or c not in "/\\": # <<<<<<<<<<<<<< + * state = AUTHORITY + * pointer -= 1 + */ + __pyx_t_11 = (__pyx_v_c == ((PyObject*)Py_None)); + if (!__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L50_bool_binop_done; + } + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 612, __pyx_L1_error) + __pyx_t_1 = __pyx_t_11; + __pyx_L50_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":613 + * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: + * if c is None or c not in "/\\": + * state = AUTHORITY # <<<<<<<<<<<<<< + * pointer -= 1 + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":614 + * if c is None or c not in "/\\": + * state = AUTHORITY + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == AUTHORITY: + */ + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":612 + * + * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: + * if c is None or c not in "/\\": # <<<<<<<<<<<<<< + * state = AUTHORITY + * pointer -= 1 + */ + } + + /* "w3lib/_url.pyx":611 + * pointer -= 1 + * + * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< + * if c is None or c not in "/\\": + * state = AUTHORITY + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":616 + * pointer -= 1 + * + * elif state == AUTHORITY: # <<<<<<<<<<<<<< + * if not skip_authority_shortcut: + * at_sign_index = input.find("@", pointer) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":617 + * + * elif state == AUTHORITY: + * if not skip_authority_shortcut: # <<<<<<<<<<<<<< + * at_sign_index = input.find("@", pointer) + * if at_sign_index == -1: + */ + __pyx_t_1 = (!__pyx_v_skip_authority_shortcut); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":618 + * elif state == AUTHORITY: + * if not skip_authority_shortcut: + * at_sign_index = input.find("@", pointer) # <<<<<<<<<<<<<< + * if at_sign_index == -1: + * state = HOST + */ + if (unlikely(__pyx_v_input == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "find"); + __PYX_ERR(0, 618, __pyx_L1_error) + } + __pyx_t_7 = (__Pyx_Py_IsNone(__pyx_v_pointer) ? (0) : (__Pyx_PyIndex_AsSsize_t(__pyx_v_pointer))); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 618, __pyx_L1_error) + __pyx_t_12 = PyUnicode_Find(__pyx_v_input, __pyx_kp_u__16, __pyx_t_7, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-2))) __PYX_ERR(0, 618, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_at_sign_index, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":619 + * if not skip_authority_shortcut: + * at_sign_index = input.find("@", pointer) + * if at_sign_index == -1: # <<<<<<<<<<<<<< + * state = HOST + * else: + */ + __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_at_sign_index, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 619, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":620 + * at_sign_index = input.find("@", pointer) + * if at_sign_index == -1: + * state = HOST # <<<<<<<<<<<<<< + * else: + * skip_authority_shortcut = True + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_HOST); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":619 + * if not skip_authority_shortcut: + * at_sign_index = input.find("@", pointer) + * if at_sign_index == -1: # <<<<<<<<<<<<<< + * state = HOST + * else: + */ + goto __pyx_L53; + } + + /* "w3lib/_url.pyx":622 + * state = HOST + * else: + * skip_authority_shortcut = True # <<<<<<<<<<<<<< + * pointer -= 1 + * elif c == "@": + */ + /*else*/ { + __pyx_v_skip_authority_shortcut = 1; + } + __pyx_L53:; + + /* "w3lib/_url.pyx":623 + * else: + * skip_authority_shortcut = True + * pointer -= 1 # <<<<<<<<<<<<<< + * elif c == "@": + * if at_sign_seen: + */ + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":617 + * + * elif state == AUTHORITY: + * if not skip_authority_shortcut: # <<<<<<<<<<<<<< + * at_sign_index = input.find("@", pointer) + * if at_sign_index == -1: + */ + goto __pyx_L52; + } + + /* "w3lib/_url.pyx":624 + * skip_authority_shortcut = True + * pointer -= 1 + * elif c == "@": # <<<<<<<<<<<<<< + * if at_sign_seen: + * buffer = "%40" + buffer + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 624, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":625 + * pointer -= 1 + * elif c == "@": + * if at_sign_seen: # <<<<<<<<<<<<<< + * buffer = "%40" + buffer + * at_sign_seen = True + */ + if (__pyx_v_at_sign_seen) { + + /* "w3lib/_url.pyx":626 + * elif c == "@": + * if at_sign_seen: + * buffer = "%40" + buffer # <<<<<<<<<<<<<< + * at_sign_seen = True + * for i, code_point in enumerate(buffer): + */ + __pyx_t_3 = PyNumber_Add(__pyx_kp_u_40, __pyx_v_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":625 + * pointer -= 1 + * elif c == "@": + * if at_sign_seen: # <<<<<<<<<<<<<< + * buffer = "%40" + buffer + * at_sign_seen = True + */ + } + + /* "w3lib/_url.pyx":627 + * if at_sign_seen: + * buffer = "%40" + buffer + * at_sign_seen = True # <<<<<<<<<<<<<< + * for i, code_point in enumerate(buffer): + * if code_point == ":" and not url._password_token_seen: + */ + __pyx_v_at_sign_seen = 1; + + /* "w3lib/_url.pyx":628 + * buffer = "%40" + buffer + * at_sign_seen = True + * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< + * if code_point == ":" and not url._password_token_seen: + * url._password_token_seen = True + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; + if (likely(PyList_CheckExact(__pyx_v_buffer)) || PyTuple_CheckExact(__pyx_v_buffer)) { + __pyx_t_4 = __pyx_v_buffer; __Pyx_INCREF(__pyx_t_4); + __pyx_t_12 = 0; + __pyx_t_13 = NULL; + } else { + __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 628, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_13)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 628, __pyx_L1_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 628, __pyx_L1_error) + #else + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 628, __pyx_L1_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 628, __pyx_L1_error) + #else + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_13(__pyx_t_4); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 628, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_5; + __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":629 + * at_sign_seen = True + * for i, code_point in enumerate(buffer): + * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< + * url._password_token_seen = True + * continue + */ + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 629, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L58_bool_binop_done; + } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_14 = (!__pyx_t_11); + __pyx_t_1 = __pyx_t_14; + __pyx_L58_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":630 + * for i, code_point in enumerate(buffer): + * if code_point == ":" and not url._password_token_seen: + * url._password_token_seen = True # <<<<<<<<<<<<<< + * continue + * encoded_code_points = _idempotent_utf_8_percent_encode( + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen, Py_True) < 0) __PYX_ERR(0, 630, __pyx_L1_error) + + /* "w3lib/_url.pyx":631 + * if code_point == ":" and not url._password_token_seen: + * url._password_token_seen = True + * continue # <<<<<<<<<<<<<< + * encoded_code_points = _idempotent_utf_8_percent_encode( + * input=buffer, + */ + goto __pyx_L55_continue; + + /* "w3lib/_url.pyx":629 + * at_sign_seen = True + * for i, code_point in enumerate(buffer): + * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< + * url._password_token_seen = True + * continue + */ + } + + /* "w3lib/_url.pyx":632 + * url._password_token_seen = True + * continue + * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * input=buffer, + * pointer=i, + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + + /* "w3lib/_url.pyx":633 + * continue + * encoded_code_points = _idempotent_utf_8_percent_encode( + * input=buffer, # <<<<<<<<<<<<<< + * pointer=i, + * encode_set=userinfo_percent_encode_set, + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_buffer) < 0) __PYX_ERR(0, 633, __pyx_L1_error) + + /* "w3lib/_url.pyx":634 + * encoded_code_points = _idempotent_utf_8_percent_encode( + * input=buffer, + * pointer=i, # <<<<<<<<<<<<<< + * encode_set=userinfo_percent_encode_set, + * ) + */ + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_i) < 0) __PYX_ERR(0, 633, __pyx_L1_error) + + /* "w3lib/_url.pyx":635 + * input=buffer, + * pointer=i, + * encode_set=userinfo_percent_encode_set, # <<<<<<<<<<<<<< + * ) + * if url._password_token_seen: + */ + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 633, __pyx_L1_error) + + /* "w3lib/_url.pyx":632 + * url._password_token_seen = True + * continue + * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * input=buffer, + * pointer=i, + */ + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_encoded_code_points, __pyx_t_15); + __pyx_t_15 = 0; + + /* "w3lib/_url.pyx":637 + * encode_set=userinfo_percent_encode_set, + * ) + * if url._password_token_seen: # <<<<<<<<<<<<<< + * url.password += encoded_code_points + * else: + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":638 + * ) + * if url._password_token_seen: + * url.password += encoded_code_points # <<<<<<<<<<<<<< + * else: + * url.username += encoded_code_points + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_15, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_2) < 0) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":637 + * encode_set=userinfo_percent_encode_set, + * ) + * if url._password_token_seen: # <<<<<<<<<<<<<< + * url.password += encoded_code_points + * else: + */ + goto __pyx_L60; + } + + /* "w3lib/_url.pyx":640 + * url.password += encoded_code_points + * else: + * url.username += encoded_code_points # <<<<<<<<<<<<<< + * buffer = "" + * elif c is None or c in "/?#" or url.is_special and c == "\\": + */ + /*else*/ { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_15) < 0) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + __pyx_L60:; + + /* "w3lib/_url.pyx":628 + * buffer = "%40" + buffer + * at_sign_seen = True + * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< + * if code_point == ":" and not url._password_token_seen: + * url._password_token_seen = True + */ + __pyx_L55_continue:; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":641 + * else: + * url.username += encoded_code_points + * buffer = "" # <<<<<<<<<<<<<< + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * if at_sign_seen and not buffer: + */ + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + + /* "w3lib/_url.pyx":624 + * skip_authority_shortcut = True + * pointer -= 1 + * elif c == "@": # <<<<<<<<<<<<<< + * if at_sign_seen: + * buffer = "%40" + buffer + */ + goto __pyx_L52; + } + + /* "w3lib/_url.pyx":642 + * url.username += encoded_code_points + * buffer = "" + * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * if at_sign_seen and not buffer: + * raise ValueError + */ + __pyx_t_14 = (__pyx_v_c == ((PyObject*)Py_None)); + if (!__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L62_bool_binop_done; + } + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 642, __pyx_L1_error) + if (!__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L62_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 642, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 642, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L62_bool_binop_done; + } + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_1 = __pyx_t_14; + __pyx_L62_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":643 + * buffer = "" + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< + * raise ValueError + * pointer -= len(buffer) + 1 + */ + if (__pyx_v_at_sign_seen) { + } else { + __pyx_t_1 = __pyx_v_at_sign_seen; + goto __pyx_L67_bool_binop_done; + } + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_14); + __pyx_t_1 = __pyx_t_11; + __pyx_L67_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "w3lib/_url.pyx":644 + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * if at_sign_seen and not buffer: + * raise ValueError # <<<<<<<<<<<<<< + * pointer -= len(buffer) + 1 + * buffer = "" + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 644, __pyx_L1_error) + + /* "w3lib/_url.pyx":643 + * buffer = "" + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< + * raise ValueError + * pointer -= len(buffer) + 1 + */ + } + + /* "w3lib/_url.pyx":645 + * if at_sign_seen and not buffer: + * raise ValueError + * pointer -= len(buffer) + 1 # <<<<<<<<<<<<<< + * buffer = "" + * state = HOST + */ + __pyx_t_12 = PyObject_Length(__pyx_v_buffer); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 645, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_12 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":646 + * raise ValueError + * pointer -= len(buffer) + 1 + * buffer = "" # <<<<<<<<<<<<<< + * state = HOST + * else: + */ + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + + /* "w3lib/_url.pyx":647 + * pointer -= len(buffer) + 1 + * buffer = "" + * state = HOST # <<<<<<<<<<<<<< + * else: + * buffer += c + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_HOST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":642 + * url.username += encoded_code_points + * buffer = "" + * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * if at_sign_seen and not buffer: + * raise ValueError + */ + goto __pyx_L52; + } + + /* "w3lib/_url.pyx":649 + * state = HOST + * else: + * buffer += c # <<<<<<<<<<<<<< + * + * elif state == HOST: + */ + /*else*/ { + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L52:; + + /* "w3lib/_url.pyx":616 + * pointer -= 1 + * + * elif state == AUTHORITY: # <<<<<<<<<<<<<< + * if not skip_authority_shortcut: + * at_sign_index = input.find("@", pointer) + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":651 + * buffer += c + * + * elif state == HOST: # <<<<<<<<<<<<<< + * if c == ":" and not inside_brackets: + * if not buffer: + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_HOST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":652 + * + * elif state == HOST: + * if c == ":" and not inside_brackets: # <<<<<<<<<<<<<< + * if not buffer: + * raise ValueError + */ + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 652, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L70_bool_binop_done; + } + __pyx_t_11 = (!__pyx_v_inside_brackets); + __pyx_t_1 = __pyx_t_11; + __pyx_L70_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":653 + * elif state == HOST: + * if c == ":" and not inside_brackets: + * if not buffer: # <<<<<<<<<<<<<< + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 653, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_1); + if (unlikely(__pyx_t_11)) { + + /* "w3lib/_url.pyx":654 + * if c == ":" and not inside_brackets: + * if not buffer: + * raise ValueError # <<<<<<<<<<<<<< + * host = _parse_host(buffer, is_special=url.is_special) + * url.hostname = host + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 654, __pyx_L1_error) + + /* "w3lib/_url.pyx":653 + * elif state == HOST: + * if c == ":" and not inside_brackets: + * if not buffer: # <<<<<<<<<<<<<< + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) + */ + } + + /* "w3lib/_url.pyx":655 + * if not buffer: + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< + * url.hostname = host + * buffer = "" + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_buffer); + __Pyx_GIVEREF(__pyx_v_buffer); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_buffer)) __PYX_ERR(0, 655, __pyx_L1_error); + __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_is_special, __pyx_t_2) < 0) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":656 + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) + * url.hostname = host # <<<<<<<<<<<<<< + * buffer = "" + * state = PORT + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 656, __pyx_L1_error) + + /* "w3lib/_url.pyx":657 + * host = _parse_host(buffer, is_special=url.is_special) + * url.hostname = host + * buffer = "" # <<<<<<<<<<<<<< + * state = PORT + * url._port_token_seen = True + */ + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + + /* "w3lib/_url.pyx":658 + * url.hostname = host + * buffer = "" + * state = PORT # <<<<<<<<<<<<<< + * url._port_token_seen = True + * elif c is None or c in "/?#" or url.is_special and c == "\\": + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":659 + * buffer = "" + * state = PORT + * url._port_token_seen = True # <<<<<<<<<<<<<< + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * pointer -= 1 + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen, Py_True) < 0) __PYX_ERR(0, 659, __pyx_L1_error) + + /* "w3lib/_url.pyx":652 + * + * elif state == HOST: + * if c == ":" and not inside_brackets: # <<<<<<<<<<<<<< + * if not buffer: + * raise ValueError + */ + goto __pyx_L69; + } + + /* "w3lib/_url.pyx":660 + * state = PORT + * url._port_token_seen = True + * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * pointer -= 1 + * if url.is_special and not buffer: + */ + __pyx_t_1 = (__pyx_v_c == ((PyObject*)Py_None)); + if (!__pyx_t_1) { + } else { + __pyx_t_11 = __pyx_t_1; + goto __pyx_L73_bool_binop_done; + } + __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 660, __pyx_L1_error) + if (!__pyx_t_1) { + } else { + __pyx_t_11 = __pyx_t_1; + goto __pyx_L73_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + } else { + __pyx_t_11 = __pyx_t_1; + goto __pyx_L73_bool_binop_done; + } + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_11 = __pyx_t_1; + __pyx_L73_bool_binop_done:; + if (__pyx_t_11) { + + /* "w3lib/_url.pyx":661 + * url._port_token_seen = True + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * pointer -= 1 # <<<<<<<<<<<<<< + * if url.is_special and not buffer: + * raise ValueError + */ + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":662 + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * pointer -= 1 + * if url.is_special and not buffer: # <<<<<<<<<<<<<< + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + } else { + __pyx_t_11 = __pyx_t_1; + goto __pyx_L78_bool_binop_done; + } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_14 = (!__pyx_t_1); + __pyx_t_11 = __pyx_t_14; + __pyx_L78_bool_binop_done:; + if (unlikely(__pyx_t_11)) { + + /* "w3lib/_url.pyx":663 + * pointer -= 1 + * if url.is_special and not buffer: + * raise ValueError # <<<<<<<<<<<<<< + * host = _parse_host(buffer, is_special=url.is_special) + * url.hostname = host + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 663, __pyx_L1_error) + + /* "w3lib/_url.pyx":662 + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * pointer -= 1 + * if url.is_special and not buffer: # <<<<<<<<<<<<<< + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) + */ + } + + /* "w3lib/_url.pyx":664 + * if url.is_special and not buffer: + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< + * url.hostname = host + * buffer = "" + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_INCREF(__pyx_v_buffer); + __Pyx_GIVEREF(__pyx_v_buffer); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_buffer)) __PYX_ERR(0, 664, __pyx_L1_error); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_is_special, __pyx_t_3) < 0) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_15, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":665 + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) + * url.hostname = host # <<<<<<<<<<<<<< + * buffer = "" + * state = PATH_START + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 665, __pyx_L1_error) + + /* "w3lib/_url.pyx":666 + * host = _parse_host(buffer, is_special=url.is_special) + * url.hostname = host + * buffer = "" # <<<<<<<<<<<<<< + * state = PATH_START + * else: + */ + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + + /* "w3lib/_url.pyx":667 + * url.hostname = host + * buffer = "" + * state = PATH_START # <<<<<<<<<<<<<< + * else: + * if c == "[": + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":660 + * state = PORT + * url._port_token_seen = True + * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * pointer -= 1 + * if url.is_special and not buffer: + */ + goto __pyx_L69; + } + + /* "w3lib/_url.pyx":669 + * state = PATH_START + * else: + * if c == "[": # <<<<<<<<<<<<<< + * inside_brackets = True + * elif c == "]": + */ + /*else*/ { + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 669, __pyx_L1_error) + if (__pyx_t_11) { + + /* "w3lib/_url.pyx":670 + * else: + * if c == "[": + * inside_brackets = True # <<<<<<<<<<<<<< + * elif c == "]": + * inside_brackets = False + */ + __pyx_v_inside_brackets = 1; + + /* "w3lib/_url.pyx":669 + * state = PATH_START + * else: + * if c == "[": # <<<<<<<<<<<<<< + * inside_brackets = True + * elif c == "]": + */ + goto __pyx_L80; + } + + /* "w3lib/_url.pyx":671 + * if c == "[": + * inside_brackets = True + * elif c == "]": # <<<<<<<<<<<<<< + * inside_brackets = False + * buffer += c + */ + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 671, __pyx_L1_error) + if (__pyx_t_11) { + + /* "w3lib/_url.pyx":672 + * inside_brackets = True + * elif c == "]": + * inside_brackets = False # <<<<<<<<<<<<<< + * buffer += c + * + */ + __pyx_v_inside_brackets = 0; + + /* "w3lib/_url.pyx":671 + * if c == "[": + * inside_brackets = True + * elif c == "]": # <<<<<<<<<<<<<< + * inside_brackets = False + * buffer += c + */ + } + __pyx_L80:; + + /* "w3lib/_url.pyx":673 + * elif c == "]": + * inside_brackets = False + * buffer += c # <<<<<<<<<<<<<< + * + * elif state == PORT: + */ + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L69:; + + /* "w3lib/_url.pyx":651 + * buffer += c + * + * elif state == HOST: # <<<<<<<<<<<<<< + * if c == ":" and not inside_brackets: + * if not buffer: + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":675 + * buffer += c + * + * elif state == PORT: # <<<<<<<<<<<<<< + * if c is not None and c in _ASCII_DIGIT: + * assert isinstance(c, str) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_11) { + + /* "w3lib/_url.pyx":676 + * + * elif state == PORT: + * if c is not None and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * buffer += c + */ + __pyx_t_14 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_14) { + } else { + __pyx_t_11 = __pyx_t_14; + goto __pyx_L82_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 676, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __pyx_t_14; + __pyx_L82_bool_binop_done:; + if (__pyx_t_11) { + + /* "w3lib/_url.pyx":677 + * elif state == PORT: + * if c is not None and c in _ASCII_DIGIT: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * buffer += c + * elif c is None or c in "/?#" or url.is_special and c == "\\": + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_11 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_11)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 677, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 677, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":678 + * if c is not None and c in _ASCII_DIGIT: + * assert isinstance(c, str) + * buffer += c # <<<<<<<<<<<<<< + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * if buffer: + */ + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":676 + * + * elif state == PORT: + * if c is not None and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * buffer += c + */ + goto __pyx_L81; + } + + /* "w3lib/_url.pyx":679 + * assert isinstance(c, str) + * buffer += c + * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * if buffer: + * port = int(buffer) + */ + __pyx_t_14 = (__pyx_v_c == ((PyObject*)Py_None)); + if (!__pyx_t_14) { + } else { + __pyx_t_11 = __pyx_t_14; + goto __pyx_L84_bool_binop_done; + } + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) + if (!__pyx_t_14) { + } else { + __pyx_t_11 = __pyx_t_14; + goto __pyx_L84_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_14) { + } else { + __pyx_t_11 = __pyx_t_14; + goto __pyx_L84_bool_binop_done; + } + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_11 = __pyx_t_14; + __pyx_L84_bool_binop_done:; + if (likely(__pyx_t_11)) { + + /* "w3lib/_url.pyx":680 + * buffer += c + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * if buffer: # <<<<<<<<<<<<<< + * port = int(buffer) + * if port > 2**16 - 1: + */ + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 680, __pyx_L1_error) + if (__pyx_t_11) { + + /* "w3lib/_url.pyx":681 + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * if buffer: + * port = int(buffer) # <<<<<<<<<<<<<< + * if port > 2**16 - 1: + * raise ValueError + */ + __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_port, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":682 + * if buffer: + * port = int(buffer) + * if port > 2**16 - 1: # <<<<<<<<<<<<<< + * raise ValueError + * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_port, __pyx_int_65535, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__pyx_t_11)) { + + /* "w3lib/_url.pyx":683 + * port = int(buffer) + * if port > 2**16 - 1: + * raise ValueError # <<<<<<<<<<<<<< + * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port + * url._default_port_seen = url.port is None + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 683, __pyx_L1_error) + + /* "w3lib/_url.pyx":682 + * if buffer: + * port = int(buffer) + * if port > 2**16 - 1: # <<<<<<<<<<<<<< + * raise ValueError + * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port + */ + } + + /* "w3lib/_url.pyx":684 + * if port > 2**16 - 1: + * raise ValueError + * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port # <<<<<<<<<<<<<< + * url._default_port_seen = url.port is None + * buffer = "" + */ + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_15}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_port, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_11) { + __Pyx_INCREF(Py_None); + __pyx_t_4 = Py_None; + } else { + __Pyx_INCREF(__pyx_v_port); + __pyx_t_4 = __pyx_v_port; + } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_4) < 0) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":685 + * raise ValueError + * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port + * url._default_port_seen = url.port is None # <<<<<<<<<<<<<< + * buffer = "" + * state = PATH_START + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = (__pyx_t_4 == Py_None); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen, __pyx_t_4) < 0) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":686 + * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port + * url._default_port_seen = url.port is None + * buffer = "" # <<<<<<<<<<<<<< + * state = PATH_START + * pointer -= 1 + */ + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + + /* "w3lib/_url.pyx":680 + * buffer += c + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * if buffer: # <<<<<<<<<<<<<< + * port = int(buffer) + * if port > 2**16 - 1: + */ + } + + /* "w3lib/_url.pyx":687 + * url._default_port_seen = url.port is None + * buffer = "" + * state = PATH_START # <<<<<<<<<<<<<< + * pointer -= 1 + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":688 + * buffer = "" + * state = PATH_START + * pointer -= 1 # <<<<<<<<<<<<<< + * else: + * raise ValueError + */ + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":679 + * assert isinstance(c, str) + * buffer += c + * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * if buffer: + * port = int(buffer) + */ + goto __pyx_L81; + } + + /* "w3lib/_url.pyx":690 + * pointer -= 1 + * else: + * raise ValueError # <<<<<<<<<<<<<< + * + * elif state == FILE: + */ + /*else*/ { + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 690, __pyx_L1_error) + } + __pyx_L81:; + + /* "w3lib/_url.pyx":675 + * buffer += c + * + * elif state == PORT: # <<<<<<<<<<<<<< + * if c is not None and c in _ASCII_DIGIT: + * assert isinstance(c, str) + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":692 + * raise ValueError + * + * elif state == FILE: # <<<<<<<<<<<<<< + * url.scheme = "file" + * url.hostname = "" + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FILE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_11) { + + /* "w3lib/_url.pyx":693 + * + * elif state == FILE: + * url.scheme = "file" # <<<<<<<<<<<<<< + * url.hostname = "" + * if c is not None and c in "/\\": + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_n_u_file) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + + /* "w3lib/_url.pyx":694 + * elif state == FILE: + * url.scheme = "file" + * url.hostname = "" # <<<<<<<<<<<<<< + * if c is not None and c in "/\\": + * assert isinstance(c, str) + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 694, __pyx_L1_error) + + /* "w3lib/_url.pyx":695 + * url.scheme = "file" + * url.hostname = "" + * if c is not None and c in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * state = FILE_SLASH + */ + __pyx_t_14 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_14) { + } else { + __pyx_t_11 = __pyx_t_14; + goto __pyx_L91_bool_binop_done; + } + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_11 = __pyx_t_14; + __pyx_L91_bool_binop_done:; + if (__pyx_t_11) { + + /* "w3lib/_url.pyx":696 + * url.hostname = "" + * if c is not None and c in "/\\": + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * state = FILE_SLASH + * elif base is not None and base.scheme == "file": + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_11 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_11)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 696, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 696, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":697 + * if c is not None and c in "/\\": + * assert isinstance(c, str) + * state = FILE_SLASH # <<<<<<<<<<<<<< + * elif base is not None and base.scheme == "file": + * url.hostname = base.hostname + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FILE_SLASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":695 + * url.scheme = "file" + * url.hostname = "" + * if c is not None and c in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * state = FILE_SLASH + */ + goto __pyx_L90; + } + + /* "w3lib/_url.pyx":698 + * assert isinstance(c, str) + * state = FILE_SLASH + * elif base is not None and base.scheme == "file": # <<<<<<<<<<<<<< + * url.hostname = base.hostname + * url.path = base.path + */ + __pyx_t_14 = (__pyx_v_base != Py_None); + if (__pyx_t_14) { + } else { + __pyx_t_11 = __pyx_t_14; + goto __pyx_L93_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_11 = __pyx_t_14; + __pyx_L93_bool_binop_done:; + if (__pyx_t_11) { + + /* "w3lib/_url.pyx":699 + * state = FILE_SLASH + * elif base is not None and base.scheme == "file": + * url.hostname = base.hostname # <<<<<<<<<<<<<< + * url.path = base.path + * url.query = base.query + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_2) < 0) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":700 + * elif base is not None and base.scheme == "file": + * url.hostname = base.hostname + * url.path = base.path # <<<<<<<<<<<<<< + * url.query = base.query + * if c == "?": + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_2) < 0) __PYX_ERR(0, 700, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":701 + * url.hostname = base.hostname + * url.path = base.path + * url.query = base.query # <<<<<<<<<<<<<< + * if c == "?": + * url.query = "" + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_2) < 0) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":702 + * url.path = base.path + * url.query = base.query + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY + */ + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 702, __pyx_L1_error) + if (__pyx_t_11) { + + /* "w3lib/_url.pyx":703 + * url.query = base.query + * if c == "?": + * url.query = "" # <<<<<<<<<<<<<< + * state = QUERY + * elif c == "#": + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 703, __pyx_L1_error) + + /* "w3lib/_url.pyx":704 + * if c == "?": + * url.query = "" + * state = QUERY # <<<<<<<<<<<<<< + * elif c == "#": + * url.fragment = "" + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":702 + * url.path = base.path + * url.query = base.query + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY + */ + goto __pyx_L95; + } + + /* "w3lib/_url.pyx":705 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 705, __pyx_L1_error) + if (__pyx_t_11) { + + /* "w3lib/_url.pyx":706 + * state = QUERY + * elif c == "#": + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * elif c is not None: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 706, __pyx_L1_error) + + /* "w3lib/_url.pyx":707 + * elif c == "#": + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * elif c is not None: + * assert isinstance(c, str) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":705 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + goto __pyx_L95; + } + + /* "w3lib/_url.pyx":708 + * url.fragment = "" + * state = FRAGMENT + * elif c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * url.query = None + */ + __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_11) { + + /* "w3lib/_url.pyx":709 + * state = FRAGMENT + * elif c is not None: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * url.query = None + * if not _starts_with_windows_drive_letter(input[pointer:]): + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_11 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_11)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 709, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 709, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":710 + * elif c is not None: + * assert isinstance(c, str) + * url.query = None # <<<<<<<<<<<<<< + * if not _starts_with_windows_drive_letter(input[pointer:]): + * _shorten_path(url) + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 710, __pyx_L1_error) + + /* "w3lib/_url.pyx":711 + * assert isinstance(c, str) + * url.query = None + * if not _starts_with_windows_drive_letter(input[pointer:]): # <<<<<<<<<<<<<< + * _shorten_path(url) + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__pyx_v_input == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 711, __pyx_L1_error) + } + __Pyx_INCREF(__pyx_v_pointer); + __pyx_t_3 = __pyx_v_pointer; + __pyx_t_11 = (__pyx_t_3 == Py_None); + if (__pyx_t_11) { + __pyx_t_12 = 0; + } else { + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_t_12 = __pyx_t_7; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_12, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = (!__pyx_t_11); + if (__pyx_t_14) { + + /* "w3lib/_url.pyx":712 + * url.query = None + * if not _starts_with_windows_drive_letter(input[pointer:]): + * _shorten_path(url) # <<<<<<<<<<<<<< + * else: + * url.path = [] + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_url}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":711 + * assert isinstance(c, str) + * url.query = None + * if not _starts_with_windows_drive_letter(input[pointer:]): # <<<<<<<<<<<<<< + * _shorten_path(url) + * else: + */ + goto __pyx_L96; + } + + /* "w3lib/_url.pyx":714 + * _shorten_path(url) + * else: + * url.path = [] # <<<<<<<<<<<<<< + * state = PATH + * pointer -= 1 + */ + /*else*/ { + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_2) < 0) __PYX_ERR(0, 714, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L96:; + + /* "w3lib/_url.pyx":715 + * else: + * url.path = [] + * state = PATH # <<<<<<<<<<<<<< + * pointer -= 1 + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":716 + * url.path = [] + * state = PATH + * pointer -= 1 # <<<<<<<<<<<<<< + * else: + * state = PATH + */ + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":708 + * url.fragment = "" + * state = FRAGMENT + * elif c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * url.query = None + */ + } + __pyx_L95:; + + /* "w3lib/_url.pyx":698 + * assert isinstance(c, str) + * state = FILE_SLASH + * elif base is not None and base.scheme == "file": # <<<<<<<<<<<<<< + * url.hostname = base.hostname + * url.path = base.path + */ + goto __pyx_L90; + } + + /* "w3lib/_url.pyx":718 + * pointer -= 1 + * else: + * state = PATH # <<<<<<<<<<<<<< + * pointer -= 1 + * + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":719 + * else: + * state = PATH + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == FILE_SLASH: + */ + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L90:; + + /* "w3lib/_url.pyx":692 + * raise ValueError + * + * elif state == FILE: # <<<<<<<<<<<<<< + * url.scheme = "file" + * url.hostname = "" + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":721 + * pointer -= 1 + * + * elif state == FILE_SLASH: # <<<<<<<<<<<<<< + * assert isinstance(url.path, list) + * if c is not None and c in "/\\": + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FILE_SLASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_14) { + + /* "w3lib/_url.pyx":722 + * + * elif state == FILE_SLASH: + * assert isinstance(url.path, list) # <<<<<<<<<<<<<< + * if c is not None and c in "/\\": + * assert isinstance(c, str) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = PyList_Check(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_14)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 722, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 722, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":723 + * elif state == FILE_SLASH: + * assert isinstance(url.path, list) + * if c is not None and c in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * state = FILE_HOST + */ + __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_11) { + } else { + __pyx_t_14 = __pyx_t_11; + goto __pyx_L98_bool_binop_done; + } + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_14 = __pyx_t_11; + __pyx_L98_bool_binop_done:; + if (__pyx_t_14) { + + /* "w3lib/_url.pyx":724 + * assert isinstance(url.path, list) + * if c is not None and c in "/\\": + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * state = FILE_HOST + * else: + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_14 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_14)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 724, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 724, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":725 + * if c is not None and c in "/\\": + * assert isinstance(c, str) + * state = FILE_HOST # <<<<<<<<<<<<<< + * else: + * if base is not None and base.scheme == "file": + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FILE_HOST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":723 + * elif state == FILE_SLASH: + * assert isinstance(url.path, list) + * if c is not None and c in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * state = FILE_HOST + */ + goto __pyx_L97; + } + + /* "w3lib/_url.pyx":727 + * state = FILE_HOST + * else: + * if base is not None and base.scheme == "file": # <<<<<<<<<<<<<< + * url.hostname = base.hostname + * if not _starts_with_windows_drive_letter( + */ + /*else*/ { + __pyx_t_11 = (__pyx_v_base != Py_None); + if (__pyx_t_11) { + } else { + __pyx_t_14 = __pyx_t_11; + goto __pyx_L101_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 727, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_14 = __pyx_t_11; + __pyx_L101_bool_binop_done:; + if (__pyx_t_14) { + + /* "w3lib/_url.pyx":728 + * else: + * if base is not None and base.scheme == "file": + * url.hostname = base.hostname # <<<<<<<<<<<<<< + * if not _starts_with_windows_drive_letter( + * input[pointer:] + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":729 + * if base is not None and base.scheme == "file": + * url.hostname = base.hostname + * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< + * input[pointer:] + * ) and _is_windows_drive_letter(base.path[0]): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_url.pyx":730 + * url.hostname = base.hostname + * if not _starts_with_windows_drive_letter( + * input[pointer:] # <<<<<<<<<<<<<< + * ) and _is_windows_drive_letter(base.path[0]): + * url.path.append(base.path[0]) + */ + if (unlikely(__pyx_v_input == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 730, __pyx_L1_error) + } + __Pyx_INCREF(__pyx_v_pointer); + __pyx_t_3 = __pyx_v_pointer; + __pyx_t_11 = (__pyx_t_3 == Py_None); + if (__pyx_t_11) { + __pyx_t_12 = 0; + } else { + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_12 = __pyx_t_7; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_12, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_3}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "w3lib/_url.pyx":729 + * if base is not None and base.scheme == "file": + * url.hostname = base.hostname + * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< + * input[pointer:] + * ) and _is_windows_drive_letter(base.path[0]): + */ + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 729, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (!__pyx_t_11); + if (__pyx_t_1) { + } else { + __pyx_t_14 = __pyx_t_1; + goto __pyx_L104_bool_binop_done; + } + + /* "w3lib/_url.pyx":731 + * if not _starts_with_windows_drive_letter( + * input[pointer:] + * ) and _is_windows_drive_letter(base.path[0]): # <<<<<<<<<<<<<< + * url.path.append(base.path[0]) + * state = PATH + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 731, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 731, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_15}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 731, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_14 = __pyx_t_1; + __pyx_L104_bool_binop_done:; + + /* "w3lib/_url.pyx":729 + * if base is not None and base.scheme == "file": + * url.hostname = base.hostname + * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< + * input[pointer:] + * ) and _is_windows_drive_letter(base.path[0]): + */ + if (__pyx_t_14) { + + /* "w3lib/_url.pyx":732 + * input[pointer:] + * ) and _is_windows_drive_letter(base.path[0]): + * url.path.append(base.path[0]) # <<<<<<<<<<<<<< + * state = PATH + * pointer -= 1 + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_15); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 732, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + + /* "w3lib/_url.pyx":729 + * if base is not None and base.scheme == "file": + * url.hostname = base.hostname + * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< + * input[pointer:] + * ) and _is_windows_drive_letter(base.path[0]): + */ + } + + /* "w3lib/_url.pyx":727 + * state = FILE_HOST + * else: + * if base is not None and base.scheme == "file": # <<<<<<<<<<<<<< + * url.hostname = base.hostname + * if not _starts_with_windows_drive_letter( + */ + } + + /* "w3lib/_url.pyx":733 + * ) and _is_windows_drive_letter(base.path[0]): + * url.path.append(base.path[0]) + * state = PATH # <<<<<<<<<<<<<< + * pointer -= 1 + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_PATH); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_15); + __pyx_t_15 = 0; + + /* "w3lib/_url.pyx":734 + * url.path.append(base.path[0]) + * state = PATH + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == FILE_HOST: + */ + __pyx_t_15 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 734, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_15); + __pyx_t_15 = 0; + } + __pyx_L97:; + + /* "w3lib/_url.pyx":721 + * pointer -= 1 + * + * elif state == FILE_SLASH: # <<<<<<<<<<<<<< + * assert isinstance(url.path, list) + * if c is not None and c in "/\\": + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":736 + * pointer -= 1 + * + * elif state == FILE_HOST: # <<<<<<<<<<<<<< + * if c is None or c in "/\\?#": + * pointer -= 1 + */ + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_FILE_HOST); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_15, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 736, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_14) { + + /* "w3lib/_url.pyx":737 + * + * elif state == FILE_HOST: + * if c is None or c in "/\\?#": # <<<<<<<<<<<<<< + * pointer -= 1 + * if _is_windows_drive_letter(buffer): + */ + __pyx_t_1 = (__pyx_v_c == ((PyObject*)Py_None)); + if (!__pyx_t_1) { + } else { + __pyx_t_14 = __pyx_t_1; + goto __pyx_L107_bool_binop_done; + } + __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_14 = __pyx_t_1; + __pyx_L107_bool_binop_done:; + if (__pyx_t_14) { + + /* "w3lib/_url.pyx":738 + * elif state == FILE_HOST: + * if c is None or c in "/\\?#": + * pointer -= 1 # <<<<<<<<<<<<<< + * if _is_windows_drive_letter(buffer): + * state = PATH + */ + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":739 + * if c is None or c in "/\\?#": + * pointer -= 1 + * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< + * state = PATH + * elif not buffer: + */ + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_2 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_15))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_15); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_15, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_buffer}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_14) { + + /* "w3lib/_url.pyx":740 + * pointer -= 1 + * if _is_windows_drive_letter(buffer): + * state = PATH # <<<<<<<<<<<<<< + * elif not buffer: + * url.hostname = "" + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":739 + * if c is None or c in "/\\?#": + * pointer -= 1 + * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< + * state = PATH + * elif not buffer: + */ + goto __pyx_L109; + } + + /* "w3lib/_url.pyx":741 + * if _is_windows_drive_letter(buffer): + * state = PATH + * elif not buffer: # <<<<<<<<<<<<<< + * url.hostname = "" + * state = PATH_START + */ + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 741, __pyx_L1_error) + __pyx_t_1 = (!__pyx_t_14); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":742 + * state = PATH + * elif not buffer: + * url.hostname = "" # <<<<<<<<<<<<<< + * state = PATH_START + * else: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 742, __pyx_L1_error) + + /* "w3lib/_url.pyx":743 + * elif not buffer: + * url.hostname = "" + * state = PATH_START # <<<<<<<<<<<<<< + * else: + * host = _parse_host(buffer, is_special=url.is_special) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":741 + * if _is_windows_drive_letter(buffer): + * state = PATH + * elif not buffer: # <<<<<<<<<<<<<< + * url.hostname = "" + * state = PATH_START + */ + goto __pyx_L109; + } + + /* "w3lib/_url.pyx":745 + * state = PATH_START + * else: + * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< + * if host == "localhost": + * host = "" + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_INCREF(__pyx_v_buffer); + __Pyx_GIVEREF(__pyx_v_buffer); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_buffer)) __PYX_ERR(0, 745, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_special, __pyx_t_3) < 0) __PYX_ERR(0, 745, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":746 + * else: + * host = _parse_host(buffer, is_special=url.is_special) + * if host == "localhost": # <<<<<<<<<<<<<< + * host = "" + * url.hostname = host + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_host, __pyx_n_u_localhost, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 746, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":747 + * host = _parse_host(buffer, is_special=url.is_special) + * if host == "localhost": + * host = "" # <<<<<<<<<<<<<< + * url.hostname = host + * buffer = "" + */ + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_host, __pyx_kp_u__2); + + /* "w3lib/_url.pyx":746 + * else: + * host = _parse_host(buffer, is_special=url.is_special) + * if host == "localhost": # <<<<<<<<<<<<<< + * host = "" + * url.hostname = host + */ + } + + /* "w3lib/_url.pyx":748 + * if host == "localhost": + * host = "" + * url.hostname = host # <<<<<<<<<<<<<< + * buffer = "" + * state = PATH_START + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 748, __pyx_L1_error) + + /* "w3lib/_url.pyx":749 + * host = "" + * url.hostname = host + * buffer = "" # <<<<<<<<<<<<<< + * state = PATH_START + * else: + */ + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + + /* "w3lib/_url.pyx":750 + * url.hostname = host + * buffer = "" + * state = PATH_START # <<<<<<<<<<<<<< + * else: + * assert isinstance(c, str) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L109:; + + /* "w3lib/_url.pyx":737 + * + * elif state == FILE_HOST: + * if c is None or c in "/\\?#": # <<<<<<<<<<<<<< + * pointer -= 1 + * if _is_windows_drive_letter(buffer): + */ + goto __pyx_L106; + } + + /* "w3lib/_url.pyx":752 + * state = PATH_START + * else: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * buffer += c + * + */ + /*else*/ { + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 752, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 752, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":753 + * else: + * assert isinstance(c, str) + * buffer += c # <<<<<<<<<<<<<< + * + * elif state == PATH_START: + */ + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L106:; + + /* "w3lib/_url.pyx":736 + * pointer -= 1 + * + * elif state == FILE_HOST: # <<<<<<<<<<<<<< + * if c is None or c in "/\\?#": + * pointer -= 1 + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":755 + * buffer += c + * + * elif state == PATH_START: # <<<<<<<<<<<<<< + * if url.is_special: + * state = PATH + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":756 + * + * elif state == PATH_START: + * if url.is_special: # <<<<<<<<<<<<<< + * state = PATH + * if c is not None and c not in "/\\": + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 756, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":757 + * elif state == PATH_START: + * if url.is_special: + * state = PATH # <<<<<<<<<<<<<< + * if c is not None and c not in "/\\": + * assert isinstance(c, str) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":758 + * if url.is_special: + * state = PATH + * if c is not None and c not in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * pointer -= 1 + */ + __pyx_t_14 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L113_bool_binop_done; + } + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_1 = __pyx_t_14; + __pyx_L113_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":759 + * state = PATH + * if c is not None and c not in "/\\": + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * pointer -= 1 + * elif c == "?": + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 759, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 759, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":760 + * if c is not None and c not in "/\\": + * assert isinstance(c, str) + * pointer -= 1 # <<<<<<<<<<<<<< + * elif c == "?": + * url.query = "" + */ + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":758 + * if url.is_special: + * state = PATH + * if c is not None and c not in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * pointer -= 1 + */ + } + + /* "w3lib/_url.pyx":756 + * + * elif state == PATH_START: + * if url.is_special: # <<<<<<<<<<<<<< + * state = PATH + * if c is not None and c not in "/\\": + */ + goto __pyx_L111; + } + + /* "w3lib/_url.pyx":761 + * assert isinstance(c, str) + * pointer -= 1 + * elif c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 761, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":762 + * pointer -= 1 + * elif c == "?": + * url.query = "" # <<<<<<<<<<<<<< + * state = QUERY + * elif c == "#": + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 762, __pyx_L1_error) + + /* "w3lib/_url.pyx":763 + * elif c == "?": + * url.query = "" + * state = QUERY # <<<<<<<<<<<<<< + * elif c == "#": + * url.fragment = "" + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":761 + * assert isinstance(c, str) + * pointer -= 1 + * elif c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY + */ + goto __pyx_L111; + } + + /* "w3lib/_url.pyx":764 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 764, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":765 + * state = QUERY + * elif c == "#": + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * elif c is not None: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 765, __pyx_L1_error) + + /* "w3lib/_url.pyx":766 + * elif c == "#": + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * elif c is not None: + * assert isinstance(c, str) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":764 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + goto __pyx_L111; + } + + /* "w3lib/_url.pyx":767 + * url.fragment = "" + * state = FRAGMENT + * elif c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * state = PATH + */ + __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":768 + * state = FRAGMENT + * elif c is not None: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * state = PATH + * if c != "/": + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 768, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 768, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":769 + * elif c is not None: + * assert isinstance(c, str) + * state = PATH # <<<<<<<<<<<<<< + * if c != "/": + * pointer -= 1 + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":770 + * assert isinstance(c, str) + * state = PATH + * if c != "/": # <<<<<<<<<<<<<< + * pointer -= 1 + * + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 770, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":771 + * state = PATH + * if c != "/": + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == PATH: + */ + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":770 + * assert isinstance(c, str) + * state = PATH + * if c != "/": # <<<<<<<<<<<<<< + * pointer -= 1 + * + */ + } + + /* "w3lib/_url.pyx":767 + * url.fragment = "" + * state = FRAGMENT + * elif c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * state = PATH + */ + } + __pyx_L111:; + + /* "w3lib/_url.pyx":755 + * buffer += c + * + * elif state == PATH_START: # <<<<<<<<<<<<<< + * if url.is_special: + * state = PATH + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":773 + * pointer -= 1 + * + * elif state == PATH: # <<<<<<<<<<<<<< + * assert isinstance(url.path, list) + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":774 + * + * elif state == PATH: + * assert isinstance(url.path, list) # <<<<<<<<<<<<<< + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if _is_double_dot_path_segment(buffer): + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyList_Check(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 774, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 774, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":775 + * elif state == PATH: + * assert isinstance(url.path, list) + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": # <<<<<<<<<<<<<< + * if _is_double_dot_path_segment(buffer): + * _shorten_path(url) + */ + __pyx_t_14 = (__pyx_v_c == ((PyObject*)Py_None)); + if (!__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L117_bool_binop_done; + } + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 775, __pyx_L1_error) + if (!__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L117_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 775, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_14) { + goto __pyx_L120_next_or; + } else { + } + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 775, __pyx_L1_error) + if (!__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L117_bool_binop_done; + } + __pyx_L120_next_or:; + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_1 = __pyx_t_14; + __pyx_L117_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":776 + * assert isinstance(url.path, list) + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< + * _shorten_path(url) + * if c != "/" and not (url.is_special and c == "\\"): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_double_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_buffer}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":777 + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if _is_double_dot_path_segment(buffer): + * _shorten_path(url) # <<<<<<<<<<<<<< + * if c != "/" and not (url.is_special and c == "\\"): + * url.path.append("") + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_url}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":778 + * if _is_double_dot_path_segment(buffer): + * _shorten_path(url) + * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< + * url.path.append("") + * elif _is_single_dot_path_segment(buffer): + */ + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 778, __pyx_L1_error) + if (__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L124_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 778, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 778, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_11) { + } else { + __pyx_t_14 = __pyx_t_11; + goto __pyx_L126_bool_binop_done; + } + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_14 = __pyx_t_11; + __pyx_L126_bool_binop_done:; + __pyx_t_11 = (!__pyx_t_14); + __pyx_t_1 = __pyx_t_11; + __pyx_L124_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":779 + * _shorten_path(url) + * if c != "/" and not (url.is_special and c == "\\"): + * url.path.append("") # <<<<<<<<<<<<<< + * elif _is_single_dot_path_segment(buffer): + * if c != "/" and not (url.is_special and c == "\\"): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":778 + * if _is_double_dot_path_segment(buffer): + * _shorten_path(url) + * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< + * url.path.append("") + * elif _is_single_dot_path_segment(buffer): + */ + } + + /* "w3lib/_url.pyx":776 + * assert isinstance(url.path, list) + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< + * _shorten_path(url) + * if c != "/" and not (url.is_special and c == "\\"): + */ + goto __pyx_L122; + } + + /* "w3lib/_url.pyx":780 + * if c != "/" and not (url.is_special and c == "\\"): + * url.path.append("") + * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< + * if c != "/" and not (url.is_special and c == "\\"): + * url.path.append("") + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_single_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_buffer}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 780, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":781 + * url.path.append("") + * elif _is_single_dot_path_segment(buffer): + * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< + * url.path.append("") + * else: + */ + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 781, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L129_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 781, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_14) { + } else { + __pyx_t_11 = __pyx_t_14; + goto __pyx_L131_bool_binop_done; + } + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_11 = __pyx_t_14; + __pyx_L131_bool_binop_done:; + __pyx_t_14 = (!__pyx_t_11); + __pyx_t_1 = __pyx_t_14; + __pyx_L129_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":782 + * elif _is_single_dot_path_segment(buffer): + * if c != "/" and not (url.is_special and c == "\\"): + * url.path.append("") # <<<<<<<<<<<<<< + * else: + * if ( + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 782, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":781 + * url.path.append("") + * elif _is_single_dot_path_segment(buffer): + * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< + * url.path.append("") + * else: + */ + } + + /* "w3lib/_url.pyx":780 + * if c != "/" and not (url.is_special and c == "\\"): + * url.path.append("") + * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< + * if c != "/" and not (url.is_special and c == "\\"): + * url.path.append("") + */ + goto __pyx_L122; + } + + /* "w3lib/_url.pyx":784 + * url.path.append("") + * else: + * if ( # <<<<<<<<<<<<<< + * url.scheme == "file" + * and not url.path + */ + /*else*/ { + + /* "w3lib/_url.pyx":785 + * else: + * if ( + * url.scheme == "file" # <<<<<<<<<<<<<< + * and not url.path + * and _is_windows_drive_letter(buffer) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L134_bool_binop_done; + } + + /* "w3lib/_url.pyx":786 + * if ( + * url.scheme == "file" + * and not url.path # <<<<<<<<<<<<<< + * and _is_windows_drive_letter(buffer) + * ): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = (!__pyx_t_14); + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L134_bool_binop_done; + } + + /* "w3lib/_url.pyx":787 + * url.scheme == "file" + * and not url.path + * and _is_windows_drive_letter(buffer) # <<<<<<<<<<<<<< + * ): + * buffer = buffer[0] + ":" + buffer[2:] + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_buffer}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 787, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_11; + __pyx_L134_bool_binop_done:; + + /* "w3lib/_url.pyx":784 + * url.path.append("") + * else: + * if ( # <<<<<<<<<<<<<< + * url.scheme == "file" + * and not url.path + */ + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":789 + * and _is_windows_drive_letter(buffer) + * ): + * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< + * if ( + * not url.path + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_buffer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_buffer, 2, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_15); + __pyx_t_15 = 0; + + /* "w3lib/_url.pyx":784 + * url.path.append("") + * else: + * if ( # <<<<<<<<<<<<<< + * url.scheme == "file" + * and not url.path + */ + } + + /* "w3lib/_url.pyx":791 + * buffer = buffer[0] + ":" + buffer[2:] + * if ( + * not url.path # <<<<<<<<<<<<<< + * and not buffer + * and c is not None + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 791, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_14 = (!__pyx_t_11); + if (__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L138_bool_binop_done; + } + + /* "w3lib/_url.pyx":792 + * if ( + * not url.path + * and not buffer # <<<<<<<<<<<<<< + * and c is not None + * and c in "?#" + */ + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 792, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_14); + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L138_bool_binop_done; + } + + /* "w3lib/_url.pyx":793 + * not url.path + * and not buffer + * and c is not None # <<<<<<<<<<<<<< + * and c in "?#" + * and input[pointer - 1] not in "/\\" + */ + __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L138_bool_binop_done; + } + + /* "w3lib/_url.pyx":794 + * and not buffer + * and c is not None + * and c in "?#" # <<<<<<<<<<<<<< + * and input[pointer - 1] not in "/\\" + * ): + */ + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 794, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L138_bool_binop_done; + } + + /* "w3lib/_url.pyx":795 + * and c is not None + * and c in "?#" + * and input[pointer - 1] not in "/\\" # <<<<<<<<<<<<<< + * ): + * url._path_token_seen = True + */ + __pyx_t_15 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_t_3, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 795, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_11; + __pyx_L138_bool_binop_done:; + + /* "w3lib/_url.pyx":790 + * ): + * buffer = buffer[0] + ":" + buffer[2:] + * if ( # <<<<<<<<<<<<<< + * not url.path + * and not buffer + */ + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":797 + * and input[pointer - 1] not in "/\\" + * ): + * url._path_token_seen = True # <<<<<<<<<<<<<< + * url.path.append(buffer) + * buffer = "" + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen, Py_True) < 0) __PYX_ERR(0, 797, __pyx_L1_error) + + /* "w3lib/_url.pyx":790 + * ): + * buffer = buffer[0] + ":" + buffer[2:] + * if ( # <<<<<<<<<<<<<< + * not url.path + * and not buffer + */ + } + + /* "w3lib/_url.pyx":798 + * ): + * url._path_token_seen = True + * url.path.append(buffer) # <<<<<<<<<<<<<< + * buffer = "" + * if c == "?": + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_buffer); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L122:; + + /* "w3lib/_url.pyx":799 + * url._path_token_seen = True + * url.path.append(buffer) + * buffer = "" # <<<<<<<<<<<<<< + * if c == "?": + * url.query = "" + */ + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + + /* "w3lib/_url.pyx":800 + * url.path.append(buffer) + * buffer = "" + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 800, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":801 + * buffer = "" + * if c == "?": + * url.query = "" # <<<<<<<<<<<<<< + * state = QUERY + * elif c == "#": + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 801, __pyx_L1_error) + + /* "w3lib/_url.pyx":802 + * if c == "?": + * url.query = "" + * state = QUERY # <<<<<<<<<<<<<< + * elif c == "#": + * url.fragment = "" + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":800 + * url.path.append(buffer) + * buffer = "" + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY + */ + goto __pyx_L143; + } + + /* "w3lib/_url.pyx":803 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 803, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":804 + * state = QUERY + * elif c == "#": + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * else: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 804, __pyx_L1_error) + + /* "w3lib/_url.pyx":805 + * elif c == "#": + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * else: + * assert isinstance(c, str) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":803 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + } + __pyx_L143:; + + /* "w3lib/_url.pyx":775 + * elif state == PATH: + * assert isinstance(url.path, list) + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": # <<<<<<<<<<<<<< + * if _is_double_dot_path_segment(buffer): + * _shorten_path(url) + */ + goto __pyx_L116; + } + + /* "w3lib/_url.pyx":807 + * state = FRAGMENT + * else: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * buffer += _idempotent_utf_8_percent_encode( + * input=input, + */ + /*else*/ { + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 807, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 807, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":808 + * else: + * assert isinstance(c, str) + * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * input=input, + * pointer=pointer, + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":809 + * assert isinstance(c, str) + * buffer += _idempotent_utf_8_percent_encode( + * input=input, # <<<<<<<<<<<<<< + * pointer=pointer, + * encode_set=path_percent_encode_set, + */ + __pyx_t_15 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + + /* "w3lib/_url.pyx":810 + * buffer += _idempotent_utf_8_percent_encode( + * input=input, + * pointer=pointer, # <<<<<<<<<<<<<< + * encode_set=path_percent_encode_set, + * ) + */ + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + + /* "w3lib/_url.pyx":811 + * input=input, + * pointer=pointer, + * encode_set=path_percent_encode_set, # <<<<<<<<<<<<<< + * ) + * + */ + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_encode_set, __pyx_v_path_percent_encode_set) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + + /* "w3lib/_url.pyx":808 + * else: + * assert isinstance(c, str) + * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * input=input, + * pointer=pointer, + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 808, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_15); + __pyx_t_15 = 0; + } + __pyx_L116:; + + /* "w3lib/_url.pyx":773 + * pointer -= 1 + * + * elif state == PATH: # <<<<<<<<<<<<<< + * assert isinstance(url.path, list) + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":814 + * ) + * + * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< + * assert isinstance(url.path, str) + * if c == "?": + */ + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_OPAQUE_PATH); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_15, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 814, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":815 + * + * elif state == OPAQUE_PATH: + * assert isinstance(url.path, str) # <<<<<<<<<<<<<< + * if c == "?": + * url.query = "" + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 815, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyUnicode_Check(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 815, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 815, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":816 + * elif state == OPAQUE_PATH: + * assert isinstance(url.path, str) + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":817 + * assert isinstance(url.path, str) + * if c == "?": + * url.query = "" # <<<<<<<<<<<<<< + * state = QUERY + * elif c == "#": + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 817, __pyx_L1_error) + + /* "w3lib/_url.pyx":818 + * if c == "?": + * url.query = "" + * state = QUERY # <<<<<<<<<<<<<< + * elif c == "#": + * url.fragment = "" + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":816 + * elif state == OPAQUE_PATH: + * assert isinstance(url.path, str) + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY + */ + goto __pyx_L144; + } + + /* "w3lib/_url.pyx":819 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 819, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":820 + * state = QUERY + * elif c == "#": + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * elif c is not None: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 820, __pyx_L1_error) + + /* "w3lib/_url.pyx":821 + * elif c == "#": + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * elif c is not None: + * assert isinstance(c, str) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":819 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + goto __pyx_L144; + } + + /* "w3lib/_url.pyx":822 + * url.fragment = "" + * state = FRAGMENT + * elif c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * encoded = _utf_8_percent_encode( + */ + __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":823 + * state = FRAGMENT + * elif c is not None: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * encoded = _utf_8_percent_encode( + * c, + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 823, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 823, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":824 + * elif c is not None: + * assert isinstance(c, str) + * encoded = _utf_8_percent_encode( # <<<<<<<<<<<<<< + * c, + * _C0_CONTROL_PERCENT_ENCODE_SET, + */ + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + + /* "w3lib/_url.pyx":826 + * encoded = _utf_8_percent_encode( + * c, + * _C0_CONTROL_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * ) + * url.path += encoded + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_15))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_15, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_c, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_encoded, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":828 + * _C0_CONTROL_PERCENT_ENCODE_SET, + * ) + * url.path += encoded # <<<<<<<<<<<<<< + * + * elif state == QUERY: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_15) < 0) __PYX_ERR(0, 828, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + + /* "w3lib/_url.pyx":822 + * url.fragment = "" + * state = FRAGMENT + * elif c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * encoded = _utf_8_percent_encode( + */ + } + __pyx_L144:; + + /* "w3lib/_url.pyx":814 + * ) + * + * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< + * assert isinstance(url.path, str) + * if c == "?": + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":830 + * url.path += encoded + * + * elif state == QUERY: # <<<<<<<<<<<<<< + * assert isinstance(url.query, str) + * if encoding != "utf-8" and ( + */ + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_15, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":831 + * + * elif state == QUERY: + * assert isinstance(url.query, str) # <<<<<<<<<<<<<< + * if encoding != "utf-8" and ( + * not url.is_special or url.scheme in ("ws", "wss") + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyUnicode_Check(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 831, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 831, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":832 + * elif state == QUERY: + * assert isinstance(url.query, str) + * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< + * not url.is_special or url.scheme in ("ws", "wss") + * ): + */ + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_kp_u_utf_8, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 832, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L146_bool_binop_done; + } + + /* "w3lib/_url.pyx":833 + * assert isinstance(url.query, str) + * if encoding != "utf-8" and ( + * not url.is_special or url.scheme in ("ws", "wss") # <<<<<<<<<<<<<< + * ): + * encoding = "utf-8" + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 833, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = (!__pyx_t_11); + if (!__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L146_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_ws, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 833, __pyx_L1_error) + if (!__pyx_t_11) { + } else { + __pyx_t_14 = __pyx_t_11; + goto __pyx_L149_bool_binop_done; + } + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_wss, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 833, __pyx_L1_error) + __pyx_t_14 = __pyx_t_11; + __pyx_L149_bool_binop_done:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_11 = __pyx_t_14; + __pyx_t_1 = __pyx_t_11; + __pyx_L146_bool_binop_done:; + + /* "w3lib/_url.pyx":832 + * elif state == QUERY: + * assert isinstance(url.query, str) + * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< + * not url.is_special or url.scheme in ("ws", "wss") + * ): + */ + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":835 + * not url.is_special or url.scheme in ("ws", "wss") + * ): + * encoding = "utf-8" # <<<<<<<<<<<<<< + * if c == "#" or c is None: + * percent_encode_set = ( + */ + __Pyx_INCREF(__pyx_kp_u_utf_8); + __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_kp_u_utf_8); + + /* "w3lib/_url.pyx":832 + * elif state == QUERY: + * assert isinstance(url.query, str) + * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< + * not url.is_special or url.scheme in ("ws", "wss") + * ): + */ + } + + /* "w3lib/_url.pyx":836 + * ): + * encoding = "utf-8" + * if c == "#" or c is None: # <<<<<<<<<<<<<< + * percent_encode_set = ( + * special_query_percent_encode_set + */ + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 836, __pyx_L1_error) + if (!__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L152_bool_binop_done; + } + __pyx_t_11 = (__pyx_v_c == ((PyObject*)Py_None)); + __pyx_t_1 = __pyx_t_11; + __pyx_L152_bool_binop_done:; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":839 + * percent_encode_set = ( + * special_query_percent_encode_set + * if url.is_special # <<<<<<<<<<<<<< + * else query_percent_encode_set + * ) + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":838 + * if c == "#" or c is None: + * percent_encode_set = ( + * special_query_percent_encode_set # <<<<<<<<<<<<<< + * if url.is_special + * else query_percent_encode_set + */ + __Pyx_INCREF(__pyx_v_special_query_percent_encode_set); + __pyx_t_2 = __pyx_v_special_query_percent_encode_set; + } else { + + /* "w3lib/_url.pyx":840 + * special_query_percent_encode_set + * if url.is_special + * else query_percent_encode_set # <<<<<<<<<<<<<< + * ) + * url.query += _percent_encode_after_encoding( + */ + __Pyx_INCREF(__pyx_v_query_percent_encode_set); + __pyx_t_2 = __pyx_v_query_percent_encode_set; + } + __Pyx_XDECREF_SET(__pyx_v_percent_encode_set, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":842 + * else query_percent_encode_set + * ) + * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * buffer, + * encoding=encoding, + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + + /* "w3lib/_url.pyx":843 + * ) + * url.query += _percent_encode_after_encoding( + * buffer, # <<<<<<<<<<<<<< + * encoding=encoding, + * percent_encode_set=percent_encode_set, + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_buffer); + __Pyx_GIVEREF(__pyx_v_buffer); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buffer)) __PYX_ERR(0, 842, __pyx_L1_error); + + /* "w3lib/_url.pyx":844 + * url.query += _percent_encode_after_encoding( + * buffer, + * encoding=encoding, # <<<<<<<<<<<<<< + * percent_encode_set=percent_encode_set, + * ) + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 844, __pyx_L1_error) + + /* "w3lib/_url.pyx":845 + * buffer, + * encoding=encoding, + * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< + * ) + * buffer = "" + */ + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 844, __pyx_L1_error) + + /* "w3lib/_url.pyx":842 + * else query_percent_encode_set + * ) + * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * buffer, + * encoding=encoding, + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_4) < 0) __PYX_ERR(0, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":847 + * percent_encode_set=percent_encode_set, + * ) + * buffer = "" # <<<<<<<<<<<<<< + * if c == "#": + * url.fragment = "" + */ + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + + /* "w3lib/_url.pyx":848 + * ) + * buffer = "" + * if c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 848, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":849 + * buffer = "" + * if c == "#": + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * elif c is not None: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 849, __pyx_L1_error) + + /* "w3lib/_url.pyx":850 + * if c == "#": + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * elif c is not None: + * assert isinstance(c, str) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":848 + * ) + * buffer = "" + * if c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + } + + /* "w3lib/_url.pyx":836 + * ): + * encoding = "utf-8" + * if c == "#" or c is None: # <<<<<<<<<<<<<< + * percent_encode_set = ( + * special_query_percent_encode_set + */ + goto __pyx_L151; + } + + /* "w3lib/_url.pyx":851 + * url.fragment = "" + * state = FRAGMENT + * elif c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * buffer += c + */ + __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":852 + * state = FRAGMENT + * elif c is not None: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * buffer += c + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 852, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 852, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":853 + * elif c is not None: + * assert isinstance(c, str) + * buffer += c # <<<<<<<<<<<<<< + * + * elif state == FRAGMENT: + */ + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":851 + * url.fragment = "" + * state = FRAGMENT + * elif c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * buffer += c + */ + } + __pyx_L151:; + + /* "w3lib/_url.pyx":830 + * url.path += encoded + * + * elif state == QUERY: # <<<<<<<<<<<<<< + * assert isinstance(url.query, str) + * if encoding != "utf-8" and ( + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":855 + * buffer += c + * + * elif state == FRAGMENT: # <<<<<<<<<<<<<< + * assert isinstance(url.fragment, str) + * if c is not None: + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":856 + * + * elif state == FRAGMENT: + * assert isinstance(url.fragment, str) # <<<<<<<<<<<<<< + * if c is not None: + * assert isinstance(c, str) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyUnicode_Check(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 856, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 856, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":857 + * elif state == FRAGMENT: + * assert isinstance(url.fragment, str) + * if c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * url.fragment += _idempotent_utf_8_percent_encode( + */ + __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":858 + * assert isinstance(url.fragment, str) + * if c is not None: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * url.fragment += _idempotent_utf_8_percent_encode( + * input=input, pointer=pointer, encode_set=fragment_percent_encode_set + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 858, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 858, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":859 + * if c is not None: + * assert isinstance(c, str) + * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * input=input, pointer=pointer, encode_set=fragment_percent_encode_set + * ) + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "w3lib/_url.pyx":860 + * assert isinstance(c, str) + * url.fragment += _idempotent_utf_8_percent_encode( + * input=input, pointer=pointer, encode_set=fragment_percent_encode_set # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 860, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 860, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_fragment_percent_encode_set) < 0) __PYX_ERR(0, 860, __pyx_L1_error) + + /* "w3lib/_url.pyx":859 + * if c is not None: + * assert isinstance(c, str) + * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * input=input, pointer=pointer, encode_set=fragment_percent_encode_set + * ) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_t_2) < 0) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":857 + * elif state == FRAGMENT: + * assert isinstance(url.fragment, str) + * if c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * url.fragment += _idempotent_utf_8_percent_encode( + */ + } + + /* "w3lib/_url.pyx":855 + * buffer += c + * + * elif state == FRAGMENT: # <<<<<<<<<<<<<< + * assert isinstance(url.fragment, str) + * if c is not None: + */ + } + __pyx_L16:; + + /* "w3lib/_url.pyx":863 + * ) + * + * if pointer >= input_length: # <<<<<<<<<<<<<< + * break + * pointer += 1 + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 863, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":864 + * + * if pointer >= input_length: + * break # <<<<<<<<<<<<<< + * pointer += 1 + * + */ + goto __pyx_L5_break; + + /* "w3lib/_url.pyx":863 + * ) + * + * if pointer >= input_length: # <<<<<<<<<<<<<< + * break + * pointer += 1 + */ + } + + /* "w3lib/_url.pyx":865 + * if pointer >= input_length: + * break + * pointer += 1 # <<<<<<<<<<<<<< + * + * return url + */ + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L5_break:; + + /* "w3lib/_url.pyx":867 + * pointer += 1 + * + * return url # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_url); + __pyx_r = __pyx_v_url; + goto __pyx_L0; + + /* "w3lib/_url.pyx":439 + * + * + * def _parse_url( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_base); + __Pyx_XDECREF(__pyx_v_url); + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v_buffer); + __Pyx_XDECREF(__pyx_v_pointer); + __Pyx_XDECREF(__pyx_v_c); + __Pyx_XDECREF(__pyx_v_at_sign_index); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_code_point); + __Pyx_XDECREF(__pyx_v_encoded_code_points); + __Pyx_XDECREF(__pyx_v_host); + __Pyx_XDECREF(__pyx_v_port); + __Pyx_XDECREF(__pyx_v_encoded); + __Pyx_XDECREF(__pyx_v_percent_encode_set); + __Pyx_XDECREF(__pyx_v_input); + __Pyx_XDECREF(__pyx_v_encoding); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":871 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 + * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< + * output = "" + * n = address + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_33_serialize_ipv4(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_33_serialize_ipv4 = {"_serialize_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_33_serialize_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_33_serialize_ipv4(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_address = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_serialize_ipv4 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_address,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_address)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv4") < 0)) __PYX_ERR(0, 871, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_address = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_serialize_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 871, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._serialize_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyInt_Type), 0, "address", 1))) __PYX_ERR(0, 871, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_32_serialize_ipv4(__pyx_self, __pyx_v_address); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_32_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_v_n = NULL; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + long __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_serialize_ipv4", 1); + + /* "w3lib/_url.pyx":872 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 + * def _serialize_ipv4(address: int) -> str: + * output = "" # <<<<<<<<<<<<<< + * n = address + * for i in range(1, 5): + */ + __Pyx_INCREF(__pyx_kp_u__2); + __pyx_v_output = __pyx_kp_u__2; + + /* "w3lib/_url.pyx":873 + * def _serialize_ipv4(address: int) -> str: + * output = "" + * n = address # <<<<<<<<<<<<<< + * for i in range(1, 5): + * output = str(n % 256) + output + */ + __Pyx_INCREF(__pyx_v_address); + __pyx_v_n = __pyx_v_address; + + /* "w3lib/_url.pyx":874 + * output = "" + * n = address + * for i in range(1, 5): # <<<<<<<<<<<<<< + * output = str(n % 256) + output + * if i != 4: + */ + for (__pyx_t_1 = 1; __pyx_t_1 < 5; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "w3lib/_url.pyx":875 + * n = address + * for i in range(1, 5): + * output = str(n % 256) + output # <<<<<<<<<<<<<< + * if i != 4: + * output = "." + output + */ + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":876 + * for i in range(1, 5): + * output = str(n % 256) + output + * if i != 4: # <<<<<<<<<<<<<< + * output = "." + output + * n = floor(n / 256) + */ + __pyx_t_4 = (__pyx_v_i != 4); + if (__pyx_t_4) { + + /* "w3lib/_url.pyx":877 + * output = str(n % 256) + output + * if i != 4: + * output = "." + output # <<<<<<<<<<<<<< + * n = floor(n / 256) + * return output + */ + __pyx_t_2 = PyNumber_Add(__pyx_kp_u__6, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":876 + * for i in range(1, 5): + * output = str(n % 256) + output + * if i != 4: # <<<<<<<<<<<<<< + * output = "." + output + * n = floor(n / 256) + */ + } + + /* "w3lib/_url.pyx":878 + * if i != 4: + * output = "." + output + * n = floor(n / 256) # <<<<<<<<<<<<<< + * return output + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); + __pyx_t_2 = 0; + } + + /* "w3lib/_url.pyx":879 + * output = "." + output + * n = floor(n / 256) + * return output # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_output); + __pyx_r = ((PyObject*)__pyx_v_output); + goto __pyx_L0; + + /* "w3lib/_url.pyx":871 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 + * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< + * output = "" + * n = address + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("w3lib._url._serialize_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":882 + * + * + * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< + * address: List[int], *, min_length: int = 2 + * ) -> Optional[int]: + */ + +static PyObject *__pyx_pf_5w3lib_4_url_46__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_length, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_min_length) < 0) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 882, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("w3lib._url.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index = {"_get_ipv6_first_longest_0_piece_index", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_address = 0; + PyObject *__pyx_v_min_length = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_ipv6_first_longest_0_piece_index (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_address,&__pyx_n_s_min_length,0}; + __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self); + values[1] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_min_length); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_address)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 882, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 882, __pyx_L3_error) + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_ipv6_first_longest_0_piece_index") < 0)) __PYX_ERR(0, 882, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_address = ((PyObject*)values[0]); + __pyx_v_min_length = ((PyObject*)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_get_ipv6_first_longest_0_piece_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 882, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._get_ipv6_first_longest_0_piece_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 883, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_min_length), (&PyInt_Type), 0, "min_length", 1))) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(__pyx_self, __pyx_v_address, __pyx_v_min_length); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length) { + PyObject *__pyx_v_index = NULL; + PyObject *__pyx_v_index_length = NULL; + PyObject *__pyx_v_current_length = NULL; + PyObject *__pyx_v_current_index = NULL; + PyObject *__pyx_v_piece = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_ipv6_first_longest_0_piece_index", 1); + + /* "w3lib/_url.pyx":885 + * address: List[int], *, min_length: int = 2 + * ) -> Optional[int]: + * index = None # <<<<<<<<<<<<<< + * index_length = 0 + * current_length = 0 + */ + __Pyx_INCREF(Py_None); + __pyx_v_index = Py_None; + + /* "w3lib/_url.pyx":886 + * ) -> Optional[int]: + * index = None + * index_length = 0 # <<<<<<<<<<<<<< + * current_length = 0 + * for current_index, piece in enumerate(address): + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_index_length = __pyx_int_0; + + /* "w3lib/_url.pyx":887 + * index = None + * index_length = 0 + * current_length = 0 # <<<<<<<<<<<<<< + * for current_index, piece in enumerate(address): + * if piece != 0: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_current_length = __pyx_int_0; + + /* "w3lib/_url.pyx":888 + * index_length = 0 + * current_length = 0 + * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< + * if piece != 0: + * current_length = 0 + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + __pyx_t_2 = __pyx_v_address; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 888, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 888, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XDECREF_SET(__pyx_v_piece, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_current_index, __pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":889 + * current_length = 0 + * for current_index, piece in enumerate(address): + * if piece != 0: # <<<<<<<<<<<<<< + * current_length = 0 + * continue + */ + __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 889, __pyx_L1_error) + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":890 + * for current_index, piece in enumerate(address): + * if piece != 0: + * current_length = 0 # <<<<<<<<<<<<<< + * continue + * current_length += 1 + */ + __Pyx_INCREF(__pyx_int_0); + __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_int_0); + + /* "w3lib/_url.pyx":891 + * if piece != 0: + * current_length = 0 + * continue # <<<<<<<<<<<<<< + * current_length += 1 + * if current_length > index_length and current_length >= min_length: + */ + goto __pyx_L3_continue; + + /* "w3lib/_url.pyx":889 + * current_length = 0 + * for current_index, piece in enumerate(address): + * if piece != 0: # <<<<<<<<<<<<<< + * current_length = 0 + * continue + */ + } + + /* "w3lib/_url.pyx":892 + * current_length = 0 + * continue + * current_length += 1 # <<<<<<<<<<<<<< + * if current_length > index_length and current_length >= min_length: + * index = current_index + 1 - current_length + */ + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":893 + * continue + * current_length += 1 + * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< + * index = current_index + 1 - current_length + * index_length = current_length + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_index_length, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 893, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_min_length, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 893, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __pyx_t_6; + __pyx_L7_bool_binop_done:; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":894 + * current_length += 1 + * if current_length > index_length and current_length >= min_length: + * index = current_index + 1 - current_length # <<<<<<<<<<<<<< + * index_length = current_length + * return index + */ + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_v_current_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_7); + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":895 + * if current_length > index_length and current_length >= min_length: + * index = current_index + 1 - current_length + * index_length = current_length # <<<<<<<<<<<<<< + * return index + * + */ + __Pyx_INCREF(__pyx_v_current_length); + __Pyx_DECREF_SET(__pyx_v_index_length, __pyx_v_current_length); + + /* "w3lib/_url.pyx":893 + * continue + * current_length += 1 + * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< + * index = current_index + 1 - current_length + * index_length = current_length + */ + } + + /* "w3lib/_url.pyx":888 + * index_length = 0 + * current_length = 0 + * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< + * if piece != 0: + * current_length = 0 + */ + __pyx_L3_continue:; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":896 + * index = current_index + 1 - current_length + * index_length = current_length + * return index # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_index))||((__pyx_v_index) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_index))) __PYX_ERR(0, 896, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_index); + __pyx_r = ((PyObject*)__pyx_v_index); + goto __pyx_L0; + + /* "w3lib/_url.pyx":882 + * + * + * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< + * address: List[int], *, min_length: int = 2 + * ) -> Optional[int]: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._get_ipv6_first_longest_0_piece_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XDECREF(__pyx_v_index_length); + __Pyx_XDECREF(__pyx_v_current_length); + __Pyx_XDECREF(__pyx_v_current_index); + __Pyx_XDECREF(__pyx_v_piece); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":900 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer + * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< + * output = "" + * compress = _get_ipv6_first_longest_0_piece_index(address) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_37_serialize_ipv6(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_37_serialize_ipv6 = {"_serialize_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_37_serialize_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_37_serialize_ipv6(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_address = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_serialize_ipv6 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_address,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_address)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv6") < 0)) __PYX_ERR(0, 900, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_address = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_serialize_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 900, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._serialize_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_36_serialize_ipv6(__pyx_self, __pyx_v_address); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_v_compress = NULL; + int __pyx_v_ignore0; + long __pyx_v_piece_index; + PyObject *__pyx_v_separator = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + long __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_serialize_ipv6", 1); + + /* "w3lib/_url.pyx":901 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer + * def _serialize_ipv6(address: List[int]) -> str: + * output = "" # <<<<<<<<<<<<<< + * compress = _get_ipv6_first_longest_0_piece_index(address) + * ignore0 = False + */ + __Pyx_INCREF(__pyx_kp_u__2); + __pyx_v_output = __pyx_kp_u__2; + + /* "w3lib/_url.pyx":902 + * def _serialize_ipv6(address: List[int]) -> str: + * output = "" + * compress = _get_ipv6_first_longest_0_piece_index(address) # <<<<<<<<<<<<<< + * ignore0 = False + * for piece_index in range(8): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_ipv6_first_longest_0_piece); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_address}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_v_compress = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":903 + * output = "" + * compress = _get_ipv6_first_longest_0_piece_index(address) + * ignore0 = False # <<<<<<<<<<<<<< + * for piece_index in range(8): + * if ignore0: + */ + __pyx_v_ignore0 = 0; + + /* "w3lib/_url.pyx":904 + * compress = _get_ipv6_first_longest_0_piece_index(address) + * ignore0 = False + * for piece_index in range(8): # <<<<<<<<<<<<<< + * if ignore0: + * if not address[piece_index]: + */ + for (__pyx_t_5 = 0; __pyx_t_5 < 8; __pyx_t_5+=1) { + __pyx_v_piece_index = __pyx_t_5; + + /* "w3lib/_url.pyx":905 + * ignore0 = False + * for piece_index in range(8): + * if ignore0: # <<<<<<<<<<<<<< + * if not address[piece_index]: + * continue + */ + if (__pyx_v_ignore0) { + + /* "w3lib/_url.pyx":906 + * for piece_index in range(8): + * if ignore0: + * if not address[piece_index]: # <<<<<<<<<<<<<< + * continue + * ignore0 = False + */ + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 906, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = (!__pyx_t_6); + if (__pyx_t_7) { + + /* "w3lib/_url.pyx":907 + * if ignore0: + * if not address[piece_index]: + * continue # <<<<<<<<<<<<<< + * ignore0 = False + * if compress == piece_index: + */ + goto __pyx_L3_continue; + + /* "w3lib/_url.pyx":906 + * for piece_index in range(8): + * if ignore0: + * if not address[piece_index]: # <<<<<<<<<<<<<< + * continue + * ignore0 = False + */ + } + + /* "w3lib/_url.pyx":908 + * if not address[piece_index]: + * continue + * ignore0 = False # <<<<<<<<<<<<<< + * if compress == piece_index: + * separator = "::" if piece_index == 0 else ":" + */ + __pyx_v_ignore0 = 0; + + /* "w3lib/_url.pyx":905 + * ignore0 = False + * for piece_index in range(8): + * if ignore0: # <<<<<<<<<<<<<< + * if not address[piece_index]: + * continue + */ + } + + /* "w3lib/_url.pyx":909 + * continue + * ignore0 = False + * if compress == piece_index: # <<<<<<<<<<<<<< + * separator = "::" if piece_index == 0 else ":" + * output += separator + */ + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_compress, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 909, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 909, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_7) { + + /* "w3lib/_url.pyx":910 + * ignore0 = False + * if compress == piece_index: + * separator = "::" if piece_index == 0 else ":" # <<<<<<<<<<<<<< + * output += separator + * ignore0 = True + */ + __pyx_t_7 = (__pyx_v_piece_index == 0); + if (__pyx_t_7) { + __Pyx_INCREF(__pyx_kp_u__21); + __pyx_t_2 = __pyx_kp_u__21; + } else { + __Pyx_INCREF(__pyx_kp_u__5); + __pyx_t_2 = __pyx_kp_u__5; + } + __Pyx_XDECREF_SET(__pyx_v_separator, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":911 + * if compress == piece_index: + * separator = "::" if piece_index == 0 else ":" + * output += separator # <<<<<<<<<<<<<< + * ignore0 = True + * continue + */ + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_output, __pyx_v_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":912 + * separator = "::" if piece_index == 0 else ":" + * output += separator + * ignore0 = True # <<<<<<<<<<<<<< + * continue + * output += f"{address[piece_index]:x}" + */ + __pyx_v_ignore0 = 1; + + /* "w3lib/_url.pyx":913 + * output += separator + * ignore0 = True + * continue # <<<<<<<<<<<<<< + * output += f"{address[piece_index]:x}" + * if piece_index != 7: + */ + goto __pyx_L3_continue; + + /* "w3lib/_url.pyx":909 + * continue + * ignore0 = False + * if compress == piece_index: # <<<<<<<<<<<<<< + * separator = "::" if piece_index == 0 else ":" + * output += separator + */ + } + + /* "w3lib/_url.pyx":914 + * ignore0 = True + * continue + * output += f"{address[piece_index]:x}" # <<<<<<<<<<<<<< + * if piece_index != 7: + * output += ":" + */ + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":915 + * continue + * output += f"{address[piece_index]:x}" + * if piece_index != 7: # <<<<<<<<<<<<<< + * output += ":" + * return output + */ + __pyx_t_7 = (__pyx_v_piece_index != 7); + if (__pyx_t_7) { + + /* "w3lib/_url.pyx":916 + * output += f"{address[piece_index]:x}" + * if piece_index != 7: + * output += ":" # <<<<<<<<<<<<<< + * return output + * + */ + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":915 + * continue + * output += f"{address[piece_index]:x}" + * if piece_index != 7: # <<<<<<<<<<<<<< + * output += ":" + * return output + */ + } + __pyx_L3_continue:; + } + + /* "w3lib/_url.pyx":917 + * if piece_index != 7: + * output += ":" + * return output # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_output); + __pyx_r = __pyx_v_output; + goto __pyx_L0; + + /* "w3lib/_url.pyx":900 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer + * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< + * output = "" + * compress = _get_ipv6_first_longest_0_piece_index(address) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("w3lib._url._serialize_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XDECREF(__pyx_v_compress); + __Pyx_XDECREF(__pyx_v_separator); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":921 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer + * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< + * if isinstance(host, int): + * return _serialize_ipv4(host) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_39_serialize_host(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_39_serialize_host = {"_serialize_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_39_serialize_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_39_serialize_host(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_host = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_serialize_host (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_host)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 921, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_host") < 0)) __PYX_ERR(0, 921, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_host = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_serialize_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 921, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._serialize_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5w3lib_4_url_38_serialize_host(__pyx_self, __pyx_v_host); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_UCS4 __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_serialize_host", 1); + + /* "w3lib/_url.pyx":922 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer + * def _serialize_host(host: Union[str, int, List[int]]) -> str: + * if isinstance(host, int): # <<<<<<<<<<<<<< + * return _serialize_ipv4(host) + * if isinstance(host, list): + */ + __pyx_t_1 = PyInt_Check(__pyx_v_host); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":923 + * def _serialize_host(host: Union[str, int, List[int]]) -> str: + * if isinstance(host, int): + * return _serialize_ipv4(host) # <<<<<<<<<<<<<< + * if isinstance(host, list): + * return f"[{_serialize_ipv6(host)}]" + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_serialize_ipv4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_host}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 923, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":922 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer + * def _serialize_host(host: Union[str, int, List[int]]) -> str: + * if isinstance(host, int): # <<<<<<<<<<<<<< + * return _serialize_ipv4(host) + * if isinstance(host, list): + */ + } + + /* "w3lib/_url.pyx":924 + * if isinstance(host, int): + * return _serialize_ipv4(host) + * if isinstance(host, list): # <<<<<<<<<<<<<< + * return f"[{_serialize_ipv6(host)}]" + * return host + */ + __pyx_t_1 = PyList_Check(__pyx_v_host); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":925 + * return _serialize_ipv4(host) + * if isinstance(host, list): + * return f"[{_serialize_ipv6(host)}]" # <<<<<<<<<<<<<< + * return host + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 925, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = 0; + __pyx_t_7 = 127; + __Pyx_INCREF(__pyx_kp_u__8); + __pyx_t_6 += 1; + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__8); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_serialize_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 925, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_host}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 925, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7; + __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_u__9); + __pyx_t_6 += 1; + __Pyx_GIVEREF(__pyx_kp_u__9); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__9); + __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 925, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":924 + * if isinstance(host, int): + * return _serialize_ipv4(host) + * if isinstance(host, list): # <<<<<<<<<<<<<< + * return f"[{_serialize_ipv6(host)}]" + * return host + */ + } + + /* "w3lib/_url.pyx":926 + * if isinstance(host, list): + * return f"[{_serialize_ipv6(host)}]" + * return host # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyUnicode_CheckExact(__pyx_v_host))||((__pyx_v_host) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_host))) __PYX_ERR(0, 926, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_host); + __pyx_r = ((PyObject*)__pyx_v_host); + goto __pyx_L0; + + /* "w3lib/_url.pyx":921 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer + * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< + * if isinstance(host, int): + * return _serialize_ipv4(host) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("w3lib._url._serialize_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":930 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer + * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< + * if url.has_opaque_path(): + * assert isinstance(url.path, str) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_41_serialize_url_path(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_41_serialize_url_path = {"_serialize_url_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_41_serialize_url_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_41_serialize_url_path(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_url = 0; + PyObject *__pyx_v_canonicalize = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_serialize_url_path (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,&__pyx_n_s_canonicalize,0}; + values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 930, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 930, __pyx_L3_error) + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url_path") < 0)) __PYX_ERR(0, 930, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_url = values[0]; + __pyx_v_canonicalize = values[1]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_serialize_url_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 930, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._serialize_url_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5w3lib_4_url_40_serialize_url_path(__pyx_self, __pyx_v_url, __pyx_v_canonicalize); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_canonicalize) { + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_v_segment = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_serialize_url_path", 1); + + /* "w3lib/_url.pyx":931 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer + * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: + * if url.has_opaque_path(): # <<<<<<<<<<<<<< + * assert isinstance(url.path, str) + * return url.path + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 931, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":932 + * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: + * if url.has_opaque_path(): + * assert isinstance(url.path, str) # <<<<<<<<<<<<<< + * return url.path + * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyUnicode_Check(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_5)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 932, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 932, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":933 + * if url.has_opaque_path(): + * assert isinstance(url.path, str) + * return url.path # <<<<<<<<<<<<<< + * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: + * return "" + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 933, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":931 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer + * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: + * if url.has_opaque_path(): # <<<<<<<<<<<<<< + * assert isinstance(url.path, str) + * return url.path + */ + } + + /* "w3lib/_url.pyx":934 + * assert isinstance(url.path, str) + * return url.path + * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: # <<<<<<<<<<<<<< + * return "" + * output = "" + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 934, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = (__pyx_t_6 <= 1); + if (__pyx_t_7) { + } else { + __pyx_t_5 = __pyx_t_7; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 934, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_7) { + } else { + __pyx_t_5 = __pyx_t_7; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 934, __pyx_L1_error) + __pyx_t_8 = (!__pyx_t_7); + __pyx_t_5 = __pyx_t_8; + __pyx_L5_bool_binop_done:; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":935 + * return url.path + * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: + * return "" # <<<<<<<<<<<<<< + * output = "" + * for segment in url.path: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_u__2); + __pyx_r = __pyx_kp_u__2; + goto __pyx_L0; + + /* "w3lib/_url.pyx":934 + * assert isinstance(url.path, str) + * return url.path + * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: # <<<<<<<<<<<<<< + * return "" + * output = "" + */ + } + + /* "w3lib/_url.pyx":936 + * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: + * return "" + * output = "" # <<<<<<<<<<<<<< + * for segment in url.path: + * output += f"/{segment}" + */ + __Pyx_INCREF(__pyx_kp_u__2); + __pyx_v_output = __pyx_kp_u__2; + + /* "w3lib/_url.pyx":937 + * return "" + * output = "" + * for segment in url.path: # <<<<<<<<<<<<<< + * output += f"/{segment}" + * return output + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_6 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 937, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 937, __pyx_L1_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 937, __pyx_L1_error) + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 937, __pyx_L1_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 937, __pyx_L1_error) + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_9(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 937, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_segment, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":938 + * output = "" + * for segment in url.path: + * output += f"/{segment}" # <<<<<<<<<<<<<< + * return output + * + */ + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_segment, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 938, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":937 + * return "" + * output = "" + * for segment in url.path: # <<<<<<<<<<<<<< + * output += f"/{segment}" + * return output + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":939 + * for segment in url.path: + * output += f"/{segment}" + * return output # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_output); + __pyx_r = __pyx_v_output; + goto __pyx_L0; + + /* "w3lib/_url.pyx":930 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer + * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< + * if url.has_opaque_path(): + * assert isinstance(url.path, str) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("w3lib._url._serialize_url_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XDECREF(__pyx_v_segment); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":943 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing + * def _serialize_url( # <<<<<<<<<<<<<< + * url: _URL, + * *, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_43_serialize_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_42_serialize_url, "Return a string representation of *url* following the URL serialization\n algorithm defined in the `URL living standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer\n\n If *exclude_fragment* is ``True``, the returned URL does not include\n :attr:`_URL.fragment`.\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *canonicalize*:\n\n - ``None``: Do not deviate from the standard algorithm to apply or\n prevent URL canonicalization.\n\n - ``True``: Deviate from the standard as needed to make sure that\n functionally-equivalent URLs are always rendered the same way.\n\n This value has no effect at the moment, i.e. it applies the same\n level of canonicalization as the standard algorithm.\n\n - ``False``: Deviate from the standard as needed to make sure that\n the returned URL string is as close as possible to the original URL\n string that was parsed into *url*, as long as the returned URL\n string is still a valid URL.\n\n At the moment, this ensures that the password separator (:) is\n included into the returned URL string as long as it was present on\n the original URL string, even if :attr:`_URL.password` is an empty\n string.\n "); +static PyMethodDef __pyx_mdef_5w3lib_4_url_43_serialize_url = {"_serialize_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_43_serialize_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_42_serialize_url}; +static PyObject *__pyx_pw_5w3lib_4_url_43_serialize_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_url = 0; + PyObject *__pyx_v_exclude_fragment = 0; + PyObject *__pyx_v_canonicalize = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_serialize_url (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,&__pyx_n_s_exclude_fragment,&__pyx_n_s_canonicalize,0}; + + /* "w3lib/_url.pyx":946 + * url: _URL, + * *, + * exclude_fragment: bool = False, # <<<<<<<<<<<<<< + * canonicalize: Optional[bool] = None, + * ) -> str: + */ + values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + + /* "w3lib/_url.pyx":947 + * *, + * exclude_fragment: bool = False, + * canonicalize: Optional[bool] = None, # <<<<<<<<<<<<<< + * ) -> str: + * """Return a string representation of *url* following the URL serialization + */ + values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 943, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (kw_args > 0 && likely(kw_args <= 2)) { + Py_ssize_t index; + for (index = 1; index < 3 && kw_args > 0; index++) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 943, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url") < 0)) __PYX_ERR(0, 943, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_url = values[0]; + __pyx_v_exclude_fragment = values[1]; + __pyx_v_canonicalize = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_serialize_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 943, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._serialize_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5w3lib_4_url_42_serialize_url(__pyx_self, __pyx_v_url, __pyx_v_exclude_fragment, __pyx_v_canonicalize); + + /* "w3lib/_url.pyx":943 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing + * def _serialize_url( # <<<<<<<<<<<<<< + * url: _URL, + * *, + */ + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_exclude_fragment, PyObject *__pyx_v_canonicalize) { + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_serialize_url", 1); + + /* "w3lib/_url.pyx":981 + * string. + * """ + * output = url.scheme + ":" # <<<<<<<<<<<<<< + * if url.hostname is not None: + * output += "//" + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_output = __pyx_t_2; + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":982 + * """ + * output = url.scheme + ":" + * if url.hostname is not None: # <<<<<<<<<<<<<< + * output += "//" + * if url.username or url.password: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + + /* "w3lib/_url.pyx":983 + * output = url.scheme + ":" + * if url.hostname is not None: + * output += "//" # <<<<<<<<<<<<<< + * if url.username or url.password: + * output += url.username + */ + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":984 + * if url.hostname is not None: + * output += "//" + * if url.username or url.password: # <<<<<<<<<<<<<< + * output += url.username + * if url.password: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 984, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 984, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __pyx_t_4; + __pyx_L5_bool_binop_done:; + if (__pyx_t_3) { + + /* "w3lib/_url.pyx":985 + * output += "//" + * if url.username or url.password: + * output += url.username # <<<<<<<<<<<<<< + * if url.password: + * output += f":{url.password}" + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":986 + * if url.username or url.password: + * output += url.username + * if url.password: # <<<<<<<<<<<<<< + * output += f":{url.password}" + * elif not canonicalize and url._password_token_seen: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "w3lib/_url.pyx":987 + * output += url.username + * if url.password: + * output += f":{url.password}" # <<<<<<<<<<<<<< + * elif not canonicalize and url._password_token_seen: + * output += ":" + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":986 + * if url.username or url.password: + * output += url.username + * if url.password: # <<<<<<<<<<<<<< + * output += f":{url.password}" + * elif not canonicalize and url._password_token_seen: + */ + goto __pyx_L7; + } + + /* "w3lib/_url.pyx":988 + * if url.password: + * output += f":{url.password}" + * elif not canonicalize and url._password_token_seen: # <<<<<<<<<<<<<< + * output += ":" + * output += "@" + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 988, __pyx_L1_error) + __pyx_t_5 = (!__pyx_t_4); + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 988, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 988, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L8_bool_binop_done:; + if (__pyx_t_3) { + + /* "w3lib/_url.pyx":989 + * output += f":{url.password}" + * elif not canonicalize and url._password_token_seen: + * output += ":" # <<<<<<<<<<<<<< + * output += "@" + * output += _serialize_host(url.hostname) + */ + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":988 + * if url.password: + * output += f":{url.password}" + * elif not canonicalize and url._password_token_seen: # <<<<<<<<<<<<<< + * output += ":" + * output += "@" + */ + } + __pyx_L7:; + + /* "w3lib/_url.pyx":990 + * elif not canonicalize and url._password_token_seen: + * output += ":" + * output += "@" # <<<<<<<<<<<<<< + * output += _serialize_host(url.hostname) + * if url.port is not None: + */ + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":984 + * if url.hostname is not None: + * output += "//" + * if url.username or url.password: # <<<<<<<<<<<<<< + * output += url.username + * if url.password: + */ + } + + /* "w3lib/_url.pyx":991 + * output += ":" + * output += "@" + * output += _serialize_host(url.hostname) # <<<<<<<<<<<<<< + * if url.port is not None: + * output += f":{url.port}" + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 991, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 991, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":992 + * output += "@" + * output += _serialize_host(url.hostname) + * if url.port is not None: # <<<<<<<<<<<<<< + * output += f":{url.port}" + * elif not canonicalize: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "w3lib/_url.pyx":993 + * output += _serialize_host(url.hostname) + * if url.port is not None: + * output += f":{url.port}" # <<<<<<<<<<<<<< + * elif not canonicalize: + * if url._default_port_seen: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":992 + * output += "@" + * output += _serialize_host(url.hostname) + * if url.port is not None: # <<<<<<<<<<<<<< + * output += f":{url.port}" + * elif not canonicalize: + */ + goto __pyx_L10; + } + + /* "w3lib/_url.pyx":994 + * if url.port is not None: + * output += f":{url.port}" + * elif not canonicalize: # <<<<<<<<<<<<<< + * if url._default_port_seen: + * output += f":{_DEFAULT_PORTS[url.scheme]}" + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 994, __pyx_L1_error) + __pyx_t_5 = (!__pyx_t_3); + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":995 + * output += f":{url.port}" + * elif not canonicalize: + * if url._default_port_seen: # <<<<<<<<<<<<<< + * output += f":{_DEFAULT_PORTS[url.scheme]}" + * elif url._port_token_seen: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":996 + * elif not canonicalize: + * if url._default_port_seen: + * output += f":{_DEFAULT_PORTS[url.scheme]}" # <<<<<<<<<<<<<< + * elif url._port_token_seen: + * output += ":" + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":995 + * output += f":{url.port}" + * elif not canonicalize: + * if url._default_port_seen: # <<<<<<<<<<<<<< + * output += f":{_DEFAULT_PORTS[url.scheme]}" + * elif url._port_token_seen: + */ + goto __pyx_L11; + } + + /* "w3lib/_url.pyx":997 + * if url._default_port_seen: + * output += f":{_DEFAULT_PORTS[url.scheme]}" + * elif url._port_token_seen: # <<<<<<<<<<<<<< + * output += ":" + * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 997, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":998 + * output += f":{_DEFAULT_PORTS[url.scheme]}" + * elif url._port_token_seen: + * output += ":" # <<<<<<<<<<<<<< + * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + * output += "/." + */ + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":997 + * if url._default_port_seen: + * output += f":{_DEFAULT_PORTS[url.scheme]}" + * elif url._port_token_seen: # <<<<<<<<<<<<<< + * output += ":" + * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + */ + } + __pyx_L11:; + + /* "w3lib/_url.pyx":994 + * if url.port is not None: + * output += f":{url.port}" + * elif not canonicalize: # <<<<<<<<<<<<<< + * if url._default_port_seen: + * output += f":{_DEFAULT_PORTS[url.scheme]}" + */ + } + __pyx_L10:; + + /* "w3lib/_url.pyx":982 + * """ + * output = url.scheme + ":" + * if url.hostname is not None: # <<<<<<<<<<<<<< + * output += "//" + * if url.username or url.password: + */ + goto __pyx_L3; + } + + /* "w3lib/_url.pyx":999 + * elif url._port_token_seen: + * output += ":" + * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< + * output += "/." + * output += _serialize_url_path(url, canonicalize=canonicalize) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 999, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (!__pyx_t_3); + if (__pyx_t_4) { + } else { + __pyx_t_5 = __pyx_t_4; + goto __pyx_L12_bool_binop_done; + } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 999, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (__pyx_t_9 > 1); + if (__pyx_t_4) { + } else { + __pyx_t_5 = __pyx_t_4; + goto __pyx_L12_bool_binop_done; + } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 999, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = (!__pyx_t_4); + __pyx_t_5 = __pyx_t_3; + __pyx_L12_bool_binop_done:; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":1000 + * output += ":" + * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + * output += "/." # <<<<<<<<<<<<<< + * output += _serialize_url_path(url, canonicalize=canonicalize) + * if url.query is not None: + */ + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__23); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1000, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_6); + __pyx_t_6 = 0; + + /* "w3lib/_url.pyx":999 + * elif url._port_token_seen: + * output += ":" + * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< + * output += "/." + * output += _serialize_url_path(url, canonicalize=canonicalize) + */ + } + __pyx_L3:; + + /* "w3lib/_url.pyx":1001 + * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + * output += "/." + * output += _serialize_url_path(url, canonicalize=canonicalize) # <<<<<<<<<<<<<< + * if url.query is not None: + * output += f"?{url.query}" + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_serialize_url_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_url); + __Pyx_GIVEREF(__pyx_v_url); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_url)) __PYX_ERR(0, 1001, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_canonicalize, __pyx_v_canonicalize) < 0) __PYX_ERR(0, 1001, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1002 + * output += "/." + * output += _serialize_url_path(url, canonicalize=canonicalize) + * if url.query is not None: # <<<<<<<<<<<<<< + * output += f"?{url.query}" + * if not exclude_fragment and url.fragment is not None: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":1003 + * output += _serialize_url_path(url, canonicalize=canonicalize) + * if url.query is not None: + * output += f"?{url.query}" # <<<<<<<<<<<<<< + * if not exclude_fragment and url.fragment is not None: + * output += f"#{url.fragment}" + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__14, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_7); + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":1002 + * output += "/." + * output += _serialize_url_path(url, canonicalize=canonicalize) + * if url.query is not None: # <<<<<<<<<<<<<< + * output += f"?{url.query}" + * if not exclude_fragment and url.fragment is not None: + */ + } + + /* "w3lib/_url.pyx":1004 + * if url.query is not None: + * output += f"?{url.query}" + * if not exclude_fragment and url.fragment is not None: # <<<<<<<<<<<<<< + * output += f"#{url.fragment}" + * return output + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_exclude_fragment); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1004, __pyx_L1_error) + __pyx_t_4 = (!__pyx_t_3); + if (__pyx_t_4) { + } else { + __pyx_t_5 = __pyx_t_4; + goto __pyx_L17_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = (__pyx_t_7 != Py_None); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __pyx_t_4; + __pyx_L17_bool_binop_done:; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":1005 + * output += f"?{url.query}" + * if not exclude_fragment and url.fragment is not None: + * output += f"#{url.fragment}" # <<<<<<<<<<<<<< + * return output + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__12, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1004 + * if url.query is not None: + * output += f"?{url.query}" + * if not exclude_fragment and url.fragment is not None: # <<<<<<<<<<<<<< + * output += f"#{url.fragment}" + * return output + */ + } + + /* "w3lib/_url.pyx":1006 + * if not exclude_fragment and url.fragment is not None: + * output += f"#{url.fragment}" + * return output # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1006, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_output); + __pyx_r = ((PyObject*)__pyx_v_output); + goto __pyx_L0; + + /* "w3lib/_url.pyx":943 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing + * def _serialize_url( # <<<<<<<<<<<<<< + * url: _URL, + * *, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._serialize_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *__pyx_freelist_5w3lib_4_url___pyx_scope_struct__genexpr[8]; +static int __pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr = 0; + +static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + #if CYTHON_COMPILING_IN_CPYTHON + if (likely((int)(__pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr)))) { + o = (PyObject*)__pyx_freelist_5w3lib_4_url___pyx_scope_struct__genexpr[--__pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else + #endif + { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct__genexpr(PyObject *o) { + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *p = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct__genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_code_point); + #if CYTHON_COMPILING_IN_CPYTHON + if (((int)(__pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr)))) { + __pyx_freelist_5w3lib_4_url___pyx_scope_struct__genexpr[__pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)o); + } else + #endif + { + #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + (*Py_TYPE(o)->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + if (tp_free) tp_free(o); + } + #endif + } +} + +static int __pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *p = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)o; + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + } + if (p->__pyx_v_code_point) { + e = (*v)(p->__pyx_v_code_point, a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct__genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct__genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec = { + "w3lib._url.__pyx_scope_struct__genexpr", + sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "w3lib._url.""__pyx_scope_struct__genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct__genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct__genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *__pyx_freelist_5w3lib_4_url___pyx_scope_struct_1_genexpr[8]; +static int __pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr = 0; + +static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + #if CYTHON_COMPILING_IN_CPYTHON + if (likely((int)(__pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr)))) { + o = (PyObject*)__pyx_freelist_5w3lib_4_url___pyx_scope_struct_1_genexpr[--__pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else + #endif + { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyObject *o) { + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct_1_genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_item); + #if CYTHON_COMPILING_IN_CPYTHON + if (((int)(__pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr)))) { + __pyx_freelist_5w3lib_4_url___pyx_scope_struct_1_genexpr[__pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)o); + } else + #endif + { + #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + (*Py_TYPE(o)->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + if (tp_free) tp_free(o); + } + #endif + } +} + +static int __pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)o; + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + } + if (p->__pyx_v_item) { + e = (*v)(p->__pyx_v_item, a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct_1_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct_1_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec = { + "w3lib._url.__pyx_scope_struct_1_genexpr", + sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "w3lib._url.""__pyx_scope_struct_1_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct_1_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_02X, __pyx_k_02X, sizeof(__pyx_k_02X), 0, 1, 0, 0}, + {&__pyx_kp_u_0X, __pyx_k_0X, sizeof(__pyx_k_0X), 0, 1, 0, 0}, + {&__pyx_kp_u_0x, __pyx_k_0x, sizeof(__pyx_k_0x), 0, 1, 0, 0}, + {&__pyx_kp_u_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 1, 0, 0}, + {&__pyx_kp_u_2E, __pyx_k_2E, sizeof(__pyx_k_2E), 0, 1, 0, 0}, + {&__pyx_kp_u_2E_2, __pyx_k_2E_2, sizeof(__pyx_k_2E_2), 0, 1, 0, 0}, + {&__pyx_kp_u_2E_2E, __pyx_k_2E_2E, sizeof(__pyx_k_2E_2E), 0, 1, 0, 0}, + {&__pyx_kp_u_2E_2e, __pyx_k_2E_2e, sizeof(__pyx_k_2E_2e), 0, 1, 0, 0}, + {&__pyx_kp_u_2E_3, __pyx_k_2E_3, sizeof(__pyx_k_2E_3), 0, 1, 0, 0}, + {&__pyx_kp_u_2e, __pyx_k_2e, sizeof(__pyx_k_2e), 0, 1, 0, 0}, + {&__pyx_kp_u_2e_2, __pyx_k_2e_2, sizeof(__pyx_k_2e_2), 0, 1, 0, 0}, + {&__pyx_kp_u_2e_2E, __pyx_k_2e_2E, sizeof(__pyx_k_2e_2E), 0, 1, 0, 0}, + {&__pyx_kp_u_2e_2e, __pyx_k_2e_2e, sizeof(__pyx_k_2e_2e), 0, 1, 0, 0}, + {&__pyx_kp_u_2e_3, __pyx_k_2e_3, sizeof(__pyx_k_2e_3), 0, 1, 0, 0}, + {&__pyx_kp_u_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 1, 0, 0}, + {&__pyx_n_s_ASCII_ALPHA, __pyx_k_ASCII_ALPHA, sizeof(__pyx_k_ASCII_ALPHA), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_ALPHANUMERIC, __pyx_k_ASCII_ALPHANUMERIC, sizeof(__pyx_k_ASCII_ALPHANUMERIC), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_DIGIT, __pyx_k_ASCII_DIGIT, sizeof(__pyx_k_ASCII_DIGIT), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_HEX_DIGIT, __pyx_k_ASCII_HEX_DIGIT, sizeof(__pyx_k_ASCII_HEX_DIGIT), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_TAB_OR_NEWLINE, __pyx_k_ASCII_TAB_OR_NEWLINE, sizeof(__pyx_k_ASCII_TAB_OR_NEWLINE), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO, __pyx_k_ASCII_TAB_OR_NEWLINE_TRANSLATIO, sizeof(__pyx_k_ASCII_TAB_OR_NEWLINE_TRANSLATIO), 0, 0, 1, 1}, + {&__pyx_n_s_AUTHORITY, __pyx_k_AUTHORITY, sizeof(__pyx_k_AUTHORITY), 0, 0, 1, 1}, + {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, + {&__pyx_n_s_C0_CONTROL, __pyx_k_C0_CONTROL, sizeof(__pyx_k_C0_CONTROL), 0, 0, 1, 1}, + {&__pyx_n_s_C0_CONTROL_OR_SPACE, __pyx_k_C0_CONTROL_OR_SPACE, sizeof(__pyx_k_C0_CONTROL_OR_SPACE), 0, 0, 1, 1}, + {&__pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_k_C0_CONTROL_PERCENT_ENCODE_SET, sizeof(__pyx_k_C0_CONTROL_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_DEFAULT_PORTS, __pyx_k_DEFAULT_PORTS, sizeof(__pyx_k_DEFAULT_PORTS), 0, 0, 1, 1}, + {&__pyx_kp_u_Domain_name, __pyx_k_Domain_name, sizeof(__pyx_k_Domain_name), 0, 1, 0, 0}, + {&__pyx_n_s_FILE, __pyx_k_FILE, sizeof(__pyx_k_FILE), 0, 0, 1, 1}, + {&__pyx_n_s_FILE_HOST, __pyx_k_FILE_HOST, sizeof(__pyx_k_FILE_HOST), 0, 0, 1, 1}, + {&__pyx_n_s_FILE_SLASH, __pyx_k_FILE_SLASH, sizeof(__pyx_k_FILE_SLASH), 0, 0, 1, 1}, + {&__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_k_FORBIDDEN_DOMAIN_CODE_POINTS, sizeof(__pyx_k_FORBIDDEN_DOMAIN_CODE_POINTS), 0, 0, 1, 1}, + {&__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_k_FORBIDDEN_HOST_CODE_POINTS, sizeof(__pyx_k_FORBIDDEN_HOST_CODE_POINTS), 0, 0, 1, 1}, + {&__pyx_n_s_FRAGMENT, __pyx_k_FRAGMENT, sizeof(__pyx_k_FRAGMENT), 0, 0, 1, 1}, + {&__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_k_FRAGMENT_PERCENT_ENCODE_SET, sizeof(__pyx_k_FRAGMENT_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_HOST, __pyx_k_HOST, sizeof(__pyx_k_HOST), 0, 0, 1, 1}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_n_s_List, __pyx_k_List, sizeof(__pyx_k_List), 0, 0, 1, 1}, + {&__pyx_kp_s_List_int, __pyx_k_List_int, sizeof(__pyx_k_List_int), 0, 0, 1, 0}, + {&__pyx_n_s_NO_SCHEME, __pyx_k_NO_SCHEME, sizeof(__pyx_k_NO_SCHEME), 0, 0, 1, 1}, + {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1}, + {&__pyx_n_s_OPAQUE_PATH, __pyx_k_OPAQUE_PATH, sizeof(__pyx_k_OPAQUE_PATH), 0, 0, 1, 1}, + {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1}, + {&__pyx_kp_s_Optional_bool, __pyx_k_Optional_bool, sizeof(__pyx_k_Optional_bool), 0, 0, 1, 0}, + {&__pyx_kp_s_Optional_int, __pyx_k_Optional_int, sizeof(__pyx_k_Optional_int), 0, 0, 1, 0}, + {&__pyx_kp_s_Optional_str, __pyx_k_Optional_str, sizeof(__pyx_k_Optional_str), 0, 0, 1, 0}, + {&__pyx_n_s_PATH, __pyx_k_PATH, sizeof(__pyx_k_PATH), 0, 0, 1, 1}, + {&__pyx_n_s_PATH_OR_AUTHORITY, __pyx_k_PATH_OR_AUTHORITY, sizeof(__pyx_k_PATH_OR_AUTHORITY), 0, 0, 1, 1}, + {&__pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_k_PATH_PERCENT_ENCODE_SET, sizeof(__pyx_k_PATH_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_PATH_START, __pyx_k_PATH_START, sizeof(__pyx_k_PATH_START), 0, 0, 1, 1}, + {&__pyx_n_s_PORT, __pyx_k_PORT, sizeof(__pyx_k_PORT), 0, 0, 1, 1}, + {&__pyx_n_s_PercentEncodeSet, __pyx_k_PercentEncodeSet, sizeof(__pyx_k_PercentEncodeSet), 0, 0, 1, 1}, + {&__pyx_n_s_QUERY, __pyx_k_QUERY, sizeof(__pyx_k_QUERY), 0, 0, 1, 1}, + {&__pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_k_QUERY_PERCENT_ENCODE_SET, sizeof(__pyx_k_QUERY_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_RELATIVE, __pyx_k_RELATIVE, sizeof(__pyx_k_RELATIVE), 0, 0, 1, 1}, + {&__pyx_n_s_RELATIVE_SLASH, __pyx_k_RELATIVE_SLASH, sizeof(__pyx_k_RELATIVE_SLASH), 0, 0, 1, 1}, + {&__pyx_n_s_SCHEME, __pyx_k_SCHEME, sizeof(__pyx_k_SCHEME), 0, 0, 1, 1}, + {&__pyx_n_s_SCHEME_CHARS, __pyx_k_SCHEME_CHARS, sizeof(__pyx_k_SCHEME_CHARS), 0, 0, 1, 1}, + {&__pyx_n_s_SCHEME_START, __pyx_k_SCHEME_START, sizeof(__pyx_k_SCHEME_START), 0, 0, 1, 1}, + {&__pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES, __pyx_k_SPECIAL_AUTHORITY_IGNORE_SLASHES, sizeof(__pyx_k_SPECIAL_AUTHORITY_IGNORE_SLASHES), 0, 0, 1, 1}, + {&__pyx_n_s_SPECIAL_AUTHORITY_SLASHES, __pyx_k_SPECIAL_AUTHORITY_SLASHES, sizeof(__pyx_k_SPECIAL_AUTHORITY_SLASHES), 0, 0, 1, 1}, + {&__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_k_SPECIAL_QUERY_PERCENT_ENCODE_SE, sizeof(__pyx_k_SPECIAL_QUERY_PERCENT_ENCODE_SE), 0, 0, 1, 1}, + {&__pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY, __pyx_k_SPECIAL_RELATIVE_OR_AUTHORITY, sizeof(__pyx_k_SPECIAL_RELATIVE_OR_AUTHORITY), 0, 0, 1, 1}, + {&__pyx_n_s_SPECIAL_SCHEMES, __pyx_k_SPECIAL_SCHEMES, sizeof(__pyx_k_SPECIAL_SCHEMES), 0, 0, 1, 1}, + {&__pyx_n_s_Tuple, __pyx_k_Tuple, sizeof(__pyx_k_Tuple), 0, 0, 1, 1}, + {&__pyx_kp_s_Tuple_int_bool, __pyx_k_Tuple_int_bool, sizeof(__pyx_k_Tuple_int_bool), 0, 0, 1, 0}, + {&__pyx_n_s_URL, __pyx_k_URL, sizeof(__pyx_k_URL), 0, 0, 1, 1}, + {&__pyx_n_s_URL___init, __pyx_k_URL___init, sizeof(__pyx_k_URL___init), 0, 0, 1, 1}, + {&__pyx_n_s_URL_has_opaque_path, __pyx_k_URL_has_opaque_path, sizeof(__pyx_k_URL_has_opaque_path), 0, 0, 1, 1}, + {&__pyx_n_s_URL_scheme, __pyx_k_URL_scheme, sizeof(__pyx_k_URL_scheme), 0, 0, 1, 1}, + {&__pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_k_USERINFO_PERCENT_ENCODE_SET, sizeof(__pyx_k_USERINFO_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, + {&__pyx_kp_s_Union_int_List_int_str, __pyx_k_Union_int_List_int_str, sizeof(__pyx_k_Union_int_List_int_str), 0, 0, 1, 0}, + {&__pyx_kp_s_Union_str_List_str, __pyx_k_Union_str_List_str, sizeof(__pyx_k_Union_str_List_str), 0, 0, 1, 0}, + {&__pyx_kp_s_Union_str_int_List_int, __pyx_k_Union_str_int_List_int, sizeof(__pyx_k_Union_str_int_List_int), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0}, + {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, + {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0}, + {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0}, + {&__pyx_n_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 1}, + {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0}, + {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0}, + {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0}, + {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0}, + {&__pyx_kp_u__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0}, + {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0}, + {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, + {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, + {&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0}, + {&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0}, + {&__pyx_kp_u__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0, 0}, + {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, + {&__pyx_kp_u__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 1, 0, 0}, + {&__pyx_n_s__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 1, 1}, + {&__pyx_kp_u__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 1, 0, 0}, + {&__pyx_kp_u__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 1, 0, 0}, + {&__pyx_kp_u__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 1, 0, 0}, + {&__pyx_kp_u__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 1, 0, 0}, + {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, + {&__pyx_kp_u__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 1, 0, 0}, + {&__pyx_kp_u__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 1, 0, 0}, + {&__pyx_kp_u__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 1, 0, 0}, + {&__pyx_kp_u__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 1, 0, 0}, + {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, + {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, + {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, + {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, + {&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1}, + {&__pyx_n_s_annotations, __pyx_k_annotations, sizeof(__pyx_k_annotations), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_ascii_domain, __pyx_k_ascii_domain, sizeof(__pyx_k_ascii_domain), 0, 0, 1, 1}, + {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, + {&__pyx_n_s_at_sign_index, __pyx_k_at_sign_index, sizeof(__pyx_k_at_sign_index), 0, 0, 1, 1}, + {&__pyx_n_s_at_sign_seen, __pyx_k_at_sign_seen, sizeof(__pyx_k_at_sign_seen), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_base_url, __pyx_k_base_url, sizeof(__pyx_k_base_url), 0, 0, 1, 1}, + {&__pyx_n_s_be_strict, __pyx_k_be_strict, sizeof(__pyx_k_be_strict), 0, 0, 1, 1}, + {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_byte, __pyx_k_byte, sizeof(__pyx_k_byte), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_s_canonicalize, __pyx_k_canonicalize, sizeof(__pyx_k_canonicalize), 0, 0, 1, 1}, + {&__pyx_n_s_check_bidi, __pyx_k_check_bidi, sizeof(__pyx_k_check_bidi), 0, 0, 1, 1}, + {&__pyx_n_s_check_hyphens, __pyx_k_check_hyphens, sizeof(__pyx_k_check_hyphens), 0, 0, 1, 1}, + {&__pyx_n_s_check_joiners, __pyx_k_check_joiners, sizeof(__pyx_k_check_joiners), 0, 0, 1, 1}, + {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, + {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_code_point, __pyx_k_code_point, sizeof(__pyx_k_code_point), 0, 0, 1, 1}, + {&__pyx_n_s_compress, __pyx_k_compress, sizeof(__pyx_k_compress), 0, 0, 1, 1}, + {&__pyx_n_s_counter, __pyx_k_counter, sizeof(__pyx_k_counter), 0, 0, 1, 1}, + {&__pyx_n_s_current_index, __pyx_k_current_index, sizeof(__pyx_k_current_index), 0, 0, 1, 1}, + {&__pyx_n_s_current_length, __pyx_k_current_length, sizeof(__pyx_k_current_length), 0, 0, 1, 1}, + {&__pyx_n_s_default_port_seen, __pyx_k_default_port_seen, sizeof(__pyx_k_default_port_seen), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 0, 0, 1, 1}, + {&__pyx_n_s_domain_to_ascii, __pyx_k_domain_to_ascii, sizeof(__pyx_k_domain_to_ascii), 0, 0, 1, 1}, + {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, + {&__pyx_n_s_encode_output, __pyx_k_encode_output, sizeof(__pyx_k_encode_output), 0, 0, 1, 1}, + {&__pyx_n_s_encode_set, __pyx_k_encode_set, sizeof(__pyx_k_encode_set), 0, 0, 1, 1}, + {&__pyx_n_s_encoded, __pyx_k_encoded, sizeof(__pyx_k_encoded), 0, 0, 1, 1}, + {&__pyx_n_s_encoded_code_points, __pyx_k_encoded_code_points, sizeof(__pyx_k_encoded_code_points), 0, 0, 1, 1}, + {&__pyx_n_s_encoder, __pyx_k_encoder, sizeof(__pyx_k_encoder), 0, 0, 1, 1}, + {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_encoding_2, __pyx_k_encoding_2, sizeof(__pyx_k_encoding_2), 0, 0, 1, 1}, + {&__pyx_n_s_ends_in_number, __pyx_k_ends_in_number, sizeof(__pyx_k_ends_in_number), 0, 0, 1, 1}, + {&__pyx_n_s_ends_in_number_locals_genexpr, __pyx_k_ends_in_number_locals_genexpr, sizeof(__pyx_k_ends_in_number_locals_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_exclude_fragment, __pyx_k_exclude_fragment, sizeof(__pyx_k_exclude_fragment), 0, 0, 1, 1}, + {&__pyx_n_u_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 1, 0, 1}, + {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1}, + {&__pyx_n_s_fragment, __pyx_k_fragment, sizeof(__pyx_k_fragment), 0, 0, 1, 1}, + {&__pyx_n_s_fragment_percent_encode_set, __pyx_k_fragment_percent_encode_set, sizeof(__pyx_k_fragment_percent_encode_set), 0, 0, 1, 1}, + {&__pyx_n_u_ftp, __pyx_k_ftp, sizeof(__pyx_k_ftp), 0, 1, 0, 1}, + {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, + {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_encoder, __pyx_k_get_encoder, sizeof(__pyx_k_get_encoder), 0, 0, 1, 1}, + {&__pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_k_get_ipv6_first_longest_0_piece, sizeof(__pyx_k_get_ipv6_first_longest_0_piece), 0, 0, 1, 1}, + {&__pyx_n_s_get_output_encoding, __pyx_k_get_output_encoding, sizeof(__pyx_k_get_output_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_greater_than, __pyx_k_greater_than, sizeof(__pyx_k_greater_than), 0, 0, 1, 1}, + {&__pyx_n_s_has_opaque_path, __pyx_k_has_opaque_path, sizeof(__pyx_k_has_opaque_path), 0, 0, 1, 1}, + {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1}, + {&__pyx_n_s_hostname, __pyx_k_hostname, sizeof(__pyx_k_hostname), 0, 0, 1, 1}, + {&__pyx_n_u_http, __pyx_k_http, sizeof(__pyx_k_http), 0, 1, 0, 1}, + {&__pyx_n_u_https, __pyx_k_https, sizeof(__pyx_k_https), 0, 1, 0, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_idempotent_utf_8_percent_encode, __pyx_k_idempotent_utf_8_percent_encode, sizeof(__pyx_k_idempotent_utf_8_percent_encode), 0, 0, 1, 1}, + {&__pyx_n_s_ignore0, __pyx_k_ignore0, sizeof(__pyx_k_ignore0), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, + {&__pyx_n_s_index_length, __pyx_k_index_length, sizeof(__pyx_k_index_length), 0, 0, 1, 1}, + {&__pyx_n_s_infra, __pyx_k_infra, sizeof(__pyx_k_infra), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, + {&__pyx_n_s_input, __pyx_k_input, sizeof(__pyx_k_input), 0, 0, 1, 1}, + {&__pyx_n_s_input_lenght, __pyx_k_input_lenght, sizeof(__pyx_k_input_lenght), 0, 0, 1, 1}, + {&__pyx_n_s_input_length, __pyx_k_input_length, sizeof(__pyx_k_input_length), 0, 0, 1, 1}, + {&__pyx_n_s_inside_brackets, __pyx_k_inside_brackets, sizeof(__pyx_k_inside_brackets), 0, 0, 1, 1}, + {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, + {&__pyx_n_s_ipv4, __pyx_k_ipv4, sizeof(__pyx_k_ipv4), 0, 0, 1, 1}, + {&__pyx_n_s_ipv4_piece, __pyx_k_ipv4_piece, sizeof(__pyx_k_ipv4_piece), 0, 0, 1, 1}, + {&__pyx_kp_u_is_an_empty_string_after_conver, __pyx_k_is_an_empty_string_after_conver, sizeof(__pyx_k_is_an_empty_string_after_conver), 0, 1, 0, 0}, + {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, + {&__pyx_n_s_is_double_dot_path_segment, __pyx_k_is_double_dot_path_segment, sizeof(__pyx_k_is_double_dot_path_segment), 0, 0, 1, 1}, + {&__pyx_n_s_is_single_dot_path_segment, __pyx_k_is_single_dot_path_segment, sizeof(__pyx_k_is_single_dot_path_segment), 0, 0, 1, 1}, + {&__pyx_n_s_is_special, __pyx_k_is_special, sizeof(__pyx_k_is_special), 0, 0, 1, 1}, + {&__pyx_n_s_is_windows_drive_letter, __pyx_k_is_windows_drive_letter, sizeof(__pyx_k_is_windows_drive_letter), 0, 0, 1, 1}, + {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, + {&__pyx_n_s_isomorph, __pyx_k_isomorph, sizeof(__pyx_k_isomorph), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_u_localhost, __pyx_k_localhost, sizeof(__pyx_k_localhost), 0, 1, 0, 1}, + {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_min_length, __pyx_k_min_length, sizeof(__pyx_k_min_length), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_number, __pyx_k_number, sizeof(__pyx_k_number), 0, 0, 1, 1}, + {&__pyx_n_s_numbers, __pyx_k_numbers, sizeof(__pyx_k_numbers), 0, 0, 1, 1}, + {&__pyx_n_s_numbers_seen, __pyx_k_numbers_seen, sizeof(__pyx_k_numbers_seen), 0, 0, 1, 1}, + {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, + {&__pyx_n_s_parse_host, __pyx_k_parse_host, sizeof(__pyx_k_parse_host), 0, 0, 1, 1}, + {&__pyx_n_s_parse_ipv4, __pyx_k_parse_ipv4, sizeof(__pyx_k_parse_ipv4), 0, 0, 1, 1}, + {&__pyx_n_s_parse_ipv4_locals_genexpr, __pyx_k_parse_ipv4_locals_genexpr, sizeof(__pyx_k_parse_ipv4_locals_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_parse_ipv4_number, __pyx_k_parse_ipv4_number, sizeof(__pyx_k_parse_ipv4_number), 0, 0, 1, 1}, + {&__pyx_n_s_parse_ipv6, __pyx_k_parse_ipv6, sizeof(__pyx_k_parse_ipv6), 0, 0, 1, 1}, + {&__pyx_n_s_parse_opaque_host, __pyx_k_parse_opaque_host, sizeof(__pyx_k_parse_opaque_host), 0, 0, 1, 1}, + {&__pyx_n_s_parse_url, __pyx_k_parse_url, sizeof(__pyx_k_parse_url), 0, 0, 1, 1}, + {&__pyx_n_s_part, __pyx_k_part, sizeof(__pyx_k_part), 0, 0, 1, 1}, + {&__pyx_n_s_parts, __pyx_k_parts, sizeof(__pyx_k_parts), 0, 0, 1, 1}, + {&__pyx_n_s_password, __pyx_k_password, sizeof(__pyx_k_password), 0, 0, 1, 1}, + {&__pyx_n_s_password_token_seen, __pyx_k_password_token_seen, sizeof(__pyx_k_password_token_seen), 0, 0, 1, 1}, + {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, + {&__pyx_n_s_path_percent_encode_set, __pyx_k_path_percent_encode_set, sizeof(__pyx_k_path_percent_encode_set), 0, 0, 1, 1}, + {&__pyx_n_s_path_token_seen, __pyx_k_path_token_seen, sizeof(__pyx_k_path_token_seen), 0, 0, 1, 1}, + {&__pyx_n_s_percent_encode_after_encoding, __pyx_k_percent_encode_after_encoding, sizeof(__pyx_k_percent_encode_after_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_percent_encode_set, __pyx_k_percent_encode_set, sizeof(__pyx_k_percent_encode_set), 0, 0, 1, 1}, + {&__pyx_n_s_piece, __pyx_k_piece, sizeof(__pyx_k_piece), 0, 0, 1, 1}, + {&__pyx_n_s_piece_index, __pyx_k_piece_index, sizeof(__pyx_k_piece_index), 0, 0, 1, 1}, + {&__pyx_n_s_pointer, __pyx_k_pointer, sizeof(__pyx_k_pointer), 0, 0, 1, 1}, + {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1}, + {&__pyx_n_s_port_token_seen, __pyx_k_port_token_seen, sizeof(__pyx_k_port_token_seen), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1}, + {&__pyx_n_s_query_percent_encode_set, __pyx_k_query_percent_encode_set, sizeof(__pyx_k_query_percent_encode_set), 0, 0, 1, 1}, + {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, + {&__pyx_n_s_scheme, __pyx_k_scheme, sizeof(__pyx_k_scheme), 0, 0, 1, 1}, + {&__pyx_n_s_scheme_2, __pyx_k_scheme_2, sizeof(__pyx_k_scheme_2), 0, 0, 1, 1}, + {&__pyx_n_s_segment, __pyx_k_segment, sizeof(__pyx_k_segment), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_separator, __pyx_k_separator, sizeof(__pyx_k_separator), 0, 0, 1, 1}, + {&__pyx_n_s_serialize_host, __pyx_k_serialize_host, sizeof(__pyx_k_serialize_host), 0, 0, 1, 1}, + {&__pyx_n_s_serialize_ipv4, __pyx_k_serialize_ipv4, sizeof(__pyx_k_serialize_ipv4), 0, 0, 1, 1}, + {&__pyx_n_s_serialize_ipv6, __pyx_k_serialize_ipv6, sizeof(__pyx_k_serialize_ipv6), 0, 0, 1, 1}, + {&__pyx_n_s_serialize_url, __pyx_k_serialize_url, sizeof(__pyx_k_serialize_url), 0, 0, 1, 1}, + {&__pyx_n_s_serialize_url_path, __pyx_k_serialize_url_path, sizeof(__pyx_k_serialize_url_path), 0, 0, 1, 1}, + {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, + {&__pyx_n_s_setter, __pyx_k_setter, sizeof(__pyx_k_setter), 0, 0, 1, 1}, + {&__pyx_n_s_shorten_path, __pyx_k_shorten_path, sizeof(__pyx_k_shorten_path), 0, 0, 1, 1}, + {&__pyx_n_s_skip_authority_shortcut, __pyx_k_skip_authority_shortcut, sizeof(__pyx_k_skip_authority_shortcut), 0, 0, 1, 1}, + {&__pyx_n_s_space_as_plus, __pyx_k_space_as_plus, sizeof(__pyx_k_space_as_plus), 0, 0, 1, 1}, + {&__pyx_n_s_special_query_percent_encode_set, __pyx_k_special_query_percent_encode_set, sizeof(__pyx_k_special_query_percent_encode_set), 0, 0, 1, 1}, + {&__pyx_n_s_starts_with_windows_drive_lette, __pyx_k_starts_with_windows_drive_lette, sizeof(__pyx_k_starts_with_windows_drive_lette), 0, 0, 1, 1}, + {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_swaps, __pyx_k_swaps, sizeof(__pyx_k_swaps), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_to_ascii, __pyx_k_to_ascii, sizeof(__pyx_k_to_ascii), 0, 0, 1, 1}, + {&__pyx_n_s_transitional_processing, __pyx_k_transitional_processing, sizeof(__pyx_k_transitional_processing), 0, 0, 1, 1}, + {&__pyx_n_s_translate, __pyx_k_translate, sizeof(__pyx_k_translate), 0, 0, 1, 1}, + {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, + {&__pyx_n_s_unquote, __pyx_k_unquote, sizeof(__pyx_k_unquote), 0, 0, 1, 1}, + {&__pyx_n_s_url, __pyx_k_url, sizeof(__pyx_k_url), 0, 0, 1, 1}, + {&__pyx_n_s_urllib_parse, __pyx_k_urllib_parse, sizeof(__pyx_k_urllib_parse), 0, 0, 1, 1}, + {&__pyx_n_s_use_std3_ascii_rules, __pyx_k_use_std3_ascii_rules, sizeof(__pyx_k_use_std3_ascii_rules), 0, 0, 1, 1}, + {&__pyx_n_s_userinfo_percent_encode_set, __pyx_k_userinfo_percent_encode_set, sizeof(__pyx_k_userinfo_percent_encode_set), 0, 0, 1, 1}, + {&__pyx_n_s_username, __pyx_k_username, sizeof(__pyx_k_username), 0, 0, 1, 1}, + {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, + {&__pyx_n_s_utf_8_percent_encode, __pyx_k_utf_8_percent_encode, sizeof(__pyx_k_utf_8_percent_encode), 0, 0, 1, 1}, + {&__pyx_n_s_util, __pyx_k_util, sizeof(__pyx_k_util), 0, 0, 1, 1}, + {&__pyx_n_s_utr46, __pyx_k_utr46, sizeof(__pyx_k_utr46), 0, 0, 1, 1}, + {&__pyx_n_s_validation_error, __pyx_k_validation_error, sizeof(__pyx_k_validation_error), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_verify_dns_length, __pyx_k_verify_dns_length, sizeof(__pyx_k_verify_dns_length), 0, 0, 1, 1}, + {&__pyx_n_s_w3lib__url, __pyx_k_w3lib__url, sizeof(__pyx_k_w3lib__url), 0, 0, 1, 1}, + {&__pyx_kp_s_w3lib__url_pyx, __pyx_k_w3lib__url_pyx, sizeof(__pyx_k_w3lib__url_pyx), 0, 0, 1, 0}, + {&__pyx_n_u_ws, __pyx_k_ws, sizeof(__pyx_k_ws), 0, 1, 0, 1}, + {&__pyx_n_u_wss, __pyx_k_wss, sizeof(__pyx_k_wss), 0, 1, 0, 1}, + {&__pyx_n_u_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 1, 0, 1}, + {&__pyx_n_u_xmlcharrefreplace, __pyx_k_xmlcharrefreplace, sizeof(__pyx_k_xmlcharrefreplace), 0, 1, 0, 1}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 628, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "w3lib/_url.pyx":120 + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + * return + * url.path = path[:-1] # <<<<<<<<<<<<<< + * + * + */ + __pyx_slice_ = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice_); + __Pyx_GIVEREF(__pyx_slice_); + + /* "w3lib/_url.pyx":297 + * r = 8 + * if not input: + * return (0, True) # <<<<<<<<<<<<<< + * return (int(input, base=r), validation_error) + * + */ + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, Py_True); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "w3lib/_url.pyx":789 + * and _is_windows_drive_letter(buffer) + * ): + * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< + * if ( + * not url.path + */ + __pyx_slice__20 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__20); + __Pyx_GIVEREF(__pyx_slice__20); + + /* "w3lib/_url.pyx":95 + * _path_token_seen: bool = False + * + * def __init__(self) -> None: # <<<<<<<<<<<<<< + * self.path = [] + * self.is_special = False + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_init, 95, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 95, __pyx_L1_error) + + /* "w3lib/_url.pyx":99 + * self.is_special = False + * + * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< + * return isinstance(self.path, str) + * + */ + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_has_opaque_path, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 99, __pyx_L1_error) + + /* "w3lib/_url.pyx":102 + * return isinstance(self.path, str) + * + * @property # <<<<<<<<<<<<<< + * def scheme(self) -> str: + * return self._scheme + */ + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 102, __pyx_L1_error) + + /* "w3lib/_url.pyx":106 + * return self._scheme + * + * @scheme.setter # <<<<<<<<<<<<<< + * def scheme(self, value: str) -> None: + * self._scheme = value + */ + __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 106, __pyx_L1_error) + + /* "w3lib/_url.pyx":116 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path + * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + */ + __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_path); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_shorten_path, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 116, __pyx_L1_error) + + /* "w3lib/_url.pyx":125 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode + * # Extended to handled cases where % is to be percent-encoded. + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + __pyx_tuple__34 = PyTuple_Pack(11, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_percent_encode_set, __pyx_n_s_space_as_plus, __pyx_n_s_encoder, __pyx_n_s_output, __pyx_n_s_encode_output, __pyx_n_s__33, __pyx_n_s_i, __pyx_n_s_byte, __pyx_n_s_isomorph); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_percent_encode_after_encoding, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 125, __pyx_L1_error) + + /* "w3lib/_url.pyx":175 + * + * + * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< + * address = [0] * 8 + * piece_index = 0 + */ + __pyx_tuple__44 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_address, __pyx_n_s_piece_index, __pyx_n_s_compress, __pyx_n_s_pointer, __pyx_n_s_input_lenght, __pyx_n_s_value, __pyx_n_s_length, __pyx_n_s_numbers_seen, __pyx_n_s_ipv4_piece, __pyx_n_s_number, __pyx_n_s_swaps); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv6, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 175, __pyx_L1_error) + + /* "w3lib/_url.pyx":262 + * + * + * def _utf_8_percent_encode( # <<<<<<<<<<<<<< + * input: str, + * percent_encode_set: _PercentEncodeSet, + */ + __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_utf_8_percent_encode, 262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 262, __pyx_L1_error) + + /* "w3lib/_url.pyx":274 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser + * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + */ + __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_opaque_host, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 274, __pyx_L1_error) + + /* "w3lib/_url.pyx":282 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< + * if not input: + * raise ValueError + */ + __pyx_tuple__50 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_validation_error, __pyx_n_s_r); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4_number, 282, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 282, __pyx_L1_error) + + /* "w3lib/_url.pyx":302 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and parts[-1] == "": + */ + __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_last, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_ends_in_number, 302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 302, __pyx_L1_error) + + /* "w3lib/_url.pyx":319 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and not parts[-1]: + */ + __pyx_tuple__54 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_numbers, __pyx_n_s_part, __pyx_n_s_result, __pyx_n_s_ipv4, __pyx_n_s_counter, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4, 319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 319, __pyx_L1_error) + + /* "w3lib/_url.pyx":342 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< + * result = _utr46._to_ascii( + * domain, + */ + __pyx_tuple__56 = PyTuple_Pack(3, __pyx_n_s_domain, __pyx_n_s_be_strict, __pyx_n_s_result); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_domain_to_ascii, 342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 342, __pyx_L1_error) + + /* "w3lib/_url.pyx":361 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser + * def _parse_host( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_is_special, __pyx_n_s_domain, __pyx_n_s_ascii_domain, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_host, 361, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 361, __pyx_L1_error) + + /* "w3lib/_url.pyx":383 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter + * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" + * + */ + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_input); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_windows_drive_letter, 383, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 383, __pyx_L1_error) + + /* "w3lib/_url.pyx":388 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter + * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * input_length = len(input) + * return ( + */ + __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_input_length); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_starts_with_windows_drive_lette, 388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 388, __pyx_L1_error) + + /* "w3lib/_url.pyx":398 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment + * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * "..", + */ + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_double_dot_path_segment, 398, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 398, __pyx_L1_error) + + /* "w3lib/_url.pyx":413 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment + * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * ".", + */ + __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_single_dot_path_segment, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 413, __pyx_L1_error) + + /* "w3lib/_url.pyx":424 + * # to be escaped, they are escaped in an idempotent way (i.e. if they are + * # already part of an escape sequence, they are not re-encoded). + * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * *, input: str, pointer: int, encode_set: _PercentEncodeSet + * ) -> str: + */ + __pyx_tuple__66 = PyTuple_Pack(4, __pyx_n_s_input, __pyx_n_s_pointer, __pyx_n_s_encode_set, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_idempotent_utf_8_percent_encode, 424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 424, __pyx_L1_error) + + /* "w3lib/_url.pyx":439 + * + * + * def _parse_url( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + __pyx_tuple__68 = PyTuple_Pack(26, __pyx_n_s_input, __pyx_n_s_base_url, __pyx_n_s_encoding, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_path_percent_encode_set, __pyx_n_s_query_percent_encode_set, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_base, __pyx_n_s_url, __pyx_n_s_state, __pyx_n_s_buffer, __pyx_n_s_at_sign_seen, __pyx_n_s_inside_brackets, __pyx_n_s_skip_authority_shortcut, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_c, __pyx_n_s_at_sign_index, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_encoded_code_points, __pyx_n_s_host, __pyx_n_s_port, __pyx_n_s_encoded, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_url, 439, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 439, __pyx_L1_error) + + /* "w3lib/_url.pyx":871 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 + * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< + * output = "" + * n = address + */ + __pyx_tuple__70 = PyTuple_Pack(4, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv4, 871, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 871, __pyx_L1_error) + + /* "w3lib/_url.pyx":882 + * + * + * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< + * address: List[int], *, min_length: int = 2 + * ) -> Optional[int]: + */ + __pyx_tuple__72 = PyTuple_Pack(7, __pyx_n_s_address, __pyx_n_s_min_length, __pyx_n_s_index, __pyx_n_s_index_length, __pyx_n_s_current_length, __pyx_n_s_current_index, __pyx_n_s_piece); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_ipv6_first_longest_0_piece, 882, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 882, __pyx_L1_error) + + /* "w3lib/_url.pyx":900 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer + * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< + * output = "" + * compress = _get_ipv6_first_longest_0_piece_index(address) + */ + __pyx_tuple__74 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_compress, __pyx_n_s_ignore0, __pyx_n_s_piece_index, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 900, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); + __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv6, 900, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 900, __pyx_L1_error) + + /* "w3lib/_url.pyx":921 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer + * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< + * if isinstance(host, int): + * return _serialize_ipv4(host) + */ + __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_s_host); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 921, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_host, 921, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 921, __pyx_L1_error) + + /* "w3lib/_url.pyx":930 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer + * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< + * if url.has_opaque_path(): + * assert isinstance(url.path, str) + */ + __pyx_tuple__78 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_canonicalize, __pyx_n_s_output, __pyx_n_s_segment); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); + __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url_path, 930, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 930, __pyx_L1_error) + + /* "w3lib/_url.pyx":943 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing + * def _serialize_url( # <<<<<<<<<<<<<< + * url: _URL, + * *, + */ + __pyx_tuple__80 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_exclude_fragment, __pyx_n_s_canonicalize, __pyx_n_s_output); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url, 943, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 943, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + __pyx_umethod_PyUnicode_Type_strip.type = (PyObject*)&PyUnicode_Type; + __pyx_umethod_PyUnicode_Type_strip.method_name = &__pyx_n_s_strip; + __pyx_umethod_PyUnicode_Type_translate.type = (PyObject*)&PyUnicode_Type; + __pyx_umethod_PyUnicode_Type_translate.method_name = &__pyx_n_s_translate; + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_80 = PyInt_FromLong(80); if (unlikely(!__pyx_int_80)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_443 = PyInt_FromLong(443); if (unlikely(!__pyx_int_443)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_65535 = PyInt_FromLong(65535L); if (unlikely(!__pyx_int_65535)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + /* AssertionsEnabled.init */ + if (likely(__Pyx_init_assertions_enabled() == 0)); else + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_7genexpr__pyx_v_5w3lib_4_url_char = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr)) __PYX_ERR(0, 309, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 309, __pyx_L1_error) + #else + __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 309, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 329, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 329, __pyx_L1_error) + #else + __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 329, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__url(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__url}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "_url", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_url(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_url(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__url(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__url(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__url(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + long __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_url' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_url", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_url" pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__url(void)", 0); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_w3lib___url) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "w3lib._url")) { + if (unlikely((PyDict_SetItemString(modules, "w3lib._url", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":6 + * # https://url.spec.whatwg.org/ + * + * from math import floor # <<<<<<<<<<<<<< + * from typing import List, Optional, Tuple, Union + * from urllib.parse import unquote + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_floor); + __Pyx_GIVEREF(__pyx_n_s_floor); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_floor)) __PYX_ERR(0, 6, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_math, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_floor, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":7 + * + * from math import floor + * from typing import List, Optional, Tuple, Union # <<<<<<<<<<<<<< + * from urllib.parse import unquote + * + */ + __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_List); + __Pyx_GIVEREF(__pyx_n_s_List); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_List)) __PYX_ERR(0, 7, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Optional); + __Pyx_GIVEREF(__pyx_n_s_Optional); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Optional)) __PYX_ERR(0, 7, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Tuple); + __Pyx_GIVEREF(__pyx_n_s_Tuple); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_Tuple)) __PYX_ERR(0, 7, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Union); + __Pyx_GIVEREF(__pyx_n_s_Union); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_Union)) __PYX_ERR(0, 7, __pyx_L1_error); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_List); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_List, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tuple, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":8 + * from math import floor + * from typing import List, Optional, Tuple, Union + * from urllib.parse import unquote # <<<<<<<<<<<<<< + * + * from . import _utr46 + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_unquote); + __Pyx_GIVEREF(__pyx_n_s_unquote); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_unquote)) __PYX_ERR(0, 8, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_urllib_parse, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_unquote); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":10 + * from urllib.parse import unquote + * + * from . import _utr46 # <<<<<<<<<<<<<< + * from ._encoding import ( + * _get_encoder, + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_utr46); + __Pyx_GIVEREF(__pyx_n_s_utr46); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_utr46)) __PYX_ERR(0, 10, __pyx_L1_error); + __pyx_t_2 = __Pyx_Import(__pyx_n_s__2, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_utr46); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utr46, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":12 + * from . import _utr46 + * from ._encoding import ( + * _get_encoder, # <<<<<<<<<<<<<< + * _get_output_encoding, + * ) + */ + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_get_encoder); + __Pyx_GIVEREF(__pyx_n_s_get_encoder); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_encoder)) __PYX_ERR(0, 12, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_get_output_encoding); + __Pyx_GIVEREF(__pyx_n_s_get_output_encoding); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_get_output_encoding)) __PYX_ERR(0, 12, __pyx_L1_error); + + /* "w3lib/_url.pyx":11 + * + * from . import _utr46 + * from ._encoding import ( # <<<<<<<<<<<<<< + * _get_encoder, + * _get_output_encoding, + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_encoding_2, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoder, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_get_output_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_output_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":16 + * ) + * from ._infra import ( + * _ASCII_ALPHA, # <<<<<<<<<<<<<< + * _ASCII_ALPHANUMERIC, + * _ASCII_DIGIT, + */ + __pyx_t_3 = PyList_New(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_ASCII_ALPHA); + __Pyx_GIVEREF(__pyx_n_s_ASCII_ALPHA); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ASCII_ALPHA)) __PYX_ERR(0, 16, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_ASCII_ALPHANUMERIC); + __Pyx_GIVEREF(__pyx_n_s_ASCII_ALPHANUMERIC); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_ASCII_ALPHANUMERIC)) __PYX_ERR(0, 16, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_ASCII_DIGIT); + __Pyx_GIVEREF(__pyx_n_s_ASCII_DIGIT); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ASCII_DIGIT)) __PYX_ERR(0, 16, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_ASCII_HEX_DIGIT); + __Pyx_GIVEREF(__pyx_n_s_ASCII_HEX_DIGIT); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_ASCII_HEX_DIGIT)) __PYX_ERR(0, 16, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_ASCII_TAB_OR_NEWLINE); + __Pyx_GIVEREF(__pyx_n_s_ASCII_TAB_OR_NEWLINE); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_ASCII_TAB_OR_NEWLINE)) __PYX_ERR(0, 16, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_C0_CONTROL); + __Pyx_GIVEREF(__pyx_n_s_C0_CONTROL); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_C0_CONTROL)) __PYX_ERR(0, 16, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_C0_CONTROL_OR_SPACE); + __Pyx_GIVEREF(__pyx_n_s_C0_CONTROL_OR_SPACE); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_C0_CONTROL_OR_SPACE)) __PYX_ERR(0, 16, __pyx_L1_error); + + /* "w3lib/_url.pyx":15 + * _get_output_encoding, + * ) + * from ._infra import ( # <<<<<<<<<<<<<< + * _ASCII_ALPHA, + * _ASCII_ALPHANUMERIC, + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_infra, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHA, __pyx_t_3) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHANUMERIC, __pyx_t_3) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_HEX_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_OR_SPACE, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":24 + * _C0_CONTROL_OR_SPACE, + * ) + * from ._util import _PercentEncodeSet # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PercentEncodeSet); + __Pyx_GIVEREF(__pyx_n_s_PercentEncodeSet); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PercentEncodeSet)) __PYX_ERR(0, 24, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_util, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PercentEncodeSet, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":27 + * + * + * _ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { # <<<<<<<<<<<<<< + * ord(char): None for char in _ASCII_TAB_OR_NEWLINE + * } + */ + { /* enter inner scope */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":28 + * + * _ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { + * ord(char): None for char in _ASCII_TAB_OR_NEWLINE # <<<<<<<<<<<<<< + * } + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 28, __pyx_L4_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 28, __pyx_L4_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 28, __pyx_L4_error) + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 28, __pyx_L4_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 28, __pyx_L4_error) + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 28, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XGOTREF(__pyx_7genexpr__pyx_v_5w3lib_4_url_char); + __Pyx_DECREF_SET(__pyx_7genexpr__pyx_v_5w3lib_4_url_char, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __pyx_7genexpr__pyx_v_5w3lib_4_url_char; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_2); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 28, __pyx_L4_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_t_2, (PyObject*)Py_None))) __PYX_ERR(0, 28, __pyx_L4_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_7genexpr__pyx_v_5w3lib_4_url_char); + __Pyx_DECREF_SET(__pyx_7genexpr__pyx_v_5w3lib_4_url_char, Py_None); + goto __pyx_L8_exit_scope; + __pyx_L4_error:; + __Pyx_GOTREF(__pyx_7genexpr__pyx_v_5w3lib_4_url_char); + __Pyx_DECREF_SET(__pyx_7genexpr__pyx_v_5w3lib_4_url_char, Py_None); + goto __pyx_L1_error; + __pyx_L8_exit_scope:; + } /* exit inner scope */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO, __pyx_t_3) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":31 + * } + * + * SCHEME_START = 0 # <<<<<<<<<<<<<< + * SCHEME = 1 + * NO_SCHEME = 2 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME_START, __pyx_int_0) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + + /* "w3lib/_url.pyx":32 + * + * SCHEME_START = 0 + * SCHEME = 1 # <<<<<<<<<<<<<< + * NO_SCHEME = 2 + * SPECIAL_RELATIVE_OR_AUTHORITY = 3 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME, __pyx_int_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + + /* "w3lib/_url.pyx":33 + * SCHEME_START = 0 + * SCHEME = 1 + * NO_SCHEME = 2 # <<<<<<<<<<<<<< + * SPECIAL_RELATIVE_OR_AUTHORITY = 3 + * PATH_OR_AUTHORITY = 4 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_SCHEME, __pyx_int_2) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + + /* "w3lib/_url.pyx":34 + * SCHEME = 1 + * NO_SCHEME = 2 + * SPECIAL_RELATIVE_OR_AUTHORITY = 3 # <<<<<<<<<<<<<< + * PATH_OR_AUTHORITY = 4 + * RELATIVE = 5 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY, __pyx_int_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + + /* "w3lib/_url.pyx":35 + * NO_SCHEME = 2 + * SPECIAL_RELATIVE_OR_AUTHORITY = 3 + * PATH_OR_AUTHORITY = 4 # <<<<<<<<<<<<<< + * RELATIVE = 5 + * RELATIVE_SLASH = 6 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_OR_AUTHORITY, __pyx_int_4) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + + /* "w3lib/_url.pyx":36 + * SPECIAL_RELATIVE_OR_AUTHORITY = 3 + * PATH_OR_AUTHORITY = 4 + * RELATIVE = 5 # <<<<<<<<<<<<<< + * RELATIVE_SLASH = 6 + * SPECIAL_AUTHORITY_SLASHES = 7 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RELATIVE, __pyx_int_5) < 0) __PYX_ERR(0, 36, __pyx_L1_error) + + /* "w3lib/_url.pyx":37 + * PATH_OR_AUTHORITY = 4 + * RELATIVE = 5 + * RELATIVE_SLASH = 6 # <<<<<<<<<<<<<< + * SPECIAL_AUTHORITY_SLASHES = 7 + * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RELATIVE_SLASH, __pyx_int_6) < 0) __PYX_ERR(0, 37, __pyx_L1_error) + + /* "w3lib/_url.pyx":38 + * RELATIVE = 5 + * RELATIVE_SLASH = 6 + * SPECIAL_AUTHORITY_SLASHES = 7 # <<<<<<<<<<<<<< + * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 + * AUTHORITY = 9 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_AUTHORITY_SLASHES, __pyx_int_7) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + + /* "w3lib/_url.pyx":39 + * RELATIVE_SLASH = 6 + * SPECIAL_AUTHORITY_SLASHES = 7 + * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 # <<<<<<<<<<<<<< + * AUTHORITY = 9 + * HOST = 10 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES, __pyx_int_8) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + + /* "w3lib/_url.pyx":40 + * SPECIAL_AUTHORITY_SLASHES = 7 + * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 + * AUTHORITY = 9 # <<<<<<<<<<<<<< + * HOST = 10 + * PORT = 11 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_AUTHORITY, __pyx_int_9) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + + /* "w3lib/_url.pyx":41 + * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 + * AUTHORITY = 9 + * HOST = 10 # <<<<<<<<<<<<<< + * PORT = 11 + * FILE = 12 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_HOST, __pyx_int_10) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + + /* "w3lib/_url.pyx":42 + * AUTHORITY = 9 + * HOST = 10 + * PORT = 11 # <<<<<<<<<<<<<< + * FILE = 12 + * FILE_SLASH = 13 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PORT, __pyx_int_11) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + + /* "w3lib/_url.pyx":43 + * HOST = 10 + * PORT = 11 + * FILE = 12 # <<<<<<<<<<<<<< + * FILE_SLASH = 13 + * FILE_HOST = 14 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FILE, __pyx_int_12) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + + /* "w3lib/_url.pyx":44 + * PORT = 11 + * FILE = 12 + * FILE_SLASH = 13 # <<<<<<<<<<<<<< + * FILE_HOST = 14 + * PATH_START = 15 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FILE_SLASH, __pyx_int_13) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + + /* "w3lib/_url.pyx":45 + * FILE = 12 + * FILE_SLASH = 13 + * FILE_HOST = 14 # <<<<<<<<<<<<<< + * PATH_START = 15 + * PATH = 16 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FILE_HOST, __pyx_int_14) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + + /* "w3lib/_url.pyx":46 + * FILE_SLASH = 13 + * FILE_HOST = 14 + * PATH_START = 15 # <<<<<<<<<<<<<< + * PATH = 16 + * OPAQUE_PATH = 17 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_START, __pyx_int_15) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + + /* "w3lib/_url.pyx":47 + * FILE_HOST = 14 + * PATH_START = 15 + * PATH = 16 # <<<<<<<<<<<<<< + * OPAQUE_PATH = 17 + * QUERY = 18 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH, __pyx_int_16) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + + /* "w3lib/_url.pyx":48 + * PATH_START = 15 + * PATH = 16 + * OPAQUE_PATH = 17 # <<<<<<<<<<<<<< + * QUERY = 18 + * FRAGMENT = 19 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OPAQUE_PATH, __pyx_int_17) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + + /* "w3lib/_url.pyx":49 + * PATH = 16 + * OPAQUE_PATH = 17 + * QUERY = 18 # <<<<<<<<<<<<<< + * FRAGMENT = 19 + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY, __pyx_int_18) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + + /* "w3lib/_url.pyx":50 + * OPAQUE_PATH = 17 + * QUERY = 18 + * FRAGMENT = 19 # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT, __pyx_int_19) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + + /* "w3lib/_url.pyx":55 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#default-port + * _DEFAULT_PORTS = { + * "ftp": 21, # <<<<<<<<<<<<<< + * "file": None, + * "http": 80, + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_ftp, __pyx_int_21) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + + /* "w3lib/_url.pyx":56 + * _DEFAULT_PORTS = { + * "ftp": 21, + * "file": None, # <<<<<<<<<<<<<< + * "http": 80, + * "https": 443, + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_file, Py_None) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_http, __pyx_int_80) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_https, __pyx_int_443) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_ws, __pyx_int_80) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_wss, __pyx_int_443) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_PORTS, __pyx_t_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":62 + * "wss": 443, + * } + * _SPECIAL_SCHEMES = set(_DEFAULT_PORTS.keys()) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PySet_New(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_SCHEMES, __pyx_t_4) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":65 + * + * + * class _URL: # <<<<<<<<<<<<<< + * _scheme: str = "" + * username: str = "" + */ + __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_URL, __pyx_n_s_URL, (PyObject *) NULL, __pyx_n_s_w3lib__url, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_scheme, __pyx_n_s_str) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_username, __pyx_n_s_str) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_password, __pyx_n_s_str) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hostname, __pyx_kp_s_Union_int_List_int_str) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_port, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_path, __pyx_kp_s_Union_str_List_str) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_query, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fragment, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_password_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_port_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_default_port_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_path_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_annotations, __pyx_t_3) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":66 + * + * class _URL: + * _scheme: str = "" # <<<<<<<<<<<<<< + * username: str = "" + * password: str = "" + */ + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_scheme, __pyx_kp_u__2) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + + /* "w3lib/_url.pyx":67 + * class _URL: + * _scheme: str = "" + * username: str = "" # <<<<<<<<<<<<<< + * password: str = "" + * hostname: Union[int, List[int], str] = "" + */ + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_username, __pyx_kp_u__2) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + + /* "w3lib/_url.pyx":68 + * _scheme: str = "" + * username: str = "" + * password: str = "" # <<<<<<<<<<<<<< + * hostname: Union[int, List[int], str] = "" + * port: Optional[int] = None + */ + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_password, __pyx_kp_u__2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + + /* "w3lib/_url.pyx":69 + * username: str = "" + * password: str = "" + * hostname: Union[int, List[int], str] = "" # <<<<<<<<<<<<<< + * port: Optional[int] = None + * path: Union[str, List[str]] + */ + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + + /* "w3lib/_url.pyx":70 + * password: str = "" + * hostname: Union[int, List[int], str] = "" + * port: Optional[int] = None # <<<<<<<<<<<<<< + * path: Union[str, List[str]] + * query: Optional[str] = None + */ + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_port, Py_None) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + + /* "w3lib/_url.pyx":72 + * port: Optional[int] = None + * path: Union[str, List[str]] + * query: Optional[str] = None # <<<<<<<<<<<<<< + * fragment: Optional[str] = None + * + */ + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + + /* "w3lib/_url.pyx":73 + * path: Union[str, List[str]] + * query: Optional[str] = None + * fragment: Optional[str] = None # <<<<<<<<<<<<<< + * + * # Indicates whether a color (:) separating a username from a password + */ + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_fragment, Py_None) < 0) __PYX_ERR(0, 73, __pyx_L1_error) + + /* "w3lib/_url.pyx":78 + * # existed in the parsed URL. This enables :func:`_serialize_url` to + * # generate a URL that matches the input URL, if desired. + * _password_token_seen: bool = False # <<<<<<<<<<<<<< + * + * # Indicates, for an empty port component, whether or not a colon (:) + */ + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_password_token_seen, Py_False) < 0) __PYX_ERR(0, 78, __pyx_L1_error) + + /* "w3lib/_url.pyx":83 + * # character was used. This enables :func:`_serialize_url` to + * # generate a URL that matches the input URL, if desired. + * _port_token_seen: bool = False # <<<<<<<<<<<<<< + * + * # Indicates whether or not a default port was specified in the input URL. + */ + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_port_token_seen, Py_False) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + + /* "w3lib/_url.pyx":88 + * # This enables :func:`_serialize_url` to generate a URL that matches the + * # input URL, if desired. + * _default_port_seen: bool = False # <<<<<<<<<<<<<< + * + * # Indicates, for an empty path component, whether or not a slash (/) + */ + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_default_port_seen, Py_False) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + + /* "w3lib/_url.pyx":93 + * # character was used. This enables :func:`_serialize_url` to + * # generate a URL that matches the input URL, if desired. + * _path_token_seen: bool = False # <<<<<<<<<<<<<< + * + * def __init__(self) -> None: + */ + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_path_token_seen, Py_False) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + + /* "w3lib/_url.pyx":95 + * _path_token_seen: bool = False + * + * def __init__(self) -> None: # <<<<<<<<<<<<<< + * self.path = [] + * self.is_special = False + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_1__init__, 0, __pyx_n_s_URL___init, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":99 + * self.is_special = False + * + * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< + * return isinstance(self.path, str) + * + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_3has_opaque_path, 0, __pyx_n_s_URL_has_opaque_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_has_opaque_path, __pyx_t_3) < 0) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":102 + * return isinstance(self.path, str) + * + * @property # <<<<<<<<<<<<<< + * def scheme(self) -> str: + * return self._scheme + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_5scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":106 + * return self._scheme + * + * @scheme.setter # <<<<<<<<<<<<<< + * def scheme(self, value: str) -> None: + * self._scheme = value + */ + __pyx_t_2 = PyObject_GetItem(__pyx_t_4, __pyx_n_s_scheme_2); + if (unlikely(!__pyx_t_2)) { + PyErr_Clear(); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_scheme_2); + } + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_setter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_value, __pyx_n_s_str) < 0) __PYX_ERR(0, 106, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_7scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_9}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":65 + * + * + * class _URL: # <<<<<<<<<<<<<< + * _scheme: str = "" + * username: str = "" + */ + __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_URL, __pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_URL, __pyx_t_3) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":112 + * + * + * _SCHEME_CHARS = _ASCII_ALPHANUMERIC + "+-." # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__30); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME_CHARS, __pyx_t_3) < 0) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":116 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path + * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 116, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_1_shorten_path, 0, __pyx_n_s_shorten_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_shorten_path, __pyx_t_4) < 0) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":125 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode + * # Extended to handled cases where % is to be percent-encoded. + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_space_as_plus, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_space_as_plus, __pyx_n_s_bool) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_3_percent_encode_after_encoding, 0, __pyx_n_s_percent_encode_after_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_percent_encode_after_encoding, __pyx_t_8) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "w3lib/_url.pyx":160 + * + * + * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< + * _C0_CONTROL, + * greater_than="~", + */ + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + + /* "w3lib/_url.pyx":161 + * + * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( + * _C0_CONTROL, # <<<<<<<<<<<<<< + * greater_than="~", + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":160 + * + * + * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< + * _C0_CONTROL, + * greater_than="~", + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":162 + * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( + * _C0_CONTROL, + * greater_than="~", # <<<<<<<<<<<<<< + * ) + * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_greater_than, __pyx_kp_u__36) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + + /* "w3lib/_url.pyx":160 + * + * + * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< + * _C0_CONTROL, + * greater_than="~", + */ + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_t_9) < 0) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":164 + * greater_than="~", + * ) + * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' # <<<<<<<<<<<<<< + * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' + * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" + */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_kp_u__37); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_t_3) < 0) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":165 + * ) + * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' + * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' # <<<<<<<<<<<<<< + * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" + * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__38); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_t_9) < 0) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":166 + * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' + * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' + * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" # <<<<<<<<<<<<<< + * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" + * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" + */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_kp_u__39); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_t_3) < 0) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":167 + * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' + * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" + * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" # <<<<<<<<<<<<<< + * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__40); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_t_9) < 0) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":168 + * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" + * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" + * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" # <<<<<<<<<<<<<< + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point + */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_kp_u__41); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_t_3) < 0) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":171 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point + * _FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" # <<<<<<<<<<<<<< + * _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_kp_u__42) < 0) __PYX_ERR(0, 171, __pyx_L1_error) + + /* "w3lib/_url.pyx":172 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point + * _FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" + * _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__43); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_t_9) < 0) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":175 + * + * + * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< + * address = [0] * 8 + * piece_index = 0 + */ + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 175, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_5_parse_ipv6, 0, __pyx_n_s_parse_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":262 + * + * + * def _utf_8_percent_encode( # <<<<<<<<<<<<<< + * input: str, + * percent_encode_set: _PercentEncodeSet, + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 262, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 262, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_7_utf_8_percent_encode, 0, __pyx_n_s_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf_8_percent_encode, __pyx_t_9) < 0) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":274 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser + * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + */ + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 274, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_9_parse_opaque_host, 0, __pyx_n_s_parse_opaque_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_opaque_host, __pyx_t_4) < 0) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":282 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< + * if not input: + * raise ValueError + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 282, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Tuple_int_bool) < 0) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_11_parse_ipv4_number, 0, __pyx_n_s_parse_ipv4_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4_number, __pyx_t_9) < 0) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":302 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and parts[-1] == "": + */ + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 302, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_13_ends_in_number, 0, __pyx_n_s_ends_in_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ends_in_number, __pyx_t_4) < 0) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":319 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and not parts[-1]: + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 319, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_15_parse_ipv4, 0, __pyx_n_s_parse_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4, __pyx_t_9) < 0) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":342 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< + * result = _utr46._to_ascii( + * domain, + */ + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_be_strict, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domain, __pyx_n_s_str) < 0) __PYX_ERR(0, 342, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_be_strict, __pyx_n_s_bool) < 0) __PYX_ERR(0, 342, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_17_domain_to_ascii, 0, __pyx_n_s_domain_to_ascii, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_3, __pyx_t_9); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_domain_to_ascii, __pyx_t_3) < 0) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":361 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser + * def _parse_host( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_special, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 361, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_is_special, __pyx_n_s_bool) < 0) __PYX_ERR(0, 361, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_19_parse_host, 0, __pyx_n_s_parse_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_9, __pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_host, __pyx_t_9) < 0) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":383 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter + * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" + * + */ + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 383, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_21_is_windows_drive_letter, 0, __pyx_n_s_is_windows_drive_letter, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_windows_drive_letter, __pyx_t_4) < 0) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":388 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter + * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * input_length = len(input) + * return ( + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 388, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_23_starts_with_windows_drive_letter, 0, __pyx_n_s_starts_with_windows_drive_lette, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_starts_with_windows_drive_lette, __pyx_t_9) < 0) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":398 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment + * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * "..", + */ + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 398, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 398, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_25_is_double_dot_path_segment, 0, __pyx_n_s_is_double_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_double_dot_path_segment, __pyx_t_4) < 0) __PYX_ERR(0, 398, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":413 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment + * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * ".", + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_27_is_single_dot_path_segment, 0, __pyx_n_s_is_single_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_single_dot_path_segment, __pyx_t_9) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":424 + * # to be escaped, they are escaped in an idempotent way (i.e. if they are + * # already part of an escape sequence, they are not re-encoded). + * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * *, input: str, pointer: int, encode_set: _PercentEncodeSet + * ) -> str: + */ + __pyx_t_9 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 424, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_pointer, __pyx_n_s_int) < 0) __PYX_ERR(0, 424, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 424, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_29_idempotent_utf_8_percent_encode, 0, __pyx_n_s_idempotent_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_idempotent_utf_8_percent_encode, __pyx_t_4) < 0) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":439 + * + * + * def _parse_url( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, __pyx_n_s_str) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_31_parse_url, 0, __pyx_n_s_parse_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_9, sizeof(__pyx_defaults), 5)) __PYX_ERR(0, 439, __pyx_L1_error) + + /* "w3lib/_url.pyx":444 + * base_url: str = None, + * encoding: str = "utf-8", + * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, + * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_userinfo_percent_encode_set = __pyx_t_3; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":445 + * encoding: str = "utf-8", + * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, + * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, + * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_path_percent_encode_set = __pyx_t_3; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":446 + * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, + * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, + * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, + * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_query_percent_encode_set = __pyx_t_3; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":447 + * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, + * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, + * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, + * ) -> _URL: + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_special_query_percent_encode_set = __pyx_t_3; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":448 + * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, + * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, + * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * ) -> _URL: + * """Return a :class:`_URL` object built from *url*, *base_url* and + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_fragment_percent_encode_set = __pyx_t_3; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_9, __pyx_pf_5w3lib_4_url_44__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_url, __pyx_t_9) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":871 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 + * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< + * output = "" + * n = address + */ + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_address, __pyx_n_s_int) < 0) __PYX_ERR(0, 871, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 871, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_33_serialize_ipv4, 0, __pyx_n_s_serialize_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv4, __pyx_t_4) < 0) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":882 + * + * + * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< + * address: List[int], *, min_length: int = 2 + * ) -> Optional[int]: + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 882, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_min_length, __pyx_n_s_int) < 0) __PYX_ERR(0, 882, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index, 0, __pyx_n_s_get_ipv6_first_longest_0_piece, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_9, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 882, __pyx_L1_error) + + /* "w3lib/_url.pyx":883 + * + * def _get_ipv6_first_longest_0_piece_index( + * address: List[int], *, min_length: int = 2 # <<<<<<<<<<<<<< + * ) -> Optional[int]: + * index = None + */ + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_2))) __PYX_ERR(0, 883, __pyx_L1_error) + __Pyx_INCREF(__pyx_int_2); + __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_9)->__pyx_arg_min_length = ((PyObject*)__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_9, __pyx_pf_5w3lib_4_url_46__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_t_9) < 0) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":900 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer + * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< + * output = "" + * compress = _get_ipv6_first_longest_0_piece_index(address) + */ + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 900, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 900, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_37_serialize_ipv6, 0, __pyx_n_s_serialize_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 900, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 900, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":921 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer + * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< + * if isinstance(host, int): + * return _serialize_ipv4(host) + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 921, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_host, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 921, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 921, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_39_serialize_host, 0, __pyx_n_s_serialize_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 921, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_host, __pyx_t_9) < 0) __PYX_ERR(0, 921, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":930 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer + * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< + * if url.has_opaque_path(): + * assert isinstance(url.path, str) + */ + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 930, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 930, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_canonicalize, __pyx_n_s_bool) < 0) __PYX_ERR(0, 930, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 930, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_41_serialize_url_path, 0, __pyx_n_s_serialize_url_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_3, __pyx_t_9); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url_path, __pyx_t_3) < 0) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":943 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing + * def _serialize_url( # <<<<<<<<<<<<<< + * url: _URL, + * *, + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_exclude_fragment, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 943, __pyx_L1_error) + + /* "w3lib/_url.pyx":947 + * *, + * exclude_fragment: bool = False, + * canonicalize: Optional[bool] = None, # <<<<<<<<<<<<<< + * ) -> str: + * """Return a string representation of *url* following the URL serialization + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 943, __pyx_L1_error) + + /* "w3lib/_url.pyx":943 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing + * def _serialize_url( # <<<<<<<<<<<<<< + * url: _URL, + * *, + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 943, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_exclude_fragment, __pyx_n_s_bool) < 0) __PYX_ERR(0, 943, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_canonicalize, __pyx_kp_s_Optional_bool) < 0) __PYX_ERR(0, 943, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_43_serialize_url, 0, __pyx_n_s_serialize_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_9, __pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url, __pyx_t_9) < 0) __PYX_ERR(0, 943, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "w3lib/_url.pyx":1 + * #cython: language_level=3 # <<<<<<<<<<<<<< + * # pylint: disable=protected-access,too-many-instance-attributes,too-many-locals,too-many-nested-blocks,too-many-statements + * + */ + __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_9) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init w3lib._url", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init w3lib._url"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +#endif +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* TupleAndListFromArray */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + Py_INCREF(__pyx_empty_tuple); + return __pyx_empty_tuple; + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} +static CYTHON_INLINE PyObject * +__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return PyList_New(0); + } + res = PyList_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); + return res; +} +#endif + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* fastcall */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) +{ + Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + for (i = 0; i < n; i++) + { + if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + } + for (i = 0; i < n; i++) + { + int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + if (unlikely(eq != 0)) { + if (unlikely(eq < 0)) return NULL; + return kwvalues[i]; + } + } + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { + Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + PyObject *dict; + dict = PyDict_New(); + if (unlikely(!dict)) + return NULL; + for (i=0; i= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); + while (1) { + Py_XDECREF(key); key = NULL; + Py_XDECREF(value); value = NULL; + if (kwds_is_tuple) { + Py_ssize_t size; +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(kwds); +#else + size = PyTuple_Size(kwds); + if (size < 0) goto bad; +#endif + if (pos >= size) break; +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); + if (!key) goto bad; +#elif CYTHON_ASSUME_SAFE_MACROS + key = PyTuple_GET_ITEM(kwds, pos); +#else + key = PyTuple_GetItem(kwds, pos); + if (!key) goto bad; +#endif + value = kwvalues[pos]; + pos++; + } + else + { + if (!PyDict_Next(kwds, &pos, &key, &value)) break; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + } + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(value); + Py_DECREF(key); +#endif + key = NULL; + value = NULL; + continue; + } +#if !CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + Py_INCREF(value); + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = ( + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key) + ); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + Py_XDECREF(key); + Py_XDECREF(value); + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + #if PY_MAJOR_VERSION < 3 + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + Py_XDECREF(key); + Py_XDECREF(value); + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* RaiseUnexpectedTypeError */ +static int +__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) +{ + __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, + expected, obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + type_name = __Pyx_PyType_GetName(type); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (unlikely(!j)) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (mm && mm->mp_subscript) { + PyObject *r, *key = PyInt_FromSsize_t(i); + if (unlikely(!key)) return NULL; + r = mm->mp_subscript(o, key); + Py_DECREF(key); + return r; + } + if (likely(sm && sm->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return sm->sq_item(o, i); + } + } +#else + if (is_list || !PyMapping_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { + return NULL; + } + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { + return NULL; + } + #endif + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectFastCall */ +#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result = 0; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: + Py_DECREF(argstuple); + return result; +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); + } + else if (nargs == 1 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); + } +#endif + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); + } + } + #if PY_VERSION_HEX >= 0x030700A1 + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + if (kwargs == NULL) { + #if CYTHON_VECTORCALL + #if PY_VERSION_HEX < 0x03090000 + vectorcallfunc f = _PyVectorcall_Function(func); + #else + vectorcallfunc f = PyVectorcall_Function(func); + #endif + if (f) { + return f(func, args, (size_t)nargs, NULL); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, NULL); + } + #endif + } + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + } + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif +} + +/* SliceObject */ +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) { + __Pyx_TypeName obj_type_name; +#if CYTHON_USE_TYPE_SLOTS + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + goto bad; + PyErr_Clear(); + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#else + CYTHON_UNUSED_VAR(wraparound); +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#else + CYTHON_UNUSED_VAR(wraparound); +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_USE_TYPE_SLOTS + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); +bad: + return NULL; +} + +/* RaiseKeywordRequired */ +static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name) { + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() needs keyword-only argument %U", func_name, kw_name); + #else + "%s() needs keyword-only argument %s", func_name, + PyString_AS_STRING(kw_name)); + #endif +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { + PyObject* exc_type; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + exc_type = __Pyx_PyErr_CurrentExceptionType(); + if (unlikely(exc_type)) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) + return -1; + __Pyx_PyErr_Clear(); + return 0; + } + return 0; +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } + return __Pyx_IterFinish(); +} + +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { + PyObject *runerr = NULL; + Py_ssize_t key_value; + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, + "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); + __Pyx_DECREF_TypeName(index_type_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { + __Pyx_TypeName obj_type_name; + if (likely(PyType_Check(obj))) { + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); + if (!meth) { + PyErr_Clear(); + } else { + PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); + Py_DECREF(meth); + return result; + } + } + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { + PyTypeObject *tp = Py_TYPE(obj); + PyMappingMethods *mm = tp->tp_as_mapping; + PySequenceMethods *sm = tp->tp_as_sequence; + if (likely(mm && mm->mp_subscript)) { + return mm->mp_subscript(obj, key); + } + if (likely(sm && sm->sq_item)) { + return __Pyx_PyObject_GetIndex(obj, key); + } + return __Pyx_PyObject_GetItem_Slow(obj, key); +} +#endif + +/* PyIntCompare */ +static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_UNUSED_VAR(inplace); + if (op1 == op2) { + return 1; + } + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + return (a == b); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + if (intval == 0) { + return (__Pyx_PyLong_IsZero(op1) == 1); + } else if (intval < 0) { + if (__Pyx_PyLong_IsNonNeg(op1)) + return 0; + intval = -intval; + } else { + if (__Pyx_PyLong_IsNeg(op1)) + return 0; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + return (unequal == 0); + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + return ((double)a == (double)b); + } + return __Pyx_PyObject_IsTrueAndDecref( + PyObject_RichCompare(op1, op2, Py_EQ)); +} + +/* PyIntBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_MAYBE_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + + x = (long)((unsigned long)a + (unsigned long)b); + if (likely((x^a) >= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + return __Pyx_NewRef(op2); + } + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } else { + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + double result; + + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* PyObjectFormat */ +#if CYTHON_USE_UNICODE_WRITER +static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) { + int ret; + _PyUnicodeWriter writer; + if (likely(PyFloat_CheckExact(obj))) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000 + _PyUnicodeWriter_Init(&writer, 0); +#else + _PyUnicodeWriter_Init(&writer); +#endif + ret = _PyFloat_FormatAdvancedWriter( + &writer, + obj, + format_spec, 0, PyUnicode_GET_LENGTH(format_spec)); + } else if (likely(PyLong_CheckExact(obj))) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000 + _PyUnicodeWriter_Init(&writer, 0); +#else + _PyUnicodeWriter_Init(&writer); +#endif + ret = _PyLong_FormatAdvancedWriter( + &writer, + obj, + format_spec, 0, PyUnicode_GET_LENGTH(format_spec)); + } else { + return PyObject_Format(obj, format_spec); + } + if (unlikely(ret == -1)) { + _PyUnicodeWriter_Dealloc(&writer); + return NULL; + } + return _PyUnicodeWriter_Finish(&writer); +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + __Pyx_PyThreadState_declare + CYTHON_UNUSED_VAR(cause); + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + #if PY_VERSION_HEX >= 0x030C00A6 + PyException_SetTraceback(value, tb); + #elif CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyIntBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_MAYBE_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + +#ifdef HAVE_LONG_LONG + if (sizeof(PY_LONG_LONG) > sizeof(long)) { + PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b; + return (result >= LONG_MIN && result <= LONG_MAX) ? + PyInt_FromLong((long)result) : PyLong_FromLongLong(result); + } +#endif +#if CYTHON_USE_TYPE_SLOTS + return PyInt_Type.tp_as_number->nb_multiply(op1, op2); +#else + return PyNumber_Multiply(op1, op2); +#endif + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + return __Pyx_NewRef(op1); + } + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } else { + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2); + } + } + CYTHON_UNUSED_VAR(a); + CYTHON_UNUSED_VAR(b); + #ifdef HAVE_LONG_LONG + lla = a; + goto long_long; + #else + return PyLong_Type.tp_as_number->nb_multiply(op1, op2); + #endif + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla * llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + double result; + + PyFPE_START_PROTECT("multiply", return NULL) + result = ((double)a) * (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); +} +#endif + +/* PyIntCompare */ +static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_UNUSED_VAR(inplace); + if (op1 == op2) { + return 0; + } + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + return (a != b); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + if (intval == 0) { + return (__Pyx_PyLong_IsZero(op1) != 1); + } else if (intval < 0) { + if (__Pyx_PyLong_IsNonNeg(op1)) + return 1; + intval = -intval; + } else { + if (__Pyx_PyLong_IsNeg(op1)) + return 1; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + return (unequal != 0); + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + return ((double)a != (double)b); + } + return __Pyx_PyObject_IsTrueAndDecref( + PyObject_RichCompare(op1, op2, Py_NE)); +} + +/* PyIntBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_MAYBE_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + + x = (long)((unsigned long)a - (unsigned long)b); + if (likely((x^a) >= 0 || (x^~b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + return PyLong_FromLong(-intval); + } + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } else { + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + } + } + x = a - b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla - llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + double result; + + PyFPE_START_PROTECT("subtract", return NULL) + result = ((double)a) - (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); +} +#endif + +/* unicode_iter */ +static CYTHON_INLINE int __Pyx_init_unicode_iteration( + PyObject* ustring, Py_ssize_t *length, void** data, int *kind) { +#if CYTHON_COMPILING_IN_LIMITED_API + *kind = 0; + *length = PyUnicode_GetLength(ustring); + *data = (void*)ustring; +#elif CYTHON_PEP393_ENABLED + if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return -1; + *kind = PyUnicode_KIND(ustring); + *length = PyUnicode_GET_LENGTH(ustring); + *data = PyUnicode_DATA(ustring); +#else + *kind = 0; + *length = PyUnicode_GET_SIZE(ustring); + *data = (void*)PyUnicode_AS_UNICODE(ustring); +#endif + return 0; +} + +/* PyUnicode_Substring */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring( + PyObject* text, Py_ssize_t start, Py_ssize_t stop) { + Py_ssize_t length; + if (unlikely(__Pyx_PyUnicode_READY(text) == -1)) return NULL; + length = __Pyx_PyUnicode_GET_LENGTH(text); + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + else if (stop > length) + stop = length; + if (stop <= start) + return __Pyx_NewRef(__pyx_empty_unicode); + if (start == 0 && stop == length) + return __Pyx_NewRef(text); +#if CYTHON_PEP393_ENABLED + return PyUnicode_FromKindAndData(PyUnicode_KIND(text), + PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start); +#else + return PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(text)+start, stop-start); +#endif +} + +/* GetItemIntUnicode */ +static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i, + int wraparound, int boundscheck) { + Py_ssize_t length; + if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return (Py_UCS4)-1; + if (wraparound | boundscheck) { + length = __Pyx_PyUnicode_GET_LENGTH(ustring); + if (wraparound & unlikely(i < 0)) i += length; + if ((!boundscheck) || likely(__Pyx_is_valid_index(i, length))) { + return __Pyx_PyUnicode_READ_CHAR(ustring, i); + } else { + PyErr_SetString(PyExc_IndexError, "string index out of range"); + return (Py_UCS4)-1; + } + } else { + return __Pyx_PyUnicode_READ_CHAR(ustring, i); + } +} + +/* RaiseUnboundLocalError */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type = NULL, *local_value, *local_tb = NULL; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030C00A6 + local_value = tstate->current_exception; + tstate->current_exception = 0; + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } + #else + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + #endif +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 + if (unlikely(tstate->current_exception)) +#elif CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + #if PY_VERSION_HEX >= 0x030B00a4 + tmp_value = exc_info->exc_value; + exc_info->exc_value = local_value; + tmp_type = NULL; + tmp_tb = NULL; + Py_XDECREF(local_type); + Py_XDECREF(local_tb); + #else + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + #endif + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* pep479 */ +static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { + PyObject *exc, *val, *tb, *cur_exc; + __Pyx_PyThreadState_declare + #ifdef __Pyx_StopAsyncIteration_USED + int is_async_stopiteration = 0; + #endif + CYTHON_MAYBE_UNUSED_VAR(in_async_gen); + cur_exc = PyErr_Occurred(); + if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { + #ifdef __Pyx_StopAsyncIteration_USED + if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { + is_async_stopiteration = 1; + } else + #endif + return; + } + __Pyx_PyThreadState_assign + __Pyx_GetException(&exc, &val, &tb); + Py_XDECREF(exc); + Py_XDECREF(val); + Py_XDECREF(tb); + PyErr_SetString(PyExc_RuntimeError, + #ifdef __Pyx_StopAsyncIteration_USED + is_async_stopiteration ? "async generator raised StopAsyncIteration" : + in_async_gen ? "async generator raised StopIteration" : + #endif + "generator raised StopIteration"); +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + PyObject *exc_value = exc_info->exc_value; + if (exc_value == NULL || exc_value == Py_None) { + *value = NULL; + *type = NULL; + *tb = NULL; + } else { + *value = exc_value; + Py_INCREF(*value); + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + *tb = PyException_GetTraceback(exc_value); + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #endif +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + PyObject *tmp_value = exc_info->exc_value; + exc_info->exc_value = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); + #else + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); + #endif +} +#endif + +/* SliceTupleAndList */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) { + Py_ssize_t start = *_start, stop = *_stop, length = *_length; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + else if (stop > length) + stop = length; + *_length = stop - start; + *_start = start; + *_stop = stop; +} +static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( + PyObject* src, Py_ssize_t start, Py_ssize_t stop) { + Py_ssize_t length = PyList_GET_SIZE(src); + __Pyx_crop_slice(&start, &stop, &length); + if (length <= 0) { + return PyList_New(0); + } + return __Pyx_PyList_FromArray(((PyListObject*)src)->ob_item + start, length); +} +static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( + PyObject* src, Py_ssize_t start, Py_ssize_t stop) { + Py_ssize_t length = PyTuple_GET_SIZE(src); + __Pyx_crop_slice(&start, &stop, &length); + return __Pyx_PyTuple_FromArray(((PyTupleObject*)src)->ob_item + start, length); +} +#endif + +/* PyIntBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_MAYBE_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op2))) { + const long a = intval; + long x; + long b = PyInt_AS_LONG(op2); + + x = (long)((unsigned long)a - (unsigned long)b); + if (likely((x^a) >= 0 || (x^~b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op2))) { + const long a = intval; + long b, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG lla = intval; + PY_LONG_LONG llb, llx; +#endif + if (unlikely(__Pyx_PyLong_IsZero(op2))) { + return __Pyx_NewRef(op1); + } + if (likely(__Pyx_PyLong_IsCompact(op2))) { + b = __Pyx_PyLong_CompactValue(op2); + } else { + const digit* digits = __Pyx_PyLong_Digits(op2); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2); + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + } + } + x = a - b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla - llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op2)) { + const long a = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double b = __pyx_PyFloat_AsDouble(op2); +#else + double b = PyFloat_AS_DOUBLE(op2); +#endif + double result; + + PyFPE_START_PROTECT("subtract", return NULL) + result = ((double)a) - (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); +} +#endif + +/* PyObjectFormatAndDecref */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { + if (unlikely(!s)) return NULL; + if (likely(PyUnicode_CheckExact(s))) return s; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(s))) { + PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); + Py_DECREF(s); + return result; + } + #endif + return __Pyx_PyObject_FormatAndDecref(s, f); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { + PyObject *result; + if (unlikely(!s)) return NULL; + result = PyObject_Format(s, f); + Py_DECREF(s); + return result; +} + +/* JoinPyUnicode */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char) { +#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyObject *result_uval; + int result_ukind, kind_shift; + Py_ssize_t i, char_pos; + void *result_udata; + CYTHON_MAYBE_UNUSED_VAR(max_char); +#if CYTHON_PEP393_ENABLED + result_uval = PyUnicode_New(result_ulength, max_char); + if (unlikely(!result_uval)) return NULL; + result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; + kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; + result_udata = PyUnicode_DATA(result_uval); +#else + result_uval = PyUnicode_FromUnicode(NULL, result_ulength); + if (unlikely(!result_uval)) return NULL; + result_ukind = sizeof(Py_UNICODE); + kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; + result_udata = PyUnicode_AS_UNICODE(result_uval); +#endif + assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + char_pos = 0; + for (i=0; i < value_count; i++) { + int ukind; + Py_ssize_t ulength; + void *udata; + PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); + if (unlikely(__Pyx_PyUnicode_READY(uval))) + goto bad; + ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + if (unlikely(!ulength)) + continue; + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) + goto overflow; + ukind = __Pyx_PyUnicode_KIND(uval); + udata = __Pyx_PyUnicode_DATA(uval); + if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); + } else { + #if PY_VERSION_HEX >= 0x030d0000 + if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; + #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); + #else + Py_ssize_t j; + for (j=0; j < ulength; j++) { + Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); + __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); + } + #endif + } + char_pos += ulength; + } + return result_uval; +overflow: + PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); +bad: + Py_DECREF(result_uval); + return NULL; +#else + CYTHON_UNUSED_VAR(max_char); + CYTHON_UNUSED_VAR(result_ulength); + CYTHON_UNUSED_VAR(value_count); + return PyUnicode_Join(__pyx_empty_unicode, value_tuple); +#endif +} + +/* unicode_tailmatch */ +static int __Pyx_PyUnicode_TailmatchTuple(PyObject* s, PyObject* substrings, + Py_ssize_t start, Py_ssize_t end, int direction) { + Py_ssize_t i, count = PyTuple_GET_SIZE(substrings); + for (i = 0; i < count; i++) { + Py_ssize_t result; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + result = PyUnicode_Tailmatch(s, PyTuple_GET_ITEM(substrings, i), + start, end, direction); +#else + PyObject* sub = PySequence_ITEM(substrings, i); + if (unlikely(!sub)) return -1; + result = PyUnicode_Tailmatch(s, sub, start, end, direction); + Py_DECREF(sub); +#endif + if (result) { + return (int) result; + } + } + return 0; +} +static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr, + Py_ssize_t start, Py_ssize_t end, int direction) { + if (unlikely(PyTuple_Check(substr))) { + return __Pyx_PyUnicode_TailmatchTuple(s, substr, start, end, direction); + } + return (int) PyUnicode_Tailmatch(s, substr, start, end, direction); +} + +/* UnpackUnboundCMethod */ +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), + METH_VARARGS | METH_KEYWORDS, + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #else + if (likely(!__Pyx_CyOrPyCFunction_Check(method))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY +#else + if (PyCFunction_Check(method)) +#endif + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); + } +#else + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + target->method = unbound_method; + } + } + return 0; +} + +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + if (likely(cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return (*(cfunc->func))(self, arg); + } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { + #if PY_VERSION_HEX >= 0x030700A0 + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + #else + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + #endif + } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } + return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(2, self, arg); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* PyObjectCall2Args */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args[3] = {NULL, arg1, arg2}; + return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + __Pyx_TypeName type_name; + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR + if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) +#elif PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (likely(descr != NULL)) { + *method = descr; + return 0; + } + type_name = __Pyx_PyType_GetName(tp); + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", + type_name, name); +#else + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", + type_name, PyString_AS_STRING(name)); +#endif + __Pyx_DECREF_TypeName(type_name); + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod1 */ +#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +#endif +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { +#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 + PyObject *args[2] = {obj, arg}; + (void) __Pyx_PyObject_GetMethod; + (void) __Pyx_PyObject_CallOneArg; + (void) __Pyx_PyObject_Call2Args; + return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#else + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +#endif +} + +/* append */ +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; +} + +/* PyIntBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_MAYBE_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + + x = a % b; + x += ((x != 0) & ((x ^ b) < 0)) * b; + return PyInt_FromLong(x); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + return __Pyx_NewRef(op1); + } + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } else { + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2); + } + } + x = a % b; + x += ((x != 0) & ((x ^ b) < 0)) * b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla % llb; + llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2); +} +#endif + +/* PyIntBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_MAYBE_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + + if (8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) { + return PyFloat_FromDouble((double)a / (double)b); + } + return PyInt_Type.tp_as_number->nb_true_divide(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + } + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } else { + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2); + } + } + if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) + || __Pyx_PyLong_DigitCount(op1) <= 52 / PyLong_SHIFT) { + return PyFloat_FromDouble((double)a / (double)b); + } + return PyLong_Type.tp_as_number->nb_true_divide(op1, op2); + return PyLong_FromLong(x); + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + double result; + + PyFPE_START_PROTECT("divide", return NULL) + result = ((double)a) / (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2); +} +#endif + +/* UnicodeConcatInPlace */ +# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +static int +__Pyx_unicode_modifiable(PyObject *unicode) +{ + if (Py_REFCNT(unicode) != 1) + return 0; + if (!PyUnicode_CheckExact(unicode)) + return 0; + if (PyUnicode_CHECK_INTERNED(unicode)) + return 0; + return 1; +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right + #if CYTHON_REFNANNY + , void* __pyx_refnanny + #endif + ) { + PyObject *left = *p_left; + Py_ssize_t left_len, right_len, new_len; + if (unlikely(__Pyx_PyUnicode_READY(left) == -1)) + return NULL; + if (unlikely(__Pyx_PyUnicode_READY(right) == -1)) + return NULL; + left_len = PyUnicode_GET_LENGTH(left); + if (left_len == 0) { + Py_INCREF(right); + return right; + } + right_len = PyUnicode_GET_LENGTH(right); + if (right_len == 0) { + Py_INCREF(left); + return left; + } + if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) { + PyErr_SetString(PyExc_OverflowError, + "strings are too large to concat"); + return NULL; + } + new_len = left_len + right_len; + if (__Pyx_unicode_modifiable(left) + && PyUnicode_CheckExact(right) + && PyUnicode_KIND(right) <= PyUnicode_KIND(left) + && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) { + int ret; + __Pyx_GIVEREF(*p_left); + ret = PyUnicode_Resize(p_left, new_len); + __Pyx_GOTREF(*p_left); + if (unlikely(ret != 0)) + return NULL; + #if PY_VERSION_HEX >= 0x030d0000 + if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL; + #else + _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len); + #endif + __Pyx_INCREF(*p_left); + __Pyx_GIVEREF(*p_left); + return *p_left; + } else { + return __Pyx_PyUnicode_Concat(left, right); + } + } +#endif + +/* FixUpExtensionType */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { +#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + CYTHON_UNUSED_VAR(spec); + CYTHON_UNUSED_VAR(type); +#else + const PyType_Slot *slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_members) + slot++; + if (slot && slot->slot == Py_tp_members) { + int changed = 0; +#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) + const +#endif + PyMemberDef *memb = (PyMemberDef*) slot->pfunc; + while (memb && memb->name) { + if (memb->name[0] == '_' && memb->name[1] == '_') { +#if PY_VERSION_HEX < 0x030900b1 + if (strcmp(memb->name, "__weaklistoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_weaklistoffset = memb->offset; + changed = 1; + } + else if (strcmp(memb->name, "__dictoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_dictoffset = memb->offset; + changed = 1; + } +#if CYTHON_METH_FASTCALL + else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); +#if PY_VERSION_HEX >= 0x030800b4 + type->tp_vectorcall_offset = memb->offset; +#else + type->tp_print = (printfunc) memb->offset; +#endif + changed = 1; + } +#endif +#else + if ((0)); +#endif +#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON + else if (strcmp(memb->name, "__module__") == 0) { + PyObject *descr; + assert(memb->type == T_OBJECT); + assert(memb->flags == 0 || memb->flags == READONLY); + descr = PyDescr_NewMember(type, memb); + if (unlikely(!descr)) + return -1; + if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { + Py_DECREF(descr); + return -1; + } + Py_DECREF(descr); + changed = 1; + } +#endif + } + memb++; + } + if (changed) + PyType_Modified(type); + } +#endif + return 0; +} +#endif + +/* PyObjectCallNoArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { + PyObject *arg[2] = {NULL, NULL}; + return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* ValidateBasesTuple */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { + Py_ssize_t i, n; +#if CYTHON_ASSUME_SAFE_MACROS + n = PyTuple_GET_SIZE(bases); +#else + n = PyTuple_Size(bases); + if (n < 0) return -1; +#endif + for (i = 1; i < n; i++) + { +#if CYTHON_AVOID_BORROWED_REFS + PyObject *b0 = PySequence_GetItem(bases, i); + if (!b0) return -1; +#elif CYTHON_ASSUME_SAFE_MACROS + PyObject *b0 = PyTuple_GET_ITEM(bases, i); +#else + PyObject *b0 = PyTuple_GetItem(bases, i); + if (!b0) return -1; +#endif + PyTypeObject *b; +#if PY_MAJOR_VERSION < 3 + if (PyClass_Check(b0)) + { + PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", + PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } +#endif + b = (PyTypeObject*) b0; + if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); + __Pyx_DECREF_TypeName(b_name); +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } + if (dictoffset == 0) + { + Py_ssize_t b_dictoffset = 0; +#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + b_dictoffset = b->tp_dictoffset; +#else + PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); + if (!py_b_dictoffset) goto dictoffset_return; + b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); + Py_DECREF(py_b_dictoffset); + if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; +#endif + if (b_dictoffset) { + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "extension type '%.200s' has no __dict__ slot, " + "but base type '" __Pyx_FMT_TYPENAME "' has: " + "either add 'cdef dict __dict__' to the extension type " + "or add '__slots__ = [...]' to the base type", + type_name, b_name); + __Pyx_DECREF_TypeName(b_name); + } +#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) + dictoffset_return: +#endif +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } + } +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + } + return 0; +} +#endif + +/* PyType_Ready */ +static int __Pyx_PyType_Ready(PyTypeObject *t) { +#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) + (void)__Pyx_PyObject_CallMethod0; +#if CYTHON_USE_TYPE_SPECS + (void)__Pyx_validate_bases_tuple; +#endif + return PyType_Ready(t); +#else + int r; + PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); + if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) + return -1; +#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) + { + int gc_was_enabled; + #if PY_VERSION_HEX >= 0x030A00b1 + gc_was_enabled = PyGC_Disable(); + (void)__Pyx_PyObject_CallMethod0; + #else + PyObject *ret, *py_status; + PyObject *gc = NULL; + #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) + gc = PyImport_GetModule(__pyx_kp_u_gc); + #endif + if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) return -1; + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + if (unlikely(!py_status)) { + Py_DECREF(gc); + return -1; + } + gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); + Py_DECREF(py_status); + if (gc_was_enabled > 0) { + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + if (unlikely(!ret)) { + Py_DECREF(gc); + return -1; + } + Py_DECREF(ret); + } else if (unlikely(gc_was_enabled == -1)) { + Py_DECREF(gc); + return -1; + } + #endif + t->tp_flags |= Py_TPFLAGS_HEAPTYPE; +#if PY_VERSION_HEX >= 0x030A0000 + t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; +#endif +#else + (void)__Pyx_PyObject_CallMethod0; +#endif + r = PyType_Ready(t); +#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) + t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; + #if PY_VERSION_HEX >= 0x030A00b1 + if (gc_was_enabled) + PyGC_Enable(); + #else + if (gc_was_enabled) { + PyObject *tp, *v, *tb; + PyErr_Fetch(&tp, &v, &tb); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + if (likely(ret || r == -1)) { + Py_XDECREF(ret); + PyErr_Restore(tp, v, tb); + } else { + Py_XDECREF(tp); + Py_XDECREF(v); + Py_XDECREF(tb); + r = -1; + } + } + Py_DECREF(gc); + #endif + } +#endif + return r; +#endif +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", + type_name, attr_name); +#else + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", + type_name, PyString_AS_STRING(attr_name)); +#endif + __Pyx_DECREF_TypeName(type_name); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + const char* module_name_str = 0; + PyObject* module_name = 0; + PyObject* module_dot = 0; + PyObject* full_name = 0; + PyErr_Clear(); + module_name_str = PyModule_GetName(module); + if (unlikely(!module_name_str)) { goto modbad; } + module_name = PyUnicode_FromString(module_name_str); + if (unlikely(!module_name)) { goto modbad; } + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__6); + if (unlikely(!module_dot)) { goto modbad; } + full_name = PyUnicode_Concat(module_dot, name); + if (unlikely(!full_name)) { goto modbad; } + #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + { + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + goto modbad; + value = PyObject_GetItem(modules, full_name); + } + #else + value = PyImport_GetModule(full_name); + #endif + modbad: + Py_XDECREF(full_name); + Py_XDECREF(module_dot); + Py_XDECREF(module_name); + } + if (unlikely(!value)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* UnicodeAsUCS4 */ +static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { + Py_ssize_t length; + #if CYTHON_PEP393_ENABLED + length = PyUnicode_GET_LENGTH(x); + if (likely(length == 1)) { + return PyUnicode_READ_CHAR(x, 0); + } + #else + length = PyUnicode_GET_SIZE(x); + if (likely(length == 1)) { + return PyUnicode_AS_UNICODE(x)[0]; + } + #if Py_UNICODE_SIZE == 2 + else if (PyUnicode_GET_SIZE(x) == 2) { + Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0]; + if (high_val >= 0xD800 && high_val <= 0xDBFF) { + Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1]; + if (low_val >= 0xDC00 && low_val <= 0xDFFF) { + return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1))); + } + } + } + #endif + #endif + PyErr_Format(PyExc_ValueError, + "only single character unicode strings can be converted to Py_UCS4, " + "got length %" CYTHON_FORMAT_SSIZE_T "d", length); + return (Py_UCS4)-1; +} + +/* object_ord */ +static long __Pyx__PyObject_Ord(PyObject* c) { + Py_ssize_t size; + if (PyBytes_Check(c)) { + size = PyBytes_GET_SIZE(c); + if (likely(size == 1)) { + return (unsigned char) PyBytes_AS_STRING(c)[0]; + } +#if PY_MAJOR_VERSION < 3 + } else if (PyUnicode_Check(c)) { + return (long)__Pyx_PyUnicode_AsPy_UCS4(c); +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + } else if (PyByteArray_Check(c)) { + size = PyByteArray_GET_SIZE(c); + if (likely(size == 1)) { + return (unsigned char) PyByteArray_AS_STRING(c)[0]; + } +#endif + } else { + __Pyx_TypeName c_type_name = __Pyx_PyType_GetName(Py_TYPE(c)); + PyErr_Format(PyExc_TypeError, + "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found", + c_type_name); + __Pyx_DECREF_TypeName(c_type_name); + return (long)(Py_UCS4)-1; + } + PyErr_Format(PyExc_TypeError, + "ord() expected a character, but string of length %zd found", size); + return (long)(Py_UCS4)-1; +} + +/* FetchSharedCythonModule */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); +} + +/* FetchCommonType */ +static int __Pyx_VerifyCachedType(PyObject *cached_type, + const char *name, + Py_ssize_t basicsize, + Py_ssize_t expected_basicsize) { + if (!PyType_Check(cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", name); + return -1; + } + if (basicsize != expected_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + name); + return -1; + } + return 0; +} +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* abi_module; + const char* object_name; + PyTypeObject *cached_type = NULL; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + object_name = strrchr(type->tp_name, '.'); + object_name = object_name ? object_name+1 : type->tp_name; + cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + if (__Pyx_VerifyCachedType( + (PyObject *)cached_type, + object_name, + cached_type->tp_basicsize, + type->tp_basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; +done: + Py_DECREF(abi_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#else +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { + PyObject *abi_module, *cached_type = NULL; + const char* object_name = strrchr(spec->name, '.'); + object_name = object_name ? object_name+1 : spec->name; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + cached_type = PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + Py_ssize_t basicsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; +#else + basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; +#endif + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + basicsize, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + CYTHON_UNUSED_VAR(module); + cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + if (unlikely(!cached_type)) goto bad; + if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; +done: + Py_DECREF(abi_module); + assert(cached_type == NULL || PyType_Check(cached_type)); + return (PyTypeObject *) cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#endif + +/* PyVectorcallFastCallDict */ +#if CYTHON_METH_FASTCALL +static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + PyObject *res = NULL; + PyObject *kwnames; + PyObject **newargs; + PyObject **kwvalues; + Py_ssize_t i, pos; + size_t j; + PyObject *key, *value; + unsigned long keys_are_strings; + Py_ssize_t nkw = PyDict_GET_SIZE(kw); + newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); + if (unlikely(newargs == NULL)) { + PyErr_NoMemory(); + return NULL; + } + for (j = 0; j < nargs; j++) newargs[j] = args[j]; + kwnames = PyTuple_New(nkw); + if (unlikely(kwnames == NULL)) { + PyMem_Free(newargs); + return NULL; + } + kwvalues = newargs + nargs; + pos = i = 0; + keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; + while (PyDict_Next(kw, &pos, &key, &value)) { + keys_are_strings &= Py_TYPE(key)->tp_flags; + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(kwnames, i, key); + kwvalues[i] = value; + i++; + } + if (unlikely(!keys_are_strings)) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + goto cleanup; + } + res = vc(func, newargs, nargs, kwnames); +cleanup: + Py_DECREF(kwnames); + for (i = 0; i < nkw; i++) + Py_DECREF(kwvalues[i]); + PyMem_Free(newargs); + return res; +} +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + return vc(func, args, nargs, NULL); + } + return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); +} +#endif + +/* CythonFunctionShared */ +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if (__Pyx_CyFunction_Check(func)) { + return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; + } else if (PyCFunction_Check(func)) { + return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; + } + return 0; +} +#else +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +} +#endif +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + __Pyx_Py_XDECREF_SET( + __Pyx_CyFunction_GetClassObj(f), + ((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#else + __Pyx_Py_XDECREF_SET( + ((PyCMethodObject *) (f))->mm_class, + (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#endif +} +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +{ + CYTHON_UNUSED_VAR(closure); + if (unlikely(op->func_doc == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); + if (unlikely(!op->func_doc)) return NULL; +#else + if (((PyCFunctionObject*)op)->m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } +#endif + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_doc, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_name == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_name = PyObject_GetAttrString(op->func, "__name__"); +#elif PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_name, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_qualname, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_dict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(op); + CYTHON_UNUSED_VAR(context); + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + CYTHON_UNUSED_VAR(context); + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_tuple; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_kwdict; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value || value == Py_None) { + value = NULL; + } else if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + __Pyx_Py_XDECREF_SET(op->func_annotations, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->func_annotations; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + int is_coroutine; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; +#if PY_VERSION_HEX >= 0x03050000 + if (is_coroutine) { + PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + fromlist = PyList_New(1); + if (unlikely(!fromlist)) return NULL; + Py_INCREF(marker); +#if CYTHON_ASSUME_SAFE_MACROS + PyList_SET_ITEM(fromlist, 0, marker); +#else + if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { + Py_DECREF(marker); + Py_DECREF(fromlist); + return NULL; + } +#endif + module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + if (unlikely(!module)) goto ignore; + op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + Py_DECREF(module); + if (likely(op->func_is_coroutine)) { + return __Pyx_NewRef(op->func_is_coroutine); + } +ignore: + PyErr_Clear(); + } +#endif + op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); + return __Pyx_NewRef(op->func_is_coroutine); +} +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_GetAttrString(op->func, "__module__"); +} +static int +__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_SetAttrString(op->func, "__module__", value); +} +#endif +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, +#endif + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { +#if !CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#endif +#if CYTHON_USE_TYPE_SPECS + {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#if CYTHON_METH_FASTCALL +#if CYTHON_BACKPORT_VECTORCALL + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#else +#if !CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, +#endif +#endif +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#else + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, +#endif +#endif + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) +{ + CYTHON_UNUSED_VAR(args); +#if PY_MAJOR_VERSION >= 3 + Py_INCREF(m->func_qualname); + return m->func_qualname; +#else + return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { +#if !CYTHON_COMPILING_IN_LIMITED_API + PyCFunctionObject *cf = (PyCFunctionObject*) op; +#endif + if (unlikely(op == NULL)) + return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API + op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); + if (unlikely(!op->func)) return NULL; +#endif + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; +#if !CYTHON_COMPILING_IN_LIMITED_API + cf->m_ml = ml; + cf->m_self = (PyObject *) op; +#endif + Py_XINCREF(closure); + op->func_closure = closure; +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_XINCREF(module); + cf->m_module = module; +#endif + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + op->func_classobj = NULL; +#else + ((PyCMethodObject*)op)->mm_class = NULL; +#endif + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults_size = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + op->func_is_coroutine = NULL; +#if CYTHON_METH_FASTCALL + switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { + case METH_NOARGS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; + break; + case METH_O: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; + break; + case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; + break; + case METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; + break; + case METH_VARARGS | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = NULL; + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + Py_DECREF(op); + return NULL; + } +#endif + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_CLEAR(m->func); +#else + Py_CLEAR(((PyCFunctionObject*)m)->m_module); +#endif + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API +#if PY_VERSION_HEX < 0x030900B1 + Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); +#else + { + PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; + ((PyCMethodObject *) (m))->mm_class = NULL; + Py_XDECREF(cls); + } +#endif +#endif + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + Py_CLEAR(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + __Pyx_PyHeapTypeObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(m->func); +#else + Py_VISIT(((PyCFunctionObject*)m)->m_module); +#endif + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); +#endif + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *f = ((__pyx_CyFunctionObject*)func)->func; + PyObject *py_name = NULL; + PyCFunction meth; + int flags; + meth = PyCFunction_GetFunction(f); + if (unlikely(!meth)) return NULL; + flags = PyCFunction_GetFlags(f); + if (unlikely(flags < 0)) return NULL; +#else + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + int flags = f->m_ml->ml_flags; +#endif + Py_ssize_t size; + switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 0)) + return (*meth)(self, NULL); +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); +#endif + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); +#endif + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + return NULL; + } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", + py_name); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); +#endif + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *self, *result; +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)func)->m_self; +#endif + result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); + return result; +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; +#if CYTHON_METH_FASTCALL + __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); + if (vc) { +#if CYTHON_ASSUME_SAFE_MACROS + return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); +#else + (void) &__Pyx_PyVectorcall_FastCallDict; + return PyVectorcall_Call(func, args, kw); +#endif + } +#endif + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; +#if CYTHON_ASSUME_SAFE_MACROS + argc = PyTuple_GET_SIZE(args); +#else + argc = PyTuple_Size(args); + if (unlikely(!argc) < 0) return NULL; +#endif + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); +#if PY_MAJOR_VERSION > 2 + PyErr_Format(PyExc_TypeError, + "unbound method %.200S() needs an argument", + cyfunc->func_qualname); +#else + PyErr_SetString(PyExc_TypeError, + "unbound method needs an argument"); +#endif + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) +{ + int ret = 0; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + if (unlikely(nargs < 1)) { + PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", + ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + ret = 1; + } + if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + return ret; +} +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 0)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, NULL); +} +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 1)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, args[0]); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; + PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); +} +#endif +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_CyFunctionType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, + {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, + {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, + {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, + {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, + {Py_tp_methods, (void *)__pyx_CyFunction_methods}, + {Py_tp_members, (void *)__pyx_CyFunction_members}, + {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, + {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, + {0, 0}, +}; +static PyType_Spec __pyx_CyFunctionType_spec = { + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + __pyx_CyFunctionType_slots +}; +#else +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, +#if !CYTHON_METH_FASTCALL + 0, +#elif CYTHON_BACKPORT_VECTORCALL + (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), +#else + offsetof(PyCFunctionObject, vectorcall), +#endif + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_PyMethod_New, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_CyFunction_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); +#endif + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + m->defaults_size = size; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + +/* CalculateMetaclass */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases; +#if CYTHON_ASSUME_SAFE_MACROS + nbases = PyTuple_GET_SIZE(bases); +#else + nbases = PyTuple_Size(bases); + if (nbases < 0) return NULL; +#endif + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; +#if CYTHON_ASSUME_SAFE_MACROS + PyObject *tmp = PyTuple_GET_ITEM(bases, i); +#else + PyObject *tmp = PyTuple_GetItem(bases, i); + if (!tmp) return NULL; +#endif + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +/* PyObjectLookupSpecial */ +#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { + PyObject *res; + PyTypeObject *tp = Py_TYPE(obj); +#if PY_MAJOR_VERSION < 3 + if (unlikely(PyInstance_Check(obj))) + return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); +#endif + res = _PyType_Lookup(tp, attr_name); + if (likely(res)) { + descrgetfunc f = Py_TYPE(res)->tp_descr_get; + if (!f) { + Py_INCREF(res); + } else { + res = f(res, obj, (PyObject *)tp); + } + } else if (with_error) { + PyErr_SetObject(PyExc_AttributeError, attr_name); + } + return res; +} +#endif + +/* Py3ClassCreate */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs[3] = {NULL, name, bases}; + ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); + Py_DECREF(prep); + } else { + if (unlikely(PyErr_Occurred())) + return NULL; + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; +#if PY_VERSION_HEX >= 0x03030000 + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; +#else + CYTHON_MAYBE_UNUSED_VAR(qualname); +#endif + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS +static int __Pyx_SetNamesPEP487(PyObject *type_obj) { + PyTypeObject *type = (PyTypeObject*) type_obj; + PyObject *names_to_set, *key, *value, *set_name, *tmp; + Py_ssize_t i = 0; +#if CYTHON_USE_TYPE_SLOTS + names_to_set = PyDict_Copy(type->tp_dict); +#else + { + PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); + names_to_set = NULL; + if (likely(d)) { + PyObject *names_to_set = PyDict_New(); + int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; + Py_DECREF(d); + if (unlikely(ret < 0)) + Py_CLEAR(names_to_set); + } + } +#endif + if (unlikely(names_to_set == NULL)) + goto bad; + while (PyDict_Next(names_to_set, &i, &key, &value)) { + set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); + if (unlikely(set_name != NULL)) { + tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); + Py_DECREF(set_name); + if (unlikely(tmp == NULL)) { + __Pyx_TypeName value_type_name = + __Pyx_PyType_GetName(Py_TYPE(value)); + __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); + PyErr_Format(PyExc_RuntimeError, +#if PY_MAJOR_VERSION >= 3 + "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", + value_type_name, key, type_name); +#else + "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", + value_type_name, + PyString_Check(key) ? PyString_AS_STRING(key) : "?", + type_name); +#endif + goto bad; + } else { + Py_DECREF(tmp); + } + } + else if (unlikely(PyErr_Occurred())) { + goto bad; + } + } + Py_DECREF(names_to_set); + return 0; +bad: + Py_XDECREF(names_to_set); + return -1; +} +static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { +#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyTypeObject *type = (PyTypeObject*) type_obj; + PyObject *mro = type->tp_mro; + Py_ssize_t i, nbases; + if (unlikely(!mro)) goto done; + (void) &__Pyx_GetBuiltinName; + Py_INCREF(mro); + nbases = PyTuple_GET_SIZE(mro); + assert(PyTuple_GET_ITEM(mro, 0) == type_obj); + for (i = 1; i < nbases-1; i++) { + PyObject *base, *dict, *meth; + base = PyTuple_GET_ITEM(mro, i); + dict = ((PyTypeObject *)base)->tp_dict; + meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); + if (unlikely(meth)) { + descrgetfunc f = Py_TYPE(meth)->tp_descr_get; + PyObject *res; + Py_INCREF(meth); + if (likely(f)) { + res = f(meth, NULL, type_obj); + Py_DECREF(meth); + if (unlikely(!res)) goto bad; + meth = res; + } + res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); + Py_DECREF(meth); + if (unlikely(!res)) goto bad; + Py_DECREF(res); + goto done; + } else if (unlikely(PyErr_Occurred())) { + goto bad; + } + } +done: + Py_XDECREF(mro); + return type_obj; +bad: + Py_XDECREF(mro); + Py_DECREF(type_obj); + return NULL; +#else + PyObject *super_type, *super, *func, *res; +#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) + super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); +#else + super_type = (PyObject*) &PySuper_Type; + (void) &__Pyx_GetBuiltinName; +#endif + super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; +#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) + Py_XDECREF(super_type); +#endif + if (unlikely(!super)) { + Py_CLEAR(type_obj); + goto done; + } + func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); + Py_DECREF(super); + if (likely(!func)) { + if (unlikely(PyErr_Occurred())) + Py_CLEAR(type_obj); + goto done; + } + res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); + Py_DECREF(func); + if (unlikely(!res)) + Py_CLEAR(type_obj); + Py_XDECREF(res); +done: + return type_obj; +#endif +} +#endif +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result; + PyObject *owned_metaclass = NULL; + PyObject *margs[4] = {NULL, name, bases, dict}; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, +#if PY_VERSION_HEX < 0x030600A4 + (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw +#else + mkw +#endif + ); + Py_XDECREF(owned_metaclass); +#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS + if (likely(result) && likely(PyType_Check(result))) { + if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { + Py_CLEAR(result); + } else { + result = __Pyx_InitSubclassPEP487(result, mkw); + } + } +#else + (void) &__Pyx_GetBuiltinName; +#endif + return result; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, + PyObject *firstlineno, PyObject *name) { + PyObject *replace = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; + replace = PyObject_GetAttrString(code, "replace"); + if (likely(replace)) { + PyObject *result; + result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + Py_DECREF(replace); + return result; + } + PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 + { + PyObject *compiled = NULL, *result = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; + compiled = Py_CompileString( + "out = type(code)(\n" + " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" + " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" + " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" + " code.co_lnotab)\n", "", Py_file_input); + if (!compiled) return NULL; + result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); + Py_DECREF(compiled); + if (!result) PyErr_Print(); + Py_DECREF(result); + result = PyDict_GetItemString(scratch_dict, "out"); + if (result) Py_INCREF(result); + return result; + } + #else + return NULL; + #endif +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; + PyObject *replace = NULL, *getframe = NULL, *frame = NULL; + PyObject *exc_type, *exc_value, *exc_traceback; + int success = 0; + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + getframe = PySys_GetObject("_getframe"); + if (unlikely(!getframe)) goto bad; + if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; + frame = PyEval_EvalCode(code_object, dict, dict); + if (unlikely(!frame) || frame == Py_None) goto bad; + success = 1; + bad: + PyErr_Restore(exc_type, exc_value, exc_traceback); + Py_XDECREF(code_object); + Py_XDECREF(py_py_line); + Py_XDECREF(py_funcname); + Py_XDECREF(dict); + Py_XDECREF(replace); + if (success) { + PyTraceBack_Here( + (struct _frame*)frame); + } + Py_XDECREF(frame); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +/* PyUCS4InUnicode */ +#if PY_VERSION_HEX < 0x03090000 || (defined(PyUnicode_WCHAR_KIND) && defined(PyUnicode_AS_UNICODE)) +#if PY_VERSION_HEX < 0x03090000 +#define __Pyx_PyUnicode_AS_UNICODE(op) PyUnicode_AS_UNICODE(op) +#define __Pyx_PyUnicode_GET_SIZE(op) PyUnicode_GET_SIZE(op) +#else +#define __Pyx_PyUnicode_AS_UNICODE(op) (((PyASCIIObject *)(op))->wstr) +#define __Pyx_PyUnicode_GET_SIZE(op) ((PyCompactUnicodeObject *)(op))->wstr_length +#endif +#if !defined(Py_UNICODE_SIZE) || Py_UNICODE_SIZE == 2 +static int __Pyx_PyUnicodeBufferContainsUCS4_SP(Py_UNICODE* buffer, Py_ssize_t length, Py_UCS4 character) { + Py_UNICODE high_val, low_val; + Py_UNICODE* pos; + high_val = (Py_UNICODE) (0xD800 | (((character - 0x10000) >> 10) & ((1<<10)-1))); + low_val = (Py_UNICODE) (0xDC00 | ( (character - 0x10000) & ((1<<10)-1))); + for (pos=buffer; pos < buffer+length-1; pos++) { + if (unlikely((high_val == pos[0]) & (low_val == pos[1]))) return 1; + } + return 0; +} +#endif +static int __Pyx_PyUnicodeBufferContainsUCS4_BMP(Py_UNICODE* buffer, Py_ssize_t length, Py_UCS4 character) { + Py_UNICODE uchar; + Py_UNICODE* pos; + uchar = (Py_UNICODE) character; + for (pos=buffer; pos < buffer+length; pos++) { + if (unlikely(uchar == pos[0])) return 1; + } + return 0; +} +#endif +static CYTHON_INLINE int __Pyx_UnicodeContainsUCS4(PyObject* unicode, Py_UCS4 character) { +#if CYTHON_PEP393_ENABLED + const int kind = PyUnicode_KIND(unicode); + #ifdef PyUnicode_WCHAR_KIND + if (likely(kind != PyUnicode_WCHAR_KIND)) + #endif + { + Py_ssize_t i; + const void* udata = PyUnicode_DATA(unicode); + const Py_ssize_t length = PyUnicode_GET_LENGTH(unicode); + for (i=0; i < length; i++) { + if (unlikely(character == PyUnicode_READ(kind, udata, i))) return 1; + } + return 0; + } +#elif PY_VERSION_HEX >= 0x03090000 + #error Cannot use "UChar in Unicode" in Python 3.9 without PEP-393 unicode strings. +#elif !defined(PyUnicode_AS_UNICODE) + #error Cannot use "UChar in Unicode" in Python < 3.9 without Py_UNICODE support. +#endif +#if PY_VERSION_HEX < 0x03090000 || (defined(PyUnicode_WCHAR_KIND) && defined(PyUnicode_AS_UNICODE)) +#if !defined(Py_UNICODE_SIZE) || Py_UNICODE_SIZE == 2 + if ((sizeof(Py_UNICODE) == 2) && unlikely(character > 65535)) { + return __Pyx_PyUnicodeBufferContainsUCS4_SP( + __Pyx_PyUnicode_AS_UNICODE(unicode), + __Pyx_PyUnicode_GET_SIZE(unicode), + character); + } else +#endif + { + return __Pyx_PyUnicodeBufferContainsUCS4_BMP( + __Pyx_PyUnicode_AS_UNICODE(unicode), + __Pyx_PyUnicode_GET_SIZE(unicode), + character); + } +#endif +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__14); + } + return name; +} +#endif + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_value = exc_info->exc_value; + exc_info->exc_value = *value; + if (tmp_value == NULL || tmp_value == Py_None) { + Py_XDECREF(tmp_value); + tmp_value = NULL; + tmp_type = NULL; + tmp_tb = NULL; + } else { + tmp_type = (PyObject*) Py_TYPE(tmp_value); + Py_INCREF(tmp_type); + #if CYTHON_COMPILING_IN_CPYTHON + tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; + Py_XINCREF(tmp_tb); + #else + tmp_tb = PyException_GetTraceback(tmp_value); + #endif + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* CoroutineBase */ +#include +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + CYTHON_UNUSED_VAR(__pyx_tstate); + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (likely(et == PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + value = Py_None; + } +#if PY_VERSION_HEX >= 0x030300A0 + else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); + } +#endif + else if (unlikely(PyTuple_Check(ev))) { + if (PyTuple_GET_SIZE(ev) >= 1) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + value = PyTuple_GET_ITEM(ev, 0); + Py_INCREF(value); +#else + value = PySequence_ITEM(ev, 0); +#endif + } else { + Py_INCREF(Py_None); + value = Py_None; + } + Py_DECREF(ev); + } + else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { + value = ev; + } + if (likely(value)) { + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = value; + return 0; + } + } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); + Py_DECREF(ev); + if (likely(args)) { + value = PySequence_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +static CYTHON_INLINE +void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { +#if PY_VERSION_HEX >= 0x030B00a4 + Py_CLEAR(exc_state->exc_value); +#else + PyObject *t, *v, *tb; + t = exc_state->exc_type; + v = exc_state->exc_value; + tb = exc_state->exc_traceback; + exc_state->exc_type = NULL; + exc_state->exc_value = NULL; + exc_state->exc_traceback = NULL; + Py_XDECREF(t); + Py_XDECREF(v); + Py_XDECREF(tb); +#endif +} +#define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { + const char *msg; + CYTHON_MAYBE_UNUSED_VAR(gen); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { + msg = "coroutine already executing"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { + msg = "async generator already executing"; + #endif + } else { + msg = "generator already executing"; + } + PyErr_SetString(PyExc_ValueError, msg); +} +#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { + const char *msg; + CYTHON_MAYBE_UNUSED_VAR(gen); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(gen)) { + msg = "can't send non-None value to a just-started coroutine"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(gen)) { + msg = "can't send non-None value to a just-started async generator"; + #endif + } else { + msg = "can't send non-None value to a just-started generator"; + } + PyErr_SetString(PyExc_TypeError, msg); +} +#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { + CYTHON_MAYBE_UNUSED_VAR(gen); + CYTHON_MAYBE_UNUSED_VAR(closing); + #ifdef __Pyx_Coroutine_USED + if (!closing && __Pyx_Coroutine_Check(gen)) { + PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); + } else + #endif + if (value) { + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + else + #endif + PyErr_SetNone(PyExc_StopIteration); + } +} +static +PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { + __Pyx_PyThreadState_declare + PyThreadState *tstate; + __Pyx_ExcInfoStruct *exc_state; + PyObject *retval; + assert(!self->is_running); + if (unlikely(self->resume_label == 0)) { + if (unlikely(value && value != Py_None)) { + return __Pyx_Coroutine_NotStartedError((PyObject*)self); + } + } + if (unlikely(self->resume_label == -1)) { + return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + } +#if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + tstate = __pyx_tstate; +#else + tstate = __Pyx_PyThreadState_Current; +#endif + exc_state = &self->gi_exc_state; + if (exc_state->exc_value) { + #if CYTHON_COMPILING_IN_PYPY + #else + PyObject *exc_tb; + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON + exc_tb = PyException_GetTraceback(exc_state->exc_value); + #elif PY_VERSION_HEX >= 0x030B00a4 + exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback; + #else + exc_tb = exc_state->exc_traceback; + #endif + if (exc_tb) { + PyTracebackObject *tb = (PyTracebackObject *) exc_tb; + PyFrameObject *f = tb->tb_frame; + assert(f->f_back == NULL); + #if PY_VERSION_HEX >= 0x030B00A1 + f->f_back = PyThreadState_GetFrame(tstate); + #else + Py_XINCREF(tstate->frame); + f->f_back = tstate->frame; + #endif + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON + Py_DECREF(exc_tb); + #endif + } + #endif + } +#if CYTHON_USE_EXC_INFO_STACK + exc_state->previous_item = tstate->exc_info; + tstate->exc_info = exc_state; +#else + if (exc_state->exc_type) { + __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } else { + __Pyx_Coroutine_ExceptionClear(exc_state); + __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } +#endif + self->is_running = 1; + retval = self->body(self, tstate, value); + self->is_running = 0; +#if CYTHON_USE_EXC_INFO_STACK + exc_state = &self->gi_exc_state; + tstate->exc_info = exc_state->previous_item; + exc_state->previous_item = NULL; + __Pyx_Coroutine_ResetFrameBackpointer(exc_state); +#endif + return retval; +} +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { +#if CYTHON_COMPILING_IN_PYPY + CYTHON_UNUSED_VAR(exc_state); +#else + PyObject *exc_tb; + #if PY_VERSION_HEX >= 0x030B00a4 + if (!exc_state->exc_value) return; + exc_tb = PyException_GetTraceback(exc_state->exc_value); + #else + exc_tb = exc_state->exc_traceback; + #endif + if (likely(exc_tb)) { + PyTracebackObject *tb = (PyTracebackObject *) exc_tb; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); + #if PY_VERSION_HEX >= 0x030B00a4 + Py_DECREF(exc_tb); + #endif + } +#endif +} +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { + CYTHON_MAYBE_UNUSED_VAR(gen); + if (unlikely(!retval)) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (!__Pyx_PyErr_Occurred()) { + PyObject *exc = PyExc_StopIteration; + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + exc = __Pyx_PyExc_StopAsyncIteration; + #endif + __Pyx_PyErr_SetNone(exc); + } + } + return retval; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) +static CYTHON_INLINE +PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { +#if PY_VERSION_HEX <= 0x030A00A1 + return _PyGen_Send(gen, arg); +#else + PyObject *result; + if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) { + if (PyAsyncGen_CheckExact(gen)) { + assert(result == Py_None); + PyErr_SetNone(PyExc_StopAsyncIteration); + } + else if (result == Py_None) { + PyErr_SetNone(PyExc_StopIteration); + } + else { +#if PY_VERSION_HEX < 0x030d00A1 + _PyGen_SetStopIterationValue(result); +#else + if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) { + PyErr_SetObject(PyExc_StopIteration, result); + } else { + PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result); + if (likely(exc != NULL)) { + PyErr_SetObject(PyExc_StopIteration, exc); + Py_DECREF(exc); + } + } +#endif + } + Py_DECREF(result); + result = NULL; + } + return result; +#endif +} +#endif +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Coroutine_Undelegate(gen); + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); + ret = __Pyx_Coroutine_SendEx(gen, val, 0); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { + PyObject *retval; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + ret = __Pyx_async_gen_asend_send(yf, value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyCoro_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + { + if (value == Py_None) + ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + else + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + retval = __Pyx_Coroutine_FinishDelegation(gen); + } else { + retval = __Pyx_Coroutine_SendEx(gen, value, 0); + } + return __Pyx_Coroutine_MethodReturn(self, retval); +} +static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + if (__Pyx_CoroutineAwait_CheckExact(yf)) { + retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + retval = __Pyx_async_gen_asend_close(yf, NULL); + } else + if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { + retval = __Pyx_async_gen_athrow_close(yf, NULL); + } else + #endif + { + PyObject *meth; + gen->is_running = 1; + meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); + if (unlikely(!meth)) { + if (unlikely(PyErr_Occurred())) { + PyErr_WriteUnraisable(yf); + } + } else { + retval = __Pyx_PyObject_CallNoArg(meth); + Py_DECREF(meth); + if (unlikely(!retval)) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Next(yf); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, Py_None); + } else + #endif + ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_SendEx(gen, Py_None, 0); +} +static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { + CYTHON_UNUSED_VAR(arg); + return __Pyx_Coroutine_Close(self); +} +static PyObject *__Pyx_Coroutine_Close(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + Py_INCREF(yf); + err = __Pyx_Coroutine_CloseIter(gen, yf); + __Pyx_Coroutine_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) + PyErr_SetNone(PyExc_GeneratorExit); + retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); + if (unlikely(retval)) { + const char *msg; + Py_DECREF(retval); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(self)) { + msg = "coroutine ignored GeneratorExit"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(self)) { +#if PY_VERSION_HEX < 0x03060000 + msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; +#else + msg = "async generator ignored GeneratorExit"; +#endif + #endif + } else { + msg = "generator ignored GeneratorExit"; + } + PyErr_SetString(PyExc_RuntimeError, msg); + return NULL; + } + raised_exception = PyErr_Occurred(); + if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { + if (raised_exception) PyErr_Clear(); + Py_INCREF(Py_None); + return Py_None; + } + return NULL; +} +static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, + PyObject *args, int close_on_genexit) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + Py_INCREF(yf); + if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { + int err = __Pyx_Coroutine_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Coroutine_Undelegate(gen); + if (err < 0) + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto throw_here; + } + gen->is_running = 1; + if (0 + #ifdef __Pyx_Generator_USED + || __Pyx_Generator_CheckExact(yf) + #endif + #ifdef __Pyx_Coroutine_USED + || __Pyx_Coroutine_Check(yf) + #endif + ) { + ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { + ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); + #endif + } else { + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (unlikely(PyErr_Occurred())) { + gen->is_running = 0; + return NULL; + } + __Pyx_Coroutine_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + if (likely(args)) { + ret = __Pyx_PyObject_Call(meth, args, NULL); + } else { + PyObject *cargs[4] = {NULL, typ, val, tb}; + ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_MethodReturn(self, ret); + } +throw_here: + __Pyx_Raise(typ, val, tb, NULL); + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +} +static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { + PyObject *typ; + PyObject *val = NULL; + PyObject *tb = NULL; + if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) + return NULL; + return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); +} +static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { +#if PY_VERSION_HEX >= 0x030B00a4 + Py_VISIT(exc_state->exc_value); +#else + Py_VISIT(exc_state->exc_type); + Py_VISIT(exc_state->exc_value); + Py_VISIT(exc_state->exc_traceback); +#endif + return 0; +} +static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + Py_VISIT(gen->closure); + Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); + return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); +} +static int __Pyx_Coroutine_clear(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); + } +#endif + Py_CLEAR(gen->gi_code); + Py_CLEAR(gen->gi_frame); + Py_CLEAR(gen->gi_name); + Py_CLEAR(gen->gi_qualname); + Py_CLEAR(gen->gi_modulename); + return 0; +} +static void __Pyx_Coroutine_dealloc(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject_GC_UnTrack(gen); + if (gen->gi_weakreflist != NULL) + PyObject_ClearWeakRefs(self); + if (gen->resume_label >= 0) { + PyObject_GC_Track(self); +#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE + if (unlikely(PyObject_CallFinalizerFromDealloc(self))) +#else + Py_TYPE(gen)->tp_del(self); + if (unlikely(Py_REFCNT(self) > 0)) +#endif + { + return; + } + PyObject_GC_UnTrack(self); + } +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + /* We have to handle this case for asynchronous generators + right here, because this code has to be between UNTRACK + and GC_Del. */ + Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); + } +#endif + __Pyx_Coroutine_clear(self); + __Pyx_PyHeapTypeObject_GC_Del(gen); +} +static void __Pyx_Coroutine_del(PyObject *self) { + PyObject *error_type, *error_value, *error_traceback; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + __Pyx_PyThreadState_declare + if (gen->resume_label < 0) { + return; + } +#if !CYTHON_USE_TP_FINALIZE + assert(self->ob_refcnt == 0); + __Pyx_SET_REFCNT(self, 1); +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; + PyObject *finalizer = agen->ag_finalizer; + if (finalizer && !agen->ag_closed) { + PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); + if (unlikely(!res)) { + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); + return; + } + } +#endif + if (unlikely(gen->resume_label == 0 && !error_value)) { +#ifdef __Pyx_Coroutine_USED +#ifdef __Pyx_Generator_USED + if (!__Pyx_Generator_CheckExact(self)) +#endif + { + PyObject_GC_UnTrack(self); +#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) + if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) + PyErr_WriteUnraisable(self); +#else + {PyObject *msg; + char *cmsg; + #if CYTHON_COMPILING_IN_PYPY + msg = NULL; + cmsg = (char*) "coroutine was never awaited"; + #else + char *cname; + PyObject *qualname; + qualname = gen->gi_qualname; + cname = PyString_AS_STRING(qualname); + msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); + if (unlikely(!msg)) { + PyErr_Clear(); + cmsg = (char*) "coroutine was never awaited"; + } else { + cmsg = PyString_AS_STRING(msg); + } + #endif + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) + PyErr_WriteUnraisable(self); + Py_XDECREF(msg);} +#endif + PyObject_GC_Track(self); + } +#endif + } else { + PyObject *res = __Pyx_Coroutine_Close(self); + if (unlikely(!res)) { + if (PyErr_Occurred()) + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); +#if !CYTHON_USE_TP_FINALIZE + assert(Py_REFCNT(self) > 0); + if (likely(--self->ob_refcnt == 0)) { + return; + } + { + Py_ssize_t refcnt = Py_REFCNT(self); + _Py_NewReference(self); + __Pyx_SET_REFCNT(self, refcnt); + } +#if CYTHON_COMPILING_IN_CPYTHON + assert(PyType_IS_GC(Py_TYPE(self)) && + _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); + _Py_DEC_REFTOTAL; +#endif +#ifdef COUNT_ALLOCS + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; +#endif +#endif +} +static PyObject * +__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) +{ + PyObject *name = self->gi_name; + CYTHON_UNUSED_VAR(context); + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(self->gi_name, value); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context) +{ + PyObject *name = self->gi_qualname; + CYTHON_UNUSED_VAR(context); + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(self->gi_qualname, value); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) +{ + PyObject *frame = self->gi_frame; + CYTHON_UNUSED_VAR(context); + if (!frame) { + if (unlikely(!self->gi_code)) { + Py_RETURN_NONE; + } + frame = (PyObject *) PyFrame_New( + PyThreadState_Get(), /*PyThreadState *tstate,*/ + (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (unlikely(!frame)) + return NULL; + self->gi_frame = frame; + } + Py_INCREF(frame); + return frame; +} +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); + if (unlikely(!gen)) + return NULL; + return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); +} +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + gen->body = body; + gen->closure = closure; + Py_XINCREF(closure); + gen->is_running = 0; + gen->resume_label = 0; + gen->classobj = NULL; + gen->yieldfrom = NULL; + #if PY_VERSION_HEX >= 0x030B00a4 + gen->gi_exc_state.exc_value = NULL; + #else + gen->gi_exc_state.exc_type = NULL; + gen->gi_exc_state.exc_value = NULL; + gen->gi_exc_state.exc_traceback = NULL; + #endif +#if CYTHON_USE_EXC_INFO_STACK + gen->gi_exc_state.previous_item = NULL; +#endif + gen->gi_weakreflist = NULL; + Py_XINCREF(qualname); + gen->gi_qualname = qualname; + Py_XINCREF(name); + gen->gi_name = name; + Py_XINCREF(module_name); + gen->gi_modulename = module_name; + Py_XINCREF(code); + gen->gi_code = code; + gen->gi_frame = NULL; + PyObject_GC_Track(gen); + return gen; +} + +/* PatchModuleWithCoroutine */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + int result; + PyObject *globals, *result_obj; + globals = PyDict_New(); if (unlikely(!globals)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_coroutine_type", + #ifdef __Pyx_Coroutine_USED + (PyObject*)__pyx_CoroutineType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_generator_type", + #ifdef __Pyx_Generator_USED + (PyObject*)__pyx_GeneratorType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; + result_obj = PyRun_String(py_code, Py_file_input, globals, globals); + if (unlikely(!result_obj)) goto ignore; + Py_DECREF(result_obj); + Py_DECREF(globals); + return module; +ignore: + Py_XDECREF(globals); + PyErr_WriteUnraisable(module); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { + Py_DECREF(module); + module = NULL; + } +#else + py_code++; +#endif + return module; +} + +/* PatchGeneratorABC */ +#ifndef CYTHON_REGISTER_ABCS +#define CYTHON_REGISTER_ABCS 1 +#endif +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) +static PyObject* __Pyx_patch_abc_module(PyObject *module); +static PyObject* __Pyx_patch_abc_module(PyObject *module) { + module = __Pyx_Coroutine_patch_module( + module, "" +"if _cython_generator_type is not None:\n" +" try: Generator = _module.Generator\n" +" except AttributeError: pass\n" +" else: Generator.register(_cython_generator_type)\n" +"if _cython_coroutine_type is not None:\n" +" try: Coroutine = _module.Coroutine\n" +" except AttributeError: pass\n" +" else: Coroutine.register(_cython_coroutine_type)\n" + ); + return module; +} +#endif +static int __Pyx_patch_abc(void) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + static int abc_patched = 0; + if (CYTHON_REGISTER_ABCS && !abc_patched) { + PyObject *module; + module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); + if (unlikely(!module)) { + PyErr_WriteUnraisable(NULL); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, + ((PY_MAJOR_VERSION >= 3) ? + "Cython module failed to register with collections.abc module" : + "Cython module failed to register with collections module"), 1) < 0)) { + return -1; + } + } else { + module = __Pyx_patch_abc_module(module); + abc_patched = 1; + if (unlikely(!module)) + return -1; + Py_DECREF(module); + } + module = PyImport_ImportModule("backports_abc"); + if (module) { + module = __Pyx_patch_abc_module(module); + Py_XDECREF(module); + } + if (!module) { + PyErr_Clear(); + } + } +#else + if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); +#endif + return 0; +} + +/* Generator */ +static PyMethodDef __pyx_Generator_methods[] = { + {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, + (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, + (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, + (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + {0, 0, 0, 0} +}; +static PyMemberDef __pyx_Generator_memberlist[] = { + {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, + {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, + {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, +#if CYTHON_USE_TYPE_SPECS + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, +#endif + {0, 0, 0, 0, 0} +}; +static PyGetSetDef __pyx_Generator_getsets[] = { + {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + (char*) PyDoc_STR("name of the generator"), 0}, + {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + (char*) PyDoc_STR("qualified name of the generator"), 0}, + {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, + (char*) PyDoc_STR("Frame of the generator"), 0}, + {0, 0, 0, 0, 0} +}; +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_GeneratorType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, + {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, + {Py_tp_iter, (void *)PyObject_SelfIter}, + {Py_tp_iternext, (void *)__Pyx_Generator_Next}, + {Py_tp_methods, (void *)__pyx_Generator_methods}, + {Py_tp_members, (void *)__pyx_Generator_memberlist}, + {Py_tp_getset, (void *)__pyx_Generator_getsets}, + {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, +#if CYTHON_USE_TP_FINALIZE + {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, +#endif + {0, 0}, +}; +static PyType_Spec __pyx_GeneratorType_spec = { + __PYX_TYPE_MODULE_PREFIX "generator", + sizeof(__pyx_CoroutineObject), + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + __pyx_GeneratorType_slots +}; +#else +static PyTypeObject __pyx_GeneratorType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "generator", + sizeof(__pyx_CoroutineObject), + 0, + (destructor) __Pyx_Coroutine_dealloc, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + 0, + (traverseproc) __Pyx_Coroutine_traverse, + 0, + 0, + offsetof(__pyx_CoroutineObject, gi_weakreflist), + 0, + (iternextfunc) __Pyx_Generator_Next, + __pyx_Generator_methods, + __pyx_Generator_memberlist, + __pyx_Generator_getsets, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if CYTHON_USE_TP_FINALIZE + 0, +#else + __Pyx_Coroutine_del, +#endif + 0, +#if CYTHON_USE_TP_FINALIZE + __Pyx_Coroutine_del, +#elif PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_Generator_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); +#endif + if (unlikely(!__pyx_GeneratorType)) { + return -1; + } + return 0; +} + +/* CheckBinaryVersion */ +static unsigned long __Pyx_get_runtime_version(void) { +#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 + return Py_Version & ~0xFFUL; +#else + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + return version; +#endif +} +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { + const unsigned long MAJOR_MINOR = 0xFFFF0000UL; + if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) + return 0; + if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) + return 1; + { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compile time Python version %d.%d " + "of module '%.100s' " + "%s " + "runtime version %d.%d", + (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), + __Pyx_MODULE_NAME, + (allow_newer) ? "was newer than" : "does not match", + (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) + ); + return PyErr_WarnEx(NULL, message, 1); + } +} + +/* InitStrings */ +#if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +#include +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { + size_t len = strlen(s); + if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, "byte string is too long"); + return -1; + } + return (Py_ssize_t) len; +} +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return __Pyx_PyUnicode_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return PyByteArray_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/w3lib/_url.py b/w3lib/_url.pyx similarity index 100% rename from w3lib/_url.py rename to w3lib/_url.pyx From eefbb9e3ca4d3b97899f356acacbc08805fd87cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Mon, 12 Feb 2024 16:28:34 +0100 Subject: [PATCH 28/34] Use Cython for additional files (x1.5 speedup) --- setup.py | 13 +- tests/test_url.py | 2 +- w3lib/_encoding.c | 13419 +++++++++++++++++ w3lib/{_encoding.py => _encoding.pyx} | 0 w3lib/_infra.c | 7401 ++++++++++ w3lib/{_infra.py => _infra.pyx} | 0 w3lib/_rfc2396.c | 4524 ++++++ w3lib/{_rfc2396.py => _rfc2396.pyx} | 0 w3lib/_rfc3986.c | 4561 ++++++ w3lib/{_rfc3986.py => _rfc3986.pyx} | 0 w3lib/_rfc5892.c | 8027 ++++++++++ w3lib/{_rfc5892.py => _rfc5892.pyx} | 0 w3lib/_types.c | 4773 ++++++ w3lib/{_types.py => _types.pyx} | 0 w3lib/_url.c | 5426 +++---- w3lib/_util.c | 12310 ++++++++++++++++ w3lib/{_util.py => _util.pyx} | 0 w3lib/_utr46.c | 18649 ++++++++++++++++++++++++ w3lib/{_utr46.py => _utr46.pyx} | 0 19 files changed, 76402 insertions(+), 2703 deletions(-) create mode 100644 w3lib/_encoding.c rename w3lib/{_encoding.py => _encoding.pyx} (100%) create mode 100644 w3lib/_infra.c rename w3lib/{_infra.py => _infra.pyx} (100%) create mode 100644 w3lib/_rfc2396.c rename w3lib/{_rfc2396.py => _rfc2396.pyx} (100%) create mode 100644 w3lib/_rfc3986.c rename w3lib/{_rfc3986.py => _rfc3986.pyx} (100%) create mode 100644 w3lib/_rfc5892.c rename w3lib/{_rfc5892.py => _rfc5892.pyx} (100%) create mode 100644 w3lib/_types.c rename w3lib/{_types.py => _types.pyx} (100%) create mode 100644 w3lib/_util.c rename w3lib/{_util.py => _util.pyx} (100%) create mode 100644 w3lib/_utr46.c rename w3lib/{_utr46.py => _utr46.pyx} (100%) diff --git a/setup.py b/setup.py index 637b739e..427370cf 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,18 @@ def no_cythonize(extensions, **_ignore): return extensions extensions = [ - Extension("w3lib._url", ["w3lib/_url.pyx"]), + Extension(f"w3lib._{name}", [f"w3lib/_{name}.pyx"]) + for name in ( + "encoding", + "infra", + "rfc2396", + "rfc3986", + "rfc5892", + "types", + "url", + "util", + "utr46", + ) ] CYTHONIZE = bool(int(os.getenv("CYTHONIZE", 0))) and cythonize is not None diff --git a/tests/test_url.py b/tests/test_url.py index d85eb46b..058193b7 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -639,7 +639,7 @@ def test_safe_url_performance(url): # presummably due to caching by urllib. number = 1 # TODO: Increase? How much? # Make sure the new implementation is at most this number of times as slow. - multiplier = 6 # TODO: Lower as close to 1 as possible. + multiplier = 4 # TODO: Lower as close to 1 as possible. time1 = timeit( f"safe_url({url!r})", "from w3lib.url import safe_url", number=number diff --git a/w3lib/_encoding.c b/w3lib/_encoding.c new file mode 100644 index 00000000..e52febcd --- /dev/null +++ b/w3lib/_encoding.c @@ -0,0 +1,13419 @@ +/* Generated by Cython 3.0.8 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "name": "w3lib._encoding", + "sources": [ + "w3lib/_encoding.pyx" + ] + }, + "module_name": "w3lib._encoding" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API +#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#else +#define __PYX_EXTRA_ABI_MODULE_NAME "" +#endif +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030008F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #ifdef Py_LIMITED_API + #undef __PYX_LIMITED_VERSION_HEX + #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API + #endif + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_USE_CPP_STD_MOVE + #if defined(__cplusplus) && (\ + __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) + #define CYTHON_USE_CPP_STD_MOVE 1 + #else + #define CYTHON_USE_CPP_STD_MOVE 0 + #endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #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 +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if CYTHON_COMPILING_IN_LIMITED_API + static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } + #ifndef CO_OPTIMIZED + #define CO_OPTIMIZED 0x0001 + #endif + #ifndef CO_NEWLOCALS + #define CO_NEWLOCALS 0x0002 + #endif + #ifndef CO_VARARGS + #define CO_VARARGS 0x0004 + #endif + #ifndef CO_VARKEYWORDS + #define CO_VARKEYWORDS 0x0008 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x0200 + #endif + #ifndef CO_GENERATOR + #define CO_GENERATOR 0x0020 + #endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x0080 + #endif +#elif PY_VERSION_HEX >= 0x030B0000 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); + if (!empty_bytes) return NULL; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); + Py_DECREF(empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_MAJOR_VERSION >= 0x030900B1 +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) +#else +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) +#endif +#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) +#elif !CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) +static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { + return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; +} +#endif +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API + return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; +#else + return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +#endif +} +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) +#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) +#else + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) +#endif +#if PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__w3lib___encoding +#define __PYX_HAVE_API__w3lib___encoding +/* Early includes */ +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#include +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#include +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "w3lib/_encoding.pyx", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* #### Code section: numeric_typedefs ### */ +/* #### Code section: complex_type_declarations ### */ +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#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 + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* TupleAndListFromArray.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* fastcall.proto */ +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#else + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) +#endif +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) + #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) +#else + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) +#endif +#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) +#define __Pyx_KwValues_VARARGS(args, nargs) NULL +#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) +#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) +#if CYTHON_METH_FASTCALL + #define __Pyx_Arg_FASTCALL(args, i) args[i] + #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) + static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + #else + #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) + #endif + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) +#else + #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS + #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS + #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS + #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS + #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) + #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* PyObjectFormatSimple.proto */ +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#elif PY_MAJOR_VERSION < 3 + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ + PyObject_Format(s, f)) +#elif CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\ + likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\ + PyObject_Format(s, f)) +#else + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#endif + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#if !CYTHON_VECTORCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if !CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03080000 + #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #define __Pxy_PyFrame_Initialize_Offsets() + #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) +#else + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif +#endif +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectFastCall.proto */ +#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod1.proto */ +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + +/* RaiseUnexpectedTypeError.proto */ +static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) +#else +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectFormatAndDecref.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); + +/* UnicodeConcatInPlace.proto */ +# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_REFNANNY + #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) + #else + #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right) + #endif + static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right + #if CYTHON_REFNANNY + , void* __pyx_refnanny + #endif + ); +#else +#define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat +#endif +#define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right)) + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportDottedModule.proto */ +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); +#endif + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* IncludeStructmemberH.proto */ +#include + +/* FixUpExtensionType.proto */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); +#endif + +/* FetchSharedCythonModule.proto */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); + +/* FetchCommonType.proto */ +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); +#else +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +#endif + +/* PyMethodNew.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + typesModule = PyImport_ImportModule("types"); + if (!typesModule) return NULL; + methodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + if (!methodType) return NULL; + result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); + Py_DECREF(methodType); + return result; +} +#elif PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#else + #define __Pyx_PyMethod_New PyMethod_New +#endif + +/* PyVectorcallFastCallDict.proto */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); +#endif + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CYFUNCTION_COROUTINE 0x08 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#else + #define __Pyx_CyFunction_GetClassObj(f)\ + ((PyObject*) ((PyCMethodObject *) (f))->mm_class) +#endif +#define __Pyx_CyFunction_SetClassObj(f, classobj)\ + __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject_HEAD + PyObject *func; +#elif PY_VERSION_HEX < 0x030900B1 + PyCFunctionObject func; +#else + PyCMethodObject func; +#endif +#if CYTHON_BACKPORT_VECTORCALL + __pyx_vectorcallfunc func_vectorcall; +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_classobj; +#endif + void *defaults; + int defaults_pyobjects; + size_t defaults_size; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; + PyObject *func_is_coroutine; +} __pyx_CyFunctionObject; +#undef __Pyx_CyOrPyCFunction_Check +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); +#undef __Pyx_IsSameCFunction +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(PyObject *module); +#if CYTHON_METH_FASTCALL +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#if CYTHON_BACKPORT_VECTORCALL +#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) +#else +#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) +#endif +#endif + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + +/* RaiseMappingExpected.proto */ +static void __Pyx_RaiseMappingExpectedError(PyObject* arg); + +/* CLineInTraceback.proto */ +#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 */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static unsigned long __Pyx_get_runtime_version(void); +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ + +/* Module declarations from "w3lib._encoding" */ +static PyObject *__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label; +static PyObject *__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label; +/* #### Code section: typeinfo ### */ +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "w3lib._encoding" +extern int __pyx_module_is_main_w3lib___encoding; +int __pyx_module_is_main_w3lib___encoding = 0; + +/* Implementation of "w3lib._encoding" */ +/* #### Code section: global_var ### */ +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_ValueError; +/* #### Code section: string_decls ### */ +static const char __pyx_k_[] = "*"; +static const char __pyx_k__2[] = "."; +static const char __pyx_k_l1[] = "l1"; +static const char __pyx_k_l2[] = "l2"; +static const char __pyx_k_l3[] = "l3"; +static const char __pyx_k_l4[] = "l4"; +static const char __pyx_k_l5[] = "l5"; +static const char __pyx_k_l6[] = "l6"; +static const char __pyx_k_l9[] = "l9"; +static const char __pyx_k_866[] = "866"; +static const char __pyx_k__49[] = "?"; +static const char __pyx_k_gbk[] = "gbk"; +static const char __pyx_k_int[] = "int"; +static const char __pyx_k_koi[] = "koi"; +static const char __pyx_k_mac[] = "mac"; +static const char __pyx_k_str[] = "str"; +static const char __pyx_k_Dict[] = "Dict"; +static const char __pyx_k_big5[] = "big5"; +static const char __pyx_k_koi8[] = "koi8"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_sjis[] = "sjis"; +static const char __pyx_k_spec[] = "__spec__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_utf8[] = "utf8"; +static const char __pyx_k_Tuple[] = "Tuple"; +static const char __pyx_k_ascii[] = "ascii"; +static const char __pyx_k_cp125[] = "cp125"; +static const char __pyx_k_cp819[] = "cp819"; +static const char __pyx_k_cp866[] = "cp866"; +static const char __pyx_k_cp874[] = "cp874"; +static const char __pyx_k_greek[] = "greek"; +static const char __pyx_k_infra[] = "_infra"; +static const char __pyx_k_label[] = "label"; +static const char __pyx_k_lower[] = "lower"; +static const char __pyx_k_ms932[] = "ms932"; +static const char __pyx_k_strip[] = "strip"; +static const char __pyx_k_ucs_2[] = "ucs-2"; +static const char __pyx_k_utf_8[] = "utf-8"; +static const char __pyx_k_x_gbk[] = "x-gbk"; +static const char __pyx_k_AnyStr[] = "AnyStr"; +static const char __pyx_k_arabic[] = "arabic"; +static const char __pyx_k_codecs[] = "codecs"; +static const char __pyx_k_cp1252[] = "cp1252"; +static const char __pyx_k_cp1254[] = "cp1254"; +static const char __pyx_k_csbig5[] = "csbig5"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_euc_jp[] = "euc-jp"; +static const char __pyx_k_euc_kr[] = "euc-kr"; +static const char __pyx_k_gb2312[] = "gb2312"; +static const char __pyx_k_greek8[] = "greek8"; +static const char __pyx_k_hebrew[] = "hebrew"; +static const char __pyx_k_ibm819[] = "ibm819"; +static const char __pyx_k_ibm866[] = "ibm866"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_koi8_r[] = "koi8-r"; +static const char __pyx_k_koi8_u[] = "koi8-u"; +static const char __pyx_k_korean[] = "korean"; +static const char __pyx_k_latin1[] = "latin1"; +static const char __pyx_k_latin2[] = "latin2"; +static const char __pyx_k_latin3[] = "latin3"; +static const char __pyx_k_latin4[] = "latin4"; +static const char __pyx_k_latin5[] = "latin5"; +static const char __pyx_k_latin6[] = "latin6"; +static const char __pyx_k_lookup[] = "lookup"; +static const char __pyx_k_return[] = "return"; +static const char __pyx_k_typing[] = "typing"; +static const char __pyx_k_utf_16[] = "utf-16"; +static const char __pyx_k_visual[] = "visual"; +static const char __pyx_k_x_sjis[] = "x-sjis"; +static const char __pyx_k_chinese[] = "chinese"; +static const char __pyx_k_cn_big5[] = "cn-big5"; +static const char __pyx_k_cseuckr[] = "cseuckr"; +static const char __pyx_k_cskoi8r[] = "cskoi8r"; +static const char __pyx_k_dos_874[] = "dos-874"; +static const char __pyx_k_gb18030[] = "gb18030"; +static const char __pyx_k_gb_2312[] = "gb_2312"; +static const char __pyx_k_koi8_ru[] = "koi8-ru"; +static const char __pyx_k_ksc5601[] = "ksc5601"; +static const char __pyx_k_logical[] = "logical"; +static const char __pyx_k_maxsize[] = "maxsize"; +static const char __pyx_k_tis_620[] = "tis-620"; +static const char __pyx_k_unicode[] = "unicode"; +static const char __pyx_k_x_cp125[] = "x-cp125"; +static const char __pyx_k_Callable[] = "Callable"; +static const char __pyx_k_KeyError[] = "KeyError"; +static const char __pyx_k_asmo_708[] = "asmo-708"; +static const char __pyx_k_csgb2312[] = "csgb2312"; +static const char __pyx_k_csibm866[] = "csibm866"; +static const char __pyx_k_cyrillic[] = "cyrillic"; +static const char __pyx_k_ecma_114[] = "ecma-114"; +static const char __pyx_k_ecma_118[] = "ecma-118"; +static const char __pyx_k_elot_928[] = "elot_928"; +static const char __pyx_k_encoding[] = "encoding"; +static const char __pyx_k_iso88591[] = "iso88591"; +static const char __pyx_k_iso88592[] = "iso88592"; +static const char __pyx_k_iso88593[] = "iso88593"; +static const char __pyx_k_iso88594[] = "iso88594"; +static const char __pyx_k_iso88595[] = "iso88595"; +static const char __pyx_k_iso88596[] = "iso88596"; +static const char __pyx_k_iso88597[] = "iso88597"; +static const char __pyx_k_iso88598[] = "iso88598"; +static const char __pyx_k_iso88599[] = "iso88599"; +static const char __pyx_k_koi8_r_2[] = "koi8_r"; +static const char __pyx_k_ksc_5601[] = "ksc_5601"; +static const char __pyx_k_ms_kanji[] = "ms_kanji"; +static const char __pyx_k_us_ascii[] = "us-ascii"; +static const char __pyx_k_utf_16be[] = "utf-16be"; +static const char __pyx_k_utf_16le[] = "utf-16le"; +static const char __pyx_k_x_cp1252[] = "x-cp1252"; +static const char __pyx_k_x_cp1254[] = "x-cp1254"; +static const char __pyx_k_x_euc_jp[] = "x-euc-jp"; +static const char __pyx_k_x_x_big5[] = "x-x-big5"; +static const char __pyx_k_csunicode[] = "csunicode"; +static const char __pyx_k_functools[] = "functools"; +static const char __pyx_k_iso885910[] = "iso885910"; +static const char __pyx_k_iso885911[] = "iso885911"; +static const char __pyx_k_iso885913[] = "iso885913"; +static const char __pyx_k_iso885914[] = "iso885914"; +static const char __pyx_k_iso885915[] = "iso885915"; +static const char __pyx_k_iso8859_1[] = "iso8859-1"; +static const char __pyx_k_iso8859_2[] = "iso8859-2"; +static const char __pyx_k_iso8859_3[] = "iso8859-3"; +static const char __pyx_k_iso8859_4[] = "iso8859-4"; +static const char __pyx_k_iso8859_5[] = "iso8859-5"; +static const char __pyx_k_iso8859_6[] = "iso8859-6"; +static const char __pyx_k_iso8859_7[] = "iso8859-7"; +static const char __pyx_k_iso8859_8[] = "iso8859-8"; +static const char __pyx_k_iso8859_9[] = "iso8859-9"; +static const char __pyx_k_iso_ir_58[] = "iso-ir-58"; +static const char __pyx_k_lru_cache[] = "lru_cache"; +static const char __pyx_k_macintosh[] = "macintosh"; +static const char __pyx_k_shift_jis[] = "shift-jis"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_big5_hkscs[] = "big5-hkscs"; +static const char __pyx_k_codec_info[] = "codec_info"; +static const char __pyx_k_csshiftjis[] = "csshiftjis"; +static const char __pyx_k_gb_2312_80[] = "gb_2312-80"; +static const char __pyx_k_hz_gb_2312[] = "hz-gb-2312"; +static const char __pyx_k_iso8859_10[] = "iso8859-10"; +static const char __pyx_k_iso8859_11[] = "iso8859-11"; +static const char __pyx_k_iso8859_13[] = "iso8859-13"; +static const char __pyx_k_iso8859_14[] = "iso8859-14"; +static const char __pyx_k_iso8859_15[] = "iso8859-15"; +static const char __pyx_k_iso_8859_1[] = "iso-8859-1"; +static const char __pyx_k_iso_8859_2[] = "iso-8859-2"; +static const char __pyx_k_iso_8859_3[] = "iso-8859-3"; +static const char __pyx_k_iso_8859_4[] = "iso-8859-4"; +static const char __pyx_k_iso_8859_5[] = "iso-8859-5"; +static const char __pyx_k_iso_8859_6[] = "iso-8859-6"; +static const char __pyx_k_iso_8859_7[] = "iso-8859-7"; +static const char __pyx_k_iso_8859_8[] = "iso-8859-8"; +static const char __pyx_k_iso_8859_9[] = "iso-8859-9"; +static const char __pyx_k_iso_ir_100[] = "iso-ir-100"; +static const char __pyx_k_iso_ir_101[] = "iso-ir-101"; +static const char __pyx_k_iso_ir_109[] = "iso-ir-109"; +static const char __pyx_k_iso_ir_110[] = "iso-ir-110"; +static const char __pyx_k_iso_ir_126[] = "iso-ir-126"; +static const char __pyx_k_iso_ir_127[] = "iso-ir-127"; +static const char __pyx_k_iso_ir_138[] = "iso-ir-138"; +static const char __pyx_k_iso_ir_144[] = "iso-ir-144"; +static const char __pyx_k_iso_ir_148[] = "iso-ir-148"; +static const char __pyx_k_iso_ir_149[] = "iso-ir-149"; +static const char __pyx_k_iso_ir_157[] = "iso-ir-157"; +static const char __pyx_k_last_digit[] = "last_digit"; +static const char __pyx_k_csiso2022jp[] = "csiso2022jp"; +static const char __pyx_k_csiso2022kr[] = "csiso2022kr"; +static const char __pyx_k_csiso88596e[] = "csiso88596e"; +static const char __pyx_k_csiso88596i[] = "csiso88596i"; +static const char __pyx_k_csiso88598e[] = "csiso88598e"; +static const char __pyx_k_csiso88598i[] = "csiso88598i"; +static const char __pyx_k_csisolatin1[] = "csisolatin1"; +static const char __pyx_k_csisolatin2[] = "csisolatin2"; +static const char __pyx_k_csisolatin3[] = "csisolatin3"; +static const char __pyx_k_csisolatin4[] = "csisolatin4"; +static const char __pyx_k_csisolatin5[] = "csisolatin5"; +static const char __pyx_k_csisolatin6[] = "csisolatin6"; +static const char __pyx_k_csisolatin9[] = "csisolatin9"; +static const char __pyx_k_csmacintosh[] = "csmacintosh"; +static const char __pyx_k_get_encoder[] = "_get_encoder"; +static const char __pyx_k_iso_2022_cn[] = "iso-2022-cn"; +static const char __pyx_k_iso_2022_jp[] = "iso-2022-jp"; +static const char __pyx_k_iso_2022_kr[] = "iso-2022-kr"; +static const char __pyx_k_iso_8859_10[] = "iso-8859-10"; +static const char __pyx_k_iso_8859_11[] = "iso-8859-11"; +static const char __pyx_k_iso_8859_13[] = "iso-8859-13"; +static const char __pyx_k_iso_8859_14[] = "iso-8859-14"; +static const char __pyx_k_iso_8859_15[] = "iso-8859-15"; +static const char __pyx_k_iso_8859_16[] = "iso-8859-16"; +static const char __pyx_k_replacement[] = "replacement"; +static const char __pyx_k_shift_jis_2[] = "shift_jis"; +static const char __pyx_k_unicodefeff[] = "unicodefeff"; +static const char __pyx_k_unicodefffe[] = "unicodefffe"; +static const char __pyx_k_windows_125[] = "windows-125"; +static const char __pyx_k_windows_31j[] = "windows-31j"; +static const char __pyx_k_windows_874[] = "windows-874"; +static const char __pyx_k_windows_949[] = "windows-949"; +static const char __pyx_k_x_mac_roman[] = "x-mac-roman"; +static const char __pyx_k_Dict_str_str[] = "Dict[str, str]"; +static const char __pyx_k_get_encoding[] = "_get_encoding"; +static const char __pyx_k_initializing[] = "_initializing"; +static const char __pyx_k_is_coroutine[] = "_is_coroutine"; +static const char __pyx_k_iso_8859_1_2[] = "iso_8859-1"; +static const char __pyx_k_iso_8859_2_2[] = "iso_8859-2"; +static const char __pyx_k_iso_8859_3_2[] = "iso_8859-3"; +static const char __pyx_k_iso_8859_4_2[] = "iso_8859-4"; +static const char __pyx_k_iso_8859_5_2[] = "iso_8859-5"; +static const char __pyx_k_iso_8859_6_2[] = "iso_8859-6"; +static const char __pyx_k_iso_8859_6_e[] = "iso-8859-6-e"; +static const char __pyx_k_iso_8859_6_i[] = "iso-8859-6-i"; +static const char __pyx_k_iso_8859_7_2[] = "iso_8859-7"; +static const char __pyx_k_iso_8859_8_2[] = "iso_8859-8"; +static const char __pyx_k_iso_8859_8_e[] = "iso-8859-8-e"; +static const char __pyx_k_iso_8859_8_i[] = "iso-8859-8-i"; +static const char __pyx_k_iso_8859_9_2[] = "iso_8859-9"; +static const char __pyx_k_mac_cyrillic[] = "mac-cyrillic"; +static const char __pyx_k_sun_eu_greek[] = "sun_eu_greek"; +static const char __pyx_k_windows_1252[] = "windows-1252"; +static const char __pyx_k_windows_1254[] = "windows-1254"; +static const char __pyx_k_CodecFunction[] = "CodecFunction"; +static const char __pyx_k_UTF_8_ENCODER[] = "_UTF_8_ENCODER"; +static const char __pyx_k_class_getitem[] = "__class_getitem__"; +static const char __pyx_k_csksc56011987[] = "csksc56011987"; +static const char __pyx_k_iso_8859_15_2[] = "iso_8859-15"; +static const char __pyx_k_unicode11utf8[] = "unicode11utf8"; +static const char __pyx_k_unicode20utf8[] = "unicode20utf8"; +static const char __pyx_k_DecodeFunction[] = "DecodeFunction"; +static const char __pyx_k_EncodeFunction[] = "EncodeFunction"; +static const char __pyx_k_UTF_8_ENCODING[] = "_UTF_8_ENCODING"; +static const char __pyx_k_ansi_x3_4_1968[] = "ansi_x3.4-1968"; +static const char __pyx_k_ks_c_5601_1987[] = "ks_c_5601-1987"; +static const char __pyx_k_ks_c_5601_1989[] = "ks_c_5601-1989"; +static const char __pyx_k_x_mac_cyrillic[] = "x-mac-cyrillic"; +static const char __pyx_k_x_user_defined[] = "x-user-defined"; +static const char __pyx_k_LABEL_ENCODINGS[] = "_LABEL_ENCODINGS"; +static const char __pyx_k_csiso58gb231280[] = "csiso58gb231280"; +static const char __pyx_k_csisolatingreek[] = "csisolatingreek"; +static const char __pyx_k_iso_10646_ucs_2[] = "iso-10646-ucs-2"; +static const char __pyx_k_iso_2022_cn_ext[] = "iso-2022-cn-ext"; +static const char __pyx_k_iso_8859_1_1987[] = "iso_8859-1:1987"; +static const char __pyx_k_iso_8859_2_1987[] = "iso_8859-2:1987"; +static const char __pyx_k_iso_8859_3_1988[] = "iso_8859-3:1988"; +static const char __pyx_k_iso_8859_4_1988[] = "iso_8859-4:1988"; +static const char __pyx_k_iso_8859_5_1988[] = "iso_8859-5:1988"; +static const char __pyx_k_iso_8859_6_1987[] = "iso_8859-6:1987"; +static const char __pyx_k_iso_8859_7_1987[] = "iso_8859-7:1987"; +static const char __pyx_k_iso_8859_8_1988[] = "iso_8859-8:1988"; +static const char __pyx_k_iso_8859_9_1989[] = "iso_8859-9:1989"; +static const char __pyx_k_w3lib__encoding[] = "w3lib._encoding"; +static const char __pyx_k_x_mac_ukrainian[] = "x-mac-ukrainian"; +static const char __pyx_k_x_unicode20utf8[] = "x-unicode20utf8"; +static const char __pyx_k_ASCII_WHITESPACE[] = "_ASCII_WHITESPACE"; +static const char __pyx_k_csisolatinarabic[] = "csisolatinarabic"; +static const char __pyx_k_csisolatinhebrew[] = "csisolatinhebrew"; +static const char __pyx_k_UTF_16BE_ENCODING[] = "_UTF_16BE_ENCODING"; +static const char __pyx_k_UTF_16LE_ENCODING[] = "_UTF_16LE_ENCODING"; +static const char __pyx_k_short_windows_125[] = "_short_windows_125"; +static const char __pyx_k_unicode_1_1_utf_8[] = "unicode-1-1-utf-8"; +static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_csisolatincyrillic[] = "csisolatincyrillic"; +static const char __pyx_k_cseucpkdfmtjapanese[] = "cseucpkdfmtjapanese"; +static const char __pyx_k_get_output_encoding[] = "_get_output_encoding"; +static const char __pyx_k_w3lib__encoding_pyx[] = "w3lib/_encoding.pyx"; +static const char __pyx_k_REPLACEMENT_ENCODING[] = "_REPLACEMENT_ENCODING"; +static const char __pyx_k_OUTPUT_ENCODING_UTF8_ENCODINGS[] = "_OUTPUT_ENCODING_UTF8_ENCODINGS"; +static const char __pyx_k_does_not_match_any_encoding_lab[] = " does not match any encoding label from the Encoding Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)"; +/* #### Code section: decls ### */ +static PyObject *__pyx_pf_5w3lib_9_encoding__short_windows_125(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_last_digit); /* proto */ +static PyObject *__pyx_pf_5w3lib_9_encoding_2_get_encoder(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_encoding); /* proto */ +static PyObject *__pyx_pf_5w3lib_9_encoding_4_get_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label); /* proto */ +static PyObject *__pyx_pf_5w3lib_9_encoding_6_get_output_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_encoding); /* proto */ +static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_strip = {0, 0, 0, 0, 0}; +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + #endif + PyObject *__pyx_n_s_; + PyObject *__pyx_kp_u_866; + PyObject *__pyx_n_s_ASCII_WHITESPACE; + PyObject *__pyx_n_s_AnyStr; + PyObject *__pyx_n_s_Callable; + PyObject *__pyx_n_s_CodecFunction; + PyObject *__pyx_n_s_DecodeFunction; + PyObject *__pyx_n_s_Dict; + PyObject *__pyx_kp_s_Dict_str_str; + PyObject *__pyx_n_s_EncodeFunction; + PyObject *__pyx_n_s_KeyError; + PyObject *__pyx_n_s_LABEL_ENCODINGS; + PyObject *__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS; + PyObject *__pyx_n_s_REPLACEMENT_ENCODING; + PyObject *__pyx_n_s_Tuple; + PyObject *__pyx_n_s_UTF_16BE_ENCODING; + PyObject *__pyx_n_s_UTF_16LE_ENCODING; + PyObject *__pyx_n_s_UTF_8_ENCODER; + PyObject *__pyx_n_s_UTF_8_ENCODING; + PyObject *__pyx_n_s_ValueError; + PyObject *__pyx_kp_u__2; + PyObject *__pyx_n_s__49; + PyObject *__pyx_kp_u_ansi_x3_4_1968; + PyObject *__pyx_n_u_arabic; + PyObject *__pyx_n_u_ascii; + PyObject *__pyx_kp_u_asmo_708; + PyObject *__pyx_n_s_asyncio_coroutines; + PyObject *__pyx_n_u_big5; + PyObject *__pyx_kp_u_big5_hkscs; + PyObject *__pyx_n_u_chinese; + PyObject *__pyx_n_s_class_getitem; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_kp_u_cn_big5; + PyObject *__pyx_n_s_codec_info; + PyObject *__pyx_n_s_codecs; + PyObject *__pyx_n_u_cp125; + PyObject *__pyx_n_u_cp1252; + PyObject *__pyx_n_u_cp1254; + PyObject *__pyx_n_u_cp819; + PyObject *__pyx_n_u_cp866; + PyObject *__pyx_n_u_cp874; + PyObject *__pyx_n_u_csbig5; + PyObject *__pyx_n_u_cseuckr; + PyObject *__pyx_n_u_cseucpkdfmtjapanese; + PyObject *__pyx_n_u_csgb2312; + PyObject *__pyx_n_u_csibm866; + PyObject *__pyx_n_u_csiso2022jp; + PyObject *__pyx_n_u_csiso2022kr; + PyObject *__pyx_n_u_csiso58gb231280; + PyObject *__pyx_n_u_csiso88596e; + PyObject *__pyx_n_u_csiso88596i; + PyObject *__pyx_n_u_csiso88598e; + PyObject *__pyx_n_u_csiso88598i; + PyObject *__pyx_n_u_csisolatin1; + PyObject *__pyx_n_u_csisolatin2; + PyObject *__pyx_n_u_csisolatin3; + PyObject *__pyx_n_u_csisolatin4; + PyObject *__pyx_n_u_csisolatin5; + PyObject *__pyx_n_u_csisolatin6; + PyObject *__pyx_n_u_csisolatin9; + PyObject *__pyx_n_u_csisolatinarabic; + PyObject *__pyx_n_u_csisolatincyrillic; + PyObject *__pyx_n_u_csisolatingreek; + PyObject *__pyx_n_u_csisolatinhebrew; + PyObject *__pyx_n_u_cskoi8r; + PyObject *__pyx_n_u_csksc56011987; + PyObject *__pyx_n_u_csmacintosh; + PyObject *__pyx_n_u_csshiftjis; + PyObject *__pyx_n_u_csunicode; + PyObject *__pyx_n_u_cyrillic; + PyObject *__pyx_kp_u_does_not_match_any_encoding_lab; + PyObject *__pyx_kp_u_dos_874; + PyObject *__pyx_kp_u_ecma_114; + PyObject *__pyx_kp_u_ecma_118; + PyObject *__pyx_n_u_elot_928; + PyObject *__pyx_n_s_encode; + PyObject *__pyx_n_s_encoding; + PyObject *__pyx_kp_u_euc_jp; + PyObject *__pyx_kp_u_euc_kr; + PyObject *__pyx_n_s_functools; + PyObject *__pyx_n_u_gb18030; + PyObject *__pyx_n_u_gb2312; + PyObject *__pyx_n_u_gb_2312; + PyObject *__pyx_kp_u_gb_2312_80; + PyObject *__pyx_n_u_gbk; + PyObject *__pyx_n_s_get_encoder; + PyObject *__pyx_n_s_get_encoding; + PyObject *__pyx_n_s_get_output_encoding; + PyObject *__pyx_n_u_greek; + PyObject *__pyx_n_u_greek8; + PyObject *__pyx_n_u_hebrew; + PyObject *__pyx_kp_u_hz_gb_2312; + PyObject *__pyx_n_u_ibm819; + PyObject *__pyx_n_u_ibm866; + PyObject *__pyx_n_s_import; + PyObject *__pyx_n_s_infra; + PyObject *__pyx_n_s_initializing; + PyObject *__pyx_n_s_int; + PyObject *__pyx_n_s_is_coroutine; + PyObject *__pyx_n_u_iso88591; + PyObject *__pyx_n_u_iso885910; + PyObject *__pyx_n_u_iso885911; + PyObject *__pyx_n_u_iso885913; + PyObject *__pyx_n_u_iso885914; + PyObject *__pyx_n_u_iso885915; + PyObject *__pyx_n_u_iso88592; + PyObject *__pyx_n_u_iso88593; + PyObject *__pyx_n_u_iso88594; + PyObject *__pyx_n_u_iso88595; + PyObject *__pyx_n_u_iso88596; + PyObject *__pyx_n_u_iso88597; + PyObject *__pyx_n_u_iso88598; + PyObject *__pyx_n_u_iso88599; + PyObject *__pyx_kp_u_iso8859_1; + PyObject *__pyx_kp_u_iso8859_10; + PyObject *__pyx_kp_u_iso8859_11; + PyObject *__pyx_kp_u_iso8859_13; + PyObject *__pyx_kp_u_iso8859_14; + PyObject *__pyx_kp_u_iso8859_15; + PyObject *__pyx_kp_u_iso8859_2; + PyObject *__pyx_kp_u_iso8859_3; + PyObject *__pyx_kp_u_iso8859_4; + PyObject *__pyx_kp_u_iso8859_5; + PyObject *__pyx_kp_u_iso8859_6; + PyObject *__pyx_kp_u_iso8859_7; + PyObject *__pyx_kp_u_iso8859_8; + PyObject *__pyx_kp_u_iso8859_9; + PyObject *__pyx_kp_u_iso_10646_ucs_2; + PyObject *__pyx_kp_u_iso_2022_cn; + PyObject *__pyx_kp_u_iso_2022_cn_ext; + PyObject *__pyx_kp_u_iso_2022_jp; + PyObject *__pyx_kp_u_iso_2022_kr; + PyObject *__pyx_kp_u_iso_8859_1; + PyObject *__pyx_kp_u_iso_8859_10; + PyObject *__pyx_kp_u_iso_8859_11; + PyObject *__pyx_kp_u_iso_8859_13; + PyObject *__pyx_kp_u_iso_8859_14; + PyObject *__pyx_kp_u_iso_8859_15; + PyObject *__pyx_kp_u_iso_8859_15_2; + PyObject *__pyx_kp_u_iso_8859_16; + PyObject *__pyx_kp_u_iso_8859_1_1987; + PyObject *__pyx_kp_u_iso_8859_1_2; + PyObject *__pyx_kp_u_iso_8859_2; + PyObject *__pyx_kp_u_iso_8859_2_1987; + PyObject *__pyx_kp_u_iso_8859_2_2; + PyObject *__pyx_kp_u_iso_8859_3; + PyObject *__pyx_kp_u_iso_8859_3_1988; + PyObject *__pyx_kp_u_iso_8859_3_2; + PyObject *__pyx_kp_u_iso_8859_4; + PyObject *__pyx_kp_u_iso_8859_4_1988; + PyObject *__pyx_kp_u_iso_8859_4_2; + PyObject *__pyx_kp_u_iso_8859_5; + PyObject *__pyx_kp_u_iso_8859_5_1988; + PyObject *__pyx_kp_u_iso_8859_5_2; + PyObject *__pyx_kp_u_iso_8859_6; + PyObject *__pyx_kp_u_iso_8859_6_1987; + PyObject *__pyx_kp_u_iso_8859_6_2; + PyObject *__pyx_kp_u_iso_8859_6_e; + PyObject *__pyx_kp_u_iso_8859_6_i; + PyObject *__pyx_kp_u_iso_8859_7; + PyObject *__pyx_kp_u_iso_8859_7_1987; + PyObject *__pyx_kp_u_iso_8859_7_2; + PyObject *__pyx_kp_u_iso_8859_8; + PyObject *__pyx_kp_u_iso_8859_8_1988; + PyObject *__pyx_kp_u_iso_8859_8_2; + PyObject *__pyx_kp_u_iso_8859_8_e; + PyObject *__pyx_kp_u_iso_8859_8_i; + PyObject *__pyx_kp_u_iso_8859_9; + PyObject *__pyx_kp_u_iso_8859_9_1989; + PyObject *__pyx_kp_u_iso_8859_9_2; + PyObject *__pyx_kp_u_iso_ir_100; + PyObject *__pyx_kp_u_iso_ir_101; + PyObject *__pyx_kp_u_iso_ir_109; + PyObject *__pyx_kp_u_iso_ir_110; + PyObject *__pyx_kp_u_iso_ir_126; + PyObject *__pyx_kp_u_iso_ir_127; + PyObject *__pyx_kp_u_iso_ir_138; + PyObject *__pyx_kp_u_iso_ir_144; + PyObject *__pyx_kp_u_iso_ir_148; + PyObject *__pyx_kp_u_iso_ir_149; + PyObject *__pyx_kp_u_iso_ir_157; + PyObject *__pyx_kp_u_iso_ir_58; + PyObject *__pyx_n_u_koi; + PyObject *__pyx_n_u_koi8; + PyObject *__pyx_kp_u_koi8_r; + PyObject *__pyx_n_u_koi8_r_2; + PyObject *__pyx_kp_u_koi8_ru; + PyObject *__pyx_kp_u_koi8_u; + PyObject *__pyx_n_u_korean; + PyObject *__pyx_kp_u_ks_c_5601_1987; + PyObject *__pyx_kp_u_ks_c_5601_1989; + PyObject *__pyx_n_u_ksc5601; + PyObject *__pyx_n_u_ksc_5601; + PyObject *__pyx_n_u_l1; + PyObject *__pyx_n_u_l2; + PyObject *__pyx_n_u_l3; + PyObject *__pyx_n_u_l4; + PyObject *__pyx_n_u_l5; + PyObject *__pyx_n_u_l6; + PyObject *__pyx_n_u_l9; + PyObject *__pyx_n_s_label; + PyObject *__pyx_n_s_last_digit; + PyObject *__pyx_n_u_latin1; + PyObject *__pyx_n_u_latin2; + PyObject *__pyx_n_u_latin3; + PyObject *__pyx_n_u_latin4; + PyObject *__pyx_n_u_latin5; + PyObject *__pyx_n_u_latin6; + PyObject *__pyx_n_u_logical; + PyObject *__pyx_n_s_lookup; + PyObject *__pyx_n_s_lower; + PyObject *__pyx_n_s_lru_cache; + PyObject *__pyx_n_u_mac; + PyObject *__pyx_kp_u_mac_cyrillic; + PyObject *__pyx_n_u_macintosh; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_maxsize; + PyObject *__pyx_n_u_ms932; + PyObject *__pyx_n_u_ms_kanji; + PyObject *__pyx_n_s_name; + PyObject *__pyx_n_u_replacement; + PyObject *__pyx_n_s_return; + PyObject *__pyx_kp_u_shift_jis; + PyObject *__pyx_n_u_shift_jis_2; + PyObject *__pyx_n_s_short_windows_125; + PyObject *__pyx_n_u_sjis; + PyObject *__pyx_n_s_spec; + PyObject *__pyx_n_s_str; + PyObject *__pyx_n_s_strip; + PyObject *__pyx_n_u_sun_eu_greek; + PyObject *__pyx_n_s_test; + PyObject *__pyx_kp_u_tis_620; + PyObject *__pyx_n_s_typing; + PyObject *__pyx_kp_u_ucs_2; + PyObject *__pyx_n_u_unicode; + PyObject *__pyx_n_u_unicode11utf8; + PyObject *__pyx_n_u_unicode20utf8; + PyObject *__pyx_kp_u_unicode_1_1_utf_8; + PyObject *__pyx_n_u_unicodefeff; + PyObject *__pyx_n_u_unicodefffe; + PyObject *__pyx_kp_u_us_ascii; + PyObject *__pyx_n_u_utf8; + PyObject *__pyx_kp_u_utf_16; + PyObject *__pyx_kp_u_utf_16be; + PyObject *__pyx_kp_u_utf_16le; + PyObject *__pyx_kp_u_utf_8; + PyObject *__pyx_n_u_visual; + PyObject *__pyx_n_s_w3lib__encoding; + PyObject *__pyx_kp_s_w3lib__encoding_pyx; + PyObject *__pyx_kp_u_windows_125; + PyObject *__pyx_kp_u_windows_1252; + PyObject *__pyx_kp_u_windows_1254; + PyObject *__pyx_kp_u_windows_31j; + PyObject *__pyx_kp_u_windows_874; + PyObject *__pyx_kp_u_windows_949; + PyObject *__pyx_kp_u_x_cp125; + PyObject *__pyx_kp_u_x_cp1252; + PyObject *__pyx_kp_u_x_cp1254; + PyObject *__pyx_kp_u_x_euc_jp; + PyObject *__pyx_kp_u_x_gbk; + PyObject *__pyx_kp_u_x_mac_cyrillic; + PyObject *__pyx_kp_u_x_mac_roman; + PyObject *__pyx_kp_u_x_mac_ukrainian; + PyObject *__pyx_kp_u_x_sjis; + PyObject *__pyx_kp_u_x_unicode20utf8; + PyObject *__pyx_kp_u_x_user_defined; + PyObject *__pyx_kp_u_x_x_big5; + PyObject *__pyx_int_0; + PyObject *__pyx_int_1; + PyObject *__pyx_int_3; + PyObject *__pyx_int_5; + PyObject *__pyx_int_6; + PyObject *__pyx_int_7; + PyObject *__pyx_int_8; + PyObject *__pyx_tuple__3; + PyObject *__pyx_tuple__5; + PyObject *__pyx_tuple__6; + PyObject *__pyx_tuple__7; + PyObject *__pyx_tuple__8; + PyObject *__pyx_tuple__9; + PyObject *__pyx_tuple__10; + PyObject *__pyx_tuple__11; + PyObject *__pyx_tuple__12; + PyObject *__pyx_tuple__13; + PyObject *__pyx_tuple__14; + PyObject *__pyx_tuple__15; + PyObject *__pyx_tuple__16; + PyObject *__pyx_tuple__17; + PyObject *__pyx_tuple__18; + PyObject *__pyx_tuple__19; + PyObject *__pyx_tuple__20; + PyObject *__pyx_tuple__21; + PyObject *__pyx_tuple__22; + PyObject *__pyx_tuple__23; + PyObject *__pyx_tuple__24; + PyObject *__pyx_tuple__25; + PyObject *__pyx_tuple__26; + PyObject *__pyx_tuple__27; + PyObject *__pyx_tuple__28; + PyObject *__pyx_tuple__29; + PyObject *__pyx_tuple__30; + PyObject *__pyx_tuple__31; + PyObject *__pyx_tuple__32; + PyObject *__pyx_tuple__33; + PyObject *__pyx_tuple__34; + PyObject *__pyx_tuple__35; + PyObject *__pyx_tuple__36; + PyObject *__pyx_tuple__37; + PyObject *__pyx_tuple__38; + PyObject *__pyx_tuple__39; + PyObject *__pyx_tuple__40; + PyObject *__pyx_tuple__41; + PyObject *__pyx_tuple__42; + PyObject *__pyx_tuple__44; + PyObject *__pyx_tuple__45; + PyObject *__pyx_tuple__47; + PyObject *__pyx_codeobj__4; + PyObject *__pyx_codeobj__43; + PyObject *__pyx_codeobj__46; + PyObject *__pyx_codeobj__48; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_n_s_); + Py_CLEAR(clear_module_state->__pyx_kp_u_866); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_WHITESPACE); + Py_CLEAR(clear_module_state->__pyx_n_s_AnyStr); + Py_CLEAR(clear_module_state->__pyx_n_s_Callable); + Py_CLEAR(clear_module_state->__pyx_n_s_CodecFunction); + Py_CLEAR(clear_module_state->__pyx_n_s_DecodeFunction); + Py_CLEAR(clear_module_state->__pyx_n_s_Dict); + Py_CLEAR(clear_module_state->__pyx_kp_s_Dict_str_str); + Py_CLEAR(clear_module_state->__pyx_n_s_EncodeFunction); + Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); + Py_CLEAR(clear_module_state->__pyx_n_s_LABEL_ENCODINGS); + Py_CLEAR(clear_module_state->__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); + Py_CLEAR(clear_module_state->__pyx_n_s_REPLACEMENT_ENCODING); + Py_CLEAR(clear_module_state->__pyx_n_s_Tuple); + Py_CLEAR(clear_module_state->__pyx_n_s_UTF_16BE_ENCODING); + Py_CLEAR(clear_module_state->__pyx_n_s_UTF_16LE_ENCODING); + Py_CLEAR(clear_module_state->__pyx_n_s_UTF_8_ENCODER); + Py_CLEAR(clear_module_state->__pyx_n_s_UTF_8_ENCODING); + Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); + Py_CLEAR(clear_module_state->__pyx_kp_u__2); + Py_CLEAR(clear_module_state->__pyx_n_s__49); + Py_CLEAR(clear_module_state->__pyx_kp_u_ansi_x3_4_1968); + Py_CLEAR(clear_module_state->__pyx_n_u_arabic); + Py_CLEAR(clear_module_state->__pyx_n_u_ascii); + Py_CLEAR(clear_module_state->__pyx_kp_u_asmo_708); + Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); + Py_CLEAR(clear_module_state->__pyx_n_u_big5); + Py_CLEAR(clear_module_state->__pyx_kp_u_big5_hkscs); + Py_CLEAR(clear_module_state->__pyx_n_u_chinese); + Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_kp_u_cn_big5); + Py_CLEAR(clear_module_state->__pyx_n_s_codec_info); + Py_CLEAR(clear_module_state->__pyx_n_s_codecs); + Py_CLEAR(clear_module_state->__pyx_n_u_cp125); + Py_CLEAR(clear_module_state->__pyx_n_u_cp1252); + Py_CLEAR(clear_module_state->__pyx_n_u_cp1254); + Py_CLEAR(clear_module_state->__pyx_n_u_cp819); + Py_CLEAR(clear_module_state->__pyx_n_u_cp866); + Py_CLEAR(clear_module_state->__pyx_n_u_cp874); + Py_CLEAR(clear_module_state->__pyx_n_u_csbig5); + Py_CLEAR(clear_module_state->__pyx_n_u_cseuckr); + Py_CLEAR(clear_module_state->__pyx_n_u_cseucpkdfmtjapanese); + Py_CLEAR(clear_module_state->__pyx_n_u_csgb2312); + Py_CLEAR(clear_module_state->__pyx_n_u_csibm866); + Py_CLEAR(clear_module_state->__pyx_n_u_csiso2022jp); + Py_CLEAR(clear_module_state->__pyx_n_u_csiso2022kr); + Py_CLEAR(clear_module_state->__pyx_n_u_csiso58gb231280); + Py_CLEAR(clear_module_state->__pyx_n_u_csiso88596e); + Py_CLEAR(clear_module_state->__pyx_n_u_csiso88596i); + Py_CLEAR(clear_module_state->__pyx_n_u_csiso88598e); + Py_CLEAR(clear_module_state->__pyx_n_u_csiso88598i); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin1); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin2); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin3); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin4); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin5); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin6); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin9); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatinarabic); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatincyrillic); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatingreek); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatinhebrew); + Py_CLEAR(clear_module_state->__pyx_n_u_cskoi8r); + Py_CLEAR(clear_module_state->__pyx_n_u_csksc56011987); + Py_CLEAR(clear_module_state->__pyx_n_u_csmacintosh); + Py_CLEAR(clear_module_state->__pyx_n_u_csshiftjis); + Py_CLEAR(clear_module_state->__pyx_n_u_csunicode); + Py_CLEAR(clear_module_state->__pyx_n_u_cyrillic); + Py_CLEAR(clear_module_state->__pyx_kp_u_does_not_match_any_encoding_lab); + Py_CLEAR(clear_module_state->__pyx_kp_u_dos_874); + Py_CLEAR(clear_module_state->__pyx_kp_u_ecma_114); + Py_CLEAR(clear_module_state->__pyx_kp_u_ecma_118); + Py_CLEAR(clear_module_state->__pyx_n_u_elot_928); + Py_CLEAR(clear_module_state->__pyx_n_s_encode); + Py_CLEAR(clear_module_state->__pyx_n_s_encoding); + Py_CLEAR(clear_module_state->__pyx_kp_u_euc_jp); + Py_CLEAR(clear_module_state->__pyx_kp_u_euc_kr); + Py_CLEAR(clear_module_state->__pyx_n_s_functools); + Py_CLEAR(clear_module_state->__pyx_n_u_gb18030); + Py_CLEAR(clear_module_state->__pyx_n_u_gb2312); + Py_CLEAR(clear_module_state->__pyx_n_u_gb_2312); + Py_CLEAR(clear_module_state->__pyx_kp_u_gb_2312_80); + Py_CLEAR(clear_module_state->__pyx_n_u_gbk); + Py_CLEAR(clear_module_state->__pyx_n_s_get_encoder); + Py_CLEAR(clear_module_state->__pyx_n_s_get_encoding); + Py_CLEAR(clear_module_state->__pyx_n_s_get_output_encoding); + Py_CLEAR(clear_module_state->__pyx_n_u_greek); + Py_CLEAR(clear_module_state->__pyx_n_u_greek8); + Py_CLEAR(clear_module_state->__pyx_n_u_hebrew); + Py_CLEAR(clear_module_state->__pyx_kp_u_hz_gb_2312); + Py_CLEAR(clear_module_state->__pyx_n_u_ibm819); + Py_CLEAR(clear_module_state->__pyx_n_u_ibm866); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_n_s_infra); + Py_CLEAR(clear_module_state->__pyx_n_s_initializing); + Py_CLEAR(clear_module_state->__pyx_n_s_int); + Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88591); + Py_CLEAR(clear_module_state->__pyx_n_u_iso885910); + Py_CLEAR(clear_module_state->__pyx_n_u_iso885911); + Py_CLEAR(clear_module_state->__pyx_n_u_iso885913); + Py_CLEAR(clear_module_state->__pyx_n_u_iso885914); + Py_CLEAR(clear_module_state->__pyx_n_u_iso885915); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88592); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88593); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88594); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88595); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88596); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88597); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88598); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88599); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_1); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_10); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_11); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_13); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_14); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_15); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_3); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_4); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_5); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_6); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_7); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_8); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_9); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_10646_ucs_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_2022_cn); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_2022_cn_ext); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_2022_jp); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_2022_kr); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_1); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_10); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_11); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_13); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_14); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_15); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_15_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_16); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_1_1987); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_1_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_2_1987); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_2_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_3); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_3_1988); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_3_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_4); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_4_1988); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_4_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_5); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_5_1988); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_5_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6_1987); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6_e); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6_i); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_7); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_7_1987); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_7_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8_1988); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8_e); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8_i); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_9); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_9_1989); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_9_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_100); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_101); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_109); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_110); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_126); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_127); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_138); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_144); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_148); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_149); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_157); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_58); + Py_CLEAR(clear_module_state->__pyx_n_u_koi); + Py_CLEAR(clear_module_state->__pyx_n_u_koi8); + Py_CLEAR(clear_module_state->__pyx_kp_u_koi8_r); + Py_CLEAR(clear_module_state->__pyx_n_u_koi8_r_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_koi8_ru); + Py_CLEAR(clear_module_state->__pyx_kp_u_koi8_u); + Py_CLEAR(clear_module_state->__pyx_n_u_korean); + Py_CLEAR(clear_module_state->__pyx_kp_u_ks_c_5601_1987); + Py_CLEAR(clear_module_state->__pyx_kp_u_ks_c_5601_1989); + Py_CLEAR(clear_module_state->__pyx_n_u_ksc5601); + Py_CLEAR(clear_module_state->__pyx_n_u_ksc_5601); + Py_CLEAR(clear_module_state->__pyx_n_u_l1); + Py_CLEAR(clear_module_state->__pyx_n_u_l2); + Py_CLEAR(clear_module_state->__pyx_n_u_l3); + Py_CLEAR(clear_module_state->__pyx_n_u_l4); + Py_CLEAR(clear_module_state->__pyx_n_u_l5); + Py_CLEAR(clear_module_state->__pyx_n_u_l6); + Py_CLEAR(clear_module_state->__pyx_n_u_l9); + Py_CLEAR(clear_module_state->__pyx_n_s_label); + Py_CLEAR(clear_module_state->__pyx_n_s_last_digit); + Py_CLEAR(clear_module_state->__pyx_n_u_latin1); + Py_CLEAR(clear_module_state->__pyx_n_u_latin2); + Py_CLEAR(clear_module_state->__pyx_n_u_latin3); + Py_CLEAR(clear_module_state->__pyx_n_u_latin4); + Py_CLEAR(clear_module_state->__pyx_n_u_latin5); + Py_CLEAR(clear_module_state->__pyx_n_u_latin6); + Py_CLEAR(clear_module_state->__pyx_n_u_logical); + Py_CLEAR(clear_module_state->__pyx_n_s_lookup); + Py_CLEAR(clear_module_state->__pyx_n_s_lower); + Py_CLEAR(clear_module_state->__pyx_n_s_lru_cache); + Py_CLEAR(clear_module_state->__pyx_n_u_mac); + Py_CLEAR(clear_module_state->__pyx_kp_u_mac_cyrillic); + Py_CLEAR(clear_module_state->__pyx_n_u_macintosh); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_maxsize); + Py_CLEAR(clear_module_state->__pyx_n_u_ms932); + Py_CLEAR(clear_module_state->__pyx_n_u_ms_kanji); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_u_replacement); + Py_CLEAR(clear_module_state->__pyx_n_s_return); + Py_CLEAR(clear_module_state->__pyx_kp_u_shift_jis); + Py_CLEAR(clear_module_state->__pyx_n_u_shift_jis_2); + Py_CLEAR(clear_module_state->__pyx_n_s_short_windows_125); + Py_CLEAR(clear_module_state->__pyx_n_u_sjis); + Py_CLEAR(clear_module_state->__pyx_n_s_spec); + Py_CLEAR(clear_module_state->__pyx_n_s_str); + Py_CLEAR(clear_module_state->__pyx_n_s_strip); + Py_CLEAR(clear_module_state->__pyx_n_u_sun_eu_greek); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_kp_u_tis_620); + Py_CLEAR(clear_module_state->__pyx_n_s_typing); + Py_CLEAR(clear_module_state->__pyx_kp_u_ucs_2); + Py_CLEAR(clear_module_state->__pyx_n_u_unicode); + Py_CLEAR(clear_module_state->__pyx_n_u_unicode11utf8); + Py_CLEAR(clear_module_state->__pyx_n_u_unicode20utf8); + Py_CLEAR(clear_module_state->__pyx_kp_u_unicode_1_1_utf_8); + Py_CLEAR(clear_module_state->__pyx_n_u_unicodefeff); + Py_CLEAR(clear_module_state->__pyx_n_u_unicodefffe); + Py_CLEAR(clear_module_state->__pyx_kp_u_us_ascii); + Py_CLEAR(clear_module_state->__pyx_n_u_utf8); + Py_CLEAR(clear_module_state->__pyx_kp_u_utf_16); + Py_CLEAR(clear_module_state->__pyx_kp_u_utf_16be); + Py_CLEAR(clear_module_state->__pyx_kp_u_utf_16le); + Py_CLEAR(clear_module_state->__pyx_kp_u_utf_8); + Py_CLEAR(clear_module_state->__pyx_n_u_visual); + Py_CLEAR(clear_module_state->__pyx_n_s_w3lib__encoding); + Py_CLEAR(clear_module_state->__pyx_kp_s_w3lib__encoding_pyx); + Py_CLEAR(clear_module_state->__pyx_kp_u_windows_125); + Py_CLEAR(clear_module_state->__pyx_kp_u_windows_1252); + Py_CLEAR(clear_module_state->__pyx_kp_u_windows_1254); + Py_CLEAR(clear_module_state->__pyx_kp_u_windows_31j); + Py_CLEAR(clear_module_state->__pyx_kp_u_windows_874); + Py_CLEAR(clear_module_state->__pyx_kp_u_windows_949); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_cp125); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_cp1252); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_cp1254); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_euc_jp); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_gbk); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_mac_cyrillic); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_mac_roman); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_mac_ukrainian); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_sjis); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_unicode20utf8); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_user_defined); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_x_big5); + Py_CLEAR(clear_module_state->__pyx_int_0); + Py_CLEAR(clear_module_state->__pyx_int_1); + Py_CLEAR(clear_module_state->__pyx_int_3); + Py_CLEAR(clear_module_state->__pyx_int_5); + Py_CLEAR(clear_module_state->__pyx_int_6); + Py_CLEAR(clear_module_state->__pyx_int_7); + Py_CLEAR(clear_module_state->__pyx_int_8); + Py_CLEAR(clear_module_state->__pyx_tuple__3); + Py_CLEAR(clear_module_state->__pyx_tuple__5); + Py_CLEAR(clear_module_state->__pyx_tuple__6); + Py_CLEAR(clear_module_state->__pyx_tuple__7); + Py_CLEAR(clear_module_state->__pyx_tuple__8); + Py_CLEAR(clear_module_state->__pyx_tuple__9); + Py_CLEAR(clear_module_state->__pyx_tuple__10); + Py_CLEAR(clear_module_state->__pyx_tuple__11); + Py_CLEAR(clear_module_state->__pyx_tuple__12); + Py_CLEAR(clear_module_state->__pyx_tuple__13); + Py_CLEAR(clear_module_state->__pyx_tuple__14); + Py_CLEAR(clear_module_state->__pyx_tuple__15); + Py_CLEAR(clear_module_state->__pyx_tuple__16); + Py_CLEAR(clear_module_state->__pyx_tuple__17); + Py_CLEAR(clear_module_state->__pyx_tuple__18); + Py_CLEAR(clear_module_state->__pyx_tuple__19); + Py_CLEAR(clear_module_state->__pyx_tuple__20); + Py_CLEAR(clear_module_state->__pyx_tuple__21); + Py_CLEAR(clear_module_state->__pyx_tuple__22); + Py_CLEAR(clear_module_state->__pyx_tuple__23); + Py_CLEAR(clear_module_state->__pyx_tuple__24); + Py_CLEAR(clear_module_state->__pyx_tuple__25); + Py_CLEAR(clear_module_state->__pyx_tuple__26); + Py_CLEAR(clear_module_state->__pyx_tuple__27); + Py_CLEAR(clear_module_state->__pyx_tuple__28); + Py_CLEAR(clear_module_state->__pyx_tuple__29); + Py_CLEAR(clear_module_state->__pyx_tuple__30); + Py_CLEAR(clear_module_state->__pyx_tuple__31); + Py_CLEAR(clear_module_state->__pyx_tuple__32); + Py_CLEAR(clear_module_state->__pyx_tuple__33); + Py_CLEAR(clear_module_state->__pyx_tuple__34); + Py_CLEAR(clear_module_state->__pyx_tuple__35); + Py_CLEAR(clear_module_state->__pyx_tuple__36); + Py_CLEAR(clear_module_state->__pyx_tuple__37); + Py_CLEAR(clear_module_state->__pyx_tuple__38); + Py_CLEAR(clear_module_state->__pyx_tuple__39); + Py_CLEAR(clear_module_state->__pyx_tuple__40); + Py_CLEAR(clear_module_state->__pyx_tuple__41); + Py_CLEAR(clear_module_state->__pyx_tuple__42); + Py_CLEAR(clear_module_state->__pyx_tuple__44); + Py_CLEAR(clear_module_state->__pyx_tuple__45); + Py_CLEAR(clear_module_state->__pyx_tuple__47); + Py_CLEAR(clear_module_state->__pyx_codeobj__4); + Py_CLEAR(clear_module_state->__pyx_codeobj__43); + Py_CLEAR(clear_module_state->__pyx_codeobj__46); + Py_CLEAR(clear_module_state->__pyx_codeobj__48); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_n_s_); + Py_VISIT(traverse_module_state->__pyx_kp_u_866); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_WHITESPACE); + Py_VISIT(traverse_module_state->__pyx_n_s_AnyStr); + Py_VISIT(traverse_module_state->__pyx_n_s_Callable); + Py_VISIT(traverse_module_state->__pyx_n_s_CodecFunction); + Py_VISIT(traverse_module_state->__pyx_n_s_DecodeFunction); + Py_VISIT(traverse_module_state->__pyx_n_s_Dict); + Py_VISIT(traverse_module_state->__pyx_kp_s_Dict_str_str); + Py_VISIT(traverse_module_state->__pyx_n_s_EncodeFunction); + Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); + Py_VISIT(traverse_module_state->__pyx_n_s_LABEL_ENCODINGS); + Py_VISIT(traverse_module_state->__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); + Py_VISIT(traverse_module_state->__pyx_n_s_REPLACEMENT_ENCODING); + Py_VISIT(traverse_module_state->__pyx_n_s_Tuple); + Py_VISIT(traverse_module_state->__pyx_n_s_UTF_16BE_ENCODING); + Py_VISIT(traverse_module_state->__pyx_n_s_UTF_16LE_ENCODING); + Py_VISIT(traverse_module_state->__pyx_n_s_UTF_8_ENCODER); + Py_VISIT(traverse_module_state->__pyx_n_s_UTF_8_ENCODING); + Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); + Py_VISIT(traverse_module_state->__pyx_kp_u__2); + Py_VISIT(traverse_module_state->__pyx_n_s__49); + Py_VISIT(traverse_module_state->__pyx_kp_u_ansi_x3_4_1968); + Py_VISIT(traverse_module_state->__pyx_n_u_arabic); + Py_VISIT(traverse_module_state->__pyx_n_u_ascii); + Py_VISIT(traverse_module_state->__pyx_kp_u_asmo_708); + Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); + Py_VISIT(traverse_module_state->__pyx_n_u_big5); + Py_VISIT(traverse_module_state->__pyx_kp_u_big5_hkscs); + Py_VISIT(traverse_module_state->__pyx_n_u_chinese); + Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_kp_u_cn_big5); + Py_VISIT(traverse_module_state->__pyx_n_s_codec_info); + Py_VISIT(traverse_module_state->__pyx_n_s_codecs); + Py_VISIT(traverse_module_state->__pyx_n_u_cp125); + Py_VISIT(traverse_module_state->__pyx_n_u_cp1252); + Py_VISIT(traverse_module_state->__pyx_n_u_cp1254); + Py_VISIT(traverse_module_state->__pyx_n_u_cp819); + Py_VISIT(traverse_module_state->__pyx_n_u_cp866); + Py_VISIT(traverse_module_state->__pyx_n_u_cp874); + Py_VISIT(traverse_module_state->__pyx_n_u_csbig5); + Py_VISIT(traverse_module_state->__pyx_n_u_cseuckr); + Py_VISIT(traverse_module_state->__pyx_n_u_cseucpkdfmtjapanese); + Py_VISIT(traverse_module_state->__pyx_n_u_csgb2312); + Py_VISIT(traverse_module_state->__pyx_n_u_csibm866); + Py_VISIT(traverse_module_state->__pyx_n_u_csiso2022jp); + Py_VISIT(traverse_module_state->__pyx_n_u_csiso2022kr); + Py_VISIT(traverse_module_state->__pyx_n_u_csiso58gb231280); + Py_VISIT(traverse_module_state->__pyx_n_u_csiso88596e); + Py_VISIT(traverse_module_state->__pyx_n_u_csiso88596i); + Py_VISIT(traverse_module_state->__pyx_n_u_csiso88598e); + Py_VISIT(traverse_module_state->__pyx_n_u_csiso88598i); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin1); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin2); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin3); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin4); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin5); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin6); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin9); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatinarabic); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatincyrillic); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatingreek); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatinhebrew); + Py_VISIT(traverse_module_state->__pyx_n_u_cskoi8r); + Py_VISIT(traverse_module_state->__pyx_n_u_csksc56011987); + Py_VISIT(traverse_module_state->__pyx_n_u_csmacintosh); + Py_VISIT(traverse_module_state->__pyx_n_u_csshiftjis); + Py_VISIT(traverse_module_state->__pyx_n_u_csunicode); + Py_VISIT(traverse_module_state->__pyx_n_u_cyrillic); + Py_VISIT(traverse_module_state->__pyx_kp_u_does_not_match_any_encoding_lab); + Py_VISIT(traverse_module_state->__pyx_kp_u_dos_874); + Py_VISIT(traverse_module_state->__pyx_kp_u_ecma_114); + Py_VISIT(traverse_module_state->__pyx_kp_u_ecma_118); + Py_VISIT(traverse_module_state->__pyx_n_u_elot_928); + Py_VISIT(traverse_module_state->__pyx_n_s_encode); + Py_VISIT(traverse_module_state->__pyx_n_s_encoding); + Py_VISIT(traverse_module_state->__pyx_kp_u_euc_jp); + Py_VISIT(traverse_module_state->__pyx_kp_u_euc_kr); + Py_VISIT(traverse_module_state->__pyx_n_s_functools); + Py_VISIT(traverse_module_state->__pyx_n_u_gb18030); + Py_VISIT(traverse_module_state->__pyx_n_u_gb2312); + Py_VISIT(traverse_module_state->__pyx_n_u_gb_2312); + Py_VISIT(traverse_module_state->__pyx_kp_u_gb_2312_80); + Py_VISIT(traverse_module_state->__pyx_n_u_gbk); + Py_VISIT(traverse_module_state->__pyx_n_s_get_encoder); + Py_VISIT(traverse_module_state->__pyx_n_s_get_encoding); + Py_VISIT(traverse_module_state->__pyx_n_s_get_output_encoding); + Py_VISIT(traverse_module_state->__pyx_n_u_greek); + Py_VISIT(traverse_module_state->__pyx_n_u_greek8); + Py_VISIT(traverse_module_state->__pyx_n_u_hebrew); + Py_VISIT(traverse_module_state->__pyx_kp_u_hz_gb_2312); + Py_VISIT(traverse_module_state->__pyx_n_u_ibm819); + Py_VISIT(traverse_module_state->__pyx_n_u_ibm866); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_n_s_infra); + Py_VISIT(traverse_module_state->__pyx_n_s_initializing); + Py_VISIT(traverse_module_state->__pyx_n_s_int); + Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88591); + Py_VISIT(traverse_module_state->__pyx_n_u_iso885910); + Py_VISIT(traverse_module_state->__pyx_n_u_iso885911); + Py_VISIT(traverse_module_state->__pyx_n_u_iso885913); + Py_VISIT(traverse_module_state->__pyx_n_u_iso885914); + Py_VISIT(traverse_module_state->__pyx_n_u_iso885915); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88592); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88593); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88594); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88595); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88596); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88597); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88598); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88599); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_1); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_10); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_11); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_13); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_14); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_15); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_3); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_4); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_5); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_6); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_7); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_8); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_9); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_10646_ucs_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_2022_cn); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_2022_cn_ext); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_2022_jp); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_2022_kr); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_1); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_10); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_11); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_13); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_14); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_15); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_15_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_16); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_1_1987); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_1_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_2_1987); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_2_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_3); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_3_1988); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_3_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_4); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_4_1988); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_4_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_5); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_5_1988); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_5_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6_1987); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6_e); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6_i); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_7); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_7_1987); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_7_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8_1988); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8_e); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8_i); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_9); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_9_1989); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_9_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_100); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_101); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_109); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_110); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_126); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_127); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_138); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_144); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_148); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_149); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_157); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_58); + Py_VISIT(traverse_module_state->__pyx_n_u_koi); + Py_VISIT(traverse_module_state->__pyx_n_u_koi8); + Py_VISIT(traverse_module_state->__pyx_kp_u_koi8_r); + Py_VISIT(traverse_module_state->__pyx_n_u_koi8_r_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_koi8_ru); + Py_VISIT(traverse_module_state->__pyx_kp_u_koi8_u); + Py_VISIT(traverse_module_state->__pyx_n_u_korean); + Py_VISIT(traverse_module_state->__pyx_kp_u_ks_c_5601_1987); + Py_VISIT(traverse_module_state->__pyx_kp_u_ks_c_5601_1989); + Py_VISIT(traverse_module_state->__pyx_n_u_ksc5601); + Py_VISIT(traverse_module_state->__pyx_n_u_ksc_5601); + Py_VISIT(traverse_module_state->__pyx_n_u_l1); + Py_VISIT(traverse_module_state->__pyx_n_u_l2); + Py_VISIT(traverse_module_state->__pyx_n_u_l3); + Py_VISIT(traverse_module_state->__pyx_n_u_l4); + Py_VISIT(traverse_module_state->__pyx_n_u_l5); + Py_VISIT(traverse_module_state->__pyx_n_u_l6); + Py_VISIT(traverse_module_state->__pyx_n_u_l9); + Py_VISIT(traverse_module_state->__pyx_n_s_label); + Py_VISIT(traverse_module_state->__pyx_n_s_last_digit); + Py_VISIT(traverse_module_state->__pyx_n_u_latin1); + Py_VISIT(traverse_module_state->__pyx_n_u_latin2); + Py_VISIT(traverse_module_state->__pyx_n_u_latin3); + Py_VISIT(traverse_module_state->__pyx_n_u_latin4); + Py_VISIT(traverse_module_state->__pyx_n_u_latin5); + Py_VISIT(traverse_module_state->__pyx_n_u_latin6); + Py_VISIT(traverse_module_state->__pyx_n_u_logical); + Py_VISIT(traverse_module_state->__pyx_n_s_lookup); + Py_VISIT(traverse_module_state->__pyx_n_s_lower); + Py_VISIT(traverse_module_state->__pyx_n_s_lru_cache); + Py_VISIT(traverse_module_state->__pyx_n_u_mac); + Py_VISIT(traverse_module_state->__pyx_kp_u_mac_cyrillic); + Py_VISIT(traverse_module_state->__pyx_n_u_macintosh); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_maxsize); + Py_VISIT(traverse_module_state->__pyx_n_u_ms932); + Py_VISIT(traverse_module_state->__pyx_n_u_ms_kanji); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_u_replacement); + Py_VISIT(traverse_module_state->__pyx_n_s_return); + Py_VISIT(traverse_module_state->__pyx_kp_u_shift_jis); + Py_VISIT(traverse_module_state->__pyx_n_u_shift_jis_2); + Py_VISIT(traverse_module_state->__pyx_n_s_short_windows_125); + Py_VISIT(traverse_module_state->__pyx_n_u_sjis); + Py_VISIT(traverse_module_state->__pyx_n_s_spec); + Py_VISIT(traverse_module_state->__pyx_n_s_str); + Py_VISIT(traverse_module_state->__pyx_n_s_strip); + Py_VISIT(traverse_module_state->__pyx_n_u_sun_eu_greek); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_kp_u_tis_620); + Py_VISIT(traverse_module_state->__pyx_n_s_typing); + Py_VISIT(traverse_module_state->__pyx_kp_u_ucs_2); + Py_VISIT(traverse_module_state->__pyx_n_u_unicode); + Py_VISIT(traverse_module_state->__pyx_n_u_unicode11utf8); + Py_VISIT(traverse_module_state->__pyx_n_u_unicode20utf8); + Py_VISIT(traverse_module_state->__pyx_kp_u_unicode_1_1_utf_8); + Py_VISIT(traverse_module_state->__pyx_n_u_unicodefeff); + Py_VISIT(traverse_module_state->__pyx_n_u_unicodefffe); + Py_VISIT(traverse_module_state->__pyx_kp_u_us_ascii); + Py_VISIT(traverse_module_state->__pyx_n_u_utf8); + Py_VISIT(traverse_module_state->__pyx_kp_u_utf_16); + Py_VISIT(traverse_module_state->__pyx_kp_u_utf_16be); + Py_VISIT(traverse_module_state->__pyx_kp_u_utf_16le); + Py_VISIT(traverse_module_state->__pyx_kp_u_utf_8); + Py_VISIT(traverse_module_state->__pyx_n_u_visual); + Py_VISIT(traverse_module_state->__pyx_n_s_w3lib__encoding); + Py_VISIT(traverse_module_state->__pyx_kp_s_w3lib__encoding_pyx); + Py_VISIT(traverse_module_state->__pyx_kp_u_windows_125); + Py_VISIT(traverse_module_state->__pyx_kp_u_windows_1252); + Py_VISIT(traverse_module_state->__pyx_kp_u_windows_1254); + Py_VISIT(traverse_module_state->__pyx_kp_u_windows_31j); + Py_VISIT(traverse_module_state->__pyx_kp_u_windows_874); + Py_VISIT(traverse_module_state->__pyx_kp_u_windows_949); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_cp125); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_cp1252); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_cp1254); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_euc_jp); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_gbk); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_mac_cyrillic); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_mac_roman); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_mac_ukrainian); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_sjis); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_unicode20utf8); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_user_defined); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_x_big5); + Py_VISIT(traverse_module_state->__pyx_int_0); + Py_VISIT(traverse_module_state->__pyx_int_1); + Py_VISIT(traverse_module_state->__pyx_int_3); + Py_VISIT(traverse_module_state->__pyx_int_5); + Py_VISIT(traverse_module_state->__pyx_int_6); + Py_VISIT(traverse_module_state->__pyx_int_7); + Py_VISIT(traverse_module_state->__pyx_int_8); + Py_VISIT(traverse_module_state->__pyx_tuple__3); + Py_VISIT(traverse_module_state->__pyx_tuple__5); + Py_VISIT(traverse_module_state->__pyx_tuple__6); + Py_VISIT(traverse_module_state->__pyx_tuple__7); + Py_VISIT(traverse_module_state->__pyx_tuple__8); + Py_VISIT(traverse_module_state->__pyx_tuple__9); + Py_VISIT(traverse_module_state->__pyx_tuple__10); + Py_VISIT(traverse_module_state->__pyx_tuple__11); + Py_VISIT(traverse_module_state->__pyx_tuple__12); + Py_VISIT(traverse_module_state->__pyx_tuple__13); + Py_VISIT(traverse_module_state->__pyx_tuple__14); + Py_VISIT(traverse_module_state->__pyx_tuple__15); + Py_VISIT(traverse_module_state->__pyx_tuple__16); + Py_VISIT(traverse_module_state->__pyx_tuple__17); + Py_VISIT(traverse_module_state->__pyx_tuple__18); + Py_VISIT(traverse_module_state->__pyx_tuple__19); + Py_VISIT(traverse_module_state->__pyx_tuple__20); + Py_VISIT(traverse_module_state->__pyx_tuple__21); + Py_VISIT(traverse_module_state->__pyx_tuple__22); + Py_VISIT(traverse_module_state->__pyx_tuple__23); + Py_VISIT(traverse_module_state->__pyx_tuple__24); + Py_VISIT(traverse_module_state->__pyx_tuple__25); + Py_VISIT(traverse_module_state->__pyx_tuple__26); + Py_VISIT(traverse_module_state->__pyx_tuple__27); + Py_VISIT(traverse_module_state->__pyx_tuple__28); + Py_VISIT(traverse_module_state->__pyx_tuple__29); + Py_VISIT(traverse_module_state->__pyx_tuple__30); + Py_VISIT(traverse_module_state->__pyx_tuple__31); + Py_VISIT(traverse_module_state->__pyx_tuple__32); + Py_VISIT(traverse_module_state->__pyx_tuple__33); + Py_VISIT(traverse_module_state->__pyx_tuple__34); + Py_VISIT(traverse_module_state->__pyx_tuple__35); + Py_VISIT(traverse_module_state->__pyx_tuple__36); + Py_VISIT(traverse_module_state->__pyx_tuple__37); + Py_VISIT(traverse_module_state->__pyx_tuple__38); + Py_VISIT(traverse_module_state->__pyx_tuple__39); + Py_VISIT(traverse_module_state->__pyx_tuple__40); + Py_VISIT(traverse_module_state->__pyx_tuple__41); + Py_VISIT(traverse_module_state->__pyx_tuple__42); + Py_VISIT(traverse_module_state->__pyx_tuple__44); + Py_VISIT(traverse_module_state->__pyx_tuple__45); + Py_VISIT(traverse_module_state->__pyx_tuple__47); + Py_VISIT(traverse_module_state->__pyx_codeobj__4); + Py_VISIT(traverse_module_state->__pyx_codeobj__43); + Py_VISIT(traverse_module_state->__pyx_codeobj__46); + Py_VISIT(traverse_module_state->__pyx_codeobj__48); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ +#define __pyx_kp_u_866 __pyx_mstate_global->__pyx_kp_u_866 +#define __pyx_n_s_ASCII_WHITESPACE __pyx_mstate_global->__pyx_n_s_ASCII_WHITESPACE +#define __pyx_n_s_AnyStr __pyx_mstate_global->__pyx_n_s_AnyStr +#define __pyx_n_s_Callable __pyx_mstate_global->__pyx_n_s_Callable +#define __pyx_n_s_CodecFunction __pyx_mstate_global->__pyx_n_s_CodecFunction +#define __pyx_n_s_DecodeFunction __pyx_mstate_global->__pyx_n_s_DecodeFunction +#define __pyx_n_s_Dict __pyx_mstate_global->__pyx_n_s_Dict +#define __pyx_kp_s_Dict_str_str __pyx_mstate_global->__pyx_kp_s_Dict_str_str +#define __pyx_n_s_EncodeFunction __pyx_mstate_global->__pyx_n_s_EncodeFunction +#define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError +#define __pyx_n_s_LABEL_ENCODINGS __pyx_mstate_global->__pyx_n_s_LABEL_ENCODINGS +#define __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS __pyx_mstate_global->__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS +#define __pyx_n_s_REPLACEMENT_ENCODING __pyx_mstate_global->__pyx_n_s_REPLACEMENT_ENCODING +#define __pyx_n_s_Tuple __pyx_mstate_global->__pyx_n_s_Tuple +#define __pyx_n_s_UTF_16BE_ENCODING __pyx_mstate_global->__pyx_n_s_UTF_16BE_ENCODING +#define __pyx_n_s_UTF_16LE_ENCODING __pyx_mstate_global->__pyx_n_s_UTF_16LE_ENCODING +#define __pyx_n_s_UTF_8_ENCODER __pyx_mstate_global->__pyx_n_s_UTF_8_ENCODER +#define __pyx_n_s_UTF_8_ENCODING __pyx_mstate_global->__pyx_n_s_UTF_8_ENCODING +#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError +#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 +#define __pyx_n_s__49 __pyx_mstate_global->__pyx_n_s__49 +#define __pyx_kp_u_ansi_x3_4_1968 __pyx_mstate_global->__pyx_kp_u_ansi_x3_4_1968 +#define __pyx_n_u_arabic __pyx_mstate_global->__pyx_n_u_arabic +#define __pyx_n_u_ascii __pyx_mstate_global->__pyx_n_u_ascii +#define __pyx_kp_u_asmo_708 __pyx_mstate_global->__pyx_kp_u_asmo_708 +#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines +#define __pyx_n_u_big5 __pyx_mstate_global->__pyx_n_u_big5 +#define __pyx_kp_u_big5_hkscs __pyx_mstate_global->__pyx_kp_u_big5_hkscs +#define __pyx_n_u_chinese __pyx_mstate_global->__pyx_n_u_chinese +#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_kp_u_cn_big5 __pyx_mstate_global->__pyx_kp_u_cn_big5 +#define __pyx_n_s_codec_info __pyx_mstate_global->__pyx_n_s_codec_info +#define __pyx_n_s_codecs __pyx_mstate_global->__pyx_n_s_codecs +#define __pyx_n_u_cp125 __pyx_mstate_global->__pyx_n_u_cp125 +#define __pyx_n_u_cp1252 __pyx_mstate_global->__pyx_n_u_cp1252 +#define __pyx_n_u_cp1254 __pyx_mstate_global->__pyx_n_u_cp1254 +#define __pyx_n_u_cp819 __pyx_mstate_global->__pyx_n_u_cp819 +#define __pyx_n_u_cp866 __pyx_mstate_global->__pyx_n_u_cp866 +#define __pyx_n_u_cp874 __pyx_mstate_global->__pyx_n_u_cp874 +#define __pyx_n_u_csbig5 __pyx_mstate_global->__pyx_n_u_csbig5 +#define __pyx_n_u_cseuckr __pyx_mstate_global->__pyx_n_u_cseuckr +#define __pyx_n_u_cseucpkdfmtjapanese __pyx_mstate_global->__pyx_n_u_cseucpkdfmtjapanese +#define __pyx_n_u_csgb2312 __pyx_mstate_global->__pyx_n_u_csgb2312 +#define __pyx_n_u_csibm866 __pyx_mstate_global->__pyx_n_u_csibm866 +#define __pyx_n_u_csiso2022jp __pyx_mstate_global->__pyx_n_u_csiso2022jp +#define __pyx_n_u_csiso2022kr __pyx_mstate_global->__pyx_n_u_csiso2022kr +#define __pyx_n_u_csiso58gb231280 __pyx_mstate_global->__pyx_n_u_csiso58gb231280 +#define __pyx_n_u_csiso88596e __pyx_mstate_global->__pyx_n_u_csiso88596e +#define __pyx_n_u_csiso88596i __pyx_mstate_global->__pyx_n_u_csiso88596i +#define __pyx_n_u_csiso88598e __pyx_mstate_global->__pyx_n_u_csiso88598e +#define __pyx_n_u_csiso88598i __pyx_mstate_global->__pyx_n_u_csiso88598i +#define __pyx_n_u_csisolatin1 __pyx_mstate_global->__pyx_n_u_csisolatin1 +#define __pyx_n_u_csisolatin2 __pyx_mstate_global->__pyx_n_u_csisolatin2 +#define __pyx_n_u_csisolatin3 __pyx_mstate_global->__pyx_n_u_csisolatin3 +#define __pyx_n_u_csisolatin4 __pyx_mstate_global->__pyx_n_u_csisolatin4 +#define __pyx_n_u_csisolatin5 __pyx_mstate_global->__pyx_n_u_csisolatin5 +#define __pyx_n_u_csisolatin6 __pyx_mstate_global->__pyx_n_u_csisolatin6 +#define __pyx_n_u_csisolatin9 __pyx_mstate_global->__pyx_n_u_csisolatin9 +#define __pyx_n_u_csisolatinarabic __pyx_mstate_global->__pyx_n_u_csisolatinarabic +#define __pyx_n_u_csisolatincyrillic __pyx_mstate_global->__pyx_n_u_csisolatincyrillic +#define __pyx_n_u_csisolatingreek __pyx_mstate_global->__pyx_n_u_csisolatingreek +#define __pyx_n_u_csisolatinhebrew __pyx_mstate_global->__pyx_n_u_csisolatinhebrew +#define __pyx_n_u_cskoi8r __pyx_mstate_global->__pyx_n_u_cskoi8r +#define __pyx_n_u_csksc56011987 __pyx_mstate_global->__pyx_n_u_csksc56011987 +#define __pyx_n_u_csmacintosh __pyx_mstate_global->__pyx_n_u_csmacintosh +#define __pyx_n_u_csshiftjis __pyx_mstate_global->__pyx_n_u_csshiftjis +#define __pyx_n_u_csunicode __pyx_mstate_global->__pyx_n_u_csunicode +#define __pyx_n_u_cyrillic __pyx_mstate_global->__pyx_n_u_cyrillic +#define __pyx_kp_u_does_not_match_any_encoding_lab __pyx_mstate_global->__pyx_kp_u_does_not_match_any_encoding_lab +#define __pyx_kp_u_dos_874 __pyx_mstate_global->__pyx_kp_u_dos_874 +#define __pyx_kp_u_ecma_114 __pyx_mstate_global->__pyx_kp_u_ecma_114 +#define __pyx_kp_u_ecma_118 __pyx_mstate_global->__pyx_kp_u_ecma_118 +#define __pyx_n_u_elot_928 __pyx_mstate_global->__pyx_n_u_elot_928 +#define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode +#define __pyx_n_s_encoding __pyx_mstate_global->__pyx_n_s_encoding +#define __pyx_kp_u_euc_jp __pyx_mstate_global->__pyx_kp_u_euc_jp +#define __pyx_kp_u_euc_kr __pyx_mstate_global->__pyx_kp_u_euc_kr +#define __pyx_n_s_functools __pyx_mstate_global->__pyx_n_s_functools +#define __pyx_n_u_gb18030 __pyx_mstate_global->__pyx_n_u_gb18030 +#define __pyx_n_u_gb2312 __pyx_mstate_global->__pyx_n_u_gb2312 +#define __pyx_n_u_gb_2312 __pyx_mstate_global->__pyx_n_u_gb_2312 +#define __pyx_kp_u_gb_2312_80 __pyx_mstate_global->__pyx_kp_u_gb_2312_80 +#define __pyx_n_u_gbk __pyx_mstate_global->__pyx_n_u_gbk +#define __pyx_n_s_get_encoder __pyx_mstate_global->__pyx_n_s_get_encoder +#define __pyx_n_s_get_encoding __pyx_mstate_global->__pyx_n_s_get_encoding +#define __pyx_n_s_get_output_encoding __pyx_mstate_global->__pyx_n_s_get_output_encoding +#define __pyx_n_u_greek __pyx_mstate_global->__pyx_n_u_greek +#define __pyx_n_u_greek8 __pyx_mstate_global->__pyx_n_u_greek8 +#define __pyx_n_u_hebrew __pyx_mstate_global->__pyx_n_u_hebrew +#define __pyx_kp_u_hz_gb_2312 __pyx_mstate_global->__pyx_kp_u_hz_gb_2312 +#define __pyx_n_u_ibm819 __pyx_mstate_global->__pyx_n_u_ibm819 +#define __pyx_n_u_ibm866 __pyx_mstate_global->__pyx_n_u_ibm866 +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_n_s_infra __pyx_mstate_global->__pyx_n_s_infra +#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing +#define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int +#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine +#define __pyx_n_u_iso88591 __pyx_mstate_global->__pyx_n_u_iso88591 +#define __pyx_n_u_iso885910 __pyx_mstate_global->__pyx_n_u_iso885910 +#define __pyx_n_u_iso885911 __pyx_mstate_global->__pyx_n_u_iso885911 +#define __pyx_n_u_iso885913 __pyx_mstate_global->__pyx_n_u_iso885913 +#define __pyx_n_u_iso885914 __pyx_mstate_global->__pyx_n_u_iso885914 +#define __pyx_n_u_iso885915 __pyx_mstate_global->__pyx_n_u_iso885915 +#define __pyx_n_u_iso88592 __pyx_mstate_global->__pyx_n_u_iso88592 +#define __pyx_n_u_iso88593 __pyx_mstate_global->__pyx_n_u_iso88593 +#define __pyx_n_u_iso88594 __pyx_mstate_global->__pyx_n_u_iso88594 +#define __pyx_n_u_iso88595 __pyx_mstate_global->__pyx_n_u_iso88595 +#define __pyx_n_u_iso88596 __pyx_mstate_global->__pyx_n_u_iso88596 +#define __pyx_n_u_iso88597 __pyx_mstate_global->__pyx_n_u_iso88597 +#define __pyx_n_u_iso88598 __pyx_mstate_global->__pyx_n_u_iso88598 +#define __pyx_n_u_iso88599 __pyx_mstate_global->__pyx_n_u_iso88599 +#define __pyx_kp_u_iso8859_1 __pyx_mstate_global->__pyx_kp_u_iso8859_1 +#define __pyx_kp_u_iso8859_10 __pyx_mstate_global->__pyx_kp_u_iso8859_10 +#define __pyx_kp_u_iso8859_11 __pyx_mstate_global->__pyx_kp_u_iso8859_11 +#define __pyx_kp_u_iso8859_13 __pyx_mstate_global->__pyx_kp_u_iso8859_13 +#define __pyx_kp_u_iso8859_14 __pyx_mstate_global->__pyx_kp_u_iso8859_14 +#define __pyx_kp_u_iso8859_15 __pyx_mstate_global->__pyx_kp_u_iso8859_15 +#define __pyx_kp_u_iso8859_2 __pyx_mstate_global->__pyx_kp_u_iso8859_2 +#define __pyx_kp_u_iso8859_3 __pyx_mstate_global->__pyx_kp_u_iso8859_3 +#define __pyx_kp_u_iso8859_4 __pyx_mstate_global->__pyx_kp_u_iso8859_4 +#define __pyx_kp_u_iso8859_5 __pyx_mstate_global->__pyx_kp_u_iso8859_5 +#define __pyx_kp_u_iso8859_6 __pyx_mstate_global->__pyx_kp_u_iso8859_6 +#define __pyx_kp_u_iso8859_7 __pyx_mstate_global->__pyx_kp_u_iso8859_7 +#define __pyx_kp_u_iso8859_8 __pyx_mstate_global->__pyx_kp_u_iso8859_8 +#define __pyx_kp_u_iso8859_9 __pyx_mstate_global->__pyx_kp_u_iso8859_9 +#define __pyx_kp_u_iso_10646_ucs_2 __pyx_mstate_global->__pyx_kp_u_iso_10646_ucs_2 +#define __pyx_kp_u_iso_2022_cn __pyx_mstate_global->__pyx_kp_u_iso_2022_cn +#define __pyx_kp_u_iso_2022_cn_ext __pyx_mstate_global->__pyx_kp_u_iso_2022_cn_ext +#define __pyx_kp_u_iso_2022_jp __pyx_mstate_global->__pyx_kp_u_iso_2022_jp +#define __pyx_kp_u_iso_2022_kr __pyx_mstate_global->__pyx_kp_u_iso_2022_kr +#define __pyx_kp_u_iso_8859_1 __pyx_mstate_global->__pyx_kp_u_iso_8859_1 +#define __pyx_kp_u_iso_8859_10 __pyx_mstate_global->__pyx_kp_u_iso_8859_10 +#define __pyx_kp_u_iso_8859_11 __pyx_mstate_global->__pyx_kp_u_iso_8859_11 +#define __pyx_kp_u_iso_8859_13 __pyx_mstate_global->__pyx_kp_u_iso_8859_13 +#define __pyx_kp_u_iso_8859_14 __pyx_mstate_global->__pyx_kp_u_iso_8859_14 +#define __pyx_kp_u_iso_8859_15 __pyx_mstate_global->__pyx_kp_u_iso_8859_15 +#define __pyx_kp_u_iso_8859_15_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_15_2 +#define __pyx_kp_u_iso_8859_16 __pyx_mstate_global->__pyx_kp_u_iso_8859_16 +#define __pyx_kp_u_iso_8859_1_1987 __pyx_mstate_global->__pyx_kp_u_iso_8859_1_1987 +#define __pyx_kp_u_iso_8859_1_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_1_2 +#define __pyx_kp_u_iso_8859_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_2 +#define __pyx_kp_u_iso_8859_2_1987 __pyx_mstate_global->__pyx_kp_u_iso_8859_2_1987 +#define __pyx_kp_u_iso_8859_2_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_2_2 +#define __pyx_kp_u_iso_8859_3 __pyx_mstate_global->__pyx_kp_u_iso_8859_3 +#define __pyx_kp_u_iso_8859_3_1988 __pyx_mstate_global->__pyx_kp_u_iso_8859_3_1988 +#define __pyx_kp_u_iso_8859_3_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_3_2 +#define __pyx_kp_u_iso_8859_4 __pyx_mstate_global->__pyx_kp_u_iso_8859_4 +#define __pyx_kp_u_iso_8859_4_1988 __pyx_mstate_global->__pyx_kp_u_iso_8859_4_1988 +#define __pyx_kp_u_iso_8859_4_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_4_2 +#define __pyx_kp_u_iso_8859_5 __pyx_mstate_global->__pyx_kp_u_iso_8859_5 +#define __pyx_kp_u_iso_8859_5_1988 __pyx_mstate_global->__pyx_kp_u_iso_8859_5_1988 +#define __pyx_kp_u_iso_8859_5_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_5_2 +#define __pyx_kp_u_iso_8859_6 __pyx_mstate_global->__pyx_kp_u_iso_8859_6 +#define __pyx_kp_u_iso_8859_6_1987 __pyx_mstate_global->__pyx_kp_u_iso_8859_6_1987 +#define __pyx_kp_u_iso_8859_6_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_6_2 +#define __pyx_kp_u_iso_8859_6_e __pyx_mstate_global->__pyx_kp_u_iso_8859_6_e +#define __pyx_kp_u_iso_8859_6_i __pyx_mstate_global->__pyx_kp_u_iso_8859_6_i +#define __pyx_kp_u_iso_8859_7 __pyx_mstate_global->__pyx_kp_u_iso_8859_7 +#define __pyx_kp_u_iso_8859_7_1987 __pyx_mstate_global->__pyx_kp_u_iso_8859_7_1987 +#define __pyx_kp_u_iso_8859_7_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_7_2 +#define __pyx_kp_u_iso_8859_8 __pyx_mstate_global->__pyx_kp_u_iso_8859_8 +#define __pyx_kp_u_iso_8859_8_1988 __pyx_mstate_global->__pyx_kp_u_iso_8859_8_1988 +#define __pyx_kp_u_iso_8859_8_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_8_2 +#define __pyx_kp_u_iso_8859_8_e __pyx_mstate_global->__pyx_kp_u_iso_8859_8_e +#define __pyx_kp_u_iso_8859_8_i __pyx_mstate_global->__pyx_kp_u_iso_8859_8_i +#define __pyx_kp_u_iso_8859_9 __pyx_mstate_global->__pyx_kp_u_iso_8859_9 +#define __pyx_kp_u_iso_8859_9_1989 __pyx_mstate_global->__pyx_kp_u_iso_8859_9_1989 +#define __pyx_kp_u_iso_8859_9_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_9_2 +#define __pyx_kp_u_iso_ir_100 __pyx_mstate_global->__pyx_kp_u_iso_ir_100 +#define __pyx_kp_u_iso_ir_101 __pyx_mstate_global->__pyx_kp_u_iso_ir_101 +#define __pyx_kp_u_iso_ir_109 __pyx_mstate_global->__pyx_kp_u_iso_ir_109 +#define __pyx_kp_u_iso_ir_110 __pyx_mstate_global->__pyx_kp_u_iso_ir_110 +#define __pyx_kp_u_iso_ir_126 __pyx_mstate_global->__pyx_kp_u_iso_ir_126 +#define __pyx_kp_u_iso_ir_127 __pyx_mstate_global->__pyx_kp_u_iso_ir_127 +#define __pyx_kp_u_iso_ir_138 __pyx_mstate_global->__pyx_kp_u_iso_ir_138 +#define __pyx_kp_u_iso_ir_144 __pyx_mstate_global->__pyx_kp_u_iso_ir_144 +#define __pyx_kp_u_iso_ir_148 __pyx_mstate_global->__pyx_kp_u_iso_ir_148 +#define __pyx_kp_u_iso_ir_149 __pyx_mstate_global->__pyx_kp_u_iso_ir_149 +#define __pyx_kp_u_iso_ir_157 __pyx_mstate_global->__pyx_kp_u_iso_ir_157 +#define __pyx_kp_u_iso_ir_58 __pyx_mstate_global->__pyx_kp_u_iso_ir_58 +#define __pyx_n_u_koi __pyx_mstate_global->__pyx_n_u_koi +#define __pyx_n_u_koi8 __pyx_mstate_global->__pyx_n_u_koi8 +#define __pyx_kp_u_koi8_r __pyx_mstate_global->__pyx_kp_u_koi8_r +#define __pyx_n_u_koi8_r_2 __pyx_mstate_global->__pyx_n_u_koi8_r_2 +#define __pyx_kp_u_koi8_ru __pyx_mstate_global->__pyx_kp_u_koi8_ru +#define __pyx_kp_u_koi8_u __pyx_mstate_global->__pyx_kp_u_koi8_u +#define __pyx_n_u_korean __pyx_mstate_global->__pyx_n_u_korean +#define __pyx_kp_u_ks_c_5601_1987 __pyx_mstate_global->__pyx_kp_u_ks_c_5601_1987 +#define __pyx_kp_u_ks_c_5601_1989 __pyx_mstate_global->__pyx_kp_u_ks_c_5601_1989 +#define __pyx_n_u_ksc5601 __pyx_mstate_global->__pyx_n_u_ksc5601 +#define __pyx_n_u_ksc_5601 __pyx_mstate_global->__pyx_n_u_ksc_5601 +#define __pyx_n_u_l1 __pyx_mstate_global->__pyx_n_u_l1 +#define __pyx_n_u_l2 __pyx_mstate_global->__pyx_n_u_l2 +#define __pyx_n_u_l3 __pyx_mstate_global->__pyx_n_u_l3 +#define __pyx_n_u_l4 __pyx_mstate_global->__pyx_n_u_l4 +#define __pyx_n_u_l5 __pyx_mstate_global->__pyx_n_u_l5 +#define __pyx_n_u_l6 __pyx_mstate_global->__pyx_n_u_l6 +#define __pyx_n_u_l9 __pyx_mstate_global->__pyx_n_u_l9 +#define __pyx_n_s_label __pyx_mstate_global->__pyx_n_s_label +#define __pyx_n_s_last_digit __pyx_mstate_global->__pyx_n_s_last_digit +#define __pyx_n_u_latin1 __pyx_mstate_global->__pyx_n_u_latin1 +#define __pyx_n_u_latin2 __pyx_mstate_global->__pyx_n_u_latin2 +#define __pyx_n_u_latin3 __pyx_mstate_global->__pyx_n_u_latin3 +#define __pyx_n_u_latin4 __pyx_mstate_global->__pyx_n_u_latin4 +#define __pyx_n_u_latin5 __pyx_mstate_global->__pyx_n_u_latin5 +#define __pyx_n_u_latin6 __pyx_mstate_global->__pyx_n_u_latin6 +#define __pyx_n_u_logical __pyx_mstate_global->__pyx_n_u_logical +#define __pyx_n_s_lookup __pyx_mstate_global->__pyx_n_s_lookup +#define __pyx_n_s_lower __pyx_mstate_global->__pyx_n_s_lower +#define __pyx_n_s_lru_cache __pyx_mstate_global->__pyx_n_s_lru_cache +#define __pyx_n_u_mac __pyx_mstate_global->__pyx_n_u_mac +#define __pyx_kp_u_mac_cyrillic __pyx_mstate_global->__pyx_kp_u_mac_cyrillic +#define __pyx_n_u_macintosh __pyx_mstate_global->__pyx_n_u_macintosh +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_maxsize __pyx_mstate_global->__pyx_n_s_maxsize +#define __pyx_n_u_ms932 __pyx_mstate_global->__pyx_n_u_ms932 +#define __pyx_n_u_ms_kanji __pyx_mstate_global->__pyx_n_u_ms_kanji +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_u_replacement __pyx_mstate_global->__pyx_n_u_replacement +#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return +#define __pyx_kp_u_shift_jis __pyx_mstate_global->__pyx_kp_u_shift_jis +#define __pyx_n_u_shift_jis_2 __pyx_mstate_global->__pyx_n_u_shift_jis_2 +#define __pyx_n_s_short_windows_125 __pyx_mstate_global->__pyx_n_s_short_windows_125 +#define __pyx_n_u_sjis __pyx_mstate_global->__pyx_n_u_sjis +#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec +#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str +#define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip +#define __pyx_n_u_sun_eu_greek __pyx_mstate_global->__pyx_n_u_sun_eu_greek +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_kp_u_tis_620 __pyx_mstate_global->__pyx_kp_u_tis_620 +#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing +#define __pyx_kp_u_ucs_2 __pyx_mstate_global->__pyx_kp_u_ucs_2 +#define __pyx_n_u_unicode __pyx_mstate_global->__pyx_n_u_unicode +#define __pyx_n_u_unicode11utf8 __pyx_mstate_global->__pyx_n_u_unicode11utf8 +#define __pyx_n_u_unicode20utf8 __pyx_mstate_global->__pyx_n_u_unicode20utf8 +#define __pyx_kp_u_unicode_1_1_utf_8 __pyx_mstate_global->__pyx_kp_u_unicode_1_1_utf_8 +#define __pyx_n_u_unicodefeff __pyx_mstate_global->__pyx_n_u_unicodefeff +#define __pyx_n_u_unicodefffe __pyx_mstate_global->__pyx_n_u_unicodefffe +#define __pyx_kp_u_us_ascii __pyx_mstate_global->__pyx_kp_u_us_ascii +#define __pyx_n_u_utf8 __pyx_mstate_global->__pyx_n_u_utf8 +#define __pyx_kp_u_utf_16 __pyx_mstate_global->__pyx_kp_u_utf_16 +#define __pyx_kp_u_utf_16be __pyx_mstate_global->__pyx_kp_u_utf_16be +#define __pyx_kp_u_utf_16le __pyx_mstate_global->__pyx_kp_u_utf_16le +#define __pyx_kp_u_utf_8 __pyx_mstate_global->__pyx_kp_u_utf_8 +#define __pyx_n_u_visual __pyx_mstate_global->__pyx_n_u_visual +#define __pyx_n_s_w3lib__encoding __pyx_mstate_global->__pyx_n_s_w3lib__encoding +#define __pyx_kp_s_w3lib__encoding_pyx __pyx_mstate_global->__pyx_kp_s_w3lib__encoding_pyx +#define __pyx_kp_u_windows_125 __pyx_mstate_global->__pyx_kp_u_windows_125 +#define __pyx_kp_u_windows_1252 __pyx_mstate_global->__pyx_kp_u_windows_1252 +#define __pyx_kp_u_windows_1254 __pyx_mstate_global->__pyx_kp_u_windows_1254 +#define __pyx_kp_u_windows_31j __pyx_mstate_global->__pyx_kp_u_windows_31j +#define __pyx_kp_u_windows_874 __pyx_mstate_global->__pyx_kp_u_windows_874 +#define __pyx_kp_u_windows_949 __pyx_mstate_global->__pyx_kp_u_windows_949 +#define __pyx_kp_u_x_cp125 __pyx_mstate_global->__pyx_kp_u_x_cp125 +#define __pyx_kp_u_x_cp1252 __pyx_mstate_global->__pyx_kp_u_x_cp1252 +#define __pyx_kp_u_x_cp1254 __pyx_mstate_global->__pyx_kp_u_x_cp1254 +#define __pyx_kp_u_x_euc_jp __pyx_mstate_global->__pyx_kp_u_x_euc_jp +#define __pyx_kp_u_x_gbk __pyx_mstate_global->__pyx_kp_u_x_gbk +#define __pyx_kp_u_x_mac_cyrillic __pyx_mstate_global->__pyx_kp_u_x_mac_cyrillic +#define __pyx_kp_u_x_mac_roman __pyx_mstate_global->__pyx_kp_u_x_mac_roman +#define __pyx_kp_u_x_mac_ukrainian __pyx_mstate_global->__pyx_kp_u_x_mac_ukrainian +#define __pyx_kp_u_x_sjis __pyx_mstate_global->__pyx_kp_u_x_sjis +#define __pyx_kp_u_x_unicode20utf8 __pyx_mstate_global->__pyx_kp_u_x_unicode20utf8 +#define __pyx_kp_u_x_user_defined __pyx_mstate_global->__pyx_kp_u_x_user_defined +#define __pyx_kp_u_x_x_big5 __pyx_mstate_global->__pyx_kp_u_x_x_big5 +#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 +#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 +#define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 +#define __pyx_int_5 __pyx_mstate_global->__pyx_int_5 +#define __pyx_int_6 __pyx_mstate_global->__pyx_int_6 +#define __pyx_int_7 __pyx_mstate_global->__pyx_int_7 +#define __pyx_int_8 __pyx_mstate_global->__pyx_int_8 +#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 +#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 +#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 +#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 +#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 +#define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 +#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 +#define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 +#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 +#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 +#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 +#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 +#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 +#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 +#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 +#define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 +#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 +#define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 +#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 +#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 +#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 +#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 +#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 +#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 +#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 +#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 +#define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 +#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 +#define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 +#define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 +#define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 +#define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 +#define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 +#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 +#define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 +#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 +#define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 +#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 +#define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 +#define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44 +#define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 +#define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 +#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 +#define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43 +#define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 +#define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 +/* #### Code section: module_code ### */ + +/* "w3lib/_encoding.pyx":15 + * + * + * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< + * return { + * label: f"windows-125{last_digit}" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_9_encoding_1_short_windows_125(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_9_encoding__short_windows_125, "_short_windows_125(int last_digit: int) -> Dict[str, str]"); +static PyMethodDef __pyx_mdef_5w3lib_9_encoding_1_short_windows_125 = {"_short_windows_125", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_9_encoding_1_short_windows_125, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_9_encoding__short_windows_125}; +static PyObject *__pyx_pw_5w3lib_9_encoding_1_short_windows_125(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_last_digit = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_short_windows_125 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_last_digit,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_last_digit)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 15, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_short_windows_125") < 0)) __PYX_ERR(0, 15, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_last_digit = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_short_windows_125", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 15, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._encoding._short_windows_125", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_digit), (&PyInt_Type), 0, "last_digit", 1))) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_9_encoding__short_windows_125(__pyx_self, __pyx_v_last_digit); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_9_encoding__short_windows_125(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_last_digit) { + PyObject *__pyx_7genexpr__pyx_v_label = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_short_windows_125", 1); + + /* "w3lib/_encoding.pyx":16 + * + * def _short_windows_125(last_digit: int) -> Dict[str, str]: + * return { # <<<<<<<<<<<<<< + * label: f"windows-125{last_digit}" + * for label in ( + */ + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "w3lib/_encoding.pyx":19 + * label: f"windows-125{last_digit}" + * for label in ( + * f"cp125{last_digit}", # <<<<<<<<<<<<<< + * f"windows-125{last_digit}", + * f"x-cp125{last_digit}", + */ + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_n_u_cp125, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_encoding.pyx":20 + * for label in ( + * f"cp125{last_digit}", + * f"windows-125{last_digit}", # <<<<<<<<<<<<<< + * f"x-cp125{last_digit}", + * ) + */ + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_windows_125, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_encoding.pyx":21 + * f"cp125{last_digit}", + * f"windows-125{last_digit}", + * f"x-cp125{last_digit}", # <<<<<<<<<<<<<< + * ) + * } + */ + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_x_cp125, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_encoding.pyx":19 + * label: f"windows-125{last_digit}" + * for label in ( + * f"cp125{last_digit}", # <<<<<<<<<<<<<< + * f"windows-125{last_digit}", + * f"x-cp125{last_digit}", + */ + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 19, __pyx_L5_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 19, __pyx_L5_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5)) __PYX_ERR(0, 19, __pyx_L5_error); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + + /* "w3lib/_encoding.pyx":18 + * return { + * label: f"windows-125{last_digit}" + * for label in ( # <<<<<<<<<<<<<< + * f"cp125{last_digit}", + * f"windows-125{last_digit}", + */ + __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); + __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_6 >= 3) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 18, __pyx_L5_error) + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_label, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "w3lib/_encoding.pyx":17 + * def _short_windows_125(last_digit: int) -> Dict[str, str]: + * return { + * label: f"windows-125{last_digit}" # <<<<<<<<<<<<<< + * for label in ( + * f"cp125{last_digit}", + */ + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_windows_125, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 17, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":18 + * return { + * label: f"windows-125{last_digit}" + * for label in ( # <<<<<<<<<<<<<< + * f"cp125{last_digit}", + * f"windows-125{last_digit}", + */ + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_label); __pyx_7genexpr__pyx_v_label = 0; + goto __pyx_L9_exit_scope; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_label); __pyx_7genexpr__pyx_v_label = 0; + goto __pyx_L1_error; + __pyx_L9_exit_scope:; + } /* exit inner scope */ + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_encoding.pyx":15 + * + * + * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< + * return { + * label: f"windows-125{last_digit}" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("w3lib._encoding._short_windows_125", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_label); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_encoding.pyx":416 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoder(encoding: str) -> EncodeFunction: + * codec_info = codecs.lookup(encoding) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_9_encoding_3_get_encoder(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_9_encoding_2_get_encoder, "_get_encoder(unicode encoding: str) -> EncodeFunction"); +static PyMethodDef __pyx_mdef_5w3lib_9_encoding_3_get_encoder = {"_get_encoder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_9_encoding_3_get_encoder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_9_encoding_2_get_encoder}; +static PyObject *__pyx_pw_5w3lib_9_encoding_3_get_encoder(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_encoding = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_encoder (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_encoding,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_encoder") < 0)) __PYX_ERR(0, 416, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_encoding = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_get_encoder", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 416, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._encoding._get_encoder", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_9_encoding_2_get_encoder(__pyx_self, __pyx_v_encoding); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_9_encoding_2_get_encoder(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_encoding) { + PyObject *__pyx_v_codec_info = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_encoder", 1); + + /* "w3lib/_encoding.pyx":418 + * @lru_cache(maxsize=None) + * def _get_encoder(encoding: str) -> EncodeFunction: + * codec_info = codecs.lookup(encoding) # <<<<<<<<<<<<<< + * return codec_info.encode + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_codecs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_encoding}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_v_codec_info = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_encoding.pyx":419 + * def _get_encoder(encoding: str) -> EncodeFunction: + * codec_info = codecs.lookup(encoding) + * return codec_info.encode # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec_info, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_encoding.pyx":416 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoder(encoding: str) -> EncodeFunction: + * codec_info = codecs.lookup(encoding) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("w3lib._encoding._get_encoder", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_codec_info); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_encoding.pyx":426 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_9_encoding_5_get_encoding(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_9_encoding_4_get_encoding, "_get_encoding(unicode label: str) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_9_encoding_5_get_encoding = {"_get_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_9_encoding_5_get_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_9_encoding_4_get_encoding}; +static PyObject *__pyx_pw_5w3lib_9_encoding_5_get_encoding(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_label = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_encoding (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_label,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_encoding") < 0)) __PYX_ERR(0, 426, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_label = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_get_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 426, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._encoding._get_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), (&PyUnicode_Type), 0, "label", 1))) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_9_encoding_4_get_encoding(__pyx_self, __pyx_v_label); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_9_encoding_4_get_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label) { + PyObject *__pyx_v_encoding = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_encoding", 0); + __Pyx_INCREF(__pyx_v_label); + + /* "w3lib/_encoding.pyx":428 + * @lru_cache(maxsize=None) + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() # <<<<<<<<<<<<<< + * try: + * encoding = _LABEL_ENCODINGS[label] + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_WHITESPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_label, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_label, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "w3lib/_encoding.pyx":429 + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() + * try: # <<<<<<<<<<<<<< + * encoding = _LABEL_ENCODINGS[label] + * except KeyError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "w3lib/_encoding.pyx":430 + * label = label.strip(_ASCII_WHITESPACE).lower() + * try: + * encoding = _LABEL_ENCODINGS[label] # <<<<<<<<<<<<<< + * except KeyError: + * raise ValueError( + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_LABEL_ENCODINGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_encoding = __pyx_t_2; + __pyx_t_2 = 0; + + /* "w3lib/_encoding.pyx":429 + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() + * try: # <<<<<<<<<<<<<< + * encoding = _LABEL_ENCODINGS[label] + * except KeyError: + */ + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_encoding.pyx":431 + * try: + * encoding = _LABEL_ENCODINGS[label] + * except KeyError: # <<<<<<<<<<<<<< + * raise ValueError( + * f"{label!r} does not match any encoding label from the Encoding " + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_4) { + __Pyx_AddTraceback("w3lib._encoding._get_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 431, __pyx_L5_except_error) + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":433 + * except KeyError: + * raise ValueError( + * f"{label!r} does not match any encoding label from the Encoding " # <<<<<<<<<<<<<< + * f"Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721" + * f"bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)" + */ + __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 433, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_8, __pyx_kp_u_does_not_match_any_encoding_lab); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 433, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "w3lib/_encoding.pyx":432 + * encoding = _LABEL_ENCODINGS[label] + * except KeyError: + * raise ValueError( # <<<<<<<<<<<<<< + * f"{label!r} does not match any encoding label from the Encoding " + * f"Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721" + */ + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(0, 432, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + + /* "w3lib/_encoding.pyx":429 + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() + * try: # <<<<<<<<<<<<<< + * encoding = _LABEL_ENCODINGS[label] + * except KeyError: + */ + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "w3lib/_encoding.pyx":437 + * f"bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)" + * ) + * return encoding # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyUnicode_CheckExact(__pyx_v_encoding))||((__pyx_v_encoding) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_encoding))) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_encoding); + __pyx_r = ((PyObject*)__pyx_v_encoding); + goto __pyx_L0; + + /* "w3lib/_encoding.pyx":426 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("w3lib._encoding._get_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_encoding); + __Pyx_XDECREF(__pyx_v_label); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_encoding.pyx":448 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_output_encoding(encoding: str) -> str: + * encoding = _get_encoding(encoding) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_9_encoding_7_get_output_encoding(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_9_encoding_6_get_output_encoding, "_get_output_encoding(unicode encoding: str) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_9_encoding_7_get_output_encoding = {"_get_output_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_9_encoding_7_get_output_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_9_encoding_6_get_output_encoding}; +static PyObject *__pyx_pw_5w3lib_9_encoding_7_get_output_encoding(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_encoding = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_output_encoding (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_encoding,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_output_encoding") < 0)) __PYX_ERR(0, 448, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_encoding = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_get_output_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 448, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._encoding._get_output_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_9_encoding_6_get_output_encoding(__pyx_self, __pyx_v_encoding); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_9_encoding_6_get_output_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_encoding) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_output_encoding", 0); + __Pyx_INCREF(__pyx_v_encoding); + + /* "w3lib/_encoding.pyx":450 + * @lru_cache(maxsize=None) + * def _get_output_encoding(encoding: str) -> str: + * encoding = _get_encoding(encoding) # <<<<<<<<<<<<<< + * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: + * return _UTF_8_ENCODING + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_encoding, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "w3lib/_encoding.pyx":451 + * def _get_output_encoding(encoding: str) -> str: + * encoding = _get_encoding(encoding) + * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: # <<<<<<<<<<<<<< + * return _UTF_8_ENCODING + * return encoding + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_encoding, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "w3lib/_encoding.pyx":452 + * encoding = _get_encoding(encoding) + * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: + * return _UTF_8_ENCODING # <<<<<<<<<<<<<< + * return encoding + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_UTF_8_ENCODING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_encoding.pyx":451 + * def _get_output_encoding(encoding: str) -> str: + * encoding = _get_encoding(encoding) + * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: # <<<<<<<<<<<<<< + * return _UTF_8_ENCODING + * return encoding + */ + } + + /* "w3lib/_encoding.pyx":453 + * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: + * return _UTF_8_ENCODING + * return encoding # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_encoding); + __pyx_r = __pyx_v_encoding; + goto __pyx_L0; + + /* "w3lib/_encoding.pyx":448 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_output_encoding(encoding: str) -> str: + * encoding = _get_encoding(encoding) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("w3lib._encoding._get_output_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_encoding); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, + {&__pyx_kp_u_866, __pyx_k_866, sizeof(__pyx_k_866), 0, 1, 0, 0}, + {&__pyx_n_s_ASCII_WHITESPACE, __pyx_k_ASCII_WHITESPACE, sizeof(__pyx_k_ASCII_WHITESPACE), 0, 0, 1, 1}, + {&__pyx_n_s_AnyStr, __pyx_k_AnyStr, sizeof(__pyx_k_AnyStr), 0, 0, 1, 1}, + {&__pyx_n_s_Callable, __pyx_k_Callable, sizeof(__pyx_k_Callable), 0, 0, 1, 1}, + {&__pyx_n_s_CodecFunction, __pyx_k_CodecFunction, sizeof(__pyx_k_CodecFunction), 0, 0, 1, 1}, + {&__pyx_n_s_DecodeFunction, __pyx_k_DecodeFunction, sizeof(__pyx_k_DecodeFunction), 0, 0, 1, 1}, + {&__pyx_n_s_Dict, __pyx_k_Dict, sizeof(__pyx_k_Dict), 0, 0, 1, 1}, + {&__pyx_kp_s_Dict_str_str, __pyx_k_Dict_str_str, sizeof(__pyx_k_Dict_str_str), 0, 0, 1, 0}, + {&__pyx_n_s_EncodeFunction, __pyx_k_EncodeFunction, sizeof(__pyx_k_EncodeFunction), 0, 0, 1, 1}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_LABEL_ENCODINGS, __pyx_k_LABEL_ENCODINGS, sizeof(__pyx_k_LABEL_ENCODINGS), 0, 0, 1, 1}, + {&__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS, __pyx_k_OUTPUT_ENCODING_UTF8_ENCODINGS, sizeof(__pyx_k_OUTPUT_ENCODING_UTF8_ENCODINGS), 0, 0, 1, 1}, + {&__pyx_n_s_REPLACEMENT_ENCODING, __pyx_k_REPLACEMENT_ENCODING, sizeof(__pyx_k_REPLACEMENT_ENCODING), 0, 0, 1, 1}, + {&__pyx_n_s_Tuple, __pyx_k_Tuple, sizeof(__pyx_k_Tuple), 0, 0, 1, 1}, + {&__pyx_n_s_UTF_16BE_ENCODING, __pyx_k_UTF_16BE_ENCODING, sizeof(__pyx_k_UTF_16BE_ENCODING), 0, 0, 1, 1}, + {&__pyx_n_s_UTF_16LE_ENCODING, __pyx_k_UTF_16LE_ENCODING, sizeof(__pyx_k_UTF_16LE_ENCODING), 0, 0, 1, 1}, + {&__pyx_n_s_UTF_8_ENCODER, __pyx_k_UTF_8_ENCODER, sizeof(__pyx_k_UTF_8_ENCODER), 0, 0, 1, 1}, + {&__pyx_n_s_UTF_8_ENCODING, __pyx_k_UTF_8_ENCODING, sizeof(__pyx_k_UTF_8_ENCODING), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, + {&__pyx_n_s__49, __pyx_k__49, sizeof(__pyx_k__49), 0, 0, 1, 1}, + {&__pyx_kp_u_ansi_x3_4_1968, __pyx_k_ansi_x3_4_1968, sizeof(__pyx_k_ansi_x3_4_1968), 0, 1, 0, 0}, + {&__pyx_n_u_arabic, __pyx_k_arabic, sizeof(__pyx_k_arabic), 0, 1, 0, 1}, + {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1}, + {&__pyx_kp_u_asmo_708, __pyx_k_asmo_708, sizeof(__pyx_k_asmo_708), 0, 1, 0, 0}, + {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, + {&__pyx_n_u_big5, __pyx_k_big5, sizeof(__pyx_k_big5), 0, 1, 0, 1}, + {&__pyx_kp_u_big5_hkscs, __pyx_k_big5_hkscs, sizeof(__pyx_k_big5_hkscs), 0, 1, 0, 0}, + {&__pyx_n_u_chinese, __pyx_k_chinese, sizeof(__pyx_k_chinese), 0, 1, 0, 1}, + {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_kp_u_cn_big5, __pyx_k_cn_big5, sizeof(__pyx_k_cn_big5), 0, 1, 0, 0}, + {&__pyx_n_s_codec_info, __pyx_k_codec_info, sizeof(__pyx_k_codec_info), 0, 0, 1, 1}, + {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1}, + {&__pyx_n_u_cp125, __pyx_k_cp125, sizeof(__pyx_k_cp125), 0, 1, 0, 1}, + {&__pyx_n_u_cp1252, __pyx_k_cp1252, sizeof(__pyx_k_cp1252), 0, 1, 0, 1}, + {&__pyx_n_u_cp1254, __pyx_k_cp1254, sizeof(__pyx_k_cp1254), 0, 1, 0, 1}, + {&__pyx_n_u_cp819, __pyx_k_cp819, sizeof(__pyx_k_cp819), 0, 1, 0, 1}, + {&__pyx_n_u_cp866, __pyx_k_cp866, sizeof(__pyx_k_cp866), 0, 1, 0, 1}, + {&__pyx_n_u_cp874, __pyx_k_cp874, sizeof(__pyx_k_cp874), 0, 1, 0, 1}, + {&__pyx_n_u_csbig5, __pyx_k_csbig5, sizeof(__pyx_k_csbig5), 0, 1, 0, 1}, + {&__pyx_n_u_cseuckr, __pyx_k_cseuckr, sizeof(__pyx_k_cseuckr), 0, 1, 0, 1}, + {&__pyx_n_u_cseucpkdfmtjapanese, __pyx_k_cseucpkdfmtjapanese, sizeof(__pyx_k_cseucpkdfmtjapanese), 0, 1, 0, 1}, + {&__pyx_n_u_csgb2312, __pyx_k_csgb2312, sizeof(__pyx_k_csgb2312), 0, 1, 0, 1}, + {&__pyx_n_u_csibm866, __pyx_k_csibm866, sizeof(__pyx_k_csibm866), 0, 1, 0, 1}, + {&__pyx_n_u_csiso2022jp, __pyx_k_csiso2022jp, sizeof(__pyx_k_csiso2022jp), 0, 1, 0, 1}, + {&__pyx_n_u_csiso2022kr, __pyx_k_csiso2022kr, sizeof(__pyx_k_csiso2022kr), 0, 1, 0, 1}, + {&__pyx_n_u_csiso58gb231280, __pyx_k_csiso58gb231280, sizeof(__pyx_k_csiso58gb231280), 0, 1, 0, 1}, + {&__pyx_n_u_csiso88596e, __pyx_k_csiso88596e, sizeof(__pyx_k_csiso88596e), 0, 1, 0, 1}, + {&__pyx_n_u_csiso88596i, __pyx_k_csiso88596i, sizeof(__pyx_k_csiso88596i), 0, 1, 0, 1}, + {&__pyx_n_u_csiso88598e, __pyx_k_csiso88598e, sizeof(__pyx_k_csiso88598e), 0, 1, 0, 1}, + {&__pyx_n_u_csiso88598i, __pyx_k_csiso88598i, sizeof(__pyx_k_csiso88598i), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatin1, __pyx_k_csisolatin1, sizeof(__pyx_k_csisolatin1), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatin2, __pyx_k_csisolatin2, sizeof(__pyx_k_csisolatin2), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatin3, __pyx_k_csisolatin3, sizeof(__pyx_k_csisolatin3), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatin4, __pyx_k_csisolatin4, sizeof(__pyx_k_csisolatin4), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatin5, __pyx_k_csisolatin5, sizeof(__pyx_k_csisolatin5), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatin6, __pyx_k_csisolatin6, sizeof(__pyx_k_csisolatin6), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatin9, __pyx_k_csisolatin9, sizeof(__pyx_k_csisolatin9), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatinarabic, __pyx_k_csisolatinarabic, sizeof(__pyx_k_csisolatinarabic), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatincyrillic, __pyx_k_csisolatincyrillic, sizeof(__pyx_k_csisolatincyrillic), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatingreek, __pyx_k_csisolatingreek, sizeof(__pyx_k_csisolatingreek), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatinhebrew, __pyx_k_csisolatinhebrew, sizeof(__pyx_k_csisolatinhebrew), 0, 1, 0, 1}, + {&__pyx_n_u_cskoi8r, __pyx_k_cskoi8r, sizeof(__pyx_k_cskoi8r), 0, 1, 0, 1}, + {&__pyx_n_u_csksc56011987, __pyx_k_csksc56011987, sizeof(__pyx_k_csksc56011987), 0, 1, 0, 1}, + {&__pyx_n_u_csmacintosh, __pyx_k_csmacintosh, sizeof(__pyx_k_csmacintosh), 0, 1, 0, 1}, + {&__pyx_n_u_csshiftjis, __pyx_k_csshiftjis, sizeof(__pyx_k_csshiftjis), 0, 1, 0, 1}, + {&__pyx_n_u_csunicode, __pyx_k_csunicode, sizeof(__pyx_k_csunicode), 0, 1, 0, 1}, + {&__pyx_n_u_cyrillic, __pyx_k_cyrillic, sizeof(__pyx_k_cyrillic), 0, 1, 0, 1}, + {&__pyx_kp_u_does_not_match_any_encoding_lab, __pyx_k_does_not_match_any_encoding_lab, sizeof(__pyx_k_does_not_match_any_encoding_lab), 0, 1, 0, 0}, + {&__pyx_kp_u_dos_874, __pyx_k_dos_874, sizeof(__pyx_k_dos_874), 0, 1, 0, 0}, + {&__pyx_kp_u_ecma_114, __pyx_k_ecma_114, sizeof(__pyx_k_ecma_114), 0, 1, 0, 0}, + {&__pyx_kp_u_ecma_118, __pyx_k_ecma_118, sizeof(__pyx_k_ecma_118), 0, 1, 0, 0}, + {&__pyx_n_u_elot_928, __pyx_k_elot_928, sizeof(__pyx_k_elot_928), 0, 1, 0, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, + {&__pyx_kp_u_euc_jp, __pyx_k_euc_jp, sizeof(__pyx_k_euc_jp), 0, 1, 0, 0}, + {&__pyx_kp_u_euc_kr, __pyx_k_euc_kr, sizeof(__pyx_k_euc_kr), 0, 1, 0, 0}, + {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, + {&__pyx_n_u_gb18030, __pyx_k_gb18030, sizeof(__pyx_k_gb18030), 0, 1, 0, 1}, + {&__pyx_n_u_gb2312, __pyx_k_gb2312, sizeof(__pyx_k_gb2312), 0, 1, 0, 1}, + {&__pyx_n_u_gb_2312, __pyx_k_gb_2312, sizeof(__pyx_k_gb_2312), 0, 1, 0, 1}, + {&__pyx_kp_u_gb_2312_80, __pyx_k_gb_2312_80, sizeof(__pyx_k_gb_2312_80), 0, 1, 0, 0}, + {&__pyx_n_u_gbk, __pyx_k_gbk, sizeof(__pyx_k_gbk), 0, 1, 0, 1}, + {&__pyx_n_s_get_encoder, __pyx_k_get_encoder, sizeof(__pyx_k_get_encoder), 0, 0, 1, 1}, + {&__pyx_n_s_get_encoding, __pyx_k_get_encoding, sizeof(__pyx_k_get_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_get_output_encoding, __pyx_k_get_output_encoding, sizeof(__pyx_k_get_output_encoding), 0, 0, 1, 1}, + {&__pyx_n_u_greek, __pyx_k_greek, sizeof(__pyx_k_greek), 0, 1, 0, 1}, + {&__pyx_n_u_greek8, __pyx_k_greek8, sizeof(__pyx_k_greek8), 0, 1, 0, 1}, + {&__pyx_n_u_hebrew, __pyx_k_hebrew, sizeof(__pyx_k_hebrew), 0, 1, 0, 1}, + {&__pyx_kp_u_hz_gb_2312, __pyx_k_hz_gb_2312, sizeof(__pyx_k_hz_gb_2312), 0, 1, 0, 0}, + {&__pyx_n_u_ibm819, __pyx_k_ibm819, sizeof(__pyx_k_ibm819), 0, 1, 0, 1}, + {&__pyx_n_u_ibm866, __pyx_k_ibm866, sizeof(__pyx_k_ibm866), 0, 1, 0, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_infra, __pyx_k_infra, sizeof(__pyx_k_infra), 0, 0, 1, 1}, + {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, + {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, + {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, + {&__pyx_n_u_iso88591, __pyx_k_iso88591, sizeof(__pyx_k_iso88591), 0, 1, 0, 1}, + {&__pyx_n_u_iso885910, __pyx_k_iso885910, sizeof(__pyx_k_iso885910), 0, 1, 0, 1}, + {&__pyx_n_u_iso885911, __pyx_k_iso885911, sizeof(__pyx_k_iso885911), 0, 1, 0, 1}, + {&__pyx_n_u_iso885913, __pyx_k_iso885913, sizeof(__pyx_k_iso885913), 0, 1, 0, 1}, + {&__pyx_n_u_iso885914, __pyx_k_iso885914, sizeof(__pyx_k_iso885914), 0, 1, 0, 1}, + {&__pyx_n_u_iso885915, __pyx_k_iso885915, sizeof(__pyx_k_iso885915), 0, 1, 0, 1}, + {&__pyx_n_u_iso88592, __pyx_k_iso88592, sizeof(__pyx_k_iso88592), 0, 1, 0, 1}, + {&__pyx_n_u_iso88593, __pyx_k_iso88593, sizeof(__pyx_k_iso88593), 0, 1, 0, 1}, + {&__pyx_n_u_iso88594, __pyx_k_iso88594, sizeof(__pyx_k_iso88594), 0, 1, 0, 1}, + {&__pyx_n_u_iso88595, __pyx_k_iso88595, sizeof(__pyx_k_iso88595), 0, 1, 0, 1}, + {&__pyx_n_u_iso88596, __pyx_k_iso88596, sizeof(__pyx_k_iso88596), 0, 1, 0, 1}, + {&__pyx_n_u_iso88597, __pyx_k_iso88597, sizeof(__pyx_k_iso88597), 0, 1, 0, 1}, + {&__pyx_n_u_iso88598, __pyx_k_iso88598, sizeof(__pyx_k_iso88598), 0, 1, 0, 1}, + {&__pyx_n_u_iso88599, __pyx_k_iso88599, sizeof(__pyx_k_iso88599), 0, 1, 0, 1}, + {&__pyx_kp_u_iso8859_1, __pyx_k_iso8859_1, sizeof(__pyx_k_iso8859_1), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_10, __pyx_k_iso8859_10, sizeof(__pyx_k_iso8859_10), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_11, __pyx_k_iso8859_11, sizeof(__pyx_k_iso8859_11), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_13, __pyx_k_iso8859_13, sizeof(__pyx_k_iso8859_13), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_14, __pyx_k_iso8859_14, sizeof(__pyx_k_iso8859_14), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_15, __pyx_k_iso8859_15, sizeof(__pyx_k_iso8859_15), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_2, __pyx_k_iso8859_2, sizeof(__pyx_k_iso8859_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_3, __pyx_k_iso8859_3, sizeof(__pyx_k_iso8859_3), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_4, __pyx_k_iso8859_4, sizeof(__pyx_k_iso8859_4), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_5, __pyx_k_iso8859_5, sizeof(__pyx_k_iso8859_5), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_6, __pyx_k_iso8859_6, sizeof(__pyx_k_iso8859_6), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_7, __pyx_k_iso8859_7, sizeof(__pyx_k_iso8859_7), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_8, __pyx_k_iso8859_8, sizeof(__pyx_k_iso8859_8), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_9, __pyx_k_iso8859_9, sizeof(__pyx_k_iso8859_9), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_10646_ucs_2, __pyx_k_iso_10646_ucs_2, sizeof(__pyx_k_iso_10646_ucs_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_2022_cn, __pyx_k_iso_2022_cn, sizeof(__pyx_k_iso_2022_cn), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_2022_cn_ext, __pyx_k_iso_2022_cn_ext, sizeof(__pyx_k_iso_2022_cn_ext), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_2022_jp, __pyx_k_iso_2022_jp, sizeof(__pyx_k_iso_2022_jp), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_2022_kr, __pyx_k_iso_2022_kr, sizeof(__pyx_k_iso_2022_kr), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_1, __pyx_k_iso_8859_1, sizeof(__pyx_k_iso_8859_1), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_10, __pyx_k_iso_8859_10, sizeof(__pyx_k_iso_8859_10), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_11, __pyx_k_iso_8859_11, sizeof(__pyx_k_iso_8859_11), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_13, __pyx_k_iso_8859_13, sizeof(__pyx_k_iso_8859_13), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_14, __pyx_k_iso_8859_14, sizeof(__pyx_k_iso_8859_14), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_15, __pyx_k_iso_8859_15, sizeof(__pyx_k_iso_8859_15), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_15_2, __pyx_k_iso_8859_15_2, sizeof(__pyx_k_iso_8859_15_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_16, __pyx_k_iso_8859_16, sizeof(__pyx_k_iso_8859_16), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_1_1987, __pyx_k_iso_8859_1_1987, sizeof(__pyx_k_iso_8859_1_1987), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_1_2, __pyx_k_iso_8859_1_2, sizeof(__pyx_k_iso_8859_1_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_2, __pyx_k_iso_8859_2, sizeof(__pyx_k_iso_8859_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_2_1987, __pyx_k_iso_8859_2_1987, sizeof(__pyx_k_iso_8859_2_1987), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_2_2, __pyx_k_iso_8859_2_2, sizeof(__pyx_k_iso_8859_2_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_3, __pyx_k_iso_8859_3, sizeof(__pyx_k_iso_8859_3), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_3_1988, __pyx_k_iso_8859_3_1988, sizeof(__pyx_k_iso_8859_3_1988), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_3_2, __pyx_k_iso_8859_3_2, sizeof(__pyx_k_iso_8859_3_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_4, __pyx_k_iso_8859_4, sizeof(__pyx_k_iso_8859_4), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_4_1988, __pyx_k_iso_8859_4_1988, sizeof(__pyx_k_iso_8859_4_1988), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_4_2, __pyx_k_iso_8859_4_2, sizeof(__pyx_k_iso_8859_4_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_5, __pyx_k_iso_8859_5, sizeof(__pyx_k_iso_8859_5), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_5_1988, __pyx_k_iso_8859_5_1988, sizeof(__pyx_k_iso_8859_5_1988), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_5_2, __pyx_k_iso_8859_5_2, sizeof(__pyx_k_iso_8859_5_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_6, __pyx_k_iso_8859_6, sizeof(__pyx_k_iso_8859_6), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_6_1987, __pyx_k_iso_8859_6_1987, sizeof(__pyx_k_iso_8859_6_1987), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_6_2, __pyx_k_iso_8859_6_2, sizeof(__pyx_k_iso_8859_6_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_6_e, __pyx_k_iso_8859_6_e, sizeof(__pyx_k_iso_8859_6_e), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_6_i, __pyx_k_iso_8859_6_i, sizeof(__pyx_k_iso_8859_6_i), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_7, __pyx_k_iso_8859_7, sizeof(__pyx_k_iso_8859_7), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_7_1987, __pyx_k_iso_8859_7_1987, sizeof(__pyx_k_iso_8859_7_1987), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_7_2, __pyx_k_iso_8859_7_2, sizeof(__pyx_k_iso_8859_7_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_8, __pyx_k_iso_8859_8, sizeof(__pyx_k_iso_8859_8), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_8_1988, __pyx_k_iso_8859_8_1988, sizeof(__pyx_k_iso_8859_8_1988), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_8_2, __pyx_k_iso_8859_8_2, sizeof(__pyx_k_iso_8859_8_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_8_e, __pyx_k_iso_8859_8_e, sizeof(__pyx_k_iso_8859_8_e), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_8_i, __pyx_k_iso_8859_8_i, sizeof(__pyx_k_iso_8859_8_i), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_9, __pyx_k_iso_8859_9, sizeof(__pyx_k_iso_8859_9), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_9_1989, __pyx_k_iso_8859_9_1989, sizeof(__pyx_k_iso_8859_9_1989), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_9_2, __pyx_k_iso_8859_9_2, sizeof(__pyx_k_iso_8859_9_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_100, __pyx_k_iso_ir_100, sizeof(__pyx_k_iso_ir_100), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_101, __pyx_k_iso_ir_101, sizeof(__pyx_k_iso_ir_101), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_109, __pyx_k_iso_ir_109, sizeof(__pyx_k_iso_ir_109), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_110, __pyx_k_iso_ir_110, sizeof(__pyx_k_iso_ir_110), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_126, __pyx_k_iso_ir_126, sizeof(__pyx_k_iso_ir_126), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_127, __pyx_k_iso_ir_127, sizeof(__pyx_k_iso_ir_127), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_138, __pyx_k_iso_ir_138, sizeof(__pyx_k_iso_ir_138), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_144, __pyx_k_iso_ir_144, sizeof(__pyx_k_iso_ir_144), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_148, __pyx_k_iso_ir_148, sizeof(__pyx_k_iso_ir_148), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_149, __pyx_k_iso_ir_149, sizeof(__pyx_k_iso_ir_149), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_157, __pyx_k_iso_ir_157, sizeof(__pyx_k_iso_ir_157), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_58, __pyx_k_iso_ir_58, sizeof(__pyx_k_iso_ir_58), 0, 1, 0, 0}, + {&__pyx_n_u_koi, __pyx_k_koi, sizeof(__pyx_k_koi), 0, 1, 0, 1}, + {&__pyx_n_u_koi8, __pyx_k_koi8, sizeof(__pyx_k_koi8), 0, 1, 0, 1}, + {&__pyx_kp_u_koi8_r, __pyx_k_koi8_r, sizeof(__pyx_k_koi8_r), 0, 1, 0, 0}, + {&__pyx_n_u_koi8_r_2, __pyx_k_koi8_r_2, sizeof(__pyx_k_koi8_r_2), 0, 1, 0, 1}, + {&__pyx_kp_u_koi8_ru, __pyx_k_koi8_ru, sizeof(__pyx_k_koi8_ru), 0, 1, 0, 0}, + {&__pyx_kp_u_koi8_u, __pyx_k_koi8_u, sizeof(__pyx_k_koi8_u), 0, 1, 0, 0}, + {&__pyx_n_u_korean, __pyx_k_korean, sizeof(__pyx_k_korean), 0, 1, 0, 1}, + {&__pyx_kp_u_ks_c_5601_1987, __pyx_k_ks_c_5601_1987, sizeof(__pyx_k_ks_c_5601_1987), 0, 1, 0, 0}, + {&__pyx_kp_u_ks_c_5601_1989, __pyx_k_ks_c_5601_1989, sizeof(__pyx_k_ks_c_5601_1989), 0, 1, 0, 0}, + {&__pyx_n_u_ksc5601, __pyx_k_ksc5601, sizeof(__pyx_k_ksc5601), 0, 1, 0, 1}, + {&__pyx_n_u_ksc_5601, __pyx_k_ksc_5601, sizeof(__pyx_k_ksc_5601), 0, 1, 0, 1}, + {&__pyx_n_u_l1, __pyx_k_l1, sizeof(__pyx_k_l1), 0, 1, 0, 1}, + {&__pyx_n_u_l2, __pyx_k_l2, sizeof(__pyx_k_l2), 0, 1, 0, 1}, + {&__pyx_n_u_l3, __pyx_k_l3, sizeof(__pyx_k_l3), 0, 1, 0, 1}, + {&__pyx_n_u_l4, __pyx_k_l4, sizeof(__pyx_k_l4), 0, 1, 0, 1}, + {&__pyx_n_u_l5, __pyx_k_l5, sizeof(__pyx_k_l5), 0, 1, 0, 1}, + {&__pyx_n_u_l6, __pyx_k_l6, sizeof(__pyx_k_l6), 0, 1, 0, 1}, + {&__pyx_n_u_l9, __pyx_k_l9, sizeof(__pyx_k_l9), 0, 1, 0, 1}, + {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1}, + {&__pyx_n_s_last_digit, __pyx_k_last_digit, sizeof(__pyx_k_last_digit), 0, 0, 1, 1}, + {&__pyx_n_u_latin1, __pyx_k_latin1, sizeof(__pyx_k_latin1), 0, 1, 0, 1}, + {&__pyx_n_u_latin2, __pyx_k_latin2, sizeof(__pyx_k_latin2), 0, 1, 0, 1}, + {&__pyx_n_u_latin3, __pyx_k_latin3, sizeof(__pyx_k_latin3), 0, 1, 0, 1}, + {&__pyx_n_u_latin4, __pyx_k_latin4, sizeof(__pyx_k_latin4), 0, 1, 0, 1}, + {&__pyx_n_u_latin5, __pyx_k_latin5, sizeof(__pyx_k_latin5), 0, 1, 0, 1}, + {&__pyx_n_u_latin6, __pyx_k_latin6, sizeof(__pyx_k_latin6), 0, 1, 0, 1}, + {&__pyx_n_u_logical, __pyx_k_logical, sizeof(__pyx_k_logical), 0, 1, 0, 1}, + {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1}, + {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, + {&__pyx_n_s_lru_cache, __pyx_k_lru_cache, sizeof(__pyx_k_lru_cache), 0, 0, 1, 1}, + {&__pyx_n_u_mac, __pyx_k_mac, sizeof(__pyx_k_mac), 0, 1, 0, 1}, + {&__pyx_kp_u_mac_cyrillic, __pyx_k_mac_cyrillic, sizeof(__pyx_k_mac_cyrillic), 0, 1, 0, 0}, + {&__pyx_n_u_macintosh, __pyx_k_macintosh, sizeof(__pyx_k_macintosh), 0, 1, 0, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1}, + {&__pyx_n_u_ms932, __pyx_k_ms932, sizeof(__pyx_k_ms932), 0, 1, 0, 1}, + {&__pyx_n_u_ms_kanji, __pyx_k_ms_kanji, sizeof(__pyx_k_ms_kanji), 0, 1, 0, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_u_replacement, __pyx_k_replacement, sizeof(__pyx_k_replacement), 0, 1, 0, 1}, + {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, + {&__pyx_kp_u_shift_jis, __pyx_k_shift_jis, sizeof(__pyx_k_shift_jis), 0, 1, 0, 0}, + {&__pyx_n_u_shift_jis_2, __pyx_k_shift_jis_2, sizeof(__pyx_k_shift_jis_2), 0, 1, 0, 1}, + {&__pyx_n_s_short_windows_125, __pyx_k_short_windows_125, sizeof(__pyx_k_short_windows_125), 0, 0, 1, 1}, + {&__pyx_n_u_sjis, __pyx_k_sjis, sizeof(__pyx_k_sjis), 0, 1, 0, 1}, + {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, + {&__pyx_n_u_sun_eu_greek, __pyx_k_sun_eu_greek, sizeof(__pyx_k_sun_eu_greek), 0, 1, 0, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_kp_u_tis_620, __pyx_k_tis_620, sizeof(__pyx_k_tis_620), 0, 1, 0, 0}, + {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, + {&__pyx_kp_u_ucs_2, __pyx_k_ucs_2, sizeof(__pyx_k_ucs_2), 0, 1, 0, 0}, + {&__pyx_n_u_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 1, 0, 1}, + {&__pyx_n_u_unicode11utf8, __pyx_k_unicode11utf8, sizeof(__pyx_k_unicode11utf8), 0, 1, 0, 1}, + {&__pyx_n_u_unicode20utf8, __pyx_k_unicode20utf8, sizeof(__pyx_k_unicode20utf8), 0, 1, 0, 1}, + {&__pyx_kp_u_unicode_1_1_utf_8, __pyx_k_unicode_1_1_utf_8, sizeof(__pyx_k_unicode_1_1_utf_8), 0, 1, 0, 0}, + {&__pyx_n_u_unicodefeff, __pyx_k_unicodefeff, sizeof(__pyx_k_unicodefeff), 0, 1, 0, 1}, + {&__pyx_n_u_unicodefffe, __pyx_k_unicodefffe, sizeof(__pyx_k_unicodefffe), 0, 1, 0, 1}, + {&__pyx_kp_u_us_ascii, __pyx_k_us_ascii, sizeof(__pyx_k_us_ascii), 0, 1, 0, 0}, + {&__pyx_n_u_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 1, 0, 1}, + {&__pyx_kp_u_utf_16, __pyx_k_utf_16, sizeof(__pyx_k_utf_16), 0, 1, 0, 0}, + {&__pyx_kp_u_utf_16be, __pyx_k_utf_16be, sizeof(__pyx_k_utf_16be), 0, 1, 0, 0}, + {&__pyx_kp_u_utf_16le, __pyx_k_utf_16le, sizeof(__pyx_k_utf_16le), 0, 1, 0, 0}, + {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, + {&__pyx_n_u_visual, __pyx_k_visual, sizeof(__pyx_k_visual), 0, 1, 0, 1}, + {&__pyx_n_s_w3lib__encoding, __pyx_k_w3lib__encoding, sizeof(__pyx_k_w3lib__encoding), 0, 0, 1, 1}, + {&__pyx_kp_s_w3lib__encoding_pyx, __pyx_k_w3lib__encoding_pyx, sizeof(__pyx_k_w3lib__encoding_pyx), 0, 0, 1, 0}, + {&__pyx_kp_u_windows_125, __pyx_k_windows_125, sizeof(__pyx_k_windows_125), 0, 1, 0, 0}, + {&__pyx_kp_u_windows_1252, __pyx_k_windows_1252, sizeof(__pyx_k_windows_1252), 0, 1, 0, 0}, + {&__pyx_kp_u_windows_1254, __pyx_k_windows_1254, sizeof(__pyx_k_windows_1254), 0, 1, 0, 0}, + {&__pyx_kp_u_windows_31j, __pyx_k_windows_31j, sizeof(__pyx_k_windows_31j), 0, 1, 0, 0}, + {&__pyx_kp_u_windows_874, __pyx_k_windows_874, sizeof(__pyx_k_windows_874), 0, 1, 0, 0}, + {&__pyx_kp_u_windows_949, __pyx_k_windows_949, sizeof(__pyx_k_windows_949), 0, 1, 0, 0}, + {&__pyx_kp_u_x_cp125, __pyx_k_x_cp125, sizeof(__pyx_k_x_cp125), 0, 1, 0, 0}, + {&__pyx_kp_u_x_cp1252, __pyx_k_x_cp1252, sizeof(__pyx_k_x_cp1252), 0, 1, 0, 0}, + {&__pyx_kp_u_x_cp1254, __pyx_k_x_cp1254, sizeof(__pyx_k_x_cp1254), 0, 1, 0, 0}, + {&__pyx_kp_u_x_euc_jp, __pyx_k_x_euc_jp, sizeof(__pyx_k_x_euc_jp), 0, 1, 0, 0}, + {&__pyx_kp_u_x_gbk, __pyx_k_x_gbk, sizeof(__pyx_k_x_gbk), 0, 1, 0, 0}, + {&__pyx_kp_u_x_mac_cyrillic, __pyx_k_x_mac_cyrillic, sizeof(__pyx_k_x_mac_cyrillic), 0, 1, 0, 0}, + {&__pyx_kp_u_x_mac_roman, __pyx_k_x_mac_roman, sizeof(__pyx_k_x_mac_roman), 0, 1, 0, 0}, + {&__pyx_kp_u_x_mac_ukrainian, __pyx_k_x_mac_ukrainian, sizeof(__pyx_k_x_mac_ukrainian), 0, 1, 0, 0}, + {&__pyx_kp_u_x_sjis, __pyx_k_x_sjis, sizeof(__pyx_k_x_sjis), 0, 1, 0, 0}, + {&__pyx_kp_u_x_unicode20utf8, __pyx_k_x_unicode20utf8, sizeof(__pyx_k_x_unicode20utf8), 0, 1, 0, 0}, + {&__pyx_kp_u_x_user_defined, __pyx_k_x_user_defined, sizeof(__pyx_k_x_user_defined), 0, 1, 0, 0}, + {&__pyx_kp_u_x_x_big5, __pyx_k_x_x_big5, sizeof(__pyx_k_x_x_big5), 0, 1, 0, 0}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 432, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "w3lib/_encoding.pyx":15 + * + * + * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< + * return { + * label: f"windows-125{last_digit}" + */ + __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_last_digit, __pyx_n_s_label); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__encoding_pyx, __pyx_n_s_short_windows_125, 15, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 15, __pyx_L1_error) + + /* "w3lib/_encoding.pyx":39 + * label: _UTF_8_ENCODING + * for label in ( + * "unicode-1-1-utf-8", # <<<<<<<<<<<<<< + * "unicode11utf8", + * "unicode20utf8", + */ + __pyx_tuple__5 = PyTuple_Pack(6, __pyx_kp_u_unicode_1_1_utf_8, __pyx_n_u_unicode11utf8, __pyx_n_u_unicode20utf8, __pyx_kp_u_utf_8, __pyx_n_u_utf8, __pyx_kp_u_x_unicode20utf8); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "w3lib/_encoding.pyx":50 + * label: "ibm866" + * for label in ( + * "866", # <<<<<<<<<<<<<< + * "cp866", + * "csibm866", + */ + __pyx_tuple__6 = PyTuple_Pack(4, __pyx_kp_u_866, __pyx_n_u_cp866, __pyx_n_u_csibm866, __pyx_n_u_ibm866); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "w3lib/_encoding.pyx":59 + * label: "iso-8859-2" + * for label in ( + * "csisolatin2", # <<<<<<<<<<<<<< + * "iso-8859-2", + * "iso-ir-101", + */ + __pyx_tuple__7 = PyTuple_Pack(9, __pyx_n_u_csisolatin2, __pyx_kp_u_iso_8859_2, __pyx_kp_u_iso_ir_101, __pyx_kp_u_iso8859_2, __pyx_n_u_iso88592, __pyx_kp_u_iso_8859_2_2, __pyx_kp_u_iso_8859_2_1987, __pyx_n_u_l2, __pyx_n_u_latin2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "w3lib/_encoding.pyx":73 + * label: "iso-8859-3" + * for label in ( + * "csisolatin3", # <<<<<<<<<<<<<< + * "iso-8859-3", + * "iso-ir-109", + */ + __pyx_tuple__8 = PyTuple_Pack(9, __pyx_n_u_csisolatin3, __pyx_kp_u_iso_8859_3, __pyx_kp_u_iso_ir_109, __pyx_kp_u_iso8859_3, __pyx_n_u_iso88593, __pyx_kp_u_iso_8859_3_2, __pyx_kp_u_iso_8859_3_1988, __pyx_n_u_l3, __pyx_n_u_latin3); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "w3lib/_encoding.pyx":87 + * label: "iso-8859-4" + * for label in ( + * "csisolatin4", # <<<<<<<<<<<<<< + * "iso-8859-4", + * "iso-ir-110", + */ + __pyx_tuple__9 = PyTuple_Pack(9, __pyx_n_u_csisolatin4, __pyx_kp_u_iso_8859_4, __pyx_kp_u_iso_ir_110, __pyx_kp_u_iso8859_4, __pyx_n_u_iso88594, __pyx_kp_u_iso_8859_4_2, __pyx_kp_u_iso_8859_4_1988, __pyx_n_u_l4, __pyx_n_u_latin4); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "w3lib/_encoding.pyx":101 + * label: "iso-8859-5" + * for label in ( + * "csisolatincyrillic", # <<<<<<<<<<<<<< + * "cyrillic", + * "iso-8859-5", + */ + __pyx_tuple__10 = PyTuple_Pack(8, __pyx_n_u_csisolatincyrillic, __pyx_n_u_cyrillic, __pyx_kp_u_iso_8859_5, __pyx_kp_u_iso_ir_144, __pyx_kp_u_iso8859_5, __pyx_n_u_iso88595, __pyx_kp_u_iso_8859_5_2, __pyx_kp_u_iso_8859_5_1988); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "w3lib/_encoding.pyx":114 + * label: "iso-8859-6" + * for label in ( + * "arabic", # <<<<<<<<<<<<<< + * "asmo-708", + * "csiso88596e", + */ + __pyx_tuple__11 = PyTuple_Pack(14, __pyx_n_u_arabic, __pyx_kp_u_asmo_708, __pyx_n_u_csiso88596e, __pyx_n_u_csiso88596i, __pyx_n_u_csisolatinarabic, __pyx_kp_u_ecma_114, __pyx_kp_u_iso_8859_6, __pyx_kp_u_iso_8859_6_e, __pyx_kp_u_iso_8859_6_i, __pyx_kp_u_iso_ir_127, __pyx_kp_u_iso8859_6, __pyx_n_u_iso88596, __pyx_kp_u_iso_8859_6_2, __pyx_kp_u_iso_8859_6_1987); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "w3lib/_encoding.pyx":133 + * label: "iso-8859-7" + * for label in ( + * "csisolatingreek", # <<<<<<<<<<<<<< + * "ecma-118", + * "elot_928", + */ + __pyx_tuple__12 = PyTuple_Pack(12, __pyx_n_u_csisolatingreek, __pyx_kp_u_ecma_118, __pyx_n_u_elot_928, __pyx_n_u_greek, __pyx_n_u_greek8, __pyx_kp_u_iso_8859_7, __pyx_kp_u_iso_ir_126, __pyx_kp_u_iso8859_7, __pyx_n_u_iso88597, __pyx_kp_u_iso_8859_7_2, __pyx_kp_u_iso_8859_7_1987, __pyx_n_u_sun_eu_greek); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "w3lib/_encoding.pyx":150 + * label: "iso-8859-8" + * for label in ( + * "csiso88598e", # <<<<<<<<<<<<<< + * "csisolatinhebrew", + * "hebrew", + */ + __pyx_tuple__13 = PyTuple_Pack(11, __pyx_n_u_csiso88598e, __pyx_n_u_csisolatinhebrew, __pyx_n_u_hebrew, __pyx_kp_u_iso_8859_8, __pyx_kp_u_iso_8859_8_e, __pyx_kp_u_iso_ir_138, __pyx_kp_u_iso8859_8, __pyx_n_u_iso88598, __pyx_kp_u_iso_8859_8_2, __pyx_kp_u_iso_8859_8_1988, __pyx_n_u_visual); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "w3lib/_encoding.pyx":166 + * label: "iso-8859-8-i" + * for label in ( + * "csiso88598i", # <<<<<<<<<<<<<< + * "iso-8859-8-i", + * "logical", + */ + __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_u_csiso88598i, __pyx_kp_u_iso_8859_8_i, __pyx_n_u_logical); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "w3lib/_encoding.pyx":174 + * label: "iso-8859-10" + * for label in ( + * "csisolatin6", # <<<<<<<<<<<<<< + * "iso-8859-10", + * "iso-ir-157", + */ + __pyx_tuple__15 = PyTuple_Pack(7, __pyx_n_u_csisolatin6, __pyx_kp_u_iso_8859_10, __pyx_kp_u_iso_ir_157, __pyx_kp_u_iso8859_10, __pyx_n_u_iso885910, __pyx_n_u_l6, __pyx_n_u_latin6); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "w3lib/_encoding.pyx":198 + * label: "iso-8859-13" + * for label in ( + * "iso-8859-13", # <<<<<<<<<<<<<< + * "iso8859-13", + * "iso885913", + */ + __pyx_tuple__16 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_13, __pyx_kp_u_iso8859_13, __pyx_n_u_iso885913); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "w3lib/_encoding.pyx":206 + * label: "iso-8859-14" + * for label in ( + * "iso-8859-14", # <<<<<<<<<<<<<< + * "iso8859-14", + * "iso885914", + */ + __pyx_tuple__17 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_14, __pyx_kp_u_iso8859_14, __pyx_n_u_iso885914); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "w3lib/_encoding.pyx":214 + * label: "iso-8859-15" + * for label in ( + * "csisolatin9", # <<<<<<<<<<<<<< + * "iso-8859-15", + * "iso8859-15", + */ + __pyx_tuple__18 = PyTuple_Pack(6, __pyx_n_u_csisolatin9, __pyx_kp_u_iso_8859_15, __pyx_kp_u_iso8859_15, __pyx_n_u_iso885915, __pyx_kp_u_iso_8859_15_2, __pyx_n_u_l9); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "w3lib/_encoding.pyx":226 + * label: "koi8-r" + * for label in ( + * "cskoi8r", # <<<<<<<<<<<<<< + * "koi", + * "koi8", + */ + __pyx_tuple__19 = PyTuple_Pack(5, __pyx_n_u_cskoi8r, __pyx_n_u_koi, __pyx_n_u_koi8, __pyx_kp_u_koi8_r, __pyx_n_u_koi8_r_2); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "w3lib/_encoding.pyx":236 + * label: "koi8-u" + * for label in ( + * "koi8-ru", # <<<<<<<<<<<<<< + * "koi8-u", + * ) + */ + __pyx_tuple__20 = PyTuple_Pack(2, __pyx_kp_u_koi8_ru, __pyx_kp_u_koi8_u); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "w3lib/_encoding.pyx":243 + * label: "macintosh" + * for label in ( + * "csmacintosh", # <<<<<<<<<<<<<< + * "mac", + * "macintosh", + */ + __pyx_tuple__21 = PyTuple_Pack(4, __pyx_n_u_csmacintosh, __pyx_n_u_mac, __pyx_n_u_macintosh, __pyx_kp_u_x_mac_roman); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "w3lib/_encoding.pyx":252 + * label: "cp874" + * for label in ( + * "dos-874", # <<<<<<<<<<<<<< + * "iso-8859-11", + * "iso8859-11", + */ + __pyx_tuple__22 = PyTuple_Pack(6, __pyx_kp_u_dos_874, __pyx_kp_u_iso_8859_11, __pyx_kp_u_iso8859_11, __pyx_n_u_iso885911, __pyx_kp_u_tis_620, __pyx_kp_u_windows_874); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "w3lib/_encoding.pyx":260 + * ) + * }, + * **_short_windows_125(0), # <<<<<<<<<<<<<< + * **_short_windows_125(1), + * **{ + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "w3lib/_encoding.pyx":261 + * }, + * **_short_windows_125(0), + * **_short_windows_125(1), # <<<<<<<<<<<<<< + * **{ + * label: "windows-1252" + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "w3lib/_encoding.pyx":265 + * label: "windows-1252" + * for label in ( + * "ansi_x3.4-1968", # <<<<<<<<<<<<<< + * "ascii", + * "cp1252", + */ + __pyx_tuple__25 = PyTuple_Pack(17, __pyx_kp_u_ansi_x3_4_1968, __pyx_n_u_ascii, __pyx_n_u_cp1252, __pyx_n_u_cp819, __pyx_n_u_csisolatin1, __pyx_n_u_ibm819, __pyx_kp_u_iso_8859_1, __pyx_kp_u_iso_ir_100, __pyx_kp_u_iso8859_1, __pyx_n_u_iso88591, __pyx_kp_u_iso_8859_1_2, __pyx_kp_u_iso_8859_1_1987, __pyx_n_u_l1, __pyx_n_u_latin1, __pyx_kp_u_us_ascii, __pyx_kp_u_windows_1252, __pyx_kp_u_x_cp1252); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "w3lib/_encoding.pyx":284 + * ) + * }, + * **_short_windows_125(3), # <<<<<<<<<<<<<< + * **{ + * label: "windows-1254" + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "w3lib/_encoding.pyx":288 + * label: "windows-1254" + * for label in ( + * "cp1254", # <<<<<<<<<<<<<< + * "csisolatin5", + * "iso-8859-9", + */ + __pyx_tuple__27 = PyTuple_Pack(12, __pyx_n_u_cp1254, __pyx_n_u_csisolatin5, __pyx_kp_u_iso_8859_9, __pyx_kp_u_iso_ir_148, __pyx_kp_u_iso8859_9, __pyx_n_u_iso88599, __pyx_kp_u_iso_8859_9_2, __pyx_kp_u_iso_8859_9_1989, __pyx_n_u_l5, __pyx_n_u_latin5, __pyx_kp_u_windows_1254, __pyx_kp_u_x_cp1254); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "w3lib/_encoding.pyx":302 + * ) + * }, + * **_short_windows_125(5), # <<<<<<<<<<<<<< + * **_short_windows_125(6), + * **_short_windows_125(7), + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "w3lib/_encoding.pyx":303 + * }, + * **_short_windows_125(5), + * **_short_windows_125(6), # <<<<<<<<<<<<<< + * **_short_windows_125(7), + * **_short_windows_125(8), + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_int_6); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "w3lib/_encoding.pyx":304 + * **_short_windows_125(5), + * **_short_windows_125(6), + * **_short_windows_125(7), # <<<<<<<<<<<<<< + * **_short_windows_125(8), + * **{ + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_int_7); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "w3lib/_encoding.pyx":305 + * **_short_windows_125(6), + * **_short_windows_125(7), + * **_short_windows_125(8), # <<<<<<<<<<<<<< + * **{ + * label: "mac-cyrillic" + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_int_8); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "w3lib/_encoding.pyx":309 + * label: "mac-cyrillic" + * for label in ( + * "x-mac-cyrillic", # <<<<<<<<<<<<<< + * "x-mac-ukrainian", + * ) + */ + __pyx_tuple__32 = PyTuple_Pack(2, __pyx_kp_u_x_mac_cyrillic, __pyx_kp_u_x_mac_ukrainian); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "w3lib/_encoding.pyx":316 + * label: "gbk" + * for label in ( + * "chinese", # <<<<<<<<<<<<<< + * "csgb2312", + * "csiso58gb231280", + */ + __pyx_tuple__33 = PyTuple_Pack(9, __pyx_n_u_chinese, __pyx_n_u_csgb2312, __pyx_n_u_csiso58gb231280, __pyx_n_u_gb2312, __pyx_n_u_gb_2312, __pyx_kp_u_gb_2312_80, __pyx_n_u_gbk, __pyx_kp_u_iso_ir_58, __pyx_kp_u_x_gbk); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "w3lib/_encoding.pyx":331 + * label: "big5" + * for label in ( + * "big5", # <<<<<<<<<<<<<< + * "big5-hkscs", + * "cn-big5", + */ + __pyx_tuple__34 = PyTuple_Pack(5, __pyx_n_u_big5, __pyx_kp_u_big5_hkscs, __pyx_kp_u_cn_big5, __pyx_n_u_csbig5, __pyx_kp_u_x_x_big5); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "w3lib/_encoding.pyx":341 + * label: "euc-jp" + * for label in ( + * "cseucpkdfmtjapanese", # <<<<<<<<<<<<<< + * "euc-jp", + * "x-euc-jp", + */ + __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_u_cseucpkdfmtjapanese, __pyx_kp_u_euc_jp, __pyx_kp_u_x_euc_jp); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "w3lib/_encoding.pyx":349 + * label: "iso-2022-jp" + * for label in ( + * "csiso2022jp", # <<<<<<<<<<<<<< + * "iso-2022-jp", + * ) + */ + __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_u_csiso2022jp, __pyx_kp_u_iso_2022_jp); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 349, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "w3lib/_encoding.pyx":356 + * label: "shift_jis" + * for label in ( + * "csshiftjis", # <<<<<<<<<<<<<< + * "ms932", + * "ms_kanji", + */ + __pyx_tuple__37 = PyTuple_Pack(8, __pyx_n_u_csshiftjis, __pyx_n_u_ms932, __pyx_n_u_ms_kanji, __pyx_kp_u_shift_jis, __pyx_n_u_shift_jis_2, __pyx_n_u_sjis, __pyx_kp_u_windows_31j, __pyx_kp_u_x_sjis); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "w3lib/_encoding.pyx":369 + * label: "euc-kr" + * for label in ( + * "cseuckr", # <<<<<<<<<<<<<< + * "csksc56011987", + * "euc-kr", + */ + __pyx_tuple__38 = PyTuple_Pack(10, __pyx_n_u_cseuckr, __pyx_n_u_csksc56011987, __pyx_kp_u_euc_kr, __pyx_kp_u_iso_ir_149, __pyx_n_u_korean, __pyx_kp_u_ks_c_5601_1987, __pyx_kp_u_ks_c_5601_1989, __pyx_n_u_ksc5601, __pyx_n_u_ksc_5601, __pyx_kp_u_windows_949); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "w3lib/_encoding.pyx":384 + * label: _REPLACEMENT_ENCODING + * for label in ( + * "csiso2022kr", # <<<<<<<<<<<<<< + * "hz-gb-2312", + * "iso-2022-cn", + */ + __pyx_tuple__39 = PyTuple_Pack(6, __pyx_n_u_csiso2022kr, __pyx_kp_u_hz_gb_2312, __pyx_kp_u_iso_2022_cn, __pyx_kp_u_iso_2022_cn_ext, __pyx_kp_u_iso_2022_kr, __pyx_n_u_replacement); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "w3lib/_encoding.pyx":395 + * label: _UTF_16BE_ENCODING + * for label in ( + * "unicodefffe", # <<<<<<<<<<<<<< + * "utf-16be", + * ) + */ + __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_u_unicodefffe, __pyx_kp_u_utf_16be); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "w3lib/_encoding.pyx":402 + * label: _UTF_16LE_ENCODING + * for label in ( + * "csunicode", # <<<<<<<<<<<<<< + * "iso-10646-ucs-2", + * "ucs-2", + */ + __pyx_tuple__41 = PyTuple_Pack(7, __pyx_n_u_csunicode, __pyx_kp_u_iso_10646_ucs_2, __pyx_kp_u_ucs_2, __pyx_n_u_unicode, __pyx_n_u_unicodefeff, __pyx_kp_u_utf_16, __pyx_kp_u_utf_16le); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "w3lib/_encoding.pyx":416 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoder(encoding: str) -> EncodeFunction: + * codec_info = codecs.lookup(encoding) + */ + __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_encoding, __pyx_n_s_codec_info); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__encoding_pyx, __pyx_n_s_get_encoder, 416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 416, __pyx_L1_error) + + /* "w3lib/_encoding.pyx":422 + * + * + * _UTF_8_ENCODER = _get_encoder("utf-8") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "w3lib/_encoding.pyx":426 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() + */ + __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_label, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__encoding_pyx, __pyx_n_s_get_encoding, 426, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 426, __pyx_L1_error) + + /* "w3lib/_encoding.pyx":448 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_output_encoding(encoding: str) -> str: + * encoding = _get_encoding(encoding) + */ + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__encoding_pyx, __pyx_n_s_get_output_encoding, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + __pyx_umethod_PyUnicode_Type_strip.type = (PyObject*)&PyUnicode_Type; + __pyx_umethod_PyUnicode_Type_strip.method_name = &__pyx_n_s_strip; + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + return 0; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__encoding(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__encoding}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "_encoding", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_encoding(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_encoding(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__encoding(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__encoding(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__encoding(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_encoding' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_encoding", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_encoding" pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__encoding(void)", 0); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_w3lib___encoding) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "w3lib._encoding")) { + if (unlikely((PyDict_SetItemString(modules, "w3lib._encoding", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + (void)__Pyx_modinit_type_init_code(); + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "w3lib/_encoding.pyx":3 + * # https://encoding.spec.whatwg.org/ + * + * import codecs # <<<<<<<<<<<<<< + * from functools import lru_cache + * from typing import AnyStr, Callable, Dict, Tuple + */ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_codecs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_codecs, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_encoding.pyx":4 + * + * import codecs + * from functools import lru_cache # <<<<<<<<<<<<<< + * from typing import AnyStr, Callable, Dict, Tuple + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_lru_cache); + __Pyx_GIVEREF(__pyx_n_s_lru_cache); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_lru_cache)) __PYX_ERR(0, 4, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lru_cache, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_encoding.pyx":5 + * import codecs + * from functools import lru_cache + * from typing import AnyStr, Callable, Dict, Tuple # <<<<<<<<<<<<<< + * + * from ._infra import _ASCII_WHITESPACE + */ + __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_AnyStr); + __Pyx_GIVEREF(__pyx_n_s_AnyStr); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_AnyStr)) __PYX_ERR(0, 5, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Callable); + __Pyx_GIVEREF(__pyx_n_s_Callable); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Callable)) __PYX_ERR(0, 5, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Dict); + __Pyx_GIVEREF(__pyx_n_s_Dict); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_Dict)) __PYX_ERR(0, 5, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Tuple); + __Pyx_GIVEREF(__pyx_n_s_Tuple); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_Tuple)) __PYX_ERR(0, 5, __pyx_L1_error); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_AnyStr, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Callable, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Dict, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tuple, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_encoding.pyx":7 + * from typing import AnyStr, Callable, Dict, Tuple + * + * from ._infra import _ASCII_WHITESPACE # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ASCII_WHITESPACE); + __Pyx_GIVEREF(__pyx_n_s_ASCII_WHITESPACE); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ASCII_WHITESPACE)) __PYX_ERR(0, 7, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_infra, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ASCII_WHITESPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_WHITESPACE, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_encoding.pyx":10 + * + * + * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] # <<<<<<<<<<<<<< + * DecodeFunction = Callable[[bytes], Tuple[str, int]] + * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error); + __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 10, __pyx_L1_error); + __Pyx_INCREF((PyObject *)(&PyInt_Type)); + __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 10, __pyx_L1_error); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 10, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CodecFunction, __pyx_t_5) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_encoding.pyx":11 + * + * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] + * DecodeFunction = Callable[[bytes], Tuple[str, int]] # <<<<<<<<<<<<<< + * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Callable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF((PyObject *)(&PyBytes_Type)); + __Pyx_GIVEREF((PyObject *)(&PyBytes_Type)); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 11, __pyx_L1_error); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); + __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 11, __pyx_L1_error); + __Pyx_INCREF((PyObject *)(&PyInt_Type)); + __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 11, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(0, 11, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error); + __pyx_t_6 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DecodeFunction, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_encoding.pyx":12 + * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] + * DecodeFunction = Callable[[bytes], Tuple[str, int]] + * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); + __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 12, __pyx_L1_error); + __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); + __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 12, __pyx_L1_error); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF((PyObject *)(&PyBytes_Type)); + __Pyx_GIVEREF((PyObject *)(&PyBytes_Type)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 12, __pyx_L1_error); + __Pyx_INCREF((PyObject *)(&PyInt_Type)); + __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 12, __pyx_L1_error); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 12, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EncodeFunction, __pyx_t_3) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_encoding.pyx":15 + * + * + * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< + * return { + * label: f"windows-125{last_digit}" + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_last_digit, __pyx_n_s_int) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Dict_str_str) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_9_encoding_1_short_windows_125, 0, __pyx_n_s_short_windows_125, NULL, __pyx_n_s_w3lib__encoding, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_short_windows_125, __pyx_t_6) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_encoding.pyx":26 + * + * + * _REPLACEMENT_ENCODING = "replacement" # <<<<<<<<<<<<<< + * _UTF_8_ENCODING = "utf-8" + * _UTF_16BE_ENCODING = "utf-16be" + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_REPLACEMENT_ENCODING, __pyx_n_u_replacement) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + + /* "w3lib/_encoding.pyx":27 + * + * _REPLACEMENT_ENCODING = "replacement" + * _UTF_8_ENCODING = "utf-8" # <<<<<<<<<<<<<< + * _UTF_16BE_ENCODING = "utf-16be" + * _UTF_16LE_ENCODING = "utf-16le" + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODING, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + + /* "w3lib/_encoding.pyx":28 + * _REPLACEMENT_ENCODING = "replacement" + * _UTF_8_ENCODING = "utf-8" + * _UTF_16BE_ENCODING = "utf-16be" # <<<<<<<<<<<<<< + * _UTF_16LE_ENCODING = "utf-16le" + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_16BE_ENCODING, __pyx_kp_u_utf_16be) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + + /* "w3lib/_encoding.pyx":29 + * _UTF_8_ENCODING = "utf-8" + * _UTF_16BE_ENCODING = "utf-16be" + * _UTF_16LE_ENCODING = "utf-16le" # <<<<<<<<<<<<<< + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_16LE_ENCODING, __pyx_kp_u_utf_16le) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + + /* "w3lib/_encoding.pyx":35 + * # Maps the labels defined in the standard to an encoding label that Python + * # understands. + * _LABEL_ENCODINGS = { # <<<<<<<<<<<<<< + * **{ + * label: _UTF_8_ENCODING + */ + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":36 + * # understands. + * _LABEL_ENCODINGS = { + * **{ # <<<<<<<<<<<<<< + * label: _UTF_8_ENCODING + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":38 + * **{ + * label: _UTF_8_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "unicode-1-1-utf-8", + * "unicode11utf8", + */ + __pyx_t_2 = __pyx_tuple__5; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 6) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 38, __pyx_L4_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":37 + * _LABEL_ENCODINGS = { + * **{ + * label: _UTF_8_ENCODING # <<<<<<<<<<<<<< + * for label in ( + * "unicode-1-1-utf-8", + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_8_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 37, __pyx_L4_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":38 + * **{ + * label: _UTF_8_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "unicode-1-1-utf-8", + * "unicode11utf8", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L8_exit_scope; + __pyx_L4_error:; + __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L8_exit_scope:; + } /* exit inner scope */ + __pyx_t_6 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":47 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "ibm866" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":49 + * **{ + * label: "ibm866" + * for label in ( # <<<<<<<<<<<<<< + * "866", + * "cp866", + */ + __pyx_t_2 = __pyx_tuple__6; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 4) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 49, __pyx_L11_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":48 + * }, + * **{ + * label: "ibm866" # <<<<<<<<<<<<<< + * for label in ( + * "866", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_n_u_ibm866))) __PYX_ERR(0, 48, __pyx_L11_error) + + /* "w3lib/_encoding.pyx":49 + * **{ + * label: "ibm866" + * for label in ( # <<<<<<<<<<<<<< + * "866", + * "cp866", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L15_exit_scope; + __pyx_L11_error:; + __Pyx_GOTREF(__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L15_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 47, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":56 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-2" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":58 + * **{ + * label: "iso-8859-2" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin2", + * "iso-8859-2", + */ + __pyx_t_2 = __pyx_tuple__7; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 9) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 58, __pyx_L18_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":57 + * }, + * **{ + * label: "iso-8859-2" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatin2", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_2))) __PYX_ERR(0, 57, __pyx_L18_error) + + /* "w3lib/_encoding.pyx":58 + * **{ + * label: "iso-8859-2" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin2", + * "iso-8859-2", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L22_exit_scope; + __pyx_L18_error:; + __Pyx_GOTREF(__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L22_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 56, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":70 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-3" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L25_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":72 + * **{ + * label: "iso-8859-3" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin3", + * "iso-8859-3", + */ + __pyx_t_2 = __pyx_tuple__8; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 9) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 72, __pyx_L25_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L25_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":71 + * }, + * **{ + * label: "iso-8859-3" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatin3", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_3))) __PYX_ERR(0, 71, __pyx_L25_error) + + /* "w3lib/_encoding.pyx":72 + * **{ + * label: "iso-8859-3" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin3", + * "iso-8859-3", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L29_exit_scope; + __pyx_L25_error:; + __Pyx_GOTREF(__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L29_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 70, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":84 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-4" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L32_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":86 + * **{ + * label: "iso-8859-4" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin4", + * "iso-8859-4", + */ + __pyx_t_2 = __pyx_tuple__9; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 9) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 86, __pyx_L32_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L32_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":85 + * }, + * **{ + * label: "iso-8859-4" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatin4", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_4))) __PYX_ERR(0, 85, __pyx_L32_error) + + /* "w3lib/_encoding.pyx":86 + * **{ + * label: "iso-8859-4" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin4", + * "iso-8859-4", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L36_exit_scope; + __pyx_L32_error:; + __Pyx_GOTREF(__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L36_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 84, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":98 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-5" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L39_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":100 + * **{ + * label: "iso-8859-5" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatincyrillic", + * "cyrillic", + */ + __pyx_t_2 = __pyx_tuple__10; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 8) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 100, __pyx_L39_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L39_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":99 + * }, + * **{ + * label: "iso-8859-5" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatincyrillic", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_5))) __PYX_ERR(0, 99, __pyx_L39_error) + + /* "w3lib/_encoding.pyx":100 + * **{ + * label: "iso-8859-5" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatincyrillic", + * "cyrillic", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L43_exit_scope; + __pyx_L39_error:; + __Pyx_GOTREF(__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L43_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 98, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":111 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-6" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L46_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":113 + * **{ + * label: "iso-8859-6" + * for label in ( # <<<<<<<<<<<<<< + * "arabic", + * "asmo-708", + */ + __pyx_t_2 = __pyx_tuple__11; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 14) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 113, __pyx_L46_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L46_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":112 + * }, + * **{ + * label: "iso-8859-6" # <<<<<<<<<<<<<< + * for label in ( + * "arabic", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_6))) __PYX_ERR(0, 112, __pyx_L46_error) + + /* "w3lib/_encoding.pyx":113 + * **{ + * label: "iso-8859-6" + * for label in ( # <<<<<<<<<<<<<< + * "arabic", + * "asmo-708", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L50_exit_scope; + __pyx_L46_error:; + __Pyx_GOTREF(__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L50_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 111, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":130 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-7" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L53_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":132 + * **{ + * label: "iso-8859-7" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatingreek", + * "ecma-118", + */ + __pyx_t_2 = __pyx_tuple__12; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 12) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 132, __pyx_L53_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L53_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":131 + * }, + * **{ + * label: "iso-8859-7" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatingreek", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_7))) __PYX_ERR(0, 131, __pyx_L53_error) + + /* "w3lib/_encoding.pyx":132 + * **{ + * label: "iso-8859-7" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatingreek", + * "ecma-118", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L57_exit_scope; + __pyx_L53_error:; + __Pyx_GOTREF(__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L57_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 130, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":147 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-8" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L60_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":149 + * **{ + * label: "iso-8859-8" + * for label in ( # <<<<<<<<<<<<<< + * "csiso88598e", + * "csisolatinhebrew", + */ + __pyx_t_2 = __pyx_tuple__13; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 11) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 149, __pyx_L60_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L60_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":148 + * }, + * **{ + * label: "iso-8859-8" # <<<<<<<<<<<<<< + * for label in ( + * "csiso88598e", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_8))) __PYX_ERR(0, 148, __pyx_L60_error) + + /* "w3lib/_encoding.pyx":149 + * **{ + * label: "iso-8859-8" + * for label in ( # <<<<<<<<<<<<<< + * "csiso88598e", + * "csisolatinhebrew", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L64_exit_scope; + __pyx_L60_error:; + __Pyx_GOTREF(__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L64_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 147, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":163 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-8-i" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L67_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":165 + * **{ + * label: "iso-8859-8-i" + * for label in ( # <<<<<<<<<<<<<< + * "csiso88598i", + * "iso-8859-8-i", + */ + __pyx_t_2 = __pyx_tuple__14; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 3) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 165, __pyx_L67_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L67_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":164 + * }, + * **{ + * label: "iso-8859-8-i" # <<<<<<<<<<<<<< + * for label in ( + * "csiso88598i", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_8_i))) __PYX_ERR(0, 164, __pyx_L67_error) + + /* "w3lib/_encoding.pyx":165 + * **{ + * label: "iso-8859-8-i" + * for label in ( # <<<<<<<<<<<<<< + * "csiso88598i", + * "iso-8859-8-i", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L71_exit_scope; + __pyx_L67_error:; + __Pyx_GOTREF(__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L71_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 163, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":171 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-10" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L74_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":173 + * **{ + * label: "iso-8859-10" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin6", + * "iso-8859-10", + */ + __pyx_t_2 = __pyx_tuple__15; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 7) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 173, __pyx_L74_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L74_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":172 + * }, + * **{ + * label: "iso-8859-10" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatin6", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_10))) __PYX_ERR(0, 172, __pyx_L74_error) + + /* "w3lib/_encoding.pyx":173 + * **{ + * label: "iso-8859-10" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin6", + * "iso-8859-10", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L78_exit_scope; + __pyx_L74_error:; + __Pyx_GOTREF(__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L78_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 171, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":183 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-10" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L81_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":185 + * **{ + * label: "iso-8859-10" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin6", + * "iso-8859-10", + */ + __pyx_t_2 = __pyx_tuple__15; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 7) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 185, __pyx_L81_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L81_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":184 + * }, + * **{ + * label: "iso-8859-10" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatin6", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_10))) __PYX_ERR(0, 184, __pyx_L81_error) + + /* "w3lib/_encoding.pyx":185 + * **{ + * label: "iso-8859-10" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin6", + * "iso-8859-10", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L85_exit_scope; + __pyx_L81_error:; + __Pyx_GOTREF(__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L85_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 183, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":195 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-13" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L88_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":197 + * **{ + * label: "iso-8859-13" + * for label in ( # <<<<<<<<<<<<<< + * "iso-8859-13", + * "iso8859-13", + */ + __pyx_t_2 = __pyx_tuple__16; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 3) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 197, __pyx_L88_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L88_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":196 + * }, + * **{ + * label: "iso-8859-13" # <<<<<<<<<<<<<< + * for label in ( + * "iso-8859-13", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_13))) __PYX_ERR(0, 196, __pyx_L88_error) + + /* "w3lib/_encoding.pyx":197 + * **{ + * label: "iso-8859-13" + * for label in ( # <<<<<<<<<<<<<< + * "iso-8859-13", + * "iso8859-13", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L92_exit_scope; + __pyx_L88_error:; + __Pyx_GOTREF(__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L92_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 195, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":203 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-14" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L95_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":205 + * **{ + * label: "iso-8859-14" + * for label in ( # <<<<<<<<<<<<<< + * "iso-8859-14", + * "iso8859-14", + */ + __pyx_t_2 = __pyx_tuple__17; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 3) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 205, __pyx_L95_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L95_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":204 + * }, + * **{ + * label: "iso-8859-14" # <<<<<<<<<<<<<< + * for label in ( + * "iso-8859-14", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_14))) __PYX_ERR(0, 204, __pyx_L95_error) + + /* "w3lib/_encoding.pyx":205 + * **{ + * label: "iso-8859-14" + * for label in ( # <<<<<<<<<<<<<< + * "iso-8859-14", + * "iso8859-14", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L99_exit_scope; + __pyx_L95_error:; + __Pyx_GOTREF(__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L99_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 203, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":211 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-15" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L102_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":213 + * **{ + * label: "iso-8859-15" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin9", + * "iso-8859-15", + */ + __pyx_t_2 = __pyx_tuple__18; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 6) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 213, __pyx_L102_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L102_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":212 + * }, + * **{ + * label: "iso-8859-15" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatin9", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_15))) __PYX_ERR(0, 212, __pyx_L102_error) + + /* "w3lib/_encoding.pyx":213 + * **{ + * label: "iso-8859-15" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin9", + * "iso-8859-15", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L106_exit_scope; + __pyx_L102_error:; + __Pyx_GOTREF(__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L106_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 211, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_kp_u_iso_8859_16, __pyx_kp_u_iso_8859_16) < 0) __PYX_ERR(0, 222, __pyx_L1_error) + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":223 + * }, + * "iso-8859-16": "iso-8859-16", + * **{ # <<<<<<<<<<<<<< + * label: "koi8-r" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L109_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":225 + * **{ + * label: "koi8-r" + * for label in ( # <<<<<<<<<<<<<< + * "cskoi8r", + * "koi", + */ + __pyx_t_2 = __pyx_tuple__19; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 5) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 225, __pyx_L109_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L109_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":224 + * "iso-8859-16": "iso-8859-16", + * **{ + * label: "koi8-r" # <<<<<<<<<<<<<< + * for label in ( + * "cskoi8r", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_koi8_r))) __PYX_ERR(0, 224, __pyx_L109_error) + + /* "w3lib/_encoding.pyx":225 + * **{ + * label: "koi8-r" + * for label in ( # <<<<<<<<<<<<<< + * "cskoi8r", + * "koi", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L113_exit_scope; + __pyx_L109_error:; + __Pyx_GOTREF(__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L113_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 223, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":233 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "koi8-u" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L116_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":235 + * **{ + * label: "koi8-u" + * for label in ( # <<<<<<<<<<<<<< + * "koi8-ru", + * "koi8-u", + */ + __pyx_t_2 = __pyx_tuple__20; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 2) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 235, __pyx_L116_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L116_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":234 + * }, + * **{ + * label: "koi8-u" # <<<<<<<<<<<<<< + * for label in ( + * "koi8-ru", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_koi8_u))) __PYX_ERR(0, 234, __pyx_L116_error) + + /* "w3lib/_encoding.pyx":235 + * **{ + * label: "koi8-u" + * for label in ( # <<<<<<<<<<<<<< + * "koi8-ru", + * "koi8-u", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L120_exit_scope; + __pyx_L116_error:; + __Pyx_GOTREF(__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L120_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 233, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":240 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "macintosh" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L123_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":242 + * **{ + * label: "macintosh" + * for label in ( # <<<<<<<<<<<<<< + * "csmacintosh", + * "mac", + */ + __pyx_t_2 = __pyx_tuple__21; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 4) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 242, __pyx_L123_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L123_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":241 + * }, + * **{ + * label: "macintosh" # <<<<<<<<<<<<<< + * for label in ( + * "csmacintosh", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_n_u_macintosh))) __PYX_ERR(0, 241, __pyx_L123_error) + + /* "w3lib/_encoding.pyx":242 + * **{ + * label: "macintosh" + * for label in ( # <<<<<<<<<<<<<< + * "csmacintosh", + * "mac", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L127_exit_scope; + __pyx_L123_error:; + __Pyx_GOTREF(__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L127_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 240, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":249 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "cp874" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L130_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":251 + * **{ + * label: "cp874" + * for label in ( # <<<<<<<<<<<<<< + * "dos-874", + * "iso-8859-11", + */ + __pyx_t_2 = __pyx_tuple__22; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 6) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 251, __pyx_L130_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L130_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":250 + * }, + * **{ + * label: "cp874" # <<<<<<<<<<<<<< + * for label in ( + * "dos-874", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_n_u_cp874))) __PYX_ERR(0, 250, __pyx_L130_error) + + /* "w3lib/_encoding.pyx":251 + * **{ + * label: "cp874" + * for label in ( # <<<<<<<<<<<<<< + * "dos-874", + * "iso-8859-11", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L134_exit_scope; + __pyx_L130_error:; + __Pyx_GOTREF(__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L134_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 249, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_encoding.pyx":260 + * ) + * }, + * **_short_windows_125(0), # <<<<<<<<<<<<<< + * **_short_windows_125(1), + * **{ + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_t_2 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 260, __pyx_L1_error) + } + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 260, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_encoding.pyx":261 + * }, + * **_short_windows_125(0), + * **_short_windows_125(1), # <<<<<<<<<<<<<< + * **{ + * label: "windows-1252" + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 261, __pyx_L1_error) + } + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 261, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":262 + * **_short_windows_125(0), + * **_short_windows_125(1), + * **{ # <<<<<<<<<<<<<< + * label: "windows-1252" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L137_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":264 + * **{ + * label: "windows-1252" + * for label in ( # <<<<<<<<<<<<<< + * "ansi_x3.4-1968", + * "ascii", + */ + __pyx_t_2 = __pyx_tuple__25; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 17) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 264, __pyx_L137_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L137_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":263 + * **_short_windows_125(1), + * **{ + * label: "windows-1252" # <<<<<<<<<<<<<< + * for label in ( + * "ansi_x3.4-1968", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_windows_1252))) __PYX_ERR(0, 263, __pyx_L137_error) + + /* "w3lib/_encoding.pyx":264 + * **{ + * label: "windows-1252" + * for label in ( # <<<<<<<<<<<<<< + * "ansi_x3.4-1968", + * "ascii", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L141_exit_scope; + __pyx_L137_error:; + __Pyx_GOTREF(__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L141_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 262, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_encoding.pyx":284 + * ) + * }, + * **_short_windows_125(3), # <<<<<<<<<<<<<< + * **{ + * label: "windows-1254" + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_t_2 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 284, __pyx_L1_error) + } + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 284, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":285 + * }, + * **_short_windows_125(3), + * **{ # <<<<<<<<<<<<<< + * label: "windows-1254" + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L144_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_encoding.pyx":287 + * **{ + * label: "windows-1254" + * for label in ( # <<<<<<<<<<<<<< + * "cp1254", + * "csisolatin5", + */ + __pyx_t_3 = __pyx_tuple__27; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 12) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 287, __pyx_L144_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L144_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":286 + * **_short_windows_125(3), + * **{ + * label: "windows-1254" # <<<<<<<<<<<<<< + * for label in ( + * "cp1254", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_windows_1254))) __PYX_ERR(0, 286, __pyx_L144_error) + + /* "w3lib/_encoding.pyx":287 + * **{ + * label: "windows-1254" + * for label in ( # <<<<<<<<<<<<<< + * "cp1254", + * "csisolatin5", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L148_exit_scope; + __pyx_L144_error:; + __Pyx_GOTREF(__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L148_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 285, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_encoding.pyx":302 + * ) + * }, + * **_short_windows_125(5), # <<<<<<<<<<<<<< + * **_short_windows_125(6), + * **_short_windows_125(7), + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 302, __pyx_L1_error) + } + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 302, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_encoding.pyx":303 + * }, + * **_short_windows_125(5), + * **_short_windows_125(6), # <<<<<<<<<<<<<< + * **_short_windows_125(7), + * **_short_windows_125(8), + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_t_2 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 303, __pyx_L1_error) + } + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 303, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_encoding.pyx":304 + * **_short_windows_125(5), + * **_short_windows_125(6), + * **_short_windows_125(7), # <<<<<<<<<<<<<< + * **_short_windows_125(8), + * **{ + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 304, __pyx_L1_error) + } + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 304, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_encoding.pyx":305 + * **_short_windows_125(6), + * **_short_windows_125(7), + * **_short_windows_125(8), # <<<<<<<<<<<<<< + * **{ + * label: "mac-cyrillic" + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_t_2 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 305, __pyx_L1_error) + } + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 305, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":306 + * **_short_windows_125(7), + * **_short_windows_125(8), + * **{ # <<<<<<<<<<<<<< + * label: "mac-cyrillic" + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L151_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_encoding.pyx":308 + * **{ + * label: "mac-cyrillic" + * for label in ( # <<<<<<<<<<<<<< + * "x-mac-cyrillic", + * "x-mac-ukrainian", + */ + __pyx_t_3 = __pyx_tuple__32; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 2) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 308, __pyx_L151_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L151_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":307 + * **_short_windows_125(8), + * **{ + * label: "mac-cyrillic" # <<<<<<<<<<<<<< + * for label in ( + * "x-mac-cyrillic", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_mac_cyrillic))) __PYX_ERR(0, 307, __pyx_L151_error) + + /* "w3lib/_encoding.pyx":308 + * **{ + * label: "mac-cyrillic" + * for label in ( # <<<<<<<<<<<<<< + * "x-mac-cyrillic", + * "x-mac-ukrainian", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L155_exit_scope; + __pyx_L151_error:; + __Pyx_GOTREF(__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L155_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 306, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":313 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "gbk" + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L158_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_encoding.pyx":315 + * **{ + * label: "gbk" + * for label in ( # <<<<<<<<<<<<<< + * "chinese", + * "csgb2312", + */ + __pyx_t_3 = __pyx_tuple__33; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 9) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 315, __pyx_L158_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L158_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":314 + * }, + * **{ + * label: "gbk" # <<<<<<<<<<<<<< + * for label in ( + * "chinese", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_n_u_gbk))) __PYX_ERR(0, 314, __pyx_L158_error) + + /* "w3lib/_encoding.pyx":315 + * **{ + * label: "gbk" + * for label in ( # <<<<<<<<<<<<<< + * "chinese", + * "csgb2312", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L162_exit_scope; + __pyx_L158_error:; + __Pyx_GOTREF(__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L162_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 313, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_gb18030, __pyx_n_u_gb18030) < 0) __PYX_ERR(0, 327, __pyx_L1_error) + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":328 + * }, + * "gb18030": "gb18030", + * **{ # <<<<<<<<<<<<<< + * label: "big5" + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L165_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_encoding.pyx":330 + * **{ + * label: "big5" + * for label in ( # <<<<<<<<<<<<<< + * "big5", + * "big5-hkscs", + */ + __pyx_t_3 = __pyx_tuple__34; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 5) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 330, __pyx_L165_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L165_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":329 + * "gb18030": "gb18030", + * **{ + * label: "big5" # <<<<<<<<<<<<<< + * for label in ( + * "big5", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_n_u_big5))) __PYX_ERR(0, 329, __pyx_L165_error) + + /* "w3lib/_encoding.pyx":330 + * **{ + * label: "big5" + * for label in ( # <<<<<<<<<<<<<< + * "big5", + * "big5-hkscs", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L169_exit_scope; + __pyx_L165_error:; + __Pyx_GOTREF(__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L169_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 328, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":338 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "euc-jp" + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L172_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_encoding.pyx":340 + * **{ + * label: "euc-jp" + * for label in ( # <<<<<<<<<<<<<< + * "cseucpkdfmtjapanese", + * "euc-jp", + */ + __pyx_t_3 = __pyx_tuple__35; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 3) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 340, __pyx_L172_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L172_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":339 + * }, + * **{ + * label: "euc-jp" # <<<<<<<<<<<<<< + * for label in ( + * "cseucpkdfmtjapanese", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_euc_jp))) __PYX_ERR(0, 339, __pyx_L172_error) + + /* "w3lib/_encoding.pyx":340 + * **{ + * label: "euc-jp" + * for label in ( # <<<<<<<<<<<<<< + * "cseucpkdfmtjapanese", + * "euc-jp", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L176_exit_scope; + __pyx_L172_error:; + __Pyx_GOTREF(__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L176_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 338, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":346 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-2022-jp" + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L179_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_encoding.pyx":348 + * **{ + * label: "iso-2022-jp" + * for label in ( # <<<<<<<<<<<<<< + * "csiso2022jp", + * "iso-2022-jp", + */ + __pyx_t_3 = __pyx_tuple__36; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 2) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 348, __pyx_L179_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L179_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":347 + * }, + * **{ + * label: "iso-2022-jp" # <<<<<<<<<<<<<< + * for label in ( + * "csiso2022jp", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_2022_jp))) __PYX_ERR(0, 347, __pyx_L179_error) + + /* "w3lib/_encoding.pyx":348 + * **{ + * label: "iso-2022-jp" + * for label in ( # <<<<<<<<<<<<<< + * "csiso2022jp", + * "iso-2022-jp", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L183_exit_scope; + __pyx_L179_error:; + __Pyx_GOTREF(__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L183_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 346, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":353 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "shift_jis" + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L186_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_encoding.pyx":355 + * **{ + * label: "shift_jis" + * for label in ( # <<<<<<<<<<<<<< + * "csshiftjis", + * "ms932", + */ + __pyx_t_3 = __pyx_tuple__37; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 8) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 355, __pyx_L186_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L186_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":354 + * }, + * **{ + * label: "shift_jis" # <<<<<<<<<<<<<< + * for label in ( + * "csshiftjis", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_n_u_shift_jis_2))) __PYX_ERR(0, 354, __pyx_L186_error) + + /* "w3lib/_encoding.pyx":355 + * **{ + * label: "shift_jis" + * for label in ( # <<<<<<<<<<<<<< + * "csshiftjis", + * "ms932", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L190_exit_scope; + __pyx_L186_error:; + __Pyx_GOTREF(__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L190_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 353, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":366 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "euc-kr" + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L193_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_encoding.pyx":368 + * **{ + * label: "euc-kr" + * for label in ( # <<<<<<<<<<<<<< + * "cseuckr", + * "csksc56011987", + */ + __pyx_t_3 = __pyx_tuple__38; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 10) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 368, __pyx_L193_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L193_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":367 + * }, + * **{ + * label: "euc-kr" # <<<<<<<<<<<<<< + * for label in ( + * "cseuckr", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_euc_kr))) __PYX_ERR(0, 367, __pyx_L193_error) + + /* "w3lib/_encoding.pyx":368 + * **{ + * label: "euc-kr" + * for label in ( # <<<<<<<<<<<<<< + * "cseuckr", + * "csksc56011987", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L197_exit_scope; + __pyx_L193_error:; + __Pyx_GOTREF(__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L197_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 366, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":381 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: _REPLACEMENT_ENCODING + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L200_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_encoding.pyx":383 + * **{ + * label: _REPLACEMENT_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "csiso2022kr", + * "hz-gb-2312", + */ + __pyx_t_3 = __pyx_tuple__39; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 6) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 383, __pyx_L200_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L200_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":382 + * }, + * **{ + * label: _REPLACEMENT_ENCODING # <<<<<<<<<<<<<< + * for label in ( + * "csiso2022kr", + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_REPLACEMENT_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L200_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 382, __pyx_L200_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":383 + * **{ + * label: _REPLACEMENT_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "csiso2022kr", + * "hz-gb-2312", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L204_exit_scope; + __pyx_L200_error:; + __Pyx_GOTREF(__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L204_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 381, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":392 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: _UTF_16BE_ENCODING + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L207_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_encoding.pyx":394 + * **{ + * label: _UTF_16BE_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "unicodefffe", + * "utf-16be", + */ + __pyx_t_3 = __pyx_tuple__40; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 2) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 394, __pyx_L207_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L207_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":393 + * }, + * **{ + * label: _UTF_16BE_ENCODING # <<<<<<<<<<<<<< + * for label in ( + * "unicodefffe", + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_16BE_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L207_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 393, __pyx_L207_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":394 + * **{ + * label: _UTF_16BE_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "unicodefffe", + * "utf-16be", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L211_exit_scope; + __pyx_L207_error:; + __Pyx_GOTREF(__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L211_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 392, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "w3lib/_encoding.pyx":399 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: _UTF_16LE_ENCODING + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L214_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_encoding.pyx":401 + * **{ + * label: _UTF_16LE_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "csunicode", + * "iso-10646-ucs-2", + */ + __pyx_t_3 = __pyx_tuple__41; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 7) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 401, __pyx_L214_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L214_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":400 + * }, + * **{ + * label: _UTF_16LE_ENCODING # <<<<<<<<<<<<<< + * for label in ( + * "csunicode", + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_16LE_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L214_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 400, __pyx_L214_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":401 + * **{ + * label: _UTF_16LE_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "csunicode", + * "iso-10646-ucs-2", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L218_exit_scope; + __pyx_L214_error:; + __Pyx_GOTREF(__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label); + __Pyx_DECREF_SET(__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label, Py_None); + goto __pyx_L1_error; + __pyx_L218_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 399, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_kp_u_x_user_defined, __pyx_kp_u_x_user_defined) < 0) __PYX_ERR(0, 411, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LABEL_ENCODINGS, __pyx_t_6) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_encoding.pyx":416 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoder(encoding: str) -> EncodeFunction: + * codec_info = codecs.lookup(encoding) + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 416, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_EncodeFunction) < 0) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_9_encoding_3_get_encoder, 0, __pyx_n_s_get_encoder, NULL, __pyx_n_s_w3lib__encoding, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoder, __pyx_t_2) < 0) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_encoding.pyx":422 + * + * + * _UTF_8_ENCODER = _get_encoder("utf-8") # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODER, __pyx_t_6) < 0) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_encoding.pyx":426 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 426, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_9_encoding_5_get_encoding, 0, __pyx_n_s_get_encoding, NULL, __pyx_n_s_w3lib__encoding, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_encoding.pyx":441 + * + * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( + * _REPLACEMENT_ENCODING, # <<<<<<<<<<<<<< + * _UTF_16BE_ENCODING, + * _UTF_16LE_ENCODING, + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_REPLACEMENT_ENCODING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_encoding.pyx":442 + * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( + * _REPLACEMENT_ENCODING, + * _UTF_16BE_ENCODING, # <<<<<<<<<<<<<< + * _UTF_16LE_ENCODING, + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_UTF_16BE_ENCODING); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "w3lib/_encoding.pyx":443 + * _REPLACEMENT_ENCODING, + * _UTF_16BE_ENCODING, + * _UTF_16LE_ENCODING, # <<<<<<<<<<<<<< + * ) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_UTF_16LE_ENCODING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_encoding.pyx":441 + * + * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( + * _REPLACEMENT_ENCODING, # <<<<<<<<<<<<<< + * _UTF_16BE_ENCODING, + * _UTF_16LE_ENCODING, + */ + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 441, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS, __pyx_t_4) < 0) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_encoding.pyx":448 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_output_encoding(encoding: str) -> str: + * encoding = _get_encoding(encoding) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 448, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_9_encoding_7_get_output_encoding, 0, __pyx_n_s_get_output_encoding, NULL, __pyx_n_s_w3lib__encoding, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_output_encoding, __pyx_t_3) < 0) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_encoding.pyx":1 + * # https://encoding.spec.whatwg.org/ # <<<<<<<<<<<<<< + * + * import codecs + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init w3lib._encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init w3lib._encoding"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +#endif +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* TupleAndListFromArray */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + Py_INCREF(__pyx_empty_tuple); + return __pyx_empty_tuple; + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} +static CYTHON_INLINE PyObject * +__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return PyList_New(0); + } + res = PyList_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); + return res; +} +#endif + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* fastcall */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) +{ + Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + for (i = 0; i < n; i++) + { + if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + } + for (i = 0; i < n; i++) + { + int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + if (unlikely(eq != 0)) { + if (unlikely(eq < 0)) return NULL; + return kwvalues[i]; + } + } + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { + Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + PyObject *dict; + dict = PyDict_New(); + if (unlikely(!dict)) + return NULL; + for (i=0; i= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); + while (1) { + Py_XDECREF(key); key = NULL; + Py_XDECREF(value); value = NULL; + if (kwds_is_tuple) { + Py_ssize_t size; +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(kwds); +#else + size = PyTuple_Size(kwds); + if (size < 0) goto bad; +#endif + if (pos >= size) break; +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); + if (!key) goto bad; +#elif CYTHON_ASSUME_SAFE_MACROS + key = PyTuple_GET_ITEM(kwds, pos); +#else + key = PyTuple_GetItem(kwds, pos); + if (!key) goto bad; +#endif + value = kwvalues[pos]; + pos++; + } + else + { + if (!PyDict_Next(kwds, &pos, &key, &value)) break; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + } + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(value); + Py_DECREF(key); +#endif + key = NULL; + value = NULL; + continue; + } +#if !CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + Py_INCREF(value); + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = ( + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key) + ); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + Py_XDECREF(key); + Py_XDECREF(value); + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + #if PY_MAJOR_VERSION < 3 + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + Py_XDECREF(key); + Py_XDECREF(value); + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + type_name = __Pyx_PyType_GetName(type); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { + return NULL; + } + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { + return NULL; + } + #endif + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectFastCall */ +#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result = 0; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: + Py_DECREF(argstuple); + return result; +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); + } + else if (nargs == 1 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); + } +#endif + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); + } + } + #if PY_VERSION_HEX >= 0x030700A1 + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + if (kwargs == NULL) { + #if CYTHON_VECTORCALL + #if PY_VERSION_HEX < 0x03090000 + vectorcallfunc f = _PyVectorcall_Function(func); + #else + vectorcallfunc f = PyVectorcall_Function(func); + #endif + if (f) { + return f(func, args, (size_t)nargs, NULL); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, NULL); + } + #endif + } + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + } + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif +} + +/* UnpackUnboundCMethod */ +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), + METH_VARARGS | METH_KEYWORDS, + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #else + if (likely(!__Pyx_CyOrPyCFunction_Check(method))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY +#else + if (PyCFunction_Check(method)) +#endif + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); + } +#else + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + target->method = unbound_method; + } + } + return 0; +} + +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + if (likely(cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return (*(cfunc->func))(self, arg); + } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { + #if PY_VERSION_HEX >= 0x030700A0 + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + #else + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + #endif + } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } + return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(2, self, arg); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* RaiseUnexpectedTypeError */ +static int +__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) +{ + __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, + expected, obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* DictGetItem */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); + } + } else { + PyErr_SetObject(PyExc_KeyError, key); + } + } + return NULL; + } + Py_INCREF(value); + return value; +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + PyObject *exc_value = exc_info->exc_value; + if (exc_value == NULL || exc_value == Py_None) { + *value = NULL; + *type = NULL; + *tb = NULL; + } else { + *value = exc_value; + Py_INCREF(*value); + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + *tb = PyException_GetTraceback(exc_value); + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #endif +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + PyObject *tmp_value = exc_info->exc_value; + exc_info->exc_value = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); + #else + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); + #endif +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type = NULL, *local_value, *local_tb = NULL; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030C00A6 + local_value = tstate->current_exception; + tstate->current_exception = 0; + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } + #else + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + #endif +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 + if (unlikely(tstate->current_exception)) +#elif CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + #if PY_VERSION_HEX >= 0x030B00a4 + tmp_value = exc_info->exc_value; + exc_info->exc_value = local_value; + tmp_type = NULL; + tmp_tb = NULL; + Py_XDECREF(local_type); + Py_XDECREF(local_tb); + #else + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + #endif + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* PyObjectFormatAndDecref */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { + if (unlikely(!s)) return NULL; + if (likely(PyUnicode_CheckExact(s))) return s; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(s))) { + PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); + Py_DECREF(s); + return result; + } + #endif + return __Pyx_PyObject_FormatAndDecref(s, f); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { + PyObject *result; + if (unlikely(!s)) return NULL; + result = PyObject_Format(s, f); + Py_DECREF(s); + return result; +} + +/* UnicodeConcatInPlace */ +# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +static int +__Pyx_unicode_modifiable(PyObject *unicode) +{ + if (Py_REFCNT(unicode) != 1) + return 0; + if (!PyUnicode_CheckExact(unicode)) + return 0; + if (PyUnicode_CHECK_INTERNED(unicode)) + return 0; + return 1; +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right + #if CYTHON_REFNANNY + , void* __pyx_refnanny + #endif + ) { + PyObject *left = *p_left; + Py_ssize_t left_len, right_len, new_len; + if (unlikely(__Pyx_PyUnicode_READY(left) == -1)) + return NULL; + if (unlikely(__Pyx_PyUnicode_READY(right) == -1)) + return NULL; + left_len = PyUnicode_GET_LENGTH(left); + if (left_len == 0) { + Py_INCREF(right); + return right; + } + right_len = PyUnicode_GET_LENGTH(right); + if (right_len == 0) { + Py_INCREF(left); + return left; + } + if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) { + PyErr_SetString(PyExc_OverflowError, + "strings are too large to concat"); + return NULL; + } + new_len = left_len + right_len; + if (__Pyx_unicode_modifiable(left) + && PyUnicode_CheckExact(right) + && PyUnicode_KIND(right) <= PyUnicode_KIND(left) + && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) { + int ret; + __Pyx_GIVEREF(*p_left); + ret = PyUnicode_Resize(p_left, new_len); + __Pyx_GOTREF(*p_left); + if (unlikely(ret != 0)) + return NULL; + #if PY_VERSION_HEX >= 0x030d0000 + if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL; + #else + _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len); + #endif + __Pyx_INCREF(*p_left); + __Pyx_GIVEREF(*p_left); + return *p_left; + } else { + return __Pyx_PyUnicode_Concat(left, right); + } + } +#endif + +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + __Pyx_PyThreadState_declare + CYTHON_UNUSED_VAR(cause); + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + #if PY_VERSION_HEX >= 0x030C00A6 + PyException_SetTraceback(value, tb); + #elif CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportDottedModule */ +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { + PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + if (unlikely(PyErr_Occurred())) { + PyErr_Clear(); + } + if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { + partial_name = name; + } else { + slice = PySequence_GetSlice(parts_tuple, 0, count); + if (unlikely(!slice)) + goto bad; + sep = PyUnicode_FromStringAndSize(".", 1); + if (unlikely(!sep)) + goto bad; + partial_name = PyUnicode_Join(sep, slice); + } + PyErr_Format( +#if PY_MAJOR_VERSION < 3 + PyExc_ImportError, + "No module named '%s'", PyString_AS_STRING(partial_name)); +#else +#if PY_VERSION_HEX >= 0x030600B1 + PyExc_ModuleNotFoundError, +#else + PyExc_ImportError, +#endif + "No module named '%U'", partial_name); +#endif +bad: + Py_XDECREF(sep); + Py_XDECREF(slice); + Py_XDECREF(partial_name); + return NULL; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { + PyObject *imported_module; +#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + return NULL; + imported_module = __Pyx_PyDict_GetItemStr(modules, name); + Py_XINCREF(imported_module); +#else + imported_module = PyImport_GetModule(name); +#endif + return imported_module; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { + Py_ssize_t i, nparts; + nparts = PyTuple_GET_SIZE(parts_tuple); + for (i=1; i < nparts && module; i++) { + PyObject *part, *submodule; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + part = PyTuple_GET_ITEM(parts_tuple, i); +#else + part = PySequence_ITEM(parts_tuple, i); +#endif + submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); +#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(part); +#endif + Py_DECREF(module); + module = submodule; + } + if (unlikely(!module)) { + return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); + } + return module; +} +#endif +static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if PY_MAJOR_VERSION < 3 + PyObject *module, *from_list, *star = __pyx_n_s_; + CYTHON_UNUSED_VAR(parts_tuple); + from_list = PyList_New(1); + if (unlikely(!from_list)) + return NULL; + Py_INCREF(star); + PyList_SET_ITEM(from_list, 0, star); + module = __Pyx_Import(name, from_list, 0); + Py_DECREF(from_list); + return module; +#else + PyObject *imported_module; + PyObject *module = __Pyx_Import(name, NULL, 0); + if (!parts_tuple || unlikely(!module)) + return module; + imported_module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(imported_module)) { + Py_DECREF(module); + return imported_module; + } + PyErr_Clear(); + return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); +#endif +} +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 + PyObject *module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(module)) { + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + if (likely(spec)) { + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { + Py_DECREF(spec); + spec = NULL; + } + Py_XDECREF(unsafe); + } + if (likely(!spec)) { + PyErr_Clear(); + return module; + } + Py_DECREF(spec); + Py_DECREF(module); + } else if (PyErr_Occurred()) { + PyErr_Clear(); + } +#endif + return __Pyx__ImportDottedModule(name, parts_tuple); +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + const char* module_name_str = 0; + PyObject* module_name = 0; + PyObject* module_dot = 0; + PyObject* full_name = 0; + PyErr_Clear(); + module_name_str = PyModule_GetName(module); + if (unlikely(!module_name_str)) { goto modbad; } + module_name = PyUnicode_FromString(module_name_str); + if (unlikely(!module_name)) { goto modbad; } + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); + if (unlikely(!module_dot)) { goto modbad; } + full_name = PyUnicode_Concat(module_dot, name); + if (unlikely(!full_name)) { goto modbad; } + #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + { + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + goto modbad; + value = PyObject_GetItem(modules, full_name); + } + #else + value = PyImport_GetModule(full_name); + #endif + modbad: + Py_XDECREF(full_name); + Py_XDECREF(module_dot); + Py_XDECREF(module_name); + } + if (unlikely(!value)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (unlikely(!j)) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (mm && mm->mp_subscript) { + PyObject *r, *key = PyInt_FromSsize_t(i); + if (unlikely(!key)) return NULL; + r = mm->mp_subscript(o, key); + Py_DECREF(key); + return r; + } + if (likely(sm && sm->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return sm->sq_item(o, i); + } + } +#else + if (is_list || !PyMapping_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { + PyObject *runerr = NULL; + Py_ssize_t key_value; + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, + "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); + __Pyx_DECREF_TypeName(index_type_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { + __Pyx_TypeName obj_type_name; + if (likely(PyType_Check(obj))) { + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); + if (!meth) { + PyErr_Clear(); + } else { + PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); + Py_DECREF(meth); + return result; + } + } + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { + PyTypeObject *tp = Py_TYPE(obj); + PyMappingMethods *mm = tp->tp_as_mapping; + PySequenceMethods *sm = tp->tp_as_sequence; + if (likely(mm && mm->mp_subscript)) { + return mm->mp_subscript(obj, key); + } + if (likely(sm && sm->sq_item)) { + return __Pyx_PyObject_GetIndex(obj, key); + } + return __Pyx_PyObject_GetItem_Slow(obj, key); +} +#endif + +/* FixUpExtensionType */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { +#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + CYTHON_UNUSED_VAR(spec); + CYTHON_UNUSED_VAR(type); +#else + const PyType_Slot *slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_members) + slot++; + if (slot && slot->slot == Py_tp_members) { + int changed = 0; +#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) + const +#endif + PyMemberDef *memb = (PyMemberDef*) slot->pfunc; + while (memb && memb->name) { + if (memb->name[0] == '_' && memb->name[1] == '_') { +#if PY_VERSION_HEX < 0x030900b1 + if (strcmp(memb->name, "__weaklistoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_weaklistoffset = memb->offset; + changed = 1; + } + else if (strcmp(memb->name, "__dictoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_dictoffset = memb->offset; + changed = 1; + } +#if CYTHON_METH_FASTCALL + else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); +#if PY_VERSION_HEX >= 0x030800b4 + type->tp_vectorcall_offset = memb->offset; +#else + type->tp_print = (printfunc) memb->offset; +#endif + changed = 1; + } +#endif +#else + if ((0)); +#endif +#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON + else if (strcmp(memb->name, "__module__") == 0) { + PyObject *descr; + assert(memb->type == T_OBJECT); + assert(memb->flags == 0 || memb->flags == READONLY); + descr = PyDescr_NewMember(type, memb); + if (unlikely(!descr)) + return -1; + if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { + Py_DECREF(descr); + return -1; + } + Py_DECREF(descr); + changed = 1; + } +#endif + } + memb++; + } + if (changed) + PyType_Modified(type); + } +#endif + return 0; +} +#endif + +/* FetchSharedCythonModule */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); +} + +/* FetchCommonType */ +static int __Pyx_VerifyCachedType(PyObject *cached_type, + const char *name, + Py_ssize_t basicsize, + Py_ssize_t expected_basicsize) { + if (!PyType_Check(cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", name); + return -1; + } + if (basicsize != expected_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + name); + return -1; + } + return 0; +} +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* abi_module; + const char* object_name; + PyTypeObject *cached_type = NULL; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + object_name = strrchr(type->tp_name, '.'); + object_name = object_name ? object_name+1 : type->tp_name; + cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + if (__Pyx_VerifyCachedType( + (PyObject *)cached_type, + object_name, + cached_type->tp_basicsize, + type->tp_basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; +done: + Py_DECREF(abi_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#else +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { + PyObject *abi_module, *cached_type = NULL; + const char* object_name = strrchr(spec->name, '.'); + object_name = object_name ? object_name+1 : spec->name; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + cached_type = PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + Py_ssize_t basicsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; +#else + basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; +#endif + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + basicsize, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + CYTHON_UNUSED_VAR(module); + cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + if (unlikely(!cached_type)) goto bad; + if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; +done: + Py_DECREF(abi_module); + assert(cached_type == NULL || PyType_Check(cached_type)); + return (PyTypeObject *) cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#endif + +/* PyVectorcallFastCallDict */ +#if CYTHON_METH_FASTCALL +static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + PyObject *res = NULL; + PyObject *kwnames; + PyObject **newargs; + PyObject **kwvalues; + Py_ssize_t i, pos; + size_t j; + PyObject *key, *value; + unsigned long keys_are_strings; + Py_ssize_t nkw = PyDict_GET_SIZE(kw); + newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); + if (unlikely(newargs == NULL)) { + PyErr_NoMemory(); + return NULL; + } + for (j = 0; j < nargs; j++) newargs[j] = args[j]; + kwnames = PyTuple_New(nkw); + if (unlikely(kwnames == NULL)) { + PyMem_Free(newargs); + return NULL; + } + kwvalues = newargs + nargs; + pos = i = 0; + keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; + while (PyDict_Next(kw, &pos, &key, &value)) { + keys_are_strings &= Py_TYPE(key)->tp_flags; + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(kwnames, i, key); + kwvalues[i] = value; + i++; + } + if (unlikely(!keys_are_strings)) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + goto cleanup; + } + res = vc(func, newargs, nargs, kwnames); +cleanup: + Py_DECREF(kwnames); + for (i = 0; i < nkw; i++) + Py_DECREF(kwvalues[i]); + PyMem_Free(newargs); + return res; +} +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + return vc(func, args, nargs, NULL); + } + return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); +} +#endif + +/* CythonFunctionShared */ +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if (__Pyx_CyFunction_Check(func)) { + return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; + } else if (PyCFunction_Check(func)) { + return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; + } + return 0; +} +#else +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +} +#endif +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + __Pyx_Py_XDECREF_SET( + __Pyx_CyFunction_GetClassObj(f), + ((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#else + __Pyx_Py_XDECREF_SET( + ((PyCMethodObject *) (f))->mm_class, + (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#endif +} +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +{ + CYTHON_UNUSED_VAR(closure); + if (unlikely(op->func_doc == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); + if (unlikely(!op->func_doc)) return NULL; +#else + if (((PyCFunctionObject*)op)->m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } +#endif + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_doc, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_name == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_name = PyObject_GetAttrString(op->func, "__name__"); +#elif PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_name, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_qualname, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_dict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(op); + CYTHON_UNUSED_VAR(context); + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + CYTHON_UNUSED_VAR(context); + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_tuple; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_kwdict; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value || value == Py_None) { + value = NULL; + } else if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + __Pyx_Py_XDECREF_SET(op->func_annotations, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->func_annotations; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + int is_coroutine; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; +#if PY_VERSION_HEX >= 0x03050000 + if (is_coroutine) { + PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + fromlist = PyList_New(1); + if (unlikely(!fromlist)) return NULL; + Py_INCREF(marker); +#if CYTHON_ASSUME_SAFE_MACROS + PyList_SET_ITEM(fromlist, 0, marker); +#else + if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { + Py_DECREF(marker); + Py_DECREF(fromlist); + return NULL; + } +#endif + module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + if (unlikely(!module)) goto ignore; + op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + Py_DECREF(module); + if (likely(op->func_is_coroutine)) { + return __Pyx_NewRef(op->func_is_coroutine); + } +ignore: + PyErr_Clear(); + } +#endif + op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); + return __Pyx_NewRef(op->func_is_coroutine); +} +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_GetAttrString(op->func, "__module__"); +} +static int +__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_SetAttrString(op->func, "__module__", value); +} +#endif +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, +#endif + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { +#if !CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#endif +#if CYTHON_USE_TYPE_SPECS + {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#if CYTHON_METH_FASTCALL +#if CYTHON_BACKPORT_VECTORCALL + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#else +#if !CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, +#endif +#endif +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#else + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, +#endif +#endif + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) +{ + CYTHON_UNUSED_VAR(args); +#if PY_MAJOR_VERSION >= 3 + Py_INCREF(m->func_qualname); + return m->func_qualname; +#else + return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { +#if !CYTHON_COMPILING_IN_LIMITED_API + PyCFunctionObject *cf = (PyCFunctionObject*) op; +#endif + if (unlikely(op == NULL)) + return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API + op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); + if (unlikely(!op->func)) return NULL; +#endif + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; +#if !CYTHON_COMPILING_IN_LIMITED_API + cf->m_ml = ml; + cf->m_self = (PyObject *) op; +#endif + Py_XINCREF(closure); + op->func_closure = closure; +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_XINCREF(module); + cf->m_module = module; +#endif + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + op->func_classobj = NULL; +#else + ((PyCMethodObject*)op)->mm_class = NULL; +#endif + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults_size = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + op->func_is_coroutine = NULL; +#if CYTHON_METH_FASTCALL + switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { + case METH_NOARGS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; + break; + case METH_O: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; + break; + case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; + break; + case METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; + break; + case METH_VARARGS | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = NULL; + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + Py_DECREF(op); + return NULL; + } +#endif + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_CLEAR(m->func); +#else + Py_CLEAR(((PyCFunctionObject*)m)->m_module); +#endif + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API +#if PY_VERSION_HEX < 0x030900B1 + Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); +#else + { + PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; + ((PyCMethodObject *) (m))->mm_class = NULL; + Py_XDECREF(cls); + } +#endif +#endif + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + Py_CLEAR(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + __Pyx_PyHeapTypeObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(m->func); +#else + Py_VISIT(((PyCFunctionObject*)m)->m_module); +#endif + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); +#endif + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *f = ((__pyx_CyFunctionObject*)func)->func; + PyObject *py_name = NULL; + PyCFunction meth; + int flags; + meth = PyCFunction_GetFunction(f); + if (unlikely(!meth)) return NULL; + flags = PyCFunction_GetFlags(f); + if (unlikely(flags < 0)) return NULL; +#else + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + int flags = f->m_ml->ml_flags; +#endif + Py_ssize_t size; + switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 0)) + return (*meth)(self, NULL); +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); +#endif + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); +#endif + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + return NULL; + } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", + py_name); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); +#endif + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *self, *result; +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)func)->m_self; +#endif + result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); + return result; +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; +#if CYTHON_METH_FASTCALL + __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); + if (vc) { +#if CYTHON_ASSUME_SAFE_MACROS + return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); +#else + (void) &__Pyx_PyVectorcall_FastCallDict; + return PyVectorcall_Call(func, args, kw); +#endif + } +#endif + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; +#if CYTHON_ASSUME_SAFE_MACROS + argc = PyTuple_GET_SIZE(args); +#else + argc = PyTuple_Size(args); + if (unlikely(!argc) < 0) return NULL; +#endif + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); +#if PY_MAJOR_VERSION > 2 + PyErr_Format(PyExc_TypeError, + "unbound method %.200S() needs an argument", + cyfunc->func_qualname); +#else + PyErr_SetString(PyExc_TypeError, + "unbound method needs an argument"); +#endif + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) +{ + int ret = 0; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + if (unlikely(nargs < 1)) { + PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", + ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + ret = 1; + } + if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + return ret; +} +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 0)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, NULL); +} +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 1)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, args[0]); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; + PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); +} +#endif +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_CyFunctionType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, + {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, + {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, + {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, + {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, + {Py_tp_methods, (void *)__pyx_CyFunction_methods}, + {Py_tp_members, (void *)__pyx_CyFunction_members}, + {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, + {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, + {0, 0}, +}; +static PyType_Spec __pyx_CyFunctionType_spec = { + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + __pyx_CyFunctionType_slots +}; +#else +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, +#if !CYTHON_METH_FASTCALL + 0, +#elif CYTHON_BACKPORT_VECTORCALL + (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), +#else + offsetof(PyCFunctionObject, vectorcall), +#endif + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_PyMethod_New, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_CyFunction_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); +#endif + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + m->defaults_size = size; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + +/* RaiseMappingExpected */ +static void __Pyx_RaiseMappingExpectedError(PyObject* arg) { + __Pyx_TypeName arg_type_name = __Pyx_PyType_GetName(Py_TYPE(arg)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' object is not a mapping", arg_type_name); + __Pyx_DECREF_TypeName(arg_type_name); +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, + PyObject *firstlineno, PyObject *name) { + PyObject *replace = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; + replace = PyObject_GetAttrString(code, "replace"); + if (likely(replace)) { + PyObject *result; + result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + Py_DECREF(replace); + return result; + } + PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 + { + PyObject *compiled = NULL, *result = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; + compiled = Py_CompileString( + "out = type(code)(\n" + " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" + " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" + " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" + " code.co_lnotab)\n", "", Py_file_input); + if (!compiled) return NULL; + result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); + Py_DECREF(compiled); + if (!result) PyErr_Print(); + Py_DECREF(result); + result = PyDict_GetItemString(scratch_dict, "out"); + if (result) Py_INCREF(result); + return result; + } + #else + return NULL; + #endif +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; + PyObject *replace = NULL, *getframe = NULL, *frame = NULL; + PyObject *exc_type, *exc_value, *exc_traceback; + int success = 0; + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + getframe = PySys_GetObject("_getframe"); + if (unlikely(!getframe)) goto bad; + if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; + frame = PyEval_EvalCode(code_object, dict, dict); + if (unlikely(!frame) || frame == Py_None) goto bad; + success = 1; + bad: + PyErr_Restore(exc_type, exc_value, exc_traceback); + Py_XDECREF(code_object); + Py_XDECREF(py_py_line); + Py_XDECREF(py_funcname); + Py_XDECREF(dict); + Py_XDECREF(replace); + if (success) { + PyTraceBack_Here( + (struct _frame*)frame); + } + Py_XDECREF(frame); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__49); + } + return name; +} +#endif + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030B00A4 + return Py_Version & ~0xFFUL; +#else + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + return version; +#endif +} +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { + const unsigned long MAJOR_MINOR = 0xFFFF0000UL; + if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) + return 0; + if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) + return 1; + { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compile time Python version %d.%d " + "of module '%.100s' " + "%s " + "runtime version %d.%d", + (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), + __Pyx_MODULE_NAME, + (allow_newer) ? "was newer than" : "does not match", + (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) + ); + return PyErr_WarnEx(NULL, message, 1); + } +} + +/* InitStrings */ +#if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +#include +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { + size_t len = strlen(s); + if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, "byte string is too long"); + return -1; + } + return (Py_ssize_t) len; +} +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return __Pyx_PyUnicode_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return PyByteArray_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/w3lib/_encoding.py b/w3lib/_encoding.pyx similarity index 100% rename from w3lib/_encoding.py rename to w3lib/_encoding.pyx diff --git a/w3lib/_infra.c b/w3lib/_infra.c new file mode 100644 index 00000000..840c05f8 --- /dev/null +++ b/w3lib/_infra.c @@ -0,0 +1,7401 @@ +/* Generated by Cython 3.0.8 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "name": "w3lib._infra", + "sources": [ + "w3lib/_infra.pyx" + ] + }, + "module_name": "w3lib._infra" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API +#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#else +#define __PYX_EXTRA_ABI_MODULE_NAME "" +#endif +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030008F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #ifdef Py_LIMITED_API + #undef __PYX_LIMITED_VERSION_HEX + #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API + #endif + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_USE_CPP_STD_MOVE + #if defined(__cplusplus) && (\ + __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) + #define CYTHON_USE_CPP_STD_MOVE 1 + #else + #define CYTHON_USE_CPP_STD_MOVE 0 + #endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #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 +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if CYTHON_COMPILING_IN_LIMITED_API + static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } + #ifndef CO_OPTIMIZED + #define CO_OPTIMIZED 0x0001 + #endif + #ifndef CO_NEWLOCALS + #define CO_NEWLOCALS 0x0002 + #endif + #ifndef CO_VARARGS + #define CO_VARARGS 0x0004 + #endif + #ifndef CO_VARKEYWORDS + #define CO_VARKEYWORDS 0x0008 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x0200 + #endif + #ifndef CO_GENERATOR + #define CO_GENERATOR 0x0020 + #endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x0080 + #endif +#elif PY_VERSION_HEX >= 0x030B0000 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); + if (!empty_bytes) return NULL; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); + Py_DECREF(empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_MAJOR_VERSION >= 0x030900B1 +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) +#else +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) +#endif +#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) +#elif !CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) +static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { + return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; +} +#endif +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API + return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; +#else + return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +#endif +} +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) +#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) +#else + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) +#endif +#if PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__w3lib___infra +#define __PYX_HAVE_API__w3lib___infra +/* Early includes */ +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#include +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#include +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "w3lib/_infra.pyx", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* #### Code section: numeric_typedefs ### */ +/* #### Code section: complex_type_declarations ### */ +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ +struct __pyx_obj_5w3lib_6_infra___pyx_scope_struct__genexpr; + +/* "w3lib/_infra.pyx":8 + * _ASCII_TAB_OR_NEWLINE = "\t\n\r" + * _ASCII_WHITESPACE = "\t\n\x0c\r " + * _C0_CONTROL = "".join(chr(n) for n in range(32)) # <<<<<<<<<<<<<< + * _C0_CONTROL_OR_SPACE = _C0_CONTROL + " " + * _ASCII_DIGIT = string.digits + */ +struct __pyx_obj_5w3lib_6_infra___pyx_scope_struct__genexpr { + PyObject_HEAD + long __pyx_v_n; +}; + +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#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 + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + L->ob_item[len] = x; + #else + PyList_SET_ITEM(list, len, x); + #endif + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#if !CYTHON_VECTORCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if !CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03080000 + #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #define __Pxy_PyFrame_Initialize_Offsets() + #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) +#else + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif +#endif +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectFastCall.proto */ +#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* pep479.proto */ +static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); + +/* IncludeStringH.proto */ +#include + +/* IncludeStructmemberH.proto */ +#include + +/* FixUpExtensionType.proto */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); +#endif + +/* PyObjectCallNoArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* ValidateBasesTuple.proto */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); +#endif + +/* PyType_Ready.proto */ +CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportDottedModule.proto */ +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); +#endif + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* CLineInTraceback.proto */ +#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 */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* FetchSharedCythonModule.proto */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); + +/* FetchCommonType.proto */ +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); +#else +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* CoroutineBase.proto */ +struct __pyx_CoroutineObject; +typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_ExcInfoStruct _PyErr_StackItem +#else +typedef struct { + PyObject *exc_type; + PyObject *exc_value; + PyObject *exc_traceback; +} __Pyx_ExcInfoStruct; +#endif +typedef struct __pyx_CoroutineObject { + PyObject_HEAD + __pyx_coroutine_body_t body; + PyObject *closure; + __Pyx_ExcInfoStruct gi_exc_state; + PyObject *gi_weakreflist; + PyObject *classobj; + PyObject *yieldfrom; + PyObject *gi_name; + PyObject *gi_qualname; + PyObject *gi_modulename; + PyObject *gi_code; + PyObject *gi_frame; + int resume_label; + char is_running; +} __pyx_CoroutineObject; +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); +static int __Pyx_Coroutine_clear(PyObject *self); +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); +static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_Coroutine_SwapException(self) +#define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) +#else +#define __Pyx_Coroutine_SwapException(self) {\ + __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ + __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ + } +#define __Pyx_Coroutine_ResetAndClearException(self) {\ + __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ + (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ + } +#endif +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) +#endif +static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); + +/* PatchModuleWithCoroutine.proto */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); + +/* PatchGeneratorABC.proto */ +static int __Pyx_patch_abc(void); + +/* Generator.proto */ +#define __Pyx_Generator_USED +#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) +#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ + __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) +static PyObject *__Pyx_Generator_Next(PyObject *self); +static int __pyx_Generator_init(PyObject *module); + +/* CheckBinaryVersion.proto */ +static unsigned long __Pyx_get_runtime_version(void); +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ + +/* Module declarations from "w3lib._infra" */ +/* #### Code section: typeinfo ### */ +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "w3lib._infra" +extern int __pyx_module_is_main_w3lib___infra; +int __pyx_module_is_main_w3lib___infra = 0; + +/* Implementation of "w3lib._infra" */ +/* #### Code section: global_var ### */ +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_chr; +/* #### Code section: string_decls ### */ +static const char __pyx_k_[] = "*"; +static const char __pyx_k__2[] = "\t\n\r"; +static const char __pyx_k__3[] = "\t\n\014\r "; +static const char __pyx_k__4[] = ""; +static const char __pyx_k__5[] = " "; +static const char __pyx_k__6[] = "?"; +static const char __pyx_k_gc[] = "gc"; +static const char __pyx_k_chr[] = "chr"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_send[] = "send"; +static const char __pyx_k_spec[] = "__spec__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_digits[] = "digits"; +static const char __pyx_k_enable[] = "enable"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_string[] = "string"; +static const char __pyx_k_disable[] = "disable"; +static const char __pyx_k_genexpr[] = "genexpr"; +static const char __pyx_k_hexdigits[] = "hexdigits"; +static const char __pyx_k_isenabled[] = "isenabled"; +static const char __pyx_k_C0_CONTROL[] = "_C0_CONTROL"; +static const char __pyx_k_ASCII_ALPHA[] = "_ASCII_ALPHA"; +static const char __pyx_k_ASCII_DIGIT[] = "_ASCII_DIGIT"; +static const char __pyx_k_initializing[] = "_initializing"; +static const char __pyx_k_w3lib__infra[] = "w3lib._infra"; +static const char __pyx_k_ascii_letters[] = "ascii_letters"; +static const char __pyx_k_ASCII_HEX_DIGIT[] = "_ASCII_HEX_DIGIT"; +static const char __pyx_k_ASCII_WHITESPACE[] = "_ASCII_WHITESPACE"; +static const char __pyx_k_ASCII_ALPHANUMERIC[] = "_ASCII_ALPHANUMERIC"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_C0_CONTROL_OR_SPACE[] = "_C0_CONTROL_OR_SPACE"; +static const char __pyx_k_ASCII_TAB_OR_NEWLINE[] = "_ASCII_TAB_OR_NEWLINE"; +/* #### Code section: decls ### */ +static PyObject *__pyx_pf_5w3lib_6_infra_genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_tp_new_5w3lib_6_infra___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + PyObject *__pyx_type_5w3lib_6_infra___pyx_scope_struct__genexpr; + #endif + PyTypeObject *__pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr; + PyObject *__pyx_n_s_; + PyObject *__pyx_n_s_ASCII_ALPHA; + PyObject *__pyx_n_s_ASCII_ALPHANUMERIC; + PyObject *__pyx_n_s_ASCII_DIGIT; + PyObject *__pyx_n_s_ASCII_HEX_DIGIT; + PyObject *__pyx_n_s_ASCII_TAB_OR_NEWLINE; + PyObject *__pyx_n_s_ASCII_WHITESPACE; + PyObject *__pyx_n_s_C0_CONTROL; + PyObject *__pyx_n_s_C0_CONTROL_OR_SPACE; + PyObject *__pyx_kp_u__2; + PyObject *__pyx_kp_u__3; + PyObject *__pyx_kp_u__4; + PyObject *__pyx_kp_u__5; + PyObject *__pyx_n_s__6; + PyObject *__pyx_n_s_args; + PyObject *__pyx_n_s_ascii_letters; + PyObject *__pyx_n_s_chr; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_close; + PyObject *__pyx_n_s_digits; + PyObject *__pyx_kp_u_disable; + PyObject *__pyx_kp_u_enable; + PyObject *__pyx_kp_u_gc; + PyObject *__pyx_n_s_genexpr; + PyObject *__pyx_n_s_hexdigits; + PyObject *__pyx_n_s_import; + PyObject *__pyx_n_s_initializing; + PyObject *__pyx_kp_u_isenabled; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_range; + PyObject *__pyx_n_s_send; + PyObject *__pyx_n_s_spec; + PyObject *__pyx_n_s_string; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_throw; + PyObject *__pyx_n_s_w3lib__infra; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr); + Py_CLEAR(clear_module_state->__pyx_type_5w3lib_6_infra___pyx_scope_struct__genexpr); + Py_CLEAR(clear_module_state->__pyx_n_s_); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_ALPHA); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_ALPHANUMERIC); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_DIGIT); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_HEX_DIGIT); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_TAB_OR_NEWLINE); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_WHITESPACE); + Py_CLEAR(clear_module_state->__pyx_n_s_C0_CONTROL); + Py_CLEAR(clear_module_state->__pyx_n_s_C0_CONTROL_OR_SPACE); + Py_CLEAR(clear_module_state->__pyx_kp_u__2); + Py_CLEAR(clear_module_state->__pyx_kp_u__3); + Py_CLEAR(clear_module_state->__pyx_kp_u__4); + Py_CLEAR(clear_module_state->__pyx_kp_u__5); + Py_CLEAR(clear_module_state->__pyx_n_s__6); + Py_CLEAR(clear_module_state->__pyx_n_s_args); + Py_CLEAR(clear_module_state->__pyx_n_s_ascii_letters); + Py_CLEAR(clear_module_state->__pyx_n_s_chr); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_close); + Py_CLEAR(clear_module_state->__pyx_n_s_digits); + Py_CLEAR(clear_module_state->__pyx_kp_u_disable); + Py_CLEAR(clear_module_state->__pyx_kp_u_enable); + Py_CLEAR(clear_module_state->__pyx_kp_u_gc); + Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); + Py_CLEAR(clear_module_state->__pyx_n_s_hexdigits); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_n_s_initializing); + Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_range); + Py_CLEAR(clear_module_state->__pyx_n_s_send); + Py_CLEAR(clear_module_state->__pyx_n_s_spec); + Py_CLEAR(clear_module_state->__pyx_n_s_string); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_throw); + Py_CLEAR(clear_module_state->__pyx_n_s_w3lib__infra); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr); + Py_VISIT(traverse_module_state->__pyx_type_5w3lib_6_infra___pyx_scope_struct__genexpr); + Py_VISIT(traverse_module_state->__pyx_n_s_); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_ALPHA); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_ALPHANUMERIC); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_DIGIT); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_HEX_DIGIT); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_TAB_OR_NEWLINE); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_WHITESPACE); + Py_VISIT(traverse_module_state->__pyx_n_s_C0_CONTROL); + Py_VISIT(traverse_module_state->__pyx_n_s_C0_CONTROL_OR_SPACE); + Py_VISIT(traverse_module_state->__pyx_kp_u__2); + Py_VISIT(traverse_module_state->__pyx_kp_u__3); + Py_VISIT(traverse_module_state->__pyx_kp_u__4); + Py_VISIT(traverse_module_state->__pyx_kp_u__5); + Py_VISIT(traverse_module_state->__pyx_n_s__6); + Py_VISIT(traverse_module_state->__pyx_n_s_args); + Py_VISIT(traverse_module_state->__pyx_n_s_ascii_letters); + Py_VISIT(traverse_module_state->__pyx_n_s_chr); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_close); + Py_VISIT(traverse_module_state->__pyx_n_s_digits); + Py_VISIT(traverse_module_state->__pyx_kp_u_disable); + Py_VISIT(traverse_module_state->__pyx_kp_u_enable); + Py_VISIT(traverse_module_state->__pyx_kp_u_gc); + Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); + Py_VISIT(traverse_module_state->__pyx_n_s_hexdigits); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_n_s_initializing); + Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_range); + Py_VISIT(traverse_module_state->__pyx_n_s_send); + Py_VISIT(traverse_module_state->__pyx_n_s_spec); + Py_VISIT(traverse_module_state->__pyx_n_s_string); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_throw); + Py_VISIT(traverse_module_state->__pyx_n_s_w3lib__infra); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#define __pyx_type_5w3lib_6_infra___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_type_5w3lib_6_infra___pyx_scope_struct__genexpr +#endif +#define __pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr +#define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ +#define __pyx_n_s_ASCII_ALPHA __pyx_mstate_global->__pyx_n_s_ASCII_ALPHA +#define __pyx_n_s_ASCII_ALPHANUMERIC __pyx_mstate_global->__pyx_n_s_ASCII_ALPHANUMERIC +#define __pyx_n_s_ASCII_DIGIT __pyx_mstate_global->__pyx_n_s_ASCII_DIGIT +#define __pyx_n_s_ASCII_HEX_DIGIT __pyx_mstate_global->__pyx_n_s_ASCII_HEX_DIGIT +#define __pyx_n_s_ASCII_TAB_OR_NEWLINE __pyx_mstate_global->__pyx_n_s_ASCII_TAB_OR_NEWLINE +#define __pyx_n_s_ASCII_WHITESPACE __pyx_mstate_global->__pyx_n_s_ASCII_WHITESPACE +#define __pyx_n_s_C0_CONTROL __pyx_mstate_global->__pyx_n_s_C0_CONTROL +#define __pyx_n_s_C0_CONTROL_OR_SPACE __pyx_mstate_global->__pyx_n_s_C0_CONTROL_OR_SPACE +#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 +#define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 +#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 +#define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 +#define __pyx_n_s__6 __pyx_mstate_global->__pyx_n_s__6 +#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args +#define __pyx_n_s_ascii_letters __pyx_mstate_global->__pyx_n_s_ascii_letters +#define __pyx_n_s_chr __pyx_mstate_global->__pyx_n_s_chr +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close +#define __pyx_n_s_digits __pyx_mstate_global->__pyx_n_s_digits +#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable +#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable +#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc +#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr +#define __pyx_n_s_hexdigits __pyx_mstate_global->__pyx_n_s_hexdigits +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing +#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range +#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send +#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec +#define __pyx_n_s_string __pyx_mstate_global->__pyx_n_s_string +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw +#define __pyx_n_s_w3lib__infra __pyx_mstate_global->__pyx_n_s_w3lib__infra +/* #### Code section: module_code ### */ +static PyObject *__pyx_gb_5w3lib_6_infra_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "w3lib/_infra.pyx":8 + * _ASCII_TAB_OR_NEWLINE = "\t\n\r" + * _ASCII_WHITESPACE = "\t\n\x0c\r " + * _C0_CONTROL = "".join(chr(n) for n in range(32)) # <<<<<<<<<<<<<< + * _C0_CONTROL_OR_SPACE = _C0_CONTROL + " " + * _ASCII_DIGIT = string.digits + */ + +static PyObject *__pyx_pf_5w3lib_6_infra_genexpr(CYTHON_UNUSED PyObject *__pyx_self) { + struct __pyx_obj_5w3lib_6_infra___pyx_scope_struct__genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_5w3lib_6_infra___pyx_scope_struct__genexpr *)__pyx_tp_new_5w3lib_6_infra___pyx_scope_struct__genexpr(__pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_5w3lib_6_infra___pyx_scope_struct__genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 8, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_6_infra_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_w3lib__infra); if (unlikely(!gen)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("w3lib._infra.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_5w3lib_6_infra_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_5w3lib_6_infra___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_6_infra___pyx_scope_struct__genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + long __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + for (__pyx_t_1 = 0; __pyx_t_1 < 32; __pyx_t_1+=1) { + __pyx_cur_scope->__pyx_v_n = __pyx_t_1; + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static struct __pyx_obj_5w3lib_6_infra___pyx_scope_struct__genexpr *__pyx_freelist_5w3lib_6_infra___pyx_scope_struct__genexpr[8]; +static int __pyx_freecount_5w3lib_6_infra___pyx_scope_struct__genexpr = 0; + +static PyObject *__pyx_tp_new_5w3lib_6_infra___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + #if CYTHON_COMPILING_IN_CPYTHON + if (likely((int)(__pyx_freecount_5w3lib_6_infra___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_6_infra___pyx_scope_struct__genexpr)))) { + o = (PyObject*)__pyx_freelist_5w3lib_6_infra___pyx_scope_struct__genexpr[--__pyx_freecount_5w3lib_6_infra___pyx_scope_struct__genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_5w3lib_6_infra___pyx_scope_struct__genexpr)); + (void) PyObject_INIT(o, t); + } else + #endif + { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc_5w3lib_6_infra___pyx_scope_struct__genexpr(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5w3lib_6_infra___pyx_scope_struct__genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + #if CYTHON_COMPILING_IN_CPYTHON + if (((int)(__pyx_freecount_5w3lib_6_infra___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_6_infra___pyx_scope_struct__genexpr)))) { + __pyx_freelist_5w3lib_6_infra___pyx_scope_struct__genexpr[__pyx_freecount_5w3lib_6_infra___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_5w3lib_6_infra___pyx_scope_struct__genexpr *)o); + } else + #endif + { + #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + (*Py_TYPE(o)->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + if (tp_free) tp_free(o); + } + #endif + } +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_5w3lib_6_infra___pyx_scope_struct__genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5w3lib_6_infra___pyx_scope_struct__genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_5w3lib_6_infra___pyx_scope_struct__genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_5w3lib_6_infra___pyx_scope_struct__genexpr_spec = { + "w3lib._infra.__pyx_scope_struct__genexpr", + sizeof(struct __pyx_obj_5w3lib_6_infra___pyx_scope_struct__genexpr), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_5w3lib_6_infra___pyx_scope_struct__genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_5w3lib_6_infra___pyx_scope_struct__genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "w3lib._infra.""__pyx_scope_struct__genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_5w3lib_6_infra___pyx_scope_struct__genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_5w3lib_6_infra___pyx_scope_struct__genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_5w3lib_6_infra___pyx_scope_struct__genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_ALPHA, __pyx_k_ASCII_ALPHA, sizeof(__pyx_k_ASCII_ALPHA), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_ALPHANUMERIC, __pyx_k_ASCII_ALPHANUMERIC, sizeof(__pyx_k_ASCII_ALPHANUMERIC), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_DIGIT, __pyx_k_ASCII_DIGIT, sizeof(__pyx_k_ASCII_DIGIT), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_HEX_DIGIT, __pyx_k_ASCII_HEX_DIGIT, sizeof(__pyx_k_ASCII_HEX_DIGIT), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_TAB_OR_NEWLINE, __pyx_k_ASCII_TAB_OR_NEWLINE, sizeof(__pyx_k_ASCII_TAB_OR_NEWLINE), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_WHITESPACE, __pyx_k_ASCII_WHITESPACE, sizeof(__pyx_k_ASCII_WHITESPACE), 0, 0, 1, 1}, + {&__pyx_n_s_C0_CONTROL, __pyx_k_C0_CONTROL, sizeof(__pyx_k_C0_CONTROL), 0, 0, 1, 1}, + {&__pyx_n_s_C0_CONTROL_OR_SPACE, __pyx_k_C0_CONTROL_OR_SPACE, sizeof(__pyx_k_C0_CONTROL_OR_SPACE), 0, 0, 1, 1}, + {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, + {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, + {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, + {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, + {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_ascii_letters, __pyx_k_ascii_letters, sizeof(__pyx_k_ascii_letters), 0, 0, 1, 1}, + {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_digits, __pyx_k_digits, sizeof(__pyx_k_digits), 0, 0, 1, 1}, + {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, + {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, + {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, + {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_hexdigits, __pyx_k_hexdigits, sizeof(__pyx_k_hexdigits), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, + {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, + {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_w3lib__infra, __pyx_k_w3lib__infra, sizeof(__pyx_k_w3lib__infra), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 8, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + __Pyx_RefNannyFinishContext(); + return 0; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + return 0; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_6_infra___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr)) __PYX_ERR(0, 8, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_6_infra___pyx_scope_struct__genexpr_spec, __pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + #else + __pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr = &__pyx_type_5w3lib_6_infra___pyx_scope_struct__genexpr; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_5w3lib_6_infra___pyx_scope_struct__genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__infra(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__infra}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "_infra", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_infra(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_infra(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__infra(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__infra(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__infra(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_infra' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_infra", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_infra" pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__infra(void)", 0); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_w3lib___infra) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "w3lib._infra")) { + if (unlikely((PyDict_SetItemString(modules, "w3lib._infra", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "w3lib/_infra.pyx":3 + * # https://infra.spec.whatwg.org/ + * + * import string # <<<<<<<<<<<<<< + * + * # https://infra.spec.whatwg.org/commit-snapshots/59e0d16c1e3ba0e77c6a60bfc69a0929b8ffaa5d/#code-points + */ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_string, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_string, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_infra.pyx":6 + * + * # https://infra.spec.whatwg.org/commit-snapshots/59e0d16c1e3ba0e77c6a60bfc69a0929b8ffaa5d/#code-points + * _ASCII_TAB_OR_NEWLINE = "\t\n\r" # <<<<<<<<<<<<<< + * _ASCII_WHITESPACE = "\t\n\x0c\r " + * _C0_CONTROL = "".join(chr(n) for n in range(32)) + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE, __pyx_kp_u__2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + + /* "w3lib/_infra.pyx":7 + * # https://infra.spec.whatwg.org/commit-snapshots/59e0d16c1e3ba0e77c6a60bfc69a0929b8ffaa5d/#code-points + * _ASCII_TAB_OR_NEWLINE = "\t\n\r" + * _ASCII_WHITESPACE = "\t\n\x0c\r " # <<<<<<<<<<<<<< + * _C0_CONTROL = "".join(chr(n) for n in range(32)) + * _C0_CONTROL_OR_SPACE = _C0_CONTROL + " " + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_WHITESPACE, __pyx_kp_u__3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + + /* "w3lib/_infra.pyx":8 + * _ASCII_TAB_OR_NEWLINE = "\t\n\r" + * _ASCII_WHITESPACE = "\t\n\x0c\r " + * _C0_CONTROL = "".join(chr(n) for n in range(32)) # <<<<<<<<<<<<<< + * _C0_CONTROL_OR_SPACE = _C0_CONTROL + " " + * _ASCII_DIGIT = string.digits + */ + __pyx_t_2 = __pyx_pf_5w3lib_6_infra_genexpr(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_infra.pyx":9 + * _ASCII_WHITESPACE = "\t\n\x0c\r " + * _C0_CONTROL = "".join(chr(n) for n in range(32)) + * _C0_CONTROL_OR_SPACE = _C0_CONTROL + " " # <<<<<<<<<<<<<< + * _ASCII_DIGIT = string.digits + * _ASCII_HEX_DIGIT = string.hexdigits + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_OR_SPACE, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_infra.pyx":10 + * _C0_CONTROL = "".join(chr(n) for n in range(32)) + * _C0_CONTROL_OR_SPACE = _C0_CONTROL + " " + * _ASCII_DIGIT = string.digits # <<<<<<<<<<<<<< + * _ASCII_HEX_DIGIT = string.hexdigits + * _ASCII_ALPHA = string.ascii_letters + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_digits); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_DIGIT, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_infra.pyx":11 + * _C0_CONTROL_OR_SPACE = _C0_CONTROL + " " + * _ASCII_DIGIT = string.digits + * _ASCII_HEX_DIGIT = string.hexdigits # <<<<<<<<<<<<<< + * _ASCII_ALPHA = string.ascii_letters + * _ASCII_ALPHANUMERIC = string.ascii_letters + string.digits + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_hexdigits); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_HEX_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_infra.pyx":12 + * _ASCII_DIGIT = string.digits + * _ASCII_HEX_DIGIT = string.hexdigits + * _ASCII_ALPHA = string.ascii_letters # <<<<<<<<<<<<<< + * _ASCII_ALPHANUMERIC = string.ascii_letters + string.digits + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascii_letters); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHA, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_infra.pyx":13 + * _ASCII_HEX_DIGIT = string.hexdigits + * _ASCII_ALPHA = string.ascii_letters + * _ASCII_ALPHANUMERIC = string.ascii_letters + string.digits # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascii_letters); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_digits); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHANUMERIC, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_infra.pyx":1 + * # https://infra.spec.whatwg.org/ # <<<<<<<<<<<<<< + * + * import string + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init w3lib._infra", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init w3lib._infra"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +#endif +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { + return NULL; + } + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { + return NULL; + } + #endif + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectFastCall */ +#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result = 0; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: + Py_DECREF(argstuple); + return result; +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); + } + else if (nargs == 1 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); + } +#endif + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); + } + } + #if PY_VERSION_HEX >= 0x030700A1 + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + if (kwargs == NULL) { + #if CYTHON_VECTORCALL + #if PY_VERSION_HEX < 0x03090000 + vectorcallfunc f = _PyVectorcall_Function(func); + #else + vectorcallfunc f = PyVectorcall_Function(func); + #endif + if (f) { + return f(func, args, (size_t)nargs, NULL); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, NULL); + } + #endif + } + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + } + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif +} + +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type = NULL, *local_value, *local_tb = NULL; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030C00A6 + local_value = tstate->current_exception; + tstate->current_exception = 0; + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } + #else + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + #endif +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 + if (unlikely(tstate->current_exception)) +#elif CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + #if PY_VERSION_HEX >= 0x030B00a4 + tmp_value = exc_info->exc_value; + exc_info->exc_value = local_value; + tmp_type = NULL; + tmp_tb = NULL; + Py_XDECREF(local_type); + Py_XDECREF(local_tb); + #else + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + #endif + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* pep479 */ +static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { + PyObject *exc, *val, *tb, *cur_exc; + __Pyx_PyThreadState_declare + #ifdef __Pyx_StopAsyncIteration_USED + int is_async_stopiteration = 0; + #endif + CYTHON_MAYBE_UNUSED_VAR(in_async_gen); + cur_exc = PyErr_Occurred(); + if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { + #ifdef __Pyx_StopAsyncIteration_USED + if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { + is_async_stopiteration = 1; + } else + #endif + return; + } + __Pyx_PyThreadState_assign + __Pyx_GetException(&exc, &val, &tb); + Py_XDECREF(exc); + Py_XDECREF(val); + Py_XDECREF(tb); + PyErr_SetString(PyExc_RuntimeError, + #ifdef __Pyx_StopAsyncIteration_USED + is_async_stopiteration ? "async generator raised StopAsyncIteration" : + in_async_gen ? "async generator raised StopIteration" : + #endif + "generator raised StopIteration"); +} + +/* FixUpExtensionType */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { +#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + CYTHON_UNUSED_VAR(spec); + CYTHON_UNUSED_VAR(type); +#else + const PyType_Slot *slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_members) + slot++; + if (slot && slot->slot == Py_tp_members) { + int changed = 0; +#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) + const +#endif + PyMemberDef *memb = (PyMemberDef*) slot->pfunc; + while (memb && memb->name) { + if (memb->name[0] == '_' && memb->name[1] == '_') { +#if PY_VERSION_HEX < 0x030900b1 + if (strcmp(memb->name, "__weaklistoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_weaklistoffset = memb->offset; + changed = 1; + } + else if (strcmp(memb->name, "__dictoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_dictoffset = memb->offset; + changed = 1; + } +#if CYTHON_METH_FASTCALL + else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); +#if PY_VERSION_HEX >= 0x030800b4 + type->tp_vectorcall_offset = memb->offset; +#else + type->tp_print = (printfunc) memb->offset; +#endif + changed = 1; + } +#endif +#else + if ((0)); +#endif +#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON + else if (strcmp(memb->name, "__module__") == 0) { + PyObject *descr; + assert(memb->type == T_OBJECT); + assert(memb->flags == 0 || memb->flags == READONLY); + descr = PyDescr_NewMember(type, memb); + if (unlikely(!descr)) + return -1; + if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { + Py_DECREF(descr); + return -1; + } + Py_DECREF(descr); + changed = 1; + } +#endif + } + memb++; + } + if (changed) + PyType_Modified(type); + } +#endif + return 0; +} +#endif + +/* PyObjectCallNoArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { + PyObject *arg[2] = {NULL, NULL}; + return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + __Pyx_TypeName type_name; + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR + if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) +#elif PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (likely(descr != NULL)) { + *method = descr; + return 0; + } + type_name = __Pyx_PyType_GetName(tp); + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", + type_name, name); +#else + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", + type_name, PyString_AS_STRING(name)); +#endif + __Pyx_DECREF_TypeName(type_name); + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* ValidateBasesTuple */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { + Py_ssize_t i, n; +#if CYTHON_ASSUME_SAFE_MACROS + n = PyTuple_GET_SIZE(bases); +#else + n = PyTuple_Size(bases); + if (n < 0) return -1; +#endif + for (i = 1; i < n; i++) + { +#if CYTHON_AVOID_BORROWED_REFS + PyObject *b0 = PySequence_GetItem(bases, i); + if (!b0) return -1; +#elif CYTHON_ASSUME_SAFE_MACROS + PyObject *b0 = PyTuple_GET_ITEM(bases, i); +#else + PyObject *b0 = PyTuple_GetItem(bases, i); + if (!b0) return -1; +#endif + PyTypeObject *b; +#if PY_MAJOR_VERSION < 3 + if (PyClass_Check(b0)) + { + PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", + PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } +#endif + b = (PyTypeObject*) b0; + if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); + __Pyx_DECREF_TypeName(b_name); +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } + if (dictoffset == 0) + { + Py_ssize_t b_dictoffset = 0; +#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + b_dictoffset = b->tp_dictoffset; +#else + PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); + if (!py_b_dictoffset) goto dictoffset_return; + b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); + Py_DECREF(py_b_dictoffset); + if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; +#endif + if (b_dictoffset) { + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "extension type '%.200s' has no __dict__ slot, " + "but base type '" __Pyx_FMT_TYPENAME "' has: " + "either add 'cdef dict __dict__' to the extension type " + "or add '__slots__ = [...]' to the base type", + type_name, b_name); + __Pyx_DECREF_TypeName(b_name); + } +#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) + dictoffset_return: +#endif +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } + } +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + } + return 0; +} +#endif + +/* PyType_Ready */ +static int __Pyx_PyType_Ready(PyTypeObject *t) { +#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) + (void)__Pyx_PyObject_CallMethod0; +#if CYTHON_USE_TYPE_SPECS + (void)__Pyx_validate_bases_tuple; +#endif + return PyType_Ready(t); +#else + int r; + PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); + if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) + return -1; +#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) + { + int gc_was_enabled; + #if PY_VERSION_HEX >= 0x030A00b1 + gc_was_enabled = PyGC_Disable(); + (void)__Pyx_PyObject_CallMethod0; + #else + PyObject *ret, *py_status; + PyObject *gc = NULL; + #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) + gc = PyImport_GetModule(__pyx_kp_u_gc); + #endif + if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) return -1; + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + if (unlikely(!py_status)) { + Py_DECREF(gc); + return -1; + } + gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); + Py_DECREF(py_status); + if (gc_was_enabled > 0) { + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + if (unlikely(!ret)) { + Py_DECREF(gc); + return -1; + } + Py_DECREF(ret); + } else if (unlikely(gc_was_enabled == -1)) { + Py_DECREF(gc); + return -1; + } + #endif + t->tp_flags |= Py_TPFLAGS_HEAPTYPE; +#if PY_VERSION_HEX >= 0x030A0000 + t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; +#endif +#else + (void)__Pyx_PyObject_CallMethod0; +#endif + r = PyType_Ready(t); +#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) + t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; + #if PY_VERSION_HEX >= 0x030A00b1 + if (gc_was_enabled) + PyGC_Enable(); + #else + if (gc_was_enabled) { + PyObject *tp, *v, *tb; + PyErr_Fetch(&tp, &v, &tb); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + if (likely(ret || r == -1)) { + Py_XDECREF(ret); + PyErr_Restore(tp, v, tb); + } else { + Py_XDECREF(tp); + Py_XDECREF(v); + Py_XDECREF(tb); + r = -1; + } + } + Py_DECREF(gc); + #endif + } +#endif + return r; +#endif +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", + type_name, attr_name); +#else + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", + type_name, PyString_AS_STRING(attr_name)); +#endif + __Pyx_DECREF_TypeName(type_name); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportDottedModule */ +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { + PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + if (unlikely(PyErr_Occurred())) { + PyErr_Clear(); + } + if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { + partial_name = name; + } else { + slice = PySequence_GetSlice(parts_tuple, 0, count); + if (unlikely(!slice)) + goto bad; + sep = PyUnicode_FromStringAndSize(".", 1); + if (unlikely(!sep)) + goto bad; + partial_name = PyUnicode_Join(sep, slice); + } + PyErr_Format( +#if PY_MAJOR_VERSION < 3 + PyExc_ImportError, + "No module named '%s'", PyString_AS_STRING(partial_name)); +#else +#if PY_VERSION_HEX >= 0x030600B1 + PyExc_ModuleNotFoundError, +#else + PyExc_ImportError, +#endif + "No module named '%U'", partial_name); +#endif +bad: + Py_XDECREF(sep); + Py_XDECREF(slice); + Py_XDECREF(partial_name); + return NULL; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { + PyObject *imported_module; +#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + return NULL; + imported_module = __Pyx_PyDict_GetItemStr(modules, name); + Py_XINCREF(imported_module); +#else + imported_module = PyImport_GetModule(name); +#endif + return imported_module; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { + Py_ssize_t i, nparts; + nparts = PyTuple_GET_SIZE(parts_tuple); + for (i=1; i < nparts && module; i++) { + PyObject *part, *submodule; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + part = PyTuple_GET_ITEM(parts_tuple, i); +#else + part = PySequence_ITEM(parts_tuple, i); +#endif + submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); +#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(part); +#endif + Py_DECREF(module); + module = submodule; + } + if (unlikely(!module)) { + return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); + } + return module; +} +#endif +static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if PY_MAJOR_VERSION < 3 + PyObject *module, *from_list, *star = __pyx_n_s_; + CYTHON_UNUSED_VAR(parts_tuple); + from_list = PyList_New(1); + if (unlikely(!from_list)) + return NULL; + Py_INCREF(star); + PyList_SET_ITEM(from_list, 0, star); + module = __Pyx_Import(name, from_list, 0); + Py_DECREF(from_list); + return module; +#else + PyObject *imported_module; + PyObject *module = __Pyx_Import(name, NULL, 0); + if (!parts_tuple || unlikely(!module)) + return module; + imported_module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(imported_module)) { + Py_DECREF(module); + return imported_module; + } + PyErr_Clear(); + return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); +#endif +} +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 + PyObject *module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(module)) { + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + if (likely(spec)) { + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { + Py_DECREF(spec); + spec = NULL; + } + Py_XDECREF(unsafe); + } + if (likely(!spec)) { + PyErr_Clear(); + return module; + } + Py_DECREF(spec); + Py_DECREF(module); + } else if (PyErr_Occurred()) { + PyErr_Clear(); + } +#endif + return __Pyx__ImportDottedModule(name, parts_tuple); +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, + PyObject *firstlineno, PyObject *name) { + PyObject *replace = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; + replace = PyObject_GetAttrString(code, "replace"); + if (likely(replace)) { + PyObject *result; + result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + Py_DECREF(replace); + return result; + } + PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 + { + PyObject *compiled = NULL, *result = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; + compiled = Py_CompileString( + "out = type(code)(\n" + " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" + " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" + " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" + " code.co_lnotab)\n", "", Py_file_input); + if (!compiled) return NULL; + result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); + Py_DECREF(compiled); + if (!result) PyErr_Print(); + Py_DECREF(result); + result = PyDict_GetItemString(scratch_dict, "out"); + if (result) Py_INCREF(result); + return result; + } + #else + return NULL; + #endif +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; + PyObject *replace = NULL, *getframe = NULL, *frame = NULL; + PyObject *exc_type, *exc_value, *exc_traceback; + int success = 0; + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + getframe = PySys_GetObject("_getframe"); + if (unlikely(!getframe)) goto bad; + if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; + frame = PyEval_EvalCode(code_object, dict, dict); + if (unlikely(!frame) || frame == Py_None) goto bad; + success = 1; + bad: + PyErr_Restore(exc_type, exc_value, exc_traceback); + Py_XDECREF(code_object); + Py_XDECREF(py_py_line); + Py_XDECREF(py_funcname); + Py_XDECREF(dict); + Py_XDECREF(replace); + if (success) { + PyTraceBack_Here( + (struct _frame*)frame); + } + Py_XDECREF(frame); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__6); + } + return name; +} +#endif + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_name, '.'); + object_name = object_name ? object_name+1 : type->tp_name; + cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + if (__Pyx_VerifyCachedType( + (PyObject *)cached_type, + object_name, + cached_type->tp_basicsize, + type->tp_basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; +done: + Py_DECREF(abi_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#else +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { + PyObject *abi_module, *cached_type = NULL; + const char* object_name = strrchr(spec->name, '.'); + object_name = object_name ? object_name+1 : spec->name; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + cached_type = PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + Py_ssize_t basicsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; +#else + basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; +#endif + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + basicsize, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + CYTHON_UNUSED_VAR(module); + cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + if (unlikely(!cached_type)) goto bad; + if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; +done: + Py_DECREF(abi_module); + assert(cached_type == NULL || PyType_Check(cached_type)); + return (PyTypeObject *) cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + __Pyx_PyThreadState_declare + CYTHON_UNUSED_VAR(cause); + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + #if PY_VERSION_HEX >= 0x030C00A6 + PyException_SetTraceback(value, tb); + #elif CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + PyObject *exc_value = exc_info->exc_value; + if (exc_value == NULL || exc_value == Py_None) { + *value = NULL; + *type = NULL; + *tb = NULL; + } else { + *value = exc_value; + Py_INCREF(*value); + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + *tb = PyException_GetTraceback(exc_value); + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #endif +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + PyObject *tmp_value = exc_info->exc_value; + exc_info->exc_value = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); + #else + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); + #endif +} +#endif + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_value = exc_info->exc_value; + exc_info->exc_value = *value; + if (tmp_value == NULL || tmp_value == Py_None) { + Py_XDECREF(tmp_value); + tmp_value = NULL; + tmp_type = NULL; + tmp_tb = NULL; + } else { + tmp_type = (PyObject*) Py_TYPE(tmp_value); + Py_INCREF(tmp_type); + #if CYTHON_COMPILING_IN_CPYTHON + tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; + Py_XINCREF(tmp_tb); + #else + tmp_tb = PyException_GetTraceback(tmp_value); + #endif + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args[3] = {NULL, arg1, arg2}; + return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* PyObjectCallMethod1 */ +#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +#endif +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { +#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 + PyObject *args[2] = {obj, arg}; + (void) __Pyx_PyObject_GetMethod; + (void) __Pyx_PyObject_CallOneArg; + (void) __Pyx_PyObject_Call2Args; + return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#else + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +#endif +} + +/* CoroutineBase */ +#include +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + CYTHON_UNUSED_VAR(__pyx_tstate); + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (likely(et == PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + value = Py_None; + } +#if PY_VERSION_HEX >= 0x030300A0 + else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); + } +#endif + else if (unlikely(PyTuple_Check(ev))) { + if (PyTuple_GET_SIZE(ev) >= 1) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + value = PyTuple_GET_ITEM(ev, 0); + Py_INCREF(value); +#else + value = PySequence_ITEM(ev, 0); +#endif + } else { + Py_INCREF(Py_None); + value = Py_None; + } + Py_DECREF(ev); + } + else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { + value = ev; + } + if (likely(value)) { + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = value; + return 0; + } + } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); + Py_DECREF(ev); + if (likely(args)) { + value = PySequence_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +static CYTHON_INLINE +void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { +#if PY_VERSION_HEX >= 0x030B00a4 + Py_CLEAR(exc_state->exc_value); +#else + PyObject *t, *v, *tb; + t = exc_state->exc_type; + v = exc_state->exc_value; + tb = exc_state->exc_traceback; + exc_state->exc_type = NULL; + exc_state->exc_value = NULL; + exc_state->exc_traceback = NULL; + Py_XDECREF(t); + Py_XDECREF(v); + Py_XDECREF(tb); +#endif +} +#define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { + const char *msg; + CYTHON_MAYBE_UNUSED_VAR(gen); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { + msg = "coroutine already executing"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { + msg = "async generator already executing"; + #endif + } else { + msg = "generator already executing"; + } + PyErr_SetString(PyExc_ValueError, msg); +} +#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { + const char *msg; + CYTHON_MAYBE_UNUSED_VAR(gen); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(gen)) { + msg = "can't send non-None value to a just-started coroutine"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(gen)) { + msg = "can't send non-None value to a just-started async generator"; + #endif + } else { + msg = "can't send non-None value to a just-started generator"; + } + PyErr_SetString(PyExc_TypeError, msg); +} +#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { + CYTHON_MAYBE_UNUSED_VAR(gen); + CYTHON_MAYBE_UNUSED_VAR(closing); + #ifdef __Pyx_Coroutine_USED + if (!closing && __Pyx_Coroutine_Check(gen)) { + PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); + } else + #endif + if (value) { + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + else + #endif + PyErr_SetNone(PyExc_StopIteration); + } +} +static +PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { + __Pyx_PyThreadState_declare + PyThreadState *tstate; + __Pyx_ExcInfoStruct *exc_state; + PyObject *retval; + assert(!self->is_running); + if (unlikely(self->resume_label == 0)) { + if (unlikely(value && value != Py_None)) { + return __Pyx_Coroutine_NotStartedError((PyObject*)self); + } + } + if (unlikely(self->resume_label == -1)) { + return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + } +#if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + tstate = __pyx_tstate; +#else + tstate = __Pyx_PyThreadState_Current; +#endif + exc_state = &self->gi_exc_state; + if (exc_state->exc_value) { + #if CYTHON_COMPILING_IN_PYPY + #else + PyObject *exc_tb; + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON + exc_tb = PyException_GetTraceback(exc_state->exc_value); + #elif PY_VERSION_HEX >= 0x030B00a4 + exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback; + #else + exc_tb = exc_state->exc_traceback; + #endif + if (exc_tb) { + PyTracebackObject *tb = (PyTracebackObject *) exc_tb; + PyFrameObject *f = tb->tb_frame; + assert(f->f_back == NULL); + #if PY_VERSION_HEX >= 0x030B00A1 + f->f_back = PyThreadState_GetFrame(tstate); + #else + Py_XINCREF(tstate->frame); + f->f_back = tstate->frame; + #endif + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON + Py_DECREF(exc_tb); + #endif + } + #endif + } +#if CYTHON_USE_EXC_INFO_STACK + exc_state->previous_item = tstate->exc_info; + tstate->exc_info = exc_state; +#else + if (exc_state->exc_type) { + __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } else { + __Pyx_Coroutine_ExceptionClear(exc_state); + __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } +#endif + self->is_running = 1; + retval = self->body(self, tstate, value); + self->is_running = 0; +#if CYTHON_USE_EXC_INFO_STACK + exc_state = &self->gi_exc_state; + tstate->exc_info = exc_state->previous_item; + exc_state->previous_item = NULL; + __Pyx_Coroutine_ResetFrameBackpointer(exc_state); +#endif + return retval; +} +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { +#if CYTHON_COMPILING_IN_PYPY + CYTHON_UNUSED_VAR(exc_state); +#else + PyObject *exc_tb; + #if PY_VERSION_HEX >= 0x030B00a4 + if (!exc_state->exc_value) return; + exc_tb = PyException_GetTraceback(exc_state->exc_value); + #else + exc_tb = exc_state->exc_traceback; + #endif + if (likely(exc_tb)) { + PyTracebackObject *tb = (PyTracebackObject *) exc_tb; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); + #if PY_VERSION_HEX >= 0x030B00a4 + Py_DECREF(exc_tb); + #endif + } +#endif +} +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { + CYTHON_MAYBE_UNUSED_VAR(gen); + if (unlikely(!retval)) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (!__Pyx_PyErr_Occurred()) { + PyObject *exc = PyExc_StopIteration; + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + exc = __Pyx_PyExc_StopAsyncIteration; + #endif + __Pyx_PyErr_SetNone(exc); + } + } + return retval; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) +static CYTHON_INLINE +PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { +#if PY_VERSION_HEX <= 0x030A00A1 + return _PyGen_Send(gen, arg); +#else + PyObject *result; + if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) { + if (PyAsyncGen_CheckExact(gen)) { + assert(result == Py_None); + PyErr_SetNone(PyExc_StopAsyncIteration); + } + else if (result == Py_None) { + PyErr_SetNone(PyExc_StopIteration); + } + else { +#if PY_VERSION_HEX < 0x030d00A1 + _PyGen_SetStopIterationValue(result); +#else + if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) { + PyErr_SetObject(PyExc_StopIteration, result); + } else { + PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result); + if (likely(exc != NULL)) { + PyErr_SetObject(PyExc_StopIteration, exc); + Py_DECREF(exc); + } + } +#endif + } + Py_DECREF(result); + result = NULL; + } + return result; +#endif +} +#endif +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Coroutine_Undelegate(gen); + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); + ret = __Pyx_Coroutine_SendEx(gen, val, 0); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { + PyObject *retval; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + ret = __Pyx_async_gen_asend_send(yf, value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyCoro_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + { + if (value == Py_None) + ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + else + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + retval = __Pyx_Coroutine_FinishDelegation(gen); + } else { + retval = __Pyx_Coroutine_SendEx(gen, value, 0); + } + return __Pyx_Coroutine_MethodReturn(self, retval); +} +static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + if (__Pyx_CoroutineAwait_CheckExact(yf)) { + retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + retval = __Pyx_async_gen_asend_close(yf, NULL); + } else + if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { + retval = __Pyx_async_gen_athrow_close(yf, NULL); + } else + #endif + { + PyObject *meth; + gen->is_running = 1; + meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); + if (unlikely(!meth)) { + if (unlikely(PyErr_Occurred())) { + PyErr_WriteUnraisable(yf); + } + } else { + retval = __Pyx_PyObject_CallNoArg(meth); + Py_DECREF(meth); + if (unlikely(!retval)) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Next(yf); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, Py_None); + } else + #endif + ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_SendEx(gen, Py_None, 0); +} +static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { + CYTHON_UNUSED_VAR(arg); + return __Pyx_Coroutine_Close(self); +} +static PyObject *__Pyx_Coroutine_Close(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + Py_INCREF(yf); + err = __Pyx_Coroutine_CloseIter(gen, yf); + __Pyx_Coroutine_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) + PyErr_SetNone(PyExc_GeneratorExit); + retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); + if (unlikely(retval)) { + const char *msg; + Py_DECREF(retval); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(self)) { + msg = "coroutine ignored GeneratorExit"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(self)) { +#if PY_VERSION_HEX < 0x03060000 + msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; +#else + msg = "async generator ignored GeneratorExit"; +#endif + #endif + } else { + msg = "generator ignored GeneratorExit"; + } + PyErr_SetString(PyExc_RuntimeError, msg); + return NULL; + } + raised_exception = PyErr_Occurred(); + if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { + if (raised_exception) PyErr_Clear(); + Py_INCREF(Py_None); + return Py_None; + } + return NULL; +} +static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, + PyObject *args, int close_on_genexit) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + Py_INCREF(yf); + if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { + int err = __Pyx_Coroutine_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Coroutine_Undelegate(gen); + if (err < 0) + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto throw_here; + } + gen->is_running = 1; + if (0 + #ifdef __Pyx_Generator_USED + || __Pyx_Generator_CheckExact(yf) + #endif + #ifdef __Pyx_Coroutine_USED + || __Pyx_Coroutine_Check(yf) + #endif + ) { + ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { + ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); + #endif + } else { + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (unlikely(PyErr_Occurred())) { + gen->is_running = 0; + return NULL; + } + __Pyx_Coroutine_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + if (likely(args)) { + ret = __Pyx_PyObject_Call(meth, args, NULL); + } else { + PyObject *cargs[4] = {NULL, typ, val, tb}; + ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_MethodReturn(self, ret); + } +throw_here: + __Pyx_Raise(typ, val, tb, NULL); + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +} +static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { + PyObject *typ; + PyObject *val = NULL; + PyObject *tb = NULL; + if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) + return NULL; + return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); +} +static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { +#if PY_VERSION_HEX >= 0x030B00a4 + Py_VISIT(exc_state->exc_value); +#else + Py_VISIT(exc_state->exc_type); + Py_VISIT(exc_state->exc_value); + Py_VISIT(exc_state->exc_traceback); +#endif + return 0; +} +static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + Py_VISIT(gen->closure); + Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); + return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); +} +static int __Pyx_Coroutine_clear(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); + } +#endif + Py_CLEAR(gen->gi_code); + Py_CLEAR(gen->gi_frame); + Py_CLEAR(gen->gi_name); + Py_CLEAR(gen->gi_qualname); + Py_CLEAR(gen->gi_modulename); + return 0; +} +static void __Pyx_Coroutine_dealloc(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject_GC_UnTrack(gen); + if (gen->gi_weakreflist != NULL) + PyObject_ClearWeakRefs(self); + if (gen->resume_label >= 0) { + PyObject_GC_Track(self); +#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE + if (unlikely(PyObject_CallFinalizerFromDealloc(self))) +#else + Py_TYPE(gen)->tp_del(self); + if (unlikely(Py_REFCNT(self) > 0)) +#endif + { + return; + } + PyObject_GC_UnTrack(self); + } +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + /* We have to handle this case for asynchronous generators + right here, because this code has to be between UNTRACK + and GC_Del. */ + Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); + } +#endif + __Pyx_Coroutine_clear(self); + __Pyx_PyHeapTypeObject_GC_Del(gen); +} +static void __Pyx_Coroutine_del(PyObject *self) { + PyObject *error_type, *error_value, *error_traceback; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + __Pyx_PyThreadState_declare + if (gen->resume_label < 0) { + return; + } +#if !CYTHON_USE_TP_FINALIZE + assert(self->ob_refcnt == 0); + __Pyx_SET_REFCNT(self, 1); +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; + PyObject *finalizer = agen->ag_finalizer; + if (finalizer && !agen->ag_closed) { + PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); + if (unlikely(!res)) { + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); + return; + } + } +#endif + if (unlikely(gen->resume_label == 0 && !error_value)) { +#ifdef __Pyx_Coroutine_USED +#ifdef __Pyx_Generator_USED + if (!__Pyx_Generator_CheckExact(self)) +#endif + { + PyObject_GC_UnTrack(self); +#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) + if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) + PyErr_WriteUnraisable(self); +#else + {PyObject *msg; + char *cmsg; + #if CYTHON_COMPILING_IN_PYPY + msg = NULL; + cmsg = (char*) "coroutine was never awaited"; + #else + char *cname; + PyObject *qualname; + qualname = gen->gi_qualname; + cname = PyString_AS_STRING(qualname); + msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); + if (unlikely(!msg)) { + PyErr_Clear(); + cmsg = (char*) "coroutine was never awaited"; + } else { + cmsg = PyString_AS_STRING(msg); + } + #endif + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) + PyErr_WriteUnraisable(self); + Py_XDECREF(msg);} +#endif + PyObject_GC_Track(self); + } +#endif + } else { + PyObject *res = __Pyx_Coroutine_Close(self); + if (unlikely(!res)) { + if (PyErr_Occurred()) + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); +#if !CYTHON_USE_TP_FINALIZE + assert(Py_REFCNT(self) > 0); + if (likely(--self->ob_refcnt == 0)) { + return; + } + { + Py_ssize_t refcnt = Py_REFCNT(self); + _Py_NewReference(self); + __Pyx_SET_REFCNT(self, refcnt); + } +#if CYTHON_COMPILING_IN_CPYTHON + assert(PyType_IS_GC(Py_TYPE(self)) && + _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); + _Py_DEC_REFTOTAL; +#endif +#ifdef COUNT_ALLOCS + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; +#endif +#endif +} +static PyObject * +__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) +{ + PyObject *name = self->gi_name; + CYTHON_UNUSED_VAR(context); + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(self->gi_name, value); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context) +{ + PyObject *name = self->gi_qualname; + CYTHON_UNUSED_VAR(context); + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(self->gi_qualname, value); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) +{ + PyObject *frame = self->gi_frame; + CYTHON_UNUSED_VAR(context); + if (!frame) { + if (unlikely(!self->gi_code)) { + Py_RETURN_NONE; + } + frame = (PyObject *) PyFrame_New( + PyThreadState_Get(), /*PyThreadState *tstate,*/ + (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (unlikely(!frame)) + return NULL; + self->gi_frame = frame; + } + Py_INCREF(frame); + return frame; +} +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); + if (unlikely(!gen)) + return NULL; + return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); +} +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + gen->body = body; + gen->closure = closure; + Py_XINCREF(closure); + gen->is_running = 0; + gen->resume_label = 0; + gen->classobj = NULL; + gen->yieldfrom = NULL; + #if PY_VERSION_HEX >= 0x030B00a4 + gen->gi_exc_state.exc_value = NULL; + #else + gen->gi_exc_state.exc_type = NULL; + gen->gi_exc_state.exc_value = NULL; + gen->gi_exc_state.exc_traceback = NULL; + #endif +#if CYTHON_USE_EXC_INFO_STACK + gen->gi_exc_state.previous_item = NULL; +#endif + gen->gi_weakreflist = NULL; + Py_XINCREF(qualname); + gen->gi_qualname = qualname; + Py_XINCREF(name); + gen->gi_name = name; + Py_XINCREF(module_name); + gen->gi_modulename = module_name; + Py_XINCREF(code); + gen->gi_code = code; + gen->gi_frame = NULL; + PyObject_GC_Track(gen); + return gen; +} + +/* PatchModuleWithCoroutine */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + int result; + PyObject *globals, *result_obj; + globals = PyDict_New(); if (unlikely(!globals)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_coroutine_type", + #ifdef __Pyx_Coroutine_USED + (PyObject*)__pyx_CoroutineType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_generator_type", + #ifdef __Pyx_Generator_USED + (PyObject*)__pyx_GeneratorType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; + result_obj = PyRun_String(py_code, Py_file_input, globals, globals); + if (unlikely(!result_obj)) goto ignore; + Py_DECREF(result_obj); + Py_DECREF(globals); + return module; +ignore: + Py_XDECREF(globals); + PyErr_WriteUnraisable(module); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { + Py_DECREF(module); + module = NULL; + } +#else + py_code++; +#endif + return module; +} + +/* PatchGeneratorABC */ +#ifndef CYTHON_REGISTER_ABCS +#define CYTHON_REGISTER_ABCS 1 +#endif +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) +static PyObject* __Pyx_patch_abc_module(PyObject *module); +static PyObject* __Pyx_patch_abc_module(PyObject *module) { + module = __Pyx_Coroutine_patch_module( + module, "" +"if _cython_generator_type is not None:\n" +" try: Generator = _module.Generator\n" +" except AttributeError: pass\n" +" else: Generator.register(_cython_generator_type)\n" +"if _cython_coroutine_type is not None:\n" +" try: Coroutine = _module.Coroutine\n" +" except AttributeError: pass\n" +" else: Coroutine.register(_cython_coroutine_type)\n" + ); + return module; +} +#endif +static int __Pyx_patch_abc(void) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + static int abc_patched = 0; + if (CYTHON_REGISTER_ABCS && !abc_patched) { + PyObject *module; + module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); + if (unlikely(!module)) { + PyErr_WriteUnraisable(NULL); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, + ((PY_MAJOR_VERSION >= 3) ? + "Cython module failed to register with collections.abc module" : + "Cython module failed to register with collections module"), 1) < 0)) { + return -1; + } + } else { + module = __Pyx_patch_abc_module(module); + abc_patched = 1; + if (unlikely(!module)) + return -1; + Py_DECREF(module); + } + module = PyImport_ImportModule("backports_abc"); + if (module) { + module = __Pyx_patch_abc_module(module); + Py_XDECREF(module); + } + if (!module) { + PyErr_Clear(); + } + } +#else + if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); +#endif + return 0; +} + +/* Generator */ +static PyMethodDef __pyx_Generator_methods[] = { + {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, + (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, + (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, + (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + {0, 0, 0, 0} +}; +static PyMemberDef __pyx_Generator_memberlist[] = { + {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, + {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, + {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, +#if CYTHON_USE_TYPE_SPECS + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, +#endif + {0, 0, 0, 0, 0} +}; +static PyGetSetDef __pyx_Generator_getsets[] = { + {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + (char*) PyDoc_STR("name of the generator"), 0}, + {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + (char*) PyDoc_STR("qualified name of the generator"), 0}, + {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, + (char*) PyDoc_STR("Frame of the generator"), 0}, + {0, 0, 0, 0, 0} +}; +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_GeneratorType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, + {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, + {Py_tp_iter, (void *)PyObject_SelfIter}, + {Py_tp_iternext, (void *)__Pyx_Generator_Next}, + {Py_tp_methods, (void *)__pyx_Generator_methods}, + {Py_tp_members, (void *)__pyx_Generator_memberlist}, + {Py_tp_getset, (void *)__pyx_Generator_getsets}, + {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, +#if CYTHON_USE_TP_FINALIZE + {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, +#endif + {0, 0}, +}; +static PyType_Spec __pyx_GeneratorType_spec = { + __PYX_TYPE_MODULE_PREFIX "generator", + sizeof(__pyx_CoroutineObject), + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + __pyx_GeneratorType_slots +}; +#else +static PyTypeObject __pyx_GeneratorType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "generator", + sizeof(__pyx_CoroutineObject), + 0, + (destructor) __Pyx_Coroutine_dealloc, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + 0, + (traverseproc) __Pyx_Coroutine_traverse, + 0, + 0, + offsetof(__pyx_CoroutineObject, gi_weakreflist), + 0, + (iternextfunc) __Pyx_Generator_Next, + __pyx_Generator_methods, + __pyx_Generator_memberlist, + __pyx_Generator_getsets, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if CYTHON_USE_TP_FINALIZE + 0, +#else + __Pyx_Coroutine_del, +#endif + 0, +#if CYTHON_USE_TP_FINALIZE + __Pyx_Coroutine_del, +#elif PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_Generator_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); +#endif + if (unlikely(!__pyx_GeneratorType)) { + return -1; + } + return 0; +} + +/* CheckBinaryVersion */ +static unsigned long __Pyx_get_runtime_version(void) { +#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 + return Py_Version & ~0xFFUL; +#else + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + return version; +#endif +} +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { + const unsigned long MAJOR_MINOR = 0xFFFF0000UL; + if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) + return 0; + if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) + return 1; + { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compile time Python version %d.%d " + "of module '%.100s' " + "%s " + "runtime version %d.%d", + (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), + __Pyx_MODULE_NAME, + (allow_newer) ? "was newer than" : "does not match", + (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) + ); + return PyErr_WarnEx(NULL, message, 1); + } +} + +/* InitStrings */ +#if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +#include +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { + size_t len = strlen(s); + if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, "byte string is too long"); + return -1; + } + return (Py_ssize_t) len; +} +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return __Pyx_PyUnicode_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return PyByteArray_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/w3lib/_infra.py b/w3lib/_infra.pyx similarity index 100% rename from w3lib/_infra.py rename to w3lib/_infra.pyx diff --git a/w3lib/_rfc2396.c b/w3lib/_rfc2396.c new file mode 100644 index 00000000..e5f7fcca --- /dev/null +++ b/w3lib/_rfc2396.c @@ -0,0 +1,4524 @@ +/* Generated by Cython 3.0.8 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "name": "w3lib._rfc2396", + "sources": [ + "w3lib/_rfc2396.pyx" + ] + }, + "module_name": "w3lib._rfc2396" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API +#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#else +#define __PYX_EXTRA_ABI_MODULE_NAME "" +#endif +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030008F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #ifdef Py_LIMITED_API + #undef __PYX_LIMITED_VERSION_HEX + #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API + #endif + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_USE_CPP_STD_MOVE + #if defined(__cplusplus) && (\ + __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) + #define CYTHON_USE_CPP_STD_MOVE 1 + #else + #define CYTHON_USE_CPP_STD_MOVE 0 + #endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #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 +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if CYTHON_COMPILING_IN_LIMITED_API + static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } + #ifndef CO_OPTIMIZED + #define CO_OPTIMIZED 0x0001 + #endif + #ifndef CO_NEWLOCALS + #define CO_NEWLOCALS 0x0002 + #endif + #ifndef CO_VARARGS + #define CO_VARARGS 0x0004 + #endif + #ifndef CO_VARKEYWORDS + #define CO_VARKEYWORDS 0x0008 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x0200 + #endif + #ifndef CO_GENERATOR + #define CO_GENERATOR 0x0020 + #endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x0080 + #endif +#elif PY_VERSION_HEX >= 0x030B0000 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); + if (!empty_bytes) return NULL; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); + Py_DECREF(empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_MAJOR_VERSION >= 0x030900B1 +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) +#else +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) +#endif +#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) +#elif !CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) +static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { + return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; +} +#endif +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API + return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; +#else + return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +#endif +} +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) +#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) +#else + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) +#endif +#if PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__w3lib___rfc2396 +#define __PYX_HAVE_API__w3lib___rfc2396 +/* Early includes */ +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#include +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#include +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "w3lib/_rfc2396.pyx", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* #### Code section: numeric_typedefs ### */ +/* #### Code section: complex_type_declarations ### */ +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* IncludeStringH.proto */ +#include + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#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 + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* CLineInTraceback.proto */ +#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 */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static unsigned long __Pyx_get_runtime_version(void); +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ + +/* Module declarations from "w3lib._rfc2396" */ +/* #### Code section: typeinfo ### */ +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "w3lib._rfc2396" +extern int __pyx_module_is_main_w3lib___rfc2396; +int __pyx_module_is_main_w3lib___rfc2396 = 0; + +/* Implementation of "w3lib._rfc2396" */ +/* #### Code section: global_var ### */ +/* #### Code section: string_decls ### */ +static const char __pyx_k_[] = "."; +static const char __pyx_k__2[] = "-_.!~*'()"; +static const char __pyx_k__4[] = ";/?:@&=+$,"; +static const char __pyx_k__6[] = ";:&=+$,"; +static const char __pyx_k__7[] = ":@&=+$,"; +static const char __pyx_k__8[] = "/"; +static const char __pyx_k__9[] = ";"; +static const char __pyx_k__10[] = "?"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_util[] = "_util"; +static const char __pyx_k_infra[] = "_infra"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_exclude[] = "exclude"; +static const char __pyx_k_PercentEncodeSet[] = "_PercentEncodeSet"; +static const char __pyx_k_ASCII_ALPHANUMERIC[] = "_ASCII_ALPHANUMERIC"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_RFC2396_ABS_PATH_PERCENT_ENCODE[] = "_RFC2396_ABS_PATH_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC2396_FRAGMENT_PERCENT_ENCODE[] = "_RFC2396_FRAGMENT_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC2396_MARK_PERCENT_ENCODE_SET[] = "_RFC2396_MARK_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC2396_QUERY_PERCENT_ENCODE_SE[] = "_RFC2396_QUERY_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC2396_RESERVED_PERCENT_ENCODE[] = "_RFC2396_RESERVED_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC2396_UNRESERVED_PERCENT_ENCO[] = "_RFC2396_UNRESERVED_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC2396_USERINFO_PERCENT_ENCODE[] = "_RFC2396_USERINFO_PERCENT_ENCODE_SET"; +/* #### Code section: decls ### */ +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + #endif + PyObject *__pyx_kp_u_; + PyObject *__pyx_n_s_ASCII_ALPHANUMERIC; + PyObject *__pyx_n_s_PercentEncodeSet; + PyObject *__pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE; + PyObject *__pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE; + PyObject *__pyx_n_s_RFC2396_MARK_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE; + PyObject *__pyx_n_s_RFC2396_RESERVED_PERCENT_ENCODE; + PyObject *__pyx_n_s_RFC2396_UNRESERVED_PERCENT_ENCO; + PyObject *__pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE; + PyObject *__pyx_n_s__10; + PyObject *__pyx_kp_u__2; + PyObject *__pyx_kp_u__4; + PyObject *__pyx_kp_u__6; + PyObject *__pyx_kp_u__7; + PyObject *__pyx_kp_u__8; + PyObject *__pyx_kp_u__9; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_exclude; + PyObject *__pyx_n_s_import; + PyObject *__pyx_n_s_infra; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_util; + PyObject *__pyx_tuple__3; + PyObject *__pyx_tuple__5; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_kp_u_); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_ALPHANUMERIC); + Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC2396_MARK_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC2396_RESERVED_PERCENT_ENCODE); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC2396_UNRESERVED_PERCENT_ENCO); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); + Py_CLEAR(clear_module_state->__pyx_n_s__10); + Py_CLEAR(clear_module_state->__pyx_kp_u__2); + Py_CLEAR(clear_module_state->__pyx_kp_u__4); + Py_CLEAR(clear_module_state->__pyx_kp_u__6); + Py_CLEAR(clear_module_state->__pyx_kp_u__7); + Py_CLEAR(clear_module_state->__pyx_kp_u__8); + Py_CLEAR(clear_module_state->__pyx_kp_u__9); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_exclude); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_n_s_infra); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_util); + Py_CLEAR(clear_module_state->__pyx_tuple__3); + Py_CLEAR(clear_module_state->__pyx_tuple__5); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_kp_u_); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_ALPHANUMERIC); + Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC2396_MARK_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC2396_RESERVED_PERCENT_ENCODE); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC2396_UNRESERVED_PERCENT_ENCO); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); + Py_VISIT(traverse_module_state->__pyx_n_s__10); + Py_VISIT(traverse_module_state->__pyx_kp_u__2); + Py_VISIT(traverse_module_state->__pyx_kp_u__4); + Py_VISIT(traverse_module_state->__pyx_kp_u__6); + Py_VISIT(traverse_module_state->__pyx_kp_u__7); + Py_VISIT(traverse_module_state->__pyx_kp_u__8); + Py_VISIT(traverse_module_state->__pyx_kp_u__9); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_exclude); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_n_s_infra); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_util); + Py_VISIT(traverse_module_state->__pyx_tuple__3); + Py_VISIT(traverse_module_state->__pyx_tuple__5); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ +#define __pyx_n_s_ASCII_ALPHANUMERIC __pyx_mstate_global->__pyx_n_s_ASCII_ALPHANUMERIC +#define __pyx_n_s_PercentEncodeSet __pyx_mstate_global->__pyx_n_s_PercentEncodeSet +#define __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE __pyx_mstate_global->__pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE +#define __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE __pyx_mstate_global->__pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE +#define __pyx_n_s_RFC2396_MARK_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_RFC2396_MARK_PERCENT_ENCODE_SET +#define __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE __pyx_mstate_global->__pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE +#define __pyx_n_s_RFC2396_RESERVED_PERCENT_ENCODE __pyx_mstate_global->__pyx_n_s_RFC2396_RESERVED_PERCENT_ENCODE +#define __pyx_n_s_RFC2396_UNRESERVED_PERCENT_ENCO __pyx_mstate_global->__pyx_n_s_RFC2396_UNRESERVED_PERCENT_ENCO +#define __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE __pyx_mstate_global->__pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE +#define __pyx_n_s__10 __pyx_mstate_global->__pyx_n_s__10 +#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 +#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 +#define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 +#define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 +#define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8 +#define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9 +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_exclude __pyx_mstate_global->__pyx_n_s_exclude +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_n_s_infra __pyx_mstate_global->__pyx_n_s_infra +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_util __pyx_mstate_global->__pyx_n_s_util +#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 +#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 +/* #### Code section: module_code ### */ + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, + {&__pyx_n_s_ASCII_ALPHANUMERIC, __pyx_k_ASCII_ALPHANUMERIC, sizeof(__pyx_k_ASCII_ALPHANUMERIC), 0, 0, 1, 1}, + {&__pyx_n_s_PercentEncodeSet, __pyx_k_PercentEncodeSet, sizeof(__pyx_k_PercentEncodeSet), 0, 0, 1, 1}, + {&__pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE, __pyx_k_RFC2396_ABS_PATH_PERCENT_ENCODE, sizeof(__pyx_k_RFC2396_ABS_PATH_PERCENT_ENCODE), 0, 0, 1, 1}, + {&__pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE, __pyx_k_RFC2396_FRAGMENT_PERCENT_ENCODE, sizeof(__pyx_k_RFC2396_FRAGMENT_PERCENT_ENCODE), 0, 0, 1, 1}, + {&__pyx_n_s_RFC2396_MARK_PERCENT_ENCODE_SET, __pyx_k_RFC2396_MARK_PERCENT_ENCODE_SET, sizeof(__pyx_k_RFC2396_MARK_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE, __pyx_k_RFC2396_QUERY_PERCENT_ENCODE_SE, sizeof(__pyx_k_RFC2396_QUERY_PERCENT_ENCODE_SE), 0, 0, 1, 1}, + {&__pyx_n_s_RFC2396_RESERVED_PERCENT_ENCODE, __pyx_k_RFC2396_RESERVED_PERCENT_ENCODE, sizeof(__pyx_k_RFC2396_RESERVED_PERCENT_ENCODE), 0, 0, 1, 1}, + {&__pyx_n_s_RFC2396_UNRESERVED_PERCENT_ENCO, __pyx_k_RFC2396_UNRESERVED_PERCENT_ENCO, sizeof(__pyx_k_RFC2396_UNRESERVED_PERCENT_ENCO), 0, 0, 1, 1}, + {&__pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE, __pyx_k_RFC2396_USERINFO_PERCENT_ENCODE, sizeof(__pyx_k_RFC2396_USERINFO_PERCENT_ENCODE), 0, 0, 1, 1}, + {&__pyx_n_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 1}, + {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, + {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, + {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, + {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, + {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, + {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_exclude, __pyx_k_exclude, sizeof(__pyx_k_exclude), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_infra, __pyx_k_infra, sizeof(__pyx_k_infra), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_util, __pyx_k_util, sizeof(__pyx_k_util), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + return 0; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "w3lib/_rfc2396.pyx":5 + * + * + * _RFC2396_MARK_PERCENT_ENCODE_SET = _PercentEncodeSet("-_.!~*'()", exclude=True) # <<<<<<<<<<<<<< + * _RFC2396_RESERVED_PERCENT_ENCODE_SET = _PercentEncodeSet(";/?:@&=+$,", exclude=True) + * _RFC2396_UNRESERVED_PERCENT_ENCODE_SET = ( + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u__2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "w3lib/_rfc2396.pyx":6 + * + * _RFC2396_MARK_PERCENT_ENCODE_SET = _PercentEncodeSet("-_.!~*'()", exclude=True) + * _RFC2396_RESERVED_PERCENT_ENCODE_SET = _PercentEncodeSet(";/?:@&=+$,", exclude=True) # <<<<<<<<<<<<<< + * _RFC2396_UNRESERVED_PERCENT_ENCODE_SET = ( + * _RFC2396_MARK_PERCENT_ENCODE_SET - _ASCII_ALPHANUMERIC + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u__4); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + return 0; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__rfc2396(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__rfc2396}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "_rfc2396", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_rfc2396(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_rfc2396(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__rfc2396(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__rfc2396(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__rfc2396(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_rfc2396' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_rfc2396", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_rfc2396" pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__rfc2396(void)", 0); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_w3lib___rfc2396) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "w3lib._rfc2396")) { + if (unlikely((PyDict_SetItemString(modules, "w3lib._rfc2396", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + (void)__Pyx_modinit_type_init_code(); + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "w3lib/_rfc2396.pyx":1 + * from ._infra import _ASCII_ALPHANUMERIC # <<<<<<<<<<<<<< + * from ._util import _PercentEncodeSet + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ASCII_ALPHANUMERIC); + __Pyx_GIVEREF(__pyx_n_s_ASCII_ALPHANUMERIC); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ASCII_ALPHANUMERIC)) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_infra, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHANUMERIC, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_rfc2396.pyx":2 + * from ._infra import _ASCII_ALPHANUMERIC + * from ._util import _PercentEncodeSet # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_PercentEncodeSet); + __Pyx_GIVEREF(__pyx_n_s_PercentEncodeSet); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_PercentEncodeSet)) __PYX_ERR(0, 2, __pyx_L1_error); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_util, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PercentEncodeSet, __pyx_t_3) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_rfc2396.pyx":5 + * + * + * _RFC2396_MARK_PERCENT_ENCODE_SET = _PercentEncodeSet("-_.!~*'()", exclude=True) # <<<<<<<<<<<<<< + * _RFC2396_RESERVED_PERCENT_ENCODE_SET = _PercentEncodeSet(";/?:@&=+$,", exclude=True) + * _RFC2396_UNRESERVED_PERCENT_ENCODE_SET = ( + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_exclude, Py_True) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_MARK_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_rfc2396.pyx":6 + * + * _RFC2396_MARK_PERCENT_ENCODE_SET = _PercentEncodeSet("-_.!~*'()", exclude=True) + * _RFC2396_RESERVED_PERCENT_ENCODE_SET = _PercentEncodeSet(";/?:@&=+$,", exclude=True) # <<<<<<<<<<<<<< + * _RFC2396_UNRESERVED_PERCENT_ENCODE_SET = ( + * _RFC2396_MARK_PERCENT_ENCODE_SET - _ASCII_ALPHANUMERIC + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_exclude, Py_True) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_RESERVED_PERCENT_ENCODE, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_rfc2396.pyx":8 + * _RFC2396_RESERVED_PERCENT_ENCODE_SET = _PercentEncodeSet(";/?:@&=+$,", exclude=True) + * _RFC2396_UNRESERVED_PERCENT_ENCODE_SET = ( + * _RFC2396_MARK_PERCENT_ENCODE_SET - _ASCII_ALPHANUMERIC # <<<<<<<<<<<<<< + * ) + * _RFC2396_USERINFO_PERCENT_ENCODE_SET = ( + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RFC2396_MARK_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_UNRESERVED_PERCENT_ENCO, __pyx_t_4) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_rfc2396.pyx":11 + * ) + * _RFC2396_USERINFO_PERCENT_ENCODE_SET = ( + * _RFC2396_UNRESERVED_PERCENT_ENCODE_SET - ";:&=+$," # <<<<<<<<<<<<<< + * ) + * _RFC2396_ABS_PATH_PERCENT_ENCODE_SET = ( + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RFC2396_UNRESERVED_PERCENT_ENCO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_kp_u__6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_rfc2396.pyx":14 + * ) + * _RFC2396_ABS_PATH_PERCENT_ENCODE_SET = ( + * _RFC2396_UNRESERVED_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * - ":@&=+$," # pchar + * - "/" # abs_path, path_segments + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_UNRESERVED_PERCENT_ENCO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_rfc2396.pyx":15 + * _RFC2396_ABS_PATH_PERCENT_ENCODE_SET = ( + * _RFC2396_UNRESERVED_PERCENT_ENCODE_SET + * - ":@&=+$," # pchar # <<<<<<<<<<<<<< + * - "/" # abs_path, path_segments + * - ";" # segment + */ + __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_kp_u__7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_rfc2396.pyx":16 + * _RFC2396_UNRESERVED_PERCENT_ENCODE_SET + * - ":@&=+$," # pchar + * - "/" # abs_path, path_segments # <<<<<<<<<<<<<< + * - ";" # segment + * ) + */ + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_kp_u__8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_rfc2396.pyx":17 + * - ":@&=+$," # pchar + * - "/" # abs_path, path_segments + * - ";" # segment # <<<<<<<<<<<<<< + * ) + * _RFC2396_QUERY_PERCENT_ENCODE_SET = ( + */ + __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_kp_u__9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE, __pyx_t_4) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_rfc2396.pyx":20 + * ) + * _RFC2396_QUERY_PERCENT_ENCODE_SET = ( + * _RFC2396_RESERVED_PERCENT_ENCODE_SET & _RFC2396_UNRESERVED_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * ) + * _RFC2396_FRAGMENT_PERCENT_ENCODE_SET = _RFC2396_QUERY_PERCENT_ENCODE_SET + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RFC2396_RESERVED_PERCENT_ENCODE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_UNRESERVED_PERCENT_ENCO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_And(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_rfc2396.pyx":22 + * _RFC2396_RESERVED_PERCENT_ENCODE_SET & _RFC2396_UNRESERVED_PERCENT_ENCODE_SET + * ) + * _RFC2396_FRAGMENT_PERCENT_ENCODE_SET = _RFC2396_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_rfc2396.pyx":1 + * from ._infra import _ASCII_ALPHANUMERIC # <<<<<<<<<<<<<< + * from ._util import _PercentEncodeSet + * + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init w3lib._rfc2396", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init w3lib._rfc2396"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + const char* module_name_str = 0; + PyObject* module_name = 0; + PyObject* module_dot = 0; + PyObject* full_name = 0; + PyErr_Clear(); + module_name_str = PyModule_GetName(module); + if (unlikely(!module_name_str)) { goto modbad; } + module_name = PyUnicode_FromString(module_name_str); + if (unlikely(!module_name)) { goto modbad; } + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); + if (unlikely(!module_dot)) { goto modbad; } + full_name = PyUnicode_Concat(module_dot, name); + if (unlikely(!full_name)) { goto modbad; } + #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + { + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + goto modbad; + value = PyObject_GetItem(modules, full_name); + } + #else + value = PyImport_GetModule(full_name); + #endif + modbad: + Py_XDECREF(full_name); + Py_XDECREF(module_dot); + Py_XDECREF(module_name); + } + if (unlikely(!value)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +#endif +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, + PyObject *firstlineno, PyObject *name) { + PyObject *replace = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; + replace = PyObject_GetAttrString(code, "replace"); + if (likely(replace)) { + PyObject *result; + result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + Py_DECREF(replace); + return result; + } + PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 + { + PyObject *compiled = NULL, *result = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; + compiled = Py_CompileString( + "out = type(code)(\n" + " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" + " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" + " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" + " code.co_lnotab)\n", "", Py_file_input); + if (!compiled) return NULL; + result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); + Py_DECREF(compiled); + if (!result) PyErr_Print(); + Py_DECREF(result); + result = PyDict_GetItemString(scratch_dict, "out"); + if (result) Py_INCREF(result); + return result; + } + #else + return NULL; + #endif +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; + PyObject *replace = NULL, *getframe = NULL, *frame = NULL; + PyObject *exc_type, *exc_value, *exc_traceback; + int success = 0; + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + getframe = PySys_GetObject("_getframe"); + if (unlikely(!getframe)) goto bad; + if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; + frame = PyEval_EvalCode(code_object, dict, dict); + if (unlikely(!frame) || frame == Py_None) goto bad; + success = 1; + bad: + PyErr_Restore(exc_type, exc_value, exc_traceback); + Py_XDECREF(code_object); + Py_XDECREF(py_py_line); + Py_XDECREF(py_funcname); + Py_XDECREF(dict); + Py_XDECREF(replace); + if (success) { + PyTraceBack_Here( + (struct _frame*)frame); + } + Py_XDECREF(frame); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__10); + } + return name; +} +#endif + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030B00A4 + return Py_Version & ~0xFFUL; +#else + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + return version; +#endif +} +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { + const unsigned long MAJOR_MINOR = 0xFFFF0000UL; + if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) + return 0; + if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) + return 1; + { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compile time Python version %d.%d " + "of module '%.100s' " + "%s " + "runtime version %d.%d", + (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), + __Pyx_MODULE_NAME, + (allow_newer) ? "was newer than" : "does not match", + (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) + ); + return PyErr_WarnEx(NULL, message, 1); + } +} + +/* InitStrings */ +#if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +#include +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { + size_t len = strlen(s); + if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, "byte string is too long"); + return -1; + } + return (Py_ssize_t) len; +} +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return __Pyx_PyUnicode_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return PyByteArray_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/w3lib/_rfc2396.py b/w3lib/_rfc2396.pyx similarity index 100% rename from w3lib/_rfc2396.py rename to w3lib/_rfc2396.pyx diff --git a/w3lib/_rfc3986.c b/w3lib/_rfc3986.c new file mode 100644 index 00000000..24c774e2 --- /dev/null +++ b/w3lib/_rfc3986.c @@ -0,0 +1,4561 @@ +/* Generated by Cython 3.0.8 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "name": "w3lib._rfc3986", + "sources": [ + "w3lib/_rfc3986.pyx" + ] + }, + "module_name": "w3lib._rfc3986" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API +#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#else +#define __PYX_EXTRA_ABI_MODULE_NAME "" +#endif +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030008F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #ifdef Py_LIMITED_API + #undef __PYX_LIMITED_VERSION_HEX + #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API + #endif + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_USE_CPP_STD_MOVE + #if defined(__cplusplus) && (\ + __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) + #define CYTHON_USE_CPP_STD_MOVE 1 + #else + #define CYTHON_USE_CPP_STD_MOVE 0 + #endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #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 +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if CYTHON_COMPILING_IN_LIMITED_API + static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } + #ifndef CO_OPTIMIZED + #define CO_OPTIMIZED 0x0001 + #endif + #ifndef CO_NEWLOCALS + #define CO_NEWLOCALS 0x0002 + #endif + #ifndef CO_VARARGS + #define CO_VARARGS 0x0004 + #endif + #ifndef CO_VARKEYWORDS + #define CO_VARKEYWORDS 0x0008 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x0200 + #endif + #ifndef CO_GENERATOR + #define CO_GENERATOR 0x0020 + #endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x0080 + #endif +#elif PY_VERSION_HEX >= 0x030B0000 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); + if (!empty_bytes) return NULL; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); + Py_DECREF(empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_MAJOR_VERSION >= 0x030900B1 +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) +#else +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) +#endif +#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) +#elif !CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) +static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { + return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; +} +#endif +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API + return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; +#else + return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +#endif +} +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) +#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) +#else + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) +#endif +#if PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__w3lib___rfc3986 +#define __PYX_HAVE_API__w3lib___rfc3986 +/* Early includes */ +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#include +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#include +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "w3lib/_rfc3986.pyx", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* #### Code section: numeric_typedefs ### */ +/* #### Code section: complex_type_declarations ### */ +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* IncludeStringH.proto */ +#include + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#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 + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* CLineInTraceback.proto */ +#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 */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static unsigned long __Pyx_get_runtime_version(void); +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ + +/* Module declarations from "w3lib._rfc3986" */ +/* #### Code section: typeinfo ### */ +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "w3lib._rfc3986" +extern int __pyx_module_is_main_w3lib___rfc3986; +int __pyx_module_is_main_w3lib___rfc3986 = 0; + +/* Implementation of "w3lib._rfc3986" */ +/* #### Code section: global_var ### */ +/* #### Code section: string_decls ### */ +static const char __pyx_k_[] = "."; +static const char __pyx_k__2[] = "-._~"; +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__9[] = "?"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_util[] = "_util"; +static const char __pyx_k_infra[] = "_infra"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_exclude[] = "exclude"; +static const char __pyx_k_PercentEncodeSet[] = "_PercentEncodeSet"; +static const char __pyx_k_ASCII_ALPHANUMERIC[] = "_ASCII_ALPHANUMERIC"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_RFC3986_FRAGMENT_PERCENT_ENCODE[] = "_RFC3986_FRAGMENT_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC3986_PATH_PERCENT_ENCODE_SET[] = "_RFC3986_PATH_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC3986_PCHAR_PERCENT_ENCODE_SE[] = "_RFC3986_PCHAR_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC3986_QUERY_PERCENT_ENCODE_SE[] = "_RFC3986_QUERY_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC3986_SUB_DELIMS_PERCENT_ENCO[] = "_RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC3986_UNRESERVED_PERCENT_ENCO[] = "_RFC3986_UNRESERVED_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC3986_USERINFO_PERCENT_ENCODE[] = "_RFC3986_USERINFO_PERCENT_ENCODE_SET"; +/* #### Code section: decls ### */ +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + #endif + PyObject *__pyx_kp_u_; + PyObject *__pyx_n_s_ASCII_ALPHANUMERIC; + PyObject *__pyx_n_s_PercentEncodeSet; + PyObject *__pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE; + PyObject *__pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_RFC3986_PCHAR_PERCENT_ENCODE_SE; + PyObject *__pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE; + PyObject *__pyx_n_s_RFC3986_SUB_DELIMS_PERCENT_ENCO; + PyObject *__pyx_n_s_RFC3986_UNRESERVED_PERCENT_ENCO; + PyObject *__pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE; + PyObject *__pyx_kp_u__2; + PyObject *__pyx_kp_u__3; + PyObject *__pyx_kp_u__5; + PyObject *__pyx_kp_u__6; + PyObject *__pyx_kp_u__7; + PyObject *__pyx_kp_u__8; + PyObject *__pyx_n_s__9; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_exclude; + PyObject *__pyx_n_s_import; + PyObject *__pyx_n_s_infra; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_util; + PyObject *__pyx_tuple__4; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_kp_u_); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_ALPHANUMERIC); + Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_PCHAR_PERCENT_ENCODE_SE); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_SUB_DELIMS_PERCENT_ENCO); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_UNRESERVED_PERCENT_ENCO); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); + Py_CLEAR(clear_module_state->__pyx_kp_u__2); + Py_CLEAR(clear_module_state->__pyx_kp_u__3); + Py_CLEAR(clear_module_state->__pyx_kp_u__5); + Py_CLEAR(clear_module_state->__pyx_kp_u__6); + Py_CLEAR(clear_module_state->__pyx_kp_u__7); + Py_CLEAR(clear_module_state->__pyx_kp_u__8); + Py_CLEAR(clear_module_state->__pyx_n_s__9); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_exclude); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_n_s_infra); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_util); + Py_CLEAR(clear_module_state->__pyx_tuple__4); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_kp_u_); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_ALPHANUMERIC); + Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_PCHAR_PERCENT_ENCODE_SE); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_SUB_DELIMS_PERCENT_ENCO); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_UNRESERVED_PERCENT_ENCO); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); + Py_VISIT(traverse_module_state->__pyx_kp_u__2); + Py_VISIT(traverse_module_state->__pyx_kp_u__3); + Py_VISIT(traverse_module_state->__pyx_kp_u__5); + Py_VISIT(traverse_module_state->__pyx_kp_u__6); + Py_VISIT(traverse_module_state->__pyx_kp_u__7); + Py_VISIT(traverse_module_state->__pyx_kp_u__8); + Py_VISIT(traverse_module_state->__pyx_n_s__9); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_exclude); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_n_s_infra); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_util); + Py_VISIT(traverse_module_state->__pyx_tuple__4); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ +#define __pyx_n_s_ASCII_ALPHANUMERIC __pyx_mstate_global->__pyx_n_s_ASCII_ALPHANUMERIC +#define __pyx_n_s_PercentEncodeSet __pyx_mstate_global->__pyx_n_s_PercentEncodeSet +#define __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE __pyx_mstate_global->__pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE +#define __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET +#define __pyx_n_s_RFC3986_PCHAR_PERCENT_ENCODE_SE __pyx_mstate_global->__pyx_n_s_RFC3986_PCHAR_PERCENT_ENCODE_SE +#define __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE __pyx_mstate_global->__pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE +#define __pyx_n_s_RFC3986_SUB_DELIMS_PERCENT_ENCO __pyx_mstate_global->__pyx_n_s_RFC3986_SUB_DELIMS_PERCENT_ENCO +#define __pyx_n_s_RFC3986_UNRESERVED_PERCENT_ENCO __pyx_mstate_global->__pyx_n_s_RFC3986_UNRESERVED_PERCENT_ENCO +#define __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE __pyx_mstate_global->__pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE +#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 +#define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 +#define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 +#define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 +#define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 +#define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8 +#define __pyx_n_s__9 __pyx_mstate_global->__pyx_n_s__9 +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_exclude __pyx_mstate_global->__pyx_n_s_exclude +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_n_s_infra __pyx_mstate_global->__pyx_n_s_infra +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_util __pyx_mstate_global->__pyx_n_s_util +#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 +/* #### Code section: module_code ### */ + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, + {&__pyx_n_s_ASCII_ALPHANUMERIC, __pyx_k_ASCII_ALPHANUMERIC, sizeof(__pyx_k_ASCII_ALPHANUMERIC), 0, 0, 1, 1}, + {&__pyx_n_s_PercentEncodeSet, __pyx_k_PercentEncodeSet, sizeof(__pyx_k_PercentEncodeSet), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE, __pyx_k_RFC3986_FRAGMENT_PERCENT_ENCODE, sizeof(__pyx_k_RFC3986_FRAGMENT_PERCENT_ENCODE), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET, __pyx_k_RFC3986_PATH_PERCENT_ENCODE_SET, sizeof(__pyx_k_RFC3986_PATH_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_PCHAR_PERCENT_ENCODE_SE, __pyx_k_RFC3986_PCHAR_PERCENT_ENCODE_SE, sizeof(__pyx_k_RFC3986_PCHAR_PERCENT_ENCODE_SE), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE, __pyx_k_RFC3986_QUERY_PERCENT_ENCODE_SE, sizeof(__pyx_k_RFC3986_QUERY_PERCENT_ENCODE_SE), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_SUB_DELIMS_PERCENT_ENCO, __pyx_k_RFC3986_SUB_DELIMS_PERCENT_ENCO, sizeof(__pyx_k_RFC3986_SUB_DELIMS_PERCENT_ENCO), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_UNRESERVED_PERCENT_ENCO, __pyx_k_RFC3986_UNRESERVED_PERCENT_ENCO, sizeof(__pyx_k_RFC3986_UNRESERVED_PERCENT_ENCO), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE, __pyx_k_RFC3986_USERINFO_PERCENT_ENCODE, sizeof(__pyx_k_RFC3986_USERINFO_PERCENT_ENCODE), 0, 0, 1, 1}, + {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, + {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, + {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, + {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, + {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, + {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, + {&__pyx_n_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_exclude, __pyx_k_exclude, sizeof(__pyx_k_exclude), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_infra, __pyx_k_infra, sizeof(__pyx_k_infra), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_util, __pyx_k_util, sizeof(__pyx_k_util), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + return 0; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "w3lib/_rfc3986.pyx":9 + * exclude=True, + * ) + * _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< + * "!$&'()*+,;=", + * exclude=True, + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u__3); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + return 0; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__rfc3986(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__rfc3986}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "_rfc3986", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_rfc3986(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_rfc3986(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__rfc3986(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__rfc3986(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__rfc3986(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_rfc3986' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_rfc3986", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_rfc3986" pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__rfc3986(void)", 0); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_w3lib___rfc3986) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "w3lib._rfc3986")) { + if (unlikely((PyDict_SetItemString(modules, "w3lib._rfc3986", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + (void)__Pyx_modinit_type_init_code(); + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "w3lib/_rfc3986.pyx":1 + * from ._infra import _ASCII_ALPHANUMERIC # <<<<<<<<<<<<<< + * from ._util import _PercentEncodeSet + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ASCII_ALPHANUMERIC); + __Pyx_GIVEREF(__pyx_n_s_ASCII_ALPHANUMERIC); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ASCII_ALPHANUMERIC)) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_infra, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHANUMERIC, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_rfc3986.pyx":2 + * from ._infra import _ASCII_ALPHANUMERIC + * from ._util import _PercentEncodeSet # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_PercentEncodeSet); + __Pyx_GIVEREF(__pyx_n_s_PercentEncodeSet); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_PercentEncodeSet)) __PYX_ERR(0, 2, __pyx_L1_error); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_util, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PercentEncodeSet, __pyx_t_3) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_rfc3986.pyx":5 + * + * + * _RFC3986_UNRESERVED_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< + * _ASCII_ALPHANUMERIC + "-._~", + * exclude=True, + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_rfc3986.pyx":6 + * + * _RFC3986_UNRESERVED_PERCENT_ENCODE_SET = _PercentEncodeSet( + * _ASCII_ALPHANUMERIC + "-._~", # <<<<<<<<<<<<<< + * exclude=True, + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_rfc3986.pyx":5 + * + * + * _RFC3986_UNRESERVED_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< + * _ASCII_ALPHANUMERIC + "-._~", + * exclude=True, + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error); + __pyx_t_4 = 0; + + /* "w3lib/_rfc3986.pyx":7 + * _RFC3986_UNRESERVED_PERCENT_ENCODE_SET = _PercentEncodeSet( + * _ASCII_ALPHANUMERIC + "-._~", + * exclude=True, # <<<<<<<<<<<<<< + * ) + * _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET = _PercentEncodeSet( + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_exclude, Py_True) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + + /* "w3lib/_rfc3986.pyx":5 + * + * + * _RFC3986_UNRESERVED_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< + * _ASCII_ALPHANUMERIC + "-._~", + * exclude=True, + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_UNRESERVED_PERCENT_ENCO, __pyx_t_5) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_rfc3986.pyx":9 + * exclude=True, + * ) + * _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< + * "!$&'()*+,;=", + * exclude=True, + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + + /* "w3lib/_rfc3986.pyx":11 + * _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET = _PercentEncodeSet( + * "!$&'()*+,;=", + * exclude=True, # <<<<<<<<<<<<<< + * ) + * _RFC3986_USERINFO_PERCENT_ENCODE_SET = ( + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_exclude, Py_True) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + + /* "w3lib/_rfc3986.pyx":9 + * exclude=True, + * ) + * _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< + * "!$&'()*+,;=", + * exclude=True, + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__4, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_SUB_DELIMS_PERCENT_ENCO, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_rfc3986.pyx":14 + * ) + * _RFC3986_USERINFO_PERCENT_ENCODE_SET = ( + * _RFC3986_UNRESERVED_PERCENT_ENCODE_SET & _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * ) - ":" + * _RFC3986_PCHAR_PERCENT_ENCODE_SET = ( + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_UNRESERVED_PERCENT_ENCO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RFC3986_SUB_DELIMS_PERCENT_ENCO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_And(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_rfc3986.pyx":15 + * _RFC3986_USERINFO_PERCENT_ENCODE_SET = ( + * _RFC3986_UNRESERVED_PERCENT_ENCODE_SET & _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET + * ) - ":" # <<<<<<<<<<<<<< + * _RFC3986_PCHAR_PERCENT_ENCODE_SET = ( + * _RFC3986_UNRESERVED_PERCENT_ENCODE_SET + */ + __pyx_t_4 = PyNumber_Subtract(__pyx_t_5, __pyx_kp_u__5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE, __pyx_t_4) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_rfc3986.pyx":17 + * ) - ":" + * _RFC3986_PCHAR_PERCENT_ENCODE_SET = ( + * _RFC3986_UNRESERVED_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * & _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET - ":@" + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RFC3986_UNRESERVED_PERCENT_ENCO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "w3lib/_rfc3986.pyx":18 + * _RFC3986_PCHAR_PERCENT_ENCODE_SET = ( + * _RFC3986_UNRESERVED_PERCENT_ENCODE_SET + * & _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET - ":@" # <<<<<<<<<<<<<< + * ) + * _RFC3986_PATH_PERCENT_ENCODE_SET = _RFC3986_PCHAR_PERCENT_ENCODE_SET - "/" + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RFC3986_SUB_DELIMS_PERCENT_ENCO); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_kp_u__6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_And(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_PCHAR_PERCENT_ENCODE_SE, __pyx_t_5) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_rfc3986.pyx":20 + * & _RFC3986_SUB_DELIMS_PERCENT_ENCODE_SET - ":@" + * ) + * _RFC3986_PATH_PERCENT_ENCODE_SET = _RFC3986_PCHAR_PERCENT_ENCODE_SET - "/" # <<<<<<<<<<<<<< + * _RFC3986_QUERY_PERCENT_ENCODE_SET = _RFC3986_PCHAR_PERCENT_ENCODE_SET - "/?" + * _RFC3986_FRAGMENT_PERCENT_ENCODE_SET = _RFC3986_QUERY_PERCENT_ENCODE_SET + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RFC3986_PCHAR_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_kp_u__7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_rfc3986.pyx":21 + * ) + * _RFC3986_PATH_PERCENT_ENCODE_SET = _RFC3986_PCHAR_PERCENT_ENCODE_SET - "/" + * _RFC3986_QUERY_PERCENT_ENCODE_SET = _RFC3986_PCHAR_PERCENT_ENCODE_SET - "/?" # <<<<<<<<<<<<<< + * _RFC3986_FRAGMENT_PERCENT_ENCODE_SET = _RFC3986_QUERY_PERCENT_ENCODE_SET + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_PCHAR_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_kp_u__8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE, __pyx_t_5) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_rfc3986.pyx":22 + * _RFC3986_PATH_PERCENT_ENCODE_SET = _RFC3986_PCHAR_PERCENT_ENCODE_SET - "/" + * _RFC3986_QUERY_PERCENT_ENCODE_SET = _RFC3986_PCHAR_PERCENT_ENCODE_SET - "/?" + * _RFC3986_FRAGMENT_PERCENT_ENCODE_SET = _RFC3986_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE, __pyx_t_5) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_rfc3986.pyx":1 + * from ._infra import _ASCII_ALPHANUMERIC # <<<<<<<<<<<<<< + * from ._util import _PercentEncodeSet + * + */ + __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init w3lib._rfc3986", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init w3lib._rfc3986"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + const char* module_name_str = 0; + PyObject* module_name = 0; + PyObject* module_dot = 0; + PyObject* full_name = 0; + PyErr_Clear(); + module_name_str = PyModule_GetName(module); + if (unlikely(!module_name_str)) { goto modbad; } + module_name = PyUnicode_FromString(module_name_str); + if (unlikely(!module_name)) { goto modbad; } + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); + if (unlikely(!module_dot)) { goto modbad; } + full_name = PyUnicode_Concat(module_dot, name); + if (unlikely(!full_name)) { goto modbad; } + #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + { + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + goto modbad; + value = PyObject_GetItem(modules, full_name); + } + #else + value = PyImport_GetModule(full_name); + #endif + modbad: + Py_XDECREF(full_name); + Py_XDECREF(module_dot); + Py_XDECREF(module_name); + } + if (unlikely(!value)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +#endif +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, + PyObject *firstlineno, PyObject *name) { + PyObject *replace = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; + replace = PyObject_GetAttrString(code, "replace"); + if (likely(replace)) { + PyObject *result; + result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + Py_DECREF(replace); + return result; + } + PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 + { + PyObject *compiled = NULL, *result = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; + compiled = Py_CompileString( + "out = type(code)(\n" + " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" + " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" + " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" + " code.co_lnotab)\n", "", Py_file_input); + if (!compiled) return NULL; + result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); + Py_DECREF(compiled); + if (!result) PyErr_Print(); + Py_DECREF(result); + result = PyDict_GetItemString(scratch_dict, "out"); + if (result) Py_INCREF(result); + return result; + } + #else + return NULL; + #endif +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; + PyObject *replace = NULL, *getframe = NULL, *frame = NULL; + PyObject *exc_type, *exc_value, *exc_traceback; + int success = 0; + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + getframe = PySys_GetObject("_getframe"); + if (unlikely(!getframe)) goto bad; + if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; + frame = PyEval_EvalCode(code_object, dict, dict); + if (unlikely(!frame) || frame == Py_None) goto bad; + success = 1; + bad: + PyErr_Restore(exc_type, exc_value, exc_traceback); + Py_XDECREF(code_object); + Py_XDECREF(py_py_line); + Py_XDECREF(py_funcname); + Py_XDECREF(dict); + Py_XDECREF(replace); + if (success) { + PyTraceBack_Here( + (struct _frame*)frame); + } + Py_XDECREF(frame); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__9); + } + return name; +} +#endif + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030B00A4 + return Py_Version & ~0xFFUL; +#else + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + return version; +#endif +} +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { + const unsigned long MAJOR_MINOR = 0xFFFF0000UL; + if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) + return 0; + if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) + return 1; + { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compile time Python version %d.%d " + "of module '%.100s' " + "%s " + "runtime version %d.%d", + (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), + __Pyx_MODULE_NAME, + (allow_newer) ? "was newer than" : "does not match", + (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) + ); + return PyErr_WarnEx(NULL, message, 1); + } +} + +/* InitStrings */ +#if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +#include +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { + size_t len = strlen(s); + if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, "byte string is too long"); + return -1; + } + return (Py_ssize_t) len; +} +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return __Pyx_PyUnicode_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return PyByteArray_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/w3lib/_rfc3986.py b/w3lib/_rfc3986.pyx similarity index 100% rename from w3lib/_rfc3986.py rename to w3lib/_rfc3986.pyx diff --git a/w3lib/_rfc5892.c b/w3lib/_rfc5892.c new file mode 100644 index 00000000..80b39db5 --- /dev/null +++ b/w3lib/_rfc5892.c @@ -0,0 +1,8027 @@ +/* Generated by Cython 3.0.8 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "name": "w3lib._rfc5892", + "sources": [ + "w3lib/_rfc5892.pyx" + ] + }, + "module_name": "w3lib._rfc5892" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API +#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#else +#define __PYX_EXTRA_ABI_MODULE_NAME "" +#endif +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030008F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #ifdef Py_LIMITED_API + #undef __PYX_LIMITED_VERSION_HEX + #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API + #endif + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_USE_CPP_STD_MOVE + #if defined(__cplusplus) && (\ + __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) + #define CYTHON_USE_CPP_STD_MOVE 1 + #else + #define CYTHON_USE_CPP_STD_MOVE 0 + #endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #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 +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if CYTHON_COMPILING_IN_LIMITED_API + static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } + #ifndef CO_OPTIMIZED + #define CO_OPTIMIZED 0x0001 + #endif + #ifndef CO_NEWLOCALS + #define CO_NEWLOCALS 0x0002 + #endif + #ifndef CO_VARARGS + #define CO_VARARGS 0x0004 + #endif + #ifndef CO_VARKEYWORDS + #define CO_VARKEYWORDS 0x0008 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x0200 + #endif + #ifndef CO_GENERATOR + #define CO_GENERATOR 0x0020 + #endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x0080 + #endif +#elif PY_VERSION_HEX >= 0x030B0000 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); + if (!empty_bytes) return NULL; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); + Py_DECREF(empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_MAJOR_VERSION >= 0x030900B1 +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) +#else +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) +#endif +#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) +#elif !CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) +static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { + return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; +} +#endif +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API + return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; +#else + return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +#endif +} +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) +#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) +#else + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) +#endif +#if PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__w3lib___rfc5892 +#define __PYX_HAVE_API__w3lib___rfc5892 +/* Early includes */ +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#include +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#include +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "w3lib/_rfc5892.pyx", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* #### Code section: numeric_typedefs ### */ +/* #### Code section: complex_type_declarations ### */ +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#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 + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* TupleAndListFromArray.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* fastcall.proto */ +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#else + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) +#endif +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) + #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) +#else + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) +#endif +#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) +#define __Pyx_KwValues_VARARGS(args, nargs) NULL +#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) +#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) +#if CYTHON_METH_FASTCALL + #define __Pyx_Arg_FASTCALL(args, i) args[i] + #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) + static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + #else + #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) + #endif + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) +#else + #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS + #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS + #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS + #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS + #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) + #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod0.proto */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CallUnboundCMethod0(cfunc, self)\ + (likely((cfunc)->func) ?\ + (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ + (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ + (PY_VERSION_HEX >= 0x030700A0 ?\ + (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ + (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ + (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ + ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)) +#else +#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) +#endif + +/* unicode_iter.proto */ +static CYTHON_INLINE int __Pyx_init_unicode_iteration( + PyObject* ustring, Py_ssize_t *length, void** data, int *kind); + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + +/* 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); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) +#else +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#if !CYTHON_VECTORCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if !CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03080000 + #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #define __Pxy_PyFrame_Initialize_Offsets() + #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) +#else + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif +#endif +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectFastCall.proto */ +#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* BuildPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, + int prepend_sign, char padding_char); + +/* CIntToPyUnicode.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char); + +/* PyObjectFormatSimple.proto */ +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#elif PY_MAJOR_VERSION < 3 + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ + PyObject_Format(s, f)) +#elif CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\ + likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\ + PyObject_Format(s, f)) +#else + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#endif + +/* PyObjectFormatAndDecref.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); + +/* JoinPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char); + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* IncludeStructmemberH.proto */ +#include + +/* FixUpExtensionType.proto */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); +#endif + +/* FetchSharedCythonModule.proto */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); + +/* FetchCommonType.proto */ +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); +#else +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +#endif + +/* PyMethodNew.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + typesModule = PyImport_ImportModule("types"); + if (!typesModule) return NULL; + methodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + if (!methodType) return NULL; + result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); + Py_DECREF(methodType); + return result; +} +#elif PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#else + #define __Pyx_PyMethod_New PyMethod_New +#endif + +/* PyVectorcallFastCallDict.proto */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); +#endif + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CYFUNCTION_COROUTINE 0x08 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#else + #define __Pyx_CyFunction_GetClassObj(f)\ + ((PyObject*) ((PyCMethodObject *) (f))->mm_class) +#endif +#define __Pyx_CyFunction_SetClassObj(f, classobj)\ + __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject_HEAD + PyObject *func; +#elif PY_VERSION_HEX < 0x030900B1 + PyCFunctionObject func; +#else + PyCMethodObject func; +#endif +#if CYTHON_BACKPORT_VECTORCALL + __pyx_vectorcallfunc func_vectorcall; +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_classobj; +#endif + void *defaults; + int defaults_pyobjects; + size_t defaults_size; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; + PyObject *func_is_coroutine; +} __pyx_CyFunctionObject; +#undef __Pyx_CyOrPyCFunction_Check +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); +#undef __Pyx_IsSameCFunction +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(PyObject *module); +#if CYTHON_METH_FASTCALL +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#if CYTHON_BACKPORT_VECTORCALL +#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) +#else +#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) +#endif +#endif + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + +/* CLineInTraceback.proto */ +#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 */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +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); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static unsigned long __Pyx_get_runtime_version(void); +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ + +/* Module declarations from "w3lib._rfc5892" */ +/* #### Code section: typeinfo ### */ +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "w3lib._rfc5892" +extern int __pyx_module_is_main_w3lib___rfc5892; +int __pyx_module_is_main_w3lib___rfc5892 = 0; + +/* Implementation of "w3lib._rfc5892" */ +/* #### Code section: global_var ### */ +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_ValueError; +/* #### Code section: string_decls ### */ +static const char __pyx_k_[] = "."; +static const char __pyx_k_i[] = "i"; +static const char __pyx_k__4[] = "?"; +static const char __pyx_k_in[] = " in "; +static const char __pyx_k_04X[] = "04X"; +static const char __pyx_k_str[] = "str"; +static const char __pyx_k_None[] = "None"; +static const char __pyx_k_idna[] = "idna"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_label[] = "label"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_return[] = "return"; +static const char __pyx_k_isascii[] = "isascii"; +static const char __pyx_k_maxsize[] = "maxsize"; +static const char __pyx_k_CONTEXTJ[] = "CONTEXTJ"; +static const char __pyx_k_Joiner_U[] = "Joiner U+"; +static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_functools[] = "functools"; +static const char __pyx_k_lru_cache[] = "lru_cache"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_code_point[] = "code_point"; +static const char __pyx_k_is_coroutine[] = "_is_coroutine"; +static const char __pyx_k_idna_idnadata[] = "idna.idnadata"; +static const char __pyx_k_valid_contextj[] = "valid_contextj"; +static const char __pyx_k_w3lib__rfc5892[] = "w3lib._rfc5892"; +static const char __pyx_k_codepoint_classes[] = "codepoint_classes"; +static const char __pyx_k_intranges_contain[] = "intranges_contain"; +static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_w3lib__rfc5892_pyx[] = "w3lib/_rfc5892.pyx"; +static const char __pyx_k_intranges_contain_2[] = "_intranges_contain"; +static const char __pyx_k_check_contextj_rules[] = "_check_contextj_rules"; +static const char __pyx_k_not_allowed_at_position[] = " not allowed at position "; +/* #### Code section: decls ### */ +static PyObject *__pyx_pf_5w3lib_8_rfc5892__check_contextj_rules(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label); /* proto */ +static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_isascii = {0, 0, 0, 0, 0}; +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + #endif + PyObject *__pyx_kp_u_; + PyObject *__pyx_kp_u_04X; + PyObject *__pyx_n_u_CONTEXTJ; + PyObject *__pyx_kp_u_Joiner_U; + PyObject *__pyx_n_s_None; + PyObject *__pyx_n_s_ValueError; + PyObject *__pyx_n_s__4; + PyObject *__pyx_n_s_asyncio_coroutines; + PyObject *__pyx_n_s_check_contextj_rules; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_code_point; + PyObject *__pyx_n_s_codepoint_classes; + PyObject *__pyx_n_s_enumerate; + PyObject *__pyx_n_s_functools; + PyObject *__pyx_n_s_i; + PyObject *__pyx_n_s_idna; + PyObject *__pyx_n_s_idna_idnadata; + PyObject *__pyx_n_s_import; + PyObject *__pyx_kp_u_in; + PyObject *__pyx_n_s_intranges_contain; + PyObject *__pyx_n_s_intranges_contain_2; + PyObject *__pyx_n_s_is_coroutine; + PyObject *__pyx_n_s_isascii; + PyObject *__pyx_n_s_label; + PyObject *__pyx_n_s_lru_cache; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_maxsize; + PyObject *__pyx_n_s_name; + PyObject *__pyx_kp_u_not_allowed_at_position; + PyObject *__pyx_n_s_return; + PyObject *__pyx_n_s_str; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_valid_contextj; + PyObject *__pyx_n_s_value; + PyObject *__pyx_n_s_w3lib__rfc5892; + PyObject *__pyx_kp_s_w3lib__rfc5892_pyx; + PyObject *__pyx_int_0; + PyObject *__pyx_int_1; + PyObject *__pyx_tuple__2; + PyObject *__pyx_codeobj__3; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_kp_u_); + Py_CLEAR(clear_module_state->__pyx_kp_u_04X); + Py_CLEAR(clear_module_state->__pyx_n_u_CONTEXTJ); + Py_CLEAR(clear_module_state->__pyx_kp_u_Joiner_U); + Py_CLEAR(clear_module_state->__pyx_n_s_None); + Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); + Py_CLEAR(clear_module_state->__pyx_n_s__4); + Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); + Py_CLEAR(clear_module_state->__pyx_n_s_check_contextj_rules); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_code_point); + Py_CLEAR(clear_module_state->__pyx_n_s_codepoint_classes); + Py_CLEAR(clear_module_state->__pyx_n_s_enumerate); + Py_CLEAR(clear_module_state->__pyx_n_s_functools); + Py_CLEAR(clear_module_state->__pyx_n_s_i); + Py_CLEAR(clear_module_state->__pyx_n_s_idna); + Py_CLEAR(clear_module_state->__pyx_n_s_idna_idnadata); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_kp_u_in); + Py_CLEAR(clear_module_state->__pyx_n_s_intranges_contain); + Py_CLEAR(clear_module_state->__pyx_n_s_intranges_contain_2); + Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); + Py_CLEAR(clear_module_state->__pyx_n_s_isascii); + Py_CLEAR(clear_module_state->__pyx_n_s_label); + Py_CLEAR(clear_module_state->__pyx_n_s_lru_cache); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_maxsize); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_kp_u_not_allowed_at_position); + Py_CLEAR(clear_module_state->__pyx_n_s_return); + Py_CLEAR(clear_module_state->__pyx_n_s_str); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_valid_contextj); + Py_CLEAR(clear_module_state->__pyx_n_s_value); + Py_CLEAR(clear_module_state->__pyx_n_s_w3lib__rfc5892); + Py_CLEAR(clear_module_state->__pyx_kp_s_w3lib__rfc5892_pyx); + Py_CLEAR(clear_module_state->__pyx_int_0); + Py_CLEAR(clear_module_state->__pyx_int_1); + Py_CLEAR(clear_module_state->__pyx_tuple__2); + Py_CLEAR(clear_module_state->__pyx_codeobj__3); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_kp_u_); + Py_VISIT(traverse_module_state->__pyx_kp_u_04X); + Py_VISIT(traverse_module_state->__pyx_n_u_CONTEXTJ); + Py_VISIT(traverse_module_state->__pyx_kp_u_Joiner_U); + Py_VISIT(traverse_module_state->__pyx_n_s_None); + Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); + Py_VISIT(traverse_module_state->__pyx_n_s__4); + Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); + Py_VISIT(traverse_module_state->__pyx_n_s_check_contextj_rules); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_code_point); + Py_VISIT(traverse_module_state->__pyx_n_s_codepoint_classes); + Py_VISIT(traverse_module_state->__pyx_n_s_enumerate); + Py_VISIT(traverse_module_state->__pyx_n_s_functools); + Py_VISIT(traverse_module_state->__pyx_n_s_i); + Py_VISIT(traverse_module_state->__pyx_n_s_idna); + Py_VISIT(traverse_module_state->__pyx_n_s_idna_idnadata); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_kp_u_in); + Py_VISIT(traverse_module_state->__pyx_n_s_intranges_contain); + Py_VISIT(traverse_module_state->__pyx_n_s_intranges_contain_2); + Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); + Py_VISIT(traverse_module_state->__pyx_n_s_isascii); + Py_VISIT(traverse_module_state->__pyx_n_s_label); + Py_VISIT(traverse_module_state->__pyx_n_s_lru_cache); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_maxsize); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_kp_u_not_allowed_at_position); + Py_VISIT(traverse_module_state->__pyx_n_s_return); + Py_VISIT(traverse_module_state->__pyx_n_s_str); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_valid_contextj); + Py_VISIT(traverse_module_state->__pyx_n_s_value); + Py_VISIT(traverse_module_state->__pyx_n_s_w3lib__rfc5892); + Py_VISIT(traverse_module_state->__pyx_kp_s_w3lib__rfc5892_pyx); + Py_VISIT(traverse_module_state->__pyx_int_0); + Py_VISIT(traverse_module_state->__pyx_int_1); + Py_VISIT(traverse_module_state->__pyx_tuple__2); + Py_VISIT(traverse_module_state->__pyx_codeobj__3); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ +#define __pyx_kp_u_04X __pyx_mstate_global->__pyx_kp_u_04X +#define __pyx_n_u_CONTEXTJ __pyx_mstate_global->__pyx_n_u_CONTEXTJ +#define __pyx_kp_u_Joiner_U __pyx_mstate_global->__pyx_kp_u_Joiner_U +#define __pyx_n_s_None __pyx_mstate_global->__pyx_n_s_None +#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError +#define __pyx_n_s__4 __pyx_mstate_global->__pyx_n_s__4 +#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines +#define __pyx_n_s_check_contextj_rules __pyx_mstate_global->__pyx_n_s_check_contextj_rules +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_code_point __pyx_mstate_global->__pyx_n_s_code_point +#define __pyx_n_s_codepoint_classes __pyx_mstate_global->__pyx_n_s_codepoint_classes +#define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate +#define __pyx_n_s_functools __pyx_mstate_global->__pyx_n_s_functools +#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i +#define __pyx_n_s_idna __pyx_mstate_global->__pyx_n_s_idna +#define __pyx_n_s_idna_idnadata __pyx_mstate_global->__pyx_n_s_idna_idnadata +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_kp_u_in __pyx_mstate_global->__pyx_kp_u_in +#define __pyx_n_s_intranges_contain __pyx_mstate_global->__pyx_n_s_intranges_contain +#define __pyx_n_s_intranges_contain_2 __pyx_mstate_global->__pyx_n_s_intranges_contain_2 +#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine +#define __pyx_n_s_isascii __pyx_mstate_global->__pyx_n_s_isascii +#define __pyx_n_s_label __pyx_mstate_global->__pyx_n_s_label +#define __pyx_n_s_lru_cache __pyx_mstate_global->__pyx_n_s_lru_cache +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_maxsize __pyx_mstate_global->__pyx_n_s_maxsize +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_kp_u_not_allowed_at_position __pyx_mstate_global->__pyx_kp_u_not_allowed_at_position +#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return +#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_valid_contextj __pyx_mstate_global->__pyx_n_s_valid_contextj +#define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value +#define __pyx_n_s_w3lib__rfc5892 __pyx_mstate_global->__pyx_n_s_w3lib__rfc5892 +#define __pyx_kp_s_w3lib__rfc5892_pyx __pyx_mstate_global->__pyx_kp_s_w3lib__rfc5892_pyx +#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 +#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 +#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 +#define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 +/* #### Code section: module_code ### */ + +/* "w3lib/_rfc5892.pyx":12 + * + * + * def _check_contextj_rules(label: str) -> None: # <<<<<<<<<<<<<< + * if label.isascii(): + * return + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_8_rfc5892_1_check_contextj_rules(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_8_rfc5892__check_contextj_rules, "_check_contextj_rules(unicode label: str) -> None"); +static PyMethodDef __pyx_mdef_5w3lib_8_rfc5892_1_check_contextj_rules = {"_check_contextj_rules", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_8_rfc5892_1_check_contextj_rules, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_8_rfc5892__check_contextj_rules}; +static PyObject *__pyx_pw_5w3lib_8_rfc5892_1_check_contextj_rules(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_label = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_check_contextj_rules (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_label,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 12, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_check_contextj_rules") < 0)) __PYX_ERR(0, 12, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_label = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_check_contextj_rules", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 12, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._rfc5892._check_contextj_rules", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), (&PyUnicode_Type), 0, "label", 1))) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_8_rfc5892__check_contextj_rules(__pyx_self, __pyx_v_label); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_8_rfc5892__check_contextj_rules(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label) { + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_code_point = NULL; + long __pyx_v_value; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + long __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_UCS4 __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_contextj_rules", 1); + + /* "w3lib/_rfc5892.pyx":13 + * + * def _check_contextj_rules(label: str) -> None: + * if label.isascii(): # <<<<<<<<<<<<<< + * return + * for i, code_point in enumerate(label): + */ + __pyx_t_1 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyUnicode_Type_isascii, __pyx_v_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "w3lib/_rfc5892.pyx":14 + * def _check_contextj_rules(label: str) -> None: + * if label.isascii(): + * return # <<<<<<<<<<<<<< + * for i, code_point in enumerate(label): + * value = ord(code_point) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "w3lib/_rfc5892.pyx":13 + * + * def _check_contextj_rules(label: str) -> None: + * if label.isascii(): # <<<<<<<<<<<<<< + * return + * for i, code_point in enumerate(label): + */ + } + + /* "w3lib/_rfc5892.pyx":15 + * if label.isascii(): + * return + * for i, code_point in enumerate(label): # <<<<<<<<<<<<<< + * value = ord(code_point) + * if not intranges_contain(value, codepoint_classes["CONTEXTJ"]): + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + __Pyx_INCREF(__pyx_v_label); + __pyx_t_3 = __pyx_v_label; + __pyx_t_8 = __Pyx_init_unicode_iteration(__pyx_t_3, (&__pyx_t_5), (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 15, __pyx_L1_error) + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_5; __pyx_t_9++) { + __pyx_t_4 = __pyx_t_9; + __pyx_t_10 = __Pyx_PyUnicode_FromOrdinal(__Pyx_PyUnicode_READ(__pyx_t_7, __pyx_t_6, __pyx_t_4)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_10); + __pyx_t_10 = 0; + + /* "w3lib/_rfc5892.pyx":16 + * return + * for i, code_point in enumerate(label): + * value = ord(code_point) # <<<<<<<<<<<<<< + * if not intranges_contain(value, codepoint_classes["CONTEXTJ"]): + * continue + */ + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); + + /* "w3lib/_rfc5892.pyx":15 + * if label.isascii(): + * return + * for i, code_point in enumerate(label): # <<<<<<<<<<<<<< + * value = ord(code_point) + * if not intranges_contain(value, codepoint_classes["CONTEXTJ"]): + */ + __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_10; + __pyx_t_10 = 0; + + /* "w3lib/_rfc5892.pyx":16 + * return + * for i, code_point in enumerate(label): + * value = ord(code_point) # <<<<<<<<<<<<<< + * if not intranges_contain(value, codepoint_classes["CONTEXTJ"]): + * continue + */ + __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_v_code_point); if (unlikely(__pyx_t_11 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 16, __pyx_L1_error) + __pyx_v_value = __pyx_t_11; + + /* "w3lib/_rfc5892.pyx":17 + * for i, code_point in enumerate(label): + * value = ord(code_point) + * if not intranges_contain(value, codepoint_classes["CONTEXTJ"]): # <<<<<<<<<<<<<< + * continue + * if valid_contextj(label, i): + */ + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_intranges_contain); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyInt_From_long(__pyx_v_value); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_codepoint_classes); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyObject_Dict_GetItem(__pyx_t_14, __pyx_n_u_CONTEXTJ); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_13, __pyx_t_15}; + __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_16 = (!__pyx_t_2); + if (__pyx_t_16) { + + /* "w3lib/_rfc5892.pyx":18 + * value = ord(code_point) + * if not intranges_contain(value, codepoint_classes["CONTEXTJ"]): + * continue # <<<<<<<<<<<<<< + * if valid_contextj(label, i): + * continue + */ + goto __pyx_L4_continue; + + /* "w3lib/_rfc5892.pyx":17 + * for i, code_point in enumerate(label): + * value = ord(code_point) + * if not intranges_contain(value, codepoint_classes["CONTEXTJ"]): # <<<<<<<<<<<<<< + * continue + * if valid_contextj(label, i): + */ + } + + /* "w3lib/_rfc5892.pyx":19 + * if not intranges_contain(value, codepoint_classes["CONTEXTJ"]): + * continue + * if valid_contextj(label, i): # <<<<<<<<<<<<<< + * continue + * raise ValueError( + */ + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_valid_contextj); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_15 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_v_label, __pyx_v_i}; + __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_16) { + + /* "w3lib/_rfc5892.pyx":20 + * continue + * if valid_contextj(label, i): + * continue # <<<<<<<<<<<<<< + * raise ValueError( + * f"Joiner U+{value:04X} not allowed at position {i+1} in {label!r}" + */ + goto __pyx_L4_continue; + + /* "w3lib/_rfc5892.pyx":19 + * if not intranges_contain(value, codepoint_classes["CONTEXTJ"]): + * continue + * if valid_contextj(label, i): # <<<<<<<<<<<<<< + * continue + * raise ValueError( + */ + } + + /* "w3lib/_rfc5892.pyx":22 + * continue + * raise ValueError( + * f"Joiner U+{value:04X} not allowed at position {i+1} in {label!r}" # <<<<<<<<<<<<<< + * ) + */ + __pyx_t_10 = PyTuple_New(6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_17 = 0; + __pyx_t_18 = 127; + __Pyx_INCREF(__pyx_kp_u_Joiner_U); + __pyx_t_17 += 9; + __Pyx_GIVEREF(__pyx_kp_u_Joiner_U); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_u_Joiner_U); + __pyx_t_12 = __Pyx_PyUnicode_From_long(__pyx_v_value, 4, '0', 'X'); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12); + __pyx_t_12 = 0; + __Pyx_INCREF(__pyx_kp_u_not_allowed_at_position); + __pyx_t_17 += 25; + __Pyx_GIVEREF(__pyx_kp_u_not_allowed_at_position); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_kp_u_not_allowed_at_position); + __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_15 = __Pyx_PyObject_FormatSimple(__pyx_t_12, __pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) : __pyx_t_18; + __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_15); + __pyx_t_15 = 0; + __Pyx_INCREF(__pyx_kp_u_in); + __pyx_t_17 += 4; + __Pyx_GIVEREF(__pyx_kp_u_in); + PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_kp_u_in); + __pyx_t_15 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) : __pyx_t_18; + __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_15); + __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyUnicode_Join(__pyx_t_10, 6, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "w3lib/_rfc5892.pyx":21 + * if valid_contextj(label, i): + * continue + * raise ValueError( # <<<<<<<<<<<<<< + * f"Joiner U+{value:04X} not allowed at position {i+1} in {label!r}" + * ) + */ + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_15); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_L4_continue:; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_rfc5892.pyx":12 + * + * + * def _check_contextj_rules(label: str) -> None: # <<<<<<<<<<<<<< + * if label.isascii(): + * return + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("w3lib._rfc5892._check_contextj_rules", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_code_point); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, + {&__pyx_kp_u_04X, __pyx_k_04X, sizeof(__pyx_k_04X), 0, 1, 0, 0}, + {&__pyx_n_u_CONTEXTJ, __pyx_k_CONTEXTJ, sizeof(__pyx_k_CONTEXTJ), 0, 1, 0, 1}, + {&__pyx_kp_u_Joiner_U, __pyx_k_Joiner_U, sizeof(__pyx_k_Joiner_U), 0, 1, 0, 0}, + {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 1}, + {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, + {&__pyx_n_s_check_contextj_rules, __pyx_k_check_contextj_rules, sizeof(__pyx_k_check_contextj_rules), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_code_point, __pyx_k_code_point, sizeof(__pyx_k_code_point), 0, 0, 1, 1}, + {&__pyx_n_s_codepoint_classes, __pyx_k_codepoint_classes, sizeof(__pyx_k_codepoint_classes), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_idna, __pyx_k_idna, sizeof(__pyx_k_idna), 0, 0, 1, 1}, + {&__pyx_n_s_idna_idnadata, __pyx_k_idna_idnadata, sizeof(__pyx_k_idna_idnadata), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_kp_u_in, __pyx_k_in, sizeof(__pyx_k_in), 0, 1, 0, 0}, + {&__pyx_n_s_intranges_contain, __pyx_k_intranges_contain, sizeof(__pyx_k_intranges_contain), 0, 0, 1, 1}, + {&__pyx_n_s_intranges_contain_2, __pyx_k_intranges_contain_2, sizeof(__pyx_k_intranges_contain_2), 0, 0, 1, 1}, + {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, + {&__pyx_n_s_isascii, __pyx_k_isascii, sizeof(__pyx_k_isascii), 0, 0, 1, 1}, + {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1}, + {&__pyx_n_s_lru_cache, __pyx_k_lru_cache, sizeof(__pyx_k_lru_cache), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_kp_u_not_allowed_at_position, __pyx_k_not_allowed_at_position, sizeof(__pyx_k_not_allowed_at_position), 0, 1, 0, 0}, + {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_valid_contextj, __pyx_k_valid_contextj, sizeof(__pyx_k_valid_contextj), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_w3lib__rfc5892, __pyx_k_w3lib__rfc5892, sizeof(__pyx_k_w3lib__rfc5892), 0, 0, 1, 1}, + {&__pyx_kp_s_w3lib__rfc5892_pyx, __pyx_k_w3lib__rfc5892_pyx, sizeof(__pyx_k_w3lib__rfc5892_pyx), 0, 0, 1, 0}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 21, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "w3lib/_rfc5892.pyx":12 + * + * + * def _check_contextj_rules(label: str) -> None: # <<<<<<<<<<<<<< + * if label.isascii(): + * return + */ + __pyx_tuple__2 = PyTuple_Pack(4, __pyx_n_s_label, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_value); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__rfc5892_pyx, __pyx_n_s_check_contextj_rules, 12, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + __pyx_umethod_PyUnicode_Type_isascii.type = (PyObject*)&PyUnicode_Type; + __pyx_umethod_PyUnicode_Type_isascii.method_name = &__pyx_n_s_isascii; + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + return 0; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__rfc5892(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__rfc5892}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "_rfc5892", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_rfc5892(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_rfc5892(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__rfc5892(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__rfc5892(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__rfc5892(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_rfc5892' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_rfc5892", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_rfc5892" pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__rfc5892(void)", 0); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_w3lib___rfc5892) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "w3lib._rfc5892")) { + if (unlikely((PyDict_SetItemString(modules, "w3lib._rfc5892", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + (void)__Pyx_modinit_type_init_code(); + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "w3lib/_rfc5892.pyx":3 + * # https://www.rfc-editor.org/rfc/rfc5892.txt + * + * from functools import lru_cache # <<<<<<<<<<<<<< + * + * from idna import intranges_contain as _intranges_contain, valid_contextj + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_lru_cache); + __Pyx_GIVEREF(__pyx_n_s_lru_cache); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_lru_cache)) __PYX_ERR(0, 3, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lru_cache, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_rfc5892.pyx":5 + * from functools import lru_cache + * + * from idna import intranges_contain as _intranges_contain, valid_contextj # <<<<<<<<<<<<<< + * from idna.idnadata import codepoint_classes + * + */ + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_intranges_contain); + __Pyx_GIVEREF(__pyx_n_s_intranges_contain); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_intranges_contain)) __PYX_ERR(0, 5, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_valid_contextj); + __Pyx_GIVEREF(__pyx_n_s_valid_contextj); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_valid_contextj)) __PYX_ERR(0, 5, __pyx_L1_error); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_idna, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_intranges_contain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_intranges_contain_2, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_valid_contextj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_valid_contextj, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_rfc5892.pyx":6 + * + * from idna import intranges_contain as _intranges_contain, valid_contextj + * from idna.idnadata import codepoint_classes # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_codepoint_classes); + __Pyx_GIVEREF(__pyx_n_s_codepoint_classes); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_codepoint_classes)) __PYX_ERR(0, 6, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_idna_idnadata, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_codepoint_classes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_codepoint_classes, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_rfc5892.pyx":9 + * + * + * intranges_contain = lru_cache(maxsize=None)(_intranges_contain) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_intranges_contain_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_intranges_contain, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_rfc5892.pyx":12 + * + * + * def _check_contextj_rules(label: str) -> None: # <<<<<<<<<<<<<< + * if label.isascii(): + * return + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_8_rfc5892_1_check_contextj_rules, 0, __pyx_n_s_check_contextj_rules, NULL, __pyx_n_s_w3lib__rfc5892, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_contextj_rules, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_rfc5892.pyx":1 + * # https://www.rfc-editor.org/rfc/rfc5892.txt # <<<<<<<<<<<<<< + * + * from functools import lru_cache + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init w3lib._rfc5892", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init w3lib._rfc5892"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +#endif +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* TupleAndListFromArray */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + Py_INCREF(__pyx_empty_tuple); + return __pyx_empty_tuple; + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} +static CYTHON_INLINE PyObject * +__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return PyList_New(0); + } + res = PyList_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); + return res; +} +#endif + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* fastcall */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) +{ + Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + for (i = 0; i < n; i++) + { + if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + } + for (i = 0; i < n; i++) + { + int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + if (unlikely(eq != 0)) { + if (unlikely(eq < 0)) return NULL; + return kwvalues[i]; + } + } + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { + Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + PyObject *dict; + dict = PyDict_New(); + if (unlikely(!dict)) + return NULL; + for (i=0; i= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); + while (1) { + Py_XDECREF(key); key = NULL; + Py_XDECREF(value); value = NULL; + if (kwds_is_tuple) { + Py_ssize_t size; +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(kwds); +#else + size = PyTuple_Size(kwds); + if (size < 0) goto bad; +#endif + if (pos >= size) break; +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); + if (!key) goto bad; +#elif CYTHON_ASSUME_SAFE_MACROS + key = PyTuple_GET_ITEM(kwds, pos); +#else + key = PyTuple_GetItem(kwds, pos); + if (!key) goto bad; +#endif + value = kwvalues[pos]; + pos++; + } + else + { + if (!PyDict_Next(kwds, &pos, &key, &value)) break; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + } + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(value); + Py_DECREF(key); +#endif + key = NULL; + value = NULL; + continue; + } +#if !CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + Py_INCREF(value); + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = ( + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key) + ); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + Py_XDECREF(key); + Py_XDECREF(value); + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + #if PY_MAJOR_VERSION < 3 + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + Py_XDECREF(key); + Py_XDECREF(value); + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + type_name = __Pyx_PyType_GetName(type); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* UnpackUnboundCMethod */ +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), + METH_VARARGS | METH_KEYWORDS, + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #else + if (likely(!__Pyx_CyOrPyCFunction_Check(method))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY +#else + if (PyCFunction_Check(method)) +#endif + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); + } +#else + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + target->method = unbound_method; + } + } + return 0; +} + +/* CallUnboundCMethod0 */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *args, *result = NULL; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_ASSUME_SAFE_MACROS + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); +#else + args = PyTuple_Pack(1, self); + if (unlikely(!args)) goto bad; +#endif + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + Py_DECREF(args); +bad: + return result; +} + +/* unicode_iter */ +static CYTHON_INLINE int __Pyx_init_unicode_iteration( + PyObject* ustring, Py_ssize_t *length, void** data, int *kind) { +#if CYTHON_COMPILING_IN_LIMITED_API + *kind = 0; + *length = PyUnicode_GetLength(ustring); + *data = (void*)ustring; +#elif CYTHON_PEP393_ENABLED + if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return -1; + *kind = PyUnicode_KIND(ustring); + *length = PyUnicode_GET_LENGTH(ustring); + *data = PyUnicode_DATA(ustring); +#else + *kind = 0; + *length = PyUnicode_GET_SIZE(ustring); + *data = (void*)PyUnicode_AS_UNICODE(ustring); +#endif + return 0; +} + +/* PyIntBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_MAYBE_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + + x = (long)((unsigned long)a + (unsigned long)b); + if (likely((x^a) >= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + return __Pyx_NewRef(op2); + } + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } else { + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + double result; + + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* UnicodeAsUCS4 */ +static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { + Py_ssize_t length; + #if CYTHON_PEP393_ENABLED + length = PyUnicode_GET_LENGTH(x); + if (likely(length == 1)) { + return PyUnicode_READ_CHAR(x, 0); + } + #else + length = PyUnicode_GET_SIZE(x); + if (likely(length == 1)) { + return PyUnicode_AS_UNICODE(x)[0]; + } + #if Py_UNICODE_SIZE == 2 + else if (PyUnicode_GET_SIZE(x) == 2) { + Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0]; + if (high_val >= 0xD800 && high_val <= 0xDBFF) { + Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1]; + if (low_val >= 0xDC00 && low_val <= 0xDFFF) { + return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1))); + } + } + } + #endif + #endif + PyErr_Format(PyExc_ValueError, + "only single character unicode strings can be converted to Py_UCS4, " + "got length %" CYTHON_FORMAT_SSIZE_T "d", length); + return (Py_UCS4)-1; +} + +/* object_ord */ +static long __Pyx__PyObject_Ord(PyObject* c) { + Py_ssize_t size; + if (PyBytes_Check(c)) { + size = PyBytes_GET_SIZE(c); + if (likely(size == 1)) { + return (unsigned char) PyBytes_AS_STRING(c)[0]; + } +#if PY_MAJOR_VERSION < 3 + } else if (PyUnicode_Check(c)) { + return (long)__Pyx_PyUnicode_AsPy_UCS4(c); +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + } else if (PyByteArray_Check(c)) { + size = PyByteArray_GET_SIZE(c); + if (likely(size == 1)) { + return (unsigned char) PyByteArray_AS_STRING(c)[0]; + } +#endif + } else { + __Pyx_TypeName c_type_name = __Pyx_PyType_GetName(Py_TYPE(c)); + PyErr_Format(PyExc_TypeError, + "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found", + c_type_name); + __Pyx_DECREF_TypeName(c_type_name); + return (long)(Py_UCS4)-1; + } + PyErr_Format(PyExc_TypeError, + "ord() expected a character, but string of length %zd found", size); + return (long)(Py_UCS4)-1; +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* DictGetItem */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); + } + } else { + PyErr_SetObject(PyExc_KeyError, key); + } + } + return NULL; + } + Py_INCREF(value); + return value; +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { + return NULL; + } + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { + return NULL; + } + #endif + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectFastCall */ +#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result = 0; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: + Py_DECREF(argstuple); + return result; +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); + } + else if (nargs == 1 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); + } +#endif + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); + } + } + #if PY_VERSION_HEX >= 0x030700A1 + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + if (kwargs == NULL) { + #if CYTHON_VECTORCALL + #if PY_VERSION_HEX < 0x03090000 + vectorcallfunc f = _PyVectorcall_Function(func); + #else + vectorcallfunc f = PyVectorcall_Function(func); + #endif + if (f) { + return f(func, args, (size_t)nargs, NULL); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, NULL); + } + #endif + } + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + } + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif +} + +/* CIntToDigits */ +static const char DIGIT_PAIRS_10[2*10*10+1] = { + "00010203040506070809" + "10111213141516171819" + "20212223242526272829" + "30313233343536373839" + "40414243444546474849" + "50515253545556575859" + "60616263646566676869" + "70717273747576777879" + "80818283848586878889" + "90919293949596979899" +}; +static const char DIGIT_PAIRS_8[2*8*8+1] = { + "0001020304050607" + "1011121314151617" + "2021222324252627" + "3031323334353637" + "4041424344454647" + "5051525354555657" + "6061626364656667" + "7071727374757677" +}; +static const char DIGITS_HEX[2*16+1] = { + "0123456789abcdef" + "0123456789ABCDEF" +}; + +/* BuildPyUnicode */ +static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, + int prepend_sign, char padding_char) { + PyObject *uval; + Py_ssize_t uoffset = ulength - clength; +#if CYTHON_USE_UNICODE_INTERNALS + Py_ssize_t i; +#if CYTHON_PEP393_ENABLED + void *udata; + uval = PyUnicode_New(ulength, 127); + if (unlikely(!uval)) return NULL; + udata = PyUnicode_DATA(uval); +#else + Py_UNICODE *udata; + uval = PyUnicode_FromUnicode(NULL, ulength); + if (unlikely(!uval)) return NULL; + udata = PyUnicode_AS_UNICODE(uval); +#endif + if (uoffset > 0) { + i = 0; + if (prepend_sign) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); + i++; + } + for (; i < uoffset; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); + } + } + for (i=0; i < clength; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); + } +#else + { + PyObject *sign = NULL, *padding = NULL; + uval = NULL; + if (uoffset > 0) { + prepend_sign = !!prepend_sign; + if (uoffset > prepend_sign) { + padding = PyUnicode_FromOrdinal(padding_char); + if (likely(padding) && uoffset > prepend_sign + 1) { + PyObject *tmp; + PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign); + if (unlikely(!repeat)) goto done_or_error; + tmp = PyNumber_Multiply(padding, repeat); + Py_DECREF(repeat); + Py_DECREF(padding); + padding = tmp; + } + if (unlikely(!padding)) goto done_or_error; + } + if (prepend_sign) { + sign = PyUnicode_FromOrdinal('-'); + if (unlikely(!sign)) goto done_or_error; + } + } + uval = PyUnicode_DecodeASCII(chars, clength, NULL); + if (likely(uval) && padding) { + PyObject *tmp = PyNumber_Add(padding, uval); + Py_DECREF(uval); + uval = tmp; + } + if (likely(uval) && sign) { + PyObject *tmp = PyNumber_Add(sign, uval); + Py_DECREF(uval); + uval = tmp; + } +done_or_error: + Py_XDECREF(padding); + Py_XDECREF(sign); + } +#endif + return uval; +} + +/* CIntToPyUnicode */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) { + char digits[sizeof(long)*3+2]; + char *dpos, *end = digits + sizeof(long)*3+2; + const char *hex_digits = DIGITS_HEX; + Py_ssize_t length, ulength; + int prepend_sign, last_one_off; + long remaining; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (format_char == 'X') { + hex_digits += 16; + format_char = 'x'; + } + remaining = value; + last_one_off = 0; + dpos = end; + do { + int digit_pos; + switch (format_char) { + case 'o': + digit_pos = abs((int)(remaining % (8*8))); + remaining = (long) (remaining / (8*8)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); + last_one_off = (digit_pos < 8); + break; + case 'd': + digit_pos = abs((int)(remaining % (10*10))); + remaining = (long) (remaining / (10*10)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); + last_one_off = (digit_pos < 10); + break; + case 'x': + *(--dpos) = hex_digits[abs((int)(remaining % 16))]; + remaining = (long) (remaining / 16); + break; + default: + assert(0); + break; + } + } while (unlikely(remaining != 0)); + assert(!last_one_off || *dpos == '0'); + dpos += last_one_off; + length = end - dpos; + ulength = length; + prepend_sign = 0; + if (!is_unsigned && value <= neg_one) { + if (padding_char == ' ' || width <= length + 1) { + *(--dpos) = '-'; + ++length; + } else { + prepend_sign = 1; + } + ++ulength; + } + if (width > ulength) { + ulength = width; + } + if (ulength == 1) { + return PyUnicode_FromOrdinal(*dpos); + } + return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); +} + +/* PyObjectFormatAndDecref */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { + if (unlikely(!s)) return NULL; + if (likely(PyUnicode_CheckExact(s))) return s; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(s))) { + PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); + Py_DECREF(s); + return result; + } + #endif + return __Pyx_PyObject_FormatAndDecref(s, f); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { + PyObject *result; + if (unlikely(!s)) return NULL; + result = PyObject_Format(s, f); + Py_DECREF(s); + return result; +} + +/* JoinPyUnicode */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char) { +#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyObject *result_uval; + int result_ukind, kind_shift; + Py_ssize_t i, char_pos; + void *result_udata; + CYTHON_MAYBE_UNUSED_VAR(max_char); +#if CYTHON_PEP393_ENABLED + result_uval = PyUnicode_New(result_ulength, max_char); + if (unlikely(!result_uval)) return NULL; + result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; + kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; + result_udata = PyUnicode_DATA(result_uval); +#else + result_uval = PyUnicode_FromUnicode(NULL, result_ulength); + if (unlikely(!result_uval)) return NULL; + result_ukind = sizeof(Py_UNICODE); + kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; + result_udata = PyUnicode_AS_UNICODE(result_uval); +#endif + assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + char_pos = 0; + for (i=0; i < value_count; i++) { + int ukind; + Py_ssize_t ulength; + void *udata; + PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); + if (unlikely(__Pyx_PyUnicode_READY(uval))) + goto bad; + ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + if (unlikely(!ulength)) + continue; + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) + goto overflow; + ukind = __Pyx_PyUnicode_KIND(uval); + udata = __Pyx_PyUnicode_DATA(uval); + if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); + } else { + #if PY_VERSION_HEX >= 0x030d0000 + if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; + #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); + #else + Py_ssize_t j; + for (j=0; j < ulength; j++) { + Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); + __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); + } + #endif + } + char_pos += ulength; + } + return result_uval; +overflow: + PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); +bad: + Py_DECREF(result_uval); + return NULL; +#else + CYTHON_UNUSED_VAR(max_char); + CYTHON_UNUSED_VAR(result_ulength); + CYTHON_UNUSED_VAR(value_count); + return PyUnicode_Join(__pyx_empty_unicode, value_tuple); +#endif +} + +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + __Pyx_PyThreadState_declare + CYTHON_UNUSED_VAR(cause); + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + #if PY_VERSION_HEX >= 0x030C00A6 + PyException_SetTraceback(value, tb); + #elif CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + const char* module_name_str = 0; + PyObject* module_name = 0; + PyObject* module_dot = 0; + PyObject* full_name = 0; + PyErr_Clear(); + module_name_str = PyModule_GetName(module); + if (unlikely(!module_name_str)) { goto modbad; } + module_name = PyUnicode_FromString(module_name_str); + if (unlikely(!module_name)) { goto modbad; } + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); + if (unlikely(!module_dot)) { goto modbad; } + full_name = PyUnicode_Concat(module_dot, name); + if (unlikely(!full_name)) { goto modbad; } + #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + { + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + goto modbad; + value = PyObject_GetItem(modules, full_name); + } + #else + value = PyImport_GetModule(full_name); + #endif + modbad: + Py_XDECREF(full_name); + Py_XDECREF(module_dot); + Py_XDECREF(module_name); + } + if (unlikely(!value)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FixUpExtensionType */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { +#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + CYTHON_UNUSED_VAR(spec); + CYTHON_UNUSED_VAR(type); +#else + const PyType_Slot *slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_members) + slot++; + if (slot && slot->slot == Py_tp_members) { + int changed = 0; +#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) + const +#endif + PyMemberDef *memb = (PyMemberDef*) slot->pfunc; + while (memb && memb->name) { + if (memb->name[0] == '_' && memb->name[1] == '_') { +#if PY_VERSION_HEX < 0x030900b1 + if (strcmp(memb->name, "__weaklistoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_weaklistoffset = memb->offset; + changed = 1; + } + else if (strcmp(memb->name, "__dictoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_dictoffset = memb->offset; + changed = 1; + } +#if CYTHON_METH_FASTCALL + else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); +#if PY_VERSION_HEX >= 0x030800b4 + type->tp_vectorcall_offset = memb->offset; +#else + type->tp_print = (printfunc) memb->offset; +#endif + changed = 1; + } +#endif +#else + if ((0)); +#endif +#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON + else if (strcmp(memb->name, "__module__") == 0) { + PyObject *descr; + assert(memb->type == T_OBJECT); + assert(memb->flags == 0 || memb->flags == READONLY); + descr = PyDescr_NewMember(type, memb); + if (unlikely(!descr)) + return -1; + if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { + Py_DECREF(descr); + return -1; + } + Py_DECREF(descr); + changed = 1; + } +#endif + } + memb++; + } + if (changed) + PyType_Modified(type); + } +#endif + return 0; +} +#endif + +/* FetchSharedCythonModule */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); +} + +/* FetchCommonType */ +static int __Pyx_VerifyCachedType(PyObject *cached_type, + const char *name, + Py_ssize_t basicsize, + Py_ssize_t expected_basicsize) { + if (!PyType_Check(cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", name); + return -1; + } + if (basicsize != expected_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + name); + return -1; + } + return 0; +} +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* abi_module; + const char* object_name; + PyTypeObject *cached_type = NULL; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + object_name = strrchr(type->tp_name, '.'); + object_name = object_name ? object_name+1 : type->tp_name; + cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + if (__Pyx_VerifyCachedType( + (PyObject *)cached_type, + object_name, + cached_type->tp_basicsize, + type->tp_basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; +done: + Py_DECREF(abi_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#else +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { + PyObject *abi_module, *cached_type = NULL; + const char* object_name = strrchr(spec->name, '.'); + object_name = object_name ? object_name+1 : spec->name; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + cached_type = PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + Py_ssize_t basicsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; +#else + basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; +#endif + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + basicsize, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + CYTHON_UNUSED_VAR(module); + cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + if (unlikely(!cached_type)) goto bad; + if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; +done: + Py_DECREF(abi_module); + assert(cached_type == NULL || PyType_Check(cached_type)); + return (PyTypeObject *) cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#endif + +/* PyVectorcallFastCallDict */ +#if CYTHON_METH_FASTCALL +static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + PyObject *res = NULL; + PyObject *kwnames; + PyObject **newargs; + PyObject **kwvalues; + Py_ssize_t i, pos; + size_t j; + PyObject *key, *value; + unsigned long keys_are_strings; + Py_ssize_t nkw = PyDict_GET_SIZE(kw); + newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); + if (unlikely(newargs == NULL)) { + PyErr_NoMemory(); + return NULL; + } + for (j = 0; j < nargs; j++) newargs[j] = args[j]; + kwnames = PyTuple_New(nkw); + if (unlikely(kwnames == NULL)) { + PyMem_Free(newargs); + return NULL; + } + kwvalues = newargs + nargs; + pos = i = 0; + keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; + while (PyDict_Next(kw, &pos, &key, &value)) { + keys_are_strings &= Py_TYPE(key)->tp_flags; + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(kwnames, i, key); + kwvalues[i] = value; + i++; + } + if (unlikely(!keys_are_strings)) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + goto cleanup; + } + res = vc(func, newargs, nargs, kwnames); +cleanup: + Py_DECREF(kwnames); + for (i = 0; i < nkw; i++) + Py_DECREF(kwvalues[i]); + PyMem_Free(newargs); + return res; +} +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + return vc(func, args, nargs, NULL); + } + return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); +} +#endif + +/* CythonFunctionShared */ +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if (__Pyx_CyFunction_Check(func)) { + return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; + } else if (PyCFunction_Check(func)) { + return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; + } + return 0; +} +#else +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +} +#endif +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + __Pyx_Py_XDECREF_SET( + __Pyx_CyFunction_GetClassObj(f), + ((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#else + __Pyx_Py_XDECREF_SET( + ((PyCMethodObject *) (f))->mm_class, + (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#endif +} +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +{ + CYTHON_UNUSED_VAR(closure); + if (unlikely(op->func_doc == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); + if (unlikely(!op->func_doc)) return NULL; +#else + if (((PyCFunctionObject*)op)->m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } +#endif + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_doc, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_name == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_name = PyObject_GetAttrString(op->func, "__name__"); +#elif PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_name, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_qualname, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_dict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(op); + CYTHON_UNUSED_VAR(context); + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + CYTHON_UNUSED_VAR(context); + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_tuple; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_kwdict; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value || value == Py_None) { + value = NULL; + } else if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + __Pyx_Py_XDECREF_SET(op->func_annotations, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->func_annotations; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + int is_coroutine; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; +#if PY_VERSION_HEX >= 0x03050000 + if (is_coroutine) { + PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + fromlist = PyList_New(1); + if (unlikely(!fromlist)) return NULL; + Py_INCREF(marker); +#if CYTHON_ASSUME_SAFE_MACROS + PyList_SET_ITEM(fromlist, 0, marker); +#else + if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { + Py_DECREF(marker); + Py_DECREF(fromlist); + return NULL; + } +#endif + module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + if (unlikely(!module)) goto ignore; + op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + Py_DECREF(module); + if (likely(op->func_is_coroutine)) { + return __Pyx_NewRef(op->func_is_coroutine); + } +ignore: + PyErr_Clear(); + } +#endif + op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); + return __Pyx_NewRef(op->func_is_coroutine); +} +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_GetAttrString(op->func, "__module__"); +} +static int +__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_SetAttrString(op->func, "__module__", value); +} +#endif +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, +#endif + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { +#if !CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#endif +#if CYTHON_USE_TYPE_SPECS + {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#if CYTHON_METH_FASTCALL +#if CYTHON_BACKPORT_VECTORCALL + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#else +#if !CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, +#endif +#endif +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#else + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, +#endif +#endif + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) +{ + CYTHON_UNUSED_VAR(args); +#if PY_MAJOR_VERSION >= 3 + Py_INCREF(m->func_qualname); + return m->func_qualname; +#else + return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { +#if !CYTHON_COMPILING_IN_LIMITED_API + PyCFunctionObject *cf = (PyCFunctionObject*) op; +#endif + if (unlikely(op == NULL)) + return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API + op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); + if (unlikely(!op->func)) return NULL; +#endif + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; +#if !CYTHON_COMPILING_IN_LIMITED_API + cf->m_ml = ml; + cf->m_self = (PyObject *) op; +#endif + Py_XINCREF(closure); + op->func_closure = closure; +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_XINCREF(module); + cf->m_module = module; +#endif + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + op->func_classobj = NULL; +#else + ((PyCMethodObject*)op)->mm_class = NULL; +#endif + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults_size = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + op->func_is_coroutine = NULL; +#if CYTHON_METH_FASTCALL + switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { + case METH_NOARGS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; + break; + case METH_O: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; + break; + case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; + break; + case METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; + break; + case METH_VARARGS | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = NULL; + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + Py_DECREF(op); + return NULL; + } +#endif + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_CLEAR(m->func); +#else + Py_CLEAR(((PyCFunctionObject*)m)->m_module); +#endif + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API +#if PY_VERSION_HEX < 0x030900B1 + Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); +#else + { + PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; + ((PyCMethodObject *) (m))->mm_class = NULL; + Py_XDECREF(cls); + } +#endif +#endif + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + Py_CLEAR(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + __Pyx_PyHeapTypeObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(m->func); +#else + Py_VISIT(((PyCFunctionObject*)m)->m_module); +#endif + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); +#endif + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *f = ((__pyx_CyFunctionObject*)func)->func; + PyObject *py_name = NULL; + PyCFunction meth; + int flags; + meth = PyCFunction_GetFunction(f); + if (unlikely(!meth)) return NULL; + flags = PyCFunction_GetFlags(f); + if (unlikely(flags < 0)) return NULL; +#else + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + int flags = f->m_ml->ml_flags; +#endif + Py_ssize_t size; + switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 0)) + return (*meth)(self, NULL); +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); +#endif + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); +#endif + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + return NULL; + } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", + py_name); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); +#endif + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *self, *result; +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)func)->m_self; +#endif + result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); + return result; +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; +#if CYTHON_METH_FASTCALL + __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); + if (vc) { +#if CYTHON_ASSUME_SAFE_MACROS + return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); +#else + (void) &__Pyx_PyVectorcall_FastCallDict; + return PyVectorcall_Call(func, args, kw); +#endif + } +#endif + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; +#if CYTHON_ASSUME_SAFE_MACROS + argc = PyTuple_GET_SIZE(args); +#else + argc = PyTuple_Size(args); + if (unlikely(!argc) < 0) return NULL; +#endif + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); +#if PY_MAJOR_VERSION > 2 + PyErr_Format(PyExc_TypeError, + "unbound method %.200S() needs an argument", + cyfunc->func_qualname); +#else + PyErr_SetString(PyExc_TypeError, + "unbound method needs an argument"); +#endif + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) +{ + int ret = 0; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + if (unlikely(nargs < 1)) { + PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", + ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + ret = 1; + } + if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + return ret; +} +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 0)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, NULL); +} +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 1)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, args[0]); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; + PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); +} +#endif +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_CyFunctionType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, + {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, + {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, + {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, + {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, + {Py_tp_methods, (void *)__pyx_CyFunction_methods}, + {Py_tp_members, (void *)__pyx_CyFunction_members}, + {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, + {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, + {0, 0}, +}; +static PyType_Spec __pyx_CyFunctionType_spec = { + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + __pyx_CyFunctionType_slots +}; +#else +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, +#if !CYTHON_METH_FASTCALL + 0, +#elif CYTHON_BACKPORT_VECTORCALL + (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), +#else + offsetof(PyCFunctionObject, vectorcall), +#endif + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_PyMethod_New, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_CyFunction_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); +#endif + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + m->defaults_size = size; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, + PyObject *firstlineno, PyObject *name) { + PyObject *replace = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; + replace = PyObject_GetAttrString(code, "replace"); + if (likely(replace)) { + PyObject *result; + result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + Py_DECREF(replace); + return result; + } + PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 + { + PyObject *compiled = NULL, *result = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; + compiled = Py_CompileString( + "out = type(code)(\n" + " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" + " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" + " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" + " code.co_lnotab)\n", "", Py_file_input); + if (!compiled) return NULL; + result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); + Py_DECREF(compiled); + if (!result) PyErr_Print(); + Py_DECREF(result); + result = PyDict_GetItemString(scratch_dict, "out"); + if (result) Py_INCREF(result); + return result; + } + #else + return NULL; + #endif +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; + PyObject *replace = NULL, *getframe = NULL, *frame = NULL; + PyObject *exc_type, *exc_value, *exc_traceback; + int success = 0; + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + getframe = PySys_GetObject("_getframe"); + if (unlikely(!getframe)) goto bad; + if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; + frame = PyEval_EvalCode(code_object, dict, dict); + if (unlikely(!frame) || frame == Py_None) goto bad; + success = 1; + bad: + PyErr_Restore(exc_type, exc_value, exc_traceback); + Py_XDECREF(code_object); + Py_XDECREF(py_py_line); + Py_XDECREF(py_funcname); + Py_XDECREF(dict); + Py_XDECREF(replace); + if (success) { + PyTraceBack_Here( + (struct _frame*)frame); + } + Py_XDECREF(frame); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__4); + } + return name; +} +#endif + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030B00A4 + return Py_Version & ~0xFFUL; +#else + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + return version; +#endif +} +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { + const unsigned long MAJOR_MINOR = 0xFFFF0000UL; + if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) + return 0; + if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) + return 1; + { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compile time Python version %d.%d " + "of module '%.100s' " + "%s " + "runtime version %d.%d", + (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), + __Pyx_MODULE_NAME, + (allow_newer) ? "was newer than" : "does not match", + (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) + ); + return PyErr_WarnEx(NULL, message, 1); + } +} + +/* InitStrings */ +#if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +#include +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { + size_t len = strlen(s); + if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, "byte string is too long"); + return -1; + } + return (Py_ssize_t) len; +} +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return __Pyx_PyUnicode_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return PyByteArray_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/w3lib/_rfc5892.py b/w3lib/_rfc5892.pyx similarity index 100% rename from w3lib/_rfc5892.py rename to w3lib/_rfc5892.pyx diff --git a/w3lib/_types.c b/w3lib/_types.c new file mode 100644 index 00000000..36dad1b6 --- /dev/null +++ b/w3lib/_types.c @@ -0,0 +1,4773 @@ +/* Generated by Cython 3.0.8 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "name": "w3lib._types", + "sources": [ + "w3lib/_types.pyx" + ] + }, + "module_name": "w3lib._types" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API +#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#else +#define __PYX_EXTRA_ABI_MODULE_NAME "" +#endif +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030008F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #ifdef Py_LIMITED_API + #undef __PYX_LIMITED_VERSION_HEX + #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API + #endif + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_USE_CPP_STD_MOVE + #if defined(__cplusplus) && (\ + __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) + #define CYTHON_USE_CPP_STD_MOVE 1 + #else + #define CYTHON_USE_CPP_STD_MOVE 0 + #endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #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 +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if CYTHON_COMPILING_IN_LIMITED_API + static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } + #ifndef CO_OPTIMIZED + #define CO_OPTIMIZED 0x0001 + #endif + #ifndef CO_NEWLOCALS + #define CO_NEWLOCALS 0x0002 + #endif + #ifndef CO_VARARGS + #define CO_VARARGS 0x0004 + #endif + #ifndef CO_VARKEYWORDS + #define CO_VARKEYWORDS 0x0008 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x0200 + #endif + #ifndef CO_GENERATOR + #define CO_GENERATOR 0x0020 + #endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x0080 + #endif +#elif PY_VERSION_HEX >= 0x030B0000 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); + if (!empty_bytes) return NULL; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); + Py_DECREF(empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_MAJOR_VERSION >= 0x030900B1 +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) +#else +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) +#endif +#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) +#elif !CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) +static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { + return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; +} +#endif +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API + return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; +#else + return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +#endif +} +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) +#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) +#else + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) +#endif +#if PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__w3lib___types +#define __PYX_HAVE_API__w3lib___types +/* Early includes */ +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#include +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#include +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "w3lib/_types.pyx", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* #### Code section: numeric_typedefs ### */ +/* #### Code section: complex_type_declarations ### */ +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#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 + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* IncludeStringH.proto */ +#include + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#if !CYTHON_VECTORCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if !CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03080000 + #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #define __Pxy_PyFrame_Initialize_Offsets() + #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) +#else + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif +#endif +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectFastCall.proto */ +#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* CLineInTraceback.proto */ +#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 */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static unsigned long __Pyx_get_runtime_version(void); +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ + +/* Module declarations from "w3lib._types" */ +/* #### Code section: typeinfo ### */ +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "w3lib._types" +extern int __pyx_module_is_main_w3lib___types; +int __pyx_module_is_main_w3lib___types = 0; + +/* Implementation of "w3lib._types" */ +/* #### Code section: global_var ### */ +static PyObject *__pyx_builtin_UnicodeEncodeError; +static PyObject *__pyx_builtin_UnicodeDecodeError; +/* #### Code section: string_decls ### */ +static const char __pyx_k_[] = "."; +static const char __pyx_k__3[] = "?"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_Union[] = "Union"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_typing[] = "typing"; +static const char __pyx_k_StrOrBytes[] = "StrOrBytes"; +static const char __pyx_k_class_getitem[] = "__class_getitem__"; +static const char __pyx_k_AnyUnicodeError[] = "AnyUnicodeError"; +static const char __pyx_k_UnicodeDecodeError[] = "UnicodeDecodeError"; +static const char __pyx_k_UnicodeEncodeError[] = "UnicodeEncodeError"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +/* #### Code section: decls ### */ +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + #endif + PyObject *__pyx_kp_u_; + PyObject *__pyx_n_s_AnyUnicodeError; + PyObject *__pyx_n_s_StrOrBytes; + PyObject *__pyx_n_s_UnicodeDecodeError; + PyObject *__pyx_n_s_UnicodeEncodeError; + PyObject *__pyx_n_s_Union; + PyObject *__pyx_n_s__3; + PyObject *__pyx_n_s_class_getitem; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_import; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_typing; + PyObject *__pyx_tuple__2; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_kp_u_); + Py_CLEAR(clear_module_state->__pyx_n_s_AnyUnicodeError); + Py_CLEAR(clear_module_state->__pyx_n_s_StrOrBytes); + Py_CLEAR(clear_module_state->__pyx_n_s_UnicodeDecodeError); + Py_CLEAR(clear_module_state->__pyx_n_s_UnicodeEncodeError); + Py_CLEAR(clear_module_state->__pyx_n_s_Union); + Py_CLEAR(clear_module_state->__pyx_n_s__3); + Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_typing); + Py_CLEAR(clear_module_state->__pyx_tuple__2); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_kp_u_); + Py_VISIT(traverse_module_state->__pyx_n_s_AnyUnicodeError); + Py_VISIT(traverse_module_state->__pyx_n_s_StrOrBytes); + Py_VISIT(traverse_module_state->__pyx_n_s_UnicodeDecodeError); + Py_VISIT(traverse_module_state->__pyx_n_s_UnicodeEncodeError); + Py_VISIT(traverse_module_state->__pyx_n_s_Union); + Py_VISIT(traverse_module_state->__pyx_n_s__3); + Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_typing); + Py_VISIT(traverse_module_state->__pyx_tuple__2); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ +#define __pyx_n_s_AnyUnicodeError __pyx_mstate_global->__pyx_n_s_AnyUnicodeError +#define __pyx_n_s_StrOrBytes __pyx_mstate_global->__pyx_n_s_StrOrBytes +#define __pyx_n_s_UnicodeDecodeError __pyx_mstate_global->__pyx_n_s_UnicodeDecodeError +#define __pyx_n_s_UnicodeEncodeError __pyx_mstate_global->__pyx_n_s_UnicodeEncodeError +#define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union +#define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3 +#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing +#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 +/* #### Code section: module_code ### */ + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, + {&__pyx_n_s_AnyUnicodeError, __pyx_k_AnyUnicodeError, sizeof(__pyx_k_AnyUnicodeError), 0, 0, 1, 1}, + {&__pyx_n_s_StrOrBytes, __pyx_k_StrOrBytes, sizeof(__pyx_k_StrOrBytes), 0, 0, 1, 1}, + {&__pyx_n_s_UnicodeDecodeError, __pyx_k_UnicodeDecodeError, sizeof(__pyx_k_UnicodeDecodeError), 0, 0, 1, 1}, + {&__pyx_n_s_UnicodeEncodeError, __pyx_k_UnicodeEncodeError, sizeof(__pyx_k_UnicodeEncodeError), 0, 0, 1, 1}, + {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, + {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1}, + {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_UnicodeEncodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeEncodeError); if (!__pyx_builtin_UnicodeEncodeError) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) __PYX_ERR(0, 4, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "w3lib/_types.pyx":4 + * + * # the base class UnicodeError doesn't have attributes like start / end + * AnyUnicodeError = Union[UnicodeEncodeError, UnicodeDecodeError] # <<<<<<<<<<<<<< + * StrOrBytes = Union[str, bytes] + */ + __pyx_tuple__2 = PyTuple_Pack(2, __pyx_builtin_UnicodeEncodeError, __pyx_builtin_UnicodeDecodeError); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + return 0; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__types(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__types}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "_types", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_types(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_types(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__types(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__types(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__types(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_types' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_types", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_types" pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__types(void)", 0); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_w3lib___types) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "w3lib._types")) { + if (unlikely((PyDict_SetItemString(modules, "w3lib._types", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + (void)__Pyx_modinit_type_init_code(); + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "w3lib/_types.pyx":1 + * from typing import Union # <<<<<<<<<<<<<< + * + * # the base class UnicodeError doesn't have attributes like start / end + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_Union); + __Pyx_GIVEREF(__pyx_n_s_Union); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Union)) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_types.pyx":4 + * + * # the base class UnicodeError doesn't have attributes like start / end + * AnyUnicodeError = Union[UnicodeEncodeError, UnicodeDecodeError] # <<<<<<<<<<<<<< + * StrOrBytes = Union[str, bytes] + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_tuple__2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_AnyUnicodeError, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_types.pyx":5 + * # the base class UnicodeError doesn't have attributes like start / end + * AnyUnicodeError = Union[UnicodeEncodeError, UnicodeDecodeError] + * StrOrBytes = Union[str, bytes] # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); + __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 5, __pyx_L1_error); + __Pyx_INCREF((PyObject *)(&PyBytes_Type)); + __Pyx_GIVEREF((PyObject *)(&PyBytes_Type)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 5, __pyx_L1_error); + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_StrOrBytes, __pyx_t_4) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_types.pyx":1 + * from typing import Union # <<<<<<<<<<<<<< + * + * # the base class UnicodeError doesn't have attributes like start / end + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init w3lib._types", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init w3lib._types"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +#endif +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + const char* module_name_str = 0; + PyObject* module_name = 0; + PyObject* module_dot = 0; + PyObject* full_name = 0; + PyErr_Clear(); + module_name_str = PyModule_GetName(module); + if (unlikely(!module_name_str)) { goto modbad; } + module_name = PyUnicode_FromString(module_name_str); + if (unlikely(!module_name)) { goto modbad; } + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); + if (unlikely(!module_dot)) { goto modbad; } + full_name = PyUnicode_Concat(module_dot, name); + if (unlikely(!full_name)) { goto modbad; } + #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + { + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + goto modbad; + value = PyObject_GetItem(modules, full_name); + } + #else + value = PyImport_GetModule(full_name); + #endif + modbad: + Py_XDECREF(full_name); + Py_XDECREF(module_dot); + Py_XDECREF(module_name); + } + if (unlikely(!value)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (unlikely(!j)) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (mm && mm->mp_subscript) { + PyObject *r, *key = PyInt_FromSsize_t(i); + if (unlikely(!key)) return NULL; + r = mm->mp_subscript(o, key); + Py_DECREF(key); + return r; + } + if (likely(sm && sm->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return sm->sq_item(o, i); + } + } +#else + if (is_list || !PyMapping_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { + return NULL; + } + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { + return NULL; + } + #endif + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectFastCall */ +#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result = 0; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: + Py_DECREF(argstuple); + return result; +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); + } + else if (nargs == 1 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); + } +#endif + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); + } + } + #if PY_VERSION_HEX >= 0x030700A1 + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + if (kwargs == NULL) { + #if CYTHON_VECTORCALL + #if PY_VERSION_HEX < 0x03090000 + vectorcallfunc f = _PyVectorcall_Function(func); + #else + vectorcallfunc f = PyVectorcall_Function(func); + #endif + if (f) { + return f(func, args, (size_t)nargs, NULL); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, NULL); + } + #endif + } + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + } + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif +} + +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { + PyObject *runerr = NULL; + Py_ssize_t key_value; + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, + "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); + __Pyx_DECREF_TypeName(index_type_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { + __Pyx_TypeName obj_type_name; + if (likely(PyType_Check(obj))) { + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); + if (!meth) { + PyErr_Clear(); + } else { + PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); + Py_DECREF(meth); + return result; + } + } + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { + PyTypeObject *tp = Py_TYPE(obj); + PyMappingMethods *mm = tp->tp_as_mapping; + PySequenceMethods *sm = tp->tp_as_sequence; + if (likely(mm && mm->mp_subscript)) { + return mm->mp_subscript(obj, key); + } + if (likely(sm && sm->sq_item)) { + return __Pyx_PyObject_GetIndex(obj, key); + } + return __Pyx_PyObject_GetItem_Slow(obj, key); +} +#endif + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, + PyObject *firstlineno, PyObject *name) { + PyObject *replace = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; + replace = PyObject_GetAttrString(code, "replace"); + if (likely(replace)) { + PyObject *result; + result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + Py_DECREF(replace); + return result; + } + PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 + { + PyObject *compiled = NULL, *result = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; + compiled = Py_CompileString( + "out = type(code)(\n" + " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" + " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" + " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" + " code.co_lnotab)\n", "", Py_file_input); + if (!compiled) return NULL; + result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); + Py_DECREF(compiled); + if (!result) PyErr_Print(); + Py_DECREF(result); + result = PyDict_GetItemString(scratch_dict, "out"); + if (result) Py_INCREF(result); + return result; + } + #else + return NULL; + #endif +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; + PyObject *replace = NULL, *getframe = NULL, *frame = NULL; + PyObject *exc_type, *exc_value, *exc_traceback; + int success = 0; + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + getframe = PySys_GetObject("_getframe"); + if (unlikely(!getframe)) goto bad; + if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; + frame = PyEval_EvalCode(code_object, dict, dict); + if (unlikely(!frame) || frame == Py_None) goto bad; + success = 1; + bad: + PyErr_Restore(exc_type, exc_value, exc_traceback); + Py_XDECREF(code_object); + Py_XDECREF(py_py_line); + Py_XDECREF(py_funcname); + Py_XDECREF(dict); + Py_XDECREF(replace); + if (success) { + PyTraceBack_Here( + (struct _frame*)frame); + } + Py_XDECREF(frame); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__3); + } + return name; +} +#endif + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030B00A4 + return Py_Version & ~0xFFUL; +#else + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + return version; +#endif +} +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { + const unsigned long MAJOR_MINOR = 0xFFFF0000UL; + if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) + return 0; + if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) + return 1; + { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compile time Python version %d.%d " + "of module '%.100s' " + "%s " + "runtime version %d.%d", + (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), + __Pyx_MODULE_NAME, + (allow_newer) ? "was newer than" : "does not match", + (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) + ); + return PyErr_WarnEx(NULL, message, 1); + } +} + +/* InitStrings */ +#if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +#include +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { + size_t len = strlen(s); + if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, "byte string is too long"); + return -1; + } + return (Py_ssize_t) len; +} +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return __Pyx_PyUnicode_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return PyByteArray_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/w3lib/_types.py b/w3lib/_types.pyx similarity index 100% rename from w3lib/_types.py rename to w3lib/_types.pyx diff --git a/w3lib/_url.c b/w3lib/_url.c index b2216d84..c83e476d 100644 --- a/w3lib/_url.c +++ b/w3lib/_url.c @@ -1491,7 +1491,7 @@ struct __pyx_defaults1 { PyObject *__pyx_arg_min_length; }; -/* "w3lib/_url.pyx":309 +/* "w3lib/_url.pyx":308 * parts = parts[:-1] * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< @@ -1505,7 +1505,7 @@ struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr { }; -/* "w3lib/_url.pyx":329 +/* "w3lib/_url.pyx":328 * result = _parse_ipv4_number(part) * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< @@ -4514,7 +4514,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_codeobj__81 __pyx_mstate_global->__pyx_codeobj__81 /* #### Code section: module_code ### */ -/* "w3lib/_url.pyx":95 +/* "w3lib/_url.pyx":94 * _path_token_seen: bool = False * * def __init__(self) -> None: # <<<<<<<<<<<<<< @@ -4530,7 +4530,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_4_URL___init__, "_URL.__init__(self) -> None"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_4_URL___init__}; static PyObject *__pyx_pw_5w3lib_4_url_4_URL_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4575,12 +4576,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 95, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 94, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -4591,7 +4592,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 95, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 94, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4627,28 +4628,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "w3lib/_url.pyx":96 + /* "w3lib/_url.pyx":95 * * def __init__(self) -> None: * self.path = [] # <<<<<<<<<<<<<< * self.is_special = False * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":97 + /* "w3lib/_url.pyx":96 * def __init__(self) -> None: * self.path = [] * self.is_special = False # <<<<<<<<<<<<<< * * def has_opaque_path(self) -> bool: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, Py_False) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, Py_False) < 0) __PYX_ERR(0, 96, __pyx_L1_error) - /* "w3lib/_url.pyx":95 + /* "w3lib/_url.pyx":94 * _path_token_seen: bool = False * * def __init__(self) -> None: # <<<<<<<<<<<<<< @@ -4669,7 +4670,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "w3lib/_url.pyx":99 +/* "w3lib/_url.pyx":98 * self.is_special = False * * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< @@ -4685,7 +4686,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_3has_opaque_path = {"has_opaque_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_4_URL_2has_opaque_path, "_URL.has_opaque_path(self) -> bool"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_3has_opaque_path = {"has_opaque_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_4_URL_2has_opaque_path}; static PyObject *__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4730,12 +4732,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "has_opaque_path") < 0)) __PYX_ERR(0, 99, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "has_opaque_path") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -4746,7 +4748,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("has_opaque_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 99, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("has_opaque_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 98, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4783,7 +4785,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(CYTHON_UNUSED PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_opaque_path", 1); - /* "w3lib/_url.pyx":100 + /* "w3lib/_url.pyx":99 * * def has_opaque_path(self) -> bool: * return isinstance(self.path, str) # <<<<<<<<<<<<<< @@ -4791,17 +4793,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(CYTHON_UNUSED PyOb * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyUnicode_Check(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":99 + /* "w3lib/_url.pyx":98 * self.is_special = False * * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< @@ -4820,7 +4822,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(CYTHON_UNUSED PyOb return __pyx_r; } -/* "w3lib/_url.pyx":102 +/* "w3lib/_url.pyx":101 * return isinstance(self.path, str) * * @property # <<<<<<<<<<<<<< @@ -4836,7 +4838,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_5scheme = {"scheme", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_5scheme, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_4_URL_4scheme, "_URL.scheme(self) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_5scheme = {"scheme", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_5scheme, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_4_URL_4scheme}; static PyObject *__pyx_pw_5w3lib_4_url_4_URL_5scheme(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4881,12 +4884,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 102, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 101, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -4897,7 +4900,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scheme", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 102, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scheme", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 101, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4933,7 +4936,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_4scheme(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scheme", 1); - /* "w3lib/_url.pyx":104 + /* "w3lib/_url.pyx":103 * @property * def scheme(self) -> str: * return self._scheme # <<<<<<<<<<<<<< @@ -4941,14 +4944,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_4scheme(CYTHON_UNUSED PyObject *__p * @scheme.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 104, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 103, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":102 + /* "w3lib/_url.pyx":101 * return isinstance(self.path, str) * * @property # <<<<<<<<<<<<<< @@ -4967,7 +4970,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_4scheme(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":106 +/* "w3lib/_url.pyx":105 * return self._scheme * * @scheme.setter # <<<<<<<<<<<<<< @@ -4983,7 +4986,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_7scheme = {"scheme", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_7scheme, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_4_URL_6scheme, "_URL.scheme(self, unicode value: str) -> None"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_7scheme = {"scheme", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_7scheme, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_4_URL_6scheme}; static PyObject *__pyx_pw_5w3lib_4_url_4_URL_7scheme(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -5031,7 +5035,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -5039,14 +5043,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, 1); __PYX_ERR(0, 106, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, 1); __PYX_ERR(0, 105, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 106, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 105, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -5059,7 +5063,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 106, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 105, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5073,7 +5077,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyUnicode_Type), 0, "value", 1))) __PYX_ERR(0, 107, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyUnicode_Type), 0, "value", 1))) __PYX_ERR(0, 106, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_4_URL_6scheme(__pyx_self, __pyx_v_self, __pyx_v_value); /* function exit code */ @@ -5101,32 +5105,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_6scheme(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scheme", 1); - /* "w3lib/_url.pyx":108 + /* "w3lib/_url.pyx":107 * @scheme.setter * def scheme(self, value: str) -> None: * self._scheme = value # <<<<<<<<<<<<<< * self.is_special = value in _SPECIAL_SCHEMES * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scheme, __pyx_v_value) < 0) __PYX_ERR(0, 108, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scheme, __pyx_v_value) < 0) __PYX_ERR(0, 107, __pyx_L1_error) - /* "w3lib/_url.pyx":109 + /* "w3lib/_url.pyx":108 * def scheme(self, value: str) -> None: * self._scheme = value * self.is_special = value in _SPECIAL_SCHEMES # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, __pyx_t_1) < 0) __PYX_ERR(0, 109, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, __pyx_t_1) < 0) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":106 + /* "w3lib/_url.pyx":105 * return self._scheme * * @scheme.setter # <<<<<<<<<<<<<< @@ -5147,7 +5151,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_6scheme(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":116 +/* "w3lib/_url.pyx":115 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< @@ -5163,7 +5167,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_1_shorten_path = {"_shorten_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_1_shorten_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url__shorten_path, "_shorten_path(url: _URL) -> None"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_1_shorten_path = {"_shorten_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_1_shorten_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url__shorten_path}; static PyObject *__pyx_pw_5w3lib_4_url_1_shorten_path(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -5208,12 +5213,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_shorten_path") < 0)) __PYX_ERR(0, 116, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_shorten_path") < 0)) __PYX_ERR(0, 115, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -5224,7 +5229,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_shorten_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 116, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_shorten_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 115, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5268,44 +5273,44 @@ static PyObject *__pyx_pf_5w3lib_4_url__shorten_path(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_shorten_path", 1); - /* "w3lib/_url.pyx":117 + /* "w3lib/_url.pyx":116 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path * def _shorten_path(url: _URL) -> None: * path = url.path # <<<<<<<<<<<<<< * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): * return */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_path = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":118 + /* "w3lib/_url.pyx":117 * def _shorten_path(url: _URL) -> None: * path = url.path * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): # <<<<<<<<<<<<<< * return * url.path = path[:-1] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = PyObject_Length(__pyx_v_path); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_4 = PyObject_Length(__pyx_v_path); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 117, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 == 1); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -5326,17 +5331,17 @@ static PyObject *__pyx_pf_5w3lib_4_url__shorten_path(CYTHON_UNUSED PyObject *__p __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":119 + /* "w3lib/_url.pyx":118 * path = url.path * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): * return # <<<<<<<<<<<<<< @@ -5347,7 +5352,7 @@ static PyObject *__pyx_pf_5w3lib_4_url__shorten_path(CYTHON_UNUSED PyObject *__p __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "w3lib/_url.pyx":118 + /* "w3lib/_url.pyx":117 * def _shorten_path(url: _URL) -> None: * path = url.path * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): # <<<<<<<<<<<<<< @@ -5356,19 +5361,19 @@ static PyObject *__pyx_pf_5w3lib_4_url__shorten_path(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":120 + /* "w3lib/_url.pyx":119 * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): * return * url.path = path[:-1] # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 120, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":116 + /* "w3lib/_url.pyx":115 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< @@ -5393,7 +5398,7 @@ static PyObject *__pyx_pf_5w3lib_4_url__shorten_path(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":125 +/* "w3lib/_url.pyx":124 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< @@ -5409,7 +5414,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_3_percent_encode_after_encoding = {"_percent_encode_after_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_3_percent_encode_after_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_2_percent_encode_after_encoding, "_percent_encode_after_encoding(unicode input: str, *, unicode encoding: str, percent_encode_set: _PercentEncodeSet, space_as_plus: bool = False) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_3_percent_encode_after_encoding = {"_percent_encode_after_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_3_percent_encode_after_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_2_percent_encode_after_encoding}; static PyObject *__pyx_pw_5w3lib_4_url_3_percent_encode_after_encoding(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -5443,7 +5449,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_encoding,&__pyx_n_s_percent_encode_set,&__pyx_n_s_space_as_plus,0}; - /* "w3lib/_url.pyx":130 + /* "w3lib/_url.pyx":129 * encoding: str, * percent_encode_set: _PercentEncodeSet, * space_as_plus: bool = False, # <<<<<<<<<<<<<< @@ -5466,7 +5472,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -5474,33 +5480,33 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L3_error) else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 125, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 124, __pyx_L3_error) } if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_percent_encode_set)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L3_error) else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_percent_encode_set); __PYX_ERR(0, 125, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_percent_encode_set); __PYX_ERR(0, 124, __pyx_L3_error) } } if (kw_args == 1) { const Py_ssize_t index = 3; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_percent_encode_after_encoding") < 0)) __PYX_ERR(0, 125, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_percent_encode_after_encoding") < 0)) __PYX_ERR(0, 124, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 125, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 124, __pyx_L3_error) } __pyx_v_input = ((PyObject*)values[0]); __pyx_v_encoding = ((PyObject*)values[1]); @@ -5509,7 +5515,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_percent_encode_after_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 125, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_percent_encode_after_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 124, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5523,11 +5529,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 126, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 128, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 125, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 127, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(__pyx_self, __pyx_v_input, __pyx_v_encoding, __pyx_v_percent_encode_set, __pyx_v_space_as_plus); - /* "w3lib/_url.pyx":125 + /* "w3lib/_url.pyx":124 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< @@ -5576,14 +5582,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_percent_encode_after_encoding", 1); - /* "w3lib/_url.pyx":132 + /* "w3lib/_url.pyx":131 * space_as_plus: bool = False, * ) -> str: * encoder = _get_encoder(encoding) # <<<<<<<<<<<<<< * output = "" * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -5603,14 +5609,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_encoder = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":133 + /* "w3lib/_url.pyx":132 * ) -> str: * encoder = _get_encoder(encoding) * output = "" # <<<<<<<<<<<<<< @@ -5620,7 +5626,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN __Pyx_INCREF(__pyx_kp_u__2); __pyx_v_output = __pyx_kp_u__2; - /* "w3lib/_url.pyx":136 + /* "w3lib/_url.pyx":135 * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B * # instead of &#NNN; * encode_output, _ = encoder(input, "xmlcharrefreplace") # <<<<<<<<<<<<<< @@ -5646,7 +5652,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_input, __pyx_n_u_xmlcharrefreplace}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -5656,7 +5662,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 136, __pyx_L1_error) + __PYX_ERR(0, 135, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -5669,15 +5675,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); @@ -5685,7 +5691,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 135, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; @@ -5693,7 +5699,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 136, __pyx_L1_error) + __PYX_ERR(0, 135, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_encode_output = __pyx_t_2; @@ -5701,17 +5707,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN __pyx_v__ = __pyx_t_3; __pyx_t_3 = 0; - /* "w3lib/_url.pyx":137 + /* "w3lib/_url.pyx":136 * # instead of &#NNN; * encode_output, _ = encoder(input, "xmlcharrefreplace") * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< * byte = encode_output[i] * if space_as_plus and byte == 0x20: */ - __pyx_t_7 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 137, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -5719,9 +5725,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -5730,28 +5736,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 137, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 136, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 137, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 136, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -5761,7 +5767,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 137, __pyx_L1_error) + else __PYX_ERR(0, 136, __pyx_L1_error) } break; } @@ -5770,49 +5776,49 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":138 + /* "w3lib/_url.pyx":137 * encode_output, _ = encoder(input, "xmlcharrefreplace") * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate * byte = encode_output[i] # <<<<<<<<<<<<<< * if space_as_plus and byte == 0x20: * output += "+" */ - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_byte, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":139 + /* "w3lib/_url.pyx":138 * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate * byte = encode_output[i] * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< * output += "+" * continue */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_space_as_plus); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_space_as_plus); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 138, __pyx_L1_error) if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L8_bool_binop_done; } - __pyx_t_10 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_byte, __pyx_int_32, 0x20, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_byte, __pyx_int_32, 0x20, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 138, __pyx_L1_error) __pyx_t_9 = __pyx_t_10; __pyx_L8_bool_binop_done:; if (__pyx_t_9) { - /* "w3lib/_url.pyx":140 + /* "w3lib/_url.pyx":139 * byte = encode_output[i] * if space_as_plus and byte == 0x20: * output += "+" # <<<<<<<<<<<<<< * continue * isomorph = chr(byte) */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":141 + /* "w3lib/_url.pyx":140 * if space_as_plus and byte == 0x20: * output += "+" * continue # <<<<<<<<<<<<<< @@ -5821,7 +5827,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN */ goto __pyx_L5_continue; - /* "w3lib/_url.pyx":139 + /* "w3lib/_url.pyx":138 * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate * byte = encode_output[i] * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< @@ -5830,41 +5836,41 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN */ } - /* "w3lib/_url.pyx":142 + /* "w3lib/_url.pyx":141 * output += "+" * continue * isomorph = chr(byte) # <<<<<<<<<<<<<< * if isomorph not in percent_encode_set: * output += isomorph */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_isomorph, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":143 + /* "w3lib/_url.pyx":142 * continue * isomorph = chr(byte) * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< * output += isomorph * elif isomorph == "%": */ - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_isomorph, __pyx_v_percent_encode_set, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_isomorph, __pyx_v_percent_encode_set, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 142, __pyx_L1_error) if (__pyx_t_9) { - /* "w3lib/_url.pyx":144 + /* "w3lib/_url.pyx":143 * isomorph = chr(byte) * if isomorph not in percent_encode_set: * output += isomorph # <<<<<<<<<<<<<< * elif isomorph == "%": * if ( */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_v_isomorph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_v_isomorph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":143 + /* "w3lib/_url.pyx":142 * continue * isomorph = chr(byte) * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< @@ -5874,32 +5880,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN goto __pyx_L10; } - /* "w3lib/_url.pyx":145 + /* "w3lib/_url.pyx":144 * if isomorph not in percent_encode_set: * output += isomorph * elif isomorph == "%": # <<<<<<<<<<<<<< * if ( * len(encode_output) <= i + 2 */ - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_isomorph, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_isomorph, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 144, __pyx_L1_error) if (__pyx_t_9) { - /* "w3lib/_url.pyx":147 + /* "w3lib/_url.pyx":146 * elif isomorph == "%": * if ( * len(encode_output) <= i + 2 # <<<<<<<<<<<<<< * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT */ - __pyx_t_11 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 147, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_11 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_10) { } else { @@ -5907,24 +5913,24 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN goto __pyx_L12_bool_binop_done; } - /* "w3lib/_url.pyx":148 + /* "w3lib/_url.pyx":147 * if ( * len(encode_output) <= i + 2 * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT * ): */ - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_10) { @@ -5933,30 +5939,30 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN goto __pyx_L12_bool_binop_done; } - /* "w3lib/_url.pyx":149 + /* "w3lib/_url.pyx":148 * len(encode_output) <= i + 2 * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * ): * output += "%25" */ - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L12_bool_binop_done:; - /* "w3lib/_url.pyx":146 + /* "w3lib/_url.pyx":145 * output += isomorph * elif isomorph == "%": * if ( # <<<<<<<<<<<<<< @@ -5965,19 +5971,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN */ if (__pyx_t_9) { - /* "w3lib/_url.pyx":151 + /* "w3lib/_url.pyx":150 * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT * ): * output += "%25" # <<<<<<<<<<<<<< * else: * output += "%" */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u_25); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u_25); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":146 + /* "w3lib/_url.pyx":145 * output += isomorph * elif isomorph == "%": * if ( # <<<<<<<<<<<<<< @@ -5987,7 +5993,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN goto __pyx_L11; } - /* "w3lib/_url.pyx":153 + /* "w3lib/_url.pyx":152 * output += "%25" * else: * output += "%" # <<<<<<<<<<<<<< @@ -5995,14 +6001,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN * output += f"%{byte:02X}" */ /*else*/ { - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; } __pyx_L11:; - /* "w3lib/_url.pyx":145 + /* "w3lib/_url.pyx":144 * if isomorph not in percent_encode_set: * output += isomorph * elif isomorph == "%": # <<<<<<<<<<<<<< @@ -6012,7 +6018,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN goto __pyx_L10; } - /* "w3lib/_url.pyx":155 + /* "w3lib/_url.pyx":154 * output += "%" * else: * output += f"%{byte:02X}" # <<<<<<<<<<<<<< @@ -6020,12 +6026,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN * return output */ /*else*/ { - __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_byte, __pyx_kp_u_02X); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_byte, __pyx_kp_u_02X); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); @@ -6033,7 +6039,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN } __pyx_L10:; - /* "w3lib/_url.pyx":137 + /* "w3lib/_url.pyx":136 * # instead of &#NNN; * encode_output, _ = encoder(input, "xmlcharrefreplace") * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< @@ -6044,7 +6050,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":157 + /* "w3lib/_url.pyx":156 * output += f"%{byte:02X}" * * return output # <<<<<<<<<<<<<< @@ -6052,12 +6058,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 157, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_INCREF(__pyx_v_output); __pyx_r = ((PyObject*)__pyx_v_output); goto __pyx_L0; - /* "w3lib/_url.pyx":125 + /* "w3lib/_url.pyx":124 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< @@ -6086,7 +6092,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UN return __pyx_r; } -/* "w3lib/_url.pyx":175 +/* "w3lib/_url.pyx":174 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< @@ -6102,7 +6108,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_5_parse_ipv6 = {"_parse_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_5_parse_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_4_parse_ipv6, "_parse_ipv6(unicode input: str) -> List[int]"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_5_parse_ipv6 = {"_parse_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_5_parse_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_4_parse_ipv6}; static PyObject *__pyx_pw_5w3lib_4_url_5_parse_ipv6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -6147,12 +6154,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv6") < 0)) __PYX_ERR(0, 175, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv6") < 0)) __PYX_ERR(0, 174, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -6163,7 +6170,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 175, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 174, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6177,7 +6184,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 175, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 174, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_4_parse_ipv6(__pyx_self, __pyx_v_input); /* function exit code */ @@ -6221,26 +6228,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_ipv6", 1); - /* "w3lib/_url.pyx":176 + /* "w3lib/_url.pyx":175 * * def _parse_ipv6(input: str) -> List[int]: * address = [0] * 8 # <<<<<<<<<<<<<< * piece_index = 0 * compress = None */ - __pyx_t_1 = PyList_New(1 * 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < 8; __pyx_temp++) { __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0)) __PYX_ERR(0, 176, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0)) __PYX_ERR(0, 175, __pyx_L1_error); } } __pyx_v_address = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":177 + /* "w3lib/_url.pyx":176 * def _parse_ipv6(input: str) -> List[int]: * address = [0] * 8 * piece_index = 0 # <<<<<<<<<<<<<< @@ -6250,7 +6257,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_int_0); __pyx_v_piece_index = __pyx_int_0; - /* "w3lib/_url.pyx":178 + /* "w3lib/_url.pyx":177 * address = [0] * 8 * piece_index = 0 * compress = None # <<<<<<<<<<<<<< @@ -6260,7 +6267,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(Py_None); __pyx_v_compress = Py_None; - /* "w3lib/_url.pyx":179 + /* "w3lib/_url.pyx":178 * piece_index = 0 * compress = None * pointer = 0 # <<<<<<<<<<<<<< @@ -6270,75 +6277,75 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_int_0); __pyx_v_pointer = __pyx_int_0; - /* "w3lib/_url.pyx":180 + /* "w3lib/_url.pyx":179 * compress = None * pointer = 0 * input_lenght = len(input) # <<<<<<<<<<<<<< * if pointer < input_lenght and input[pointer] == ":": * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": */ - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 179, __pyx_L1_error) __pyx_v_input_lenght = __pyx_t_2; - /* "w3lib/_url.pyx":181 + /* "w3lib/_url.pyx":180 * pointer = 0 * input_lenght = len(input) * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": * raise ValueError */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":182 + /* "w3lib/_url.pyx":181 * input_lenght = len(input) * if pointer < input_lenght and input[pointer] == ":": * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": # <<<<<<<<<<<<<< * raise ValueError * pointer += 2 */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L7_bool_binop_done; } - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L7_bool_binop_done:; if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":183 + /* "w3lib/_url.pyx":182 * if pointer < input_lenght and input[pointer] == ":": * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": * raise ValueError # <<<<<<<<<<<<<< @@ -6346,9 +6353,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * piece_index += 1 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 183, __pyx_L1_error) + __PYX_ERR(0, 182, __pyx_L1_error) - /* "w3lib/_url.pyx":182 + /* "w3lib/_url.pyx":181 * input_lenght = len(input) * if pointer < input_lenght and input[pointer] == ":": * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": # <<<<<<<<<<<<<< @@ -6357,31 +6364,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":184 + /* "w3lib/_url.pyx":183 * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": * raise ValueError * pointer += 2 # <<<<<<<<<<<<<< * piece_index += 1 * compress = piece_index */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":185 + /* "w3lib/_url.pyx":184 * raise ValueError * pointer += 2 * piece_index += 1 # <<<<<<<<<<<<<< * compress = piece_index * while pointer < input_lenght: */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":186 + /* "w3lib/_url.pyx":185 * pointer += 2 * piece_index += 1 * compress = piece_index # <<<<<<<<<<<<<< @@ -6391,7 +6398,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_piece_index); __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); - /* "w3lib/_url.pyx":181 + /* "w3lib/_url.pyx":180 * pointer = 0 * input_lenght = len(input) * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< @@ -6400,7 +6407,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":187 + /* "w3lib/_url.pyx":186 * piece_index += 1 * compress = piece_index * while pointer < input_lenght: # <<<<<<<<<<<<<< @@ -6408,25 +6415,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * raise ValueError */ while (1) { - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":188 + /* "w3lib/_url.pyx":187 * compress = piece_index * while pointer < input_lenght: * if piece_index == 8: # <<<<<<<<<<<<<< * raise ValueError * if input[pointer] == ":": */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":189 + /* "w3lib/_url.pyx":188 * while pointer < input_lenght: * if piece_index == 8: * raise ValueError # <<<<<<<<<<<<<< @@ -6434,9 +6441,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * if compress is not None: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 189, __pyx_L1_error) + __PYX_ERR(0, 188, __pyx_L1_error) - /* "w3lib/_url.pyx":188 + /* "w3lib/_url.pyx":187 * compress = piece_index * while pointer < input_lenght: * if piece_index == 8: # <<<<<<<<<<<<<< @@ -6445,20 +6452,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":190 + /* "w3lib/_url.pyx":189 * if piece_index == 8: * raise ValueError * if input[pointer] == ":": # <<<<<<<<<<<<<< * if compress is not None: * raise ValueError */ - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":191 + /* "w3lib/_url.pyx":190 * raise ValueError * if input[pointer] == ":": * if compress is not None: # <<<<<<<<<<<<<< @@ -6468,7 +6475,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_compress != Py_None); if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":192 + /* "w3lib/_url.pyx":191 * if input[pointer] == ":": * if compress is not None: * raise ValueError # <<<<<<<<<<<<<< @@ -6476,9 +6483,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * piece_index += 1 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 192, __pyx_L1_error) + __PYX_ERR(0, 191, __pyx_L1_error) - /* "w3lib/_url.pyx":191 + /* "w3lib/_url.pyx":190 * raise ValueError * if input[pointer] == ":": * if compress is not None: # <<<<<<<<<<<<<< @@ -6487,31 +6494,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":193 + /* "w3lib/_url.pyx":192 * if compress is not None: * raise ValueError * pointer += 1 # <<<<<<<<<<<<<< * piece_index += 1 * compress = piece_index */ - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":194 + /* "w3lib/_url.pyx":193 * raise ValueError * pointer += 1 * piece_index += 1 # <<<<<<<<<<<<<< * compress = piece_index * continue */ - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":195 + /* "w3lib/_url.pyx":194 * pointer += 1 * piece_index += 1 * compress = piece_index # <<<<<<<<<<<<<< @@ -6521,7 +6528,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_piece_index); __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); - /* "w3lib/_url.pyx":196 + /* "w3lib/_url.pyx":195 * piece_index += 1 * compress = piece_index * continue # <<<<<<<<<<<<<< @@ -6530,7 +6537,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ goto __pyx_L9_continue; - /* "w3lib/_url.pyx":190 + /* "w3lib/_url.pyx":189 * if piece_index == 8: * raise ValueError * if input[pointer] == ":": # <<<<<<<<<<<<<< @@ -6539,7 +6546,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":197 + /* "w3lib/_url.pyx":196 * compress = piece_index * continue * value = length = 0 # <<<<<<<<<<<<<< @@ -6551,7 +6558,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_int_0); - /* "w3lib/_url.pyx":198 + /* "w3lib/_url.pyx":197 * continue * value = length = 0 * while ( # <<<<<<<<<<<<<< @@ -6560,135 +6567,135 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ while (1) { - /* "w3lib/_url.pyx":199 + /* "w3lib/_url.pyx":198 * value = length = 0 * while ( * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * ): * value = value * 0x10 + int(input[pointer], base=16) */ - __pyx_t_6 = PyObject_RichCompare(__pyx_v_length, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_length, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L16_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L16_bool_binop_done:; if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":201 + /* "w3lib/_url.pyx":200 * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT * ): * value = value * 0x10 + int(input[pointer], base=16) # <<<<<<<<<<<<<< * pointer += 1 * length += 1 */ - __pyx_t_6 = __Pyx_PyInt_MultiplyObjC(__pyx_v_value, __pyx_int_16, 0x10, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_MultiplyObjC(__pyx_v_value, __pyx_int_16, 0x10, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 201, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 201, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":202 + /* "w3lib/_url.pyx":201 * ): * value = value * 0x10 + int(input[pointer], base=16) * pointer += 1 # <<<<<<<<<<<<<< * length += 1 * if pointer < input_lenght and input[pointer] == ".": */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":203 + /* "w3lib/_url.pyx":202 * value = value * 0x10 + int(input[pointer], base=16) * pointer += 1 * length += 1 # <<<<<<<<<<<<<< * if pointer < input_lenght and input[pointer] == ".": * if length == 0: */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_length, __pyx_t_1); __pyx_t_1 = 0; } - /* "w3lib/_url.pyx":204 + /* "w3lib/_url.pyx":203 * pointer += 1 * length += 1 * if pointer < input_lenght and input[pointer] == ".": # <<<<<<<<<<<<<< * if length == 0: * raise ValueError */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L20_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":205 + /* "w3lib/_url.pyx":204 * length += 1 * if pointer < input_lenght and input[pointer] == ".": * if length == 0: # <<<<<<<<<<<<<< * raise ValueError * pointer -= length */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_length, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_length, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":206 + /* "w3lib/_url.pyx":205 * if pointer < input_lenght and input[pointer] == ".": * if length == 0: * raise ValueError # <<<<<<<<<<<<<< @@ -6696,9 +6703,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * if piece_index > 6: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 206, __pyx_L1_error) + __PYX_ERR(0, 205, __pyx_L1_error) - /* "w3lib/_url.pyx":205 + /* "w3lib/_url.pyx":204 * length += 1 * if pointer < input_lenght and input[pointer] == ".": * if length == 0: # <<<<<<<<<<<<<< @@ -6707,31 +6714,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":207 + /* "w3lib/_url.pyx":206 * if length == 0: * raise ValueError * pointer -= length # <<<<<<<<<<<<<< * if piece_index > 6: * raise ValueError */ - __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_v_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_v_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":208 + /* "w3lib/_url.pyx":207 * raise ValueError * pointer -= length * if piece_index > 6: # <<<<<<<<<<<<<< * raise ValueError * numbers_seen = 0 */ - __pyx_t_7 = PyObject_RichCompare(__pyx_v_piece_index, __pyx_int_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_piece_index, __pyx_int_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":209 + /* "w3lib/_url.pyx":208 * pointer -= length * if piece_index > 6: * raise ValueError # <<<<<<<<<<<<<< @@ -6739,9 +6746,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * while pointer < input_lenght: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 208, __pyx_L1_error) - /* "w3lib/_url.pyx":208 + /* "w3lib/_url.pyx":207 * raise ValueError * pointer -= length * if piece_index > 6: # <<<<<<<<<<<<<< @@ -6750,7 +6757,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":210 + /* "w3lib/_url.pyx":209 * if piece_index > 6: * raise ValueError * numbers_seen = 0 # <<<<<<<<<<<<<< @@ -6760,7 +6767,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_int_0); __pyx_v_numbers_seen = __pyx_int_0; - /* "w3lib/_url.pyx":211 + /* "w3lib/_url.pyx":210 * raise ValueError * numbers_seen = 0 * while pointer < input_lenght: # <<<<<<<<<<<<<< @@ -6768,15 +6775,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * if numbers_seen > 0: */ while (1) { - __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":212 + /* "w3lib/_url.pyx":211 * numbers_seen = 0 * while pointer < input_lenght: * ipv4_piece = None # <<<<<<<<<<<<<< @@ -6786,54 +6793,54 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_ipv4_piece, Py_None); - /* "w3lib/_url.pyx":213 + /* "w3lib/_url.pyx":212 * while pointer < input_lenght: * ipv4_piece = None * if numbers_seen > 0: # <<<<<<<<<<<<<< * if input[pointer] == "." and numbers_seen < 4: * pointer += 1 */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":214 + /* "w3lib/_url.pyx":213 * ipv4_piece = None * if numbers_seen > 0: * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< * pointer += 1 * else: */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L28_bool_binop_done; } - __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L28_bool_binop_done:; if (likely(__pyx_t_3)) { - /* "w3lib/_url.pyx":215 + /* "w3lib/_url.pyx":214 * if numbers_seen > 0: * if input[pointer] == "." and numbers_seen < 4: * pointer += 1 # <<<<<<<<<<<<<< * else: * raise ValueError */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":214 + /* "w3lib/_url.pyx":213 * ipv4_piece = None * if numbers_seen > 0: * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< @@ -6843,7 +6850,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py goto __pyx_L27; } - /* "w3lib/_url.pyx":217 + /* "w3lib/_url.pyx":216 * pointer += 1 * else: * raise ValueError # <<<<<<<<<<<<<< @@ -6852,11 +6859,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ /*else*/ { __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 217, __pyx_L1_error) + __PYX_ERR(0, 216, __pyx_L1_error) } __pyx_L27:; - /* "w3lib/_url.pyx":213 + /* "w3lib/_url.pyx":212 * while pointer < input_lenght: * ipv4_piece = None * if numbers_seen > 0: # <<<<<<<<<<<<<< @@ -6865,36 +6872,36 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":218 + /* "w3lib/_url.pyx":217 * else: * raise ValueError * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< * raise ValueError * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L31_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L31_bool_binop_done:; if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":219 + /* "w3lib/_url.pyx":218 * raise ValueError * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: * raise ValueError # <<<<<<<<<<<<<< @@ -6902,9 +6909,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * number = int(input[pointer]) */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 219, __pyx_L1_error) + __PYX_ERR(0, 218, __pyx_L1_error) - /* "w3lib/_url.pyx":218 + /* "w3lib/_url.pyx":217 * else: * raise ValueError * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< @@ -6913,7 +6920,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":220 + /* "w3lib/_url.pyx":219 * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: * raise ValueError * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: # <<<<<<<<<<<<<< @@ -6921,44 +6928,44 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * if ipv4_piece is None: */ while (1) { - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L35_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L35_bool_binop_done:; if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":221 + /* "w3lib/_url.pyx":220 * raise ValueError * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: * number = int(input[pointer]) # <<<<<<<<<<<<<< * if ipv4_piece is None: * ipv4_piece = number */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_number, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":222 + /* "w3lib/_url.pyx":221 * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: * number = int(input[pointer]) * if ipv4_piece is None: # <<<<<<<<<<<<<< @@ -6968,7 +6975,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_ipv4_piece == Py_None); if (__pyx_t_3) { - /* "w3lib/_url.pyx":223 + /* "w3lib/_url.pyx":222 * number = int(input[pointer]) * if ipv4_piece is None: * ipv4_piece = number # <<<<<<<<<<<<<< @@ -6978,7 +6985,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_number); __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_v_number); - /* "w3lib/_url.pyx":222 + /* "w3lib/_url.pyx":221 * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: * number = int(input[pointer]) * if ipv4_piece is None: # <<<<<<<<<<<<<< @@ -6988,17 +6995,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py goto __pyx_L37; } - /* "w3lib/_url.pyx":224 + /* "w3lib/_url.pyx":223 * if ipv4_piece is None: * ipv4_piece = number * elif ipv4_piece == 0: # <<<<<<<<<<<<<< * raise ValueError * else: */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_ipv4_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_ipv4_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 223, __pyx_L1_error) if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":225 + /* "w3lib/_url.pyx":224 * ipv4_piece = number * elif ipv4_piece == 0: * raise ValueError # <<<<<<<<<<<<<< @@ -7006,9 +7013,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * ipv4_piece = ipv4_piece * 10 + number */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 225, __pyx_L1_error) + __PYX_ERR(0, 224, __pyx_L1_error) - /* "w3lib/_url.pyx":224 + /* "w3lib/_url.pyx":223 * if ipv4_piece is None: * ipv4_piece = number * elif ipv4_piece == 0: # <<<<<<<<<<<<<< @@ -7017,7 +7024,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":227 + /* "w3lib/_url.pyx":226 * raise ValueError * else: * ipv4_piece = ipv4_piece * 10 + number # <<<<<<<<<<<<<< @@ -7025,9 +7032,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * raise ValueError */ /*else*/ { - __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ipv4_piece, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ipv4_piece, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_t_1); @@ -7035,19 +7042,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py } __pyx_L37:; - /* "w3lib/_url.pyx":228 + /* "w3lib/_url.pyx":227 * else: * ipv4_piece = ipv4_piece * 10 + number * if ipv4_piece > 255: # <<<<<<<<<<<<<< * raise ValueError * pointer += 1 */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ipv4_piece, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ipv4_piece, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":229 + /* "w3lib/_url.pyx":228 * ipv4_piece = ipv4_piece * 10 + number * if ipv4_piece > 255: * raise ValueError # <<<<<<<<<<<<<< @@ -7055,9 +7062,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * assert isinstance(ipv4_piece, int) */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 229, __pyx_L1_error) + __PYX_ERR(0, 228, __pyx_L1_error) - /* "w3lib/_url.pyx":228 + /* "w3lib/_url.pyx":227 * else: * ipv4_piece = ipv4_piece * 10 + number * if ipv4_piece > 255: # <<<<<<<<<<<<<< @@ -7066,20 +7073,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":230 + /* "w3lib/_url.pyx":229 * if ipv4_piece > 255: * raise ValueError * pointer += 1 # <<<<<<<<<<<<<< * assert isinstance(ipv4_piece, int) * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); __pyx_t_1 = 0; } - /* "w3lib/_url.pyx":231 + /* "w3lib/_url.pyx":230 * raise ValueError * pointer += 1 * assert isinstance(ipv4_piece, int) # <<<<<<<<<<<<<< @@ -7091,44 +7098,44 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __pyx_t_3 = PyInt_Check(__pyx_v_ipv4_piece); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 231, __pyx_L1_error) + __PYX_ERR(0, 230, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 231, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 230, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":232 + /* "w3lib/_url.pyx":231 * pointer += 1 * assert isinstance(ipv4_piece, int) * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece # <<<<<<<<<<<<<< * numbers_seen += 1 * if numbers_seen in (2, 4): */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_ipv4_piece); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_ipv4_piece); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_1) < 0))) __PYX_ERR(0, 232, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_1) < 0))) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":233 + /* "w3lib/_url.pyx":232 * assert isinstance(ipv4_piece, int) * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece * numbers_seen += 1 # <<<<<<<<<<<<<< * if numbers_seen in (2, 4): * piece_index += 1 */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_numbers_seen, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_numbers_seen, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_numbers_seen, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":234 + /* "w3lib/_url.pyx":233 * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece * numbers_seen += 1 * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< @@ -7137,32 +7144,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ __Pyx_INCREF(__pyx_v_numbers_seen); __pyx_t_1 = __pyx_v_numbers_seen; - __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) if (!__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L40_bool_binop_done; } - __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) __pyx_t_3 = __pyx_t_5; __pyx_L40_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_3; if (__pyx_t_5) { - /* "w3lib/_url.pyx":235 + /* "w3lib/_url.pyx":234 * numbers_seen += 1 * if numbers_seen in (2, 4): * piece_index += 1 # <<<<<<<<<<<<<< * if numbers_seen != 4: * raise ValueError */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":234 + /* "w3lib/_url.pyx":233 * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece * numbers_seen += 1 * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< @@ -7172,17 +7179,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py } } - /* "w3lib/_url.pyx":236 + /* "w3lib/_url.pyx":235 * if numbers_seen in (2, 4): * piece_index += 1 * if numbers_seen != 4: # <<<<<<<<<<<<<< * raise ValueError * break */ - __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_numbers_seen, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_numbers_seen, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 235, __pyx_L1_error) if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":237 + /* "w3lib/_url.pyx":236 * piece_index += 1 * if numbers_seen != 4: * raise ValueError # <<<<<<<<<<<<<< @@ -7190,9 +7197,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * if pointer < input_lenght and input[pointer] == ":": */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 237, __pyx_L1_error) + __PYX_ERR(0, 236, __pyx_L1_error) - /* "w3lib/_url.pyx":236 + /* "w3lib/_url.pyx":235 * if numbers_seen in (2, 4): * piece_index += 1 * if numbers_seen != 4: # <<<<<<<<<<<<<< @@ -7201,7 +7208,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":238 + /* "w3lib/_url.pyx":237 * if numbers_seen != 4: * raise ValueError * break # <<<<<<<<<<<<<< @@ -7210,7 +7217,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ goto __pyx_L10_break; - /* "w3lib/_url.pyx":204 + /* "w3lib/_url.pyx":203 * pointer += 1 * length += 1 * if pointer < input_lenght and input[pointer] == ".": # <<<<<<<<<<<<<< @@ -7219,60 +7226,60 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":239 + /* "w3lib/_url.pyx":238 * raise ValueError * break * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< * pointer += 1 * if pointer >= input_lenght: */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L44_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = __pyx_t_3; __pyx_L44_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":240 + /* "w3lib/_url.pyx":239 * break * if pointer < input_lenght and input[pointer] == ":": * pointer += 1 # <<<<<<<<<<<<<< * if pointer >= input_lenght: * raise ValueError */ - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":241 + /* "w3lib/_url.pyx":240 * if pointer < input_lenght and input[pointer] == ":": * pointer += 1 * if pointer >= input_lenght: # <<<<<<<<<<<<<< * raise ValueError * elif pointer < input_lenght: */ - __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":242 + /* "w3lib/_url.pyx":241 * pointer += 1 * if pointer >= input_lenght: * raise ValueError # <<<<<<<<<<<<<< @@ -7280,9 +7287,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * raise ValueError */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 242, __pyx_L1_error) + __PYX_ERR(0, 241, __pyx_L1_error) - /* "w3lib/_url.pyx":241 + /* "w3lib/_url.pyx":240 * if pointer < input_lenght and input[pointer] == ":": * pointer += 1 * if pointer >= input_lenght: # <<<<<<<<<<<<<< @@ -7291,7 +7298,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":239 + /* "w3lib/_url.pyx":238 * raise ValueError * break * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< @@ -7301,22 +7308,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py goto __pyx_L43; } - /* "w3lib/_url.pyx":243 + /* "w3lib/_url.pyx":242 * if pointer >= input_lenght: * raise ValueError * elif pointer < input_lenght: # <<<<<<<<<<<<<< * raise ValueError * address[piece_index] = value */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":244 + /* "w3lib/_url.pyx":243 * raise ValueError * elif pointer < input_lenght: * raise ValueError # <<<<<<<<<<<<<< @@ -7324,9 +7331,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * piece_index += 1 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 244, __pyx_L1_error) + __PYX_ERR(0, 243, __pyx_L1_error) - /* "w3lib/_url.pyx":243 + /* "w3lib/_url.pyx":242 * if pointer >= input_lenght: * raise ValueError * elif pointer < input_lenght: # <<<<<<<<<<<<<< @@ -7336,23 +7343,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py } __pyx_L43:; - /* "w3lib/_url.pyx":245 + /* "w3lib/_url.pyx":244 * elif pointer < input_lenght: * raise ValueError * address[piece_index] = value # <<<<<<<<<<<<<< * piece_index += 1 * if compress is not None: */ - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_v_value) < 0))) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_v_value) < 0))) __PYX_ERR(0, 244, __pyx_L1_error) - /* "w3lib/_url.pyx":246 + /* "w3lib/_url.pyx":245 * raise ValueError * address[piece_index] = value * piece_index += 1 # <<<<<<<<<<<<<< * if compress is not None: * swaps = piece_index - compress */ - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_7); __pyx_t_7 = 0; @@ -7360,7 +7367,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py } __pyx_L10_break:; - /* "w3lib/_url.pyx":247 + /* "w3lib/_url.pyx":246 * address[piece_index] = value * piece_index += 1 * if compress is not None: # <<<<<<<<<<<<<< @@ -7370,19 +7377,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (__pyx_v_compress != Py_None); if (__pyx_t_5) { - /* "w3lib/_url.pyx":248 + /* "w3lib/_url.pyx":247 * piece_index += 1 * if compress is not None: * swaps = piece_index - compress # <<<<<<<<<<<<<< * piece_index = 7 * while piece_index != 0 and swaps > 0: */ - __pyx_t_7 = PyNumber_Subtract(__pyx_v_piece_index, __pyx_v_compress); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_v_piece_index, __pyx_v_compress); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_swaps = __pyx_t_7; __pyx_t_7 = 0; - /* "w3lib/_url.pyx":249 + /* "w3lib/_url.pyx":248 * if compress is not None: * swaps = piece_index - compress * piece_index = 7 # <<<<<<<<<<<<<< @@ -7392,7 +7399,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_int_7); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_int_7); - /* "w3lib/_url.pyx":250 + /* "w3lib/_url.pyx":249 * swaps = piece_index - compress * piece_index = 7 * while piece_index != 0 and swaps > 0: # <<<<<<<<<<<<<< @@ -7400,89 +7407,89 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * address[compress + swaps - 1], */ while (1) { - __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 249, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L50_bool_binop_done; } - __pyx_t_7 = PyObject_RichCompare(__pyx_v_swaps, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_swaps, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = __pyx_t_3; __pyx_L50_bool_binop_done:; if (!__pyx_t_5) break; - /* "w3lib/_url.pyx":252 + /* "w3lib/_url.pyx":251 * while piece_index != 0 and swaps > 0: * address[piece_index], address[compress + swaps - 1] = ( * address[compress + swaps - 1], # <<<<<<<<<<<<<< * address[piece_index], * ) */ - __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":253 + /* "w3lib/_url.pyx":252 * address[piece_index], address[compress + swaps - 1] = ( * address[compress + swaps - 1], * address[piece_index], # <<<<<<<<<<<<<< * ) * piece_index -= 1 */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":251 + /* "w3lib/_url.pyx":250 * piece_index = 7 * while piece_index != 0 and swaps > 0: * address[piece_index], address[compress + swaps - 1] = ( # <<<<<<<<<<<<<< * address[compress + swaps - 1], * address[piece_index], */ - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_7) < 0))) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_7) < 0))) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_t_6, __pyx_t_1) < 0))) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_t_6, __pyx_t_1) < 0))) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":255 + /* "w3lib/_url.pyx":254 * address[piece_index], * ) * piece_index -= 1 # <<<<<<<<<<<<<< * swaps -= 1 * elif compress is None and piece_index != 8: */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":256 + /* "w3lib/_url.pyx":255 * ) * piece_index -= 1 * swaps -= 1 # <<<<<<<<<<<<<< * elif compress is None and piece_index != 8: * raise ValueError */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_swaps, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_swaps, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_swaps, __pyx_t_1); __pyx_t_1 = 0; } - /* "w3lib/_url.pyx":247 + /* "w3lib/_url.pyx":246 * address[piece_index] = value * piece_index += 1 * if compress is not None: # <<<<<<<<<<<<<< @@ -7492,7 +7499,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py goto __pyx_L47; } - /* "w3lib/_url.pyx":257 + /* "w3lib/_url.pyx":256 * piece_index -= 1 * swaps -= 1 * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< @@ -7505,12 +7512,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __pyx_t_5 = __pyx_t_3; goto __pyx_L52_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 256, __pyx_L1_error) __pyx_t_5 = __pyx_t_3; __pyx_L52_bool_binop_done:; if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":258 + /* "w3lib/_url.pyx":257 * swaps -= 1 * elif compress is None and piece_index != 8: * raise ValueError # <<<<<<<<<<<<<< @@ -7518,9 +7525,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py * */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 258, __pyx_L1_error) + __PYX_ERR(0, 257, __pyx_L1_error) - /* "w3lib/_url.pyx":257 + /* "w3lib/_url.pyx":256 * piece_index -= 1 * swaps -= 1 * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< @@ -7530,7 +7537,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py } __pyx_L47:; - /* "w3lib/_url.pyx":259 + /* "w3lib/_url.pyx":258 * elif compress is None and piece_index != 8: * raise ValueError * return address # <<<<<<<<<<<<<< @@ -7542,7 +7549,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_address; goto __pyx_L0; - /* "w3lib/_url.pyx":175 + /* "w3lib/_url.pyx":174 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< @@ -7574,7 +7581,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "w3lib/_url.pyx":262 +/* "w3lib/_url.pyx":261 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -7590,7 +7597,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_7_utf_8_percent_encode = {"_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_7_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_6_utf_8_percent_encode, "_utf_8_percent_encode(unicode input: str, percent_encode_set: _PercentEncodeSet) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_7_utf_8_percent_encode = {"_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_7_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_6_utf_8_percent_encode}; static PyObject *__pyx_pw_5w3lib_4_url_7_utf_8_percent_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -7638,7 +7646,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -7646,14 +7654,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, 1); __PYX_ERR(0, 262, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, 1); __PYX_ERR(0, 261, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_utf_8_percent_encode") < 0)) __PYX_ERR(0, 262, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_utf_8_percent_encode") < 0)) __PYX_ERR(0, 261, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -7666,7 +7674,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 262, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 261, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7680,7 +7688,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 263, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 262, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_6_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_percent_encode_set); /* function exit code */ @@ -7710,7 +7718,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_6_utf_8_percent_encode(CYTHON_UNUSED PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_utf_8_percent_encode", 1); - /* "w3lib/_url.pyx":266 + /* "w3lib/_url.pyx":265 * percent_encode_set: _PercentEncodeSet, * ) -> str: * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< @@ -7718,60 +7726,60 @@ static PyObject *__pyx_pf_5w3lib_4_url_6_utf_8_percent_encode(CYTHON_UNUSED PyOb * encoding="utf-8", */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":267 + /* "w3lib/_url.pyx":266 * ) -> str: * return _percent_encode_after_encoding( * input, # <<<<<<<<<<<<<< * encoding="utf-8", * percent_encode_set=percent_encode_set, */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_input); __Pyx_GIVEREF(__pyx_v_input); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input)) __PYX_ERR(0, 266, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input)) __PYX_ERR(0, 265, __pyx_L1_error); - /* "w3lib/_url.pyx":268 + /* "w3lib/_url.pyx":267 * return _percent_encode_after_encoding( * input, * encoding="utf-8", # <<<<<<<<<<<<<< * percent_encode_set=percent_encode_set, * ) */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 268, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 267, __pyx_L1_error) - /* "w3lib/_url.pyx":269 + /* "w3lib/_url.pyx":268 * input, * encoding="utf-8", * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< * ) * */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 268, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 267, __pyx_L1_error) - /* "w3lib/_url.pyx":266 + /* "w3lib/_url.pyx":265 * percent_encode_set: _PercentEncodeSet, * ) -> str: * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< * input, * encoding="utf-8", */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 266, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 265, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":262 + /* "w3lib/_url.pyx":261 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -7793,7 +7801,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_6_utf_8_percent_encode(CYTHON_UNUSED PyOb return __pyx_r; } -/* "w3lib/_url.pyx":274 +/* "w3lib/_url.pyx":273 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< @@ -7809,7 +7817,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_9_parse_opaque_host = {"_parse_opaque_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_9_parse_opaque_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_8_parse_opaque_host, "_parse_opaque_host(unicode input: str) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_9_parse_opaque_host = {"_parse_opaque_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_9_parse_opaque_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_8_parse_opaque_host}; static PyObject *__pyx_pw_5w3lib_4_url_9_parse_opaque_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -7854,12 +7863,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_opaque_host") < 0)) __PYX_ERR(0, 274, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_opaque_host") < 0)) __PYX_ERR(0, 273, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -7870,7 +7879,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_opaque_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 274, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_opaque_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 273, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7884,7 +7893,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 274, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 273, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_8_parse_opaque_host(__pyx_self, __pyx_v_input); /* function exit code */ @@ -7923,7 +7932,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_opaque_host(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_opaque_host", 1); - /* "w3lib/_url.pyx":275 + /* "w3lib/_url.pyx":274 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: * for code_point in input: # <<<<<<<<<<<<<< @@ -7932,28 +7941,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_opaque_host(CYTHON_UNUSED PyObjec */ __Pyx_INCREF(__pyx_v_input); __pyx_t_1 = __pyx_v_input; - __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 274, __pyx_L1_error) for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) { __pyx_t_2 = __pyx_t_7; __pyx_v_code_point = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2); - /* "w3lib/_url.pyx":276 + /* "w3lib/_url.pyx":275 * def _parse_opaque_host(input: str) -> str: * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< * raise ValueError * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) */ - __pyx_t_8 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(__pyx_t_10)) { - /* "w3lib/_url.pyx":277 + /* "w3lib/_url.pyx":276 * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: * raise ValueError # <<<<<<<<<<<<<< @@ -7961,9 +7970,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_opaque_host(CYTHON_UNUSED PyObjec * */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 277, __pyx_L1_error) + __PYX_ERR(0, 276, __pyx_L1_error) - /* "w3lib/_url.pyx":276 + /* "w3lib/_url.pyx":275 * def _parse_opaque_host(input: str) -> str: * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< @@ -7974,7 +7983,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_opaque_host(CYTHON_UNUSED PyObjec } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":278 + /* "w3lib/_url.pyx":277 * if code_point in _FORBIDDEN_HOST_CODE_POINTS: * raise ValueError * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) # <<<<<<<<<<<<<< @@ -7982,9 +7991,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_opaque_host(CYTHON_UNUSED PyObjec * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_5 = 0; @@ -8005,16 +8014,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_opaque_host(CYTHON_UNUSED PyObjec __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 278, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_9))) __PYX_ERR(0, 278, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_9))) __PYX_ERR(0, 277, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":274 + /* "w3lib/_url.pyx":273 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< @@ -8037,7 +8046,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_opaque_host(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "w3lib/_url.pyx":282 +/* "w3lib/_url.pyx":281 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< @@ -8053,7 +8062,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_11_parse_ipv4_number = {"_parse_ipv4_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_11_parse_ipv4_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_10_parse_ipv4_number, "_parse_ipv4_number(unicode input: str) -> Tuple[int, bool]"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_11_parse_ipv4_number = {"_parse_ipv4_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_11_parse_ipv4_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_10_parse_ipv4_number}; static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv4_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -8098,12 +8108,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4_number") < 0)) __PYX_ERR(0, 282, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4_number") < 0)) __PYX_ERR(0, 281, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -8114,7 +8124,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv4_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 282, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_ipv4_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 281, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8128,7 +8138,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 282, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 281, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_10_parse_ipv4_number(__pyx_self, __pyx_v_input); /* function exit code */ @@ -8164,7 +8174,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje __Pyx_RefNannySetupContext("_parse_ipv4_number", 0); __Pyx_INCREF(__pyx_v_input); - /* "w3lib/_url.pyx":283 + /* "w3lib/_url.pyx":282 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: * if not input: # <<<<<<<<<<<<<< @@ -8175,7 +8185,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":284 + /* "w3lib/_url.pyx":283 * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: * if not input: * raise ValueError # <<<<<<<<<<<<<< @@ -8183,9 +8193,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje * r = 10 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 284, __pyx_L1_error) + __PYX_ERR(0, 283, __pyx_L1_error) - /* "w3lib/_url.pyx":283 + /* "w3lib/_url.pyx":282 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: * if not input: # <<<<<<<<<<<<<< @@ -8194,7 +8204,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje */ } - /* "w3lib/_url.pyx":285 + /* "w3lib/_url.pyx":284 * if not input: * raise ValueError * validation_error = False # <<<<<<<<<<<<<< @@ -8203,7 +8213,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_validation_error = 0; - /* "w3lib/_url.pyx":286 + /* "w3lib/_url.pyx":285 * raise ValueError * validation_error = False * r = 10 # <<<<<<<<<<<<<< @@ -8212,40 +8222,40 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_r = 10; - /* "w3lib/_url.pyx":287 + /* "w3lib/_url.pyx":286 * validation_error = False * r = 10 * if len(input) >= 2: # <<<<<<<<<<<<<< * if input[:2] in ("0X", "0x"): * validation_error = True */ - __pyx_t_3 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 286, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 >= 2); if (__pyx_t_2) { - /* "w3lib/_url.pyx":288 + /* "w3lib/_url.pyx":287 * r = 10 * if len(input) >= 2: * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< * validation_error = True * input = input[2:] */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0X, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0X, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 287, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L6_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0x, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0x, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 287, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __pyx_L6_bool_binop_done:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_2; if (__pyx_t_1) { - /* "w3lib/_url.pyx":289 + /* "w3lib/_url.pyx":288 * if len(input) >= 2: * if input[:2] in ("0X", "0x"): * validation_error = True # <<<<<<<<<<<<<< @@ -8254,19 +8264,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_validation_error = 1; - /* "w3lib/_url.pyx":290 + /* "w3lib/_url.pyx":289 * if input[:2] in ("0X", "0x"): * validation_error = True * input = input[2:] # <<<<<<<<<<<<<< * r = 16 * elif input[0] == "0": */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":291 + /* "w3lib/_url.pyx":290 * validation_error = True * input = input[2:] * r = 16 # <<<<<<<<<<<<<< @@ -8275,7 +8285,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_r = 16; - /* "w3lib/_url.pyx":288 + /* "w3lib/_url.pyx":287 * r = 10 * if len(input) >= 2: * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< @@ -8285,18 +8295,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje goto __pyx_L5; } - /* "w3lib/_url.pyx":292 + /* "w3lib/_url.pyx":291 * input = input[2:] * r = 16 * elif input[0] == "0": # <<<<<<<<<<<<<< * validation_error = True * input = input[1:] */ - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 291, __pyx_L1_error) __pyx_t_1 = (__pyx_t_5 == 48); if (__pyx_t_1) { - /* "w3lib/_url.pyx":293 + /* "w3lib/_url.pyx":292 * r = 16 * elif input[0] == "0": * validation_error = True # <<<<<<<<<<<<<< @@ -8305,19 +8315,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_validation_error = 1; - /* "w3lib/_url.pyx":294 + /* "w3lib/_url.pyx":293 * elif input[0] == "0": * validation_error = True * input = input[1:] # <<<<<<<<<<<<<< * r = 8 * if not input: */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":295 + /* "w3lib/_url.pyx":294 * validation_error = True * input = input[1:] * r = 8 # <<<<<<<<<<<<<< @@ -8326,7 +8336,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_r = 8; - /* "w3lib/_url.pyx":292 + /* "w3lib/_url.pyx":291 * input = input[2:] * r = 16 * elif input[0] == "0": # <<<<<<<<<<<<<< @@ -8336,7 +8346,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje } __pyx_L5:; - /* "w3lib/_url.pyx":287 + /* "w3lib/_url.pyx":286 * validation_error = False * r = 10 * if len(input) >= 2: # <<<<<<<<<<<<<< @@ -8345,7 +8355,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje */ } - /* "w3lib/_url.pyx":296 + /* "w3lib/_url.pyx":295 * input = input[1:] * r = 8 * if not input: # <<<<<<<<<<<<<< @@ -8356,7 +8366,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "w3lib/_url.pyx":297 + /* "w3lib/_url.pyx":296 * r = 8 * if not input: * return (0, True) # <<<<<<<<<<<<<< @@ -8368,7 +8378,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje __pyx_r = __pyx_tuple__7; goto __pyx_L0; - /* "w3lib/_url.pyx":296 + /* "w3lib/_url.pyx":295 * input = input[1:] * r = 8 * if not input: # <<<<<<<<<<<<<< @@ -8377,7 +8387,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje */ } - /* "w3lib/_url.pyx":298 + /* "w3lib/_url.pyx":297 * if not input: * return (0, True) * return (int(input, base=r), validation_error) # <<<<<<<<<<<<<< @@ -8385,36 +8395,36 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_input); __Pyx_GIVEREF(__pyx_v_input); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_input)) __PYX_ERR(0, 298, __pyx_L1_error); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_input)) __PYX_ERR(0, 297, __pyx_L1_error); + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base, __pyx_t_7) < 0) __PYX_ERR(0, 298, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base, __pyx_t_7) < 0) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_validation_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_validation_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":282 + /* "w3lib/_url.pyx":281 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< @@ -8436,7 +8446,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObje return __pyx_r; } -/* "w3lib/_url.pyx":302 +/* "w3lib/_url.pyx":301 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< @@ -8452,7 +8462,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_13_ends_in_number = {"_ends_in_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_13_ends_in_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_12_ends_in_number, "_ends_in_number(unicode input: str) -> bool"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_13_ends_in_number = {"_ends_in_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_13_ends_in_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_12_ends_in_number}; static PyObject *__pyx_pw_5w3lib_4_url_13_ends_in_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -8497,12 +8508,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ends_in_number") < 0)) __PYX_ERR(0, 302, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ends_in_number") < 0)) __PYX_ERR(0, 301, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -8513,7 +8524,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_ends_in_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 302, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_ends_in_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 301, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8527,7 +8538,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 301, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_12_ends_in_number(__pyx_self, __pyx_v_input); /* function exit code */ @@ -8546,7 +8557,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "w3lib/_url.pyx":309 +/* "w3lib/_url.pyx":308 * parts = parts[:-1] * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< @@ -8566,7 +8577,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED P if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 309, __pyx_L1_error) + __PYX_ERR(0, 308, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -8574,7 +8585,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED P __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_15_ends_in_number_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ends_in_number_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_15_ends_in_number_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ends_in_number_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -8612,16 +8623,16 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 309, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 309, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 308, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 308, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -8629,28 +8640,28 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 308, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 308, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -8660,7 +8671,7 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 309, __pyx_L1_error) + else __PYX_ERR(0, 308, __pyx_L1_error) } break; } @@ -8670,9 +8681,9 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { @@ -8710,7 +8721,7 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout return __pyx_r; } -/* "w3lib/_url.pyx":302 +/* "w3lib/_url.pyx":301 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< @@ -8739,51 +8750,51 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_ends_in_number", 1); - /* "w3lib/_url.pyx":303 + /* "w3lib/_url.pyx":302 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: * parts = input.split(".") # <<<<<<<<<<<<<< * if parts and parts[-1] == "": * if len(parts) == 1: */ - __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parts = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":304 + /* "w3lib/_url.pyx":303 * def _ends_in_number(input: str) -> bool: * parts = input.split(".") * if parts and parts[-1] == "": # <<<<<<<<<<<<<< * if len(parts) == 1: * return False */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 303, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":305 + /* "w3lib/_url.pyx":304 * parts = input.split(".") * if parts and parts[-1] == "": * if len(parts) == 1: # <<<<<<<<<<<<<< * return False * parts = parts[:-1] */ - __pyx_t_4 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_t_4 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 304, __pyx_L1_error) __pyx_t_2 = (__pyx_t_4 == 1); if (__pyx_t_2) { - /* "w3lib/_url.pyx":306 + /* "w3lib/_url.pyx":305 * if parts and parts[-1] == "": * if len(parts) == 1: * return False # <<<<<<<<<<<<<< @@ -8795,7 +8806,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject __pyx_r = Py_False; goto __pyx_L0; - /* "w3lib/_url.pyx":305 + /* "w3lib/_url.pyx":304 * parts = input.split(".") * if parts and parts[-1] == "": * if len(parts) == 1: # <<<<<<<<<<<<<< @@ -8804,19 +8815,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":307 + /* "w3lib/_url.pyx":306 * if len(parts) == 1: * return False * parts = parts[:-1] # <<<<<<<<<<<<<< * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":304 + /* "w3lib/_url.pyx":303 * def _ends_in_number(input: str) -> bool: * parts = input.split(".") * if parts and parts[-1] == "": # <<<<<<<<<<<<<< @@ -8825,43 +8836,43 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":308 + /* "w3lib/_url.pyx":307 * return False * parts = parts[:-1] * last = parts[-1] # <<<<<<<<<<<<<< * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_last = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":309 + /* "w3lib/_url.pyx":308 * parts = parts[:-1] * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< * return True * try: */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_last); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_last); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L8_bool_binop_done; } - __pyx_t_1 = __pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(NULL, __pyx_v_last); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(NULL, __pyx_v_last); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L8_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":310 + /* "w3lib/_url.pyx":309 * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True # <<<<<<<<<<<<<< @@ -8873,7 +8884,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject __pyx_r = Py_True; goto __pyx_L0; - /* "w3lib/_url.pyx":309 + /* "w3lib/_url.pyx":308 * parts = parts[:-1] * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< @@ -8882,7 +8893,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":311 + /* "w3lib/_url.pyx":310 * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True * try: # <<<<<<<<<<<<<< @@ -8898,14 +8909,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { - /* "w3lib/_url.pyx":312 + /* "w3lib/_url.pyx":311 * return True * try: * _parse_ipv4_number(last) # <<<<<<<<<<<<<< * except ValueError: * return False */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L10_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -8925,13 +8936,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_last}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L10_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":311 + /* "w3lib/_url.pyx":310 * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True * try: # <<<<<<<<<<<<<< @@ -8948,7 +8959,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":313 + /* "w3lib/_url.pyx":312 * try: * _parse_ipv4_number(last) * except ValueError: # <<<<<<<<<<<<<< @@ -8958,12 +8969,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_10) { __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(0, 313, __pyx_L12_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(0, 312, __pyx_L12_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_9); - /* "w3lib/_url.pyx":314 + /* "w3lib/_url.pyx":313 * _parse_ipv4_number(last) * except ValueError: * return False # <<<<<<<<<<<<<< @@ -8980,7 +8991,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject } goto __pyx_L12_except_error; - /* "w3lib/_url.pyx":311 + /* "w3lib/_url.pyx":310 * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True * try: # <<<<<<<<<<<<<< @@ -9002,7 +9013,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject __pyx_L15_try_end:; } - /* "w3lib/_url.pyx":315 + /* "w3lib/_url.pyx":314 * except ValueError: * return False * return True # <<<<<<<<<<<<<< @@ -9014,7 +9025,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject __pyx_r = Py_True; goto __pyx_L0; - /* "w3lib/_url.pyx":302 + /* "w3lib/_url.pyx":301 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< @@ -9038,7 +9049,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":319 +/* "w3lib/_url.pyx":318 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< @@ -9054,7 +9065,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_15_parse_ipv4 = {"_parse_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_15_parse_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_14_parse_ipv4, "_parse_ipv4(unicode input: str) -> int"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_15_parse_ipv4 = {"_parse_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_15_parse_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_14_parse_ipv4}; static PyObject *__pyx_pw_5w3lib_4_url_15_parse_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -9099,12 +9111,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4") < 0)) __PYX_ERR(0, 319, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4") < 0)) __PYX_ERR(0, 318, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -9115,7 +9127,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 319, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 318, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9129,7 +9141,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 319, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 318, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_14_parse_ipv4(__pyx_self, __pyx_v_input); /* function exit code */ @@ -9148,7 +9160,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "w3lib/_url.pyx":329 +/* "w3lib/_url.pyx":328 * result = _parse_ipv4_number(part) * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< @@ -9168,7 +9180,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObj if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 329, __pyx_L1_error) + __PYX_ERR(0, 328, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -9176,7 +9188,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObj __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_ipv4_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_ipv4_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -9212,30 +9224,30 @@ static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_Coroutine return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 329, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 329, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 328, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 328, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 329, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 328, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_item, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_item, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { __Pyx_XDECREF(__pyx_r); @@ -9272,7 +9284,7 @@ static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_Coroutine return __pyx_r; } -/* "w3lib/_url.pyx":319 +/* "w3lib/_url.pyx":318 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< @@ -9307,53 +9319,53 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_ipv4", 1); - /* "w3lib/_url.pyx":320 + /* "w3lib/_url.pyx":319 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: * parts = input.split(".") # <<<<<<<<<<<<<< * if parts and not parts[-1]: * parts = parts[:-1] */ - __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parts = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":321 + /* "w3lib/_url.pyx":320 * def _parse_ipv4(input: str) -> int: * parts = input.split(".") * if parts and not parts[-1]: # <<<<<<<<<<<<<< * parts = parts[:-1] * if len(parts) > 4: */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 320, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (!__pyx_t_3); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":322 + /* "w3lib/_url.pyx":321 * parts = input.split(".") * if parts and not parts[-1]: * parts = parts[:-1] # <<<<<<<<<<<<<< * if len(parts) > 4: * raise ValueError */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":321 + /* "w3lib/_url.pyx":320 * def _parse_ipv4(input: str) -> int: * parts = input.split(".") * if parts and not parts[-1]: # <<<<<<<<<<<<<< @@ -9362,18 +9374,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":323 + /* "w3lib/_url.pyx":322 * if parts and not parts[-1]: * parts = parts[:-1] * if len(parts) > 4: # <<<<<<<<<<<<<< * raise ValueError * numbers = [] */ - __pyx_t_5 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_5 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 322, __pyx_L1_error) __pyx_t_2 = (__pyx_t_5 > 4); if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":324 + /* "w3lib/_url.pyx":323 * parts = parts[:-1] * if len(parts) > 4: * raise ValueError # <<<<<<<<<<<<<< @@ -9381,9 +9393,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p * for part in parts: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 324, __pyx_L1_error) + __PYX_ERR(0, 323, __pyx_L1_error) - /* "w3lib/_url.pyx":323 + /* "w3lib/_url.pyx":322 * if parts and not parts[-1]: * parts = parts[:-1] * if len(parts) > 4: # <<<<<<<<<<<<<< @@ -9392,19 +9404,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":325 + /* "w3lib/_url.pyx":324 * if len(parts) > 4: * raise ValueError * numbers = [] # <<<<<<<<<<<<<< * for part in parts: * result = _parse_ipv4_number(part) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_numbers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":326 + /* "w3lib/_url.pyx":325 * raise ValueError * numbers = [] * for part in parts: # <<<<<<<<<<<<<< @@ -9416,9 +9428,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -9426,28 +9438,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 326, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 325, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 326, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 325, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -9457,7 +9469,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 326, __pyx_L1_error) + else __PYX_ERR(0, 325, __pyx_L1_error) } break; } @@ -9466,14 +9478,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p __Pyx_XDECREF_SET(__pyx_v_part, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":327 + /* "w3lib/_url.pyx":326 * numbers = [] * for part in parts: * result = _parse_ipv4_number(part) # <<<<<<<<<<<<<< * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -9493,26 +9505,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_part}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":328 + /* "w3lib/_url.pyx":327 * for part in parts: * result = _parse_ipv4_number(part) * numbers.append(result[0]) # <<<<<<<<<<<<<< * if any(item > 255 for item in numbers[:-1]): * raise ValueError */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_numbers, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_numbers, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":326 + /* "w3lib/_url.pyx":325 * raise ValueError * numbers = [] * for part in parts: # <<<<<<<<<<<<<< @@ -9522,26 +9534,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":329 + /* "w3lib/_url.pyx":328 * result = _parse_ipv4_number(part) * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< * raise ValueError * if numbers[-1] >= 256 ** (5 - len(numbers)): */ - __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_7 = __pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":330 + /* "w3lib/_url.pyx":329 * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): * raise ValueError # <<<<<<<<<<<<<< @@ -9549,9 +9561,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p * raise ValueError */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 330, __pyx_L1_error) + __PYX_ERR(0, 329, __pyx_L1_error) - /* "w3lib/_url.pyx":329 + /* "w3lib/_url.pyx":328 * result = _parse_ipv4_number(part) * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< @@ -9560,26 +9572,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":331 + /* "w3lib/_url.pyx":330 * if any(item > 255 for item in numbers[:-1]): * raise ValueError * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< * raise ValueError * ipv4 = numbers[-1] */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyList_GET_SIZE(__pyx_v_numbers); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 331, __pyx_L1_error) - __pyx_t_7 = PyFloat_FromDouble(pow(256.0, ((double)(5 - __pyx_t_5)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyList_GET_SIZE(__pyx_v_numbers); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(pow(256.0, ((double)(5 - __pyx_t_5)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":332 + /* "w3lib/_url.pyx":331 * raise ValueError * if numbers[-1] >= 256 ** (5 - len(numbers)): * raise ValueError # <<<<<<<<<<<<<< @@ -9587,9 +9599,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p * counter = 0 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 332, __pyx_L1_error) + __PYX_ERR(0, 331, __pyx_L1_error) - /* "w3lib/_url.pyx":331 + /* "w3lib/_url.pyx":330 * if any(item > 255 for item in numbers[:-1]): * raise ValueError * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< @@ -9598,19 +9610,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":333 + /* "w3lib/_url.pyx":332 * if numbers[-1] >= 256 ** (5 - len(numbers)): * raise ValueError * ipv4 = numbers[-1] # <<<<<<<<<<<<<< * counter = 0 * for n in numbers[:-1]: */ - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_ipv4 = __pyx_t_8; __pyx_t_8 = 0; - /* "w3lib/_url.pyx":334 + /* "w3lib/_url.pyx":333 * raise ValueError * ipv4 = numbers[-1] * counter = 0 # <<<<<<<<<<<<<< @@ -9620,14 +9632,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(__pyx_int_0); __pyx_v_counter = __pyx_int_0; - /* "w3lib/_url.pyx":335 + /* "w3lib/_url.pyx":334 * ipv4 = numbers[-1] * counter = 0 * for n in numbers[:-1]: # <<<<<<<<<<<<<< * ipv4 += n * 256 ** (3 - counter) * counter += 1 */ - __pyx_t_8 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0; @@ -9636,53 +9648,53 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 335, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 334, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 334, __pyx_L1_error) #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_8); __pyx_t_8 = 0; - /* "w3lib/_url.pyx":336 + /* "w3lib/_url.pyx":335 * counter = 0 * for n in numbers[:-1]: * ipv4 += n * 256 ** (3 - counter) # <<<<<<<<<<<<<< * counter += 1 * return ipv4 */ - __pyx_t_8 = __Pyx_PyInt_SubtractCObj(__pyx_int_3, __pyx_v_counter, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_SubtractCObj(__pyx_int_3, __pyx_v_counter, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyNumber_Power(__pyx_int_256, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = PyNumber_Power(__pyx_int_256, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ipv4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ipv4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_ipv4, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":337 + /* "w3lib/_url.pyx":336 * for n in numbers[:-1]: * ipv4 += n * 256 ** (3 - counter) * counter += 1 # <<<<<<<<<<<<<< * return ipv4 * */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_counter, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_counter, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_counter, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":335 + /* "w3lib/_url.pyx":334 * ipv4 = numbers[-1] * counter = 0 * for n in numbers[:-1]: # <<<<<<<<<<<<<< @@ -9692,7 +9704,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":338 + /* "w3lib/_url.pyx":337 * ipv4 += n * 256 ** (3 - counter) * counter += 1 * return ipv4 # <<<<<<<<<<<<<< @@ -9700,12 +9712,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_ipv4))||((__pyx_v_ipv4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_ipv4))) __PYX_ERR(0, 338, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_ipv4))||((__pyx_v_ipv4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_ipv4))) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_INCREF(__pyx_v_ipv4); __pyx_r = ((PyObject*)__pyx_v_ipv4); goto __pyx_L0; - /* "w3lib/_url.pyx":319 + /* "w3lib/_url.pyx":318 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< @@ -9735,7 +9747,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":342 +/* "w3lib/_url.pyx":341 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< @@ -9751,7 +9763,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_17_domain_to_ascii = {"_domain_to_ascii", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_17_domain_to_ascii, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_16_domain_to_ascii, "_domain_to_ascii(unicode domain: str, *, be_strict: bool = False) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_17_domain_to_ascii = {"_domain_to_ascii", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_17_domain_to_ascii, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_16_domain_to_ascii}; static PyObject *__pyx_pw_5w3lib_4_url_17_domain_to_ascii(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -9798,18 +9811,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 341, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 341, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_domain_to_ascii") < 0)) __PYX_ERR(0, 342, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_domain_to_ascii") < 0)) __PYX_ERR(0, 341, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -9821,7 +9834,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_domain_to_ascii", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 342, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_domain_to_ascii", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 341, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9835,7 +9848,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain), (&PyUnicode_Type), 0, "domain", 1))) __PYX_ERR(0, 342, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain), (&PyUnicode_Type), 0, "domain", 1))) __PYX_ERR(0, 341, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_16_domain_to_ascii(__pyx_self, __pyx_v_domain, __pyx_v_be_strict); /* function exit code */ @@ -9870,96 +9883,96 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_domain_to_ascii(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_domain_to_ascii", 1); - /* "w3lib/_url.pyx":343 + /* "w3lib/_url.pyx":342 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: * result = _utr46._to_ascii( # <<<<<<<<<<<<<< * domain, * use_std3_ascii_rules=be_strict, */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utr46); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utr46); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_ascii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_ascii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":344 + /* "w3lib/_url.pyx":343 * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: * result = _utr46._to_ascii( * domain, # <<<<<<<<<<<<<< * use_std3_ascii_rules=be_strict, * check_hyphens=False, */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_domain); __Pyx_GIVEREF(__pyx_v_domain); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domain)) __PYX_ERR(0, 343, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domain)) __PYX_ERR(0, 342, __pyx_L1_error); - /* "w3lib/_url.pyx":345 + /* "w3lib/_url.pyx":344 * result = _utr46._to_ascii( * domain, * use_std3_ascii_rules=be_strict, # <<<<<<<<<<<<<< * check_hyphens=False, * check_bidi=True, */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_v_be_strict) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_v_be_strict) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - /* "w3lib/_url.pyx":346 + /* "w3lib/_url.pyx":345 * domain, * use_std3_ascii_rules=be_strict, * check_hyphens=False, # <<<<<<<<<<<<<< * check_bidi=True, * check_joiners=True, */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, Py_False) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, Py_False) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - /* "w3lib/_url.pyx":347 + /* "w3lib/_url.pyx":346 * use_std3_ascii_rules=be_strict, * check_hyphens=False, * check_bidi=True, # <<<<<<<<<<<<<< * check_joiners=True, * transitional_processing=False, */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, Py_True) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, Py_True) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - /* "w3lib/_url.pyx":348 + /* "w3lib/_url.pyx":347 * check_hyphens=False, * check_bidi=True, * check_joiners=True, # <<<<<<<<<<<<<< * transitional_processing=False, * verify_dns_length=be_strict, */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, Py_True) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, Py_True) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - /* "w3lib/_url.pyx":349 + /* "w3lib/_url.pyx":348 * check_bidi=True, * check_joiners=True, * transitional_processing=False, # <<<<<<<<<<<<<< * verify_dns_length=be_strict, * ) */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, Py_False) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, Py_False) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - /* "w3lib/_url.pyx":350 + /* "w3lib/_url.pyx":349 * check_joiners=True, * transitional_processing=False, * verify_dns_length=be_strict, # <<<<<<<<<<<<<< * ) * if not result: */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_v_be_strict) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_v_be_strict) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - /* "w3lib/_url.pyx":343 + /* "w3lib/_url.pyx":342 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: * result = _utr46._to_ascii( # <<<<<<<<<<<<<< * domain, * use_std3_ascii_rules=be_strict, */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9967,25 +9980,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_domain_to_ascii(CYTHON_UNUSED PyObject __pyx_v_result = __pyx_t_4; __pyx_t_4 = 0; - /* "w3lib/_url.pyx":352 + /* "w3lib/_url.pyx":351 * verify_dns_length=be_strict, * ) * if not result: # <<<<<<<<<<<<<< * raise ValueError( * f"Domain name {domain!r} is an empty string after conversion to " */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (unlikely(__pyx_t_6)) { - /* "w3lib/_url.pyx":354 + /* "w3lib/_url.pyx":353 * if not result: * raise ValueError( * f"Domain name {domain!r} is an empty string after conversion to " # <<<<<<<<<<<<<< * f"ASCII, which makes for an invalid domain name." * ) */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_8 = 127; @@ -9993,7 +10006,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_domain_to_ascii(CYTHON_UNUSED PyObject __pyx_t_7 += 12; __Pyx_GIVEREF(__pyx_kp_u_Domain_name); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Domain_name); - __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8; __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); @@ -10004,25 +10017,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_domain_to_ascii(CYTHON_UNUSED PyObject __pyx_t_7 += 86; __Pyx_GIVEREF(__pyx_kp_u_is_an_empty_string_after_conver); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_is_an_empty_string_after_conver); - __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":353 + /* "w3lib/_url.pyx":352 * ) * if not result: * raise ValueError( # <<<<<<<<<<<<<< * f"Domain name {domain!r} is an empty string after conversion to " * f"ASCII, which makes for an invalid domain name." */ - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 353, __pyx_L1_error) + __PYX_ERR(0, 352, __pyx_L1_error) - /* "w3lib/_url.pyx":352 + /* "w3lib/_url.pyx":351 * verify_dns_length=be_strict, * ) * if not result: # <<<<<<<<<<<<<< @@ -10031,7 +10044,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_domain_to_ascii(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":357 + /* "w3lib/_url.pyx":356 * f"ASCII, which makes for an invalid domain name." * ) * return result # <<<<<<<<<<<<<< @@ -10039,12 +10052,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_domain_to_ascii(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_result))) __PYX_ERR(0, 357, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_result))) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_INCREF(__pyx_v_result); __pyx_r = ((PyObject*)__pyx_v_result); goto __pyx_L0; - /* "w3lib/_url.pyx":342 + /* "w3lib/_url.pyx":341 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< @@ -10067,7 +10080,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_domain_to_ascii(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":361 +/* "w3lib/_url.pyx":360 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< @@ -10083,7 +10096,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_19_parse_host = {"_parse_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_19_parse_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_18_parse_host, "_parse_host(unicode input: str, *, is_special: bool = True) -> Union[str, int, List[int]]"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_19_parse_host = {"_parse_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_19_parse_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_18_parse_host}; static PyObject *__pyx_pw_5w3lib_4_url_19_parse_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -10115,7 +10129,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_is_special,0}; - /* "w3lib/_url.pyx":364 + /* "w3lib/_url.pyx":363 * input: str, * *, * is_special: bool = True, # <<<<<<<<<<<<<< @@ -10138,18 +10152,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_host") < 0)) __PYX_ERR(0, 361, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_host") < 0)) __PYX_ERR(0, 360, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -10161,7 +10175,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 361, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 360, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10175,10 +10189,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 362, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 361, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_18_parse_host(__pyx_self, __pyx_v_input, __pyx_v_is_special); - /* "w3lib/_url.pyx":361 + /* "w3lib/_url.pyx":360 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< @@ -10221,28 +10235,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_host", 1); - /* "w3lib/_url.pyx":366 + /* "w3lib/_url.pyx":365 * is_special: bool = True, * ) -> Union[str, int, List[int]]: * if input.startswith("["): # <<<<<<<<<<<<<< * if not input.endswith("]"): * raise ValueError */ - __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 365, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":367 + /* "w3lib/_url.pyx":366 * ) -> Union[str, int, List[int]]: * if input.startswith("["): * if not input.endswith("]"): # <<<<<<<<<<<<<< * raise ValueError * return _parse_ipv6(input[1:-1]) */ - __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__9, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__9, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 366, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":368 + /* "w3lib/_url.pyx":367 * if input.startswith("["): * if not input.endswith("]"): * raise ValueError # <<<<<<<<<<<<<< @@ -10250,9 +10264,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p * if not is_special: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 368, __pyx_L1_error) + __PYX_ERR(0, 367, __pyx_L1_error) - /* "w3lib/_url.pyx":367 + /* "w3lib/_url.pyx":366 * ) -> Union[str, int, List[int]]: * if input.startswith("["): * if not input.endswith("]"): # <<<<<<<<<<<<<< @@ -10261,7 +10275,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":369 + /* "w3lib/_url.pyx":368 * if not input.endswith("]"): * raise ValueError * return _parse_ipv6(input[1:-1]) # <<<<<<<<<<<<<< @@ -10269,9 +10283,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p * return _parse_opaque_host(input) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -10292,7 +10306,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -10300,7 +10314,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":366 + /* "w3lib/_url.pyx":365 * is_special: bool = True, * ) -> Union[str, int, List[int]]: * if input.startswith("["): # <<<<<<<<<<<<<< @@ -10309,18 +10323,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":370 + /* "w3lib/_url.pyx":369 * raise ValueError * return _parse_ipv6(input[1:-1]) * if not is_special: # <<<<<<<<<<<<<< * return _parse_opaque_host(input) * domain = unquote(input) */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_is_special); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_is_special); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 369, __pyx_L1_error) __pyx_t_1 = (!__pyx_t_2); if (__pyx_t_1) { - /* "w3lib/_url.pyx":371 + /* "w3lib/_url.pyx":370 * return _parse_ipv6(input[1:-1]) * if not is_special: * return _parse_opaque_host(input) # <<<<<<<<<<<<<< @@ -10328,7 +10342,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p * ascii_domain = _domain_to_ascii(domain) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_opaque_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_opaque_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -10348,7 +10362,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -10356,7 +10370,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":370 + /* "w3lib/_url.pyx":369 * raise ValueError * return _parse_ipv6(input[1:-1]) * if not is_special: # <<<<<<<<<<<<<< @@ -10365,14 +10379,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":372 + /* "w3lib/_url.pyx":371 * if not is_special: * return _parse_opaque_host(input) * domain = unquote(input) # <<<<<<<<<<<<<< * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unquote); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unquote); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -10392,21 +10406,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_domain = __pyx_t_3; __pyx_t_3 = 0; - /* "w3lib/_url.pyx":373 + /* "w3lib/_url.pyx":372 * return _parse_opaque_host(input) * domain = unquote(input) * ascii_domain = _domain_to_ascii(domain) # <<<<<<<<<<<<<< * for code_point in ascii_domain: * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_domain_to_ascii); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 373, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_domain_to_ascii); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -10426,14 +10440,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_domain}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_ascii_domain = __pyx_t_3; __pyx_t_3 = 0; - /* "w3lib/_url.pyx":374 + /* "w3lib/_url.pyx":373 * domain = unquote(input) * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: # <<<<<<<<<<<<<< @@ -10445,9 +10459,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ascii_domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ascii_domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 373, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { @@ -10455,28 +10469,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 374, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 373, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 373, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 374, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 373, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 373, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -10486,7 +10500,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 374, __pyx_L1_error) + else __PYX_ERR(0, 373, __pyx_L1_error) } break; } @@ -10495,20 +10509,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":375 + /* "w3lib/_url.pyx":374 * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< * raise ValueError * if _ends_in_number(ascii_domain): */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_t_1)) { - /* "w3lib/_url.pyx":376 + /* "w3lib/_url.pyx":375 * for code_point in ascii_domain: * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: * raise ValueError # <<<<<<<<<<<<<< @@ -10516,9 +10530,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p * return _parse_ipv4(ascii_domain) */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 376, __pyx_L1_error) + __PYX_ERR(0, 375, __pyx_L1_error) - /* "w3lib/_url.pyx":375 + /* "w3lib/_url.pyx":374 * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< @@ -10527,7 +10541,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":374 + /* "w3lib/_url.pyx":373 * domain = unquote(input) * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: # <<<<<<<<<<<<<< @@ -10537,14 +10551,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":377 + /* "w3lib/_url.pyx":376 * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: * raise ValueError * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< * return _parse_ipv4(ascii_domain) * return ascii_domain */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ends_in_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ends_in_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -10564,15 +10578,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":378 + /* "w3lib/_url.pyx":377 * raise ValueError * if _ends_in_number(ascii_domain): * return _parse_ipv4(ascii_domain) # <<<<<<<<<<<<<< @@ -10580,7 +10594,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -10600,7 +10614,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -10608,7 +10622,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":377 + /* "w3lib/_url.pyx":376 * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: * raise ValueError * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< @@ -10617,7 +10631,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":379 + /* "w3lib/_url.pyx":378 * if _ends_in_number(ascii_domain): * return _parse_ipv4(ascii_domain) * return ascii_domain # <<<<<<<<<<<<<< @@ -10629,7 +10643,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p __pyx_r = __pyx_v_ascii_domain; goto __pyx_L0; - /* "w3lib/_url.pyx":361 + /* "w3lib/_url.pyx":360 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< @@ -10654,7 +10668,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":383 +/* "w3lib/_url.pyx":382 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< @@ -10670,7 +10684,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_21_is_windows_drive_letter = {"_is_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_21_is_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_20_is_windows_drive_letter, "_is_windows_drive_letter(unicode input: str) -> bool"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_21_is_windows_drive_letter = {"_is_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_21_is_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_20_is_windows_drive_letter}; static PyObject *__pyx_pw_5w3lib_4_url_21_is_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -10715,12 +10730,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_windows_drive_letter") < 0)) __PYX_ERR(0, 383, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_windows_drive_letter") < 0)) __PYX_ERR(0, 382, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -10731,7 +10746,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 383, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_is_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 382, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10745,7 +10760,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 383, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 382, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_20_is_windows_drive_letter(__pyx_self, __pyx_v_input); /* function exit code */ @@ -10778,7 +10793,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_is_windows_drive_letter(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_is_windows_drive_letter", 1); - /* "w3lib/_url.pyx":384 + /* "w3lib/_url.pyx":383 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bool: * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" # <<<<<<<<<<<<<< @@ -10786,33 +10801,33 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_is_windows_drive_letter(CYTHON_UNUSED * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 383, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 == 2); if (__pyx_t_3) { } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 384, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { } else { - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 383, __pyx_L1_error) switch (__pyx_t_5) { case 58: case 0x7C: @@ -10823,7 +10838,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_is_windows_drive_letter(CYTHON_UNUSED break; } __pyx_t_7 = __pyx_t_3; - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; @@ -10832,7 +10847,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_is_windows_drive_letter(CYTHON_UNUSED __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":383 + /* "w3lib/_url.pyx":382 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< @@ -10853,7 +10868,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_is_windows_drive_letter(CYTHON_UNUSED return __pyx_r; } -/* "w3lib/_url.pyx":388 +/* "w3lib/_url.pyx":387 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< @@ -10869,7 +10884,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_23_starts_with_windows_drive_letter = {"_starts_with_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_23_starts_with_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_22_starts_with_windows_drive_letter, "_starts_with_windows_drive_letter(unicode input: str) -> bool"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_23_starts_with_windows_drive_letter = {"_starts_with_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_23_starts_with_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_22_starts_with_windows_drive_letter}; static PyObject *__pyx_pw_5w3lib_4_url_23_starts_with_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -10914,12 +10930,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_starts_with_windows_drive_letter") < 0)) __PYX_ERR(0, 388, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_starts_with_windows_drive_letter") < 0)) __PYX_ERR(0, 387, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -10930,7 +10946,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_starts_with_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 388, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_starts_with_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 387, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10944,7 +10960,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 388, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 387, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(__pyx_self, __pyx_v_input); /* function exit code */ @@ -10981,17 +10997,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(CYTHO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_starts_with_windows_drive_letter", 1); - /* "w3lib/_url.pyx":389 + /* "w3lib/_url.pyx":388 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bool: * input_length = len(input) # <<<<<<<<<<<<<< * return ( * input_length >= 2 */ - __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 388, __pyx_L1_error) __pyx_v_input_length = __pyx_t_1; - /* "w3lib/_url.pyx":390 + /* "w3lib/_url.pyx":389 * def _starts_with_windows_drive_letter(input: str) -> bool: * input_length = len(input) * return ( # <<<<<<<<<<<<<< @@ -11000,7 +11016,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(CYTHO */ __Pyx_XDECREF(__pyx_r); - /* "w3lib/_url.pyx":391 + /* "w3lib/_url.pyx":390 * input_length = len(input) * return ( * input_length >= 2 # <<<<<<<<<<<<<< @@ -11010,23 +11026,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(CYTHO __pyx_t_3 = (__pyx_v_input_length >= 2); if (__pyx_t_3) { } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L3_bool_binop_done; } - /* "w3lib/_url.pyx":392 + /* "w3lib/_url.pyx":391 * return ( * input_length >= 2 * and _is_windows_drive_letter(input[:2]) # <<<<<<<<<<<<<< * and (input_length == 2 or input[2] in "/\\?#") * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -11047,11 +11063,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(CYTHO __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 391, __pyx_L1_error) if (__pyx_t_3) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { @@ -11061,7 +11077,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(CYTHO goto __pyx_L3_bool_binop_done; } - /* "w3lib/_url.pyx":393 + /* "w3lib/_url.pyx":392 * input_length >= 2 * and _is_windows_drive_letter(input[:2]) * and (input_length == 2 or input[2] in "/\\?#") # <<<<<<<<<<<<<< @@ -11071,13 +11087,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(CYTHO __pyx_t_3 = (__pyx_v_input_length == 2); if (!__pyx_t_3) { } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_9 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == (Py_UCS4)-1)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == (Py_UCS4)-1)) __PYX_ERR(0, 392, __pyx_L1_error) switch (__pyx_t_9) { case 35: case 47: @@ -11090,7 +11106,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(CYTHO break; } __pyx_t_10 = __pyx_t_3; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __pyx_t_4 = 0; @@ -11099,7 +11115,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(CYTHO __pyx_t_2 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":388 + /* "w3lib/_url.pyx":387 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< @@ -11122,7 +11138,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(CYTHO return __pyx_r; } -/* "w3lib/_url.pyx":398 +/* "w3lib/_url.pyx":397 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< @@ -11138,7 +11154,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_25_is_double_dot_path_segment = {"_is_double_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_25_is_double_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_24_is_double_dot_path_segment, "_is_double_dot_path_segment(unicode input: str) -> bool"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_25_is_double_dot_path_segment = {"_is_double_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_25_is_double_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_24_is_double_dot_path_segment}; static PyObject *__pyx_pw_5w3lib_4_url_25_is_double_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -11183,12 +11200,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 397, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_double_dot_path_segment") < 0)) __PYX_ERR(0, 398, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_double_dot_path_segment") < 0)) __PYX_ERR(0, 397, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -11199,7 +11216,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_double_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 398, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_is_double_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 397, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11213,7 +11230,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 398, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 397, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_24_is_double_dot_path_segment(__pyx_self, __pyx_v_input); /* function exit code */ @@ -11243,7 +11260,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_is_double_dot_path_segment(CYTHON_UNUS int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_is_double_dot_path_segment", 1); - /* "w3lib/_url.pyx":399 + /* "w3lib/_url.pyx":398 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bool: * return input in ( # <<<<<<<<<<<<<< @@ -11253,65 +11270,65 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_is_double_dot_path_segment(CYTHON_UNUS __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_input); __pyx_t_1 = __pyx_v_input; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":398 + /* "w3lib/_url.pyx":397 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< @@ -11331,7 +11348,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_is_double_dot_path_segment(CYTHON_UNUS return __pyx_r; } -/* "w3lib/_url.pyx":413 +/* "w3lib/_url.pyx":412 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< @@ -11347,7 +11364,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_27_is_single_dot_path_segment = {"_is_single_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_27_is_single_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_26_is_single_dot_path_segment, "_is_single_dot_path_segment(unicode input: str) -> bool"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_27_is_single_dot_path_segment = {"_is_single_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_27_is_single_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_26_is_single_dot_path_segment}; static PyObject *__pyx_pw_5w3lib_4_url_27_is_single_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -11392,12 +11410,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_single_dot_path_segment") < 0)) __PYX_ERR(0, 413, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_single_dot_path_segment") < 0)) __PYX_ERR(0, 412, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -11408,7 +11426,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_single_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 413, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_is_single_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 412, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11422,7 +11440,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 413, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 412, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_26_is_single_dot_path_segment(__pyx_self, __pyx_v_input); /* function exit code */ @@ -11452,7 +11470,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_is_single_dot_path_segment(CYTHON_UNUS int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_is_single_dot_path_segment", 1); - /* "w3lib/_url.pyx":414 + /* "w3lib/_url.pyx":413 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bool: * return input in ( # <<<<<<<<<<<<<< @@ -11462,29 +11480,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_is_single_dot_path_segment(CYTHON_UNUS __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_input); __pyx_t_1 = __pyx_v_input; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":413 + /* "w3lib/_url.pyx":412 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< @@ -11504,7 +11522,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_is_single_dot_path_segment(CYTHON_UNUS return __pyx_r; } -/* "w3lib/_url.pyx":424 +/* "w3lib/_url.pyx":423 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -11520,7 +11538,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_29_idempotent_utf_8_percent_encode = {"_idempotent_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_29_idempotent_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_28_idempotent_utf_8_percent_encode, "_idempotent_utf_8_percent_encode(*, unicode input: str, int pointer: int, encode_set: _PercentEncodeSet) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_29_idempotent_utf_8_percent_encode = {"_idempotent_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_29_idempotent_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_28_idempotent_utf_8_percent_encode}; static PyObject *__pyx_pw_5w3lib_4_url_29_idempotent_utf_8_percent_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -11563,33 +11582,33 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L3_error) else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 424, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 423, __pyx_L3_error) } if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pointer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L3_error) else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_pointer); __PYX_ERR(0, 424, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_pointer); __PYX_ERR(0, 423, __pyx_L3_error) } if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encode_set)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L3_error) else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_encode_set); __PYX_ERR(0, 424, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_encode_set); __PYX_ERR(0, 423, __pyx_L3_error) } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "_idempotent_utf_8_percent_encode") < 0)) __PYX_ERR(0, 424, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "_idempotent_utf_8_percent_encode") < 0)) __PYX_ERR(0, 423, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 0)) { goto __pyx_L5_argtuple_error; } else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 424, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 423, __pyx_L3_error) } __pyx_v_input = ((PyObject*)values[0]); __pyx_v_pointer = ((PyObject*)values[1]); @@ -11597,7 +11616,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_idempotent_utf_8_percent_encode", 1, 0, 0, __pyx_nargs); __PYX_ERR(0, 424, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_idempotent_utf_8_percent_encode", 1, 0, 0, __pyx_nargs); __PYX_ERR(0, 423, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11611,8 +11630,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 425, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pointer), (&PyInt_Type), 0, "pointer", 1))) __PYX_ERR(0, 425, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 424, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pointer), (&PyInt_Type), 0, "pointer", 1))) __PYX_ERR(0, 424, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_pointer, __pyx_v_encode_set); /* function exit code */ @@ -11646,53 +11665,53 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_idempotent_utf_8_percent_encode", 1); - /* "w3lib/_url.pyx":427 + /* "w3lib/_url.pyx":426 * *, input: str, pointer: int, encode_set: _PercentEncodeSet * ) -> str: * code_point = input[pointer] # <<<<<<<<<<<<<< * if code_point == "%" and "%" in encode_set: * if ( */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 427, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 426, __pyx_L1_error) __pyx_v_code_point = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":428 + /* "w3lib/_url.pyx":427 * ) -> str: * code_point = input[pointer] * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< * if ( * pointer + 2 >= len(input) */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 427, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__4, __pyx_v_encode_set, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__4, __pyx_v_encode_set, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 427, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":430 + /* "w3lib/_url.pyx":429 * if code_point == "%" and "%" in encode_set: * if ( * pointer + 2 >= len(input) # <<<<<<<<<<<<<< * or input[pointer + 1] not in _ASCII_HEX_DIGIT * or input[pointer + 2] not in _ASCII_HEX_DIGIT */ - __pyx_t_1 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 430, __pyx_L1_error) - __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_3) { } else { @@ -11700,21 +11719,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON goto __pyx_L7_bool_binop_done; } - /* "w3lib/_url.pyx":431 + /* "w3lib/_url.pyx":430 * if ( * pointer + 2 >= len(input) * or input[pointer + 1] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * or input[pointer + 2] not in _ASCII_HEX_DIGIT * ): */ - __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_3) { @@ -11723,27 +11742,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON goto __pyx_L7_bool_binop_done; } - /* "w3lib/_url.pyx":432 + /* "w3lib/_url.pyx":431 * pointer + 2 >= len(input) * or input[pointer + 1] not in _ASCII_HEX_DIGIT * or input[pointer + 2] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * ): * return "%25" */ - __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; - /* "w3lib/_url.pyx":429 + /* "w3lib/_url.pyx":428 * code_point = input[pointer] * if code_point == "%" and "%" in encode_set: * if ( # <<<<<<<<<<<<<< @@ -11752,7 +11771,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON */ if (__pyx_t_2) { - /* "w3lib/_url.pyx":434 + /* "w3lib/_url.pyx":433 * or input[pointer + 2] not in _ASCII_HEX_DIGIT * ): * return "%25" # <<<<<<<<<<<<<< @@ -11764,7 +11783,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON __pyx_r = __pyx_kp_u_25; goto __pyx_L0; - /* "w3lib/_url.pyx":429 + /* "w3lib/_url.pyx":428 * code_point = input[pointer] * if code_point == "%" and "%" in encode_set: * if ( # <<<<<<<<<<<<<< @@ -11773,7 +11792,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON */ } - /* "w3lib/_url.pyx":435 + /* "w3lib/_url.pyx":434 * ): * return "%25" * return "%" # <<<<<<<<<<<<<< @@ -11785,7 +11804,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON __pyx_r = __pyx_kp_u__4; goto __pyx_L0; - /* "w3lib/_url.pyx":428 + /* "w3lib/_url.pyx":427 * ) -> str: * code_point = input[pointer] * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< @@ -11794,7 +11813,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON */ } - /* "w3lib/_url.pyx":436 + /* "w3lib/_url.pyx":435 * return "%25" * return "%" * return _utf_8_percent_encode(code_point, encode_set) # <<<<<<<<<<<<<< @@ -11802,7 +11821,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; __pyx_t_7 = 0; @@ -11822,16 +11841,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_code_point, __pyx_v_encode_set}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_6))) __PYX_ERR(0, 436, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_6))) __PYX_ERR(0, 435, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":424 + /* "w3lib/_url.pyx":423 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -11853,7 +11872,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON return __pyx_r; } -/* "w3lib/_url.pyx":439 +/* "w3lib/_url.pyx":438 * * * def _parse_url( # <<<<<<<<<<<<<< @@ -11871,38 +11890,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_44__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":442 + /* "w3lib/_url.pyx":441 * input: str, * *, * base_url: str = None, # <<<<<<<<<<<<<< * encoding: str = "utf-8", * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, Py_None) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, ((PyObject*)__pyx_kp_u_utf_8)) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, Py_None) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, ((PyObject*)__pyx_kp_u_utf_8)) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - /* "w3lib/_url.pyx":439 + /* "w3lib/_url.pyx":438 * * * def _parse_url( # <<<<<<<<<<<<<< * input: str, * *, */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_userinfo_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_path_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_path_percent_encode_set) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_query_percent_encode_set) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_special_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_special_query_percent_encode_set) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fragment_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_fragment_percent_encode_set) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_userinfo_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_path_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_path_percent_encode_set) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_query_percent_encode_set) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_special_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_special_query_percent_encode_set) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fragment_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_fragment_percent_encode_set) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 439, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 438, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -11928,7 +11947,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_30_parse_url, "Return a :class:`_URL` object built from *url*, *base_url* and\n *encoding*, following the URL parsing algorithm defined in the `URL living\n standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *userinfo_percent_encode_set* allows customizing which characters found\n in the user authroization part of the input URL need to be\n percent-encoded.\n "); +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_30_parse_url, "_parse_url(unicode input: str, *, unicode base_url: str = None, unicode encoding: str = u'utf-8', userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET) -> _URL\nReturn a :class:`_URL` object built from *url*, *base_url* and\n *encoding*, following the URL parsing algorithm defined in the `URL living\n standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *userinfo_percent_encode_set* allows customizing which characters found\n in the user authroization part of the input URL need to be\n percent-encoded.\n "); static PyMethodDef __pyx_mdef_5w3lib_4_url_31_parse_url = {"_parse_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_31_parse_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_30_parse_url}; static PyObject *__pyx_pw_5w3lib_4_url_31_parse_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -11968,7 +11987,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_base_url,&__pyx_n_s_encoding,&__pyx_n_s_userinfo_percent_encode_set,&__pyx_n_s_path_percent_encode_set,&__pyx_n_s_query_percent_encode_set,&__pyx_n_s_special_query_percent_encode_set,&__pyx_n_s_fragment_percent_encode_set,0}; __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); - /* "w3lib/_url.pyx":442 + /* "w3lib/_url.pyx":441 * input: str, * *, * base_url: str = None, # <<<<<<<<<<<<<< @@ -11997,7 +12016,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args > 0 && likely(kw_args <= 7)) { @@ -12005,12 +12024,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds for (index = 1; index < 8 && kw_args > 0; index++) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_url") < 0)) __PYX_ERR(0, 439, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_url") < 0)) __PYX_ERR(0, 438, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -12028,7 +12047,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 439, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 438, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12042,12 +12061,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 440, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_base_url), (&PyUnicode_Type), 1, "base_url", 1))) __PYX_ERR(0, 442, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 443, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 439, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_base_url), (&PyUnicode_Type), 1, "base_url", 1))) __PYX_ERR(0, 441, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 442, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_30_parse_url(__pyx_self, __pyx_v_input, __pyx_v_base_url, __pyx_v_encoding, __pyx_v_userinfo_percent_encode_set, __pyx_v_path_percent_encode_set, __pyx_v_query_percent_encode_set, __pyx_v_special_query_percent_encode_set, __pyx_v_fragment_percent_encode_set); - /* "w3lib/_url.pyx":439 + /* "w3lib/_url.pyx":438 * * * def _parse_url( # <<<<<<<<<<<<<< @@ -12114,7 +12133,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_input); __Pyx_INCREF(__pyx_v_encoding); - /* "w3lib/_url.pyx":475 + /* "w3lib/_url.pyx":474 * # output can match the original parsed URL if desired. * * if base_url is not None: # <<<<<<<<<<<<<< @@ -12124,24 +12143,24 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = (__pyx_v_base_url != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "w3lib/_url.pyx":476 + /* "w3lib/_url.pyx":475 * * if base_url is not None: * base = _parse_url(base_url, encoding=encoding) # <<<<<<<<<<<<<< * else: * base = None */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_base_url); __Pyx_GIVEREF(__pyx_v_base_url); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_base_url)) __PYX_ERR(0, 476, __pyx_L1_error); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_base_url)) __PYX_ERR(0, 475, __pyx_L1_error); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 476, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 475, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -12149,7 +12168,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_v_base = __pyx_t_5; __pyx_t_5 = 0; - /* "w3lib/_url.pyx":475 + /* "w3lib/_url.pyx":474 * # output can match the original parsed URL if desired. * * if base_url is not None: # <<<<<<<<<<<<<< @@ -12159,7 +12178,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L3; } - /* "w3lib/_url.pyx":478 + /* "w3lib/_url.pyx":477 * base = _parse_url(base_url, encoding=encoding) * else: * base = None # <<<<<<<<<<<<<< @@ -12172,14 +12191,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L3:; - /* "w3lib/_url.pyx":479 + /* "w3lib/_url.pyx":478 * else: * base = None * encoding = _get_output_encoding(encoding) # <<<<<<<<<<<<<< * * url = _URL() */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_output_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_output_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_6 = 0; @@ -12199,22 +12218,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 479, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_encoding, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":481 + /* "w3lib/_url.pyx":480 * encoding = _get_output_encoding(encoding) * * url = _URL() # <<<<<<<<<<<<<< * state = SCHEME_START * buffer = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_URL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_URL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_6 = 0; @@ -12234,26 +12253,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_url = __pyx_t_5; __pyx_t_5 = 0; - /* "w3lib/_url.pyx":482 + /* "w3lib/_url.pyx":481 * * url = _URL() * state = SCHEME_START # <<<<<<<<<<<<<< * buffer = "" * at_sign_seen = inside_brackets = skip_authority_shortcut = False */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SCHEME_START); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 482, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SCHEME_START); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_state = __pyx_t_5; __pyx_t_5 = 0; - /* "w3lib/_url.pyx":483 + /* "w3lib/_url.pyx":482 * url = _URL() * state = SCHEME_START * buffer = "" # <<<<<<<<<<<<<< @@ -12263,7 +12282,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __pyx_v_buffer = __pyx_kp_u__2; - /* "w3lib/_url.pyx":484 + /* "w3lib/_url.pyx":483 * state = SCHEME_START * buffer = "" * at_sign_seen = inside_brackets = skip_authority_shortcut = False # <<<<<<<<<<<<<< @@ -12274,7 +12293,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_v_inside_brackets = 0; __pyx_v_skip_authority_shortcut = 0; - /* "w3lib/_url.pyx":485 + /* "w3lib/_url.pyx":484 * buffer = "" * at_sign_seen = inside_brackets = skip_authority_shortcut = False * pointer = 0 # <<<<<<<<<<<<<< @@ -12284,39 +12303,39 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_int_0); __pyx_v_pointer = __pyx_int_0; - /* "w3lib/_url.pyx":487 + /* "w3lib/_url.pyx":486 * pointer = 0 * * input = input.strip(_C0_CONTROL_OR_SPACE) # <<<<<<<<<<<<<< * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) * input_length = len(input) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_input, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_input, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 487, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":488 + /* "w3lib/_url.pyx":487 * * input = input.strip(_C0_CONTROL_OR_SPACE) * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) # <<<<<<<<<<<<<< * input_length = len(input) * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_translate, __pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L1_error) + __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_translate, __pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 488, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":489 + /* "w3lib/_url.pyx":488 * input = input.strip(_C0_CONTROL_OR_SPACE) * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) * input_length = len(input) # <<<<<<<<<<<<<< @@ -12325,12 +12344,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ if (unlikely(__pyx_v_input == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 489, __pyx_L1_error) + __PYX_ERR(0, 488, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 489, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 488, __pyx_L1_error) __pyx_v_input_length = __pyx_t_7; - /* "w3lib/_url.pyx":491 + /* "w3lib/_url.pyx":490 * input_length = len(input) * * while True: # <<<<<<<<<<<<<< @@ -12339,7 +12358,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ while (1) { - /* "w3lib/_url.pyx":492 + /* "w3lib/_url.pyx":491 * * while True: * try: # <<<<<<<<<<<<<< @@ -12355,20 +12374,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { - /* "w3lib/_url.pyx":493 + /* "w3lib/_url.pyx":492 * while True: * try: * c: Optional[str] = input[pointer] # <<<<<<<<<<<<<< * except IndexError: * c = None */ - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L6_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 493, __pyx_L6_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 492, __pyx_L6_error) __Pyx_XDECREF_SET(__pyx_v_c, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":492 + /* "w3lib/_url.pyx":491 * * while True: * try: # <<<<<<<<<<<<<< @@ -12386,7 +12405,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":494 + /* "w3lib/_url.pyx":493 * try: * c: Optional[str] = input[pointer] * except IndexError: # <<<<<<<<<<<<<< @@ -12396,12 +12415,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); if (__pyx_t_6) { __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 494, __pyx_L8_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 493, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":495 + /* "w3lib/_url.pyx":494 * c: Optional[str] = input[pointer] * except IndexError: * c = None # <<<<<<<<<<<<<< @@ -12417,7 +12436,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } goto __pyx_L8_except_error; - /* "w3lib/_url.pyx":492 + /* "w3lib/_url.pyx":491 * * while True: * try: # <<<<<<<<<<<<<< @@ -12438,22 +12457,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_L13_try_end:; } - /* "w3lib/_url.pyx":497 + /* "w3lib/_url.pyx":496 * c = None * * if state == SCHEME_START: # <<<<<<<<<<<<<< * if c is not None and c in _ASCII_ALPHA: * assert isinstance(c, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SCHEME_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SCHEME_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 497, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":498 + /* "w3lib/_url.pyx":497 * * if state == SCHEME_START: * if c is not None and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< @@ -12466,15 +12485,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = __pyx_t_11; goto __pyx_L18_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_11; __pyx_L18_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":499 + /* "w3lib/_url.pyx":498 * if state == SCHEME_START: * if c is not None and c in _ASCII_ALPHA: * assert isinstance(c, str) # <<<<<<<<<<<<<< @@ -12486,38 +12505,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 499, __pyx_L1_error) + __PYX_ERR(0, 498, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 499, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 498, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":500 + /* "w3lib/_url.pyx":499 * if c is not None and c in _ASCII_ALPHA: * assert isinstance(c, str) * buffer += c # <<<<<<<<<<<<<< * state = SCHEME * else: */ - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":501 + /* "w3lib/_url.pyx":500 * assert isinstance(c, str) * buffer += c * state = SCHEME # <<<<<<<<<<<<<< * else: * state = NO_SCHEME */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":498 + /* "w3lib/_url.pyx":497 * * if state == SCHEME_START: * if c is not None and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< @@ -12527,7 +12546,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L17; } - /* "w3lib/_url.pyx":503 + /* "w3lib/_url.pyx":502 * state = SCHEME * else: * state = NO_SCHEME # <<<<<<<<<<<<<< @@ -12535,26 +12554,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NO_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NO_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":504 + /* "w3lib/_url.pyx":503 * else: * state = NO_SCHEME * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == SCHEME: */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); __pyx_t_4 = 0; } __pyx_L17:; - /* "w3lib/_url.pyx":497 + /* "w3lib/_url.pyx":496 * c = None * * if state == SCHEME_START: # <<<<<<<<<<<<<< @@ -12564,22 +12583,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":506 + /* "w3lib/_url.pyx":505 * pointer -= 1 * * elif state == SCHEME: # <<<<<<<<<<<<<< * if c is not None and c in _SCHEME_CHARS: * assert isinstance(c, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":507 + /* "w3lib/_url.pyx":506 * * elif state == SCHEME: * if c is not None and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< @@ -12592,15 +12611,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = __pyx_t_11; goto __pyx_L21_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SCHEME_CHARS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SCHEME_CHARS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_11; __pyx_L21_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":508 + /* "w3lib/_url.pyx":507 * elif state == SCHEME: * if c is not None and c in _SCHEME_CHARS: * assert isinstance(c, str) # <<<<<<<<<<<<<< @@ -12612,26 +12631,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 508, __pyx_L1_error) + __PYX_ERR(0, 507, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 508, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 507, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":509 + /* "w3lib/_url.pyx":508 * if c is not None and c in _SCHEME_CHARS: * assert isinstance(c, str) * buffer += c # <<<<<<<<<<<<<< * elif c == ":": * url.scheme = buffer.lower() */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":507 + /* "w3lib/_url.pyx":506 * * elif state == SCHEME: * if c is not None and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< @@ -12641,24 +12660,24 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L20; } - /* "w3lib/_url.pyx":510 + /* "w3lib/_url.pyx":509 * assert isinstance(c, str) * buffer += c * elif c == ":": # <<<<<<<<<<<<<< * url.scheme = buffer.lower() * buffer = "" */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 510, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 509, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":511 + /* "w3lib/_url.pyx":510 * buffer += c * elif c == ":": * url.scheme = buffer.lower() # <<<<<<<<<<<<<< * buffer = "" * if url.scheme == "file": */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_buffer, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_buffer, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -12678,14 +12697,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 511, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":512 + /* "w3lib/_url.pyx":511 * elif c == ":": * url.scheme = buffer.lower() * buffer = "" # <<<<<<<<<<<<<< @@ -12695,32 +12714,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":513 + /* "w3lib/_url.pyx":512 * url.scheme = buffer.lower() * buffer = "" * if url.scheme == "file": # <<<<<<<<<<<<<< * state = FILE * elif url.is_special: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":514 + /* "w3lib/_url.pyx":513 * buffer = "" * if url.scheme == "file": * state = FILE # <<<<<<<<<<<<<< * elif url.is_special: * if base is not None and base.scheme == url.scheme: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FILE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FILE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":513 + /* "w3lib/_url.pyx":512 * url.scheme = buffer.lower() * buffer = "" * if url.scheme == "file": # <<<<<<<<<<<<<< @@ -12730,20 +12749,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L23; } - /* "w3lib/_url.pyx":515 + /* "w3lib/_url.pyx":514 * if url.scheme == "file": * state = FILE * elif url.is_special: # <<<<<<<<<<<<<< * if base is not None and base.scheme == url.scheme: * state = SPECIAL_RELATIVE_OR_AUTHORITY */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":516 + /* "w3lib/_url.pyx":515 * state = FILE * elif url.is_special: * if base is not None and base.scheme == url.scheme: # <<<<<<<<<<<<<< @@ -12756,32 +12775,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = __pyx_t_11; goto __pyx_L25_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __pyx_t_11; __pyx_L25_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":517 + /* "w3lib/_url.pyx":516 * elif url.is_special: * if base is not None and base.scheme == url.scheme: * state = SPECIAL_RELATIVE_OR_AUTHORITY # <<<<<<<<<<<<<< * else: * state = SPECIAL_AUTHORITY_SLASHES */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":516 + /* "w3lib/_url.pyx":515 * state = FILE * elif url.is_special: * if base is not None and base.scheme == url.scheme: # <<<<<<<<<<<<<< @@ -12791,7 +12810,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L24; } - /* "w3lib/_url.pyx":519 + /* "w3lib/_url.pyx":518 * state = SPECIAL_RELATIVE_OR_AUTHORITY * else: * state = SPECIAL_AUTHORITY_SLASHES # <<<<<<<<<<<<<< @@ -12799,14 +12818,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * state = PATH_OR_AUTHORITY */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SPECIAL_AUTHORITY_SLASHES); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SPECIAL_AUTHORITY_SLASHES); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_5); __pyx_t_5 = 0; } __pyx_L24:; - /* "w3lib/_url.pyx":515 + /* "w3lib/_url.pyx":514 * if url.scheme == "file": * state = FILE * elif url.is_special: # <<<<<<<<<<<<<< @@ -12816,68 +12835,68 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L23; } - /* "w3lib/_url.pyx":520 + /* "w3lib/_url.pyx":519 * else: * state = SPECIAL_AUTHORITY_SLASHES * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = PATH_OR_AUTHORITY * pointer += 1 */ - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_input == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 520, __pyx_L1_error) + __PYX_ERR(0, 519, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 520, __pyx_L1_error) - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; goto __pyx_L27_bool_binop_done; } - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_11; __pyx_L27_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":521 + /* "w3lib/_url.pyx":520 * state = SPECIAL_AUTHORITY_SLASHES * elif pointer + 1 < len(input) and input[pointer + 1] == "/": * state = PATH_OR_AUTHORITY # <<<<<<<<<<<<<< * pointer += 1 * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH_OR_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 521, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH_OR_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":522 + /* "w3lib/_url.pyx":521 * elif pointer + 1 < len(input) and input[pointer + 1] == "/": * state = PATH_OR_AUTHORITY * pointer += 1 # <<<<<<<<<<<<<< * else: * url.path = "" */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":520 + /* "w3lib/_url.pyx":519 * else: * state = SPECIAL_AUTHORITY_SLASHES * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< @@ -12887,7 +12906,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L23; } - /* "w3lib/_url.pyx":524 + /* "w3lib/_url.pyx":523 * pointer += 1 * else: * url.path = "" # <<<<<<<<<<<<<< @@ -12895,23 +12914,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * else: */ /*else*/ { - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_kp_u__2) < 0) __PYX_ERR(0, 524, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_kp_u__2) < 0) __PYX_ERR(0, 523, __pyx_L1_error) - /* "w3lib/_url.pyx":525 + /* "w3lib/_url.pyx":524 * else: * url.path = "" * state = OPAQUE_PATH # <<<<<<<<<<<<<< * else: * buffer = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OPAQUE_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OPAQUE_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; } __pyx_L23:; - /* "w3lib/_url.pyx":510 + /* "w3lib/_url.pyx":509 * assert isinstance(c, str) * buffer += c * elif c == ":": # <<<<<<<<<<<<<< @@ -12921,7 +12940,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L20; } - /* "w3lib/_url.pyx":527 + /* "w3lib/_url.pyx":526 * state = OPAQUE_PATH * else: * buffer = "" # <<<<<<<<<<<<<< @@ -12932,19 +12951,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":528 + /* "w3lib/_url.pyx":527 * else: * buffer = "" * state = NO_SCHEME # <<<<<<<<<<<<<< * pointer = -1 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NO_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NO_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":529 + /* "w3lib/_url.pyx":528 * buffer = "" * state = NO_SCHEME * pointer = -1 # <<<<<<<<<<<<<< @@ -12956,7 +12975,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L20:; - /* "w3lib/_url.pyx":506 + /* "w3lib/_url.pyx":505 * pointer -= 1 * * elif state == SCHEME: # <<<<<<<<<<<<<< @@ -12966,22 +12985,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":531 + /* "w3lib/_url.pyx":530 * pointer = -1 * * elif state == NO_SCHEME: # <<<<<<<<<<<<<< * if base is None: * raise ValueError */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NO_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NO_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":532 + /* "w3lib/_url.pyx":531 * * elif state == NO_SCHEME: * if base is None: # <<<<<<<<<<<<<< @@ -12991,7 +13010,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = (__pyx_v_base == Py_None); if (unlikely(__pyx_t_1)) { - /* "w3lib/_url.pyx":533 + /* "w3lib/_url.pyx":532 * elif state == NO_SCHEME: * if base is None: * raise ValueError # <<<<<<<<<<<<<< @@ -12999,9 +13018,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * if c != "#": */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 533, __pyx_L1_error) + __PYX_ERR(0, 532, __pyx_L1_error) - /* "w3lib/_url.pyx":532 + /* "w3lib/_url.pyx":531 * * elif state == NO_SCHEME: * if base is None: # <<<<<<<<<<<<<< @@ -13010,14 +13029,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":534 + /* "w3lib/_url.pyx":533 * if base is None: * raise ValueError * if base.has_opaque_path(): # <<<<<<<<<<<<<< * if c != "#": * raise ValueError */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -13037,25 +13056,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 534, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":535 + /* "w3lib/_url.pyx":534 * raise ValueError * if base.has_opaque_path(): * if c != "#": # <<<<<<<<<<<<<< * raise ValueError * url.scheme = base.scheme */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 534, __pyx_L1_error) if (unlikely(__pyx_t_1)) { - /* "w3lib/_url.pyx":536 + /* "w3lib/_url.pyx":535 * if base.has_opaque_path(): * if c != "#": * raise ValueError # <<<<<<<<<<<<<< @@ -13063,9 +13082,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * url.path = base.path */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 536, __pyx_L1_error) + __PYX_ERR(0, 535, __pyx_L1_error) - /* "w3lib/_url.pyx":535 + /* "w3lib/_url.pyx":534 * raise ValueError * if base.has_opaque_path(): * if c != "#": # <<<<<<<<<<<<<< @@ -13074,64 +13093,64 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":537 + /* "w3lib/_url.pyx":536 * if c != "#": * raise ValueError * url.scheme = base.scheme # <<<<<<<<<<<<<< * url.path = base.path * url.query = base.query */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 537, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":538 + /* "w3lib/_url.pyx":537 * raise ValueError * url.scheme = base.scheme * url.path = base.path # <<<<<<<<<<<<<< * url.query = base.query * url.fragment = "" */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_3) < 0) __PYX_ERR(0, 538, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_3) < 0) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":539 + /* "w3lib/_url.pyx":538 * url.scheme = base.scheme * url.path = base.path * url.query = base.query # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_3) < 0) __PYX_ERR(0, 539, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_3) < 0) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":540 + /* "w3lib/_url.pyx":539 * url.path = base.path * url.query = base.query * url.fragment = "" # <<<<<<<<<<<<<< * state = FRAGMENT * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 540, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 539, __pyx_L1_error) - /* "w3lib/_url.pyx":541 + /* "w3lib/_url.pyx":540 * url.query = base.query * url.fragment = "" * state = FRAGMENT # <<<<<<<<<<<<<< * else: * if base.scheme != "file": */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":534 + /* "w3lib/_url.pyx":533 * if base is None: * raise ValueError * if base.has_opaque_path(): # <<<<<<<<<<<<<< @@ -13141,7 +13160,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L30; } - /* "w3lib/_url.pyx":543 + /* "w3lib/_url.pyx":542 * state = FRAGMENT * else: * if base.scheme != "file": # <<<<<<<<<<<<<< @@ -13149,25 +13168,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * else: */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":544 + /* "w3lib/_url.pyx":543 * else: * if base.scheme != "file": * state = RELATIVE # <<<<<<<<<<<<<< * else: * state = FILE */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RELATIVE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RELATIVE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":543 + /* "w3lib/_url.pyx":542 * state = FRAGMENT * else: * if base.scheme != "file": # <<<<<<<<<<<<<< @@ -13177,7 +13196,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L32; } - /* "w3lib/_url.pyx":546 + /* "w3lib/_url.pyx":545 * state = RELATIVE * else: * state = FILE # <<<<<<<<<<<<<< @@ -13185,28 +13204,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FILE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FILE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L32:; - /* "w3lib/_url.pyx":547 + /* "w3lib/_url.pyx":546 * else: * state = FILE * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L30:; - /* "w3lib/_url.pyx":531 + /* "w3lib/_url.pyx":530 * pointer = -1 * * elif state == NO_SCHEME: # <<<<<<<<<<<<<< @@ -13216,70 +13235,70 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":549 + /* "w3lib/_url.pyx":548 * pointer -= 1 * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< * if c == "/" and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":550 + /* "w3lib/_url.pyx":549 * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 549, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; goto __pyx_L34_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_11; __pyx_L34_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":551 + /* "w3lib/_url.pyx":550 * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: * if c == "/" and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< * pointer += 1 * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":552 + /* "w3lib/_url.pyx":551 * if c == "/" and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 # <<<<<<<<<<<<<< * else: * state = RELATIVE */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":550 + /* "w3lib/_url.pyx":549 * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< @@ -13289,7 +13308,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L33; } - /* "w3lib/_url.pyx":554 + /* "w3lib/_url.pyx":553 * pointer += 1 * else: * state = RELATIVE # <<<<<<<<<<<<<< @@ -13297,26 +13316,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RELATIVE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RELATIVE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":555 + /* "w3lib/_url.pyx":554 * else: * state = RELATIVE * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == PATH_OR_AUTHORITY: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L33:; - /* "w3lib/_url.pyx":549 + /* "w3lib/_url.pyx":548 * pointer -= 1 * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< @@ -13326,44 +13345,44 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":557 + /* "w3lib/_url.pyx":556 * pointer -= 1 * * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< * if c == "/": * state = AUTHORITY */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_OR_AUTHORITY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_OR_AUTHORITY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":558 + /* "w3lib/_url.pyx":557 * * elif state == PATH_OR_AUTHORITY: * if c == "/": # <<<<<<<<<<<<<< * state = AUTHORITY * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 557, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":559 + /* "w3lib/_url.pyx":558 * elif state == PATH_OR_AUTHORITY: * if c == "/": * state = AUTHORITY # <<<<<<<<<<<<<< * else: * state = PATH */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":558 + /* "w3lib/_url.pyx":557 * * elif state == PATH_OR_AUTHORITY: * if c == "/": # <<<<<<<<<<<<<< @@ -13373,7 +13392,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L36; } - /* "w3lib/_url.pyx":561 + /* "w3lib/_url.pyx":560 * state = AUTHORITY * else: * state = PATH # <<<<<<<<<<<<<< @@ -13381,26 +13400,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":562 + /* "w3lib/_url.pyx":561 * else: * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == RELATIVE: */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); __pyx_t_4 = 0; } __pyx_L36:; - /* "w3lib/_url.pyx":557 + /* "w3lib/_url.pyx":556 * pointer -= 1 * * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< @@ -13410,22 +13429,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":564 + /* "w3lib/_url.pyx":563 * pointer -= 1 * * elif state == RELATIVE: # <<<<<<<<<<<<<< * assert isinstance(base, _URL) * url.scheme = base.scheme */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RELATIVE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RELATIVE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":565 + /* "w3lib/_url.pyx":564 * * elif state == RELATIVE: * assert isinstance(base, _URL) # <<<<<<<<<<<<<< @@ -13434,71 +13453,71 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_URL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_URL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_IsInstance(__pyx_v_base, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_1 = PyObject_IsInstance(__pyx_v_base, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 565, __pyx_L1_error) + __PYX_ERR(0, 564, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 565, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 564, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":566 + /* "w3lib/_url.pyx":565 * elif state == RELATIVE: * assert isinstance(base, _URL) * url.scheme = base.scheme # <<<<<<<<<<<<<< * if c == "/" or url.is_special and c == "\\": * state = RELATIVE_SLASH */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":567 + /* "w3lib/_url.pyx":566 * assert isinstance(base, _URL) * url.scheme = base.scheme * if c == "/" or url.is_special and c == "\\": # <<<<<<<<<<<<<< * state = RELATIVE_SLASH * else: */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 566, __pyx_L1_error) if (!__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; goto __pyx_L38_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; goto __pyx_L38_bool_binop_done; } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 566, __pyx_L1_error) __pyx_t_1 = __pyx_t_11; __pyx_L38_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":568 + /* "w3lib/_url.pyx":567 * url.scheme = base.scheme * if c == "/" or url.is_special and c == "\\": * state = RELATIVE_SLASH # <<<<<<<<<<<<<< * else: * url.username = base.username */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RELATIVE_SLASH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RELATIVE_SLASH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":567 + /* "w3lib/_url.pyx":566 * assert isinstance(base, _URL) * url.scheme = base.scheme * if c == "/" or url.is_special and c == "\\": # <<<<<<<<<<<<<< @@ -13508,7 +13527,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L37; } - /* "w3lib/_url.pyx":570 + /* "w3lib/_url.pyx":569 * state = RELATIVE_SLASH * else: * url.username = base.username # <<<<<<<<<<<<<< @@ -13516,103 +13535,103 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * url.hostname = base.hostname */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_3) < 0) __PYX_ERR(0, 570, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_3) < 0) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":571 + /* "w3lib/_url.pyx":570 * else: * url.username = base.username * url.password = base.password # <<<<<<<<<<<<<< * url.hostname = base.hostname * url.port = base.port */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_3) < 0) __PYX_ERR(0, 571, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_3) < 0) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":572 + /* "w3lib/_url.pyx":571 * url.username = base.username * url.password = base.password * url.hostname = base.hostname # <<<<<<<<<<<<<< * url.port = base.port * url.path = base.path */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_3) < 0) __PYX_ERR(0, 572, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_3) < 0) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":573 + /* "w3lib/_url.pyx":572 * url.password = base.password * url.hostname = base.hostname * url.port = base.port # <<<<<<<<<<<<<< * url.path = base.path * url.query = base.query */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_3) < 0) __PYX_ERR(0, 573, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_3) < 0) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":574 + /* "w3lib/_url.pyx":573 * url.hostname = base.hostname * url.port = base.port * url.path = base.path # <<<<<<<<<<<<<< * url.query = base.query * if c == "?": */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_3) < 0) __PYX_ERR(0, 574, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_3) < 0) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":575 + /* "w3lib/_url.pyx":574 * url.port = base.port * url.path = base.path * url.query = base.query # <<<<<<<<<<<<<< * if c == "?": * url.query = "" */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_3) < 0) __PYX_ERR(0, 575, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_3) < 0) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":576 + /* "w3lib/_url.pyx":575 * url.path = base.path * url.query = base.query * if c == "?": # <<<<<<<<<<<<<< * url.query = "" * state = QUERY */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 575, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":577 + /* "w3lib/_url.pyx":576 * url.query = base.query * if c == "?": * url.query = "" # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 577, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 576, __pyx_L1_error) - /* "w3lib/_url.pyx":578 + /* "w3lib/_url.pyx":577 * if c == "?": * url.query = "" * state = QUERY # <<<<<<<<<<<<<< * elif c == "#": * url.fragment = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":576 + /* "w3lib/_url.pyx":575 * url.path = base.path * url.query = base.query * if c == "?": # <<<<<<<<<<<<<< @@ -13622,38 +13641,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L41; } - /* "w3lib/_url.pyx":579 + /* "w3lib/_url.pyx":578 * url.query = "" * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 578, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":580 + /* "w3lib/_url.pyx":579 * state = QUERY * elif c == "#": * url.fragment = "" # <<<<<<<<<<<<<< * state = FRAGMENT * elif pointer < input_length: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 579, __pyx_L1_error) - /* "w3lib/_url.pyx":581 + /* "w3lib/_url.pyx":580 * elif c == "#": * url.fragment = "" * state = FRAGMENT # <<<<<<<<<<<<<< * elif pointer < input_length: * url.query = None */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":579 + /* "w3lib/_url.pyx":578 * url.query = "" * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< @@ -13663,38 +13682,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L41; } - /* "w3lib/_url.pyx":582 + /* "w3lib/_url.pyx":581 * url.fragment = "" * state = FRAGMENT * elif pointer < input_length: # <<<<<<<<<<<<<< * url.query = None * _shorten_path(url) */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":583 + /* "w3lib/_url.pyx":582 * state = FRAGMENT * elif pointer < input_length: * url.query = None # <<<<<<<<<<<<<< * _shorten_path(url) * state = PATH */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 583, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 582, __pyx_L1_error) - /* "w3lib/_url.pyx":584 + /* "w3lib/_url.pyx":583 * elif pointer < input_length: * url.query = None * _shorten_path(url) # <<<<<<<<<<<<<< * state = PATH * pointer -= 1 */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -13714,37 +13733,37 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_url}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":585 + /* "w3lib/_url.pyx":584 * url.query = None * _shorten_path(url) * state = PATH # <<<<<<<<<<<<<< * pointer -= 1 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":586 + /* "w3lib/_url.pyx":585 * _shorten_path(url) * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == RELATIVE_SLASH: */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":582 + /* "w3lib/_url.pyx":581 * url.fragment = "" * state = FRAGMENT * elif pointer < input_length: # <<<<<<<<<<<<<< @@ -13756,7 +13775,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L37:; - /* "w3lib/_url.pyx":564 + /* "w3lib/_url.pyx":563 * pointer -= 1 * * elif state == RELATIVE: # <<<<<<<<<<<<<< @@ -13766,22 +13785,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":588 + /* "w3lib/_url.pyx":587 * pointer -= 1 * * elif state == RELATIVE_SLASH: # <<<<<<<<<<<<<< * assert isinstance(base, _URL) * if url.is_special and c is not None and c in "/\\": */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RELATIVE_SLASH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RELATIVE_SLASH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":589 + /* "w3lib/_url.pyx":588 * * elif state == RELATIVE_SLASH: * assert isinstance(base, _URL) # <<<<<<<<<<<<<< @@ -13790,29 +13809,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_URL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_URL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_IsInstance(__pyx_v_base, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_1 = PyObject_IsInstance(__pyx_v_base, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 589, __pyx_L1_error) + __PYX_ERR(0, 588, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 589, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 588, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":590 + /* "w3lib/_url.pyx":589 * elif state == RELATIVE_SLASH: * assert isinstance(base, _URL) * if url.is_special and c is not None and c in "/\\": # <<<<<<<<<<<<<< * assert isinstance(c, str) * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_11) { } else { @@ -13825,12 +13844,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = __pyx_t_11; goto __pyx_L43_bool_binop_done; } - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 589, __pyx_L1_error) __pyx_t_1 = __pyx_t_11; __pyx_L43_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":591 + /* "w3lib/_url.pyx":590 * assert isinstance(base, _URL) * if url.is_special and c is not None and c in "/\\": * assert isinstance(c, str) # <<<<<<<<<<<<<< @@ -13842,26 +13861,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 591, __pyx_L1_error) + __PYX_ERR(0, 590, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 591, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 590, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":592 + /* "w3lib/_url.pyx":591 * if url.is_special and c is not None and c in "/\\": * assert isinstance(c, str) * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< * elif c == "/": * state = AUTHORITY */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":590 + /* "w3lib/_url.pyx":589 * elif state == RELATIVE_SLASH: * assert isinstance(base, _URL) * if url.is_special and c is not None and c in "/\\": # <<<<<<<<<<<<<< @@ -13871,29 +13890,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L42; } - /* "w3lib/_url.pyx":593 + /* "w3lib/_url.pyx":592 * assert isinstance(c, str) * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * elif c == "/": # <<<<<<<<<<<<<< * state = AUTHORITY * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 592, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":594 + /* "w3lib/_url.pyx":593 * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * elif c == "/": * state = AUTHORITY # <<<<<<<<<<<<<< * else: * url.username = base.username */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":593 + /* "w3lib/_url.pyx":592 * assert isinstance(c, str) * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * elif c == "/": # <<<<<<<<<<<<<< @@ -13903,7 +13922,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L42; } - /* "w3lib/_url.pyx":596 + /* "w3lib/_url.pyx":595 * state = AUTHORITY * else: * url.username = base.username # <<<<<<<<<<<<<< @@ -13911,74 +13930,74 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * url.hostname = base.hostname */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_3) < 0) __PYX_ERR(0, 596, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_3) < 0) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":597 + /* "w3lib/_url.pyx":596 * else: * url.username = base.username * url.password = base.password # <<<<<<<<<<<<<< * url.hostname = base.hostname * url.port = base.port */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_3) < 0) __PYX_ERR(0, 597, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_3) < 0) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":598 + /* "w3lib/_url.pyx":597 * url.username = base.username * url.password = base.password * url.hostname = base.hostname # <<<<<<<<<<<<<< * url.port = base.port * state = PATH */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_3) < 0) __PYX_ERR(0, 598, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_3) < 0) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":599 + /* "w3lib/_url.pyx":598 * url.password = base.password * url.hostname = base.hostname * url.port = base.port # <<<<<<<<<<<<<< * state = PATH * pointer -= 1 */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_3) < 0) __PYX_ERR(0, 599, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_3) < 0) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":600 + /* "w3lib/_url.pyx":599 * url.hostname = base.hostname * url.port = base.port * state = PATH # <<<<<<<<<<<<<< * pointer -= 1 * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":601 + /* "w3lib/_url.pyx":600 * url.port = base.port * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == SPECIAL_AUTHORITY_SLASHES: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L42:; - /* "w3lib/_url.pyx":588 + /* "w3lib/_url.pyx":587 * pointer -= 1 * * elif state == RELATIVE_SLASH: # <<<<<<<<<<<<<< @@ -13988,70 +14007,70 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":603 + /* "w3lib/_url.pyx":602 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< * if c == "/" and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":604 + /* "w3lib/_url.pyx":603 * * elif state == SPECIAL_AUTHORITY_SLASHES: * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; goto __pyx_L47_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_11; __pyx_L47_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":605 + /* "w3lib/_url.pyx":604 * elif state == SPECIAL_AUTHORITY_SLASHES: * if c == "/" and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< * pointer += 1 * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":606 + /* "w3lib/_url.pyx":605 * if c == "/" and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 # <<<<<<<<<<<<<< * else: * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":604 + /* "w3lib/_url.pyx":603 * * elif state == SPECIAL_AUTHORITY_SLASHES: * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< @@ -14061,7 +14080,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L46; } - /* "w3lib/_url.pyx":608 + /* "w3lib/_url.pyx":607 * pointer += 1 * else: * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< @@ -14069,26 +14088,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":609 + /* "w3lib/_url.pyx":608 * else: * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L46:; - /* "w3lib/_url.pyx":603 + /* "w3lib/_url.pyx":602 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< @@ -14098,22 +14117,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":611 + /* "w3lib/_url.pyx":610 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< * if c is None or c not in "/\\": * state = AUTHORITY */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":612 + /* "w3lib/_url.pyx":611 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: * if c is None or c not in "/\\": # <<<<<<<<<<<<<< @@ -14126,36 +14145,36 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = __pyx_t_11; goto __pyx_L50_bool_binop_done; } - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 612, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 611, __pyx_L1_error) __pyx_t_1 = __pyx_t_11; __pyx_L50_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":613 + /* "w3lib/_url.pyx":612 * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: * if c is None or c not in "/\\": * state = AUTHORITY # <<<<<<<<<<<<<< * pointer -= 1 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":614 + /* "w3lib/_url.pyx":613 * if c is None or c not in "/\\": * state = AUTHORITY * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == AUTHORITY: */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":612 + /* "w3lib/_url.pyx":611 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: * if c is None or c not in "/\\": # <<<<<<<<<<<<<< @@ -14164,7 +14183,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":611 + /* "w3lib/_url.pyx":610 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< @@ -14174,22 +14193,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":616 + /* "w3lib/_url.pyx":615 * pointer -= 1 * * elif state == AUTHORITY: # <<<<<<<<<<<<<< * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 616, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":617 + /* "w3lib/_url.pyx":616 * * elif state == AUTHORITY: * if not skip_authority_shortcut: # <<<<<<<<<<<<<< @@ -14199,7 +14218,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = (!__pyx_v_skip_authority_shortcut); if (__pyx_t_1) { - /* "w3lib/_url.pyx":618 + /* "w3lib/_url.pyx":617 * elif state == AUTHORITY: * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) # <<<<<<<<<<<<<< @@ -14208,38 +14227,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ if (unlikely(__pyx_v_input == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "find"); - __PYX_ERR(0, 618, __pyx_L1_error) + __PYX_ERR(0, 617, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_Py_IsNone(__pyx_v_pointer) ? (0) : (__Pyx_PyIndex_AsSsize_t(__pyx_v_pointer))); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 618, __pyx_L1_error) - __pyx_t_12 = PyUnicode_Find(__pyx_v_input, __pyx_kp_u__16, __pyx_t_7, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-2))) __PYX_ERR(0, 618, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L1_error) + __pyx_t_7 = (__Pyx_Py_IsNone(__pyx_v_pointer) ? (0) : (__Pyx_PyIndex_AsSsize_t(__pyx_v_pointer))); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 617, __pyx_L1_error) + __pyx_t_12 = PyUnicode_Find(__pyx_v_input, __pyx_kp_u__16, __pyx_t_7, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-2))) __PYX_ERR(0, 617, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_at_sign_index, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":619 + /* "w3lib/_url.pyx":618 * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: # <<<<<<<<<<<<<< * state = HOST * else: */ - __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_at_sign_index, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 619, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_at_sign_index, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 618, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":620 + /* "w3lib/_url.pyx":619 * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: * state = HOST # <<<<<<<<<<<<<< * else: * skip_authority_shortcut = True */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_HOST); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_HOST); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":619 + /* "w3lib/_url.pyx":618 * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: # <<<<<<<<<<<<<< @@ -14249,7 +14268,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L53; } - /* "w3lib/_url.pyx":622 + /* "w3lib/_url.pyx":621 * state = HOST * else: * skip_authority_shortcut = True # <<<<<<<<<<<<<< @@ -14261,19 +14280,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L53:; - /* "w3lib/_url.pyx":623 + /* "w3lib/_url.pyx":622 * else: * skip_authority_shortcut = True * pointer -= 1 # <<<<<<<<<<<<<< * elif c == "@": * if at_sign_seen: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":617 + /* "w3lib/_url.pyx":616 * * elif state == AUTHORITY: * if not skip_authority_shortcut: # <<<<<<<<<<<<<< @@ -14283,17 +14302,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L52; } - /* "w3lib/_url.pyx":624 + /* "w3lib/_url.pyx":623 * skip_authority_shortcut = True * pointer -= 1 * elif c == "@": # <<<<<<<<<<<<<< * if at_sign_seen: * buffer = "%40" + buffer */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 624, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 623, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":625 + /* "w3lib/_url.pyx":624 * pointer -= 1 * elif c == "@": * if at_sign_seen: # <<<<<<<<<<<<<< @@ -14302,19 +14321,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ if (__pyx_v_at_sign_seen) { - /* "w3lib/_url.pyx":626 + /* "w3lib/_url.pyx":625 * elif c == "@": * if at_sign_seen: * buffer = "%40" + buffer # <<<<<<<<<<<<<< * at_sign_seen = True * for i, code_point in enumerate(buffer): */ - __pyx_t_3 = PyNumber_Add(__pyx_kp_u_40, __pyx_v_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_kp_u_40, __pyx_v_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":625 + /* "w3lib/_url.pyx":624 * pointer -= 1 * elif c == "@": * if at_sign_seen: # <<<<<<<<<<<<<< @@ -14323,7 +14342,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":627 + /* "w3lib/_url.pyx":626 * if at_sign_seen: * buffer = "%40" + buffer * at_sign_seen = True # <<<<<<<<<<<<<< @@ -14332,7 +14351,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_at_sign_seen = 1; - /* "w3lib/_url.pyx":628 + /* "w3lib/_url.pyx":627 * buffer = "%40" + buffer * at_sign_seen = True * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< @@ -14346,9 +14365,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 627, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_13)) { @@ -14356,28 +14375,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 628, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 627, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 627, __pyx_L1_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 628, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 627, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 627, __pyx_L1_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -14387,7 +14406,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 628, __pyx_L1_error) + else __PYX_ERR(0, 627, __pyx_L1_error) } break; } @@ -14397,44 +14416,44 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_5; __pyx_t_5 = 0; - /* "w3lib/_url.pyx":629 + /* "w3lib/_url.pyx":628 * at_sign_seen = True * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< * url._password_token_seen = True * continue */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 628, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; goto __pyx_L58_bool_binop_done; } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_14 = (!__pyx_t_11); __pyx_t_1 = __pyx_t_14; __pyx_L58_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":630 + /* "w3lib/_url.pyx":629 * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: * url._password_token_seen = True # <<<<<<<<<<<<<< * continue * encoded_code_points = _idempotent_utf_8_percent_encode( */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen, Py_True) < 0) __PYX_ERR(0, 630, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen, Py_True) < 0) __PYX_ERR(0, 629, __pyx_L1_error) - /* "w3lib/_url.pyx":631 + /* "w3lib/_url.pyx":630 * if code_point == ":" and not url._password_token_seen: * url._password_token_seen = True * continue # <<<<<<<<<<<<<< @@ -14443,7 +14462,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ goto __pyx_L55_continue; - /* "w3lib/_url.pyx":629 + /* "w3lib/_url.pyx":628 * at_sign_seen = True * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< @@ -14452,88 +14471,88 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":632 + /* "w3lib/_url.pyx":631 * url._password_token_seen = True * continue * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=buffer, * pointer=i, */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "w3lib/_url.pyx":633 + /* "w3lib/_url.pyx":632 * continue * encoded_code_points = _idempotent_utf_8_percent_encode( * input=buffer, # <<<<<<<<<<<<<< * pointer=i, * encode_set=userinfo_percent_encode_set, */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_buffer) < 0) __PYX_ERR(0, 633, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_buffer) < 0) __PYX_ERR(0, 632, __pyx_L1_error) - /* "w3lib/_url.pyx":634 + /* "w3lib/_url.pyx":633 * encoded_code_points = _idempotent_utf_8_percent_encode( * input=buffer, * pointer=i, # <<<<<<<<<<<<<< * encode_set=userinfo_percent_encode_set, * ) */ - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_i) < 0) __PYX_ERR(0, 633, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_i) < 0) __PYX_ERR(0, 632, __pyx_L1_error) - /* "w3lib/_url.pyx":635 + /* "w3lib/_url.pyx":634 * input=buffer, * pointer=i, * encode_set=userinfo_percent_encode_set, # <<<<<<<<<<<<<< * ) * if url._password_token_seen: */ - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 633, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 632, __pyx_L1_error) - /* "w3lib/_url.pyx":632 + /* "w3lib/_url.pyx":631 * url._password_token_seen = True * continue * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=buffer, * pointer=i, */ - __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_encoded_code_points, __pyx_t_15); __pyx_t_15 = 0; - /* "w3lib/_url.pyx":637 + /* "w3lib/_url.pyx":636 * encode_set=userinfo_percent_encode_set, * ) * if url._password_token_seen: # <<<<<<<<<<<<<< * url.password += encoded_code_points * else: */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":638 + /* "w3lib/_url.pyx":637 * ) * if url._password_token_seen: * url.password += encoded_code_points # <<<<<<<<<<<<<< * else: * url.username += encoded_code_points */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_15, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_15, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_2) < 0) __PYX_ERR(0, 638, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_2) < 0) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":637 + /* "w3lib/_url.pyx":636 * encode_set=userinfo_percent_encode_set, * ) * if url._password_token_seen: # <<<<<<<<<<<<<< @@ -14543,7 +14562,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L60; } - /* "w3lib/_url.pyx":640 + /* "w3lib/_url.pyx":639 * url.password += encoded_code_points * else: * url.username += encoded_code_points # <<<<<<<<<<<<<< @@ -14551,17 +14570,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * elif c is None or c in "/?#" or url.is_special and c == "\\": */ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_15) < 0) __PYX_ERR(0, 640, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_15) < 0) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __pyx_L60:; - /* "w3lib/_url.pyx":628 + /* "w3lib/_url.pyx":627 * buffer = "%40" + buffer * at_sign_seen = True * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< @@ -14573,7 +14592,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":641 + /* "w3lib/_url.pyx":640 * else: * url.username += encoded_code_points * buffer = "" # <<<<<<<<<<<<<< @@ -14583,7 +14602,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":624 + /* "w3lib/_url.pyx":623 * skip_authority_shortcut = True * pointer -= 1 * elif c == "@": # <<<<<<<<<<<<<< @@ -14593,7 +14612,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L52; } - /* "w3lib/_url.pyx":642 + /* "w3lib/_url.pyx":641 * url.username += encoded_code_points * buffer = "" * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< @@ -14606,27 +14625,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = __pyx_t_14; goto __pyx_L62_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 641, __pyx_L1_error) if (!__pyx_t_14) { } else { __pyx_t_1 = __pyx_t_14; goto __pyx_L62_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_14) { } else { __pyx_t_1 = __pyx_t_14; goto __pyx_L62_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 641, __pyx_L1_error) __pyx_t_1 = __pyx_t_14; __pyx_L62_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":643 + /* "w3lib/_url.pyx":642 * buffer = "" * elif c is None or c in "/?#" or url.is_special and c == "\\": * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< @@ -14638,13 +14657,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = __pyx_v_at_sign_seen; goto __pyx_L67_bool_binop_done; } - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 642, __pyx_L1_error) __pyx_t_11 = (!__pyx_t_14); __pyx_t_1 = __pyx_t_11; __pyx_L67_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "w3lib/_url.pyx":644 + /* "w3lib/_url.pyx":643 * elif c is None or c in "/?#" or url.is_special and c == "\\": * if at_sign_seen and not buffer: * raise ValueError # <<<<<<<<<<<<<< @@ -14652,9 +14671,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * buffer = "" */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 644, __pyx_L1_error) + __PYX_ERR(0, 643, __pyx_L1_error) - /* "w3lib/_url.pyx":643 + /* "w3lib/_url.pyx":642 * buffer = "" * elif c is None or c in "/?#" or url.is_special and c == "\\": * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< @@ -14663,23 +14682,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":645 + /* "w3lib/_url.pyx":644 * if at_sign_seen and not buffer: * raise ValueError * pointer -= len(buffer) + 1 # <<<<<<<<<<<<<< * buffer = "" * state = HOST */ - __pyx_t_12 = PyObject_Length(__pyx_v_buffer); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 645, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_12 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 645, __pyx_L1_error) + __pyx_t_12 = PyObject_Length(__pyx_v_buffer); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_12 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":646 + /* "w3lib/_url.pyx":645 * raise ValueError * pointer -= len(buffer) + 1 * buffer = "" # <<<<<<<<<<<<<< @@ -14689,19 +14708,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":647 + /* "w3lib/_url.pyx":646 * pointer -= len(buffer) + 1 * buffer = "" * state = HOST # <<<<<<<<<<<<<< * else: * buffer += c */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_HOST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_HOST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":642 + /* "w3lib/_url.pyx":641 * url.username += encoded_code_points * buffer = "" * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< @@ -14711,7 +14730,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L52; } - /* "w3lib/_url.pyx":649 + /* "w3lib/_url.pyx":648 * state = HOST * else: * buffer += c # <<<<<<<<<<<<<< @@ -14719,14 +14738,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * elif state == HOST: */ /*else*/ { - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); __pyx_t_4 = 0; } __pyx_L52:; - /* "w3lib/_url.pyx":616 + /* "w3lib/_url.pyx":615 * pointer -= 1 * * elif state == AUTHORITY: # <<<<<<<<<<<<<< @@ -14736,29 +14755,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":651 + /* "w3lib/_url.pyx":650 * buffer += c * * elif state == HOST: # <<<<<<<<<<<<<< * if c == ":" and not inside_brackets: * if not buffer: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_HOST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_HOST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 651, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":652 + /* "w3lib/_url.pyx":651 * * elif state == HOST: * if c == ":" and not inside_brackets: # <<<<<<<<<<<<<< * if not buffer: * raise ValueError */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 651, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; @@ -14769,18 +14788,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_L70_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":653 + /* "w3lib/_url.pyx":652 * elif state == HOST: * if c == ":" and not inside_brackets: * if not buffer: # <<<<<<<<<<<<<< * raise ValueError * host = _parse_host(buffer, is_special=url.is_special) */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 653, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 652, __pyx_L1_error) __pyx_t_11 = (!__pyx_t_1); if (unlikely(__pyx_t_11)) { - /* "w3lib/_url.pyx":654 + /* "w3lib/_url.pyx":653 * if c == ":" and not inside_brackets: * if not buffer: * raise ValueError # <<<<<<<<<<<<<< @@ -14788,9 +14807,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * url.hostname = host */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 654, __pyx_L1_error) + __PYX_ERR(0, 653, __pyx_L1_error) - /* "w3lib/_url.pyx":653 + /* "w3lib/_url.pyx":652 * elif state == HOST: * if c == ":" and not inside_brackets: * if not buffer: # <<<<<<<<<<<<<< @@ -14799,27 +14818,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":655 + /* "w3lib/_url.pyx":654 * if not buffer: * raise ValueError * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< * url.hostname = host * buffer = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_buffer)) __PYX_ERR(0, 655, __pyx_L1_error); - __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 655, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_buffer)) __PYX_ERR(0, 654, __pyx_L1_error); + __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_is_special, __pyx_t_2) < 0) __PYX_ERR(0, 655, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_is_special, __pyx_t_2) < 0) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -14827,16 +14846,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":656 + /* "w3lib/_url.pyx":655 * raise ValueError * host = _parse_host(buffer, is_special=url.is_special) * url.hostname = host # <<<<<<<<<<<<<< * buffer = "" * state = PORT */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 656, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 655, __pyx_L1_error) - /* "w3lib/_url.pyx":657 + /* "w3lib/_url.pyx":656 * host = _parse_host(buffer, is_special=url.is_special) * url.hostname = host * buffer = "" # <<<<<<<<<<<<<< @@ -14846,28 +14865,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":658 + /* "w3lib/_url.pyx":657 * url.hostname = host * buffer = "" * state = PORT # <<<<<<<<<<<<<< * url._port_token_seen = True * elif c is None or c in "/?#" or url.is_special and c == "\\": */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":659 + /* "w3lib/_url.pyx":658 * buffer = "" * state = PORT * url._port_token_seen = True # <<<<<<<<<<<<<< * elif c is None or c in "/?#" or url.is_special and c == "\\": * pointer -= 1 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen, Py_True) < 0) __PYX_ERR(0, 659, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen, Py_True) < 0) __PYX_ERR(0, 658, __pyx_L1_error) - /* "w3lib/_url.pyx":652 + /* "w3lib/_url.pyx":651 * * elif state == HOST: * if c == ":" and not inside_brackets: # <<<<<<<<<<<<<< @@ -14877,7 +14896,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L69; } - /* "w3lib/_url.pyx":660 + /* "w3lib/_url.pyx":659 * state = PORT * url._port_token_seen = True * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< @@ -14890,61 +14909,61 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_11 = __pyx_t_1; goto __pyx_L73_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 659, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_11 = __pyx_t_1; goto __pyx_L73_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { } else { __pyx_t_11 = __pyx_t_1; goto __pyx_L73_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 659, __pyx_L1_error) __pyx_t_11 = __pyx_t_1; __pyx_L73_bool_binop_done:; if (__pyx_t_11) { - /* "w3lib/_url.pyx":661 + /* "w3lib/_url.pyx":660 * url._port_token_seen = True * elif c is None or c in "/?#" or url.is_special and c == "\\": * pointer -= 1 # <<<<<<<<<<<<<< * if url.is_special and not buffer: * raise ValueError */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":662 + /* "w3lib/_url.pyx":661 * elif c is None or c in "/?#" or url.is_special and c == "\\": * pointer -= 1 * if url.is_special and not buffer: # <<<<<<<<<<<<<< * raise ValueError * host = _parse_host(buffer, is_special=url.is_special) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { } else { __pyx_t_11 = __pyx_t_1; goto __pyx_L78_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 661, __pyx_L1_error) __pyx_t_14 = (!__pyx_t_1); __pyx_t_11 = __pyx_t_14; __pyx_L78_bool_binop_done:; if (unlikely(__pyx_t_11)) { - /* "w3lib/_url.pyx":663 + /* "w3lib/_url.pyx":662 * pointer -= 1 * if url.is_special and not buffer: * raise ValueError # <<<<<<<<<<<<<< @@ -14952,9 +14971,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * url.hostname = host */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 663, __pyx_L1_error) + __PYX_ERR(0, 662, __pyx_L1_error) - /* "w3lib/_url.pyx":662 + /* "w3lib/_url.pyx":661 * elif c is None or c in "/?#" or url.is_special and c == "\\": * pointer -= 1 * if url.is_special and not buffer: # <<<<<<<<<<<<<< @@ -14963,27 +14982,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":664 + /* "w3lib/_url.pyx":663 * if url.is_special and not buffer: * raise ValueError * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< * url.hostname = host * buffer = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 664, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_buffer)) __PYX_ERR(0, 664, __pyx_L1_error); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_buffer)) __PYX_ERR(0, 663, __pyx_L1_error); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_is_special, __pyx_t_3) < 0) __PYX_ERR(0, 664, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_is_special, __pyx_t_3) < 0) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_15, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_15, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; @@ -14991,16 +15010,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":665 + /* "w3lib/_url.pyx":664 * raise ValueError * host = _parse_host(buffer, is_special=url.is_special) * url.hostname = host # <<<<<<<<<<<<<< * buffer = "" * state = PATH_START */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 665, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 664, __pyx_L1_error) - /* "w3lib/_url.pyx":666 + /* "w3lib/_url.pyx":665 * host = _parse_host(buffer, is_special=url.is_special) * url.hostname = host * buffer = "" # <<<<<<<<<<<<<< @@ -15010,19 +15029,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":667 + /* "w3lib/_url.pyx":666 * url.hostname = host * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< * else: * if c == "[": */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":660 + /* "w3lib/_url.pyx":659 * state = PORT * url._port_token_seen = True * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< @@ -15032,7 +15051,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L69; } - /* "w3lib/_url.pyx":669 + /* "w3lib/_url.pyx":668 * state = PATH_START * else: * if c == "[": # <<<<<<<<<<<<<< @@ -15040,10 +15059,10 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * elif c == "]": */ /*else*/ { - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 669, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) if (__pyx_t_11) { - /* "w3lib/_url.pyx":670 + /* "w3lib/_url.pyx":669 * else: * if c == "[": * inside_brackets = True # <<<<<<<<<<<<<< @@ -15052,7 +15071,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_inside_brackets = 1; - /* "w3lib/_url.pyx":669 + /* "w3lib/_url.pyx":668 * state = PATH_START * else: * if c == "[": # <<<<<<<<<<<<<< @@ -15062,17 +15081,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L80; } - /* "w3lib/_url.pyx":671 + /* "w3lib/_url.pyx":670 * if c == "[": * inside_brackets = True * elif c == "]": # <<<<<<<<<<<<<< * inside_brackets = False * buffer += c */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 671, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 670, __pyx_L1_error) if (__pyx_t_11) { - /* "w3lib/_url.pyx":672 + /* "w3lib/_url.pyx":671 * inside_brackets = True * elif c == "]": * inside_brackets = False # <<<<<<<<<<<<<< @@ -15081,7 +15100,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_inside_brackets = 0; - /* "w3lib/_url.pyx":671 + /* "w3lib/_url.pyx":670 * if c == "[": * inside_brackets = True * elif c == "]": # <<<<<<<<<<<<<< @@ -15091,21 +15110,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L80:; - /* "w3lib/_url.pyx":673 + /* "w3lib/_url.pyx":672 * elif c == "]": * inside_brackets = False * buffer += c # <<<<<<<<<<<<<< * * elif state == PORT: */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L69:; - /* "w3lib/_url.pyx":651 + /* "w3lib/_url.pyx":650 * buffer += c * * elif state == HOST: # <<<<<<<<<<<<<< @@ -15115,22 +15134,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":675 + /* "w3lib/_url.pyx":674 * buffer += c * * elif state == PORT: # <<<<<<<<<<<<<< * if c is not None and c in _ASCII_DIGIT: * assert isinstance(c, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_11) { - /* "w3lib/_url.pyx":676 + /* "w3lib/_url.pyx":675 * * elif state == PORT: * if c is not None and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< @@ -15143,15 +15162,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_11 = __pyx_t_14; goto __pyx_L82_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __pyx_t_14; __pyx_L82_bool_binop_done:; if (__pyx_t_11) { - /* "w3lib/_url.pyx":677 + /* "w3lib/_url.pyx":676 * elif state == PORT: * if c is not None and c in _ASCII_DIGIT: * assert isinstance(c, str) # <<<<<<<<<<<<<< @@ -15163,26 +15182,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_11 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_11)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 677, __pyx_L1_error) + __PYX_ERR(0, 676, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 677, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 676, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":678 + /* "w3lib/_url.pyx":677 * if c is not None and c in _ASCII_DIGIT: * assert isinstance(c, str) * buffer += c # <<<<<<<<<<<<<< * elif c is None or c in "/?#" or url.is_special and c == "\\": * if buffer: */ - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":676 + /* "w3lib/_url.pyx":675 * * elif state == PORT: * if c is not None and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< @@ -15192,7 +15211,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L81; } - /* "w3lib/_url.pyx":679 + /* "w3lib/_url.pyx":678 * assert isinstance(c, str) * buffer += c * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< @@ -15205,61 +15224,61 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_11 = __pyx_t_14; goto __pyx_L84_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 678, __pyx_L1_error) if (!__pyx_t_14) { } else { __pyx_t_11 = __pyx_t_14; goto __pyx_L84_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_14) { } else { __pyx_t_11 = __pyx_t_14; goto __pyx_L84_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 678, __pyx_L1_error) __pyx_t_11 = __pyx_t_14; __pyx_L84_bool_binop_done:; if (likely(__pyx_t_11)) { - /* "w3lib/_url.pyx":680 + /* "w3lib/_url.pyx":679 * buffer += c * elif c is None or c in "/?#" or url.is_special and c == "\\": * if buffer: # <<<<<<<<<<<<<< * port = int(buffer) * if port > 2**16 - 1: */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) if (__pyx_t_11) { - /* "w3lib/_url.pyx":681 + /* "w3lib/_url.pyx":680 * elif c is None or c in "/?#" or url.is_special and c == "\\": * if buffer: * port = int(buffer) # <<<<<<<<<<<<<< * if port > 2**16 - 1: * raise ValueError */ - __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_port, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":682 + /* "w3lib/_url.pyx":681 * if buffer: * port = int(buffer) * if port > 2**16 - 1: # <<<<<<<<<<<<<< * raise ValueError * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_port, __pyx_int_65535, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_port, __pyx_int_65535, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_t_11)) { - /* "w3lib/_url.pyx":683 + /* "w3lib/_url.pyx":682 * port = int(buffer) * if port > 2**16 - 1: * raise ValueError # <<<<<<<<<<<<<< @@ -15267,9 +15286,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * url._default_port_seen = url.port is None */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 683, __pyx_L1_error) + __PYX_ERR(0, 682, __pyx_L1_error) - /* "w3lib/_url.pyx":682 + /* "w3lib/_url.pyx":681 * if buffer: * port = int(buffer) * if port > 2**16 - 1: # <<<<<<<<<<<<<< @@ -15278,19 +15297,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":684 + /* "w3lib/_url.pyx":683 * if port > 2**16 - 1: * raise ValueError * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port # <<<<<<<<<<<<<< * url._default_port_seen = url.port is None * buffer = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 684, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -15311,13 +15330,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 684, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_port, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_port, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 684, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_11) { __Pyx_INCREF(Py_None); @@ -15326,26 +15345,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_port); __pyx_t_4 = __pyx_v_port; } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_4) < 0) __PYX_ERR(0, 684, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_4) < 0) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":685 + /* "w3lib/_url.pyx":684 * raise ValueError * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port * url._default_port_seen = url.port is None # <<<<<<<<<<<<<< * buffer = "" * state = PATH_START */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = (__pyx_t_4 == Py_None); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen, __pyx_t_4) < 0) __PYX_ERR(0, 685, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen, __pyx_t_4) < 0) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":686 + /* "w3lib/_url.pyx":685 * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port * url._default_port_seen = url.port is None * buffer = "" # <<<<<<<<<<<<<< @@ -15355,7 +15374,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":680 + /* "w3lib/_url.pyx":679 * buffer += c * elif c is None or c in "/?#" or url.is_special and c == "\\": * if buffer: # <<<<<<<<<<<<<< @@ -15364,31 +15383,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":687 + /* "w3lib/_url.pyx":686 * url._default_port_seen = url.port is None * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< * pointer -= 1 * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":688 + /* "w3lib/_url.pyx":687 * buffer = "" * state = PATH_START * pointer -= 1 # <<<<<<<<<<<<<< * else: * raise ValueError */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":679 + /* "w3lib/_url.pyx":678 * assert isinstance(c, str) * buffer += c * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< @@ -15398,7 +15417,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L81; } - /* "w3lib/_url.pyx":690 + /* "w3lib/_url.pyx":689 * pointer -= 1 * else: * raise ValueError # <<<<<<<<<<<<<< @@ -15407,11 +15426,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ /*else*/ { __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 690, __pyx_L1_error) + __PYX_ERR(0, 689, __pyx_L1_error) } __pyx_L81:; - /* "w3lib/_url.pyx":675 + /* "w3lib/_url.pyx":674 * buffer += c * * elif state == PORT: # <<<<<<<<<<<<<< @@ -15421,40 +15440,40 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":692 + /* "w3lib/_url.pyx":691 * raise ValueError * * elif state == FILE: # <<<<<<<<<<<<<< * url.scheme = "file" * url.hostname = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FILE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FILE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_11) { - /* "w3lib/_url.pyx":693 + /* "w3lib/_url.pyx":692 * * elif state == FILE: * url.scheme = "file" # <<<<<<<<<<<<<< * url.hostname = "" * if c is not None and c in "/\\": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_n_u_file) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_n_u_file) < 0) __PYX_ERR(0, 692, __pyx_L1_error) - /* "w3lib/_url.pyx":694 + /* "w3lib/_url.pyx":693 * elif state == FILE: * url.scheme = "file" * url.hostname = "" # <<<<<<<<<<<<<< * if c is not None and c in "/\\": * assert isinstance(c, str) */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 694, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - /* "w3lib/_url.pyx":695 + /* "w3lib/_url.pyx":694 * url.scheme = "file" * url.hostname = "" * if c is not None and c in "/\\": # <<<<<<<<<<<<<< @@ -15467,12 +15486,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_11 = __pyx_t_14; goto __pyx_L91_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 694, __pyx_L1_error) __pyx_t_11 = __pyx_t_14; __pyx_L91_bool_binop_done:; if (__pyx_t_11) { - /* "w3lib/_url.pyx":696 + /* "w3lib/_url.pyx":695 * url.hostname = "" * if c is not None and c in "/\\": * assert isinstance(c, str) # <<<<<<<<<<<<<< @@ -15484,26 +15503,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_11 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_11)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 696, __pyx_L1_error) + __PYX_ERR(0, 695, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 696, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 695, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":697 + /* "w3lib/_url.pyx":696 * if c is not None and c in "/\\": * assert isinstance(c, str) * state = FILE_SLASH # <<<<<<<<<<<<<< * elif base is not None and base.scheme == "file": * url.hostname = base.hostname */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FILE_SLASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FILE_SLASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":695 + /* "w3lib/_url.pyx":694 * url.scheme = "file" * url.hostname = "" * if c is not None and c in "/\\": # <<<<<<<<<<<<<< @@ -15513,7 +15532,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L90; } - /* "w3lib/_url.pyx":698 + /* "w3lib/_url.pyx":697 * assert isinstance(c, str) * state = FILE_SLASH * elif base is not None and base.scheme == "file": # <<<<<<<<<<<<<< @@ -15526,82 +15545,82 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_11 = __pyx_t_14; goto __pyx_L93_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __pyx_t_14; __pyx_L93_bool_binop_done:; if (__pyx_t_11) { - /* "w3lib/_url.pyx":699 + /* "w3lib/_url.pyx":698 * state = FILE_SLASH * elif base is not None and base.scheme == "file": * url.hostname = base.hostname # <<<<<<<<<<<<<< * url.path = base.path * url.query = base.query */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_2) < 0) __PYX_ERR(0, 699, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_2) < 0) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":700 + /* "w3lib/_url.pyx":699 * elif base is not None and base.scheme == "file": * url.hostname = base.hostname * url.path = base.path # <<<<<<<<<<<<<< * url.query = base.query * if c == "?": */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_2) < 0) __PYX_ERR(0, 700, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_2) < 0) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":701 + /* "w3lib/_url.pyx":700 * url.hostname = base.hostname * url.path = base.path * url.query = base.query # <<<<<<<<<<<<<< * if c == "?": * url.query = "" */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_2) < 0) __PYX_ERR(0, 701, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_2) < 0) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":702 + /* "w3lib/_url.pyx":701 * url.path = base.path * url.query = base.query * if c == "?": # <<<<<<<<<<<<<< * url.query = "" * state = QUERY */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 702, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 701, __pyx_L1_error) if (__pyx_t_11) { - /* "w3lib/_url.pyx":703 + /* "w3lib/_url.pyx":702 * url.query = base.query * if c == "?": * url.query = "" # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 703, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 702, __pyx_L1_error) - /* "w3lib/_url.pyx":704 + /* "w3lib/_url.pyx":703 * if c == "?": * url.query = "" * state = QUERY # <<<<<<<<<<<<<< * elif c == "#": * url.fragment = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":702 + /* "w3lib/_url.pyx":701 * url.path = base.path * url.query = base.query * if c == "?": # <<<<<<<<<<<<<< @@ -15611,38 +15630,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L95; } - /* "w3lib/_url.pyx":705 + /* "w3lib/_url.pyx":704 * url.query = "" * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 705, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 704, __pyx_L1_error) if (__pyx_t_11) { - /* "w3lib/_url.pyx":706 + /* "w3lib/_url.pyx":705 * state = QUERY * elif c == "#": * url.fragment = "" # <<<<<<<<<<<<<< * state = FRAGMENT * elif c is not None: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 706, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 705, __pyx_L1_error) - /* "w3lib/_url.pyx":707 + /* "w3lib/_url.pyx":706 * elif c == "#": * url.fragment = "" * state = FRAGMENT # <<<<<<<<<<<<<< * elif c is not None: * assert isinstance(c, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":705 + /* "w3lib/_url.pyx":704 * url.query = "" * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< @@ -15652,7 +15671,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L95; } - /* "w3lib/_url.pyx":708 + /* "w3lib/_url.pyx":707 * url.fragment = "" * state = FRAGMENT * elif c is not None: # <<<<<<<<<<<<<< @@ -15662,7 +15681,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); if (__pyx_t_11) { - /* "w3lib/_url.pyx":709 + /* "w3lib/_url.pyx":708 * state = FRAGMENT * elif c is not None: * assert isinstance(c, str) # <<<<<<<<<<<<<< @@ -15674,34 +15693,34 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_11 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_11)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 709, __pyx_L1_error) + __PYX_ERR(0, 708, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 709, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 708, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":710 + /* "w3lib/_url.pyx":709 * elif c is not None: * assert isinstance(c, str) * url.query = None # <<<<<<<<<<<<<< * if not _starts_with_windows_drive_letter(input[pointer:]): * _shorten_path(url) */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 710, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 709, __pyx_L1_error) - /* "w3lib/_url.pyx":711 + /* "w3lib/_url.pyx":710 * assert isinstance(c, str) * url.query = None * if not _starts_with_windows_drive_letter(input[pointer:]): # <<<<<<<<<<<<<< * _shorten_path(url) * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__pyx_v_input == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 711, __pyx_L1_error) + __PYX_ERR(0, 710, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_pointer); __pyx_t_3 = __pyx_v_pointer; @@ -15709,11 +15728,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py if (__pyx_t_11) { __pyx_t_12 = 0; } else { - __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 710, __pyx_L1_error) __pyx_t_12 = __pyx_t_7; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_12, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_12, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_15 = NULL; __pyx_t_6 = 0; @@ -15734,23 +15753,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_14 = (!__pyx_t_11); if (__pyx_t_14) { - /* "w3lib/_url.pyx":712 + /* "w3lib/_url.pyx":711 * url.query = None * if not _starts_with_windows_drive_letter(input[pointer:]): * _shorten_path(url) # <<<<<<<<<<<<<< * else: * url.path = [] */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_6 = 0; @@ -15770,13 +15789,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_url}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":711 + /* "w3lib/_url.pyx":710 * assert isinstance(c, str) * url.query = None * if not _starts_with_windows_drive_letter(input[pointer:]): # <<<<<<<<<<<<<< @@ -15786,7 +15805,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L96; } - /* "w3lib/_url.pyx":714 + /* "w3lib/_url.pyx":713 * _shorten_path(url) * else: * url.path = [] # <<<<<<<<<<<<<< @@ -15794,38 +15813,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * pointer -= 1 */ /*else*/ { - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_2) < 0) __PYX_ERR(0, 714, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_2) < 0) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L96:; - /* "w3lib/_url.pyx":715 + /* "w3lib/_url.pyx":714 * else: * url.path = [] * state = PATH # <<<<<<<<<<<<<< * pointer -= 1 * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":716 + /* "w3lib/_url.pyx":715 * url.path = [] * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * else: * state = PATH */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":708 + /* "w3lib/_url.pyx":707 * url.fragment = "" * state = FRAGMENT * elif c is not None: # <<<<<<<<<<<<<< @@ -15835,7 +15854,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L95:; - /* "w3lib/_url.pyx":698 + /* "w3lib/_url.pyx":697 * assert isinstance(c, str) * state = FILE_SLASH * elif base is not None and base.scheme == "file": # <<<<<<<<<<<<<< @@ -15845,7 +15864,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L90; } - /* "w3lib/_url.pyx":718 + /* "w3lib/_url.pyx":717 * pointer -= 1 * else: * state = PATH # <<<<<<<<<<<<<< @@ -15853,26 +15872,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":719 + /* "w3lib/_url.pyx":718 * else: * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == FILE_SLASH: */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); __pyx_t_2 = 0; } __pyx_L90:; - /* "w3lib/_url.pyx":692 + /* "w3lib/_url.pyx":691 * raise ValueError * * elif state == FILE: # <<<<<<<<<<<<<< @@ -15882,22 +15901,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":721 + /* "w3lib/_url.pyx":720 * pointer -= 1 * * elif state == FILE_SLASH: # <<<<<<<<<<<<<< * assert isinstance(url.path, list) * if c is not None and c in "/\\": */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FILE_SLASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FILE_SLASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_14) { - /* "w3lib/_url.pyx":722 + /* "w3lib/_url.pyx":721 * * elif state == FILE_SLASH: * assert isinstance(url.path, list) # <<<<<<<<<<<<<< @@ -15906,20 +15925,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_14 = PyList_Check(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_14)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 722, __pyx_L1_error) + __PYX_ERR(0, 721, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 722, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 721, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":723 + /* "w3lib/_url.pyx":722 * elif state == FILE_SLASH: * assert isinstance(url.path, list) * if c is not None and c in "/\\": # <<<<<<<<<<<<<< @@ -15932,12 +15951,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_14 = __pyx_t_11; goto __pyx_L98_bool_binop_done; } - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 722, __pyx_L1_error) __pyx_t_14 = __pyx_t_11; __pyx_L98_bool_binop_done:; if (__pyx_t_14) { - /* "w3lib/_url.pyx":724 + /* "w3lib/_url.pyx":723 * assert isinstance(url.path, list) * if c is not None and c in "/\\": * assert isinstance(c, str) # <<<<<<<<<<<<<< @@ -15949,26 +15968,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_14 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_14)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 724, __pyx_L1_error) + __PYX_ERR(0, 723, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 724, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 723, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":725 + /* "w3lib/_url.pyx":724 * if c is not None and c in "/\\": * assert isinstance(c, str) * state = FILE_HOST # <<<<<<<<<<<<<< * else: * if base is not None and base.scheme == "file": */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FILE_HOST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FILE_HOST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":723 + /* "w3lib/_url.pyx":722 * elif state == FILE_SLASH: * assert isinstance(url.path, list) * if c is not None and c in "/\\": # <<<<<<<<<<<<<< @@ -15978,7 +15997,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L97; } - /* "w3lib/_url.pyx":727 + /* "w3lib/_url.pyx":726 * state = FILE_HOST * else: * if base is not None and base.scheme == "file": # <<<<<<<<<<<<<< @@ -15992,37 +16011,37 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_14 = __pyx_t_11; goto __pyx_L101_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_14 = __pyx_t_11; __pyx_L101_bool_binop_done:; if (__pyx_t_14) { - /* "w3lib/_url.pyx":728 + /* "w3lib/_url.pyx":727 * else: * if base is not None and base.scheme == "file": * url.hostname = base.hostname # <<<<<<<<<<<<<< * if not _starts_with_windows_drive_letter( * input[pointer:] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 728, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":729 + /* "w3lib/_url.pyx":728 * if base is not None and base.scheme == "file": * url.hostname = base.hostname * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< * input[pointer:] * ) and _is_windows_drive_letter(base.path[0]): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":730 + /* "w3lib/_url.pyx":729 * url.hostname = base.hostname * if not _starts_with_windows_drive_letter( * input[pointer:] # <<<<<<<<<<<<<< @@ -16031,7 +16050,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ if (unlikely(__pyx_v_input == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 730, __pyx_L1_error) + __PYX_ERR(0, 729, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_pointer); __pyx_t_3 = __pyx_v_pointer; @@ -16039,11 +16058,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py if (__pyx_t_11) { __pyx_t_12 = 0; } else { - __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 729, __pyx_L1_error) __pyx_t_12 = __pyx_t_7; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_12, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_12, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_15 = NULL; __pyx_t_6 = 0; @@ -16064,19 +16083,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 729, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "w3lib/_url.pyx":729 + /* "w3lib/_url.pyx":728 * if base is not None and base.scheme == "file": * url.hostname = base.hostname * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< * input[pointer:] * ) and _is_windows_drive_letter(base.path[0]): */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = (!__pyx_t_11); if (__pyx_t_1) { @@ -16085,18 +16104,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L104_bool_binop_done; } - /* "w3lib/_url.pyx":731 + /* "w3lib/_url.pyx":730 * if not _starts_with_windows_drive_letter( * input[pointer:] * ) and _is_windows_drive_letter(base.path[0]): # <<<<<<<<<<<<<< * url.path.append(base.path[0]) * state = PATH */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 731, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 731, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -16118,16 +16137,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 731, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_14 = __pyx_t_1; __pyx_L104_bool_binop_done:; - /* "w3lib/_url.pyx":729 + /* "w3lib/_url.pyx":728 * if base is not None and base.scheme == "file": * url.hostname = base.hostname * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< @@ -16136,25 +16155,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ if (__pyx_t_14) { - /* "w3lib/_url.pyx":732 + /* "w3lib/_url.pyx":731 * input[pointer:] * ) and _is_windows_drive_letter(base.path[0]): * url.path.append(base.path[0]) # <<<<<<<<<<<<<< * state = PATH * pointer -= 1 */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_15); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_15); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "w3lib/_url.pyx":729 + /* "w3lib/_url.pyx":728 * if base is not None and base.scheme == "file": * url.hostname = base.hostname * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< @@ -16163,7 +16182,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":727 + /* "w3lib/_url.pyx":726 * state = FILE_HOST * else: * if base is not None and base.scheme == "file": # <<<<<<<<<<<<<< @@ -16172,33 +16191,33 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":733 + /* "w3lib/_url.pyx":732 * ) and _is_windows_drive_letter(base.path[0]): * url.path.append(base.path[0]) * state = PATH # <<<<<<<<<<<<<< * pointer -= 1 * */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_PATH); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 733, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_PATH); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_15); __pyx_t_15 = 0; - /* "w3lib/_url.pyx":734 + /* "w3lib/_url.pyx":733 * url.path.append(base.path[0]) * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == FILE_HOST: */ - __pyx_t_15 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_15); __pyx_t_15 = 0; } __pyx_L97:; - /* "w3lib/_url.pyx":721 + /* "w3lib/_url.pyx":720 * pointer -= 1 * * elif state == FILE_SLASH: # <<<<<<<<<<<<<< @@ -16208,22 +16227,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":736 + /* "w3lib/_url.pyx":735 * pointer -= 1 * * elif state == FILE_HOST: # <<<<<<<<<<<<<< * if c is None or c in "/\\?#": * pointer -= 1 */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_FILE_HOST); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 736, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_FILE_HOST); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_15, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_15, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_14) { - /* "w3lib/_url.pyx":737 + /* "w3lib/_url.pyx":736 * * elif state == FILE_HOST: * if c is None or c in "/\\?#": # <<<<<<<<<<<<<< @@ -16236,31 +16255,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_14 = __pyx_t_1; goto __pyx_L107_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 736, __pyx_L1_error) __pyx_t_14 = __pyx_t_1; __pyx_L107_bool_binop_done:; if (__pyx_t_14) { - /* "w3lib/_url.pyx":738 + /* "w3lib/_url.pyx":737 * elif state == FILE_HOST: * if c is None or c in "/\\?#": * pointer -= 1 # <<<<<<<<<<<<<< * if _is_windows_drive_letter(buffer): * state = PATH */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":739 + /* "w3lib/_url.pyx":738 * if c is None or c in "/\\?#": * pointer -= 1 * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< * state = PATH * elif not buffer: */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_2 = NULL; __pyx_t_6 = 0; @@ -16280,27 +16299,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_buffer}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 739, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_14) { - /* "w3lib/_url.pyx":740 + /* "w3lib/_url.pyx":739 * pointer -= 1 * if _is_windows_drive_letter(buffer): * state = PATH # <<<<<<<<<<<<<< * elif not buffer: * url.hostname = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":739 + /* "w3lib/_url.pyx":738 * if c is None or c in "/\\?#": * pointer -= 1 * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< @@ -16310,39 +16329,39 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L109; } - /* "w3lib/_url.pyx":741 + /* "w3lib/_url.pyx":740 * if _is_windows_drive_letter(buffer): * state = PATH * elif not buffer: # <<<<<<<<<<<<<< * url.hostname = "" * state = PATH_START */ - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 741, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 740, __pyx_L1_error) __pyx_t_1 = (!__pyx_t_14); if (__pyx_t_1) { - /* "w3lib/_url.pyx":742 + /* "w3lib/_url.pyx":741 * state = PATH * elif not buffer: * url.hostname = "" # <<<<<<<<<<<<<< * state = PATH_START * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 742, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 741, __pyx_L1_error) - /* "w3lib/_url.pyx":743 + /* "w3lib/_url.pyx":742 * elif not buffer: * url.hostname = "" * state = PATH_START # <<<<<<<<<<<<<< * else: * host = _parse_host(buffer, is_special=url.is_special) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":741 + /* "w3lib/_url.pyx":740 * if _is_windows_drive_letter(buffer): * state = PATH * elif not buffer: # <<<<<<<<<<<<<< @@ -16352,7 +16371,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L109; } - /* "w3lib/_url.pyx":745 + /* "w3lib/_url.pyx":744 * state = PATH_START * else: * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< @@ -16360,20 +16379,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py * host = "" */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 745, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_buffer)) __PYX_ERR(0, 745, __pyx_L1_error); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_buffer)) __PYX_ERR(0, 744, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_special, __pyx_t_3) < 0) __PYX_ERR(0, 745, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_special, __pyx_t_3) < 0) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; @@ -16381,17 +16400,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":746 + /* "w3lib/_url.pyx":745 * else: * host = _parse_host(buffer, is_special=url.is_special) * if host == "localhost": # <<<<<<<<<<<<<< * host = "" * url.hostname = host */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_host, __pyx_n_u_localhost, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_host, __pyx_n_u_localhost, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 745, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":747 + /* "w3lib/_url.pyx":746 * host = _parse_host(buffer, is_special=url.is_special) * if host == "localhost": * host = "" # <<<<<<<<<<<<<< @@ -16401,7 +16420,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_host, __pyx_kp_u__2); - /* "w3lib/_url.pyx":746 + /* "w3lib/_url.pyx":745 * else: * host = _parse_host(buffer, is_special=url.is_special) * if host == "localhost": # <<<<<<<<<<<<<< @@ -16410,16 +16429,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":748 + /* "w3lib/_url.pyx":747 * if host == "localhost": * host = "" * url.hostname = host # <<<<<<<<<<<<<< * buffer = "" * state = PATH_START */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 748, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 747, __pyx_L1_error) - /* "w3lib/_url.pyx":749 + /* "w3lib/_url.pyx":748 * host = "" * url.hostname = host * buffer = "" # <<<<<<<<<<<<<< @@ -16429,21 +16448,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":750 + /* "w3lib/_url.pyx":749 * url.hostname = host * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< * else: * assert isinstance(c, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L109:; - /* "w3lib/_url.pyx":737 + /* "w3lib/_url.pyx":736 * * elif state == FILE_HOST: * if c is None or c in "/\\?#": # <<<<<<<<<<<<<< @@ -16453,7 +16472,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L106; } - /* "w3lib/_url.pyx":752 + /* "w3lib/_url.pyx":751 * state = PATH_START * else: * assert isinstance(c, str) # <<<<<<<<<<<<<< @@ -16466,28 +16485,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 752, __pyx_L1_error) + __PYX_ERR(0, 751, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 752, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 751, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":753 + /* "w3lib/_url.pyx":752 * else: * assert isinstance(c, str) * buffer += c # <<<<<<<<<<<<<< * * elif state == PATH_START: */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L106:; - /* "w3lib/_url.pyx":736 + /* "w3lib/_url.pyx":735 * pointer -= 1 * * elif state == FILE_HOST: # <<<<<<<<<<<<<< @@ -16497,47 +16516,47 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":755 + /* "w3lib/_url.pyx":754 * buffer += c * * elif state == PATH_START: # <<<<<<<<<<<<<< * if url.is_special: * state = PATH */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 755, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":756 + /* "w3lib/_url.pyx":755 * * elif state == PATH_START: * if url.is_special: # <<<<<<<<<<<<<< * state = PATH * if c is not None and c not in "/\\": */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":757 + /* "w3lib/_url.pyx":756 * elif state == PATH_START: * if url.is_special: * state = PATH # <<<<<<<<<<<<<< * if c is not None and c not in "/\\": * assert isinstance(c, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":758 + /* "w3lib/_url.pyx":757 * if url.is_special: * state = PATH * if c is not None and c not in "/\\": # <<<<<<<<<<<<<< @@ -16550,12 +16569,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = __pyx_t_14; goto __pyx_L113_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) __pyx_t_1 = __pyx_t_14; __pyx_L113_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":759 + /* "w3lib/_url.pyx":758 * state = PATH * if c is not None and c not in "/\\": * assert isinstance(c, str) # <<<<<<<<<<<<<< @@ -16567,26 +16586,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 759, __pyx_L1_error) + __PYX_ERR(0, 758, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 759, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 758, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":760 + /* "w3lib/_url.pyx":759 * if c is not None and c not in "/\\": * assert isinstance(c, str) * pointer -= 1 # <<<<<<<<<<<<<< * elif c == "?": * url.query = "" */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":758 + /* "w3lib/_url.pyx":757 * if url.is_special: * state = PATH * if c is not None and c not in "/\\": # <<<<<<<<<<<<<< @@ -16595,7 +16614,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":756 + /* "w3lib/_url.pyx":755 * * elif state == PATH_START: * if url.is_special: # <<<<<<<<<<<<<< @@ -16605,38 +16624,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L111; } - /* "w3lib/_url.pyx":761 + /* "w3lib/_url.pyx":760 * assert isinstance(c, str) * pointer -= 1 * elif c == "?": # <<<<<<<<<<<<<< * url.query = "" * state = QUERY */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 761, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 760, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":762 + /* "w3lib/_url.pyx":761 * pointer -= 1 * elif c == "?": * url.query = "" # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 762, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 761, __pyx_L1_error) - /* "w3lib/_url.pyx":763 + /* "w3lib/_url.pyx":762 * elif c == "?": * url.query = "" * state = QUERY # <<<<<<<<<<<<<< * elif c == "#": * url.fragment = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":761 + /* "w3lib/_url.pyx":760 * assert isinstance(c, str) * pointer -= 1 * elif c == "?": # <<<<<<<<<<<<<< @@ -16646,38 +16665,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L111; } - /* "w3lib/_url.pyx":764 + /* "w3lib/_url.pyx":763 * url.query = "" * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 764, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 763, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":765 + /* "w3lib/_url.pyx":764 * state = QUERY * elif c == "#": * url.fragment = "" # <<<<<<<<<<<<<< * state = FRAGMENT * elif c is not None: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 765, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 764, __pyx_L1_error) - /* "w3lib/_url.pyx":766 + /* "w3lib/_url.pyx":765 * elif c == "#": * url.fragment = "" * state = FRAGMENT # <<<<<<<<<<<<<< * elif c is not None: * assert isinstance(c, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":764 + /* "w3lib/_url.pyx":763 * url.query = "" * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< @@ -16687,7 +16706,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L111; } - /* "w3lib/_url.pyx":767 + /* "w3lib/_url.pyx":766 * url.fragment = "" * state = FRAGMENT * elif c is not None: # <<<<<<<<<<<<<< @@ -16697,7 +16716,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "w3lib/_url.pyx":768 + /* "w3lib/_url.pyx":767 * state = FRAGMENT * elif c is not None: * assert isinstance(c, str) # <<<<<<<<<<<<<< @@ -16709,48 +16728,48 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 768, __pyx_L1_error) + __PYX_ERR(0, 767, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 768, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 767, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":769 + /* "w3lib/_url.pyx":768 * elif c is not None: * assert isinstance(c, str) * state = PATH # <<<<<<<<<<<<<< * if c != "/": * pointer -= 1 */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":770 + /* "w3lib/_url.pyx":769 * assert isinstance(c, str) * state = PATH * if c != "/": # <<<<<<<<<<<<<< * pointer -= 1 * */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 769, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":771 + /* "w3lib/_url.pyx":770 * state = PATH * if c != "/": * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == PATH: */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":770 + /* "w3lib/_url.pyx":769 * assert isinstance(c, str) * state = PATH * if c != "/": # <<<<<<<<<<<<<< @@ -16759,7 +16778,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":767 + /* "w3lib/_url.pyx":766 * url.fragment = "" * state = FRAGMENT * elif c is not None: # <<<<<<<<<<<<<< @@ -16769,7 +16788,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L111:; - /* "w3lib/_url.pyx":755 + /* "w3lib/_url.pyx":754 * buffer += c * * elif state == PATH_START: # <<<<<<<<<<<<<< @@ -16779,22 +16798,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":773 + /* "w3lib/_url.pyx":772 * pointer -= 1 * * elif state == PATH: # <<<<<<<<<<<<<< * assert isinstance(url.path, list) * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":774 + /* "w3lib/_url.pyx":773 * * elif state == PATH: * assert isinstance(url.path, list) # <<<<<<<<<<<<<< @@ -16803,20 +16822,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyList_Check(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 774, __pyx_L1_error) + __PYX_ERR(0, 773, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 774, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 773, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":775 + /* "w3lib/_url.pyx":774 * elif state == PATH: * assert isinstance(url.path, list) * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": # <<<<<<<<<<<<<< @@ -16829,40 +16848,40 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = __pyx_t_14; goto __pyx_L117_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 774, __pyx_L1_error) if (!__pyx_t_14) { } else { __pyx_t_1 = __pyx_t_14; goto __pyx_L117_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_14) { goto __pyx_L120_next_or; } else { } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 774, __pyx_L1_error) if (!__pyx_t_14) { } else { __pyx_t_1 = __pyx_t_14; goto __pyx_L117_bool_binop_done; } __pyx_L120_next_or:; - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 774, __pyx_L1_error) __pyx_t_1 = __pyx_t_14; __pyx_L117_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":776 + /* "w3lib/_url.pyx":775 * assert isinstance(url.path, list) * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< * _shorten_path(url) * if c != "/" and not (url.is_special and c == "\\"): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_double_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_double_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_15 = NULL; __pyx_t_6 = 0; @@ -16882,22 +16901,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_buffer}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 776, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 775, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":777 + /* "w3lib/_url.pyx":776 * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): * _shorten_path(url) # <<<<<<<<<<<<<< * if c != "/" and not (url.is_special and c == "\\"): * url.path.append("") */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_15 = NULL; __pyx_t_6 = 0; @@ -16917,35 +16936,35 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_url}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":778 + /* "w3lib/_url.pyx":777 * if _is_double_dot_path_segment(buffer): * _shorten_path(url) * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< * url.path.append("") * elif _is_single_dot_path_segment(buffer): */ - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) if (__pyx_t_14) { } else { __pyx_t_1 = __pyx_t_14; goto __pyx_L124_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_11) { } else { __pyx_t_14 = __pyx_t_11; goto __pyx_L126_bool_binop_done; } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) __pyx_t_14 = __pyx_t_11; __pyx_L126_bool_binop_done:; __pyx_t_11 = (!__pyx_t_14); @@ -16953,19 +16972,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_L124_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":779 + /* "w3lib/_url.pyx":778 * _shorten_path(url) * if c != "/" and not (url.is_special and c == "\\"): * url.path.append("") # <<<<<<<<<<<<<< * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.is_special and c == "\\"): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 779, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 778, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":778 + /* "w3lib/_url.pyx":777 * if _is_double_dot_path_segment(buffer): * _shorten_path(url) * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< @@ -16974,7 +16993,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":776 + /* "w3lib/_url.pyx":775 * assert isinstance(url.path, list) * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< @@ -16984,14 +17003,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L122; } - /* "w3lib/_url.pyx":780 + /* "w3lib/_url.pyx":779 * if c != "/" and not (url.is_special and c == "\\"): * url.path.append("") * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< * if c != "/" and not (url.is_special and c == "\\"): * url.path.append("") */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_single_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 780, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_single_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_15 = NULL; __pyx_t_6 = 0; @@ -17011,37 +17030,37 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_buffer}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 780, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":781 + /* "w3lib/_url.pyx":780 * url.path.append("") * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< * url.path.append("") * else: */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 780, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; goto __pyx_L129_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_14) { } else { __pyx_t_11 = __pyx_t_14; goto __pyx_L131_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 780, __pyx_L1_error) __pyx_t_11 = __pyx_t_14; __pyx_L131_bool_binop_done:; __pyx_t_14 = (!__pyx_t_11); @@ -17049,19 +17068,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_L129_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":782 + /* "w3lib/_url.pyx":781 * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.is_special and c == "\\"): * url.path.append("") # <<<<<<<<<<<<<< * else: * if ( */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":781 + /* "w3lib/_url.pyx":780 * url.path.append("") * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< @@ -17070,7 +17089,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":780 + /* "w3lib/_url.pyx":779 * if c != "/" and not (url.is_special and c == "\\"): * url.path.append("") * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< @@ -17080,7 +17099,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L122; } - /* "w3lib/_url.pyx":784 + /* "w3lib/_url.pyx":783 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< @@ -17089,16 +17108,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ /*else*/ { - /* "w3lib/_url.pyx":785 + /* "w3lib/_url.pyx":784 * else: * if ( * url.scheme == "file" # <<<<<<<<<<<<<< * and not url.path * and _is_windows_drive_letter(buffer) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 785, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 785, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_14) { } else { @@ -17106,16 +17125,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L134_bool_binop_done; } - /* "w3lib/_url.pyx":786 + /* "w3lib/_url.pyx":785 * if ( * url.scheme == "file" * and not url.path # <<<<<<<<<<<<<< * and _is_windows_drive_letter(buffer) * ): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 786, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 786, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_11 = (!__pyx_t_14); if (__pyx_t_11) { @@ -17124,14 +17143,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L134_bool_binop_done; } - /* "w3lib/_url.pyx":787 + /* "w3lib/_url.pyx":786 * url.scheme == "file" * and not url.path * and _is_windows_drive_letter(buffer) # <<<<<<<<<<<<<< * ): * buffer = buffer[0] + ":" + buffer[2:] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_15 = NULL; __pyx_t_6 = 0; @@ -17151,16 +17170,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_buffer}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 787, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 787, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_11; __pyx_L134_bool_binop_done:; - /* "w3lib/_url.pyx":784 + /* "w3lib/_url.pyx":783 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< @@ -17169,28 +17188,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ if (__pyx_t_1) { - /* "w3lib/_url.pyx":789 + /* "w3lib/_url.pyx":788 * and _is_windows_drive_letter(buffer) * ): * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< * if ( * not url.path */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_buffer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_buffer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_buffer, 2, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_buffer, 2, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_15 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_15); __pyx_t_15 = 0; - /* "w3lib/_url.pyx":784 + /* "w3lib/_url.pyx":783 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< @@ -17199,16 +17218,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":791 + /* "w3lib/_url.pyx":790 * buffer = buffer[0] + ":" + buffer[2:] * if ( * not url.path # <<<<<<<<<<<<<< * and not buffer * and c is not None */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 791, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 791, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_14 = (!__pyx_t_11); if (__pyx_t_14) { @@ -17217,14 +17236,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L138_bool_binop_done; } - /* "w3lib/_url.pyx":792 + /* "w3lib/_url.pyx":791 * if ( * not url.path * and not buffer # <<<<<<<<<<<<<< * and c is not None * and c in "?#" */ - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 792, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 791, __pyx_L1_error) __pyx_t_11 = (!__pyx_t_14); if (__pyx_t_11) { } else { @@ -17232,7 +17251,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L138_bool_binop_done; } - /* "w3lib/_url.pyx":793 + /* "w3lib/_url.pyx":792 * not url.path * and not buffer * and c is not None # <<<<<<<<<<<<<< @@ -17246,38 +17265,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L138_bool_binop_done; } - /* "w3lib/_url.pyx":794 + /* "w3lib/_url.pyx":793 * and not buffer * and c is not None * and c in "?#" # <<<<<<<<<<<<<< * and input[pointer - 1] not in "/\\" * ): */ - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 794, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 793, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; goto __pyx_L138_bool_binop_done; } - /* "w3lib/_url.pyx":795 + /* "w3lib/_url.pyx":794 * and c is not None * and c in "?#" * and input[pointer - 1] not in "/\\" # <<<<<<<<<<<<<< * ): * url._path_token_seen = True */ - __pyx_t_15 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_t_3, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_t_3, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_11; __pyx_L138_bool_binop_done:; - /* "w3lib/_url.pyx":790 + /* "w3lib/_url.pyx":789 * ): * buffer = buffer[0] + ":" + buffer[2:] * if ( # <<<<<<<<<<<<<< @@ -17286,16 +17305,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ if (__pyx_t_1) { - /* "w3lib/_url.pyx":797 + /* "w3lib/_url.pyx":796 * and input[pointer - 1] not in "/\\" * ): * url._path_token_seen = True # <<<<<<<<<<<<<< * url.path.append(buffer) * buffer = "" */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen, Py_True) < 0) __PYX_ERR(0, 797, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen, Py_True) < 0) __PYX_ERR(0, 796, __pyx_L1_error) - /* "w3lib/_url.pyx":790 + /* "w3lib/_url.pyx":789 * ): * buffer = buffer[0] + ":" + buffer[2:] * if ( # <<<<<<<<<<<<<< @@ -17304,21 +17323,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":798 + /* "w3lib/_url.pyx":797 * ): * url._path_token_seen = True * url.path.append(buffer) # <<<<<<<<<<<<<< * buffer = "" * if c == "?": */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 798, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_buffer); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 798, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_buffer); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L122:; - /* "w3lib/_url.pyx":799 + /* "w3lib/_url.pyx":798 * url._path_token_seen = True * url.path.append(buffer) * buffer = "" # <<<<<<<<<<<<<< @@ -17328,38 +17347,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":800 + /* "w3lib/_url.pyx":799 * url.path.append(buffer) * buffer = "" * if c == "?": # <<<<<<<<<<<<<< * url.query = "" * state = QUERY */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 800, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 799, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":801 + /* "w3lib/_url.pyx":800 * buffer = "" * if c == "?": * url.query = "" # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 801, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 800, __pyx_L1_error) - /* "w3lib/_url.pyx":802 + /* "w3lib/_url.pyx":801 * if c == "?": * url.query = "" * state = QUERY # <<<<<<<<<<<<<< * elif c == "#": * url.fragment = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":800 + /* "w3lib/_url.pyx":799 * url.path.append(buffer) * buffer = "" * if c == "?": # <<<<<<<<<<<<<< @@ -17369,38 +17388,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L143; } - /* "w3lib/_url.pyx":803 + /* "w3lib/_url.pyx":802 * url.query = "" * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 803, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 802, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":804 + /* "w3lib/_url.pyx":803 * state = QUERY * elif c == "#": * url.fragment = "" # <<<<<<<<<<<<<< * state = FRAGMENT * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 804, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 803, __pyx_L1_error) - /* "w3lib/_url.pyx":805 + /* "w3lib/_url.pyx":804 * elif c == "#": * url.fragment = "" * state = FRAGMENT # <<<<<<<<<<<<<< * else: * assert isinstance(c, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":803 + /* "w3lib/_url.pyx":802 * url.query = "" * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< @@ -17410,7 +17429,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L143:; - /* "w3lib/_url.pyx":775 + /* "w3lib/_url.pyx":774 * elif state == PATH: * assert isinstance(url.path, list) * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": # <<<<<<<<<<<<<< @@ -17420,7 +17439,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L116; } - /* "w3lib/_url.pyx":807 + /* "w3lib/_url.pyx":806 * state = FRAGMENT * else: * assert isinstance(c, str) # <<<<<<<<<<<<<< @@ -17433,64 +17452,64 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 807, __pyx_L1_error) + __PYX_ERR(0, 806, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 807, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 806, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":808 + /* "w3lib/_url.pyx":807 * else: * assert isinstance(c, str) * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, * pointer=pointer, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":809 + /* "w3lib/_url.pyx":808 * assert isinstance(c, str) * buffer += _idempotent_utf_8_percent_encode( * input=input, # <<<<<<<<<<<<<< * pointer=pointer, * encode_set=path_percent_encode_set, */ - __pyx_t_15 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 808, __pyx_L1_error) - /* "w3lib/_url.pyx":810 + /* "w3lib/_url.pyx":809 * buffer += _idempotent_utf_8_percent_encode( * input=input, * pointer=pointer, # <<<<<<<<<<<<<< * encode_set=path_percent_encode_set, * ) */ - if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 808, __pyx_L1_error) - /* "w3lib/_url.pyx":811 + /* "w3lib/_url.pyx":810 * input=input, * pointer=pointer, * encode_set=path_percent_encode_set, # <<<<<<<<<<<<<< * ) * */ - if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_encode_set, __pyx_v_path_percent_encode_set) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_encode_set, __pyx_v_path_percent_encode_set) < 0) __PYX_ERR(0, 808, __pyx_L1_error) - /* "w3lib/_url.pyx":808 + /* "w3lib/_url.pyx":807 * else: * assert isinstance(c, str) * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, * pointer=pointer, */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 808, __pyx_L1_error) + __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_15); @@ -17498,7 +17517,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L116:; - /* "w3lib/_url.pyx":773 + /* "w3lib/_url.pyx":772 * pointer -= 1 * * elif state == PATH: # <<<<<<<<<<<<<< @@ -17508,22 +17527,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":814 + /* "w3lib/_url.pyx":813 * ) * * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< * assert isinstance(url.path, str) * if c == "?": */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_OPAQUE_PATH); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 814, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_OPAQUE_PATH); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_15, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_15, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":815 + /* "w3lib/_url.pyx":814 * * elif state == OPAQUE_PATH: * assert isinstance(url.path, str) # <<<<<<<<<<<<<< @@ -17532,51 +17551,51 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 815, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyUnicode_Check(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 815, __pyx_L1_error) + __PYX_ERR(0, 814, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 815, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 814, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":816 + /* "w3lib/_url.pyx":815 * elif state == OPAQUE_PATH: * assert isinstance(url.path, str) * if c == "?": # <<<<<<<<<<<<<< * url.query = "" * state = QUERY */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 815, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":817 + /* "w3lib/_url.pyx":816 * assert isinstance(url.path, str) * if c == "?": * url.query = "" # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 817, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 816, __pyx_L1_error) - /* "w3lib/_url.pyx":818 + /* "w3lib/_url.pyx":817 * if c == "?": * url.query = "" * state = QUERY # <<<<<<<<<<<<<< * elif c == "#": * url.fragment = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":816 + /* "w3lib/_url.pyx":815 * elif state == OPAQUE_PATH: * assert isinstance(url.path, str) * if c == "?": # <<<<<<<<<<<<<< @@ -17586,38 +17605,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L144; } - /* "w3lib/_url.pyx":819 + /* "w3lib/_url.pyx":818 * url.query = "" * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 819, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 818, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":820 + /* "w3lib/_url.pyx":819 * state = QUERY * elif c == "#": * url.fragment = "" # <<<<<<<<<<<<<< * state = FRAGMENT * elif c is not None: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 820, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 819, __pyx_L1_error) - /* "w3lib/_url.pyx":821 + /* "w3lib/_url.pyx":820 * elif c == "#": * url.fragment = "" * state = FRAGMENT # <<<<<<<<<<<<<< * elif c is not None: * assert isinstance(c, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":819 + /* "w3lib/_url.pyx":818 * url.query = "" * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< @@ -17627,7 +17646,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L144; } - /* "w3lib/_url.pyx":822 + /* "w3lib/_url.pyx":821 * url.fragment = "" * state = FRAGMENT * elif c is not None: # <<<<<<<<<<<<<< @@ -17637,7 +17656,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "w3lib/_url.pyx":823 + /* "w3lib/_url.pyx":822 * state = FRAGMENT * elif c is not None: * assert isinstance(c, str) # <<<<<<<<<<<<<< @@ -17649,31 +17668,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 823, __pyx_L1_error) + __PYX_ERR(0, 822, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 823, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 822, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":824 + /* "w3lib/_url.pyx":823 * elif c is not None: * assert isinstance(c, str) * encoded = _utf_8_percent_encode( # <<<<<<<<<<<<<< * c, * _C0_CONTROL_PERCENT_ENCODE_SET, */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 824, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - /* "w3lib/_url.pyx":826 + /* "w3lib/_url.pyx":825 * encoded = _utf_8_percent_encode( * c, * _C0_CONTROL_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * ) * url.path += encoded */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; @@ -17694,29 +17713,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 824, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_XDECREF_SET(__pyx_v_encoded, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":828 + /* "w3lib/_url.pyx":827 * _C0_CONTROL_PERCENT_ENCODE_SET, * ) * url.path += encoded # <<<<<<<<<<<<<< * * elif state == QUERY: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 828, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 828, __pyx_L1_error) + __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_15) < 0) __PYX_ERR(0, 828, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_15) < 0) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "w3lib/_url.pyx":822 + /* "w3lib/_url.pyx":821 * url.fragment = "" * state = FRAGMENT * elif c is not None: # <<<<<<<<<<<<<< @@ -17726,7 +17745,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L144:; - /* "w3lib/_url.pyx":814 + /* "w3lib/_url.pyx":813 * ) * * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< @@ -17736,22 +17755,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":830 + /* "w3lib/_url.pyx":829 * url.path += encoded * * elif state == QUERY: # <<<<<<<<<<<<<< * assert isinstance(url.query, str) * if encoding != "utf-8" and ( */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_15, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_15, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":831 + /* "w3lib/_url.pyx":830 * * elif state == QUERY: * assert isinstance(url.query, str) # <<<<<<<<<<<<<< @@ -17760,43 +17779,43 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyUnicode_Check(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 831, __pyx_L1_error) + __PYX_ERR(0, 830, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 831, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 830, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":832 + /* "w3lib/_url.pyx":831 * elif state == QUERY: * assert isinstance(url.query, str) * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< * not url.is_special or url.scheme in ("ws", "wss") * ): */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_kp_u_utf_8, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_kp_u_utf_8, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 831, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; goto __pyx_L146_bool_binop_done; } - /* "w3lib/_url.pyx":833 + /* "w3lib/_url.pyx":832 * assert isinstance(url.query, str) * if encoding != "utf-8" and ( * not url.is_special or url.scheme in ("ws", "wss") # <<<<<<<<<<<<<< * ): * encoding = "utf-8" */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 833, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_14 = (!__pyx_t_11); if (!__pyx_t_14) { @@ -17804,15 +17823,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = __pyx_t_14; goto __pyx_L146_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_ws, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 833, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_ws, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 832, __pyx_L1_error) if (!__pyx_t_11) { } else { __pyx_t_14 = __pyx_t_11; goto __pyx_L149_bool_binop_done; } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_wss, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 833, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_wss, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 832, __pyx_L1_error) __pyx_t_14 = __pyx_t_11; __pyx_L149_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -17820,7 +17839,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = __pyx_t_11; __pyx_L146_bool_binop_done:; - /* "w3lib/_url.pyx":832 + /* "w3lib/_url.pyx":831 * elif state == QUERY: * assert isinstance(url.query, str) * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< @@ -17829,7 +17848,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ if (__pyx_t_1) { - /* "w3lib/_url.pyx":835 + /* "w3lib/_url.pyx":834 * not url.is_special or url.scheme in ("ws", "wss") * ): * encoding = "utf-8" # <<<<<<<<<<<<<< @@ -17839,7 +17858,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_utf_8); __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_kp_u_utf_8); - /* "w3lib/_url.pyx":832 + /* "w3lib/_url.pyx":831 * elif state == QUERY: * assert isinstance(url.query, str) * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< @@ -17848,14 +17867,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":836 + /* "w3lib/_url.pyx":835 * ): * encoding = "utf-8" * if c == "#" or c is None: # <<<<<<<<<<<<<< * percent_encode_set = ( * special_query_percent_encode_set */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 835, __pyx_L1_error) if (!__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; @@ -17866,20 +17885,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_L152_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":839 + /* "w3lib/_url.pyx":838 * percent_encode_set = ( * special_query_percent_encode_set * if url.is_special # <<<<<<<<<<<<<< * else query_percent_encode_set * ) */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":838 + /* "w3lib/_url.pyx":837 * if c == "#" or c is None: * percent_encode_set = ( * special_query_percent_encode_set # <<<<<<<<<<<<<< @@ -17890,7 +17909,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_2 = __pyx_v_special_query_percent_encode_set; } else { - /* "w3lib/_url.pyx":840 + /* "w3lib/_url.pyx":839 * special_query_percent_encode_set * if url.is_special * else query_percent_encode_set # <<<<<<<<<<<<<< @@ -17903,71 +17922,71 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_XDECREF_SET(__pyx_v_percent_encode_set, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":842 + /* "w3lib/_url.pyx":841 * else query_percent_encode_set * ) * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< * buffer, * encoding=encoding, */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 842, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - /* "w3lib/_url.pyx":843 + /* "w3lib/_url.pyx":842 * ) * url.query += _percent_encode_after_encoding( * buffer, # <<<<<<<<<<<<<< * encoding=encoding, * percent_encode_set=percent_encode_set, */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buffer)) __PYX_ERR(0, 842, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buffer)) __PYX_ERR(0, 841, __pyx_L1_error); - /* "w3lib/_url.pyx":844 + /* "w3lib/_url.pyx":843 * url.query += _percent_encode_after_encoding( * buffer, * encoding=encoding, # <<<<<<<<<<<<<< * percent_encode_set=percent_encode_set, * ) */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 844, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 843, __pyx_L1_error) - /* "w3lib/_url.pyx":845 + /* "w3lib/_url.pyx":844 * buffer, * encoding=encoding, * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< * ) * buffer = "" */ - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 844, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 843, __pyx_L1_error) - /* "w3lib/_url.pyx":842 + /* "w3lib/_url.pyx":841 * else query_percent_encode_set * ) * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< * buffer, * encoding=encoding, */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_4) < 0) __PYX_ERR(0, 842, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_4) < 0) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":847 + /* "w3lib/_url.pyx":846 * percent_encode_set=percent_encode_set, * ) * buffer = "" # <<<<<<<<<<<<<< @@ -17977,38 +17996,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":848 + /* "w3lib/_url.pyx":847 * ) * buffer = "" * if c == "#": # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":849 + /* "w3lib/_url.pyx":848 * buffer = "" * if c == "#": * url.fragment = "" # <<<<<<<<<<<<<< * state = FRAGMENT * elif c is not None: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 849, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 848, __pyx_L1_error) - /* "w3lib/_url.pyx":850 + /* "w3lib/_url.pyx":849 * if c == "#": * url.fragment = "" * state = FRAGMENT # <<<<<<<<<<<<<< * elif c is not None: * assert isinstance(c, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":848 + /* "w3lib/_url.pyx":847 * ) * buffer = "" * if c == "#": # <<<<<<<<<<<<<< @@ -18017,7 +18036,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":836 + /* "w3lib/_url.pyx":835 * ): * encoding = "utf-8" * if c == "#" or c is None: # <<<<<<<<<<<<<< @@ -18027,7 +18046,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L151; } - /* "w3lib/_url.pyx":851 + /* "w3lib/_url.pyx":850 * url.fragment = "" * state = FRAGMENT * elif c is not None: # <<<<<<<<<<<<<< @@ -18037,7 +18056,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "w3lib/_url.pyx":852 + /* "w3lib/_url.pyx":851 * state = FRAGMENT * elif c is not None: * assert isinstance(c, str) # <<<<<<<<<<<<<< @@ -18049,26 +18068,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 852, __pyx_L1_error) + __PYX_ERR(0, 851, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 852, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 851, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":853 + /* "w3lib/_url.pyx":852 * elif c is not None: * assert isinstance(c, str) * buffer += c # <<<<<<<<<<<<<< * * elif state == FRAGMENT: */ - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":851 + /* "w3lib/_url.pyx":850 * url.fragment = "" * state = FRAGMENT * elif c is not None: # <<<<<<<<<<<<<< @@ -18078,7 +18097,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L151:; - /* "w3lib/_url.pyx":830 + /* "w3lib/_url.pyx":829 * url.path += encoded * * elif state == QUERY: # <<<<<<<<<<<<<< @@ -18088,22 +18107,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16; } - /* "w3lib/_url.pyx":855 + /* "w3lib/_url.pyx":854 * buffer += c * * elif state == FRAGMENT: # <<<<<<<<<<<<<< * assert isinstance(url.fragment, str) * if c is not None: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":856 + /* "w3lib/_url.pyx":855 * * elif state == FRAGMENT: * assert isinstance(url.fragment, str) # <<<<<<<<<<<<<< @@ -18112,20 +18131,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyUnicode_Check(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 856, __pyx_L1_error) + __PYX_ERR(0, 855, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 856, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 855, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":857 + /* "w3lib/_url.pyx":856 * elif state == FRAGMENT: * assert isinstance(url.fragment, str) * if c is not None: # <<<<<<<<<<<<<< @@ -18135,7 +18154,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "w3lib/_url.pyx":858 + /* "w3lib/_url.pyx":857 * assert isinstance(url.fragment, str) * if c is not None: * assert isinstance(c, str) # <<<<<<<<<<<<<< @@ -18147,57 +18166,57 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 858, __pyx_L1_error) + __PYX_ERR(0, 857, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 858, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 857, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":859 + /* "w3lib/_url.pyx":858 * if c is not None: * assert isinstance(c, str) * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, pointer=pointer, encode_set=fragment_percent_encode_set * ) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "w3lib/_url.pyx":860 + /* "w3lib/_url.pyx":859 * assert isinstance(c, str) * url.fragment += _idempotent_utf_8_percent_encode( * input=input, pointer=pointer, encode_set=fragment_percent_encode_set # <<<<<<<<<<<<<< * ) * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 860, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 860, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_fragment_percent_encode_set) < 0) __PYX_ERR(0, 860, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 859, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 859, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_fragment_percent_encode_set) < 0) __PYX_ERR(0, 859, __pyx_L1_error) - /* "w3lib/_url.pyx":859 + /* "w3lib/_url.pyx":858 * if c is not None: * assert isinstance(c, str) * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, pointer=pointer, encode_set=fragment_percent_encode_set * ) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_t_2) < 0) __PYX_ERR(0, 859, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_t_2) < 0) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":857 + /* "w3lib/_url.pyx":856 * elif state == FRAGMENT: * assert isinstance(url.fragment, str) * if c is not None: # <<<<<<<<<<<<<< @@ -18206,7 +18225,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":855 + /* "w3lib/_url.pyx":854 * buffer += c * * elif state == FRAGMENT: # <<<<<<<<<<<<<< @@ -18216,22 +18235,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L16:; - /* "w3lib/_url.pyx":863 + /* "w3lib/_url.pyx":862 * ) * * if pointer >= input_length: # <<<<<<<<<<<<<< * break * pointer += 1 */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 863, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":864 + /* "w3lib/_url.pyx":863 * * if pointer >= input_length: * break # <<<<<<<<<<<<<< @@ -18240,7 +18259,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ goto __pyx_L5_break; - /* "w3lib/_url.pyx":863 + /* "w3lib/_url.pyx":862 * ) * * if pointer >= input_length: # <<<<<<<<<<<<<< @@ -18249,21 +18268,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":865 + /* "w3lib/_url.pyx":864 * if pointer >= input_length: * break * pointer += 1 # <<<<<<<<<<<<<< * * return url */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L5_break:; - /* "w3lib/_url.pyx":867 + /* "w3lib/_url.pyx":866 * pointer += 1 * * return url # <<<<<<<<<<<<<< @@ -18275,7 +18294,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_url; goto __pyx_L0; - /* "w3lib/_url.pyx":439 + /* "w3lib/_url.pyx":438 * * * def _parse_url( # <<<<<<<<<<<<<< @@ -18314,7 +18333,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "w3lib/_url.pyx":871 +/* "w3lib/_url.pyx":870 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< @@ -18330,7 +18349,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_33_serialize_ipv4 = {"_serialize_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_33_serialize_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_32_serialize_ipv4, "_serialize_ipv4(int address: int) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_33_serialize_ipv4 = {"_serialize_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_33_serialize_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_32_serialize_ipv4}; static PyObject *__pyx_pw_5w3lib_4_url_33_serialize_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -18375,12 +18395,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 870, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv4") < 0)) __PYX_ERR(0, 871, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv4") < 0)) __PYX_ERR(0, 870, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18391,7 +18411,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 871, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 870, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18405,7 +18425,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyInt_Type), 0, "address", 1))) __PYX_ERR(0, 871, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyInt_Type), 0, "address", 1))) __PYX_ERR(0, 870, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_32_serialize_ipv4(__pyx_self, __pyx_v_address); /* function exit code */ @@ -18441,7 +18461,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_serialize_ipv4(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_ipv4", 1); - /* "w3lib/_url.pyx":872 + /* "w3lib/_url.pyx":871 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: * output = "" # <<<<<<<<<<<<<< @@ -18451,7 +18471,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_serialize_ipv4(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_kp_u__2); __pyx_v_output = __pyx_kp_u__2; - /* "w3lib/_url.pyx":873 + /* "w3lib/_url.pyx":872 * def _serialize_ipv4(address: int) -> str: * output = "" * n = address # <<<<<<<<<<<<<< @@ -18461,7 +18481,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_serialize_ipv4(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_v_address); __pyx_v_n = __pyx_v_address; - /* "w3lib/_url.pyx":874 + /* "w3lib/_url.pyx":873 * output = "" * n = address * for i in range(1, 5): # <<<<<<<<<<<<<< @@ -18471,25 +18491,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_serialize_ipv4(CYTHON_UNUSED PyObject for (__pyx_t_1 = 1; __pyx_t_1 < 5; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "w3lib/_url.pyx":875 + /* "w3lib/_url.pyx":874 * n = address * for i in range(1, 5): * output = str(n % 256) + output # <<<<<<<<<<<<<< * if i != 4: * output = "." + output */ - __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":876 + /* "w3lib/_url.pyx":875 * for i in range(1, 5): * output = str(n % 256) + output * if i != 4: # <<<<<<<<<<<<<< @@ -18499,19 +18519,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_4 = (__pyx_v_i != 4); if (__pyx_t_4) { - /* "w3lib/_url.pyx":877 + /* "w3lib/_url.pyx":876 * output = str(n % 256) + output * if i != 4: * output = "." + output # <<<<<<<<<<<<<< * n = floor(n / 256) * return output */ - __pyx_t_2 = PyNumber_Add(__pyx_kp_u__6, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_kp_u__6, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":876 + /* "w3lib/_url.pyx":875 * for i in range(1, 5): * output = str(n % 256) + output * if i != 4: # <<<<<<<<<<<<<< @@ -18520,16 +18540,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_serialize_ipv4(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":878 + /* "w3lib/_url.pyx":877 * if i != 4: * output = "." + output * n = floor(n / 256) # <<<<<<<<<<<<<< * return output * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 878, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 878, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -18550,7 +18570,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -18558,7 +18578,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_2 = 0; } - /* "w3lib/_url.pyx":879 + /* "w3lib/_url.pyx":878 * output = "." + output * n = floor(n / 256) * return output # <<<<<<<<<<<<<< @@ -18566,12 +18586,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_serialize_ipv4(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 879, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_INCREF(__pyx_v_output); __pyx_r = ((PyObject*)__pyx_v_output); goto __pyx_L0; - /* "w3lib/_url.pyx":871 + /* "w3lib/_url.pyx":870 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< @@ -18595,7 +18615,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_serialize_ipv4(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":882 +/* "w3lib/_url.pyx":881 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< @@ -18613,16 +18633,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_46__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_length, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_min_length) < 0) __PYX_ERR(0, 882, __pyx_L1_error) - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_length, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_min_length) < 0) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 882, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 881, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -18648,7 +18668,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index = {"_get_ipv6_first_longest_0_piece_index", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index, "_get_ipv6_first_longest_0_piece_index(list address: List[int], *, int min_length: int = 2) -> Optional[int]"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index = {"_get_ipv6_first_longest_0_piece_index", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index}; static PyObject *__pyx_pw_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -18696,18 +18717,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 882, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 882, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_ipv6_first_longest_0_piece_index") < 0)) __PYX_ERR(0, 882, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_ipv6_first_longest_0_piece_index") < 0)) __PYX_ERR(0, 881, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18719,7 +18740,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_ipv6_first_longest_0_piece_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 882, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_ipv6_first_longest_0_piece_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 881, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18733,8 +18754,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 883, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_min_length), (&PyInt_Type), 0, "min_length", 1))) __PYX_ERR(0, 883, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 882, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_min_length), (&PyInt_Type), 0, "min_length", 1))) __PYX_ERR(0, 882, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(__pyx_self, __pyx_v_address, __pyx_v_min_length); /* function exit code */ @@ -18772,7 +18793,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(C int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_ipv6_first_longest_0_piece_index", 1); - /* "w3lib/_url.pyx":885 + /* "w3lib/_url.pyx":884 * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: * index = None # <<<<<<<<<<<<<< @@ -18782,7 +18803,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(Py_None); __pyx_v_index = Py_None; - /* "w3lib/_url.pyx":886 + /* "w3lib/_url.pyx":885 * ) -> Optional[int]: * index = None * index_length = 0 # <<<<<<<<<<<<<< @@ -18792,7 +18813,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __pyx_v_index_length = __pyx_int_0; - /* "w3lib/_url.pyx":887 + /* "w3lib/_url.pyx":886 * index = None * index_length = 0 * current_length = 0 # <<<<<<<<<<<<<< @@ -18802,7 +18823,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __pyx_v_current_length = __pyx_int_0; - /* "w3lib/_url.pyx":888 + /* "w3lib/_url.pyx":887 * index_length = 0 * current_length = 0 * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< @@ -18817,37 +18838,37 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(C { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 888, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 887, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 887, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_piece, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_current_index, __pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; - /* "w3lib/_url.pyx":889 + /* "w3lib/_url.pyx":888 * current_length = 0 * for current_index, piece in enumerate(address): * if piece != 0: # <<<<<<<<<<<<<< * current_length = 0 * continue */ - __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 888, __pyx_L1_error) if (__pyx_t_5) { - /* "w3lib/_url.pyx":890 + /* "w3lib/_url.pyx":889 * for current_index, piece in enumerate(address): * if piece != 0: * current_length = 0 # <<<<<<<<<<<<<< @@ -18857,7 +18878,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_int_0); - /* "w3lib/_url.pyx":891 + /* "w3lib/_url.pyx":890 * if piece != 0: * current_length = 0 * continue # <<<<<<<<<<<<<< @@ -18866,7 +18887,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(C */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":889 + /* "w3lib/_url.pyx":888 * current_length = 0 * for current_index, piece in enumerate(address): * if piece != 0: # <<<<<<<<<<<<<< @@ -18875,56 +18896,56 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(C */ } - /* "w3lib/_url.pyx":892 + /* "w3lib/_url.pyx":891 * current_length = 0 * continue * current_length += 1 # <<<<<<<<<<<<<< * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":893 + /* "w3lib/_url.pyx":892 * continue * current_length += 1 * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< * index = current_index + 1 - current_length * index_length = current_length */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_index_length, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 893, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_index_length, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L7_bool_binop_done; } - __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_min_length, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 893, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_min_length, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L7_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":894 + /* "w3lib/_url.pyx":893 * current_length += 1 * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length # <<<<<<<<<<<<<< * index_length = current_length * return index */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 894, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_v_current_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 894, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_v_current_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":895 + /* "w3lib/_url.pyx":894 * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length * index_length = current_length # <<<<<<<<<<<<<< @@ -18934,7 +18955,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_v_current_length); __Pyx_DECREF_SET(__pyx_v_index_length, __pyx_v_current_length); - /* "w3lib/_url.pyx":893 + /* "w3lib/_url.pyx":892 * continue * current_length += 1 * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< @@ -18943,7 +18964,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(C */ } - /* "w3lib/_url.pyx":888 + /* "w3lib/_url.pyx":887 * index_length = 0 * current_length = 0 * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< @@ -18955,7 +18976,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(C __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":896 + /* "w3lib/_url.pyx":895 * index = current_index + 1 - current_length * index_length = current_length * return index # <<<<<<<<<<<<<< @@ -18963,12 +18984,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(C * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_index))||((__pyx_v_index) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_index))) __PYX_ERR(0, 896, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_index))||((__pyx_v_index) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_index))) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_INCREF(__pyx_v_index); __pyx_r = ((PyObject*)__pyx_v_index); goto __pyx_L0; - /* "w3lib/_url.pyx":882 + /* "w3lib/_url.pyx":881 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< @@ -18995,7 +19016,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(C return __pyx_r; } -/* "w3lib/_url.pyx":900 +/* "w3lib/_url.pyx":899 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< @@ -19011,7 +19032,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_37_serialize_ipv6 = {"_serialize_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_37_serialize_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_36_serialize_ipv6, "_serialize_ipv6(list address: List[int]) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_37_serialize_ipv6 = {"_serialize_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_37_serialize_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_36_serialize_ipv6}; static PyObject *__pyx_pw_5w3lib_4_url_37_serialize_ipv6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -19056,12 +19078,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 899, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv6") < 0)) __PYX_ERR(0, 900, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv6") < 0)) __PYX_ERR(0, 899, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19072,7 +19094,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 900, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 899, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19086,7 +19108,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 900, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 899, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_36_serialize_ipv6(__pyx_self, __pyx_v_address); /* function exit code */ @@ -19124,7 +19146,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_ipv6", 1); - /* "w3lib/_url.pyx":901 + /* "w3lib/_url.pyx":900 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: * output = "" # <<<<<<<<<<<<<< @@ -19134,14 +19156,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_kp_u__2); __pyx_v_output = __pyx_kp_u__2; - /* "w3lib/_url.pyx":902 + /* "w3lib/_url.pyx":901 * def _serialize_ipv6(address: List[int]) -> str: * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) # <<<<<<<<<<<<<< * ignore0 = False * for piece_index in range(8): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_ipv6_first_longest_0_piece); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_ipv6_first_longest_0_piece); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -19161,14 +19183,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_address}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_compress = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":903 + /* "w3lib/_url.pyx":902 * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) * ignore0 = False # <<<<<<<<<<<<<< @@ -19177,7 +19199,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 0; - /* "w3lib/_url.pyx":904 + /* "w3lib/_url.pyx":903 * compress = _get_ipv6_first_longest_0_piece_index(address) * ignore0 = False * for piece_index in range(8): # <<<<<<<<<<<<<< @@ -19187,7 +19209,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject for (__pyx_t_5 = 0; __pyx_t_5 < 8; __pyx_t_5+=1) { __pyx_v_piece_index = __pyx_t_5; - /* "w3lib/_url.pyx":905 + /* "w3lib/_url.pyx":904 * ignore0 = False * for piece_index in range(8): * if ignore0: # <<<<<<<<<<<<<< @@ -19196,21 +19218,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject */ if (__pyx_v_ignore0) { - /* "w3lib/_url.pyx":906 + /* "w3lib/_url.pyx":905 * for piece_index in range(8): * if ignore0: * if not address[piece_index]: # <<<<<<<<<<<<<< * continue * ignore0 = False */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 906, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "w3lib/_url.pyx":907 + /* "w3lib/_url.pyx":906 * if ignore0: * if not address[piece_index]: * continue # <<<<<<<<<<<<<< @@ -19219,7 +19241,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":906 + /* "w3lib/_url.pyx":905 * for piece_index in range(8): * if ignore0: * if not address[piece_index]: # <<<<<<<<<<<<<< @@ -19228,7 +19250,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":908 + /* "w3lib/_url.pyx":907 * if not address[piece_index]: * continue * ignore0 = False # <<<<<<<<<<<<<< @@ -19237,7 +19259,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 0; - /* "w3lib/_url.pyx":905 + /* "w3lib/_url.pyx":904 * ignore0 = False * for piece_index in range(8): * if ignore0: # <<<<<<<<<<<<<< @@ -19246,22 +19268,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":909 + /* "w3lib/_url.pyx":908 * continue * ignore0 = False * if compress == piece_index: # <<<<<<<<<<<<<< * separator = "::" if piece_index == 0 else ":" * output += separator */ - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_compress, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 909, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_compress, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 909, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_7) { - /* "w3lib/_url.pyx":910 + /* "w3lib/_url.pyx":909 * ignore0 = False * if compress == piece_index: * separator = "::" if piece_index == 0 else ":" # <<<<<<<<<<<<<< @@ -19279,19 +19301,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject __Pyx_XDECREF_SET(__pyx_v_separator, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":911 + /* "w3lib/_url.pyx":910 * if compress == piece_index: * separator = "::" if piece_index == 0 else ":" * output += separator # <<<<<<<<<<<<<< * ignore0 = True * continue */ - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_output, __pyx_v_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_output, __pyx_v_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":912 + /* "w3lib/_url.pyx":911 * separator = "::" if piece_index == 0 else ":" * output += separator * ignore0 = True # <<<<<<<<<<<<<< @@ -19300,7 +19322,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 1; - /* "w3lib/_url.pyx":913 + /* "w3lib/_url.pyx":912 * output += separator * ignore0 = True * continue # <<<<<<<<<<<<<< @@ -19309,7 +19331,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":909 + /* "w3lib/_url.pyx":908 * continue * ignore0 = False * if compress == piece_index: # <<<<<<<<<<<<<< @@ -19318,25 +19340,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":914 + /* "w3lib/_url.pyx":913 * ignore0 = True * continue * output += f"{address[piece_index]:x}" # <<<<<<<<<<<<<< * if piece_index != 7: * output += ":" */ - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":915 + /* "w3lib/_url.pyx":914 * continue * output += f"{address[piece_index]:x}" * if piece_index != 7: # <<<<<<<<<<<<<< @@ -19346,19 +19368,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_t_7 = (__pyx_v_piece_index != 7); if (__pyx_t_7) { - /* "w3lib/_url.pyx":916 + /* "w3lib/_url.pyx":915 * output += f"{address[piece_index]:x}" * if piece_index != 7: * output += ":" # <<<<<<<<<<<<<< * return output * */ - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":915 + /* "w3lib/_url.pyx":914 * continue * output += f"{address[piece_index]:x}" * if piece_index != 7: # <<<<<<<<<<<<<< @@ -19369,7 +19391,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_L3_continue:; } - /* "w3lib/_url.pyx":917 + /* "w3lib/_url.pyx":916 * if piece_index != 7: * output += ":" * return output # <<<<<<<<<<<<<< @@ -19381,7 +19403,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "w3lib/_url.pyx":900 + /* "w3lib/_url.pyx":899 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< @@ -19405,7 +19427,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":921 +/* "w3lib/_url.pyx":920 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< @@ -19421,7 +19443,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_39_serialize_host = {"_serialize_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_39_serialize_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_38_serialize_host, "_serialize_host(host: Union[str, int, List[int]]) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_39_serialize_host = {"_serialize_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_39_serialize_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_38_serialize_host}; static PyObject *__pyx_pw_5w3lib_4_url_39_serialize_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -19466,12 +19489,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 921, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_host") < 0)) __PYX_ERR(0, 921, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_host") < 0)) __PYX_ERR(0, 920, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19482,7 +19505,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 921, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 920, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19525,7 +19548,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_host", 1); - /* "w3lib/_url.pyx":922 + /* "w3lib/_url.pyx":921 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(host: Union[str, int, List[int]]) -> str: * if isinstance(host, int): # <<<<<<<<<<<<<< @@ -19535,7 +19558,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject __pyx_t_1 = PyInt_Check(__pyx_v_host); if (__pyx_t_1) { - /* "w3lib/_url.pyx":923 + /* "w3lib/_url.pyx":922 * def _serialize_host(host: Union[str, int, List[int]]) -> str: * if isinstance(host, int): * return _serialize_ipv4(host) # <<<<<<<<<<<<<< @@ -19543,7 +19566,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject * return f"[{_serialize_ipv6(host)}]" */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_serialize_ipv4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_serialize_ipv4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -19563,16 +19586,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_host}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 923, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 922, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":922 + /* "w3lib/_url.pyx":921 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(host: Union[str, int, List[int]]) -> str: * if isinstance(host, int): # <<<<<<<<<<<<<< @@ -19581,7 +19604,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":924 + /* "w3lib/_url.pyx":923 * if isinstance(host, int): * return _serialize_ipv4(host) * if isinstance(host, list): # <<<<<<<<<<<<<< @@ -19591,7 +19614,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject __pyx_t_1 = PyList_Check(__pyx_v_host); if (__pyx_t_1) { - /* "w3lib/_url.pyx":925 + /* "w3lib/_url.pyx":924 * return _serialize_ipv4(host) * if isinstance(host, list): * return f"[{_serialize_ipv6(host)}]" # <<<<<<<<<<<<<< @@ -19599,7 +19622,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = 127; @@ -19607,7 +19630,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject __pyx_t_6 += 1; __Pyx_GIVEREF(__pyx_kp_u__8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__8); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_serialize_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 925, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_serialize_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -19627,11 +19650,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_host}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7; @@ -19643,14 +19666,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject __pyx_t_6 += 1; __Pyx_GIVEREF(__pyx_kp_u__9); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__9); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":924 + /* "w3lib/_url.pyx":923 * if isinstance(host, int): * return _serialize_ipv4(host) * if isinstance(host, list): # <<<<<<<<<<<<<< @@ -19659,7 +19682,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":926 + /* "w3lib/_url.pyx":925 * if isinstance(host, list): * return f"[{_serialize_ipv6(host)}]" * return host # <<<<<<<<<<<<<< @@ -19667,12 +19690,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_host))||((__pyx_v_host) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_host))) __PYX_ERR(0, 926, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_host))||((__pyx_v_host) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_host))) __PYX_ERR(0, 925, __pyx_L1_error) __Pyx_INCREF(__pyx_v_host); __pyx_r = ((PyObject*)__pyx_v_host); goto __pyx_L0; - /* "w3lib/_url.pyx":921 + /* "w3lib/_url.pyx":920 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< @@ -19694,7 +19717,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":930 +/* "w3lib/_url.pyx":929 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< @@ -19710,7 +19733,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_41_serialize_url_path = {"_serialize_url_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_41_serialize_url_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_40_serialize_url_path, "_serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_4_url_41_serialize_url_path = {"_serialize_url_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_41_serialize_url_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_40_serialize_url_path}; static PyObject *__pyx_pw_5w3lib_4_url_41_serialize_url_path(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -19757,18 +19781,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 930, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 929, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 930, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 929, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url_path") < 0)) __PYX_ERR(0, 930, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url_path") < 0)) __PYX_ERR(0, 929, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19780,7 +19804,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_url_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 930, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_url_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 929, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19826,14 +19850,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_url_path", 1); - /* "w3lib/_url.pyx":931 + /* "w3lib/_url.pyx":930 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: * if url.has_opaque_path(): # <<<<<<<<<<<<<< * assert isinstance(url.path, str) * return url.path */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -19853,15 +19877,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 931, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "w3lib/_url.pyx":932 + /* "w3lib/_url.pyx":931 * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: * if url.has_opaque_path(): * assert isinstance(url.path, str) # <<<<<<<<<<<<<< @@ -19870,20 +19894,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyUnicode_Check(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 932, __pyx_L1_error) + __PYX_ERR(0, 931, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 932, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 931, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":933 + /* "w3lib/_url.pyx":932 * if url.has_opaque_path(): * assert isinstance(url.path, str) * return url.path # <<<<<<<<<<<<<< @@ -19891,14 +19915,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj * return "" */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 933, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 932, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":931 + /* "w3lib/_url.pyx":930 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: * if url.has_opaque_path(): # <<<<<<<<<<<<<< @@ -19907,16 +19931,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj */ } - /* "w3lib/_url.pyx":934 + /* "w3lib/_url.pyx":933 * assert isinstance(url.path, str) * return url.path * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: # <<<<<<<<<<<<<< * return "" * output = "" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 934, __pyx_L1_error) + __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (__pyx_t_6 <= 1); if (__pyx_t_7) { @@ -19924,22 +19948,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj __pyx_t_5 = __pyx_t_7; goto __pyx_L5_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 934, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { } else { __pyx_t_5 = __pyx_t_7; goto __pyx_L5_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 934, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 933, __pyx_L1_error) __pyx_t_8 = (!__pyx_t_7); __pyx_t_5 = __pyx_t_8; __pyx_L5_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":935 + /* "w3lib/_url.pyx":934 * return url.path * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: * return "" # <<<<<<<<<<<<<< @@ -19951,7 +19975,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj __pyx_r = __pyx_kp_u__2; goto __pyx_L0; - /* "w3lib/_url.pyx":934 + /* "w3lib/_url.pyx":933 * assert isinstance(url.path, str) * return url.path * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: # <<<<<<<<<<<<<< @@ -19960,7 +19984,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj */ } - /* "w3lib/_url.pyx":936 + /* "w3lib/_url.pyx":935 * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: * return "" * output = "" # <<<<<<<<<<<<<< @@ -19970,23 +19994,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj __Pyx_INCREF(__pyx_kp_u__2); __pyx_v_output = __pyx_kp_u__2; - /* "w3lib/_url.pyx":937 + /* "w3lib/_url.pyx":936 * return "" * output = "" * for segment in url.path: # <<<<<<<<<<<<<< * output += f"/{segment}" * return output */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 936, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -19995,28 +20019,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 937, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 936, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 936, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 937, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 936, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 936, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -20026,7 +20050,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 937, __pyx_L1_error) + else __PYX_ERR(0, 936, __pyx_L1_error) } break; } @@ -20035,25 +20059,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj __Pyx_XDECREF_SET(__pyx_v_segment, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":938 + /* "w3lib/_url.pyx":937 * output = "" * for segment in url.path: * output += f"/{segment}" # <<<<<<<<<<<<<< * return output * */ - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_segment, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_segment, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 938, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":937 + /* "w3lib/_url.pyx":936 * return "" * output = "" * for segment in url.path: # <<<<<<<<<<<<<< @@ -20063,7 +20087,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":939 + /* "w3lib/_url.pyx":938 * for segment in url.path: * output += f"/{segment}" * return output # <<<<<<<<<<<<<< @@ -20075,7 +20099,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "w3lib/_url.pyx":930 + /* "w3lib/_url.pyx":929 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< @@ -20098,7 +20122,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj return __pyx_r; } -/* "w3lib/_url.pyx":943 +/* "w3lib/_url.pyx":942 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url( # <<<<<<<<<<<<<< @@ -20114,7 +20138,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_42_serialize_url, "Return a string representation of *url* following the URL serialization\n algorithm defined in the `URL living standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer\n\n If *exclude_fragment* is ``True``, the returned URL does not include\n :attr:`_URL.fragment`.\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *canonicalize*:\n\n - ``None``: Do not deviate from the standard algorithm to apply or\n prevent URL canonicalization.\n\n - ``True``: Deviate from the standard as needed to make sure that\n functionally-equivalent URLs are always rendered the same way.\n\n This value has no effect at the moment, i.e. it applies the same\n level of canonicalization as the standard algorithm.\n\n - ``False``: Deviate from the standard as needed to make sure that\n the returned URL string is as close as possible to the original URL\n string that was parsed into *url*, as long as the returned URL\n string is still a valid URL.\n\n At the moment, this ensures that the password separator (:) is\n included into the returned URL string as long as it was present on\n the original URL string, even if :attr:`_URL.password` is an empty\n string.\n "); +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_42_serialize_url, "_serialize_url(url: _URL, *, exclude_fragment: bool = False, canonicalize: Optional[bool] = None) -> str\nReturn a string representation of *url* following the URL serialization\n algorithm defined in the `URL living standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer\n\n If *exclude_fragment* is ``True``, the returned URL does not include\n :attr:`_URL.fragment`.\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *canonicalize*:\n\n - ``None``: Do not deviate from the standard algorithm to apply or\n prevent URL canonicalization.\n\n - ``True``: Deviate from the standard as needed to make sure that\n functionally-equivalent URLs are always rendered the same way.\n\n This value has no effect at the moment, i.e. it applies the same\n level of canonicalization as the standard algorithm.\n\n - ``False``: Deviate from the standard as needed to make sure that\n the returned URL string is as close as possible to the original URL\n string that was parsed into *url*, as long as the returned URL\n string is still a valid URL.\n\n At the moment, this ensures that the password separator (:) is\n included into the returned URL string as long as it was present on\n the original URL string, even if :attr:`_URL.password` is an empty\n string.\n "); static PyMethodDef __pyx_mdef_5w3lib_4_url_43_serialize_url = {"_serialize_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_43_serialize_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_42_serialize_url}; static PyObject *__pyx_pw_5w3lib_4_url_43_serialize_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -20148,7 +20172,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,&__pyx_n_s_exclude_fragment,&__pyx_n_s_canonicalize,0}; - /* "w3lib/_url.pyx":946 + /* "w3lib/_url.pyx":945 * url: _URL, * *, * exclude_fragment: bool = False, # <<<<<<<<<<<<<< @@ -20157,7 +20181,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - /* "w3lib/_url.pyx":947 + /* "w3lib/_url.pyx":946 * *, * exclude_fragment: bool = False, * canonicalize: Optional[bool] = None, # <<<<<<<<<<<<<< @@ -20180,7 +20204,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 943, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 942, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args > 0 && likely(kw_args <= 2)) { @@ -20188,12 +20212,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds for (index = 1; index < 3 && kw_args > 0; index++) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 943, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 942, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url") < 0)) __PYX_ERR(0, 943, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url") < 0)) __PYX_ERR(0, 942, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -20206,7 +20230,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 943, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 942, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20222,7 +20246,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5w3lib_4_url_42_serialize_url(__pyx_self, __pyx_v_url, __pyx_v_exclude_fragment, __pyx_v_canonicalize); - /* "w3lib/_url.pyx":943 + /* "w3lib/_url.pyx":942 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url( # <<<<<<<<<<<<<< @@ -20259,120 +20283,120 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_url", 1); - /* "w3lib/_url.pyx":981 + /* "w3lib/_url.pyx":980 * string. * """ * output = url.scheme + ":" # <<<<<<<<<<<<<< * if url.hostname is not None: * output += "//" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_output = __pyx_t_2; __pyx_t_2 = 0; - /* "w3lib/_url.pyx":982 + /* "w3lib/_url.pyx":981 * """ * output = url.scheme + ":" * if url.hostname is not None: # <<<<<<<<<<<<<< * output += "//" * if url.username or url.password: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":983 + /* "w3lib/_url.pyx":982 * output = url.scheme + ":" * if url.hostname is not None: * output += "//" # <<<<<<<<<<<<<< * if url.username or url.password: * output += url.username */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":984 + /* "w3lib/_url.pyx":983 * if url.hostname is not None: * output += "//" * if url.username or url.password: # <<<<<<<<<<<<<< * output += url.username * if url.password: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 984, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 984, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":985 + /* "w3lib/_url.pyx":984 * output += "//" * if url.username or url.password: * output += url.username # <<<<<<<<<<<<<< * if url.password: * output += f":{url.password}" */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 985, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":986 + /* "w3lib/_url.pyx":985 * if url.username or url.password: * output += url.username * if url.password: # <<<<<<<<<<<<<< * output += f":{url.password}" * elif not canonicalize and url._password_token_seen: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 986, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":987 + /* "w3lib/_url.pyx":986 * output += url.username * if url.password: * output += f":{url.password}" # <<<<<<<<<<<<<< * elif not canonicalize and url._password_token_seen: * output += ":" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":986 + /* "w3lib/_url.pyx":985 * if url.username or url.password: * output += url.username * if url.password: # <<<<<<<<<<<<<< @@ -20382,41 +20406,41 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L7; } - /* "w3lib/_url.pyx":988 + /* "w3lib/_url.pyx":987 * if url.password: * output += f":{url.password}" * elif not canonicalize and url._password_token_seen: # <<<<<<<<<<<<<< * output += ":" * output += "@" */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 988, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 987, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 988, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 988, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 987, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L8_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":989 + /* "w3lib/_url.pyx":988 * output += f":{url.password}" * elif not canonicalize and url._password_token_seen: * output += ":" # <<<<<<<<<<<<<< * output += "@" * output += _serialize_host(url.hostname) */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":988 + /* "w3lib/_url.pyx":987 * if url.password: * output += f":{url.password}" * elif not canonicalize and url._password_token_seen: # <<<<<<<<<<<<<< @@ -20426,19 +20450,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L7:; - /* "w3lib/_url.pyx":990 + /* "w3lib/_url.pyx":989 * elif not canonicalize and url._password_token_seen: * output += ":" * output += "@" # <<<<<<<<<<<<<< * output += _serialize_host(url.hostname) * if url.port is not None: */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":984 + /* "w3lib/_url.pyx":983 * if url.hostname is not None: * output += "//" * if url.username or url.password: # <<<<<<<<<<<<<< @@ -20447,16 +20471,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * */ } - /* "w3lib/_url.pyx":991 + /* "w3lib/_url.pyx":990 * output += ":" * output += "@" * output += _serialize_host(url.hostname) # <<<<<<<<<<<<<< * if url.port is not None: * output += f":{url.port}" */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 991, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -20477,51 +20501,51 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 991, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":992 + /* "w3lib/_url.pyx":991 * output += "@" * output += _serialize_host(url.hostname) * if url.port is not None: # <<<<<<<<<<<<<< * output += f":{url.port}" * elif not canonicalize: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_t_1 != Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":993 + /* "w3lib/_url.pyx":992 * output += _serialize_host(url.hostname) * if url.port is not None: * output += f":{url.port}" # <<<<<<<<<<<<<< * elif not canonicalize: * if url._default_port_seen: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 993, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 993, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 993, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 993, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":992 + /* "w3lib/_url.pyx":991 * output += "@" * output += _serialize_host(url.hostname) * if url.port is not None: # <<<<<<<<<<<<<< @@ -20531,58 +20555,58 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L10; } - /* "w3lib/_url.pyx":994 + /* "w3lib/_url.pyx":993 * if url.port is not None: * output += f":{url.port}" * elif not canonicalize: # <<<<<<<<<<<<<< * if url._default_port_seen: * output += f":{_DEFAULT_PORTS[url.scheme]}" */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 994, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 993, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_3); if (__pyx_t_5) { - /* "w3lib/_url.pyx":995 + /* "w3lib/_url.pyx":994 * output += f":{url.port}" * elif not canonicalize: * if url._default_port_seen: # <<<<<<<<<<<<<< * output += f":{_DEFAULT_PORTS[url.scheme]}" * elif url._port_token_seen: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 995, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "w3lib/_url.pyx":996 + /* "w3lib/_url.pyx":995 * elif not canonicalize: * if url._default_port_seen: * output += f":{_DEFAULT_PORTS[url.scheme]}" # <<<<<<<<<<<<<< * elif url._port_token_seen: * output += ":" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 996, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 996, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 996, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":995 + /* "w3lib/_url.pyx":994 * output += f":{url.port}" * elif not canonicalize: * if url._default_port_seen: # <<<<<<<<<<<<<< @@ -20592,32 +20616,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L11; } - /* "w3lib/_url.pyx":997 + /* "w3lib/_url.pyx":996 * if url._default_port_seen: * output += f":{_DEFAULT_PORTS[url.scheme]}" * elif url._port_token_seen: # <<<<<<<<<<<<<< * output += ":" * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 997, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "w3lib/_url.pyx":998 + /* "w3lib/_url.pyx":997 * output += f":{_DEFAULT_PORTS[url.scheme]}" * elif url._port_token_seen: * output += ":" # <<<<<<<<<<<<<< * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: * output += "/." */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":997 + /* "w3lib/_url.pyx":996 * if url._default_port_seen: * output += f":{_DEFAULT_PORTS[url.scheme]}" * elif url._port_token_seen: # <<<<<<<<<<<<<< @@ -20627,7 +20651,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L11:; - /* "w3lib/_url.pyx":994 + /* "w3lib/_url.pyx":993 * if url.port is not None: * output += f":{url.port}" * elif not canonicalize: # <<<<<<<<<<<<<< @@ -20637,7 +20661,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L10:; - /* "w3lib/_url.pyx":982 + /* "w3lib/_url.pyx":981 * """ * output = url.scheme + ":" * if url.hostname is not None: # <<<<<<<<<<<<<< @@ -20647,14 +20671,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L3; } - /* "w3lib/_url.pyx":999 + /* "w3lib/_url.pyx":998 * elif url._port_token_seen: * output += ":" * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< * output += "/." * output += _serialize_url_path(url, canonicalize=canonicalize) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = NULL; __pyx_t_8 = 0; @@ -20674,11 +20698,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (!__pyx_t_3); if (__pyx_t_4) { @@ -20686,9 +20710,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * __pyx_t_5 = __pyx_t_4; goto __pyx_L12_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_t_9 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__pyx_t_9 > 1); if (__pyx_t_4) { @@ -20696,31 +20720,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * __pyx_t_5 = __pyx_t_4; goto __pyx_L12_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = (!__pyx_t_4); __pyx_t_5 = __pyx_t_3; __pyx_L12_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":1000 + /* "w3lib/_url.pyx":999 * output += ":" * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: * output += "/." # <<<<<<<<<<<<<< * output += _serialize_url_path(url, canonicalize=canonicalize) * if url.query is not None: */ - __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__23); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1000, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__23); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":999 + /* "w3lib/_url.pyx":998 * elif url._port_token_seen: * output += ":" * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< @@ -20730,69 +20754,69 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L3:; - /* "w3lib/_url.pyx":1001 + /* "w3lib/_url.pyx":1000 * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: * output += "/." * output += _serialize_url_path(url, canonicalize=canonicalize) # <<<<<<<<<<<<<< * if url.query is not None: * output += f"?{url.query}" */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_serialize_url_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1001, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_serialize_url_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_url); __Pyx_GIVEREF(__pyx_v_url); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_url)) __PYX_ERR(0, 1001, __pyx_L1_error); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_url)) __PYX_ERR(0, 1000, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_canonicalize, __pyx_v_canonicalize) < 0) __PYX_ERR(0, 1001, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1001, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_canonicalize, __pyx_v_canonicalize) < 0) __PYX_ERR(0, 1000, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1002 + /* "w3lib/_url.pyx":1001 * output += "/." * output += _serialize_url_path(url, canonicalize=canonicalize) * if url.query is not None: # <<<<<<<<<<<<<< * output += f"?{url.query}" * if not exclude_fragment and url.fragment is not None: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "w3lib/_url.pyx":1003 + /* "w3lib/_url.pyx":1002 * output += _serialize_url_path(url, canonicalize=canonicalize) * if url.query is not None: * output += f"?{url.query}" # <<<<<<<<<<<<<< * if not exclude_fragment and url.fragment is not None: * output += f"#{url.fragment}" */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1003, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__14, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__14, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1003, __pyx_L1_error) + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":1002 + /* "w3lib/_url.pyx":1001 * output += "/." * output += _serialize_url_path(url, canonicalize=canonicalize) * if url.query is not None: # <<<<<<<<<<<<<< @@ -20801,21 +20825,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * */ } - /* "w3lib/_url.pyx":1004 + /* "w3lib/_url.pyx":1003 * if url.query is not None: * output += f"?{url.query}" * if not exclude_fragment and url.fragment is not None: # <<<<<<<<<<<<<< * output += f"#{url.fragment}" * return output */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_exclude_fragment); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1004, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_exclude_fragment); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1003, __pyx_L1_error) __pyx_t_4 = (!__pyx_t_3); if (__pyx_t_4) { } else { __pyx_t_5 = __pyx_t_4; goto __pyx_L17_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1004, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = (__pyx_t_7 != Py_None); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -20823,27 +20847,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * __pyx_L17_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":1005 + /* "w3lib/_url.pyx":1004 * output += f"?{url.query}" * if not exclude_fragment and url.fragment is not None: * output += f"#{url.fragment}" # <<<<<<<<<<<<<< * return output */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__12, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__12, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1004 + /* "w3lib/_url.pyx":1003 * if url.query is not None: * output += f"?{url.query}" * if not exclude_fragment and url.fragment is not None: # <<<<<<<<<<<<<< @@ -20852,18 +20876,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject * */ } - /* "w3lib/_url.pyx":1006 + /* "w3lib/_url.pyx":1005 * if not exclude_fragment and url.fragment is not None: * output += f"#{url.fragment}" * return output # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1006, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_INCREF(__pyx_v_output); __pyx_r = ((PyObject*)__pyx_v_output); goto __pyx_L0; - /* "w3lib/_url.pyx":943 + /* "w3lib/_url.pyx":942 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url( # <<<<<<<<<<<<<< @@ -21523,13 +21547,13 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 102, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 137, __pyx_L1_error) - __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 142, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 183, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 231, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 494, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 627, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -21540,338 +21564,338 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "w3lib/_url.pyx":120 + /* "w3lib/_url.pyx":119 * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): * return * url.path = path[:-1] # <<<<<<<<<<<<<< * * */ - __pyx_slice_ = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_slice_ = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); - /* "w3lib/_url.pyx":297 + /* "w3lib/_url.pyx":296 * r = 8 * if not input: * return (0, True) # <<<<<<<<<<<<<< * return (int(input, base=r), validation_error) * */ - __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, Py_True); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, Py_True); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "w3lib/_url.pyx":789 + /* "w3lib/_url.pyx":788 * and _is_windows_drive_letter(buffer) * ): * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< * if ( * not url.path */ - __pyx_slice__20 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_slice__20 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__20); __Pyx_GIVEREF(__pyx_slice__20); - /* "w3lib/_url.pyx":95 + /* "w3lib/_url.pyx":94 * _path_token_seen: bool = False * * def __init__(self) -> None: # <<<<<<<<<<<<<< * self.path = [] * self.is_special = False */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_init, 95, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_init, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 94, __pyx_L1_error) - /* "w3lib/_url.pyx":99 + /* "w3lib/_url.pyx":98 * self.is_special = False * * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< * return isinstance(self.path, str) * */ - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_has_opaque_path, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_has_opaque_path, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 98, __pyx_L1_error) - /* "w3lib/_url.pyx":102 + /* "w3lib/_url.pyx":101 * return isinstance(self.path, str) * * @property # <<<<<<<<<<<<<< * def scheme(self) -> str: * return self._scheme */ - __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 101, __pyx_L1_error) - /* "w3lib/_url.pyx":106 + /* "w3lib/_url.pyx":105 * return self._scheme * * @scheme.setter # <<<<<<<<<<<<<< * def scheme(self, value: str) -> None: * self._scheme = value */ - __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); - __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 105, __pyx_L1_error) - /* "w3lib/_url.pyx":116 + /* "w3lib/_url.pyx":115 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< * path = url.path * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): */ - __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_path); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_path); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_shorten_path, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_shorten_path, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 115, __pyx_L1_error) - /* "w3lib/_url.pyx":125 + /* "w3lib/_url.pyx":124 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_tuple__34 = PyTuple_Pack(11, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_percent_encode_set, __pyx_n_s_space_as_plus, __pyx_n_s_encoder, __pyx_n_s_output, __pyx_n_s_encode_output, __pyx_n_s__33, __pyx_n_s_i, __pyx_n_s_byte, __pyx_n_s_isomorph); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_tuple__34 = PyTuple_Pack(11, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_percent_encode_set, __pyx_n_s_space_as_plus, __pyx_n_s_encoder, __pyx_n_s_output, __pyx_n_s_encode_output, __pyx_n_s__33, __pyx_n_s_i, __pyx_n_s_byte, __pyx_n_s_isomorph); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_percent_encode_after_encoding, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_percent_encode_after_encoding, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 124, __pyx_L1_error) - /* "w3lib/_url.pyx":175 + /* "w3lib/_url.pyx":174 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< * address = [0] * 8 * piece_index = 0 */ - __pyx_tuple__44 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_address, __pyx_n_s_piece_index, __pyx_n_s_compress, __pyx_n_s_pointer, __pyx_n_s_input_lenght, __pyx_n_s_value, __pyx_n_s_length, __pyx_n_s_numbers_seen, __pyx_n_s_ipv4_piece, __pyx_n_s_number, __pyx_n_s_swaps); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_tuple__44 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_address, __pyx_n_s_piece_index, __pyx_n_s_compress, __pyx_n_s_pointer, __pyx_n_s_input_lenght, __pyx_n_s_value, __pyx_n_s_length, __pyx_n_s_numbers_seen, __pyx_n_s_ipv4_piece, __pyx_n_s_number, __pyx_n_s_swaps); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); - __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv6, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv6, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 174, __pyx_L1_error) - /* "w3lib/_url.pyx":262 + /* "w3lib/_url.pyx":261 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< * input: str, * percent_encode_set: _PercentEncodeSet, */ - __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); - __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_utf_8_percent_encode, 262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_utf_8_percent_encode, 261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 261, __pyx_L1_error) - /* "w3lib/_url.pyx":274 + /* "w3lib/_url.pyx":273 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: */ - __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); - __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_opaque_host, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_opaque_host, 273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 273, __pyx_L1_error) - /* "w3lib/_url.pyx":282 + /* "w3lib/_url.pyx":281 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< * if not input: * raise ValueError */ - __pyx_tuple__50 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_validation_error, __pyx_n_s_r); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_tuple__50 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_validation_error, __pyx_n_s_r); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); - __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4_number, 282, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4_number, 281, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 281, __pyx_L1_error) - /* "w3lib/_url.pyx":302 + /* "w3lib/_url.pyx":301 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and parts[-1] == "": */ - __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_last, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_last, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); - __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_ends_in_number, 302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_ends_in_number, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 301, __pyx_L1_error) - /* "w3lib/_url.pyx":319 + /* "w3lib/_url.pyx":318 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and not parts[-1]: */ - __pyx_tuple__54 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_numbers, __pyx_n_s_part, __pyx_n_s_result, __pyx_n_s_ipv4, __pyx_n_s_counter, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_tuple__54 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_numbers, __pyx_n_s_part, __pyx_n_s_result, __pyx_n_s_ipv4, __pyx_n_s_counter, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); - __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4, 319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4, 318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 318, __pyx_L1_error) - /* "w3lib/_url.pyx":342 + /* "w3lib/_url.pyx":341 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< * result = _utr46._to_ascii( * domain, */ - __pyx_tuple__56 = PyTuple_Pack(3, __pyx_n_s_domain, __pyx_n_s_be_strict, __pyx_n_s_result); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_tuple__56 = PyTuple_Pack(3, __pyx_n_s_domain, __pyx_n_s_be_strict, __pyx_n_s_result); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); - __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_domain_to_ascii, 342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_domain_to_ascii, 341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 341, __pyx_L1_error) - /* "w3lib/_url.pyx":361 + /* "w3lib/_url.pyx":360 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_is_special, __pyx_n_s_domain, __pyx_n_s_ascii_domain, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_is_special, __pyx_n_s_domain, __pyx_n_s_ascii_domain, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); - __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_host, 361, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_host, 360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 360, __pyx_L1_error) - /* "w3lib/_url.pyx":383 + /* "w3lib/_url.pyx":382 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * */ - __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_input); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_input); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); - __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_windows_drive_letter, 383, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_windows_drive_letter, 382, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 382, __pyx_L1_error) - /* "w3lib/_url.pyx":388 + /* "w3lib/_url.pyx":387 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< * input_length = len(input) * return ( */ - __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_input_length); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_input_length); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); - __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_starts_with_windows_drive_lette, 388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_starts_with_windows_drive_lette, 387, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 387, __pyx_L1_error) - /* "w3lib/_url.pyx":398 + /* "w3lib/_url.pyx":397 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< * return input in ( * "..", */ - __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_double_dot_path_segment, 398, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_double_dot_path_segment, 397, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 397, __pyx_L1_error) - /* "w3lib/_url.pyx":413 + /* "w3lib/_url.pyx":412 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< * return input in ( * ".", */ - __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_single_dot_path_segment, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_single_dot_path_segment, 412, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 412, __pyx_L1_error) - /* "w3lib/_url.pyx":424 + /* "w3lib/_url.pyx":423 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * *, input: str, pointer: int, encode_set: _PercentEncodeSet * ) -> str: */ - __pyx_tuple__66 = PyTuple_Pack(4, __pyx_n_s_input, __pyx_n_s_pointer, __pyx_n_s_encode_set, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_tuple__66 = PyTuple_Pack(4, __pyx_n_s_input, __pyx_n_s_pointer, __pyx_n_s_encode_set, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66); - __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_idempotent_utf_8_percent_encode, 424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_idempotent_utf_8_percent_encode, 423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 423, __pyx_L1_error) - /* "w3lib/_url.pyx":439 + /* "w3lib/_url.pyx":438 * * * def _parse_url( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_tuple__68 = PyTuple_Pack(26, __pyx_n_s_input, __pyx_n_s_base_url, __pyx_n_s_encoding, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_path_percent_encode_set, __pyx_n_s_query_percent_encode_set, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_base, __pyx_n_s_url, __pyx_n_s_state, __pyx_n_s_buffer, __pyx_n_s_at_sign_seen, __pyx_n_s_inside_brackets, __pyx_n_s_skip_authority_shortcut, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_c, __pyx_n_s_at_sign_index, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_encoded_code_points, __pyx_n_s_host, __pyx_n_s_port, __pyx_n_s_encoded, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_tuple__68 = PyTuple_Pack(26, __pyx_n_s_input, __pyx_n_s_base_url, __pyx_n_s_encoding, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_path_percent_encode_set, __pyx_n_s_query_percent_encode_set, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_base, __pyx_n_s_url, __pyx_n_s_state, __pyx_n_s_buffer, __pyx_n_s_at_sign_seen, __pyx_n_s_inside_brackets, __pyx_n_s_skip_authority_shortcut, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_c, __pyx_n_s_at_sign_index, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_encoded_code_points, __pyx_n_s_host, __pyx_n_s_port, __pyx_n_s_encoded, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68); - __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_url, 439, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_url, 438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 438, __pyx_L1_error) - /* "w3lib/_url.pyx":871 + /* "w3lib/_url.pyx":870 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< * output = "" * n = address */ - __pyx_tuple__70 = PyTuple_Pack(4, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 871, __pyx_L1_error) + __pyx_tuple__70 = PyTuple_Pack(4, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__70); __Pyx_GIVEREF(__pyx_tuple__70); - __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv4, 871, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 871, __pyx_L1_error) + __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv4, 870, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 870, __pyx_L1_error) - /* "w3lib/_url.pyx":882 + /* "w3lib/_url.pyx":881 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: */ - __pyx_tuple__72 = PyTuple_Pack(7, __pyx_n_s_address, __pyx_n_s_min_length, __pyx_n_s_index, __pyx_n_s_index_length, __pyx_n_s_current_length, __pyx_n_s_current_index, __pyx_n_s_piece); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_tuple__72 = PyTuple_Pack(7, __pyx_n_s_address, __pyx_n_s_min_length, __pyx_n_s_index, __pyx_n_s_index_length, __pyx_n_s_current_length, __pyx_n_s_current_index, __pyx_n_s_piece); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); - __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_ipv6_first_longest_0_piece, 882, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_ipv6_first_longest_0_piece, 881, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 881, __pyx_L1_error) - /* "w3lib/_url.pyx":900 + /* "w3lib/_url.pyx":899 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) */ - __pyx_tuple__74 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_compress, __pyx_n_s_ignore0, __pyx_n_s_piece_index, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_tuple__74 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_compress, __pyx_n_s_ignore0, __pyx_n_s_piece_index, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74); - __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv6, 900, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv6, 899, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 899, __pyx_L1_error) - /* "w3lib/_url.pyx":921 + /* "w3lib/_url.pyx":920 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< * if isinstance(host, int): * return _serialize_ipv4(host) */ - __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_s_host); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 921, __pyx_L1_error) + __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_s_host); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); - __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_host, 921, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 921, __pyx_L1_error) + __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_host, 920, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 920, __pyx_L1_error) - /* "w3lib/_url.pyx":930 + /* "w3lib/_url.pyx":929 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< * if url.has_opaque_path(): * assert isinstance(url.path, str) */ - __pyx_tuple__78 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_canonicalize, __pyx_n_s_output, __pyx_n_s_segment); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 930, __pyx_L1_error) + __pyx_tuple__78 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_canonicalize, __pyx_n_s_output, __pyx_n_s_segment); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78); - __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url_path, 930, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 930, __pyx_L1_error) + __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url_path, 929, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 929, __pyx_L1_error) - /* "w3lib/_url.pyx":943 + /* "w3lib/_url.pyx":942 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url( # <<<<<<<<<<<<<< * url: _URL, * *, */ - __pyx_tuple__80 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_exclude_fragment, __pyx_n_s_canonicalize, __pyx_n_s_output); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_tuple__80 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_exclude_fragment, __pyx_n_s_canonicalize, __pyx_n_s_output); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__80); __Pyx_GIVEREF(__pyx_tuple__80); - __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url, 943, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url, 942, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -21973,15 +21997,15 @@ static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr)) __PYX_ERR(0, 309, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr)) __PYX_ERR(0, 308, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 308, __pyx_L1_error) #else __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 309, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 308, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_print = 0; @@ -21992,15 +22016,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 329, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 328, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 328, __pyx_L1_error) #else __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 329, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 328, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_print = 0; @@ -22327,240 +22351,240 @@ if (!__Pyx_RefNanny) { if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":6 + /* "w3lib/_url.pyx":5 * # https://url.spec.whatwg.org/ * * from math import floor # <<<<<<<<<<<<<< * from typing import List, Optional, Tuple, Union * from urllib.parse import unquote */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_floor); __Pyx_GIVEREF(__pyx_n_s_floor); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_floor)) __PYX_ERR(0, 6, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_math, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_floor)) __PYX_ERR(0, 5, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_math, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_floor, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_floor, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":7 + /* "w3lib/_url.pyx":6 * * from math import floor * from typing import List, Optional, Tuple, Union # <<<<<<<<<<<<<< * from urllib.parse import unquote * */ - __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_List); __Pyx_GIVEREF(__pyx_n_s_List); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_List)) __PYX_ERR(0, 7, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_List)) __PYX_ERR(0, 6, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_Optional); __Pyx_GIVEREF(__pyx_n_s_Optional); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Optional)) __PYX_ERR(0, 7, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Optional)) __PYX_ERR(0, 6, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_Tuple); __Pyx_GIVEREF(__pyx_n_s_Tuple); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_Tuple)) __PYX_ERR(0, 7, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_Tuple)) __PYX_ERR(0, 6, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_Union); __Pyx_GIVEREF(__pyx_n_s_Union); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_Union)) __PYX_ERR(0, 7, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_Union)) __PYX_ERR(0, 6, __pyx_L1_error); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_List); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_List); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_List, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_List, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tuple, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tuple, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":8 + /* "w3lib/_url.pyx":7 * from math import floor * from typing import List, Optional, Tuple, Union * from urllib.parse import unquote # <<<<<<<<<<<<<< * * from . import _utr46 */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_unquote); __Pyx_GIVEREF(__pyx_n_s_unquote); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_unquote)) __PYX_ERR(0, 8, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_urllib_parse, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_unquote)) __PYX_ERR(0, 7, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_urllib_parse, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_unquote); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_unquote); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":10 + /* "w3lib/_url.pyx":9 * from urllib.parse import unquote * * from . import _utr46 # <<<<<<<<<<<<<< * from ._encoding import ( * _get_encoder, */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_utr46); __Pyx_GIVEREF(__pyx_n_s_utr46); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_utr46)) __PYX_ERR(0, 10, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s__2, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_utr46)) __PYX_ERR(0, 9, __pyx_L1_error); + __pyx_t_2 = __Pyx_Import(__pyx_n_s__2, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_utr46); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_utr46); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_utr46, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utr46, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":12 + /* "w3lib/_url.pyx":11 * from . import _utr46 * from ._encoding import ( * _get_encoder, # <<<<<<<<<<<<<< * _get_output_encoding, * ) */ - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_get_encoder); __Pyx_GIVEREF(__pyx_n_s_get_encoder); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_encoder)) __PYX_ERR(0, 12, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_encoder)) __PYX_ERR(0, 11, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_get_output_encoding); __Pyx_GIVEREF(__pyx_n_s_get_output_encoding); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_get_output_encoding)) __PYX_ERR(0, 12, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_get_output_encoding)) __PYX_ERR(0, 11, __pyx_L1_error); - /* "w3lib/_url.pyx":11 + /* "w3lib/_url.pyx":10 * * from . import _utr46 * from ._encoding import ( # <<<<<<<<<<<<<< * _get_encoder, * _get_output_encoding, */ - __pyx_t_3 = __Pyx_Import(__pyx_n_s_encoding_2, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_n_s_encoding_2, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoder, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoder, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_get_output_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_get_output_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_output_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_output_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":16 + /* "w3lib/_url.pyx":15 * ) * from ._infra import ( * _ASCII_ALPHA, # <<<<<<<<<<<<<< * _ASCII_ALPHANUMERIC, * _ASCII_DIGIT, */ - __pyx_t_3 = PyList_New(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 16, __pyx_L1_error) + __pyx_t_3 = PyList_New(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_ASCII_ALPHA); __Pyx_GIVEREF(__pyx_n_s_ASCII_ALPHA); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ASCII_ALPHA)) __PYX_ERR(0, 16, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ASCII_ALPHA)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ASCII_ALPHANUMERIC); __Pyx_GIVEREF(__pyx_n_s_ASCII_ALPHANUMERIC); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_ASCII_ALPHANUMERIC)) __PYX_ERR(0, 16, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_ASCII_ALPHANUMERIC)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ASCII_DIGIT); __Pyx_GIVEREF(__pyx_n_s_ASCII_DIGIT); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ASCII_DIGIT)) __PYX_ERR(0, 16, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ASCII_DIGIT)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ASCII_HEX_DIGIT); __Pyx_GIVEREF(__pyx_n_s_ASCII_HEX_DIGIT); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_ASCII_HEX_DIGIT)) __PYX_ERR(0, 16, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_ASCII_HEX_DIGIT)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ASCII_TAB_OR_NEWLINE); __Pyx_GIVEREF(__pyx_n_s_ASCII_TAB_OR_NEWLINE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_ASCII_TAB_OR_NEWLINE)) __PYX_ERR(0, 16, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_ASCII_TAB_OR_NEWLINE)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_C0_CONTROL); __Pyx_GIVEREF(__pyx_n_s_C0_CONTROL); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_C0_CONTROL)) __PYX_ERR(0, 16, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_C0_CONTROL)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_C0_CONTROL_OR_SPACE); __Pyx_GIVEREF(__pyx_n_s_C0_CONTROL_OR_SPACE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_C0_CONTROL_OR_SPACE)) __PYX_ERR(0, 16, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_C0_CONTROL_OR_SPACE)) __PYX_ERR(0, 15, __pyx_L1_error); - /* "w3lib/_url.pyx":15 + /* "w3lib/_url.pyx":14 * _get_output_encoding, * ) * from ._infra import ( # <<<<<<<<<<<<<< * _ASCII_ALPHA, * _ASCII_ALPHANUMERIC, */ - __pyx_t_2 = __Pyx_Import(__pyx_n_s_infra, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_n_s_infra, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHA, __pyx_t_3) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHA, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHANUMERIC, __pyx_t_3) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHANUMERIC, __pyx_t_3) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_HEX_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_HEX_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_OR_SPACE, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_OR_SPACE, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":24 + /* "w3lib/_url.pyx":23 * _C0_CONTROL_OR_SPACE, * ) * from ._util import _PercentEncodeSet # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PercentEncodeSet); __Pyx_GIVEREF(__pyx_n_s_PercentEncodeSet); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PercentEncodeSet)) __PYX_ERR(0, 24, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_util, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PercentEncodeSet)) __PYX_ERR(0, 23, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_util, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PercentEncodeSet, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PercentEncodeSet, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":27 + /* "w3lib/_url.pyx":26 * * * _ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { # <<<<<<<<<<<<<< @@ -22568,26 +22592,26 @@ if (!__Pyx_RefNanny) { * } */ { /* enter inner scope */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L4_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":28 + /* "w3lib/_url.pyx":27 * * _ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { * ord(char): None for char in _ASCII_TAB_OR_NEWLINE # <<<<<<<<<<<<<< * } * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L4_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L4_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 28, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 27, __pyx_L4_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -22596,28 +22620,28 @@ if (!__Pyx_RefNanny) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 28, __pyx_L4_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 27, __pyx_L4_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 28, __pyx_L4_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 27, __pyx_L4_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L4_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 28, __pyx_L4_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 27, __pyx_L4_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 28, __pyx_L4_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 27, __pyx_L4_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L4_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -22627,7 +22651,7 @@ if (!__Pyx_RefNanny) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 28, __pyx_L4_error) + else __PYX_ERR(0, 27, __pyx_L4_error) } break; } @@ -22639,11 +22663,11 @@ if (!__Pyx_RefNanny) { __pyx_t_2 = 0; __pyx_t_2 = __pyx_7genexpr__pyx_v_5w3lib_4_url_char; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_2); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 28, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_2); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 27, __pyx_L4_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L4_error) + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_t_2, (PyObject*)Py_None))) __PYX_ERR(0, 28, __pyx_L4_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_t_2, (PyObject*)Py_None))) __PYX_ERR(0, 27, __pyx_L4_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -22656,416 +22680,416 @@ if (!__Pyx_RefNanny) { goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO, __pyx_t_3) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":31 + /* "w3lib/_url.pyx":30 * } * * SCHEME_START = 0 # <<<<<<<<<<<<<< * SCHEME = 1 * NO_SCHEME = 2 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME_START, __pyx_int_0) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME_START, __pyx_int_0) < 0) __PYX_ERR(0, 30, __pyx_L1_error) - /* "w3lib/_url.pyx":32 + /* "w3lib/_url.pyx":31 * * SCHEME_START = 0 * SCHEME = 1 # <<<<<<<<<<<<<< * NO_SCHEME = 2 * SPECIAL_RELATIVE_OR_AUTHORITY = 3 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME, __pyx_int_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME, __pyx_int_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error) - /* "w3lib/_url.pyx":33 + /* "w3lib/_url.pyx":32 * SCHEME_START = 0 * SCHEME = 1 * NO_SCHEME = 2 # <<<<<<<<<<<<<< * SPECIAL_RELATIVE_OR_AUTHORITY = 3 * PATH_OR_AUTHORITY = 4 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_SCHEME, __pyx_int_2) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_SCHEME, __pyx_int_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error) - /* "w3lib/_url.pyx":34 + /* "w3lib/_url.pyx":33 * SCHEME = 1 * NO_SCHEME = 2 * SPECIAL_RELATIVE_OR_AUTHORITY = 3 # <<<<<<<<<<<<<< * PATH_OR_AUTHORITY = 4 * RELATIVE = 5 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY, __pyx_int_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY, __pyx_int_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) - /* "w3lib/_url.pyx":35 + /* "w3lib/_url.pyx":34 * NO_SCHEME = 2 * SPECIAL_RELATIVE_OR_AUTHORITY = 3 * PATH_OR_AUTHORITY = 4 # <<<<<<<<<<<<<< * RELATIVE = 5 * RELATIVE_SLASH = 6 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_OR_AUTHORITY, __pyx_int_4) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_OR_AUTHORITY, __pyx_int_4) < 0) __PYX_ERR(0, 34, __pyx_L1_error) - /* "w3lib/_url.pyx":36 + /* "w3lib/_url.pyx":35 * SPECIAL_RELATIVE_OR_AUTHORITY = 3 * PATH_OR_AUTHORITY = 4 * RELATIVE = 5 # <<<<<<<<<<<<<< * RELATIVE_SLASH = 6 * SPECIAL_AUTHORITY_SLASHES = 7 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RELATIVE, __pyx_int_5) < 0) __PYX_ERR(0, 36, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RELATIVE, __pyx_int_5) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - /* "w3lib/_url.pyx":37 + /* "w3lib/_url.pyx":36 * PATH_OR_AUTHORITY = 4 * RELATIVE = 5 * RELATIVE_SLASH = 6 # <<<<<<<<<<<<<< * SPECIAL_AUTHORITY_SLASHES = 7 * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RELATIVE_SLASH, __pyx_int_6) < 0) __PYX_ERR(0, 37, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RELATIVE_SLASH, __pyx_int_6) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - /* "w3lib/_url.pyx":38 + /* "w3lib/_url.pyx":37 * RELATIVE = 5 * RELATIVE_SLASH = 6 * SPECIAL_AUTHORITY_SLASHES = 7 # <<<<<<<<<<<<<< * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 * AUTHORITY = 9 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_AUTHORITY_SLASHES, __pyx_int_7) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_AUTHORITY_SLASHES, __pyx_int_7) < 0) __PYX_ERR(0, 37, __pyx_L1_error) - /* "w3lib/_url.pyx":39 + /* "w3lib/_url.pyx":38 * RELATIVE_SLASH = 6 * SPECIAL_AUTHORITY_SLASHES = 7 * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 # <<<<<<<<<<<<<< * AUTHORITY = 9 * HOST = 10 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES, __pyx_int_8) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES, __pyx_int_8) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - /* "w3lib/_url.pyx":40 + /* "w3lib/_url.pyx":39 * SPECIAL_AUTHORITY_SLASHES = 7 * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 * AUTHORITY = 9 # <<<<<<<<<<<<<< * HOST = 10 * PORT = 11 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AUTHORITY, __pyx_int_9) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_AUTHORITY, __pyx_int_9) < 0) __PYX_ERR(0, 39, __pyx_L1_error) - /* "w3lib/_url.pyx":41 + /* "w3lib/_url.pyx":40 * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 * AUTHORITY = 9 * HOST = 10 # <<<<<<<<<<<<<< * PORT = 11 * FILE = 12 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_HOST, __pyx_int_10) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_HOST, __pyx_int_10) < 0) __PYX_ERR(0, 40, __pyx_L1_error) - /* "w3lib/_url.pyx":42 + /* "w3lib/_url.pyx":41 * AUTHORITY = 9 * HOST = 10 * PORT = 11 # <<<<<<<<<<<<<< * FILE = 12 * FILE_SLASH = 13 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PORT, __pyx_int_11) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PORT, __pyx_int_11) < 0) __PYX_ERR(0, 41, __pyx_L1_error) - /* "w3lib/_url.pyx":43 + /* "w3lib/_url.pyx":42 * HOST = 10 * PORT = 11 * FILE = 12 # <<<<<<<<<<<<<< * FILE_SLASH = 13 * FILE_HOST = 14 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FILE, __pyx_int_12) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FILE, __pyx_int_12) < 0) __PYX_ERR(0, 42, __pyx_L1_error) - /* "w3lib/_url.pyx":44 + /* "w3lib/_url.pyx":43 * PORT = 11 * FILE = 12 * FILE_SLASH = 13 # <<<<<<<<<<<<<< * FILE_HOST = 14 * PATH_START = 15 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FILE_SLASH, __pyx_int_13) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FILE_SLASH, __pyx_int_13) < 0) __PYX_ERR(0, 43, __pyx_L1_error) - /* "w3lib/_url.pyx":45 + /* "w3lib/_url.pyx":44 * FILE = 12 * FILE_SLASH = 13 * FILE_HOST = 14 # <<<<<<<<<<<<<< * PATH_START = 15 * PATH = 16 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FILE_HOST, __pyx_int_14) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FILE_HOST, __pyx_int_14) < 0) __PYX_ERR(0, 44, __pyx_L1_error) - /* "w3lib/_url.pyx":46 + /* "w3lib/_url.pyx":45 * FILE_SLASH = 13 * FILE_HOST = 14 * PATH_START = 15 # <<<<<<<<<<<<<< * PATH = 16 * OPAQUE_PATH = 17 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_START, __pyx_int_15) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_START, __pyx_int_15) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - /* "w3lib/_url.pyx":47 + /* "w3lib/_url.pyx":46 * FILE_HOST = 14 * PATH_START = 15 * PATH = 16 # <<<<<<<<<<<<<< * OPAQUE_PATH = 17 * QUERY = 18 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH, __pyx_int_16) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH, __pyx_int_16) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - /* "w3lib/_url.pyx":48 + /* "w3lib/_url.pyx":47 * PATH_START = 15 * PATH = 16 * OPAQUE_PATH = 17 # <<<<<<<<<<<<<< * QUERY = 18 * FRAGMENT = 19 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_OPAQUE_PATH, __pyx_int_17) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OPAQUE_PATH, __pyx_int_17) < 0) __PYX_ERR(0, 47, __pyx_L1_error) - /* "w3lib/_url.pyx":49 + /* "w3lib/_url.pyx":48 * PATH = 16 * OPAQUE_PATH = 17 * QUERY = 18 # <<<<<<<<<<<<<< * FRAGMENT = 19 * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY, __pyx_int_18) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY, __pyx_int_18) < 0) __PYX_ERR(0, 48, __pyx_L1_error) - /* "w3lib/_url.pyx":50 + /* "w3lib/_url.pyx":49 * OPAQUE_PATH = 17 * QUERY = 18 * FRAGMENT = 19 # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT, __pyx_int_19) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT, __pyx_int_19) < 0) __PYX_ERR(0, 49, __pyx_L1_error) - /* "w3lib/_url.pyx":55 + /* "w3lib/_url.pyx":54 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#default-port * _DEFAULT_PORTS = { * "ftp": 21, # <<<<<<<<<<<<<< * "file": None, * "http": 80, */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_ftp, __pyx_int_21) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_ftp, __pyx_int_21) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - /* "w3lib/_url.pyx":56 + /* "w3lib/_url.pyx":55 * _DEFAULT_PORTS = { * "ftp": 21, * "file": None, # <<<<<<<<<<<<<< * "http": 80, * "https": 443, */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_file, Py_None) < 0) __PYX_ERR(0, 55, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_http, __pyx_int_80) < 0) __PYX_ERR(0, 55, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_https, __pyx_int_443) < 0) __PYX_ERR(0, 55, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_ws, __pyx_int_80) < 0) __PYX_ERR(0, 55, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_wss, __pyx_int_443) < 0) __PYX_ERR(0, 55, __pyx_L1_error) - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_PORTS, __pyx_t_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_file, Py_None) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_http, __pyx_int_80) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_https, __pyx_int_443) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_ws, __pyx_int_80) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_wss, __pyx_int_443) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_PORTS, __pyx_t_3) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":62 + /* "w3lib/_url.pyx":61 * "wss": 443, * } * _SPECIAL_SCHEMES = set(_DEFAULT_PORTS.keys()) # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySet_New(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_4 = PySet_New(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_SCHEMES, __pyx_t_4) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_SCHEMES, __pyx_t_4) < 0) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":65 + /* "w3lib/_url.pyx":64 * * * class _URL: # <<<<<<<<<<<<<< * _scheme: str = "" * username: str = "" */ - __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_URL, __pyx_n_s_URL, (PyObject *) NULL, __pyx_n_s_w3lib__url, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_URL, __pyx_n_s_URL, (PyObject *) NULL, __pyx_n_s_w3lib__url, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_scheme, __pyx_n_s_str) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_username, __pyx_n_s_str) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_password, __pyx_n_s_str) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hostname, __pyx_kp_s_Union_int_List_int_str) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_port, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_path, __pyx_kp_s_Union_str_List_str) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_query, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fragment, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_password_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_port_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_default_port_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_path_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_annotations, __pyx_t_3) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_scheme, __pyx_n_s_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_username, __pyx_n_s_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_password, __pyx_n_s_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hostname, __pyx_kp_s_Union_int_List_int_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_port, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_path, __pyx_kp_s_Union_str_List_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_query, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fragment, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_password_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_port_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_default_port_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_path_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_annotations, __pyx_t_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":66 + /* "w3lib/_url.pyx":65 * * class _URL: * _scheme: str = "" # <<<<<<<<<<<<<< * username: str = "" * password: str = "" */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_scheme, __pyx_kp_u__2) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_scheme, __pyx_kp_u__2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - /* "w3lib/_url.pyx":67 + /* "w3lib/_url.pyx":66 * class _URL: * _scheme: str = "" * username: str = "" # <<<<<<<<<<<<<< * password: str = "" * hostname: Union[int, List[int], str] = "" */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_username, __pyx_kp_u__2) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_username, __pyx_kp_u__2) < 0) __PYX_ERR(0, 66, __pyx_L1_error) - /* "w3lib/_url.pyx":68 + /* "w3lib/_url.pyx":67 * _scheme: str = "" * username: str = "" * password: str = "" # <<<<<<<<<<<<<< * hostname: Union[int, List[int], str] = "" * port: Optional[int] = None */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_password, __pyx_kp_u__2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_password, __pyx_kp_u__2) < 0) __PYX_ERR(0, 67, __pyx_L1_error) - /* "w3lib/_url.pyx":69 + /* "w3lib/_url.pyx":68 * username: str = "" * password: str = "" * hostname: Union[int, List[int], str] = "" # <<<<<<<<<<<<<< * port: Optional[int] = None * path: Union[str, List[str]] */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) - /* "w3lib/_url.pyx":70 + /* "w3lib/_url.pyx":69 * password: str = "" * hostname: Union[int, List[int], str] = "" * port: Optional[int] = None # <<<<<<<<<<<<<< * path: Union[str, List[str]] * query: Optional[str] = None */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_port, Py_None) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_port, Py_None) < 0) __PYX_ERR(0, 69, __pyx_L1_error) - /* "w3lib/_url.pyx":72 + /* "w3lib/_url.pyx":71 * port: Optional[int] = None * path: Union[str, List[str]] * query: Optional[str] = None # <<<<<<<<<<<<<< * fragment: Optional[str] = None * */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 71, __pyx_L1_error) - /* "w3lib/_url.pyx":73 + /* "w3lib/_url.pyx":72 * path: Union[str, List[str]] * query: Optional[str] = None * fragment: Optional[str] = None # <<<<<<<<<<<<<< * * # Indicates whether a color (:) separating a username from a password */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_fragment, Py_None) < 0) __PYX_ERR(0, 73, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_fragment, Py_None) < 0) __PYX_ERR(0, 72, __pyx_L1_error) - /* "w3lib/_url.pyx":78 + /* "w3lib/_url.pyx":77 * # existed in the parsed URL. This enables :func:`_serialize_url` to * # generate a URL that matches the input URL, if desired. * _password_token_seen: bool = False # <<<<<<<<<<<<<< * * # Indicates, for an empty port component, whether or not a colon (:) */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_password_token_seen, Py_False) < 0) __PYX_ERR(0, 78, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_password_token_seen, Py_False) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - /* "w3lib/_url.pyx":83 + /* "w3lib/_url.pyx":82 * # character was used. This enables :func:`_serialize_url` to * # generate a URL that matches the input URL, if desired. * _port_token_seen: bool = False # <<<<<<<<<<<<<< * * # Indicates whether or not a default port was specified in the input URL. */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_port_token_seen, Py_False) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_port_token_seen, Py_False) < 0) __PYX_ERR(0, 82, __pyx_L1_error) - /* "w3lib/_url.pyx":88 + /* "w3lib/_url.pyx":87 * # This enables :func:`_serialize_url` to generate a URL that matches the * # input URL, if desired. * _default_port_seen: bool = False # <<<<<<<<<<<<<< * * # Indicates, for an empty path component, whether or not a slash (/) */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_default_port_seen, Py_False) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_default_port_seen, Py_False) < 0) __PYX_ERR(0, 87, __pyx_L1_error) - /* "w3lib/_url.pyx":93 + /* "w3lib/_url.pyx":92 * # character was used. This enables :func:`_serialize_url` to * # generate a URL that matches the input URL, if desired. * _path_token_seen: bool = False # <<<<<<<<<<<<<< * * def __init__(self) -> None: */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_path_token_seen, Py_False) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_path_token_seen, Py_False) < 0) __PYX_ERR(0, 92, __pyx_L1_error) - /* "w3lib/_url.pyx":95 + /* "w3lib/_url.pyx":94 * _path_token_seen: bool = False * * def __init__(self) -> None: # <<<<<<<<<<<<<< * self.path = [] * self.is_special = False */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 95, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_1__init__, 0, __pyx_n_s_URL___init, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_1__init__, 0, __pyx_n_s_URL___init, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 95, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":99 + /* "w3lib/_url.pyx":98 * self.is_special = False * * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< * return isinstance(self.path, str) * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 99, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_3has_opaque_path, 0, __pyx_n_s_URL_has_opaque_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_3has_opaque_path, 0, __pyx_n_s_URL_has_opaque_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_has_opaque_path, __pyx_t_3) < 0) __PYX_ERR(0, 99, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_has_opaque_path, __pyx_t_3) < 0) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":102 + /* "w3lib/_url.pyx":101 * return isinstance(self.path, str) * * @property # <<<<<<<<<<<<<< * def scheme(self) -> str: * return self._scheme */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 102, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_5scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_5scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 102, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":106 + /* "w3lib/_url.pyx":105 * return self._scheme * * @scheme.setter # <<<<<<<<<<<<<< @@ -23077,16 +23101,16 @@ if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_scheme_2); } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_setter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_setter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_value, __pyx_n_s_str) < 0) __PYX_ERR(0, 106, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 106, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_7scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 106, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_value, __pyx_n_s_str) < 0) __PYX_ERR(0, 105, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_7scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -23109,580 +23133,580 @@ if (!__Pyx_RefNanny) { __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 106, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":65 + /* "w3lib/_url.pyx":64 * * * class _URL: # <<<<<<<<<<<<<< * _scheme: str = "" * username: str = "" */ - __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_URL, __pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_URL, __pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_URL, __pyx_t_3) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_URL, __pyx_t_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":112 + /* "w3lib/_url.pyx":111 * * * _SCHEME_CHARS = _ASCII_ALPHANUMERIC + "+-." # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__30); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__30); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME_CHARS, __pyx_t_3) < 0) __PYX_ERR(0, 112, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME_CHARS, __pyx_t_3) < 0) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":116 + /* "w3lib/_url.pyx":115 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< * path = url.path * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 116, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 116, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_1_shorten_path, 0, __pyx_n_s_shorten_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_1_shorten_path, 0, __pyx_n_s_shorten_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_shorten_path, __pyx_t_4) < 0) __PYX_ERR(0, 116, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_shorten_path, __pyx_t_4) < 0) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":125 + /* "w3lib/_url.pyx":124 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_space_as_plus, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 125, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_space_as_plus, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 125, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 125, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 125, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_space_as_plus, __pyx_n_s_bool) < 0) __PYX_ERR(0, 125, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 125, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_3_percent_encode_after_encoding, 0, __pyx_n_s_percent_encode_after_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_space_as_plus, __pyx_n_s_bool) < 0) __PYX_ERR(0, 124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_3_percent_encode_after_encoding, 0, __pyx_n_s_percent_encode_after_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_percent_encode_after_encoding, __pyx_t_8) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_percent_encode_after_encoding, __pyx_t_8) < 0) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "w3lib/_url.pyx":160 + /* "w3lib/_url.pyx":159 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - /* "w3lib/_url.pyx":161 + /* "w3lib/_url.pyx":160 * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( * _C0_CONTROL, # <<<<<<<<<<<<<< * greater_than="~", * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":160 + /* "w3lib/_url.pyx":159 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":162 + /* "w3lib/_url.pyx":161 * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( * _C0_CONTROL, * greater_than="~", # <<<<<<<<<<<<<< * ) * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_greater_than, __pyx_kp_u__36) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_greater_than, __pyx_kp_u__36) < 0) __PYX_ERR(0, 161, __pyx_L1_error) - /* "w3lib/_url.pyx":160 + /* "w3lib/_url.pyx":159 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_t_9) < 0) __PYX_ERR(0, 160, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_t_9) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":164 + /* "w3lib/_url.pyx":163 * greater_than="~", * ) * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' # <<<<<<<<<<<<<< * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_kp_u__37); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_kp_u__37); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_t_3) < 0) __PYX_ERR(0, 164, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_t_3) < 0) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":165 + /* "w3lib/_url.pyx":164 * ) * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' # <<<<<<<<<<<<<< * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__38); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__38); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_t_9) < 0) __PYX_ERR(0, 165, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_t_9) < 0) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":166 + /* "w3lib/_url.pyx":165 * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" # <<<<<<<<<<<<<< * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_kp_u__39); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_kp_u__39); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_t_3) < 0) __PYX_ERR(0, 166, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_t_3) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":167 + /* "w3lib/_url.pyx":166 * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" # <<<<<<<<<<<<<< * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__40); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__40); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_t_9) < 0) __PYX_ERR(0, 167, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_t_9) < 0) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":168 + /* "w3lib/_url.pyx":167 * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" # <<<<<<<<<<<<<< * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_kp_u__41); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_kp_u__41); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_t_3) < 0) __PYX_ERR(0, 168, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_t_3) < 0) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":171 + /* "w3lib/_url.pyx":170 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point * _FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" # <<<<<<<<<<<<<< * _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_kp_u__42) < 0) __PYX_ERR(0, 171, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_kp_u__42) < 0) __PYX_ERR(0, 170, __pyx_L1_error) - /* "w3lib/_url.pyx":172 + /* "w3lib/_url.pyx":171 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point * _FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" * _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__43); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_9 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__43); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_t_9) < 0) __PYX_ERR(0, 172, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_t_9) < 0) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":175 + /* "w3lib/_url.pyx":174 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< * address = [0] * 8 * piece_index = 0 */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 175, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 175, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_5_parse_ipv6, 0, __pyx_n_s_parse_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 174, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_5_parse_ipv6, 0, __pyx_n_s_parse_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 175, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":262 + /* "w3lib/_url.pyx":261 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< * input: str, * percent_encode_set: _PercentEncodeSet, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 262, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 262, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 262, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_7_utf_8_percent_encode, 0, __pyx_n_s_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 262, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 261, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 261, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_7_utf_8_percent_encode, 0, __pyx_n_s_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf_8_percent_encode, __pyx_t_9) < 0) __PYX_ERR(0, 262, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf_8_percent_encode, __pyx_t_9) < 0) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":274 + /* "w3lib/_url.pyx":273 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 274, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 274, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_9_parse_opaque_host, 0, __pyx_n_s_parse_opaque_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 273, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_9_parse_opaque_host, 0, __pyx_n_s_parse_opaque_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_opaque_host, __pyx_t_4) < 0) __PYX_ERR(0, 274, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_opaque_host, __pyx_t_4) < 0) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":282 + /* "w3lib/_url.pyx":281 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< * if not input: * raise ValueError */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 282, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Tuple_int_bool) < 0) __PYX_ERR(0, 282, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_11_parse_ipv4_number, 0, __pyx_n_s_parse_ipv4_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 282, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 281, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Tuple_int_bool) < 0) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_11_parse_ipv4_number, 0, __pyx_n_s_parse_ipv4_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4_number, __pyx_t_9) < 0) __PYX_ERR(0, 282, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4_number, __pyx_t_9) < 0) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":302 + /* "w3lib/_url.pyx":301 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and parts[-1] == "": */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 302, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 302, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_13_ends_in_number, 0, __pyx_n_s_ends_in_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 301, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_13_ends_in_number, 0, __pyx_n_s_ends_in_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ends_in_number, __pyx_t_4) < 0) __PYX_ERR(0, 302, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ends_in_number, __pyx_t_4) < 0) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":319 + /* "w3lib/_url.pyx":318 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and not parts[-1]: */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 319, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 319, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_15_parse_ipv4, 0, __pyx_n_s_parse_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 319, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 318, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_15_parse_ipv4, 0, __pyx_n_s_parse_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4, __pyx_t_9) < 0) __PYX_ERR(0, 319, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4, __pyx_t_9) < 0) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":342 + /* "w3lib/_url.pyx":341 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< * result = _utr46._to_ascii( * domain, */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_be_strict, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 342, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_be_strict, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domain, __pyx_n_s_str) < 0) __PYX_ERR(0, 342, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_be_strict, __pyx_n_s_bool) < 0) __PYX_ERR(0, 342, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 342, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_17_domain_to_ascii, 0, __pyx_n_s_domain_to_ascii, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domain, __pyx_n_s_str) < 0) __PYX_ERR(0, 341, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_be_strict, __pyx_n_s_bool) < 0) __PYX_ERR(0, 341, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_17_domain_to_ascii, 0, __pyx_n_s_domain_to_ascii, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_3, __pyx_t_9); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_domain_to_ascii, __pyx_t_3) < 0) __PYX_ERR(0, 342, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_domain_to_ascii, __pyx_t_3) < 0) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":361 + /* "w3lib/_url.pyx":360 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_special, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 361, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_special, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 361, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_is_special, __pyx_n_s_bool) < 0) __PYX_ERR(0, 361, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 361, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_19_parse_host, 0, __pyx_n_s_parse_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 360, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_is_special, __pyx_n_s_bool) < 0) __PYX_ERR(0, 360, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_19_parse_host, 0, __pyx_n_s_parse_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_9, __pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_host, __pyx_t_9) < 0) __PYX_ERR(0, 361, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_host, __pyx_t_9) < 0) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":383 + /* "w3lib/_url.pyx":382 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 383, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 383, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_21_is_windows_drive_letter, 0, __pyx_n_s_is_windows_drive_letter, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 382, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_21_is_windows_drive_letter, 0, __pyx_n_s_is_windows_drive_letter, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_windows_drive_letter, __pyx_t_4) < 0) __PYX_ERR(0, 383, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_windows_drive_letter, __pyx_t_4) < 0) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":388 + /* "w3lib/_url.pyx":387 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< * input_length = len(input) * return ( */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 388, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 388, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_23_starts_with_windows_drive_letter, 0, __pyx_n_s_starts_with_windows_drive_lette, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 388, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_23_starts_with_windows_drive_letter, 0, __pyx_n_s_starts_with_windows_drive_lette, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_starts_with_windows_drive_lette, __pyx_t_9) < 0) __PYX_ERR(0, 388, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_starts_with_windows_drive_lette, __pyx_t_9) < 0) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":398 + /* "w3lib/_url.pyx":397 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< * return input in ( * "..", */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 398, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 398, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_25_is_double_dot_path_segment, 0, __pyx_n_s_is_double_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 397, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_25_is_double_dot_path_segment, 0, __pyx_n_s_is_double_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_double_dot_path_segment, __pyx_t_4) < 0) __PYX_ERR(0, 398, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_double_dot_path_segment, __pyx_t_4) < 0) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":413 + /* "w3lib/_url.pyx":412 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< * return input in ( * ".", */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_27_is_single_dot_path_segment, 0, __pyx_n_s_is_single_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 413, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 412, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_27_is_single_dot_path_segment, 0, __pyx_n_s_is_single_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_single_dot_path_segment, __pyx_t_9) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_single_dot_path_segment, __pyx_t_9) < 0) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":424 + /* "w3lib/_url.pyx":423 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * *, input: str, pointer: int, encode_set: _PercentEncodeSet * ) -> str: */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 424, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_pointer, __pyx_n_s_int) < 0) __PYX_ERR(0, 424, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 424, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 424, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_29_idempotent_utf_8_percent_encode, 0, __pyx_n_s_idempotent_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 423, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_pointer, __pyx_n_s_int) < 0) __PYX_ERR(0, 423, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 423, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_29_idempotent_utf_8_percent_encode, 0, __pyx_n_s_idempotent_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_idempotent_utf_8_percent_encode, __pyx_t_4) < 0) __PYX_ERR(0, 424, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_idempotent_utf_8_percent_encode, __pyx_t_4) < 0) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":439 + /* "w3lib/_url.pyx":438 * * * def _parse_url( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, __pyx_n_s_str) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_31_parse_url, 0, __pyx_n_s_parse_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, __pyx_n_s_str) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_31_parse_url, 0, __pyx_n_s_parse_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_9, sizeof(__pyx_defaults), 5)) __PYX_ERR(0, 439, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_9, sizeof(__pyx_defaults), 5)) __PYX_ERR(0, 438, __pyx_L1_error) - /* "w3lib/_url.pyx":444 + /* "w3lib/_url.pyx":443 * base_url: str = None, * encoding: str = "utf-8", * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_userinfo_percent_encode_set = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":445 + /* "w3lib/_url.pyx":444 * encoding: str = "utf-8", * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_path_percent_encode_set = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":446 + /* "w3lib/_url.pyx":445 * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_query_percent_encode_set = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":447 + /* "w3lib/_url.pyx":446 * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, * ) -> _URL: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_special_query_percent_encode_set = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":448 + /* "w3lib/_url.pyx":447 * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * ) -> _URL: * """Return a :class:`_URL` object built from *url*, *base_url* and */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_fragment_percent_encode_set = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); @@ -23690,166 +23714,166 @@ if (!__Pyx_RefNanny) { __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_9, __pyx_pf_5w3lib_4_url_44__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_url, __pyx_t_9) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_url, __pyx_t_9) < 0) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":871 + /* "w3lib/_url.pyx":870 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< * output = "" * n = address */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 871, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_address, __pyx_n_s_int) < 0) __PYX_ERR(0, 871, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 871, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_33_serialize_ipv4, 0, __pyx_n_s_serialize_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_address, __pyx_n_s_int) < 0) __PYX_ERR(0, 870, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 870, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_33_serialize_ipv4, 0, __pyx_n_s_serialize_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv4, __pyx_t_4) < 0) __PYX_ERR(0, 871, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv4, __pyx_t_4) < 0) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":882 + /* "w3lib/_url.pyx":881 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 882, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_min_length, __pyx_n_s_int) < 0) __PYX_ERR(0, 882, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 882, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index, 0, __pyx_n_s_get_ipv6_first_longest_0_piece, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 882, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 881, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_min_length, __pyx_n_s_int) < 0) __PYX_ERR(0, 881, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index, 0, __pyx_n_s_get_ipv6_first_longest_0_piece, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_9, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 882, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_9, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 881, __pyx_L1_error) - /* "w3lib/_url.pyx":883 + /* "w3lib/_url.pyx":882 * * def _get_ipv6_first_longest_0_piece_index( * address: List[int], *, min_length: int = 2 # <<<<<<<<<<<<<< * ) -> Optional[int]: * index = None */ - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_2))) __PYX_ERR(0, 883, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_2))) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_INCREF(__pyx_int_2); __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_9)->__pyx_arg_min_length = ((PyObject*)__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_9, __pyx_pf_5w3lib_4_url_46__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_t_9) < 0) __PYX_ERR(0, 882, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_t_9) < 0) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":900 + /* "w3lib/_url.pyx":899 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 900, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 900, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_37_serialize_ipv6, 0, __pyx_n_s_serialize_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 900, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 899, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_37_serialize_ipv6, 0, __pyx_n_s_serialize_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 900, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":921 + /* "w3lib/_url.pyx":920 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< * if isinstance(host, int): * return _serialize_ipv4(host) */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 921, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_host, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 921, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 921, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_39_serialize_host, 0, __pyx_n_s_serialize_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 921, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_host, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 920, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 920, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_39_serialize_host, 0, __pyx_n_s_serialize_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_host, __pyx_t_9) < 0) __PYX_ERR(0, 921, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_host, __pyx_t_9) < 0) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":930 + /* "w3lib/_url.pyx":929 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< * if url.has_opaque_path(): * assert isinstance(url.path, str) */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 930, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 930, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 930, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_canonicalize, __pyx_n_s_bool) < 0) __PYX_ERR(0, 930, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 930, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_41_serialize_url_path, 0, __pyx_n_s_serialize_url_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 930, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 929, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_canonicalize, __pyx_n_s_bool) < 0) __PYX_ERR(0, 929, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_41_serialize_url_path, 0, __pyx_n_s_serialize_url_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_3, __pyx_t_9); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url_path, __pyx_t_3) < 0) __PYX_ERR(0, 930, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url_path, __pyx_t_3) < 0) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":943 + /* "w3lib/_url.pyx":942 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url( # <<<<<<<<<<<<<< * url: _URL, * *, */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_exclude_fragment, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 943, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_exclude_fragment, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 942, __pyx_L1_error) - /* "w3lib/_url.pyx":947 + /* "w3lib/_url.pyx":946 * *, * exclude_fragment: bool = False, * canonicalize: Optional[bool] = None, # <<<<<<<<<<<<<< * ) -> str: * """Return a string representation of *url* following the URL serialization */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 943, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 942, __pyx_L1_error) - /* "w3lib/_url.pyx":943 + /* "w3lib/_url.pyx":942 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url( # <<<<<<<<<<<<<< * url: _URL, * *, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 943, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_exclude_fragment, __pyx_n_s_bool) < 0) __PYX_ERR(0, 943, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_canonicalize, __pyx_kp_s_Optional_bool) < 0) __PYX_ERR(0, 943, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 943, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_43_serialize_url, 0, __pyx_n_s_serialize_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 943, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 942, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_exclude_fragment, __pyx_n_s_bool) < 0) __PYX_ERR(0, 942, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_canonicalize, __pyx_kp_s_Optional_bool) < 0) __PYX_ERR(0, 942, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_43_serialize_url, 0, __pyx_n_s_serialize_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_9, __pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url, __pyx_t_9) < 0) __PYX_ERR(0, 943, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url, __pyx_t_9) < 0) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "w3lib/_url.pyx":1 - * #cython: language_level=3 # <<<<<<<<<<<<<< - * # pylint: disable=protected-access,too-many-instance-attributes,too-many-locals,too-many-nested-blocks,too-many-statements + * # pylint: disable=protected-access,too-many-instance-attributes,too-many-locals,too-many-nested-blocks,too-many-statements # <<<<<<<<<<<<<< * + * # https://url.spec.whatwg.org/ */ __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); diff --git a/w3lib/_util.c b/w3lib/_util.c new file mode 100644 index 00000000..9178ab54 --- /dev/null +++ b/w3lib/_util.c @@ -0,0 +1,12310 @@ +/* Generated by Cython 3.0.8 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "name": "w3lib._util", + "sources": [ + "w3lib/_util.pyx" + ] + }, + "module_name": "w3lib._util" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API +#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#else +#define __PYX_EXTRA_ABI_MODULE_NAME "" +#endif +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030008F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #ifdef Py_LIMITED_API + #undef __PYX_LIMITED_VERSION_HEX + #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API + #endif + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_USE_CPP_STD_MOVE + #if defined(__cplusplus) && (\ + __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) + #define CYTHON_USE_CPP_STD_MOVE 1 + #else + #define CYTHON_USE_CPP_STD_MOVE 0 + #endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #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 +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if CYTHON_COMPILING_IN_LIMITED_API + static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } + #ifndef CO_OPTIMIZED + #define CO_OPTIMIZED 0x0001 + #endif + #ifndef CO_NEWLOCALS + #define CO_NEWLOCALS 0x0002 + #endif + #ifndef CO_VARARGS + #define CO_VARARGS 0x0004 + #endif + #ifndef CO_VARKEYWORDS + #define CO_VARKEYWORDS 0x0008 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x0200 + #endif + #ifndef CO_GENERATOR + #define CO_GENERATOR 0x0020 + #endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x0080 + #endif +#elif PY_VERSION_HEX >= 0x030B0000 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); + if (!empty_bytes) return NULL; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); + Py_DECREF(empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_MAJOR_VERSION >= 0x030900B1 +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) +#else +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) +#endif +#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) +#elif !CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) +static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { + return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; +} +#endif +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API + return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; +#else + return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +#endif +} +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) +#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) +#else + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) +#endif +#if PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__w3lib___util +#define __PYX_HAVE_API__w3lib___util +/* Early includes */ +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#include +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#include +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "w3lib/_util.pyx", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* #### Code section: numeric_typedefs ### */ +/* #### Code section: complex_type_declarations ### */ +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ +struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__; +struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr; + +/* "w3lib/_util.pyx":18 + * """ + * + * def __init__( # <<<<<<<<<<<<<< + * self, + * code_points: str, + */ +struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ { + PyObject_HEAD + PyObject *__pyx_v_code_points; +}; + + +/* "w3lib/_util.pyx":30 + * if exclude: + * code_points = "".join( + * chr(value) # <<<<<<<<<<<<<< + * for value in range(self._greater_than + 1) + * if chr(value) not in code_points + */ +struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr { + PyObject_HEAD + struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ *__pyx_outer_scope; + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_value; +}; + +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#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 + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* TupleAndListFromArray.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* fastcall.proto */ +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#else + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) +#endif +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) + #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) +#else + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) +#endif +#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) +#define __Pyx_KwValues_VARARGS(args, nargs) NULL +#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) +#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) +#if CYTHON_METH_FASTCALL + #define __Pyx_Arg_FASTCALL(args, i) args[i] + #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) + static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + #else + #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) + #endif + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) +#else + #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS + #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS + #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS + #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS + #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) + #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, + const char* function_name); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* RaiseUnboundLocalError.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#if !CYTHON_VECTORCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if !CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03080000 + #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #define __Pxy_PyFrame_Initialize_Offsets() + #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) +#else + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif +#endif +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectFastCall.proto */ +#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* RaiseClosureNameError.proto */ +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); + +/* PyUnicodeContains.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_ContainsTF(PyObject* substring, PyObject* text, int eq) { + int result = PyUnicode_Contains(text, substring); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + L->ob_item[len] = x; + #else + PyList_SET_ITEM(list, len, x); + #endif + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* pep479.proto */ +static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); + +/* 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); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* unicode_iter.proto */ +static CYTHON_INLINE int __Pyx_init_unicode_iteration( + PyObject* ustring, Py_ssize_t *length, void** data, int *kind); + +/* PyObjectFormatAndDecref.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); + +/* JoinPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char); + +/* IncludeStructmemberH.proto */ +#include + +/* FixUpExtensionType.proto */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); +#endif + +/* PyObjectCallNoArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* ValidateBasesTuple.proto */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); +#endif + +/* PyType_Ready.proto */ +CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchSharedCythonModule.proto */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); + +/* FetchCommonType.proto */ +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); +#else +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +#endif + +/* PyMethodNew.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + typesModule = PyImport_ImportModule("types"); + if (!typesModule) return NULL; + methodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + if (!methodType) return NULL; + result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); + Py_DECREF(methodType); + return result; +} +#elif PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#else + #define __Pyx_PyMethod_New PyMethod_New +#endif + +/* PyVectorcallFastCallDict.proto */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); +#endif + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CYFUNCTION_COROUTINE 0x08 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#else + #define __Pyx_CyFunction_GetClassObj(f)\ + ((PyObject*) ((PyCMethodObject *) (f))->mm_class) +#endif +#define __Pyx_CyFunction_SetClassObj(f, classobj)\ + __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject_HEAD + PyObject *func; +#elif PY_VERSION_HEX < 0x030900B1 + PyCFunctionObject func; +#else + PyCMethodObject func; +#endif +#if CYTHON_BACKPORT_VECTORCALL + __pyx_vectorcallfunc func_vectorcall; +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_classobj; +#endif + void *defaults; + int defaults_pyobjects; + size_t defaults_size; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; + PyObject *func_is_coroutine; +} __pyx_CyFunctionObject; +#undef __Pyx_CyOrPyCFunction_Check +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); +#undef __Pyx_IsSameCFunction +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(PyObject *module); +#if CYTHON_METH_FASTCALL +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#if CYTHON_BACKPORT_VECTORCALL +#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) +#else +#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) +#endif +#endif + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + +/* SetNameInClass.proto */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) +#elif CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) +#else +#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) +#endif + +/* CalculateMetaclass.proto */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +/* PyObjectCall2Args.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectLookupSpecial.proto */ +#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) +#define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) +static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); +#else +#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +/* Py3ClassCreate.proto */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); + +/* CLineInTraceback.proto */ +#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 */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* CoroutineBase.proto */ +struct __pyx_CoroutineObject; +typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_ExcInfoStruct _PyErr_StackItem +#else +typedef struct { + PyObject *exc_type; + PyObject *exc_value; + PyObject *exc_traceback; +} __Pyx_ExcInfoStruct; +#endif +typedef struct __pyx_CoroutineObject { + PyObject_HEAD + __pyx_coroutine_body_t body; + PyObject *closure; + __Pyx_ExcInfoStruct gi_exc_state; + PyObject *gi_weakreflist; + PyObject *classobj; + PyObject *yieldfrom; + PyObject *gi_name; + PyObject *gi_qualname; + PyObject *gi_modulename; + PyObject *gi_code; + PyObject *gi_frame; + int resume_label; + char is_running; +} __pyx_CoroutineObject; +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); +static int __Pyx_Coroutine_clear(PyObject *self); +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); +static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_Coroutine_SwapException(self) +#define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) +#else +#define __Pyx_Coroutine_SwapException(self) {\ + __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ + __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ + } +#define __Pyx_Coroutine_ResetAndClearException(self) {\ + __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ + (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ + } +#endif +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) +#endif +static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); + +/* PatchModuleWithCoroutine.proto */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); + +/* PatchGeneratorABC.proto */ +static int __Pyx_patch_abc(void); + +/* Generator.proto */ +#define __Pyx_Generator_USED +#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) +#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ + __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) +static PyObject *__Pyx_Generator_Next(PyObject *self); +static int __pyx_Generator_init(PyObject *module); + +/* CheckBinaryVersion.proto */ +static unsigned long __Pyx_get_runtime_version(void); +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ + +/* Module declarations from "w3lib._util" */ +/* #### Code section: typeinfo ### */ +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "w3lib._util" +extern int __pyx_module_is_main_w3lib___util; +int __pyx_module_is_main_w3lib___util = 0; + +/* Implementation of "w3lib._util" */ +/* #### Code section: global_var ### */ +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_chr; +static PyObject *__pyx_builtin_sorted; +/* #### Code section: string_decls ### */ +static const char __pyx_k_[] = ""; +static const char __pyx_k__2[] = ""; +static const char __pyx_k__3[] = ")"; +static const char __pyx_k__4[] = "."; +static const char __pyx_k_cp[] = "cp"; +static const char __pyx_k_gc[] = "gc"; +static const char __pyx_k_gt[] = "gt"; +static const char __pyx_k_or[] = "__or__"; +static const char __pyx_k__18[] = "?"; +static const char __pyx_k_add[] = "__add__"; +static const char __pyx_k_and[] = "__and__"; +static const char __pyx_k_chr[] = "chr"; +static const char __pyx_k_doc[] = "__doc__"; +static const char __pyx_k_key[] = "key"; +static const char __pyx_k_ord[] = "ord"; +static const char __pyx_k_str[] = "str"; +static const char __pyx_k_sub[] = "__sub__"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_bool[] = "bool"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_repr[] = "__repr__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_send[] = "send"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_Union[] = "Union"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_other[] = "other"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_super[] = "super"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_enable[] = "enable"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_module[] = "__module__"; +static const char __pyx_k_return[] = "return"; +static const char __pyx_k_sorted[] = "sorted"; +static const char __pyx_k_typing[] = "typing"; +static const char __pyx_k_disable[] = "disable"; +static const char __pyx_k_exclude[] = "exclude"; +static const char __pyx_k_genexpr[] = "genexpr"; +static const char __pyx_k_prepare[] = "__prepare__"; +static const char __pyx_k_replace[] = "replace"; +static const char __pyx_k_contains[] = "__contains__"; +static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_set_name[] = "__set_name__"; +static const char __pyx_k_isenabled[] = "isenabled"; +static const char __pyx_k_metaclass[] = "__metaclass__"; +static const char __pyx_k_code_point[] = "code_point"; +static const char __pyx_k_code_points[] = "code_points"; +static const char __pyx_k_w3lib__util[] = "w3lib._util"; +static const char __pyx_k_greater_than[] = "greater_than"; +static const char __pyx_k_is_coroutine[] = "_is_coroutine"; +static const char __pyx_k_Union_int_str[] = "Union[int, str]"; +static const char __pyx_k_code_points_2[] = "_code_points"; +static const char __pyx_k_init_subclass[] = "__init_subclass__"; +static const char __pyx_k_greater_than_2[] = "_greater_than"; +static const char __pyx_k_greater_than_3[] = ", greater_than="; +static const char __pyx_k_new_code_points[] = "new_code_points"; +static const char __pyx_k_w3lib__util_pyx[] = "w3lib/_util.pyx"; +static const char __pyx_k_PercentEncodeSet[] = "_PercentEncodeSet"; +static const char __pyx_k_PercentEncodeSet_2[] = "_PercentEncodeSet("; +static const char __pyx_k_PercentEncodeSet_3[] = "'_PercentEncodeSet'"; +static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_PercentEncodeSet___or[] = "_PercentEncodeSet.__or__"; +static const char __pyx_k_PercentEncodeSet___add[] = "_PercentEncodeSet.__add__"; +static const char __pyx_k_PercentEncodeSet___and[] = "_PercentEncodeSet.__and__"; +static const char __pyx_k_PercentEncodeSet___sub[] = "_PercentEncodeSet.__sub__"; +static const char __pyx_k_PercentEncodeSet___init[] = "_PercentEncodeSet.__init__"; +static const char __pyx_k_PercentEncodeSet___repr[] = "_PercentEncodeSet.__repr__"; +static const char __pyx_k_PercentEncodeSet___contains[] = "_PercentEncodeSet.__contains__"; +static const char __pyx_k_PercentEncodeSet___init___local[] = "_PercentEncodeSet.__init__..genexpr"; +static const char __pyx_k_Set_of_code_points_that_require[] = "Set of code points that require percent-encoding.\n\n The set is comprised of *code_points* and any code point greater than\n *greater_than*.\n\n If *exclude* is ``True``, *code_points* is interpreted as a string of code\n points *not* to percent-encode, i.e. all other code points lower or equal\n to *greater_than* must be percent-encoded.\n\n *greater_than* is 0x7F by default, meaning all non-ASCII characters are\n included.\n "; +/* #### Code section: decls ### */ +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__init___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_points, PyObject *__pyx_v_greater_than, PyObject *__pyx_v_exclude); /* proto */ +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_point); /* proto */ +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_points); /* proto */ +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_points); /* proto */ +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_5w3lib_5_util___pyx_scope_struct____init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_5w3lib_5_util___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + PyObject *__pyx_type_5w3lib_5_util___pyx_scope_struct____init__; + PyObject *__pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr; + #endif + PyTypeObject *__pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__; + PyTypeObject *__pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr; + PyObject *__pyx_kp_u_; + PyObject *__pyx_n_s_PercentEncodeSet; + PyObject *__pyx_kp_u_PercentEncodeSet_2; + PyObject *__pyx_kp_s_PercentEncodeSet_3; + PyObject *__pyx_n_s_PercentEncodeSet___add; + PyObject *__pyx_n_s_PercentEncodeSet___and; + PyObject *__pyx_n_s_PercentEncodeSet___contains; + PyObject *__pyx_n_s_PercentEncodeSet___init; + PyObject *__pyx_n_s_PercentEncodeSet___init___local; + PyObject *__pyx_n_s_PercentEncodeSet___or; + PyObject *__pyx_n_s_PercentEncodeSet___repr; + PyObject *__pyx_n_s_PercentEncodeSet___sub; + PyObject *__pyx_kp_s_Set_of_code_points_that_require; + PyObject *__pyx_n_s_Union; + PyObject *__pyx_kp_s_Union_int_str; + PyObject *__pyx_n_s__18; + PyObject *__pyx_kp_u__2; + PyObject *__pyx_kp_u__3; + PyObject *__pyx_kp_u__4; + PyObject *__pyx_n_s_add; + PyObject *__pyx_n_s_and; + PyObject *__pyx_n_s_args; + PyObject *__pyx_n_s_asyncio_coroutines; + PyObject *__pyx_n_s_bool; + PyObject *__pyx_n_s_chr; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_close; + PyObject *__pyx_n_s_code_point; + PyObject *__pyx_n_s_code_points; + PyObject *__pyx_n_s_code_points_2; + PyObject *__pyx_n_s_contains; + PyObject *__pyx_n_s_cp; + PyObject *__pyx_n_s_dict; + PyObject *__pyx_kp_u_disable; + PyObject *__pyx_n_s_doc; + PyObject *__pyx_kp_u_enable; + PyObject *__pyx_n_s_exclude; + PyObject *__pyx_kp_u_gc; + PyObject *__pyx_n_s_genexpr; + PyObject *__pyx_n_s_greater_than; + PyObject *__pyx_n_s_greater_than_2; + PyObject *__pyx_kp_u_greater_than_3; + PyObject *__pyx_n_s_gt; + PyObject *__pyx_n_s_import; + PyObject *__pyx_n_s_init; + PyObject *__pyx_n_s_init_subclass; + PyObject *__pyx_n_s_is_coroutine; + PyObject *__pyx_kp_u_isenabled; + PyObject *__pyx_n_s_key; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_metaclass; + PyObject *__pyx_n_s_module; + PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_new_code_points; + PyObject *__pyx_n_s_or; + PyObject *__pyx_n_s_ord; + PyObject *__pyx_n_s_other; + PyObject *__pyx_n_s_prepare; + PyObject *__pyx_n_s_qualname; + PyObject *__pyx_n_s_range; + PyObject *__pyx_n_s_replace; + PyObject *__pyx_n_s_repr; + PyObject *__pyx_n_s_return; + PyObject *__pyx_n_s_self; + PyObject *__pyx_n_s_send; + PyObject *__pyx_n_s_set_name; + PyObject *__pyx_n_s_sorted; + PyObject *__pyx_n_s_str; + PyObject *__pyx_n_s_sub; + PyObject *__pyx_n_s_super; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_throw; + PyObject *__pyx_n_s_typing; + PyObject *__pyx_n_s_w3lib__util; + PyObject *__pyx_kp_s_w3lib__util_pyx; + PyObject *__pyx_int_1; + PyObject *__pyx_tuple__5; + PyObject *__pyx_tuple__7; + PyObject *__pyx_tuple__9; + PyObject *__pyx_tuple__11; + PyObject *__pyx_tuple__13; + PyObject *__pyx_tuple__16; + PyObject *__pyx_codeobj__6; + PyObject *__pyx_codeobj__8; + PyObject *__pyx_codeobj__10; + PyObject *__pyx_codeobj__12; + PyObject *__pyx_codeobj__14; + PyObject *__pyx_codeobj__15; + PyObject *__pyx_codeobj__17; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__); + Py_CLEAR(clear_module_state->__pyx_type_5w3lib_5_util___pyx_scope_struct____init__); + Py_CLEAR(clear_module_state->__pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr); + Py_CLEAR(clear_module_state->__pyx_kp_u_); + Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet); + Py_CLEAR(clear_module_state->__pyx_kp_u_PercentEncodeSet_2); + Py_CLEAR(clear_module_state->__pyx_kp_s_PercentEncodeSet_3); + Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet___add); + Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet___and); + Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet___contains); + Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet___init); + Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet___init___local); + Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet___or); + Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet___repr); + Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet___sub); + Py_CLEAR(clear_module_state->__pyx_kp_s_Set_of_code_points_that_require); + Py_CLEAR(clear_module_state->__pyx_n_s_Union); + Py_CLEAR(clear_module_state->__pyx_kp_s_Union_int_str); + Py_CLEAR(clear_module_state->__pyx_n_s__18); + Py_CLEAR(clear_module_state->__pyx_kp_u__2); + Py_CLEAR(clear_module_state->__pyx_kp_u__3); + Py_CLEAR(clear_module_state->__pyx_kp_u__4); + Py_CLEAR(clear_module_state->__pyx_n_s_add); + Py_CLEAR(clear_module_state->__pyx_n_s_and); + Py_CLEAR(clear_module_state->__pyx_n_s_args); + Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); + Py_CLEAR(clear_module_state->__pyx_n_s_bool); + Py_CLEAR(clear_module_state->__pyx_n_s_chr); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_close); + Py_CLEAR(clear_module_state->__pyx_n_s_code_point); + Py_CLEAR(clear_module_state->__pyx_n_s_code_points); + Py_CLEAR(clear_module_state->__pyx_n_s_code_points_2); + Py_CLEAR(clear_module_state->__pyx_n_s_contains); + Py_CLEAR(clear_module_state->__pyx_n_s_cp); + Py_CLEAR(clear_module_state->__pyx_n_s_dict); + Py_CLEAR(clear_module_state->__pyx_kp_u_disable); + Py_CLEAR(clear_module_state->__pyx_n_s_doc); + Py_CLEAR(clear_module_state->__pyx_kp_u_enable); + Py_CLEAR(clear_module_state->__pyx_n_s_exclude); + Py_CLEAR(clear_module_state->__pyx_kp_u_gc); + Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); + Py_CLEAR(clear_module_state->__pyx_n_s_greater_than); + Py_CLEAR(clear_module_state->__pyx_n_s_greater_than_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_greater_than_3); + Py_CLEAR(clear_module_state->__pyx_n_s_gt); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_n_s_init); + Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); + Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); + Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); + Py_CLEAR(clear_module_state->__pyx_n_s_key); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); + Py_CLEAR(clear_module_state->__pyx_n_s_module); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_new_code_points); + Py_CLEAR(clear_module_state->__pyx_n_s_or); + Py_CLEAR(clear_module_state->__pyx_n_s_ord); + Py_CLEAR(clear_module_state->__pyx_n_s_other); + Py_CLEAR(clear_module_state->__pyx_n_s_prepare); + Py_CLEAR(clear_module_state->__pyx_n_s_qualname); + Py_CLEAR(clear_module_state->__pyx_n_s_range); + Py_CLEAR(clear_module_state->__pyx_n_s_replace); + Py_CLEAR(clear_module_state->__pyx_n_s_repr); + Py_CLEAR(clear_module_state->__pyx_n_s_return); + Py_CLEAR(clear_module_state->__pyx_n_s_self); + Py_CLEAR(clear_module_state->__pyx_n_s_send); + Py_CLEAR(clear_module_state->__pyx_n_s_set_name); + Py_CLEAR(clear_module_state->__pyx_n_s_sorted); + Py_CLEAR(clear_module_state->__pyx_n_s_str); + Py_CLEAR(clear_module_state->__pyx_n_s_sub); + Py_CLEAR(clear_module_state->__pyx_n_s_super); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_throw); + Py_CLEAR(clear_module_state->__pyx_n_s_typing); + Py_CLEAR(clear_module_state->__pyx_n_s_w3lib__util); + Py_CLEAR(clear_module_state->__pyx_kp_s_w3lib__util_pyx); + Py_CLEAR(clear_module_state->__pyx_int_1); + Py_CLEAR(clear_module_state->__pyx_tuple__5); + Py_CLEAR(clear_module_state->__pyx_tuple__7); + Py_CLEAR(clear_module_state->__pyx_tuple__9); + Py_CLEAR(clear_module_state->__pyx_tuple__11); + Py_CLEAR(clear_module_state->__pyx_tuple__13); + Py_CLEAR(clear_module_state->__pyx_tuple__16); + Py_CLEAR(clear_module_state->__pyx_codeobj__6); + Py_CLEAR(clear_module_state->__pyx_codeobj__8); + Py_CLEAR(clear_module_state->__pyx_codeobj__10); + Py_CLEAR(clear_module_state->__pyx_codeobj__12); + Py_CLEAR(clear_module_state->__pyx_codeobj__14); + Py_CLEAR(clear_module_state->__pyx_codeobj__15); + Py_CLEAR(clear_module_state->__pyx_codeobj__17); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__); + Py_VISIT(traverse_module_state->__pyx_type_5w3lib_5_util___pyx_scope_struct____init__); + Py_VISIT(traverse_module_state->__pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr); + Py_VISIT(traverse_module_state->__pyx_kp_u_); + Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet); + Py_VISIT(traverse_module_state->__pyx_kp_u_PercentEncodeSet_2); + Py_VISIT(traverse_module_state->__pyx_kp_s_PercentEncodeSet_3); + Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet___add); + Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet___and); + Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet___contains); + Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet___init); + Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet___init___local); + Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet___or); + Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet___repr); + Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet___sub); + Py_VISIT(traverse_module_state->__pyx_kp_s_Set_of_code_points_that_require); + Py_VISIT(traverse_module_state->__pyx_n_s_Union); + Py_VISIT(traverse_module_state->__pyx_kp_s_Union_int_str); + Py_VISIT(traverse_module_state->__pyx_n_s__18); + Py_VISIT(traverse_module_state->__pyx_kp_u__2); + Py_VISIT(traverse_module_state->__pyx_kp_u__3); + Py_VISIT(traverse_module_state->__pyx_kp_u__4); + Py_VISIT(traverse_module_state->__pyx_n_s_add); + Py_VISIT(traverse_module_state->__pyx_n_s_and); + Py_VISIT(traverse_module_state->__pyx_n_s_args); + Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); + Py_VISIT(traverse_module_state->__pyx_n_s_bool); + Py_VISIT(traverse_module_state->__pyx_n_s_chr); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_close); + Py_VISIT(traverse_module_state->__pyx_n_s_code_point); + Py_VISIT(traverse_module_state->__pyx_n_s_code_points); + Py_VISIT(traverse_module_state->__pyx_n_s_code_points_2); + Py_VISIT(traverse_module_state->__pyx_n_s_contains); + Py_VISIT(traverse_module_state->__pyx_n_s_cp); + Py_VISIT(traverse_module_state->__pyx_n_s_dict); + Py_VISIT(traverse_module_state->__pyx_kp_u_disable); + Py_VISIT(traverse_module_state->__pyx_n_s_doc); + Py_VISIT(traverse_module_state->__pyx_kp_u_enable); + Py_VISIT(traverse_module_state->__pyx_n_s_exclude); + Py_VISIT(traverse_module_state->__pyx_kp_u_gc); + Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); + Py_VISIT(traverse_module_state->__pyx_n_s_greater_than); + Py_VISIT(traverse_module_state->__pyx_n_s_greater_than_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_greater_than_3); + Py_VISIT(traverse_module_state->__pyx_n_s_gt); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_n_s_init); + Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); + Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); + Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); + Py_VISIT(traverse_module_state->__pyx_n_s_key); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); + Py_VISIT(traverse_module_state->__pyx_n_s_module); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_new_code_points); + Py_VISIT(traverse_module_state->__pyx_n_s_or); + Py_VISIT(traverse_module_state->__pyx_n_s_ord); + Py_VISIT(traverse_module_state->__pyx_n_s_other); + Py_VISIT(traverse_module_state->__pyx_n_s_prepare); + Py_VISIT(traverse_module_state->__pyx_n_s_qualname); + Py_VISIT(traverse_module_state->__pyx_n_s_range); + Py_VISIT(traverse_module_state->__pyx_n_s_replace); + Py_VISIT(traverse_module_state->__pyx_n_s_repr); + Py_VISIT(traverse_module_state->__pyx_n_s_return); + Py_VISIT(traverse_module_state->__pyx_n_s_self); + Py_VISIT(traverse_module_state->__pyx_n_s_send); + Py_VISIT(traverse_module_state->__pyx_n_s_set_name); + Py_VISIT(traverse_module_state->__pyx_n_s_sorted); + Py_VISIT(traverse_module_state->__pyx_n_s_str); + Py_VISIT(traverse_module_state->__pyx_n_s_sub); + Py_VISIT(traverse_module_state->__pyx_n_s_super); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_throw); + Py_VISIT(traverse_module_state->__pyx_n_s_typing); + Py_VISIT(traverse_module_state->__pyx_n_s_w3lib__util); + Py_VISIT(traverse_module_state->__pyx_kp_s_w3lib__util_pyx); + Py_VISIT(traverse_module_state->__pyx_int_1); + Py_VISIT(traverse_module_state->__pyx_tuple__5); + Py_VISIT(traverse_module_state->__pyx_tuple__7); + Py_VISIT(traverse_module_state->__pyx_tuple__9); + Py_VISIT(traverse_module_state->__pyx_tuple__11); + Py_VISIT(traverse_module_state->__pyx_tuple__13); + Py_VISIT(traverse_module_state->__pyx_tuple__16); + Py_VISIT(traverse_module_state->__pyx_codeobj__6); + Py_VISIT(traverse_module_state->__pyx_codeobj__8); + Py_VISIT(traverse_module_state->__pyx_codeobj__10); + Py_VISIT(traverse_module_state->__pyx_codeobj__12); + Py_VISIT(traverse_module_state->__pyx_codeobj__14); + Py_VISIT(traverse_module_state->__pyx_codeobj__15); + Py_VISIT(traverse_module_state->__pyx_codeobj__17); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#define __pyx_type_5w3lib_5_util___pyx_scope_struct____init__ __pyx_mstate_global->__pyx_type_5w3lib_5_util___pyx_scope_struct____init__ +#define __pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr +#endif +#define __pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__ __pyx_mstate_global->__pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__ +#define __pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr +#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ +#define __pyx_n_s_PercentEncodeSet __pyx_mstate_global->__pyx_n_s_PercentEncodeSet +#define __pyx_kp_u_PercentEncodeSet_2 __pyx_mstate_global->__pyx_kp_u_PercentEncodeSet_2 +#define __pyx_kp_s_PercentEncodeSet_3 __pyx_mstate_global->__pyx_kp_s_PercentEncodeSet_3 +#define __pyx_n_s_PercentEncodeSet___add __pyx_mstate_global->__pyx_n_s_PercentEncodeSet___add +#define __pyx_n_s_PercentEncodeSet___and __pyx_mstate_global->__pyx_n_s_PercentEncodeSet___and +#define __pyx_n_s_PercentEncodeSet___contains __pyx_mstate_global->__pyx_n_s_PercentEncodeSet___contains +#define __pyx_n_s_PercentEncodeSet___init __pyx_mstate_global->__pyx_n_s_PercentEncodeSet___init +#define __pyx_n_s_PercentEncodeSet___init___local __pyx_mstate_global->__pyx_n_s_PercentEncodeSet___init___local +#define __pyx_n_s_PercentEncodeSet___or __pyx_mstate_global->__pyx_n_s_PercentEncodeSet___or +#define __pyx_n_s_PercentEncodeSet___repr __pyx_mstate_global->__pyx_n_s_PercentEncodeSet___repr +#define __pyx_n_s_PercentEncodeSet___sub __pyx_mstate_global->__pyx_n_s_PercentEncodeSet___sub +#define __pyx_kp_s_Set_of_code_points_that_require __pyx_mstate_global->__pyx_kp_s_Set_of_code_points_that_require +#define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union +#define __pyx_kp_s_Union_int_str __pyx_mstate_global->__pyx_kp_s_Union_int_str +#define __pyx_n_s__18 __pyx_mstate_global->__pyx_n_s__18 +#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 +#define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 +#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 +#define __pyx_n_s_add __pyx_mstate_global->__pyx_n_s_add +#define __pyx_n_s_and __pyx_mstate_global->__pyx_n_s_and +#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args +#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines +#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool +#define __pyx_n_s_chr __pyx_mstate_global->__pyx_n_s_chr +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close +#define __pyx_n_s_code_point __pyx_mstate_global->__pyx_n_s_code_point +#define __pyx_n_s_code_points __pyx_mstate_global->__pyx_n_s_code_points +#define __pyx_n_s_code_points_2 __pyx_mstate_global->__pyx_n_s_code_points_2 +#define __pyx_n_s_contains __pyx_mstate_global->__pyx_n_s_contains +#define __pyx_n_s_cp __pyx_mstate_global->__pyx_n_s_cp +#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict +#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable +#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc +#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable +#define __pyx_n_s_exclude __pyx_mstate_global->__pyx_n_s_exclude +#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc +#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr +#define __pyx_n_s_greater_than __pyx_mstate_global->__pyx_n_s_greater_than +#define __pyx_n_s_greater_than_2 __pyx_mstate_global->__pyx_n_s_greater_than_2 +#define __pyx_kp_u_greater_than_3 __pyx_mstate_global->__pyx_kp_u_greater_than_3 +#define __pyx_n_s_gt __pyx_mstate_global->__pyx_n_s_gt +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init +#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass +#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine +#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled +#define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass +#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_new_code_points __pyx_mstate_global->__pyx_n_s_new_code_points +#define __pyx_n_s_or __pyx_mstate_global->__pyx_n_s_or +#define __pyx_n_s_ord __pyx_mstate_global->__pyx_n_s_ord +#define __pyx_n_s_other __pyx_mstate_global->__pyx_n_s_other +#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare +#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname +#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range +#define __pyx_n_s_replace __pyx_mstate_global->__pyx_n_s_replace +#define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr +#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return +#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self +#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send +#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name +#define __pyx_n_s_sorted __pyx_mstate_global->__pyx_n_s_sorted +#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str +#define __pyx_n_s_sub __pyx_mstate_global->__pyx_n_s_sub +#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw +#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing +#define __pyx_n_s_w3lib__util __pyx_mstate_global->__pyx_n_s_w3lib__util +#define __pyx_kp_s_w3lib__util_pyx __pyx_mstate_global->__pyx_kp_s_w3lib__util_pyx +#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 +#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 +#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 +#define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 +#define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 +#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 +#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 +#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 +#define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 +#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 +#define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 +#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 +#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 +#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 +/* #### Code section: module_code ### */ + +/* "w3lib/_util.pyx":18 + * """ + * + * def __init__( # <<<<<<<<<<<<<< + * self, + * code_points: str, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_1__init__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_5_util_17_PercentEncodeSet___init__, "_PercentEncodeSet.__init__(self, unicode code_points: str, *, greater_than: Union[int, str] = u'\\x7f', exclude: bool = False)"); +static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_5_util_17_PercentEncodeSet___init__}; +static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_1__init__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_code_points = 0; + PyObject *__pyx_v_greater_than = 0; + PyObject *__pyx_v_exclude = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_code_points,&__pyx_n_s_greater_than,&__pyx_n_s_exclude,0}; + values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_kp_u_))); + + /* "w3lib/_util.pyx":23 + * *, + * greater_than: Union[int, str] = "\x7f", + * exclude: bool = False, # <<<<<<<<<<<<<< + * ): + * if isinstance(greater_than, str): + */ + values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_code_points)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 18, __pyx_L3_error) + } + } + if (kw_args > 0 && likely(kw_args <= 2)) { + Py_ssize_t index; + for (index = 2; index < 4 && kw_args > 0; index++) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 18, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_code_points = ((PyObject*)values[1]); + __pyx_v_greater_than = values[2]; + __pyx_v_exclude = values[3]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 18, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code_points), (&PyUnicode_Type), 0, "code_points", 1))) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(__pyx_self, __pyx_v_self, __pyx_v_code_points, __pyx_v_greater_than, __pyx_v_exclude); + + /* "w3lib/_util.pyx":18 + * """ + * + * def __init__( # <<<<<<<<<<<<<< + * self, + * code_points: str, + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "w3lib/_util.pyx":30 + * if exclude: + * code_points = "".join( + * chr(value) # <<<<<<<<<<<<<< + * for value in range(self._greater_than + 1) + * if chr(value) not in code_points + */ + +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__init___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *)__pyx_tp_new_5w3lib_5_util___pyx_scope_struct_1_genexpr(__pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 30, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ *) __pyx_self; + __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); + __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_PercentEncodeSet___init___local, __pyx_n_s_w3lib__util); if (unlikely(!gen)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__init__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + + /* "w3lib/_util.pyx":31 + * code_points = "".join( + * chr(value) + * for value in range(self._greater_than + 1) # <<<<<<<<<<<<<< + * if chr(value) not in code_points + * ) + */ + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 31, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 31, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 31, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 31, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 31, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 31, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_util.pyx":32 + * chr(value) + * for value in range(self._greater_than + 1) + * if chr(value) not in code_points # <<<<<<<<<<<<<< + * ) + * self._code_points = code_points + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_code_points)) { __Pyx_RaiseClosureNameError("code_points"); __PYX_ERR(0, 32, __pyx_L1_error) } + if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_code_points == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 32, __pyx_L1_error) + } + __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_code_points, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "w3lib/_util.pyx":30 + * if exclude: + * code_points = "".join( + * chr(value) # <<<<<<<<<<<<<< + * for value in range(self._greater_than + 1) + * if chr(value) not in code_points + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_util.pyx":32 + * chr(value) + * for value in range(self._greater_than + 1) + * if chr(value) not in code_points # <<<<<<<<<<<<<< + * ) + * self._code_points = code_points + */ + } + + /* "w3lib/_util.pyx":31 + * code_points = "".join( + * chr(value) + * for value in range(self._greater_than + 1) # <<<<<<<<<<<<<< + * if chr(value) not in code_points + * ) + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* "w3lib/_util.pyx":30 + * if exclude: + * code_points = "".join( + * chr(value) # <<<<<<<<<<<<<< + * for value in range(self._greater_than + 1) + * if chr(value) not in code_points + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_util.pyx":18 + * """ + * + * def __init__( # <<<<<<<<<<<<<< + * self, + * code_points: str, + */ + +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_points, PyObject *__pyx_v_greater_than, PyObject *__pyx_v_exclude) { + struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ *__pyx_cur_scope; + PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + long __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + __pyx_cur_scope = (struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ *)__pyx_tp_new_5w3lib_5_util___pyx_scope_struct____init__(__pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 18, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_code_points = __pyx_v_code_points; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_code_points); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_code_points); + __Pyx_INCREF(__pyx_v_greater_than); + + /* "w3lib/_util.pyx":25 + * exclude: bool = False, + * ): + * if isinstance(greater_than, str): # <<<<<<<<<<<<<< + * greater_than = ord(greater_than) + * self._greater_than = greater_than + */ + __pyx_t_1 = PyUnicode_Check(__pyx_v_greater_than); + if (__pyx_t_1) { + + /* "w3lib/_util.pyx":26 + * ): + * if isinstance(greater_than, str): + * greater_than = ord(greater_than) # <<<<<<<<<<<<<< + * self._greater_than = greater_than + * if exclude: + */ + __pyx_t_2 = __Pyx_PyObject_Ord(__pyx_v_greater_than); if (unlikely(__pyx_t_2 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 26, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_greater_than, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_util.pyx":25 + * exclude: bool = False, + * ): + * if isinstance(greater_than, str): # <<<<<<<<<<<<<< + * greater_than = ord(greater_than) + * self._greater_than = greater_than + */ + } + + /* "w3lib/_util.pyx":27 + * if isinstance(greater_than, str): + * greater_than = ord(greater_than) + * self._greater_than = greater_than # <<<<<<<<<<<<<< + * if exclude: + * code_points = "".join( + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2, __pyx_v_greater_than) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + + /* "w3lib/_util.pyx":28 + * greater_than = ord(greater_than) + * self._greater_than = greater_than + * if exclude: # <<<<<<<<<<<<<< + * code_points = "".join( + * chr(value) + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exclude); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 28, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_util.pyx":31 + * code_points = "".join( + * chr(value) + * for value in range(self._greater_than + 1) # <<<<<<<<<<<<<< + * if chr(value) not in code_points + * ) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_util.pyx":30 + * if exclude: + * code_points = "".join( + * chr(value) # <<<<<<<<<<<<<< + * for value in range(self._greater_than + 1) + * if chr(value) not in code_points + */ + __pyx_t_4 = __pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__init___genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_util.pyx":29 + * self._greater_than = greater_than + * if exclude: + * code_points = "".join( # <<<<<<<<<<<<<< + * chr(value) + * for value in range(self._greater_than + 1) + */ + __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_code_points); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_code_points, ((PyObject*)__pyx_t_4)); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_util.pyx":28 + * greater_than = ord(greater_than) + * self._greater_than = greater_than + * if exclude: # <<<<<<<<<<<<<< + * code_points = "".join( + * chr(value) + */ + } + + /* "w3lib/_util.pyx":34 + * if chr(value) not in code_points + * ) + * self._code_points = code_points # <<<<<<<<<<<<<< + * + * def __contains__(self, code_point: str) -> bool: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2, __pyx_cur_scope->__pyx_v_code_points) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + + /* "w3lib/_util.pyx":18 + * """ + * + * def __init__( # <<<<<<<<<<<<<< + * self, + * code_points: str, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator); + __Pyx_XDECREF(__pyx_v_greater_than); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_util.pyx":36 + * self._code_points = code_points + * + * def __contains__(self, code_point: str) -> bool: # <<<<<<<<<<<<<< + * return code_point in self._code_points or ord(code_point) > self._greater_than + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_3__contains__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_5_util_17_PercentEncodeSet_2__contains__, "_PercentEncodeSet.__contains__(self, unicode code_point: str) -> bool"); +static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_3__contains__ = {"__contains__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_3__contains__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_5_util_17_PercentEncodeSet_2__contains__}; +static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_3__contains__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_code_point = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_code_point,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_code_point)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, 1); __PYX_ERR(0, 36, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__contains__") < 0)) __PYX_ERR(0, 36, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_code_point = ((PyObject*)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 36, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code_point), (&PyUnicode_Type), 0, "code_point", 1))) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(__pyx_self, __pyx_v_self, __pyx_v_code_point); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_point) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + long __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__contains__", 1); + + /* "w3lib/_util.pyx":37 + * + * def __contains__(self, code_point: str) -> bool: + * return code_point in self._code_points or ord(code_point) > self._greater_than # <<<<<<<<<<<<<< + * + * def __add__(self, code_points: str) -> "_PercentEncodeSet": + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_code_point, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyObject_Ord(__pyx_v_code_point); if (unlikely(__pyx_t_4 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_1 = __pyx_t_6; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_util.pyx":36 + * self._code_points = code_points + * + * def __contains__(self, code_point: str) -> bool: # <<<<<<<<<<<<<< + * return code_point in self._code_points or ord(code_point) > self._greater_than + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_util.pyx":39 + * return code_point in self._code_points or ord(code_point) > self._greater_than + * + * def __add__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * return _PercentEncodeSet( + * self._code_points + code_points, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_5__add__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_5_util_17_PercentEncodeSet_4__add__, "_PercentEncodeSet.__add__(self, unicode code_points: str) -> '_PercentEncodeSet'"); +static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_5__add__ = {"__add__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_5__add__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_5_util_17_PercentEncodeSet_4__add__}; +static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_5__add__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_code_points = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_code_points,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_code_points)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, 1); __PYX_ERR(0, 39, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__add__") < 0)) __PYX_ERR(0, 39, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_code_points = ((PyObject*)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 39, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code_points), (&PyUnicode_Type), 0, "code_points", 1))) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(__pyx_self, __pyx_v_self, __pyx_v_code_points); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_points) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__add__", 1); + + /* "w3lib/_util.pyx":40 + * + * def __add__(self, code_points: str) -> "_PercentEncodeSet": + * return _PercentEncodeSet( # <<<<<<<<<<<<<< + * self._code_points + code_points, + * greater_than=self._greater_than, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "w3lib/_util.pyx":41 + * def __add__(self, code_points: str) -> "_PercentEncodeSet": + * return _PercentEncodeSet( + * self._code_points + code_points, # <<<<<<<<<<<<<< + * greater_than=self._greater_than, + * ) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_code_points); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_util.pyx":40 + * + * def __add__(self, code_points: str) -> "_PercentEncodeSet": + * return _PercentEncodeSet( # <<<<<<<<<<<<<< + * self._code_points + code_points, + * greater_than=self._greater_than, + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error); + __pyx_t_3 = 0; + + /* "w3lib/_util.pyx":42 + * return _PercentEncodeSet( + * self._code_points + code_points, + * greater_than=self._greater_than, # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_greater_than, __pyx_t_4) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_util.pyx":40 + * + * def __add__(self, code_points: str) -> "_PercentEncodeSet": + * return _PercentEncodeSet( # <<<<<<<<<<<<<< + * self._code_points + code_points, + * greater_than=self._greater_than, + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "w3lib/_util.pyx":39 + * return code_point in self._code_points or ord(code_point) > self._greater_than + * + * def __add__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * return _PercentEncodeSet( + * self._code_points + code_points, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_util.pyx":45 + * ) + * + * def __sub__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * new_code_points = self._code_points + * for code_point in code_points: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_7__sub__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_5_util_17_PercentEncodeSet_6__sub__, "_PercentEncodeSet.__sub__(self, unicode code_points: str) -> '_PercentEncodeSet'"); +static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_7__sub__ = {"__sub__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_7__sub__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_5_util_17_PercentEncodeSet_6__sub__}; +static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_7__sub__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_code_points = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_code_points,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_code_points)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__sub__", 1, 2, 2, 1); __PYX_ERR(0, 45, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__sub__") < 0)) __PYX_ERR(0, 45, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_code_points = ((PyObject*)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__sub__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 45, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code_points), (&PyUnicode_Type), 0, "code_points", 1))) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(__pyx_self, __pyx_v_self, __pyx_v_code_points); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_points) { + PyObject *__pyx_v_new_code_points = NULL; + Py_UCS4 __pyx_v_code_point; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + void *__pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__sub__", 1); + + /* "w3lib/_util.pyx":46 + * + * def __sub__(self, code_points: str) -> "_PercentEncodeSet": + * new_code_points = self._code_points # <<<<<<<<<<<<<< + * for code_point in code_points: + * new_code_points = new_code_points.replace(code_point, "") + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_new_code_points = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_util.pyx":47 + * def __sub__(self, code_points: str) -> "_PercentEncodeSet": + * new_code_points = self._code_points + * for code_point in code_points: # <<<<<<<<<<<<<< + * new_code_points = new_code_points.replace(code_point, "") + * return _PercentEncodeSet( + */ + __Pyx_INCREF(__pyx_v_code_points); + __pyx_t_2 = __pyx_v_code_points; + __pyx_t_7 = __Pyx_init_unicode_iteration(__pyx_t_2, (&__pyx_t_4), (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 47, __pyx_L1_error) + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_4; __pyx_t_8++) { + __pyx_t_3 = __pyx_t_8; + __pyx_v_code_point = __Pyx_PyUnicode_READ(__pyx_t_6, __pyx_t_5, __pyx_t_3); + + /* "w3lib/_util.pyx":48 + * new_code_points = self._code_points + * for code_point in code_points: + * new_code_points = new_code_points.replace(code_point, "") # <<<<<<<<<<<<<< + * return _PercentEncodeSet( + * new_code_points, + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_code_points, __pyx_n_s_replace); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_10, __pyx_kp_u__2}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF_SET(__pyx_v_new_code_points, __pyx_t_1); + __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_util.pyx":49 + * for code_point in code_points: + * new_code_points = new_code_points.replace(code_point, "") + * return _PercentEncodeSet( # <<<<<<<<<<<<<< + * new_code_points, + * greater_than=self._greater_than, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "w3lib/_util.pyx":50 + * new_code_points = new_code_points.replace(code_point, "") + * return _PercentEncodeSet( + * new_code_points, # <<<<<<<<<<<<<< + * greater_than=self._greater_than, + * ) + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_new_code_points); + __Pyx_GIVEREF(__pyx_v_new_code_points); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_new_code_points)) __PYX_ERR(0, 49, __pyx_L1_error); + + /* "w3lib/_util.pyx":51 + * return _PercentEncodeSet( + * new_code_points, + * greater_than=self._greater_than, # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_greater_than, __pyx_t_11) < 0) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "w3lib/_util.pyx":49 + * for code_point in code_points: + * new_code_points = new_code_points.replace(code_point, "") + * return _PercentEncodeSet( # <<<<<<<<<<<<<< + * new_code_points, + * greater_than=self._greater_than, + */ + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "w3lib/_util.pyx":45 + * ) + * + * def __sub__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * new_code_points = self._code_points + * for code_point in code_points: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_new_code_points); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_util.pyx":54 + * ) + * + * def __or__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * greater_than = min(self._greater_than, other._greater_than) + * code_points = "".join(set(self._code_points) | set(other._code_points)) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_9__or__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_5_util_17_PercentEncodeSet_8__or__, "_PercentEncodeSet.__or__(self, other: '_PercentEncodeSet') -> '_PercentEncodeSet'"); +static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_9__or__ = {"__or__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_9__or__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_5_util_17_PercentEncodeSet_8__or__}; +static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_9__or__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__or__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__or__", 1, 2, 2, 1); __PYX_ERR(0, 54, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__or__") < 0)) __PYX_ERR(0, 54, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other = values[1]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__or__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 54, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(__pyx_self, __pyx_v_self, __pyx_v_other); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_v_greater_than = NULL; + PyObject *__pyx_v_code_points = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__or__", 1); + + /* "w3lib/_util.pyx":55 + * + * def __or__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": + * greater_than = min(self._greater_than, other._greater_than) # <<<<<<<<<<<<<< + * code_points = "".join(set(self._code_points) | set(other._code_points)) + * return _PercentEncodeSet( + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_t_2; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_t_3; + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_greater_than = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_util.pyx":56 + * def __or__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": + * greater_than = min(self._greater_than, other._greater_than) + * code_points = "".join(set(self._code_points) | set(other._code_points)) # <<<<<<<<<<<<<< + * return _PercentEncodeSet( + * code_points, + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Or(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_code_points = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_util.pyx":57 + * greater_than = min(self._greater_than, other._greater_than) + * code_points = "".join(set(self._code_points) | set(other._code_points)) + * return _PercentEncodeSet( # <<<<<<<<<<<<<< + * code_points, + * greater_than=greater_than, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_util.pyx":58 + * code_points = "".join(set(self._code_points) | set(other._code_points)) + * return _PercentEncodeSet( + * code_points, # <<<<<<<<<<<<<< + * greater_than=greater_than, + * ) + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_code_points); + __Pyx_GIVEREF(__pyx_v_code_points); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_code_points)) __PYX_ERR(0, 57, __pyx_L1_error); + + /* "w3lib/_util.pyx":59 + * return _PercentEncodeSet( + * code_points, + * greater_than=greater_than, # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_greater_than, __pyx_v_greater_than) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + + /* "w3lib/_util.pyx":57 + * greater_than = min(self._greater_than, other._greater_than) + * code_points = "".join(set(self._code_points) | set(other._code_points)) + * return _PercentEncodeSet( # <<<<<<<<<<<<<< + * code_points, + * greater_than=greater_than, + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "w3lib/_util.pyx":54 + * ) + * + * def __or__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * greater_than = min(self._greater_than, other._greater_than) + * code_points = "".join(set(self._code_points) | set(other._code_points)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_greater_than); + __Pyx_XDECREF(__pyx_v_code_points); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_util.pyx":62 + * ) + * + * def __and__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * greater_than = max(self._greater_than, other._greater_than) + * code_points = "".join(set(self._code_points) & set(other._code_points)) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_11__and__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_5_util_17_PercentEncodeSet_10__and__, "_PercentEncodeSet.__and__(self, other: '_PercentEncodeSet') -> '_PercentEncodeSet'"); +static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_11__and__ = {"__and__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_11__and__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_5_util_17_PercentEncodeSet_10__and__}; +static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_11__and__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__and__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__and__", 1, 2, 2, 1); __PYX_ERR(0, 62, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__and__") < 0)) __PYX_ERR(0, 62, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other = values[1]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__and__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 62, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(__pyx_self, __pyx_v_self, __pyx_v_other); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_v_greater_than = NULL; + PyObject *__pyx_v_code_points = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__and__", 1); + + /* "w3lib/_util.pyx":63 + * + * def __and__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": + * greater_than = max(self._greater_than, other._greater_than) # <<<<<<<<<<<<<< + * code_points = "".join(set(self._code_points) & set(other._code_points)) + * return _PercentEncodeSet( + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_t_2; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_t_3; + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_greater_than = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_util.pyx":64 + * def __and__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": + * greater_than = max(self._greater_than, other._greater_than) + * code_points = "".join(set(self._code_points) & set(other._code_points)) # <<<<<<<<<<<<<< + * return _PercentEncodeSet( + * code_points, + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_And(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_code_points = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_util.pyx":65 + * greater_than = max(self._greater_than, other._greater_than) + * code_points = "".join(set(self._code_points) & set(other._code_points)) + * return _PercentEncodeSet( # <<<<<<<<<<<<<< + * code_points, + * greater_than=greater_than, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_util.pyx":66 + * code_points = "".join(set(self._code_points) & set(other._code_points)) + * return _PercentEncodeSet( + * code_points, # <<<<<<<<<<<<<< + * greater_than=greater_than, + * ) + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_code_points); + __Pyx_GIVEREF(__pyx_v_code_points); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_code_points)) __PYX_ERR(0, 65, __pyx_L1_error); + + /* "w3lib/_util.pyx":67 + * return _PercentEncodeSet( + * code_points, + * greater_than=greater_than, # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_greater_than, __pyx_v_greater_than) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + + /* "w3lib/_util.pyx":65 + * greater_than = max(self._greater_than, other._greater_than) + * code_points = "".join(set(self._code_points) & set(other._code_points)) + * return _PercentEncodeSet( # <<<<<<<<<<<<<< + * code_points, + * greater_than=greater_than, + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "w3lib/_util.pyx":62 + * ) + * + * def __and__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * greater_than = max(self._greater_than, other._greater_than) + * code_points = "".join(set(self._code_points) & set(other._code_points)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_greater_than); + __Pyx_XDECREF(__pyx_v_code_points); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_util.pyx":70 + * ) + * + * def __repr__(self) -> str: # <<<<<<<<<<<<<< + * cp = "".join(sorted(tuple(self._code_points), key=ord)) + * gt = chr(self._greater_than) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_13__repr__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_5_util_17_PercentEncodeSet_12__repr__, "_PercentEncodeSet.__repr__(self) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_13__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_13__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_5_util_17_PercentEncodeSet_12__repr__}; +static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_13__repr__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 70, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 70, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(__pyx_self, __pyx_v_self); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_cp = NULL; + PyObject *__pyx_v_gt = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_UCS4 __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 1); + + /* "w3lib/_util.pyx":71 + * + * def __repr__(self) -> str: + * cp = "".join(sorted(tuple(self._code_points), key=ord)) # <<<<<<<<<<<<<< + * gt = chr(self._greater_than) + * return f"_PercentEncodeSet({cp!r}, greater_than={gt!r})" + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetBuiltinName(__pyx_n_s_ord); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_cp = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_util.pyx":72 + * def __repr__(self) -> str: + * cp = "".join(sorted(tuple(self._code_points), key=ord)) + * gt = chr(self._greater_than) # <<<<<<<<<<<<<< + * return f"_PercentEncodeSet({cp!r}, greater_than={gt!r})" + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_gt = __pyx_t_3; + __pyx_t_3 = 0; + + /* "w3lib/_util.pyx":73 + * cp = "".join(sorted(tuple(self._code_points), key=ord)) + * gt = chr(self._greater_than) + * return f"_PercentEncodeSet({cp!r}, greater_than={gt!r})" # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = 127; + __Pyx_INCREF(__pyx_kp_u_PercentEncodeSet_2); + __pyx_t_4 += 18; + __Pyx_GIVEREF(__pyx_kp_u_PercentEncodeSet_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_PercentEncodeSet_2); + __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_cp), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_5; + __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_kp_u_greater_than_3); + __pyx_t_4 += 15; + __Pyx_GIVEREF(__pyx_kp_u_greater_than_3); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_greater_than_3); + __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_gt), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_5; + __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_kp_u__3); + __pyx_t_4 += 1; + __Pyx_GIVEREF(__pyx_kp_u__3); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__3); + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "w3lib/_util.pyx":70 + * ) + * + * def __repr__(self) -> str: # <<<<<<<<<<<<<< + * cp = "".join(sorted(tuple(self._code_points), key=ord)) + * gt = chr(self._greater_than) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cp); + __Pyx_XDECREF(__pyx_v_gt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ *__pyx_freelist_5w3lib_5_util___pyx_scope_struct____init__[8]; +static int __pyx_freecount_5w3lib_5_util___pyx_scope_struct____init__ = 0; + +static PyObject *__pyx_tp_new_5w3lib_5_util___pyx_scope_struct____init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + #if CYTHON_COMPILING_IN_CPYTHON + if (likely((int)(__pyx_freecount_5w3lib_5_util___pyx_scope_struct____init__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__)))) { + o = (PyObject*)__pyx_freelist_5w3lib_5_util___pyx_scope_struct____init__[--__pyx_freecount_5w3lib_5_util___pyx_scope_struct____init__]; + memset(o, 0, sizeof(struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__)); + (void) PyObject_INIT(o, t); + } else + #endif + { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc_5w3lib_5_util___pyx_scope_struct____init__(PyObject *o) { + struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ *p = (struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5w3lib_5_util___pyx_scope_struct____init__) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + Py_CLEAR(p->__pyx_v_code_points); + #if CYTHON_COMPILING_IN_CPYTHON + if (((int)(__pyx_freecount_5w3lib_5_util___pyx_scope_struct____init__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__)))) { + __pyx_freelist_5w3lib_5_util___pyx_scope_struct____init__[__pyx_freecount_5w3lib_5_util___pyx_scope_struct____init__++] = ((struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ *)o); + } else + #endif + { + #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + (*Py_TYPE(o)->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + if (tp_free) tp_free(o); + } + #endif + } +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_5w3lib_5_util___pyx_scope_struct____init___slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5w3lib_5_util___pyx_scope_struct____init__}, + {Py_tp_new, (void *)__pyx_tp_new_5w3lib_5_util___pyx_scope_struct____init__}, + {0, 0}, +}; +static PyType_Spec __pyx_type_5w3lib_5_util___pyx_scope_struct____init___spec = { + "w3lib._util.__pyx_scope_struct____init__", + sizeof(struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_5w3lib_5_util___pyx_scope_struct____init___slots, +}; +#else + +static PyTypeObject __pyx_type_5w3lib_5_util___pyx_scope_struct____init__ = { + PyVarObject_HEAD_INIT(0, 0) + "w3lib._util.""__pyx_scope_struct____init__", /*tp_name*/ + sizeof(struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_5w3lib_5_util___pyx_scope_struct____init__, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_5w3lib_5_util___pyx_scope_struct____init__, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *__pyx_freelist_5w3lib_5_util___pyx_scope_struct_1_genexpr[8]; +static int __pyx_freecount_5w3lib_5_util___pyx_scope_struct_1_genexpr = 0; + +static PyObject *__pyx_tp_new_5w3lib_5_util___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + #if CYTHON_COMPILING_IN_CPYTHON + if (likely((int)(__pyx_freecount_5w3lib_5_util___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr)))) { + o = (PyObject*)__pyx_freelist_5w3lib_5_util___pyx_scope_struct_1_genexpr[--__pyx_freecount_5w3lib_5_util___pyx_scope_struct_1_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else + #endif + { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc_5w3lib_5_util___pyx_scope_struct_1_genexpr(PyObject *o) { + struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5w3lib_5_util___pyx_scope_struct_1_genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_value); + #if CYTHON_COMPILING_IN_CPYTHON + if (((int)(__pyx_freecount_5w3lib_5_util___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr)))) { + __pyx_freelist_5w3lib_5_util___pyx_scope_struct_1_genexpr[__pyx_freecount_5w3lib_5_util___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *)o); + } else + #endif + { + #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + (*Py_TYPE(o)->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + if (tp_free) tp_free(o); + } + #endif + } +} + +static int __pyx_tp_traverse_5w3lib_5_util___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + } + if (p->__pyx_v_value) { + e = (*v)(p->__pyx_v_value, a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5w3lib_5_util___pyx_scope_struct_1_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_5w3lib_5_util___pyx_scope_struct_1_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_5w3lib_5_util___pyx_scope_struct_1_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr_spec = { + "w3lib._util.__pyx_scope_struct_1_genexpr", + sizeof(struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "w3lib._util.""__pyx_scope_struct_1_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_5w3lib_5_util___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_5w3lib_5_util___pyx_scope_struct_1_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_5w3lib_5_util___pyx_scope_struct_1_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, + {&__pyx_n_s_PercentEncodeSet, __pyx_k_PercentEncodeSet, sizeof(__pyx_k_PercentEncodeSet), 0, 0, 1, 1}, + {&__pyx_kp_u_PercentEncodeSet_2, __pyx_k_PercentEncodeSet_2, sizeof(__pyx_k_PercentEncodeSet_2), 0, 1, 0, 0}, + {&__pyx_kp_s_PercentEncodeSet_3, __pyx_k_PercentEncodeSet_3, sizeof(__pyx_k_PercentEncodeSet_3), 0, 0, 1, 0}, + {&__pyx_n_s_PercentEncodeSet___add, __pyx_k_PercentEncodeSet___add, sizeof(__pyx_k_PercentEncodeSet___add), 0, 0, 1, 1}, + {&__pyx_n_s_PercentEncodeSet___and, __pyx_k_PercentEncodeSet___and, sizeof(__pyx_k_PercentEncodeSet___and), 0, 0, 1, 1}, + {&__pyx_n_s_PercentEncodeSet___contains, __pyx_k_PercentEncodeSet___contains, sizeof(__pyx_k_PercentEncodeSet___contains), 0, 0, 1, 1}, + {&__pyx_n_s_PercentEncodeSet___init, __pyx_k_PercentEncodeSet___init, sizeof(__pyx_k_PercentEncodeSet___init), 0, 0, 1, 1}, + {&__pyx_n_s_PercentEncodeSet___init___local, __pyx_k_PercentEncodeSet___init___local, sizeof(__pyx_k_PercentEncodeSet___init___local), 0, 0, 1, 1}, + {&__pyx_n_s_PercentEncodeSet___or, __pyx_k_PercentEncodeSet___or, sizeof(__pyx_k_PercentEncodeSet___or), 0, 0, 1, 1}, + {&__pyx_n_s_PercentEncodeSet___repr, __pyx_k_PercentEncodeSet___repr, sizeof(__pyx_k_PercentEncodeSet___repr), 0, 0, 1, 1}, + {&__pyx_n_s_PercentEncodeSet___sub, __pyx_k_PercentEncodeSet___sub, sizeof(__pyx_k_PercentEncodeSet___sub), 0, 0, 1, 1}, + {&__pyx_kp_s_Set_of_code_points_that_require, __pyx_k_Set_of_code_points_that_require, sizeof(__pyx_k_Set_of_code_points_that_require), 0, 0, 1, 0}, + {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, + {&__pyx_kp_s_Union_int_str, __pyx_k_Union_int_str, sizeof(__pyx_k_Union_int_str), 0, 0, 1, 0}, + {&__pyx_n_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 1}, + {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, + {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, + {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, + {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, + {&__pyx_n_s_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, + {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_code_point, __pyx_k_code_point, sizeof(__pyx_k_code_point), 0, 0, 1, 1}, + {&__pyx_n_s_code_points, __pyx_k_code_points, sizeof(__pyx_k_code_points), 0, 0, 1, 1}, + {&__pyx_n_s_code_points_2, __pyx_k_code_points_2, sizeof(__pyx_k_code_points_2), 0, 0, 1, 1}, + {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1}, + {&__pyx_n_s_cp, __pyx_k_cp, sizeof(__pyx_k_cp), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, + {&__pyx_n_s_exclude, __pyx_k_exclude, sizeof(__pyx_k_exclude), 0, 0, 1, 1}, + {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, + {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_greater_than, __pyx_k_greater_than, sizeof(__pyx_k_greater_than), 0, 0, 1, 1}, + {&__pyx_n_s_greater_than_2, __pyx_k_greater_than_2, sizeof(__pyx_k_greater_than_2), 0, 0, 1, 1}, + {&__pyx_kp_u_greater_than_3, __pyx_k_greater_than_3, sizeof(__pyx_k_greater_than_3), 0, 1, 0, 0}, + {&__pyx_n_s_gt, __pyx_k_gt, sizeof(__pyx_k_gt), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, + {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, + {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_new_code_points, __pyx_k_new_code_points, sizeof(__pyx_k_new_code_points), 0, 0, 1, 1}, + {&__pyx_n_s_or, __pyx_k_or, sizeof(__pyx_k_or), 0, 0, 1, 1}, + {&__pyx_n_s_ord, __pyx_k_ord, sizeof(__pyx_k_ord), 0, 0, 1, 1}, + {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, + {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, + {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, + {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, + {&__pyx_n_s_w3lib__util, __pyx_k_w3lib__util, sizeof(__pyx_k_w3lib__util), 0, 0, 1, 1}, + {&__pyx_kp_s_w3lib__util_pyx, __pyx_k_w3lib__util_pyx, sizeof(__pyx_k_w3lib__util_pyx), 0, 0, 1, 0}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 71, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "w3lib/_util.pyx":18 + * """ + * + * def __init__( # <<<<<<<<<<<<<< + * self, + * code_points: str, + */ + __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_code_points, __pyx_n_s_greater_than, __pyx_n_s_exclude, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_init, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 18, __pyx_L1_error) + + /* "w3lib/_util.pyx":36 + * self._code_points = code_points + * + * def __contains__(self, code_point: str) -> bool: # <<<<<<<<<<<<<< + * return code_point in self._code_points or ord(code_point) > self._greater_than + * + */ + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_contains, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 36, __pyx_L1_error) + + /* "w3lib/_util.pyx":39 + * return code_point in self._code_points or ord(code_point) > self._greater_than + * + * def __add__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * return _PercentEncodeSet( + * self._code_points + code_points, + */ + __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_code_points); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_add, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 39, __pyx_L1_error) + + /* "w3lib/_util.pyx":45 + * ) + * + * def __sub__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * new_code_points = self._code_points + * for code_point in code_points: + */ + __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_code_points, __pyx_n_s_new_code_points, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_sub, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 45, __pyx_L1_error) + + /* "w3lib/_util.pyx":54 + * ) + * + * def __or__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * greater_than = min(self._greater_than, other._greater_than) + * code_points = "".join(set(self._code_points) | set(other._code_points)) + */ + __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_greater_than, __pyx_n_s_code_points); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_or, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 54, __pyx_L1_error) + + /* "w3lib/_util.pyx":62 + * ) + * + * def __and__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * greater_than = max(self._greater_than, other._greater_than) + * code_points = "".join(set(self._code_points) & set(other._code_points)) + */ + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_and, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 62, __pyx_L1_error) + + /* "w3lib/_util.pyx":70 + * ) + * + * def __repr__(self) -> str: # <<<<<<<<<<<<<< + * cp = "".join(sorted(tuple(self._code_points), key=ord)) + * gt = chr(self._greater_than) + */ + __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_cp, __pyx_n_s_gt); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_repr, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + return 0; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_5_util___pyx_scope_struct____init___spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__)) __PYX_ERR(0, 18, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_5_util___pyx_scope_struct____init___spec, __pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + #else + __pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__ = &__pyx_type_5w3lib_5_util___pyx_scope_struct____init__; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__->tp_dictoffset && __pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 30, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + #else + __pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr = &__pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__util(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__util}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "_util", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_util(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_util(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__util(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__util(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__util(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_util' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_util", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_util" pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__util(void)", 0); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_w3lib___util) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "w3lib._util")) { + if (unlikely((PyDict_SetItemString(modules, "w3lib._util", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "w3lib/_util.pyx":1 + * from typing import Union # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_Union); + __Pyx_GIVEREF(__pyx_n_s_Union); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Union)) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_util.pyx":4 + * + * + * class _PercentEncodeSet: # <<<<<<<<<<<<<< + * """Set of code points that require percent-encoding. + * + */ + __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_PercentEncodeSet, __pyx_n_s_PercentEncodeSet, (PyObject *) NULL, __pyx_n_s_w3lib__util, __pyx_kp_s_Set_of_code_points_that_require); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_util.pyx":18 + * """ + * + * def __init__( # <<<<<<<<<<<<<< + * self, + * code_points: str, + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_greater_than, ((PyObject*)__pyx_kp_u_)) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_exclude, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_greater_than, __pyx_kp_s_Union_int_str) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_exclude, __pyx_n_s_bool) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_1__init__, 0, __pyx_n_s_PercentEncodeSet___init, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_5, __pyx_t_2); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_util.pyx":36 + * self._code_points = code_points + * + * def __contains__(self, code_point: str) -> bool: # <<<<<<<<<<<<<< + * return code_point in self._code_points or ord(code_point) > self._greater_than + * + */ + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_code_point, __pyx_n_s_str) < 0) __PYX_ERR(0, 36, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_3__contains__, 0, __pyx_n_s_PercentEncodeSet___contains, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_contains, __pyx_t_4) < 0) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_util.pyx":39 + * return code_point in self._code_points or ord(code_point) > self._greater_than + * + * def __add__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * return _PercentEncodeSet( + * self._code_points + code_points, + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_5__add__, 0, __pyx_n_s_PercentEncodeSet___add, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_add, __pyx_t_5) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_util.pyx":45 + * ) + * + * def __sub__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * new_code_points = self._code_points + * for code_point in code_points: + */ + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_7__sub__, 0, __pyx_n_s_PercentEncodeSet___sub, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_sub, __pyx_t_4) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_util.pyx":54 + * ) + * + * def __or__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * greater_than = min(self._greater_than, other._greater_than) + * code_points = "".join(set(self._code_points) | set(other._code_points)) + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_other, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_9__or__, 0, __pyx_n_s_PercentEncodeSet___or, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_or, __pyx_t_5) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_util.pyx":62 + * ) + * + * def __and__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< + * greater_than = max(self._greater_than, other._greater_than) + * code_points = "".join(set(self._code_points) & set(other._code_points)) + */ + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_other, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_11__and__, 0, __pyx_n_s_PercentEncodeSet___and, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_and, __pyx_t_4) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_util.pyx":70 + * ) + * + * def __repr__(self) -> str: # <<<<<<<<<<<<<< + * cp = "".join(sorted(tuple(self._code_points), key=ord)) + * gt = chr(self._greater_than) + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_13__repr__, 0, __pyx_n_s_PercentEncodeSet___repr, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_repr, __pyx_t_5) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_util.pyx":4 + * + * + * class _PercentEncodeSet: # <<<<<<<<<<<<<< + * """Set of code points that require percent-encoding. + * + */ + __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_PercentEncodeSet, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PercentEncodeSet, __pyx_t_5) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_util.pyx":1 + * from typing import Union # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init w3lib._util", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init w3lib._util"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +#endif +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* TupleAndListFromArray */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + Py_INCREF(__pyx_empty_tuple); + return __pyx_empty_tuple; + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} +static CYTHON_INLINE PyObject * +__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return PyList_New(0); + } + res = PyList_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); + return res; +} +#endif + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* fastcall */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) +{ + Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + for (i = 0; i < n; i++) + { + if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + } + for (i = 0; i < n; i++) + { + int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + if (unlikely(eq != 0)) { + if (unlikely(eq < 0)) return NULL; + return kwvalues[i]; + } + } + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { + Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + PyObject *dict; + dict = PyDict_New(); + if (unlikely(!dict)) + return NULL; + for (i=0; i= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); + while (1) { + Py_XDECREF(key); key = NULL; + Py_XDECREF(value); value = NULL; + if (kwds_is_tuple) { + Py_ssize_t size; +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(kwds); +#else + size = PyTuple_Size(kwds); + if (size < 0) goto bad; +#endif + if (pos >= size) break; +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); + if (!key) goto bad; +#elif CYTHON_ASSUME_SAFE_MACROS + key = PyTuple_GET_ITEM(kwds, pos); +#else + key = PyTuple_GetItem(kwds, pos); + if (!key) goto bad; +#endif + value = kwvalues[pos]; + pos++; + } + else + { + if (!PyDict_Next(kwds, &pos, &key, &value)) break; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + } + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(value); + Py_DECREF(key); +#endif + key = NULL; + value = NULL; + continue; + } +#if !CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + Py_INCREF(value); + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = ( + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key) + ); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + Py_XDECREF(key); + Py_XDECREF(value); + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + #if PY_MAJOR_VERSION < 3 + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + Py_XDECREF(key); + Py_XDECREF(value); + return -1; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + type_name = __Pyx_PyType_GetName(type); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* RaiseUnboundLocalError */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { + return NULL; + } + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { + return NULL; + } + #endif + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectFastCall */ +#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result = 0; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: + Py_DECREF(argstuple); + return result; +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); + } + else if (nargs == 1 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); + } +#endif + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); + } + } + #if PY_VERSION_HEX >= 0x030700A1 + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + if (kwargs == NULL) { + #if CYTHON_VECTORCALL + #if PY_VERSION_HEX < 0x03090000 + vectorcallfunc f = _PyVectorcall_Function(func); + #else + vectorcallfunc f = PyVectorcall_Function(func); + #endif + if (f) { + return f(func, args, (size_t)nargs, NULL); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, NULL); + } + #endif + } + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + } + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif +} + +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* RaiseClosureNameError */ +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { + PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); +} + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type = NULL, *local_value, *local_tb = NULL; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030C00A6 + local_value = tstate->current_exception; + tstate->current_exception = 0; + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } + #else + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + #endif +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 + if (unlikely(tstate->current_exception)) +#elif CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + #if PY_VERSION_HEX >= 0x030B00a4 + tmp_value = exc_info->exc_value; + exc_info->exc_value = local_value; + tmp_type = NULL; + tmp_tb = NULL; + Py_XDECREF(local_type); + Py_XDECREF(local_tb); + #else + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + #endif + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* pep479 */ +static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { + PyObject *exc, *val, *tb, *cur_exc; + __Pyx_PyThreadState_declare + #ifdef __Pyx_StopAsyncIteration_USED + int is_async_stopiteration = 0; + #endif + CYTHON_MAYBE_UNUSED_VAR(in_async_gen); + cur_exc = PyErr_Occurred(); + if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { + #ifdef __Pyx_StopAsyncIteration_USED + if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { + is_async_stopiteration = 1; + } else + #endif + return; + } + __Pyx_PyThreadState_assign + __Pyx_GetException(&exc, &val, &tb); + Py_XDECREF(exc); + Py_XDECREF(val); + Py_XDECREF(tb); + PyErr_SetString(PyExc_RuntimeError, + #ifdef __Pyx_StopAsyncIteration_USED + is_async_stopiteration ? "async generator raised StopAsyncIteration" : + in_async_gen ? "async generator raised StopIteration" : + #endif + "generator raised StopIteration"); +} + +/* UnicodeAsUCS4 */ +static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { + Py_ssize_t length; + #if CYTHON_PEP393_ENABLED + length = PyUnicode_GET_LENGTH(x); + if (likely(length == 1)) { + return PyUnicode_READ_CHAR(x, 0); + } + #else + length = PyUnicode_GET_SIZE(x); + if (likely(length == 1)) { + return PyUnicode_AS_UNICODE(x)[0]; + } + #if Py_UNICODE_SIZE == 2 + else if (PyUnicode_GET_SIZE(x) == 2) { + Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0]; + if (high_val >= 0xD800 && high_val <= 0xDBFF) { + Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1]; + if (low_val >= 0xDC00 && low_val <= 0xDFFF) { + return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1))); + } + } + } + #endif + #endif + PyErr_Format(PyExc_ValueError, + "only single character unicode strings can be converted to Py_UCS4, " + "got length %" CYTHON_FORMAT_SSIZE_T "d", length); + return (Py_UCS4)-1; +} + +/* object_ord */ +static long __Pyx__PyObject_Ord(PyObject* c) { + Py_ssize_t size; + if (PyBytes_Check(c)) { + size = PyBytes_GET_SIZE(c); + if (likely(size == 1)) { + return (unsigned char) PyBytes_AS_STRING(c)[0]; + } +#if PY_MAJOR_VERSION < 3 + } else if (PyUnicode_Check(c)) { + return (long)__Pyx_PyUnicode_AsPy_UCS4(c); +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + } else if (PyByteArray_Check(c)) { + size = PyByteArray_GET_SIZE(c); + if (likely(size == 1)) { + return (unsigned char) PyByteArray_AS_STRING(c)[0]; + } +#endif + } else { + __Pyx_TypeName c_type_name = __Pyx_PyType_GetName(Py_TYPE(c)); + PyErr_Format(PyExc_TypeError, + "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found", + c_type_name); + __Pyx_DECREF_TypeName(c_type_name); + return (long)(Py_UCS4)-1; + } + PyErr_Format(PyExc_TypeError, + "ord() expected a character, but string of length %zd found", size); + return (long)(Py_UCS4)-1; +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* PyIntBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_MAYBE_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + + x = (long)((unsigned long)a + (unsigned long)b); + if (likely((x^a) >= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + return __Pyx_NewRef(op2); + } + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } else { + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + double result; + + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* unicode_iter */ +static CYTHON_INLINE int __Pyx_init_unicode_iteration( + PyObject* ustring, Py_ssize_t *length, void** data, int *kind) { +#if CYTHON_COMPILING_IN_LIMITED_API + *kind = 0; + *length = PyUnicode_GetLength(ustring); + *data = (void*)ustring; +#elif CYTHON_PEP393_ENABLED + if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return -1; + *kind = PyUnicode_KIND(ustring); + *length = PyUnicode_GET_LENGTH(ustring); + *data = PyUnicode_DATA(ustring); +#else + *kind = 0; + *length = PyUnicode_GET_SIZE(ustring); + *data = (void*)PyUnicode_AS_UNICODE(ustring); +#endif + return 0; +} + +/* PyObjectFormatAndDecref */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { + if (unlikely(!s)) return NULL; + if (likely(PyUnicode_CheckExact(s))) return s; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(s))) { + PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); + Py_DECREF(s); + return result; + } + #endif + return __Pyx_PyObject_FormatAndDecref(s, f); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { + PyObject *result; + if (unlikely(!s)) return NULL; + result = PyObject_Format(s, f); + Py_DECREF(s); + return result; +} + +/* JoinPyUnicode */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char) { +#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyObject *result_uval; + int result_ukind, kind_shift; + Py_ssize_t i, char_pos; + void *result_udata; + CYTHON_MAYBE_UNUSED_VAR(max_char); +#if CYTHON_PEP393_ENABLED + result_uval = PyUnicode_New(result_ulength, max_char); + if (unlikely(!result_uval)) return NULL; + result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; + kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; + result_udata = PyUnicode_DATA(result_uval); +#else + result_uval = PyUnicode_FromUnicode(NULL, result_ulength); + if (unlikely(!result_uval)) return NULL; + result_ukind = sizeof(Py_UNICODE); + kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; + result_udata = PyUnicode_AS_UNICODE(result_uval); +#endif + assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + char_pos = 0; + for (i=0; i < value_count; i++) { + int ukind; + Py_ssize_t ulength; + void *udata; + PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); + if (unlikely(__Pyx_PyUnicode_READY(uval))) + goto bad; + ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + if (unlikely(!ulength)) + continue; + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) + goto overflow; + ukind = __Pyx_PyUnicode_KIND(uval); + udata = __Pyx_PyUnicode_DATA(uval); + if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); + } else { + #if PY_VERSION_HEX >= 0x030d0000 + if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; + #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); + #else + Py_ssize_t j; + for (j=0; j < ulength; j++) { + Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); + __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); + } + #endif + } + char_pos += ulength; + } + return result_uval; +overflow: + PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); +bad: + Py_DECREF(result_uval); + return NULL; +#else + CYTHON_UNUSED_VAR(max_char); + CYTHON_UNUSED_VAR(result_ulength); + CYTHON_UNUSED_VAR(value_count); + return PyUnicode_Join(__pyx_empty_unicode, value_tuple); +#endif +} + +/* FixUpExtensionType */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { +#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + CYTHON_UNUSED_VAR(spec); + CYTHON_UNUSED_VAR(type); +#else + const PyType_Slot *slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_members) + slot++; + if (slot && slot->slot == Py_tp_members) { + int changed = 0; +#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) + const +#endif + PyMemberDef *memb = (PyMemberDef*) slot->pfunc; + while (memb && memb->name) { + if (memb->name[0] == '_' && memb->name[1] == '_') { +#if PY_VERSION_HEX < 0x030900b1 + if (strcmp(memb->name, "__weaklistoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_weaklistoffset = memb->offset; + changed = 1; + } + else if (strcmp(memb->name, "__dictoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_dictoffset = memb->offset; + changed = 1; + } +#if CYTHON_METH_FASTCALL + else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); +#if PY_VERSION_HEX >= 0x030800b4 + type->tp_vectorcall_offset = memb->offset; +#else + type->tp_print = (printfunc) memb->offset; +#endif + changed = 1; + } +#endif +#else + if ((0)); +#endif +#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON + else if (strcmp(memb->name, "__module__") == 0) { + PyObject *descr; + assert(memb->type == T_OBJECT); + assert(memb->flags == 0 || memb->flags == READONLY); + descr = PyDescr_NewMember(type, memb); + if (unlikely(!descr)) + return -1; + if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { + Py_DECREF(descr); + return -1; + } + Py_DECREF(descr); + changed = 1; + } +#endif + } + memb++; + } + if (changed) + PyType_Modified(type); + } +#endif + return 0; +} +#endif + +/* PyObjectCallNoArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { + PyObject *arg[2] = {NULL, NULL}; + return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + __Pyx_TypeName type_name; + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR + if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) +#elif PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (likely(descr != NULL)) { + *method = descr; + return 0; + } + type_name = __Pyx_PyType_GetName(tp); + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", + type_name, name); +#else + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", + type_name, PyString_AS_STRING(name)); +#endif + __Pyx_DECREF_TypeName(type_name); + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* ValidateBasesTuple */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { + Py_ssize_t i, n; +#if CYTHON_ASSUME_SAFE_MACROS + n = PyTuple_GET_SIZE(bases); +#else + n = PyTuple_Size(bases); + if (n < 0) return -1; +#endif + for (i = 1; i < n; i++) + { +#if CYTHON_AVOID_BORROWED_REFS + PyObject *b0 = PySequence_GetItem(bases, i); + if (!b0) return -1; +#elif CYTHON_ASSUME_SAFE_MACROS + PyObject *b0 = PyTuple_GET_ITEM(bases, i); +#else + PyObject *b0 = PyTuple_GetItem(bases, i); + if (!b0) return -1; +#endif + PyTypeObject *b; +#if PY_MAJOR_VERSION < 3 + if (PyClass_Check(b0)) + { + PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", + PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } +#endif + b = (PyTypeObject*) b0; + if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); + __Pyx_DECREF_TypeName(b_name); +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } + if (dictoffset == 0) + { + Py_ssize_t b_dictoffset = 0; +#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + b_dictoffset = b->tp_dictoffset; +#else + PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); + if (!py_b_dictoffset) goto dictoffset_return; + b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); + Py_DECREF(py_b_dictoffset); + if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; +#endif + if (b_dictoffset) { + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "extension type '%.200s' has no __dict__ slot, " + "but base type '" __Pyx_FMT_TYPENAME "' has: " + "either add 'cdef dict __dict__' to the extension type " + "or add '__slots__ = [...]' to the base type", + type_name, b_name); + __Pyx_DECREF_TypeName(b_name); + } +#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) + dictoffset_return: +#endif +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } + } +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + } + return 0; +} +#endif + +/* PyType_Ready */ +static int __Pyx_PyType_Ready(PyTypeObject *t) { +#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) + (void)__Pyx_PyObject_CallMethod0; +#if CYTHON_USE_TYPE_SPECS + (void)__Pyx_validate_bases_tuple; +#endif + return PyType_Ready(t); +#else + int r; + PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); + if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) + return -1; +#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) + { + int gc_was_enabled; + #if PY_VERSION_HEX >= 0x030A00b1 + gc_was_enabled = PyGC_Disable(); + (void)__Pyx_PyObject_CallMethod0; + #else + PyObject *ret, *py_status; + PyObject *gc = NULL; + #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) + gc = PyImport_GetModule(__pyx_kp_u_gc); + #endif + if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) return -1; + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + if (unlikely(!py_status)) { + Py_DECREF(gc); + return -1; + } + gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); + Py_DECREF(py_status); + if (gc_was_enabled > 0) { + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + if (unlikely(!ret)) { + Py_DECREF(gc); + return -1; + } + Py_DECREF(ret); + } else if (unlikely(gc_was_enabled == -1)) { + Py_DECREF(gc); + return -1; + } + #endif + t->tp_flags |= Py_TPFLAGS_HEAPTYPE; +#if PY_VERSION_HEX >= 0x030A0000 + t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; +#endif +#else + (void)__Pyx_PyObject_CallMethod0; +#endif + r = PyType_Ready(t); +#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) + t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; + #if PY_VERSION_HEX >= 0x030A00b1 + if (gc_was_enabled) + PyGC_Enable(); + #else + if (gc_was_enabled) { + PyObject *tp, *v, *tb; + PyErr_Fetch(&tp, &v, &tb); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + if (likely(ret || r == -1)) { + Py_XDECREF(ret); + PyErr_Restore(tp, v, tb); + } else { + Py_XDECREF(tp); + Py_XDECREF(v); + Py_XDECREF(tb); + r = -1; + } + } + Py_DECREF(gc); + #endif + } +#endif + return r; +#endif +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", + type_name, attr_name); +#else + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", + type_name, PyString_AS_STRING(attr_name)); +#endif + __Pyx_DECREF_TypeName(type_name); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + const char* module_name_str = 0; + PyObject* module_name = 0; + PyObject* module_dot = 0; + PyObject* full_name = 0; + PyErr_Clear(); + module_name_str = PyModule_GetName(module); + if (unlikely(!module_name_str)) { goto modbad; } + module_name = PyUnicode_FromString(module_name_str); + if (unlikely(!module_name)) { goto modbad; } + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__4); + if (unlikely(!module_dot)) { goto modbad; } + full_name = PyUnicode_Concat(module_dot, name); + if (unlikely(!full_name)) { goto modbad; } + #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + { + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + goto modbad; + value = PyObject_GetItem(modules, full_name); + } + #else + value = PyImport_GetModule(full_name); + #endif + modbad: + Py_XDECREF(full_name); + Py_XDECREF(module_dot); + Py_XDECREF(module_name); + } + if (unlikely(!value)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchSharedCythonModule */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); +} + +/* FetchCommonType */ +static int __Pyx_VerifyCachedType(PyObject *cached_type, + const char *name, + Py_ssize_t basicsize, + Py_ssize_t expected_basicsize) { + if (!PyType_Check(cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", name); + return -1; + } + if (basicsize != expected_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + name); + return -1; + } + return 0; +} +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* abi_module; + const char* object_name; + PyTypeObject *cached_type = NULL; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + object_name = strrchr(type->tp_name, '.'); + object_name = object_name ? object_name+1 : type->tp_name; + cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + if (__Pyx_VerifyCachedType( + (PyObject *)cached_type, + object_name, + cached_type->tp_basicsize, + type->tp_basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; +done: + Py_DECREF(abi_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#else +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { + PyObject *abi_module, *cached_type = NULL; + const char* object_name = strrchr(spec->name, '.'); + object_name = object_name ? object_name+1 : spec->name; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + cached_type = PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + Py_ssize_t basicsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; +#else + basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; +#endif + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + basicsize, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + CYTHON_UNUSED_VAR(module); + cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + if (unlikely(!cached_type)) goto bad; + if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; +done: + Py_DECREF(abi_module); + assert(cached_type == NULL || PyType_Check(cached_type)); + return (PyTypeObject *) cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#endif + +/* PyVectorcallFastCallDict */ +#if CYTHON_METH_FASTCALL +static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + PyObject *res = NULL; + PyObject *kwnames; + PyObject **newargs; + PyObject **kwvalues; + Py_ssize_t i, pos; + size_t j; + PyObject *key, *value; + unsigned long keys_are_strings; + Py_ssize_t nkw = PyDict_GET_SIZE(kw); + newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); + if (unlikely(newargs == NULL)) { + PyErr_NoMemory(); + return NULL; + } + for (j = 0; j < nargs; j++) newargs[j] = args[j]; + kwnames = PyTuple_New(nkw); + if (unlikely(kwnames == NULL)) { + PyMem_Free(newargs); + return NULL; + } + kwvalues = newargs + nargs; + pos = i = 0; + keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; + while (PyDict_Next(kw, &pos, &key, &value)) { + keys_are_strings &= Py_TYPE(key)->tp_flags; + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(kwnames, i, key); + kwvalues[i] = value; + i++; + } + if (unlikely(!keys_are_strings)) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + goto cleanup; + } + res = vc(func, newargs, nargs, kwnames); +cleanup: + Py_DECREF(kwnames); + for (i = 0; i < nkw; i++) + Py_DECREF(kwvalues[i]); + PyMem_Free(newargs); + return res; +} +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + return vc(func, args, nargs, NULL); + } + return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); +} +#endif + +/* CythonFunctionShared */ +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if (__Pyx_CyFunction_Check(func)) { + return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; + } else if (PyCFunction_Check(func)) { + return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; + } + return 0; +} +#else +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +} +#endif +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + __Pyx_Py_XDECREF_SET( + __Pyx_CyFunction_GetClassObj(f), + ((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#else + __Pyx_Py_XDECREF_SET( + ((PyCMethodObject *) (f))->mm_class, + (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#endif +} +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +{ + CYTHON_UNUSED_VAR(closure); + if (unlikely(op->func_doc == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); + if (unlikely(!op->func_doc)) return NULL; +#else + if (((PyCFunctionObject*)op)->m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } +#endif + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_doc, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_name == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_name = PyObject_GetAttrString(op->func, "__name__"); +#elif PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_name, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_qualname, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_dict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(op); + CYTHON_UNUSED_VAR(context); + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + CYTHON_UNUSED_VAR(context); + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_tuple; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_kwdict; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value || value == Py_None) { + value = NULL; + } else if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + __Pyx_Py_XDECREF_SET(op->func_annotations, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->func_annotations; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + int is_coroutine; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; +#if PY_VERSION_HEX >= 0x03050000 + if (is_coroutine) { + PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + fromlist = PyList_New(1); + if (unlikely(!fromlist)) return NULL; + Py_INCREF(marker); +#if CYTHON_ASSUME_SAFE_MACROS + PyList_SET_ITEM(fromlist, 0, marker); +#else + if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { + Py_DECREF(marker); + Py_DECREF(fromlist); + return NULL; + } +#endif + module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + if (unlikely(!module)) goto ignore; + op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + Py_DECREF(module); + if (likely(op->func_is_coroutine)) { + return __Pyx_NewRef(op->func_is_coroutine); + } +ignore: + PyErr_Clear(); + } +#endif + op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); + return __Pyx_NewRef(op->func_is_coroutine); +} +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_GetAttrString(op->func, "__module__"); +} +static int +__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_SetAttrString(op->func, "__module__", value); +} +#endif +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, +#endif + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { +#if !CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#endif +#if CYTHON_USE_TYPE_SPECS + {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#if CYTHON_METH_FASTCALL +#if CYTHON_BACKPORT_VECTORCALL + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#else +#if !CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, +#endif +#endif +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#else + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, +#endif +#endif + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) +{ + CYTHON_UNUSED_VAR(args); +#if PY_MAJOR_VERSION >= 3 + Py_INCREF(m->func_qualname); + return m->func_qualname; +#else + return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { +#if !CYTHON_COMPILING_IN_LIMITED_API + PyCFunctionObject *cf = (PyCFunctionObject*) op; +#endif + if (unlikely(op == NULL)) + return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API + op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); + if (unlikely(!op->func)) return NULL; +#endif + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; +#if !CYTHON_COMPILING_IN_LIMITED_API + cf->m_ml = ml; + cf->m_self = (PyObject *) op; +#endif + Py_XINCREF(closure); + op->func_closure = closure; +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_XINCREF(module); + cf->m_module = module; +#endif + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + op->func_classobj = NULL; +#else + ((PyCMethodObject*)op)->mm_class = NULL; +#endif + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults_size = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + op->func_is_coroutine = NULL; +#if CYTHON_METH_FASTCALL + switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { + case METH_NOARGS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; + break; + case METH_O: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; + break; + case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; + break; + case METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; + break; + case METH_VARARGS | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = NULL; + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + Py_DECREF(op); + return NULL; + } +#endif + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_CLEAR(m->func); +#else + Py_CLEAR(((PyCFunctionObject*)m)->m_module); +#endif + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API +#if PY_VERSION_HEX < 0x030900B1 + Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); +#else + { + PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; + ((PyCMethodObject *) (m))->mm_class = NULL; + Py_XDECREF(cls); + } +#endif +#endif + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + Py_CLEAR(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + __Pyx_PyHeapTypeObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(m->func); +#else + Py_VISIT(((PyCFunctionObject*)m)->m_module); +#endif + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); +#endif + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *f = ((__pyx_CyFunctionObject*)func)->func; + PyObject *py_name = NULL; + PyCFunction meth; + int flags; + meth = PyCFunction_GetFunction(f); + if (unlikely(!meth)) return NULL; + flags = PyCFunction_GetFlags(f); + if (unlikely(flags < 0)) return NULL; +#else + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + int flags = f->m_ml->ml_flags; +#endif + Py_ssize_t size; + switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 0)) + return (*meth)(self, NULL); +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); +#endif + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); +#endif + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + return NULL; + } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", + py_name); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); +#endif + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *self, *result; +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)func)->m_self; +#endif + result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); + return result; +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; +#if CYTHON_METH_FASTCALL + __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); + if (vc) { +#if CYTHON_ASSUME_SAFE_MACROS + return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); +#else + (void) &__Pyx_PyVectorcall_FastCallDict; + return PyVectorcall_Call(func, args, kw); +#endif + } +#endif + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; +#if CYTHON_ASSUME_SAFE_MACROS + argc = PyTuple_GET_SIZE(args); +#else + argc = PyTuple_Size(args); + if (unlikely(!argc) < 0) return NULL; +#endif + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); +#if PY_MAJOR_VERSION > 2 + PyErr_Format(PyExc_TypeError, + "unbound method %.200S() needs an argument", + cyfunc->func_qualname); +#else + PyErr_SetString(PyExc_TypeError, + "unbound method needs an argument"); +#endif + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) +{ + int ret = 0; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + if (unlikely(nargs < 1)) { + PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", + ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + ret = 1; + } + if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + return ret; +} +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 0)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, NULL); +} +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 1)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, args[0]); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; + PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); +} +#endif +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_CyFunctionType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, + {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, + {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, + {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, + {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, + {Py_tp_methods, (void *)__pyx_CyFunction_methods}, + {Py_tp_members, (void *)__pyx_CyFunction_members}, + {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, + {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, + {0, 0}, +}; +static PyType_Spec __pyx_CyFunctionType_spec = { + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + __pyx_CyFunctionType_slots +}; +#else +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, +#if !CYTHON_METH_FASTCALL + 0, +#elif CYTHON_BACKPORT_VECTORCALL + (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), +#else + offsetof(PyCFunctionObject, vectorcall), +#endif + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_PyMethod_New, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_CyFunction_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); +#endif + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + m->defaults_size = size; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + +/* CalculateMetaclass */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases; +#if CYTHON_ASSUME_SAFE_MACROS + nbases = PyTuple_GET_SIZE(bases); +#else + nbases = PyTuple_Size(bases); + if (nbases < 0) return NULL; +#endif + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; +#if CYTHON_ASSUME_SAFE_MACROS + PyObject *tmp = PyTuple_GET_ITEM(bases, i); +#else + PyObject *tmp = PyTuple_GetItem(bases, i); + if (!tmp) return NULL; +#endif + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +/* PyObjectCall2Args */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args[3] = {NULL, arg1, arg2}; + return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* PyObjectLookupSpecial */ +#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { + PyObject *res; + PyTypeObject *tp = Py_TYPE(obj); +#if PY_MAJOR_VERSION < 3 + if (unlikely(PyInstance_Check(obj))) + return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); +#endif + res = _PyType_Lookup(tp, attr_name); + if (likely(res)) { + descrgetfunc f = Py_TYPE(res)->tp_descr_get; + if (!f) { + Py_INCREF(res); + } else { + res = f(res, obj, (PyObject *)tp); + } + } else if (with_error) { + PyErr_SetObject(PyExc_AttributeError, attr_name); + } + return res; +} +#endif + +/* Py3ClassCreate */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs[3] = {NULL, name, bases}; + ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); + Py_DECREF(prep); + } else { + if (unlikely(PyErr_Occurred())) + return NULL; + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; +#if PY_VERSION_HEX >= 0x03030000 + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; +#else + CYTHON_MAYBE_UNUSED_VAR(qualname); +#endif + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS +static int __Pyx_SetNamesPEP487(PyObject *type_obj) { + PyTypeObject *type = (PyTypeObject*) type_obj; + PyObject *names_to_set, *key, *value, *set_name, *tmp; + Py_ssize_t i = 0; +#if CYTHON_USE_TYPE_SLOTS + names_to_set = PyDict_Copy(type->tp_dict); +#else + { + PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); + names_to_set = NULL; + if (likely(d)) { + PyObject *names_to_set = PyDict_New(); + int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; + Py_DECREF(d); + if (unlikely(ret < 0)) + Py_CLEAR(names_to_set); + } + } +#endif + if (unlikely(names_to_set == NULL)) + goto bad; + while (PyDict_Next(names_to_set, &i, &key, &value)) { + set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); + if (unlikely(set_name != NULL)) { + tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); + Py_DECREF(set_name); + if (unlikely(tmp == NULL)) { + __Pyx_TypeName value_type_name = + __Pyx_PyType_GetName(Py_TYPE(value)); + __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); + PyErr_Format(PyExc_RuntimeError, +#if PY_MAJOR_VERSION >= 3 + "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", + value_type_name, key, type_name); +#else + "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", + value_type_name, + PyString_Check(key) ? PyString_AS_STRING(key) : "?", + type_name); +#endif + goto bad; + } else { + Py_DECREF(tmp); + } + } + else if (unlikely(PyErr_Occurred())) { + goto bad; + } + } + Py_DECREF(names_to_set); + return 0; +bad: + Py_XDECREF(names_to_set); + return -1; +} +static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { +#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyTypeObject *type = (PyTypeObject*) type_obj; + PyObject *mro = type->tp_mro; + Py_ssize_t i, nbases; + if (unlikely(!mro)) goto done; + (void) &__Pyx_GetBuiltinName; + Py_INCREF(mro); + nbases = PyTuple_GET_SIZE(mro); + assert(PyTuple_GET_ITEM(mro, 0) == type_obj); + for (i = 1; i < nbases-1; i++) { + PyObject *base, *dict, *meth; + base = PyTuple_GET_ITEM(mro, i); + dict = ((PyTypeObject *)base)->tp_dict; + meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); + if (unlikely(meth)) { + descrgetfunc f = Py_TYPE(meth)->tp_descr_get; + PyObject *res; + Py_INCREF(meth); + if (likely(f)) { + res = f(meth, NULL, type_obj); + Py_DECREF(meth); + if (unlikely(!res)) goto bad; + meth = res; + } + res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); + Py_DECREF(meth); + if (unlikely(!res)) goto bad; + Py_DECREF(res); + goto done; + } else if (unlikely(PyErr_Occurred())) { + goto bad; + } + } +done: + Py_XDECREF(mro); + return type_obj; +bad: + Py_XDECREF(mro); + Py_DECREF(type_obj); + return NULL; +#else + PyObject *super_type, *super, *func, *res; +#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) + super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); +#else + super_type = (PyObject*) &PySuper_Type; + (void) &__Pyx_GetBuiltinName; +#endif + super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; +#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) + Py_XDECREF(super_type); +#endif + if (unlikely(!super)) { + Py_CLEAR(type_obj); + goto done; + } + func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); + Py_DECREF(super); + if (likely(!func)) { + if (unlikely(PyErr_Occurred())) + Py_CLEAR(type_obj); + goto done; + } + res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); + Py_DECREF(func); + if (unlikely(!res)) + Py_CLEAR(type_obj); + Py_XDECREF(res); +done: + return type_obj; +#endif +} +#endif +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result; + PyObject *owned_metaclass = NULL; + PyObject *margs[4] = {NULL, name, bases, dict}; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, +#if PY_VERSION_HEX < 0x030600A4 + (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw +#else + mkw +#endif + ); + Py_XDECREF(owned_metaclass); +#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS + if (likely(result) && likely(PyType_Check(result))) { + if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { + Py_CLEAR(result); + } else { + result = __Pyx_InitSubclassPEP487(result, mkw); + } + } +#else + (void) &__Pyx_GetBuiltinName; +#endif + return result; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, + PyObject *firstlineno, PyObject *name) { + PyObject *replace = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; + replace = PyObject_GetAttrString(code, "replace"); + if (likely(replace)) { + PyObject *result; + result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + Py_DECREF(replace); + return result; + } + PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 + { + PyObject *compiled = NULL, *result = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; + compiled = Py_CompileString( + "out = type(code)(\n" + " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" + " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" + " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" + " code.co_lnotab)\n", "", Py_file_input); + if (!compiled) return NULL; + result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); + Py_DECREF(compiled); + if (!result) PyErr_Print(); + Py_DECREF(result); + result = PyDict_GetItemString(scratch_dict, "out"); + if (result) Py_INCREF(result); + return result; + } + #else + return NULL; + #endif +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; + PyObject *replace = NULL, *getframe = NULL, *frame = NULL; + PyObject *exc_type, *exc_value, *exc_traceback; + int success = 0; + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + getframe = PySys_GetObject("_getframe"); + if (unlikely(!getframe)) goto bad; + if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; + frame = PyEval_EvalCode(code_object, dict, dict); + if (unlikely(!frame) || frame == Py_None) goto bad; + success = 1; + bad: + PyErr_Restore(exc_type, exc_value, exc_traceback); + Py_XDECREF(code_object); + Py_XDECREF(py_py_line); + Py_XDECREF(py_funcname); + Py_XDECREF(dict); + Py_XDECREF(replace); + if (success) { + PyTraceBack_Here( + (struct _frame*)frame); + } + Py_XDECREF(frame); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__18); + } + return name; +} +#endif + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyException_SetTraceback(value, tb); + #elif CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + PyObject *exc_value = exc_info->exc_value; + if (exc_value == NULL || exc_value == Py_None) { + *value = NULL; + *type = NULL; + *tb = NULL; + } else { + *value = exc_value; + Py_INCREF(*value); + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + *tb = PyException_GetTraceback(exc_value); + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #endif +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + PyObject *tmp_value = exc_info->exc_value; + exc_info->exc_value = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); + #else + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); + #endif +} +#endif + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_value = exc_info->exc_value; + exc_info->exc_value = *value; + if (tmp_value == NULL || tmp_value == Py_None) { + Py_XDECREF(tmp_value); + tmp_value = NULL; + tmp_type = NULL; + tmp_tb = NULL; + } else { + tmp_type = (PyObject*) Py_TYPE(tmp_value); + Py_INCREF(tmp_type); + #if CYTHON_COMPILING_IN_CPYTHON + tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; + Py_XINCREF(tmp_tb); + #else + tmp_tb = PyException_GetTraceback(tmp_value); + #endif + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* PyObjectCallMethod1 */ +#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +#endif +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { +#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 + PyObject *args[2] = {obj, arg}; + (void) __Pyx_PyObject_GetMethod; + (void) __Pyx_PyObject_CallOneArg; + (void) __Pyx_PyObject_Call2Args; + return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#else + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +#endif +} + +/* CoroutineBase */ +#include +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + CYTHON_UNUSED_VAR(__pyx_tstate); + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (likely(et == PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + value = Py_None; + } +#if PY_VERSION_HEX >= 0x030300A0 + else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); + } +#endif + else if (unlikely(PyTuple_Check(ev))) { + if (PyTuple_GET_SIZE(ev) >= 1) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + value = PyTuple_GET_ITEM(ev, 0); + Py_INCREF(value); +#else + value = PySequence_ITEM(ev, 0); +#endif + } else { + Py_INCREF(Py_None); + value = Py_None; + } + Py_DECREF(ev); + } + else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { + value = ev; + } + if (likely(value)) { + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = value; + return 0; + } + } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); + Py_DECREF(ev); + if (likely(args)) { + value = PySequence_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +static CYTHON_INLINE +void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { +#if PY_VERSION_HEX >= 0x030B00a4 + Py_CLEAR(exc_state->exc_value); +#else + PyObject *t, *v, *tb; + t = exc_state->exc_type; + v = exc_state->exc_value; + tb = exc_state->exc_traceback; + exc_state->exc_type = NULL; + exc_state->exc_value = NULL; + exc_state->exc_traceback = NULL; + Py_XDECREF(t); + Py_XDECREF(v); + Py_XDECREF(tb); +#endif +} +#define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { + const char *msg; + CYTHON_MAYBE_UNUSED_VAR(gen); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { + msg = "coroutine already executing"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { + msg = "async generator already executing"; + #endif + } else { + msg = "generator already executing"; + } + PyErr_SetString(PyExc_ValueError, msg); +} +#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { + const char *msg; + CYTHON_MAYBE_UNUSED_VAR(gen); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(gen)) { + msg = "can't send non-None value to a just-started coroutine"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(gen)) { + msg = "can't send non-None value to a just-started async generator"; + #endif + } else { + msg = "can't send non-None value to a just-started generator"; + } + PyErr_SetString(PyExc_TypeError, msg); +} +#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { + CYTHON_MAYBE_UNUSED_VAR(gen); + CYTHON_MAYBE_UNUSED_VAR(closing); + #ifdef __Pyx_Coroutine_USED + if (!closing && __Pyx_Coroutine_Check(gen)) { + PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); + } else + #endif + if (value) { + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + else + #endif + PyErr_SetNone(PyExc_StopIteration); + } +} +static +PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { + __Pyx_PyThreadState_declare + PyThreadState *tstate; + __Pyx_ExcInfoStruct *exc_state; + PyObject *retval; + assert(!self->is_running); + if (unlikely(self->resume_label == 0)) { + if (unlikely(value && value != Py_None)) { + return __Pyx_Coroutine_NotStartedError((PyObject*)self); + } + } + if (unlikely(self->resume_label == -1)) { + return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + } +#if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + tstate = __pyx_tstate; +#else + tstate = __Pyx_PyThreadState_Current; +#endif + exc_state = &self->gi_exc_state; + if (exc_state->exc_value) { + #if CYTHON_COMPILING_IN_PYPY + #else + PyObject *exc_tb; + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON + exc_tb = PyException_GetTraceback(exc_state->exc_value); + #elif PY_VERSION_HEX >= 0x030B00a4 + exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback; + #else + exc_tb = exc_state->exc_traceback; + #endif + if (exc_tb) { + PyTracebackObject *tb = (PyTracebackObject *) exc_tb; + PyFrameObject *f = tb->tb_frame; + assert(f->f_back == NULL); + #if PY_VERSION_HEX >= 0x030B00A1 + f->f_back = PyThreadState_GetFrame(tstate); + #else + Py_XINCREF(tstate->frame); + f->f_back = tstate->frame; + #endif + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON + Py_DECREF(exc_tb); + #endif + } + #endif + } +#if CYTHON_USE_EXC_INFO_STACK + exc_state->previous_item = tstate->exc_info; + tstate->exc_info = exc_state; +#else + if (exc_state->exc_type) { + __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } else { + __Pyx_Coroutine_ExceptionClear(exc_state); + __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } +#endif + self->is_running = 1; + retval = self->body(self, tstate, value); + self->is_running = 0; +#if CYTHON_USE_EXC_INFO_STACK + exc_state = &self->gi_exc_state; + tstate->exc_info = exc_state->previous_item; + exc_state->previous_item = NULL; + __Pyx_Coroutine_ResetFrameBackpointer(exc_state); +#endif + return retval; +} +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { +#if CYTHON_COMPILING_IN_PYPY + CYTHON_UNUSED_VAR(exc_state); +#else + PyObject *exc_tb; + #if PY_VERSION_HEX >= 0x030B00a4 + if (!exc_state->exc_value) return; + exc_tb = PyException_GetTraceback(exc_state->exc_value); + #else + exc_tb = exc_state->exc_traceback; + #endif + if (likely(exc_tb)) { + PyTracebackObject *tb = (PyTracebackObject *) exc_tb; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); + #if PY_VERSION_HEX >= 0x030B00a4 + Py_DECREF(exc_tb); + #endif + } +#endif +} +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { + CYTHON_MAYBE_UNUSED_VAR(gen); + if (unlikely(!retval)) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (!__Pyx_PyErr_Occurred()) { + PyObject *exc = PyExc_StopIteration; + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + exc = __Pyx_PyExc_StopAsyncIteration; + #endif + __Pyx_PyErr_SetNone(exc); + } + } + return retval; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) +static CYTHON_INLINE +PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { +#if PY_VERSION_HEX <= 0x030A00A1 + return _PyGen_Send(gen, arg); +#else + PyObject *result; + if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) { + if (PyAsyncGen_CheckExact(gen)) { + assert(result == Py_None); + PyErr_SetNone(PyExc_StopAsyncIteration); + } + else if (result == Py_None) { + PyErr_SetNone(PyExc_StopIteration); + } + else { +#if PY_VERSION_HEX < 0x030d00A1 + _PyGen_SetStopIterationValue(result); +#else + if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) { + PyErr_SetObject(PyExc_StopIteration, result); + } else { + PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result); + if (likely(exc != NULL)) { + PyErr_SetObject(PyExc_StopIteration, exc); + Py_DECREF(exc); + } + } +#endif + } + Py_DECREF(result); + result = NULL; + } + return result; +#endif +} +#endif +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Coroutine_Undelegate(gen); + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); + ret = __Pyx_Coroutine_SendEx(gen, val, 0); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { + PyObject *retval; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + ret = __Pyx_async_gen_asend_send(yf, value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyCoro_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + { + if (value == Py_None) + ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + else + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + retval = __Pyx_Coroutine_FinishDelegation(gen); + } else { + retval = __Pyx_Coroutine_SendEx(gen, value, 0); + } + return __Pyx_Coroutine_MethodReturn(self, retval); +} +static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + if (__Pyx_CoroutineAwait_CheckExact(yf)) { + retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + retval = __Pyx_async_gen_asend_close(yf, NULL); + } else + if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { + retval = __Pyx_async_gen_athrow_close(yf, NULL); + } else + #endif + { + PyObject *meth; + gen->is_running = 1; + meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); + if (unlikely(!meth)) { + if (unlikely(PyErr_Occurred())) { + PyErr_WriteUnraisable(yf); + } + } else { + retval = __Pyx_PyObject_CallNoArg(meth); + Py_DECREF(meth); + if (unlikely(!retval)) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Next(yf); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, Py_None); + } else + #endif + ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_SendEx(gen, Py_None, 0); +} +static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { + CYTHON_UNUSED_VAR(arg); + return __Pyx_Coroutine_Close(self); +} +static PyObject *__Pyx_Coroutine_Close(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + Py_INCREF(yf); + err = __Pyx_Coroutine_CloseIter(gen, yf); + __Pyx_Coroutine_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) + PyErr_SetNone(PyExc_GeneratorExit); + retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); + if (unlikely(retval)) { + const char *msg; + Py_DECREF(retval); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(self)) { + msg = "coroutine ignored GeneratorExit"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(self)) { +#if PY_VERSION_HEX < 0x03060000 + msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; +#else + msg = "async generator ignored GeneratorExit"; +#endif + #endif + } else { + msg = "generator ignored GeneratorExit"; + } + PyErr_SetString(PyExc_RuntimeError, msg); + return NULL; + } + raised_exception = PyErr_Occurred(); + if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { + if (raised_exception) PyErr_Clear(); + Py_INCREF(Py_None); + return Py_None; + } + return NULL; +} +static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, + PyObject *args, int close_on_genexit) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + Py_INCREF(yf); + if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { + int err = __Pyx_Coroutine_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Coroutine_Undelegate(gen); + if (err < 0) + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto throw_here; + } + gen->is_running = 1; + if (0 + #ifdef __Pyx_Generator_USED + || __Pyx_Generator_CheckExact(yf) + #endif + #ifdef __Pyx_Coroutine_USED + || __Pyx_Coroutine_Check(yf) + #endif + ) { + ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { + ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); + #endif + } else { + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (unlikely(PyErr_Occurred())) { + gen->is_running = 0; + return NULL; + } + __Pyx_Coroutine_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + if (likely(args)) { + ret = __Pyx_PyObject_Call(meth, args, NULL); + } else { + PyObject *cargs[4] = {NULL, typ, val, tb}; + ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_MethodReturn(self, ret); + } +throw_here: + __Pyx_Raise(typ, val, tb, NULL); + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +} +static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { + PyObject *typ; + PyObject *val = NULL; + PyObject *tb = NULL; + if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) + return NULL; + return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); +} +static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { +#if PY_VERSION_HEX >= 0x030B00a4 + Py_VISIT(exc_state->exc_value); +#else + Py_VISIT(exc_state->exc_type); + Py_VISIT(exc_state->exc_value); + Py_VISIT(exc_state->exc_traceback); +#endif + return 0; +} +static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + Py_VISIT(gen->closure); + Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); + return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); +} +static int __Pyx_Coroutine_clear(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); + } +#endif + Py_CLEAR(gen->gi_code); + Py_CLEAR(gen->gi_frame); + Py_CLEAR(gen->gi_name); + Py_CLEAR(gen->gi_qualname); + Py_CLEAR(gen->gi_modulename); + return 0; +} +static void __Pyx_Coroutine_dealloc(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject_GC_UnTrack(gen); + if (gen->gi_weakreflist != NULL) + PyObject_ClearWeakRefs(self); + if (gen->resume_label >= 0) { + PyObject_GC_Track(self); +#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE + if (unlikely(PyObject_CallFinalizerFromDealloc(self))) +#else + Py_TYPE(gen)->tp_del(self); + if (unlikely(Py_REFCNT(self) > 0)) +#endif + { + return; + } + PyObject_GC_UnTrack(self); + } +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + /* We have to handle this case for asynchronous generators + right here, because this code has to be between UNTRACK + and GC_Del. */ + Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); + } +#endif + __Pyx_Coroutine_clear(self); + __Pyx_PyHeapTypeObject_GC_Del(gen); +} +static void __Pyx_Coroutine_del(PyObject *self) { + PyObject *error_type, *error_value, *error_traceback; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + __Pyx_PyThreadState_declare + if (gen->resume_label < 0) { + return; + } +#if !CYTHON_USE_TP_FINALIZE + assert(self->ob_refcnt == 0); + __Pyx_SET_REFCNT(self, 1); +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; + PyObject *finalizer = agen->ag_finalizer; + if (finalizer && !agen->ag_closed) { + PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); + if (unlikely(!res)) { + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); + return; + } + } +#endif + if (unlikely(gen->resume_label == 0 && !error_value)) { +#ifdef __Pyx_Coroutine_USED +#ifdef __Pyx_Generator_USED + if (!__Pyx_Generator_CheckExact(self)) +#endif + { + PyObject_GC_UnTrack(self); +#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) + if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) + PyErr_WriteUnraisable(self); +#else + {PyObject *msg; + char *cmsg; + #if CYTHON_COMPILING_IN_PYPY + msg = NULL; + cmsg = (char*) "coroutine was never awaited"; + #else + char *cname; + PyObject *qualname; + qualname = gen->gi_qualname; + cname = PyString_AS_STRING(qualname); + msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); + if (unlikely(!msg)) { + PyErr_Clear(); + cmsg = (char*) "coroutine was never awaited"; + } else { + cmsg = PyString_AS_STRING(msg); + } + #endif + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) + PyErr_WriteUnraisable(self); + Py_XDECREF(msg);} +#endif + PyObject_GC_Track(self); + } +#endif + } else { + PyObject *res = __Pyx_Coroutine_Close(self); + if (unlikely(!res)) { + if (PyErr_Occurred()) + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); +#if !CYTHON_USE_TP_FINALIZE + assert(Py_REFCNT(self) > 0); + if (likely(--self->ob_refcnt == 0)) { + return; + } + { + Py_ssize_t refcnt = Py_REFCNT(self); + _Py_NewReference(self); + __Pyx_SET_REFCNT(self, refcnt); + } +#if CYTHON_COMPILING_IN_CPYTHON + assert(PyType_IS_GC(Py_TYPE(self)) && + _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); + _Py_DEC_REFTOTAL; +#endif +#ifdef COUNT_ALLOCS + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; +#endif +#endif +} +static PyObject * +__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) +{ + PyObject *name = self->gi_name; + CYTHON_UNUSED_VAR(context); + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(self->gi_name, value); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context) +{ + PyObject *name = self->gi_qualname; + CYTHON_UNUSED_VAR(context); + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(self->gi_qualname, value); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) +{ + PyObject *frame = self->gi_frame; + CYTHON_UNUSED_VAR(context); + if (!frame) { + if (unlikely(!self->gi_code)) { + Py_RETURN_NONE; + } + frame = (PyObject *) PyFrame_New( + PyThreadState_Get(), /*PyThreadState *tstate,*/ + (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (unlikely(!frame)) + return NULL; + self->gi_frame = frame; + } + Py_INCREF(frame); + return frame; +} +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); + if (unlikely(!gen)) + return NULL; + return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); +} +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + gen->body = body; + gen->closure = closure; + Py_XINCREF(closure); + gen->is_running = 0; + gen->resume_label = 0; + gen->classobj = NULL; + gen->yieldfrom = NULL; + #if PY_VERSION_HEX >= 0x030B00a4 + gen->gi_exc_state.exc_value = NULL; + #else + gen->gi_exc_state.exc_type = NULL; + gen->gi_exc_state.exc_value = NULL; + gen->gi_exc_state.exc_traceback = NULL; + #endif +#if CYTHON_USE_EXC_INFO_STACK + gen->gi_exc_state.previous_item = NULL; +#endif + gen->gi_weakreflist = NULL; + Py_XINCREF(qualname); + gen->gi_qualname = qualname; + Py_XINCREF(name); + gen->gi_name = name; + Py_XINCREF(module_name); + gen->gi_modulename = module_name; + Py_XINCREF(code); + gen->gi_code = code; + gen->gi_frame = NULL; + PyObject_GC_Track(gen); + return gen; +} + +/* PatchModuleWithCoroutine */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + int result; + PyObject *globals, *result_obj; + globals = PyDict_New(); if (unlikely(!globals)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_coroutine_type", + #ifdef __Pyx_Coroutine_USED + (PyObject*)__pyx_CoroutineType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_generator_type", + #ifdef __Pyx_Generator_USED + (PyObject*)__pyx_GeneratorType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; + result_obj = PyRun_String(py_code, Py_file_input, globals, globals); + if (unlikely(!result_obj)) goto ignore; + Py_DECREF(result_obj); + Py_DECREF(globals); + return module; +ignore: + Py_XDECREF(globals); + PyErr_WriteUnraisable(module); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { + Py_DECREF(module); + module = NULL; + } +#else + py_code++; +#endif + return module; +} + +/* PatchGeneratorABC */ +#ifndef CYTHON_REGISTER_ABCS +#define CYTHON_REGISTER_ABCS 1 +#endif +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) +static PyObject* __Pyx_patch_abc_module(PyObject *module); +static PyObject* __Pyx_patch_abc_module(PyObject *module) { + module = __Pyx_Coroutine_patch_module( + module, "" +"if _cython_generator_type is not None:\n" +" try: Generator = _module.Generator\n" +" except AttributeError: pass\n" +" else: Generator.register(_cython_generator_type)\n" +"if _cython_coroutine_type is not None:\n" +" try: Coroutine = _module.Coroutine\n" +" except AttributeError: pass\n" +" else: Coroutine.register(_cython_coroutine_type)\n" + ); + return module; +} +#endif +static int __Pyx_patch_abc(void) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + static int abc_patched = 0; + if (CYTHON_REGISTER_ABCS && !abc_patched) { + PyObject *module; + module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); + if (unlikely(!module)) { + PyErr_WriteUnraisable(NULL); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, + ((PY_MAJOR_VERSION >= 3) ? + "Cython module failed to register with collections.abc module" : + "Cython module failed to register with collections module"), 1) < 0)) { + return -1; + } + } else { + module = __Pyx_patch_abc_module(module); + abc_patched = 1; + if (unlikely(!module)) + return -1; + Py_DECREF(module); + } + module = PyImport_ImportModule("backports_abc"); + if (module) { + module = __Pyx_patch_abc_module(module); + Py_XDECREF(module); + } + if (!module) { + PyErr_Clear(); + } + } +#else + if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); +#endif + return 0; +} + +/* Generator */ +static PyMethodDef __pyx_Generator_methods[] = { + {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, + (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, + (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, + (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + {0, 0, 0, 0} +}; +static PyMemberDef __pyx_Generator_memberlist[] = { + {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, + {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, + {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, +#if CYTHON_USE_TYPE_SPECS + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, +#endif + {0, 0, 0, 0, 0} +}; +static PyGetSetDef __pyx_Generator_getsets[] = { + {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + (char*) PyDoc_STR("name of the generator"), 0}, + {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + (char*) PyDoc_STR("qualified name of the generator"), 0}, + {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, + (char*) PyDoc_STR("Frame of the generator"), 0}, + {0, 0, 0, 0, 0} +}; +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_GeneratorType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, + {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, + {Py_tp_iter, (void *)PyObject_SelfIter}, + {Py_tp_iternext, (void *)__Pyx_Generator_Next}, + {Py_tp_methods, (void *)__pyx_Generator_methods}, + {Py_tp_members, (void *)__pyx_Generator_memberlist}, + {Py_tp_getset, (void *)__pyx_Generator_getsets}, + {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, +#if CYTHON_USE_TP_FINALIZE + {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, +#endif + {0, 0}, +}; +static PyType_Spec __pyx_GeneratorType_spec = { + __PYX_TYPE_MODULE_PREFIX "generator", + sizeof(__pyx_CoroutineObject), + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + __pyx_GeneratorType_slots +}; +#else +static PyTypeObject __pyx_GeneratorType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "generator", + sizeof(__pyx_CoroutineObject), + 0, + (destructor) __Pyx_Coroutine_dealloc, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + 0, + (traverseproc) __Pyx_Coroutine_traverse, + 0, + 0, + offsetof(__pyx_CoroutineObject, gi_weakreflist), + 0, + (iternextfunc) __Pyx_Generator_Next, + __pyx_Generator_methods, + __pyx_Generator_memberlist, + __pyx_Generator_getsets, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if CYTHON_USE_TP_FINALIZE + 0, +#else + __Pyx_Coroutine_del, +#endif + 0, +#if CYTHON_USE_TP_FINALIZE + __Pyx_Coroutine_del, +#elif PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_Generator_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); +#endif + if (unlikely(!__pyx_GeneratorType)) { + return -1; + } + return 0; +} + +/* CheckBinaryVersion */ +static unsigned long __Pyx_get_runtime_version(void) { +#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 + return Py_Version & ~0xFFUL; +#else + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + return version; +#endif +} +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { + const unsigned long MAJOR_MINOR = 0xFFFF0000UL; + if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) + return 0; + if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) + return 1; + { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compile time Python version %d.%d " + "of module '%.100s' " + "%s " + "runtime version %d.%d", + (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), + __Pyx_MODULE_NAME, + (allow_newer) ? "was newer than" : "does not match", + (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) + ); + return PyErr_WarnEx(NULL, message, 1); + } +} + +/* InitStrings */ +#if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +#include +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { + size_t len = strlen(s); + if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, "byte string is too long"); + return -1; + } + return (Py_ssize_t) len; +} +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return __Pyx_PyUnicode_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return PyByteArray_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/w3lib/_util.py b/w3lib/_util.pyx similarity index 100% rename from w3lib/_util.py rename to w3lib/_util.pyx diff --git a/w3lib/_utr46.c b/w3lib/_utr46.c new file mode 100644 index 00000000..cafff2d0 --- /dev/null +++ b/w3lib/_utr46.c @@ -0,0 +1,18649 @@ +/* Generated by Cython 3.0.8 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "name": "w3lib._utr46", + "sources": [ + "w3lib/_utr46.pyx" + ] + }, + "module_name": "w3lib._utr46" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API +#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#else +#define __PYX_EXTRA_ABI_MODULE_NAME "" +#endif +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030008F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #ifdef Py_LIMITED_API + #undef __PYX_LIMITED_VERSION_HEX + #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API + #endif + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_USE_CPP_STD_MOVE + #if defined(__cplusplus) && (\ + __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) + #define CYTHON_USE_CPP_STD_MOVE 1 + #else + #define CYTHON_USE_CPP_STD_MOVE 0 + #endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #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 +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if CYTHON_COMPILING_IN_LIMITED_API + static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } + #ifndef CO_OPTIMIZED + #define CO_OPTIMIZED 0x0001 + #endif + #ifndef CO_NEWLOCALS + #define CO_NEWLOCALS 0x0002 + #endif + #ifndef CO_VARARGS + #define CO_VARARGS 0x0004 + #endif + #ifndef CO_VARKEYWORDS + #define CO_VARKEYWORDS 0x0008 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x0200 + #endif + #ifndef CO_GENERATOR + #define CO_GENERATOR 0x0020 + #endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x0080 + #endif +#elif PY_VERSION_HEX >= 0x030B0000 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); + if (!empty_bytes) return NULL; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); + Py_DECREF(empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_MAJOR_VERSION >= 0x030900B1 +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) +#else +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) +#endif +#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) +#elif !CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) +static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { + return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; +} +#endif +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API + return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; +#else + return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +#endif +} +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) +#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) +#else + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) +#endif +#if PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__w3lib___utr46 +#define __PYX_HAVE_API__w3lib___utr46 +/* Early includes */ +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#include +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#include +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "w3lib/_utr46.pyx", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* #### Code section: numeric_typedefs ### */ +/* #### Code section: complex_type_declarations ### */ +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ +struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr; +struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr; + +/* "w3lib/_utr46.pyx":57 + * else: + * mapping = "".join( + * chr(int(value, base=16)) for value in match["mapping"].split(" ") # <<<<<<<<<<<<<< + * ) + * return cls( + */ +struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr { + PyObject_HEAD + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_value; +}; + + +/* "w3lib/_utr46.pyx":187 + * def _is_bidi_domain_name(domain_name: str) -> bool: + * return any( + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} # <<<<<<<<<<<<<< + * for code_point in set(domain_name) + * ) + */ +struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr { + PyObject_HEAD + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_code_point; +}; + +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#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 + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* TupleAndListFromArray.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* fastcall.proto */ +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#else + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) +#endif +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) + #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) +#else + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) +#endif +#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) +#define __Pyx_KwValues_VARARGS(args, nargs) NULL +#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) +#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) +#if CYTHON_METH_FASTCALL + #define __Pyx_Arg_FASTCALL(args, i) args[i] + #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) + static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + #else + #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) + #endif + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) +#else + #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS + #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS + #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS + #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS + #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) + #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, + const char* function_name); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#if !CYTHON_VECTORCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if !CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03080000 + #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #define __Pxy_PyFrame_Initialize_Offsets() + #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) +#else + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif +#endif +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectFastCall.proto */ +#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); + +/* RaiseUnboundLocalError.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + L->ob_item[len] = x; + #else + PyList_SET_ITEM(list, len, x); + #endif + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* pep479.proto */ +static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) +#else +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#endif + +/* PyObjectFormatAndDecref.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* RaiseKeywordRequired.proto */ +static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* PyObjectLookupSpecial.proto */ +#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) +#define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) +static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); +#else +#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +/* PyObjectFormatSimple.proto */ +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#elif PY_MAJOR_VERSION < 3 + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ + PyObject_Format(s, f)) +#elif CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\ + likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\ + PyObject_Format(s, f)) +#else + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#endif + +/* JoinPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char); + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyUnicode_Substring.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring( + PyObject* text, Py_ssize_t start, Py_ssize_t stop); + +/* unicode_tailmatch.proto */ +static int __Pyx_PyUnicode_Tailmatch( + PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction); + +/* PyUnicodeContains.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_ContainsTF(PyObject* substring, PyObject* text, int eq) { + int result = PyUnicode_Contains(text, substring); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* GetItemIntUnicode.proto */ +#define __Pyx_GetItemInt_Unicode(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Unicode_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "string index out of range"), (Py_UCS4)-1)) +static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i, + int wraparound, int boundscheck); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* set_iter.proto */ +static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set, + Py_ssize_t* p_orig_length, int* p_source_is_set); +static CYTHON_INLINE int __Pyx_set_iter_next( + PyObject* iter_obj, Py_ssize_t orig_length, + Py_ssize_t* ppos, PyObject **value, + int source_is_set); + +/* 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); + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* BuildPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, + int prepend_sign, char padding_char); + +/* CIntToPyUnicode.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char); + +/* AssertionsEnabled.proto */ +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define __Pyx_init_assertions_enabled() (0) + #define __pyx_assertions_enabled() (1) +#elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) + static int __pyx_assertions_enabled_flag; + #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) + static int __Pyx_init_assertions_enabled(void) { + PyObject *builtins, *debug, *debug_str; + int flag; + builtins = PyEval_GetBuiltins(); + if (!builtins) goto bad; + debug_str = PyUnicode_FromStringAndSize("__debug__", 9); + if (!debug_str) goto bad; + debug = PyObject_GetItem(builtins, debug_str); + Py_DECREF(debug_str); + if (!debug) goto bad; + flag = PyObject_IsTrue(debug); + Py_DECREF(debug); + if (flag == -1) goto bad; + __pyx_assertions_enabled_flag = flag; + return 0; + bad: + __pyx_assertions_enabled_flag = 1; + return -1; + } +#else + #define __Pyx_init_assertions_enabled() (0) + #define __pyx_assertions_enabled() (!Py_OptimizeFlag) +#endif + +/* RaiseUnexpectedTypeError.proto */ +static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); + +/* 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); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod0.proto */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CallUnboundCMethod0(cfunc, self)\ + (likely((cfunc)->func) ?\ + (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ + (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ + (PY_VERSION_HEX >= 0x030700A0 ?\ + (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ + (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ + (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ + ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)) +#else +#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) +#endif + +/* decode_c_string_utf16.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 0; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = -1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} + +/* decode_c_bytes.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( + const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* decode_bytes.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_bytes( + PyObject* string, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + char* as_c_string; + Py_ssize_t size; +#if CYTHON_ASSUME_SAFE_MACROS + as_c_string = PyBytes_AS_STRING(string); + size = PyBytes_GET_SIZE(string); +#else + if (PyBytes_AsStringAndSize(string, &as_c_string, &size) < 0) { + return NULL; + } +#endif + return __Pyx_decode_c_bytes( + as_c_string, size, + start, stop, encoding, errors, decode_func); +} + +/* CallUnboundCMethod1.proto */ +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + +/* CIntToPyUnicode.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char); + +/* IncludeStructmemberH.proto */ +#include + +/* FixUpExtensionType.proto */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); +#endif + +/* PyObjectCallNoArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* ValidateBasesTuple.proto */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); +#endif + +/* PyType_Ready.proto */ +CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportDottedModule.proto */ +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); +#endif + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* HasAttr.proto */ +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) +#else +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); +#endif + +/* FetchSharedCythonModule.proto */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); + +/* FetchCommonType.proto */ +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); +#else +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +#endif + +/* PyMethodNew.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + typesModule = PyImport_ImportModule("types"); + if (!typesModule) return NULL; + methodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + if (!methodType) return NULL; + result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); + Py_DECREF(methodType); + return result; +} +#elif PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#else + #define __Pyx_PyMethod_New PyMethod_New +#endif + +/* PyVectorcallFastCallDict.proto */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); +#endif + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CYFUNCTION_COROUTINE 0x08 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#else + #define __Pyx_CyFunction_GetClassObj(f)\ + ((PyObject*) ((PyCMethodObject *) (f))->mm_class) +#endif +#define __Pyx_CyFunction_SetClassObj(f, classobj)\ + __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject_HEAD + PyObject *func; +#elif PY_VERSION_HEX < 0x030900B1 + PyCFunctionObject func; +#else + PyCMethodObject func; +#endif +#if CYTHON_BACKPORT_VECTORCALL + __pyx_vectorcallfunc func_vectorcall; +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_classobj; +#endif + void *defaults; + int defaults_pyobjects; + size_t defaults_size; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; + PyObject *func_is_coroutine; +} __pyx_CyFunctionObject; +#undef __Pyx_CyOrPyCFunction_Check +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); +#undef __Pyx_IsSameCFunction +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(PyObject *module); +#if CYTHON_METH_FASTCALL +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#if CYTHON_BACKPORT_VECTORCALL +#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) +#else +#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) +#endif +#endif + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + +/* Py3UpdateBases.proto */ +static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); + +/* CalculateMetaclass.proto */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +/* SetNameInClass.proto */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) +#elif CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) +#else +#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* Py3ClassCreate.proto */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); + +/* ClassMethod.proto */ +#include "descrobject.h" +CYTHON_UNUSED static PyObject* __Pyx_Method_ClassMethod(PyObject *method); + +/* CLineInTraceback.proto */ +#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 */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +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); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* CoroutineBase.proto */ +struct __pyx_CoroutineObject; +typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_ExcInfoStruct _PyErr_StackItem +#else +typedef struct { + PyObject *exc_type; + PyObject *exc_value; + PyObject *exc_traceback; +} __Pyx_ExcInfoStruct; +#endif +typedef struct __pyx_CoroutineObject { + PyObject_HEAD + __pyx_coroutine_body_t body; + PyObject *closure; + __Pyx_ExcInfoStruct gi_exc_state; + PyObject *gi_weakreflist; + PyObject *classobj; + PyObject *yieldfrom; + PyObject *gi_name; + PyObject *gi_qualname; + PyObject *gi_modulename; + PyObject *gi_code; + PyObject *gi_frame; + int resume_label; + char is_running; +} __pyx_CoroutineObject; +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); +static int __Pyx_Coroutine_clear(PyObject *self); +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); +static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_Coroutine_SwapException(self) +#define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) +#else +#define __Pyx_Coroutine_SwapException(self) {\ + __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ + __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ + } +#define __Pyx_Coroutine_ResetAndClearException(self) {\ + __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ + (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ + } +#endif +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) +#endif +static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); + +/* PatchModuleWithCoroutine.proto */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); + +/* PatchGeneratorABC.proto */ +static int __Pyx_patch_abc(void); + +/* Generator.proto */ +#define __Pyx_Generator_USED +#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) +#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ + __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) +static PyObject *__Pyx_Generator_Next(PyObject *self); +static int __pyx_Generator_init(PyObject *module); + +/* CheckBinaryVersion.proto */ +static unsigned long __Pyx_get_runtime_version(void); +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ + +/* Module declarations from "w3lib._utr46" */ +/* #### Code section: typeinfo ### */ +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "w3lib._utr46" +extern int __pyx_module_is_main_w3lib___utr46; +int __pyx_module_is_main_w3lib___utr46 = 0; + +/* Implementation of "w3lib._utr46" */ +/* #### Code section: global_var ### */ +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_chr; +static PyObject *__pyx_builtin_open; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_AssertionError; +static PyObject *__pyx_builtin_enumerate; +/* #### Code section: string_decls ### */ +static const char __pyx_k_[] = ""; +static const char __pyx_k_M[] = "M"; +static const char __pyx_k_R[] = "R"; +static const char __pyx_k_i[] = "i"; +static const char __pyx_k_AL[] = "AL"; +static const char __pyx_k_AN[] = "AN"; +static const char __pyx_k__2[] = " "; +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__9[] = ")."; +static const char __pyx_k_gc[] = "gc"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_is[] = " is "; +static const char __pyx_k_re[] = "re"; +static const char __pyx_k_xn[] = "xn--"; +static const char __pyx_k_04X[] = "04X"; +static const char __pyx_k_NFC[] = "NFC"; +static const char __pyx_k__11[] = "*"; +static const char __pyx_k__30[] = "?"; +static const char __pyx_k_chr[] = "chr"; +static const char __pyx_k_cls[] = "cls"; +static const char __pyx_k_doc[] = "__doc__"; +static const char __pyx_k_end[] = "end"; +static const char __pyx_k_get[] = "get"; +static const char __pyx_k_str[] = "str"; +static const char __pyx_k_Dict[] = "Dict"; +static const char __pyx_k_Enum[] = "Enum"; +static const char __pyx_k_Line[] = "Line "; +static const char __pyx_k_None[] = "None"; +static const char __pyx_k_Path[] = "Path"; +static const char __pyx_k_Type[] = "Type"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_auto[] = "auto"; +static const char __pyx_k_base[] = "base"; +static const char __pyx_k_bool[] = "bool"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_enum[] = "enum"; +static const char __pyx_k_exit[] = "__exit__"; +static const char __pyx_k_file[] = "__file__"; +static const char __pyx_k_form[] = "form"; +static const char __pyx_k_from[] = " from "; +static const char __pyx_k_idna[] = "idna"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_line[] = "line"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_open[] = "open"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_send[] = "send"; +static const char __pyx_k_spec[] = "__spec__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_Entry[] = "_Entry"; +static const char __pyx_k_Match[] = "Match"; +static const char __pyx_k_VALID[] = "VALID"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_enter[] = "__enter__"; +static const char __pyx_k_entry[] = "entry"; +static const char __pyx_k_input[] = "input"; +static const char __pyx_k_label[] = "label"; +static const char __pyx_k_match[] = "match"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_split[] = "split"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_strip[] = "strip"; +static const char __pyx_k_super[] = "super"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_utf_8[] = "utf-8"; +static const char __pyx_k_valid[] = "valid"; +static const char __pyx_k_MAPPED[] = "MAPPED"; +static const char __pyx_k_Status[] = "_Status"; +static const char __pyx_k_decode[] = "decode"; +static const char __pyx_k_enable[] = "enable"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_labels[] = "labels"; +static const char __pyx_k_length[] = "length"; +static const char __pyx_k_mapped[] = "mapped"; +static const char __pyx_k_module[] = "__module__"; +static const char __pyx_k_parent[] = "parent"; +static const char __pyx_k_return[] = "return"; +static const char __pyx_k_rstrip[] = "rstrip"; +static const char __pyx_k_search[] = "search"; +static const char __pyx_k_status[] = "status"; +static const char __pyx_k_typing[] = "typing"; +static const char __pyx_k_unistr[] = "unistr"; +static const char __pyx_k_Entry_2[] = "'_Entry'"; +static const char __pyx_k_IGNORED[] = "IGNORED"; +static const char __pyx_k_disable[] = "disable"; +static const char __pyx_k_genexpr[] = "genexpr"; +static const char __pyx_k_ignored[] = "ignored"; +static const char __pyx_k_isascii[] = "isascii"; +static const char __pyx_k_mapping[] = "mapping"; +static const char __pyx_k_pathlib[] = "pathlib"; +static const char __pyx_k_pattern[] = "pattern"; +static const char __pyx_k_prepare[] = "__prepare__"; +static const char __pyx_k_process[] = "_process"; +static const char __pyx_k_rfc5892[] = "_rfc5892"; +static const char __pyx_k_Optional[] = "Optional"; +static const char __pyx_k_category[] = "category"; +static const char __pyx_k_encoding[] = "encoding"; +static const char __pyx_k_idna_txt[] = "idna.txt"; +static const char __pyx_k_punycode[] = "punycode"; +static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_set_name[] = "__set_name__"; +static const char __pyx_k_to_ascii[] = "_to_ascii"; +static const char __pyx_k_DEVIATION[] = "DEVIATION"; +static const char __pyx_k_deviation[] = "deviation"; +static const char __pyx_k_ends_with[] = " ends with '-'."; +static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_file_name[] = "file_name"; +static const char __pyx_k_isenabled[] = "isenabled"; +static const char __pyx_k_metaclass[] = "__metaclass__"; +static const char __pyx_k_new_label[] = "new_label"; +static const char __pyx_k_normalize[] = "normalize"; +static const char __pyx_k_DISALLOWED[] = "DISALLOWED"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_check_bidi[] = "check_bidi"; +static const char __pyx_k_code_point[] = "code_point"; +static const char __pyx_k_contains_a[] = " contains a '.'."; +static const char __pyx_k_disallowed[] = "disallowed"; +static const char __pyx_k_from_match[] = "from_match"; +static const char __pyx_k_startswith[] = "startswith"; +static const char __pyx_k_Domain_name[] = "Domain name "; +static const char __pyx_k_Type__Entry[] = "Type['_Entry']"; +static const char __pyx_k_domain_name[] = "domain_name"; +static const char __pyx_k_mro_entries[] = "__mro_entries__"; +static const char __pyx_k_starts_with[] = " starts with '-'."; +static const char __pyx_k_unicodedata[] = "unicodedata"; +static const char __pyx_k_Entry___init[] = "_Entry.__init__"; +static const char __pyx_k_Optional_str[] = "Optional[str]"; +static const char __pyx_k_check_bidi_2[] = "_check_bidi"; +static const char __pyx_k_initializing[] = "_initializing"; +static const char __pyx_k_is_coroutine[] = "_is_coroutine"; +static const char __pyx_k_w3lib__utr46[] = "w3lib._utr46"; +static const char __pyx_k_bidirectional[] = "bidirectional"; +static const char __pyx_k_check_hyphens[] = "check_hyphens"; +static const char __pyx_k_check_joiners[] = "check_joiners"; +static const char __pyx_k_convert_label[] = "_convert_label"; +static const char __pyx_k_init_subclass[] = "__init_subclass__"; +static const char __pyx_k_is_normalized[] = "_is_normalized"; +static const char __pyx_k_AssertionError[] = "AssertionError"; +static const char __pyx_k_validate_label[] = "_validate_label"; +static const char __pyx_k_Dict_str__Entry[] = "Dict[str, _Entry]"; +static const char __pyx_k_is_normalized_2[] = "is_normalized"; +static const char __pyx_k_Entry_from_match[] = "_Entry.from_match"; +static const char __pyx_k_from_domain_name[] = " from domain name "; +static const char __pyx_k_w3lib__utr46_pyx[] = "w3lib/_utr46.pyx"; +static const char __pyx_k_Domain_name_label[] = "Domain name label "; +static const char __pyx_k_verify_dns_length[] = "verify_dns_length"; +static const char __pyx_k_IDNA_MAPPING_TABLE[] = "_IDNA_MAPPING_TABLE"; +static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_The_length_of_label[] = "The length of label "; +static const char __pyx_k_is_bidi_domain_name[] = "_is_bidi_domain_name"; +static const char __pyx_k_check_contextj_rules[] = "_check_contextj_rules"; +static const char __pyx_k_use_std3_ascii_rules[] = "use_std3_ascii_rules"; +static const char __pyx_k_DISALLOWED_STD3_VALID[] = "DISALLOWED_STD3_VALID"; +static const char __pyx_k_disallowed_STD3_valid[] = "disallowed_STD3_valid"; +static const char __pyx_k_DISALLOWED_STD3_MAPPED[] = "DISALLOWED_STD3_MAPPED"; +static const char __pyx_k_disallowed_STD3_mapped[] = "disallowed_STD3_mapped"; +static const char __pyx_k_contains_a_code_point_U[] = " contains a code point, U+"; +static const char __pyx_k_load_idna_mapping_table[] = "_load_idna_mapping_table"; +static const char __pyx_k_starts_with_a_character[] = " starts with a character ("; +static const char __pyx_k_transitional_processing[] = "transitional_processing"; +static const char __pyx_k_The_length_of_domain_name[] = "The length of domain name "; +static const char __pyx_k_It_should_be_between_1_and_253[] = ". It should be between 1 and 253. Pass verify_dns_length=False to avoid this check."; +static const char __pyx_k_contains_disallowed_code_point[] = " contains disallowed code point U+"; +static const char __pyx_k_x_P_id_0_9A_F_4_6_P_start_0_9A[] = "(?x)\n ^\n (?:\n (?P[0-9A-F]{4,6})\n |(?P[0-9A-F]{4,6})\\.\\.(?P[0-9A-F]{4,6})\n )\n \\s*;\\s*\n (?P\n disallowed(?:_STD3_(?:mapped|valid))?\n |ignored\n |mapped\n |deviation\n |valid\n )\n (?:\n \\s*;\\s*\n (?P\n [0-9A-F]{4,6}\n (\\s[0-9A-F]{4,6})*\n )\n )?\n "; +static const char __pyx_k_Entry_from_match_locals_genexpr[] = "_Entry.from_match..genexpr"; +static const char __pyx_k_It_should_be_between_1_and_63_P[] = ". It should be between 1 and 63. Pass verify_dns_length=False to avoid this check."; +static const char __pyx_k_contains_an_unrecognized_code_p[] = " contains an unrecognized code point: U+"; +static const char __pyx_k_contains_in_its_3rd_and_4rd_pos[] = " contains '-' in its 3rd and 4rd positions."; +static const char __pyx_k_does_not_match_the_expected_pat[] = " does not match the expected pattern."; +static const char __pyx_k_excluding_the_root_label_and_it[] = ", excluding the root label and its dot, is "; +static const char __pyx_k_in_the_Mark_general_category_fr[] = ") in the Mark general category from the Unicode Character Database."; +static const char __pyx_k_is_bidi_domain_name_locals_gene[] = "_is_bidi_domain_name..genexpr"; +static const char __pyx_k_is_not_in_Unicode_Normalization[] = " is not in Unicode Normalization Form NFC."; +static const char __pyx_k_which_is_neither_valid_nor_a_de[] = "), which is neither valid nor a deviation."; +static const char __pyx_k_Unknown_IDNA_mapping_table_statu[] = "Unknown IDNA mapping table status value found: "; +/* #### Code section: decls ### */ +static PyObject *__pyx_pf_5w3lib_6_utr46__is_normalized(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_form, PyObject *__pyx_v_unistr); /* proto */ +static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_10from_match_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_from_match(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_match); /* proto */ +static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_2__init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mapping, PyObject *__pyx_v_status); /* proto */ +static PyObject *__pyx_pf_5w3lib_6_utr46_2_load_idna_mapping_table(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label, PyObject *__pyx_v_check_hyphens, PyObject *__pyx_v_check_joiners, PyObject *__pyx_v_check_bidi, PyObject *__pyx_v_transitional_processing, PyObject *__pyx_v_use_std3_ascii_rules); /* proto */ +static PyObject *__pyx_pf_5w3lib_6_utr46_20_is_bidi_domain_name_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_5w3lib_6_utr46_6_is_bidi_domain_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain_name); /* proto */ +static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain_name, PyObject *__pyx_v_use_std3_ascii_rules, PyObject *__pyx_v_check_hyphens, PyObject *__pyx_v_check_bidi, PyObject *__pyx_v_check_joiners, PyObject *__pyx_v_transitional_processing); /* proto */ +static PyObject *__pyx_pf_5w3lib_6_utr46_10_convert_label(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label); /* proto */ +static PyObject *__pyx_pf_5w3lib_6_utr46_12_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain_name, PyObject *__pyx_v_check_hyphens, PyObject *__pyx_v_check_bidi, PyObject *__pyx_v_check_joiners, PyObject *__pyx_v_use_std3_ascii_rules, PyObject *__pyx_v_transitional_processing, PyObject *__pyx_v_verify_dns_length); /* proto */ +static PyObject *__pyx_tp_new_5w3lib_6_utr46___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_5w3lib_6_utr46___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_isascii = {0, 0, 0, 0, 0}; +static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_rstrip = {0, 0, 0, 0, 0}; +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + PyObject *__pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr; + PyObject *__pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr; + #endif + PyTypeObject *__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr; + PyTypeObject *__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr; + PyObject *__pyx_kp_u_; + PyObject *__pyx_kp_u_04X; + PyObject *__pyx_n_u_AL; + PyObject *__pyx_n_u_AN; + PyObject *__pyx_n_s_AssertionError; + PyObject *__pyx_n_s_DEVIATION; + PyObject *__pyx_n_s_DISALLOWED; + PyObject *__pyx_n_s_DISALLOWED_STD3_MAPPED; + PyObject *__pyx_n_s_DISALLOWED_STD3_VALID; + PyObject *__pyx_n_s_Dict; + PyObject *__pyx_kp_s_Dict_str__Entry; + PyObject *__pyx_kp_u_Domain_name; + PyObject *__pyx_kp_u_Domain_name_label; + PyObject *__pyx_n_s_Entry; + PyObject *__pyx_kp_s_Entry_2; + PyObject *__pyx_n_s_Entry___init; + PyObject *__pyx_n_s_Entry_from_match; + PyObject *__pyx_n_s_Entry_from_match_locals_genexpr; + PyObject *__pyx_n_s_Enum; + PyObject *__pyx_n_s_IDNA_MAPPING_TABLE; + PyObject *__pyx_n_s_IGNORED; + PyObject *__pyx_kp_u_It_should_be_between_1_and_253; + PyObject *__pyx_kp_u_It_should_be_between_1_and_63_P; + PyObject *__pyx_kp_u_Line; + PyObject *__pyx_n_u_M; + PyObject *__pyx_n_s_MAPPED; + PyObject *__pyx_n_s_Match; + PyObject *__pyx_n_u_NFC; + PyObject *__pyx_n_s_None; + PyObject *__pyx_n_s_Optional; + PyObject *__pyx_kp_s_Optional_str; + PyObject *__pyx_n_s_Path; + PyObject *__pyx_n_u_R; + PyObject *__pyx_n_s_Status; + PyObject *__pyx_kp_u_The_length_of_domain_name; + PyObject *__pyx_kp_u_The_length_of_label; + PyObject *__pyx_n_s_Type; + PyObject *__pyx_kp_s_Type__Entry; + PyObject *__pyx_kp_u_Unknown_IDNA_mapping_table_statu; + PyObject *__pyx_n_s_VALID; + PyObject *__pyx_n_s_ValueError; + PyObject *__pyx_n_s__11; + PyObject *__pyx_kp_u__2; + PyObject *__pyx_kp_u__3; + PyObject *__pyx_n_s__30; + PyObject *__pyx_kp_u__5; + PyObject *__pyx_kp_u__6; + PyObject *__pyx_kp_u__7; + PyObject *__pyx_kp_u__8; + PyObject *__pyx_kp_u__9; + PyObject *__pyx_n_s_args; + PyObject *__pyx_n_s_asyncio_coroutines; + PyObject *__pyx_n_s_auto; + PyObject *__pyx_n_s_base; + PyObject *__pyx_n_s_bidirectional; + PyObject *__pyx_n_s_bool; + PyObject *__pyx_n_s_category; + PyObject *__pyx_n_s_check_bidi; + PyObject *__pyx_n_s_check_bidi_2; + PyObject *__pyx_n_s_check_contextj_rules; + PyObject *__pyx_n_s_check_hyphens; + PyObject *__pyx_n_s_check_joiners; + PyObject *__pyx_n_s_chr; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_close; + PyObject *__pyx_n_s_cls; + PyObject *__pyx_n_s_code_point; + PyObject *__pyx_kp_u_contains_a; + PyObject *__pyx_kp_u_contains_a_code_point_U; + PyObject *__pyx_kp_u_contains_an_unrecognized_code_p; + PyObject *__pyx_kp_u_contains_disallowed_code_point; + PyObject *__pyx_kp_u_contains_in_its_3rd_and_4rd_pos; + PyObject *__pyx_n_s_convert_label; + PyObject *__pyx_n_s_decode; + PyObject *__pyx_n_u_deviation; + PyObject *__pyx_n_s_dict; + PyObject *__pyx_kp_u_disable; + PyObject *__pyx_n_u_disallowed; + PyObject *__pyx_n_u_disallowed_STD3_mapped; + PyObject *__pyx_n_u_disallowed_STD3_valid; + PyObject *__pyx_n_s_doc; + PyObject *__pyx_kp_u_does_not_match_the_expected_pat; + PyObject *__pyx_n_s_domain_name; + PyObject *__pyx_kp_u_enable; + PyObject *__pyx_n_s_encode; + PyObject *__pyx_n_s_encoding; + PyObject *__pyx_n_s_end; + PyObject *__pyx_n_u_end; + PyObject *__pyx_kp_u_ends_with; + PyObject *__pyx_n_s_enter; + PyObject *__pyx_n_s_entry; + PyObject *__pyx_n_s_enum; + PyObject *__pyx_n_s_enumerate; + PyObject *__pyx_kp_u_excluding_the_root_label_and_it; + PyObject *__pyx_n_s_exit; + PyObject *__pyx_n_s_file; + PyObject *__pyx_n_s_file_name; + PyObject *__pyx_n_s_form; + PyObject *__pyx_kp_u_from; + PyObject *__pyx_kp_u_from_domain_name; + PyObject *__pyx_n_s_from_match; + PyObject *__pyx_kp_u_gc; + PyObject *__pyx_n_s_genexpr; + PyObject *__pyx_n_s_get; + PyObject *__pyx_n_s_i; + PyObject *__pyx_n_s_id; + PyObject *__pyx_n_u_id; + PyObject *__pyx_n_s_idna; + PyObject *__pyx_kp_u_idna_txt; + PyObject *__pyx_n_u_ignored; + PyObject *__pyx_n_s_import; + PyObject *__pyx_kp_u_in_the_Mark_general_category_fr; + PyObject *__pyx_n_s_init; + PyObject *__pyx_n_s_init_subclass; + PyObject *__pyx_n_s_initializing; + PyObject *__pyx_n_s_input; + PyObject *__pyx_kp_u_is; + PyObject *__pyx_n_s_is_bidi_domain_name; + PyObject *__pyx_n_s_is_bidi_domain_name_locals_gene; + PyObject *__pyx_n_s_is_coroutine; + PyObject *__pyx_n_s_is_normalized; + PyObject *__pyx_n_s_is_normalized_2; + PyObject *__pyx_n_u_is_normalized_2; + PyObject *__pyx_kp_u_is_not_in_Unicode_Normalization; + PyObject *__pyx_n_s_isascii; + PyObject *__pyx_kp_u_isenabled; + PyObject *__pyx_n_s_label; + PyObject *__pyx_n_s_labels; + PyObject *__pyx_n_s_length; + PyObject *__pyx_n_s_line; + PyObject *__pyx_n_s_load_idna_mapping_table; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_u_mapped; + PyObject *__pyx_n_s_mapping; + PyObject *__pyx_n_u_mapping; + PyObject *__pyx_n_s_match; + PyObject *__pyx_n_s_metaclass; + PyObject *__pyx_n_s_module; + PyObject *__pyx_n_s_mro_entries; + PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_new_label; + PyObject *__pyx_n_s_normalize; + PyObject *__pyx_n_s_open; + PyObject *__pyx_n_s_parent; + PyObject *__pyx_n_s_pathlib; + PyObject *__pyx_n_s_pattern; + PyObject *__pyx_n_s_prepare; + PyObject *__pyx_n_s_process; + PyObject *__pyx_n_u_punycode; + PyObject *__pyx_n_s_qualname; + PyObject *__pyx_n_s_range; + PyObject *__pyx_n_s_re; + PyObject *__pyx_n_s_return; + PyObject *__pyx_n_s_rfc5892; + PyObject *__pyx_n_s_rstrip; + PyObject *__pyx_n_s_search; + PyObject *__pyx_n_s_self; + PyObject *__pyx_n_s_send; + PyObject *__pyx_n_s_set_name; + PyObject *__pyx_n_s_spec; + PyObject *__pyx_n_s_split; + PyObject *__pyx_n_s_start; + PyObject *__pyx_n_u_start; + PyObject *__pyx_kp_u_starts_with; + PyObject *__pyx_kp_u_starts_with_a_character; + PyObject *__pyx_n_s_startswith; + PyObject *__pyx_n_s_status; + PyObject *__pyx_n_u_status; + PyObject *__pyx_n_s_str; + PyObject *__pyx_n_s_strip; + PyObject *__pyx_n_s_super; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_throw; + PyObject *__pyx_n_s_to_ascii; + PyObject *__pyx_n_s_transitional_processing; + PyObject *__pyx_n_s_typing; + PyObject *__pyx_n_s_unicodedata; + PyObject *__pyx_n_s_unistr; + PyObject *__pyx_n_s_use_std3_ascii_rules; + PyObject *__pyx_kp_u_utf_8; + PyObject *__pyx_n_u_valid; + PyObject *__pyx_n_s_validate_label; + PyObject *__pyx_n_s_verify_dns_length; + PyObject *__pyx_n_s_w3lib__utr46; + PyObject *__pyx_kp_s_w3lib__utr46_pyx; + PyObject *__pyx_kp_u_which_is_neither_valid_nor_a_de; + PyObject *__pyx_kp_u_x_P_id_0_9A_F_4_6_P_start_0_9A; + PyObject *__pyx_kp_u_xn; + PyObject *__pyx_int_0; + PyObject *__pyx_int_1; + PyObject *__pyx_int_4; + PyObject *__pyx_int_16; + PyObject *__pyx_tuple__4; + PyObject *__pyx_slice__10; + PyObject *__pyx_tuple__12; + PyObject *__pyx_tuple__14; + PyObject *__pyx_tuple__16; + PyObject *__pyx_tuple__18; + PyObject *__pyx_tuple__20; + PyObject *__pyx_tuple__22; + PyObject *__pyx_tuple__24; + PyObject *__pyx_tuple__26; + PyObject *__pyx_tuple__28; + PyObject *__pyx_codeobj__13; + PyObject *__pyx_codeobj__15; + PyObject *__pyx_codeobj__17; + PyObject *__pyx_codeobj__19; + PyObject *__pyx_codeobj__21; + PyObject *__pyx_codeobj__23; + PyObject *__pyx_codeobj__25; + PyObject *__pyx_codeobj__27; + PyObject *__pyx_codeobj__29; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr); + Py_CLEAR(clear_module_state->__pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr); + Py_CLEAR(clear_module_state->__pyx_kp_u_); + Py_CLEAR(clear_module_state->__pyx_kp_u_04X); + Py_CLEAR(clear_module_state->__pyx_n_u_AL); + Py_CLEAR(clear_module_state->__pyx_n_u_AN); + Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); + Py_CLEAR(clear_module_state->__pyx_n_s_DEVIATION); + Py_CLEAR(clear_module_state->__pyx_n_s_DISALLOWED); + Py_CLEAR(clear_module_state->__pyx_n_s_DISALLOWED_STD3_MAPPED); + Py_CLEAR(clear_module_state->__pyx_n_s_DISALLOWED_STD3_VALID); + Py_CLEAR(clear_module_state->__pyx_n_s_Dict); + Py_CLEAR(clear_module_state->__pyx_kp_s_Dict_str__Entry); + Py_CLEAR(clear_module_state->__pyx_kp_u_Domain_name); + Py_CLEAR(clear_module_state->__pyx_kp_u_Domain_name_label); + Py_CLEAR(clear_module_state->__pyx_n_s_Entry); + Py_CLEAR(clear_module_state->__pyx_kp_s_Entry_2); + Py_CLEAR(clear_module_state->__pyx_n_s_Entry___init); + Py_CLEAR(clear_module_state->__pyx_n_s_Entry_from_match); + Py_CLEAR(clear_module_state->__pyx_n_s_Entry_from_match_locals_genexpr); + Py_CLEAR(clear_module_state->__pyx_n_s_Enum); + Py_CLEAR(clear_module_state->__pyx_n_s_IDNA_MAPPING_TABLE); + Py_CLEAR(clear_module_state->__pyx_n_s_IGNORED); + Py_CLEAR(clear_module_state->__pyx_kp_u_It_should_be_between_1_and_253); + Py_CLEAR(clear_module_state->__pyx_kp_u_It_should_be_between_1_and_63_P); + Py_CLEAR(clear_module_state->__pyx_kp_u_Line); + Py_CLEAR(clear_module_state->__pyx_n_u_M); + Py_CLEAR(clear_module_state->__pyx_n_s_MAPPED); + Py_CLEAR(clear_module_state->__pyx_n_s_Match); + Py_CLEAR(clear_module_state->__pyx_n_u_NFC); + Py_CLEAR(clear_module_state->__pyx_n_s_None); + Py_CLEAR(clear_module_state->__pyx_n_s_Optional); + Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_str); + Py_CLEAR(clear_module_state->__pyx_n_s_Path); + Py_CLEAR(clear_module_state->__pyx_n_u_R); + Py_CLEAR(clear_module_state->__pyx_n_s_Status); + Py_CLEAR(clear_module_state->__pyx_kp_u_The_length_of_domain_name); + Py_CLEAR(clear_module_state->__pyx_kp_u_The_length_of_label); + Py_CLEAR(clear_module_state->__pyx_n_s_Type); + Py_CLEAR(clear_module_state->__pyx_kp_s_Type__Entry); + Py_CLEAR(clear_module_state->__pyx_kp_u_Unknown_IDNA_mapping_table_statu); + Py_CLEAR(clear_module_state->__pyx_n_s_VALID); + Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); + Py_CLEAR(clear_module_state->__pyx_n_s__11); + Py_CLEAR(clear_module_state->__pyx_kp_u__2); + Py_CLEAR(clear_module_state->__pyx_kp_u__3); + Py_CLEAR(clear_module_state->__pyx_n_s__30); + Py_CLEAR(clear_module_state->__pyx_kp_u__5); + Py_CLEAR(clear_module_state->__pyx_kp_u__6); + Py_CLEAR(clear_module_state->__pyx_kp_u__7); + Py_CLEAR(clear_module_state->__pyx_kp_u__8); + Py_CLEAR(clear_module_state->__pyx_kp_u__9); + Py_CLEAR(clear_module_state->__pyx_n_s_args); + Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); + Py_CLEAR(clear_module_state->__pyx_n_s_auto); + Py_CLEAR(clear_module_state->__pyx_n_s_base); + Py_CLEAR(clear_module_state->__pyx_n_s_bidirectional); + Py_CLEAR(clear_module_state->__pyx_n_s_bool); + Py_CLEAR(clear_module_state->__pyx_n_s_category); + Py_CLEAR(clear_module_state->__pyx_n_s_check_bidi); + Py_CLEAR(clear_module_state->__pyx_n_s_check_bidi_2); + Py_CLEAR(clear_module_state->__pyx_n_s_check_contextj_rules); + Py_CLEAR(clear_module_state->__pyx_n_s_check_hyphens); + Py_CLEAR(clear_module_state->__pyx_n_s_check_joiners); + Py_CLEAR(clear_module_state->__pyx_n_s_chr); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_close); + Py_CLEAR(clear_module_state->__pyx_n_s_cls); + Py_CLEAR(clear_module_state->__pyx_n_s_code_point); + Py_CLEAR(clear_module_state->__pyx_kp_u_contains_a); + Py_CLEAR(clear_module_state->__pyx_kp_u_contains_a_code_point_U); + Py_CLEAR(clear_module_state->__pyx_kp_u_contains_an_unrecognized_code_p); + Py_CLEAR(clear_module_state->__pyx_kp_u_contains_disallowed_code_point); + Py_CLEAR(clear_module_state->__pyx_kp_u_contains_in_its_3rd_and_4rd_pos); + Py_CLEAR(clear_module_state->__pyx_n_s_convert_label); + Py_CLEAR(clear_module_state->__pyx_n_s_decode); + Py_CLEAR(clear_module_state->__pyx_n_u_deviation); + Py_CLEAR(clear_module_state->__pyx_n_s_dict); + Py_CLEAR(clear_module_state->__pyx_kp_u_disable); + Py_CLEAR(clear_module_state->__pyx_n_u_disallowed); + Py_CLEAR(clear_module_state->__pyx_n_u_disallowed_STD3_mapped); + Py_CLEAR(clear_module_state->__pyx_n_u_disallowed_STD3_valid); + Py_CLEAR(clear_module_state->__pyx_n_s_doc); + Py_CLEAR(clear_module_state->__pyx_kp_u_does_not_match_the_expected_pat); + Py_CLEAR(clear_module_state->__pyx_n_s_domain_name); + Py_CLEAR(clear_module_state->__pyx_kp_u_enable); + Py_CLEAR(clear_module_state->__pyx_n_s_encode); + Py_CLEAR(clear_module_state->__pyx_n_s_encoding); + Py_CLEAR(clear_module_state->__pyx_n_s_end); + Py_CLEAR(clear_module_state->__pyx_n_u_end); + Py_CLEAR(clear_module_state->__pyx_kp_u_ends_with); + Py_CLEAR(clear_module_state->__pyx_n_s_enter); + Py_CLEAR(clear_module_state->__pyx_n_s_entry); + Py_CLEAR(clear_module_state->__pyx_n_s_enum); + Py_CLEAR(clear_module_state->__pyx_n_s_enumerate); + Py_CLEAR(clear_module_state->__pyx_kp_u_excluding_the_root_label_and_it); + Py_CLEAR(clear_module_state->__pyx_n_s_exit); + Py_CLEAR(clear_module_state->__pyx_n_s_file); + Py_CLEAR(clear_module_state->__pyx_n_s_file_name); + Py_CLEAR(clear_module_state->__pyx_n_s_form); + Py_CLEAR(clear_module_state->__pyx_kp_u_from); + Py_CLEAR(clear_module_state->__pyx_kp_u_from_domain_name); + Py_CLEAR(clear_module_state->__pyx_n_s_from_match); + Py_CLEAR(clear_module_state->__pyx_kp_u_gc); + Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); + Py_CLEAR(clear_module_state->__pyx_n_s_get); + Py_CLEAR(clear_module_state->__pyx_n_s_i); + Py_CLEAR(clear_module_state->__pyx_n_s_id); + Py_CLEAR(clear_module_state->__pyx_n_u_id); + Py_CLEAR(clear_module_state->__pyx_n_s_idna); + Py_CLEAR(clear_module_state->__pyx_kp_u_idna_txt); + Py_CLEAR(clear_module_state->__pyx_n_u_ignored); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_kp_u_in_the_Mark_general_category_fr); + Py_CLEAR(clear_module_state->__pyx_n_s_init); + Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); + Py_CLEAR(clear_module_state->__pyx_n_s_initializing); + Py_CLEAR(clear_module_state->__pyx_n_s_input); + Py_CLEAR(clear_module_state->__pyx_kp_u_is); + Py_CLEAR(clear_module_state->__pyx_n_s_is_bidi_domain_name); + Py_CLEAR(clear_module_state->__pyx_n_s_is_bidi_domain_name_locals_gene); + Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); + Py_CLEAR(clear_module_state->__pyx_n_s_is_normalized); + Py_CLEAR(clear_module_state->__pyx_n_s_is_normalized_2); + Py_CLEAR(clear_module_state->__pyx_n_u_is_normalized_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_is_not_in_Unicode_Normalization); + Py_CLEAR(clear_module_state->__pyx_n_s_isascii); + Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); + Py_CLEAR(clear_module_state->__pyx_n_s_label); + Py_CLEAR(clear_module_state->__pyx_n_s_labels); + Py_CLEAR(clear_module_state->__pyx_n_s_length); + Py_CLEAR(clear_module_state->__pyx_n_s_line); + Py_CLEAR(clear_module_state->__pyx_n_s_load_idna_mapping_table); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_u_mapped); + Py_CLEAR(clear_module_state->__pyx_n_s_mapping); + Py_CLEAR(clear_module_state->__pyx_n_u_mapping); + Py_CLEAR(clear_module_state->__pyx_n_s_match); + Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); + Py_CLEAR(clear_module_state->__pyx_n_s_module); + Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_new_label); + Py_CLEAR(clear_module_state->__pyx_n_s_normalize); + Py_CLEAR(clear_module_state->__pyx_n_s_open); + Py_CLEAR(clear_module_state->__pyx_n_s_parent); + Py_CLEAR(clear_module_state->__pyx_n_s_pathlib); + Py_CLEAR(clear_module_state->__pyx_n_s_pattern); + Py_CLEAR(clear_module_state->__pyx_n_s_prepare); + Py_CLEAR(clear_module_state->__pyx_n_s_process); + Py_CLEAR(clear_module_state->__pyx_n_u_punycode); + Py_CLEAR(clear_module_state->__pyx_n_s_qualname); + Py_CLEAR(clear_module_state->__pyx_n_s_range); + Py_CLEAR(clear_module_state->__pyx_n_s_re); + Py_CLEAR(clear_module_state->__pyx_n_s_return); + Py_CLEAR(clear_module_state->__pyx_n_s_rfc5892); + Py_CLEAR(clear_module_state->__pyx_n_s_rstrip); + Py_CLEAR(clear_module_state->__pyx_n_s_search); + Py_CLEAR(clear_module_state->__pyx_n_s_self); + Py_CLEAR(clear_module_state->__pyx_n_s_send); + Py_CLEAR(clear_module_state->__pyx_n_s_set_name); + Py_CLEAR(clear_module_state->__pyx_n_s_spec); + Py_CLEAR(clear_module_state->__pyx_n_s_split); + Py_CLEAR(clear_module_state->__pyx_n_s_start); + Py_CLEAR(clear_module_state->__pyx_n_u_start); + Py_CLEAR(clear_module_state->__pyx_kp_u_starts_with); + Py_CLEAR(clear_module_state->__pyx_kp_u_starts_with_a_character); + Py_CLEAR(clear_module_state->__pyx_n_s_startswith); + Py_CLEAR(clear_module_state->__pyx_n_s_status); + Py_CLEAR(clear_module_state->__pyx_n_u_status); + Py_CLEAR(clear_module_state->__pyx_n_s_str); + Py_CLEAR(clear_module_state->__pyx_n_s_strip); + Py_CLEAR(clear_module_state->__pyx_n_s_super); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_throw); + Py_CLEAR(clear_module_state->__pyx_n_s_to_ascii); + Py_CLEAR(clear_module_state->__pyx_n_s_transitional_processing); + Py_CLEAR(clear_module_state->__pyx_n_s_typing); + Py_CLEAR(clear_module_state->__pyx_n_s_unicodedata); + Py_CLEAR(clear_module_state->__pyx_n_s_unistr); + Py_CLEAR(clear_module_state->__pyx_n_s_use_std3_ascii_rules); + Py_CLEAR(clear_module_state->__pyx_kp_u_utf_8); + Py_CLEAR(clear_module_state->__pyx_n_u_valid); + Py_CLEAR(clear_module_state->__pyx_n_s_validate_label); + Py_CLEAR(clear_module_state->__pyx_n_s_verify_dns_length); + Py_CLEAR(clear_module_state->__pyx_n_s_w3lib__utr46); + Py_CLEAR(clear_module_state->__pyx_kp_s_w3lib__utr46_pyx); + Py_CLEAR(clear_module_state->__pyx_kp_u_which_is_neither_valid_nor_a_de); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_P_id_0_9A_F_4_6_P_start_0_9A); + Py_CLEAR(clear_module_state->__pyx_kp_u_xn); + Py_CLEAR(clear_module_state->__pyx_int_0); + Py_CLEAR(clear_module_state->__pyx_int_1); + Py_CLEAR(clear_module_state->__pyx_int_4); + Py_CLEAR(clear_module_state->__pyx_int_16); + Py_CLEAR(clear_module_state->__pyx_tuple__4); + Py_CLEAR(clear_module_state->__pyx_slice__10); + Py_CLEAR(clear_module_state->__pyx_tuple__12); + Py_CLEAR(clear_module_state->__pyx_tuple__14); + Py_CLEAR(clear_module_state->__pyx_tuple__16); + Py_CLEAR(clear_module_state->__pyx_tuple__18); + Py_CLEAR(clear_module_state->__pyx_tuple__20); + Py_CLEAR(clear_module_state->__pyx_tuple__22); + Py_CLEAR(clear_module_state->__pyx_tuple__24); + Py_CLEAR(clear_module_state->__pyx_tuple__26); + Py_CLEAR(clear_module_state->__pyx_tuple__28); + Py_CLEAR(clear_module_state->__pyx_codeobj__13); + Py_CLEAR(clear_module_state->__pyx_codeobj__15); + Py_CLEAR(clear_module_state->__pyx_codeobj__17); + Py_CLEAR(clear_module_state->__pyx_codeobj__19); + Py_CLEAR(clear_module_state->__pyx_codeobj__21); + Py_CLEAR(clear_module_state->__pyx_codeobj__23); + Py_CLEAR(clear_module_state->__pyx_codeobj__25); + Py_CLEAR(clear_module_state->__pyx_codeobj__27); + Py_CLEAR(clear_module_state->__pyx_codeobj__29); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr); + Py_VISIT(traverse_module_state->__pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr); + Py_VISIT(traverse_module_state->__pyx_kp_u_); + Py_VISIT(traverse_module_state->__pyx_kp_u_04X); + Py_VISIT(traverse_module_state->__pyx_n_u_AL); + Py_VISIT(traverse_module_state->__pyx_n_u_AN); + Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); + Py_VISIT(traverse_module_state->__pyx_n_s_DEVIATION); + Py_VISIT(traverse_module_state->__pyx_n_s_DISALLOWED); + Py_VISIT(traverse_module_state->__pyx_n_s_DISALLOWED_STD3_MAPPED); + Py_VISIT(traverse_module_state->__pyx_n_s_DISALLOWED_STD3_VALID); + Py_VISIT(traverse_module_state->__pyx_n_s_Dict); + Py_VISIT(traverse_module_state->__pyx_kp_s_Dict_str__Entry); + Py_VISIT(traverse_module_state->__pyx_kp_u_Domain_name); + Py_VISIT(traverse_module_state->__pyx_kp_u_Domain_name_label); + Py_VISIT(traverse_module_state->__pyx_n_s_Entry); + Py_VISIT(traverse_module_state->__pyx_kp_s_Entry_2); + Py_VISIT(traverse_module_state->__pyx_n_s_Entry___init); + Py_VISIT(traverse_module_state->__pyx_n_s_Entry_from_match); + Py_VISIT(traverse_module_state->__pyx_n_s_Entry_from_match_locals_genexpr); + Py_VISIT(traverse_module_state->__pyx_n_s_Enum); + Py_VISIT(traverse_module_state->__pyx_n_s_IDNA_MAPPING_TABLE); + Py_VISIT(traverse_module_state->__pyx_n_s_IGNORED); + Py_VISIT(traverse_module_state->__pyx_kp_u_It_should_be_between_1_and_253); + Py_VISIT(traverse_module_state->__pyx_kp_u_It_should_be_between_1_and_63_P); + Py_VISIT(traverse_module_state->__pyx_kp_u_Line); + Py_VISIT(traverse_module_state->__pyx_n_u_M); + Py_VISIT(traverse_module_state->__pyx_n_s_MAPPED); + Py_VISIT(traverse_module_state->__pyx_n_s_Match); + Py_VISIT(traverse_module_state->__pyx_n_u_NFC); + Py_VISIT(traverse_module_state->__pyx_n_s_None); + Py_VISIT(traverse_module_state->__pyx_n_s_Optional); + Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_str); + Py_VISIT(traverse_module_state->__pyx_n_s_Path); + Py_VISIT(traverse_module_state->__pyx_n_u_R); + Py_VISIT(traverse_module_state->__pyx_n_s_Status); + Py_VISIT(traverse_module_state->__pyx_kp_u_The_length_of_domain_name); + Py_VISIT(traverse_module_state->__pyx_kp_u_The_length_of_label); + Py_VISIT(traverse_module_state->__pyx_n_s_Type); + Py_VISIT(traverse_module_state->__pyx_kp_s_Type__Entry); + Py_VISIT(traverse_module_state->__pyx_kp_u_Unknown_IDNA_mapping_table_statu); + Py_VISIT(traverse_module_state->__pyx_n_s_VALID); + Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); + Py_VISIT(traverse_module_state->__pyx_n_s__11); + Py_VISIT(traverse_module_state->__pyx_kp_u__2); + Py_VISIT(traverse_module_state->__pyx_kp_u__3); + Py_VISIT(traverse_module_state->__pyx_n_s__30); + Py_VISIT(traverse_module_state->__pyx_kp_u__5); + Py_VISIT(traverse_module_state->__pyx_kp_u__6); + Py_VISIT(traverse_module_state->__pyx_kp_u__7); + Py_VISIT(traverse_module_state->__pyx_kp_u__8); + Py_VISIT(traverse_module_state->__pyx_kp_u__9); + Py_VISIT(traverse_module_state->__pyx_n_s_args); + Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); + Py_VISIT(traverse_module_state->__pyx_n_s_auto); + Py_VISIT(traverse_module_state->__pyx_n_s_base); + Py_VISIT(traverse_module_state->__pyx_n_s_bidirectional); + Py_VISIT(traverse_module_state->__pyx_n_s_bool); + Py_VISIT(traverse_module_state->__pyx_n_s_category); + Py_VISIT(traverse_module_state->__pyx_n_s_check_bidi); + Py_VISIT(traverse_module_state->__pyx_n_s_check_bidi_2); + Py_VISIT(traverse_module_state->__pyx_n_s_check_contextj_rules); + Py_VISIT(traverse_module_state->__pyx_n_s_check_hyphens); + Py_VISIT(traverse_module_state->__pyx_n_s_check_joiners); + Py_VISIT(traverse_module_state->__pyx_n_s_chr); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_close); + Py_VISIT(traverse_module_state->__pyx_n_s_cls); + Py_VISIT(traverse_module_state->__pyx_n_s_code_point); + Py_VISIT(traverse_module_state->__pyx_kp_u_contains_a); + Py_VISIT(traverse_module_state->__pyx_kp_u_contains_a_code_point_U); + Py_VISIT(traverse_module_state->__pyx_kp_u_contains_an_unrecognized_code_p); + Py_VISIT(traverse_module_state->__pyx_kp_u_contains_disallowed_code_point); + Py_VISIT(traverse_module_state->__pyx_kp_u_contains_in_its_3rd_and_4rd_pos); + Py_VISIT(traverse_module_state->__pyx_n_s_convert_label); + Py_VISIT(traverse_module_state->__pyx_n_s_decode); + Py_VISIT(traverse_module_state->__pyx_n_u_deviation); + Py_VISIT(traverse_module_state->__pyx_n_s_dict); + Py_VISIT(traverse_module_state->__pyx_kp_u_disable); + Py_VISIT(traverse_module_state->__pyx_n_u_disallowed); + Py_VISIT(traverse_module_state->__pyx_n_u_disallowed_STD3_mapped); + Py_VISIT(traverse_module_state->__pyx_n_u_disallowed_STD3_valid); + Py_VISIT(traverse_module_state->__pyx_n_s_doc); + Py_VISIT(traverse_module_state->__pyx_kp_u_does_not_match_the_expected_pat); + Py_VISIT(traverse_module_state->__pyx_n_s_domain_name); + Py_VISIT(traverse_module_state->__pyx_kp_u_enable); + Py_VISIT(traverse_module_state->__pyx_n_s_encode); + Py_VISIT(traverse_module_state->__pyx_n_s_encoding); + Py_VISIT(traverse_module_state->__pyx_n_s_end); + Py_VISIT(traverse_module_state->__pyx_n_u_end); + Py_VISIT(traverse_module_state->__pyx_kp_u_ends_with); + Py_VISIT(traverse_module_state->__pyx_n_s_enter); + Py_VISIT(traverse_module_state->__pyx_n_s_entry); + Py_VISIT(traverse_module_state->__pyx_n_s_enum); + Py_VISIT(traverse_module_state->__pyx_n_s_enumerate); + Py_VISIT(traverse_module_state->__pyx_kp_u_excluding_the_root_label_and_it); + Py_VISIT(traverse_module_state->__pyx_n_s_exit); + Py_VISIT(traverse_module_state->__pyx_n_s_file); + Py_VISIT(traverse_module_state->__pyx_n_s_file_name); + Py_VISIT(traverse_module_state->__pyx_n_s_form); + Py_VISIT(traverse_module_state->__pyx_kp_u_from); + Py_VISIT(traverse_module_state->__pyx_kp_u_from_domain_name); + Py_VISIT(traverse_module_state->__pyx_n_s_from_match); + Py_VISIT(traverse_module_state->__pyx_kp_u_gc); + Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); + Py_VISIT(traverse_module_state->__pyx_n_s_get); + Py_VISIT(traverse_module_state->__pyx_n_s_i); + Py_VISIT(traverse_module_state->__pyx_n_s_id); + Py_VISIT(traverse_module_state->__pyx_n_u_id); + Py_VISIT(traverse_module_state->__pyx_n_s_idna); + Py_VISIT(traverse_module_state->__pyx_kp_u_idna_txt); + Py_VISIT(traverse_module_state->__pyx_n_u_ignored); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_kp_u_in_the_Mark_general_category_fr); + Py_VISIT(traverse_module_state->__pyx_n_s_init); + Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); + Py_VISIT(traverse_module_state->__pyx_n_s_initializing); + Py_VISIT(traverse_module_state->__pyx_n_s_input); + Py_VISIT(traverse_module_state->__pyx_kp_u_is); + Py_VISIT(traverse_module_state->__pyx_n_s_is_bidi_domain_name); + Py_VISIT(traverse_module_state->__pyx_n_s_is_bidi_domain_name_locals_gene); + Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); + Py_VISIT(traverse_module_state->__pyx_n_s_is_normalized); + Py_VISIT(traverse_module_state->__pyx_n_s_is_normalized_2); + Py_VISIT(traverse_module_state->__pyx_n_u_is_normalized_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_is_not_in_Unicode_Normalization); + Py_VISIT(traverse_module_state->__pyx_n_s_isascii); + Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); + Py_VISIT(traverse_module_state->__pyx_n_s_label); + Py_VISIT(traverse_module_state->__pyx_n_s_labels); + Py_VISIT(traverse_module_state->__pyx_n_s_length); + Py_VISIT(traverse_module_state->__pyx_n_s_line); + Py_VISIT(traverse_module_state->__pyx_n_s_load_idna_mapping_table); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_u_mapped); + Py_VISIT(traverse_module_state->__pyx_n_s_mapping); + Py_VISIT(traverse_module_state->__pyx_n_u_mapping); + Py_VISIT(traverse_module_state->__pyx_n_s_match); + Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); + Py_VISIT(traverse_module_state->__pyx_n_s_module); + Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_new_label); + Py_VISIT(traverse_module_state->__pyx_n_s_normalize); + Py_VISIT(traverse_module_state->__pyx_n_s_open); + Py_VISIT(traverse_module_state->__pyx_n_s_parent); + Py_VISIT(traverse_module_state->__pyx_n_s_pathlib); + Py_VISIT(traverse_module_state->__pyx_n_s_pattern); + Py_VISIT(traverse_module_state->__pyx_n_s_prepare); + Py_VISIT(traverse_module_state->__pyx_n_s_process); + Py_VISIT(traverse_module_state->__pyx_n_u_punycode); + Py_VISIT(traverse_module_state->__pyx_n_s_qualname); + Py_VISIT(traverse_module_state->__pyx_n_s_range); + Py_VISIT(traverse_module_state->__pyx_n_s_re); + Py_VISIT(traverse_module_state->__pyx_n_s_return); + Py_VISIT(traverse_module_state->__pyx_n_s_rfc5892); + Py_VISIT(traverse_module_state->__pyx_n_s_rstrip); + Py_VISIT(traverse_module_state->__pyx_n_s_search); + Py_VISIT(traverse_module_state->__pyx_n_s_self); + Py_VISIT(traverse_module_state->__pyx_n_s_send); + Py_VISIT(traverse_module_state->__pyx_n_s_set_name); + Py_VISIT(traverse_module_state->__pyx_n_s_spec); + Py_VISIT(traverse_module_state->__pyx_n_s_split); + Py_VISIT(traverse_module_state->__pyx_n_s_start); + Py_VISIT(traverse_module_state->__pyx_n_u_start); + Py_VISIT(traverse_module_state->__pyx_kp_u_starts_with); + Py_VISIT(traverse_module_state->__pyx_kp_u_starts_with_a_character); + Py_VISIT(traverse_module_state->__pyx_n_s_startswith); + Py_VISIT(traverse_module_state->__pyx_n_s_status); + Py_VISIT(traverse_module_state->__pyx_n_u_status); + Py_VISIT(traverse_module_state->__pyx_n_s_str); + Py_VISIT(traverse_module_state->__pyx_n_s_strip); + Py_VISIT(traverse_module_state->__pyx_n_s_super); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_throw); + Py_VISIT(traverse_module_state->__pyx_n_s_to_ascii); + Py_VISIT(traverse_module_state->__pyx_n_s_transitional_processing); + Py_VISIT(traverse_module_state->__pyx_n_s_typing); + Py_VISIT(traverse_module_state->__pyx_n_s_unicodedata); + Py_VISIT(traverse_module_state->__pyx_n_s_unistr); + Py_VISIT(traverse_module_state->__pyx_n_s_use_std3_ascii_rules); + Py_VISIT(traverse_module_state->__pyx_kp_u_utf_8); + Py_VISIT(traverse_module_state->__pyx_n_u_valid); + Py_VISIT(traverse_module_state->__pyx_n_s_validate_label); + Py_VISIT(traverse_module_state->__pyx_n_s_verify_dns_length); + Py_VISIT(traverse_module_state->__pyx_n_s_w3lib__utr46); + Py_VISIT(traverse_module_state->__pyx_kp_s_w3lib__utr46_pyx); + Py_VISIT(traverse_module_state->__pyx_kp_u_which_is_neither_valid_nor_a_de); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_P_id_0_9A_F_4_6_P_start_0_9A); + Py_VISIT(traverse_module_state->__pyx_kp_u_xn); + Py_VISIT(traverse_module_state->__pyx_int_0); + Py_VISIT(traverse_module_state->__pyx_int_1); + Py_VISIT(traverse_module_state->__pyx_int_4); + Py_VISIT(traverse_module_state->__pyx_int_16); + Py_VISIT(traverse_module_state->__pyx_tuple__4); + Py_VISIT(traverse_module_state->__pyx_slice__10); + Py_VISIT(traverse_module_state->__pyx_tuple__12); + Py_VISIT(traverse_module_state->__pyx_tuple__14); + Py_VISIT(traverse_module_state->__pyx_tuple__16); + Py_VISIT(traverse_module_state->__pyx_tuple__18); + Py_VISIT(traverse_module_state->__pyx_tuple__20); + Py_VISIT(traverse_module_state->__pyx_tuple__22); + Py_VISIT(traverse_module_state->__pyx_tuple__24); + Py_VISIT(traverse_module_state->__pyx_tuple__26); + Py_VISIT(traverse_module_state->__pyx_tuple__28); + Py_VISIT(traverse_module_state->__pyx_codeobj__13); + Py_VISIT(traverse_module_state->__pyx_codeobj__15); + Py_VISIT(traverse_module_state->__pyx_codeobj__17); + Py_VISIT(traverse_module_state->__pyx_codeobj__19); + Py_VISIT(traverse_module_state->__pyx_codeobj__21); + Py_VISIT(traverse_module_state->__pyx_codeobj__23); + Py_VISIT(traverse_module_state->__pyx_codeobj__25); + Py_VISIT(traverse_module_state->__pyx_codeobj__27); + Py_VISIT(traverse_module_state->__pyx_codeobj__29); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#define __pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr +#define __pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr +#endif +#define __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr +#define __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr +#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ +#define __pyx_kp_u_04X __pyx_mstate_global->__pyx_kp_u_04X +#define __pyx_n_u_AL __pyx_mstate_global->__pyx_n_u_AL +#define __pyx_n_u_AN __pyx_mstate_global->__pyx_n_u_AN +#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError +#define __pyx_n_s_DEVIATION __pyx_mstate_global->__pyx_n_s_DEVIATION +#define __pyx_n_s_DISALLOWED __pyx_mstate_global->__pyx_n_s_DISALLOWED +#define __pyx_n_s_DISALLOWED_STD3_MAPPED __pyx_mstate_global->__pyx_n_s_DISALLOWED_STD3_MAPPED +#define __pyx_n_s_DISALLOWED_STD3_VALID __pyx_mstate_global->__pyx_n_s_DISALLOWED_STD3_VALID +#define __pyx_n_s_Dict __pyx_mstate_global->__pyx_n_s_Dict +#define __pyx_kp_s_Dict_str__Entry __pyx_mstate_global->__pyx_kp_s_Dict_str__Entry +#define __pyx_kp_u_Domain_name __pyx_mstate_global->__pyx_kp_u_Domain_name +#define __pyx_kp_u_Domain_name_label __pyx_mstate_global->__pyx_kp_u_Domain_name_label +#define __pyx_n_s_Entry __pyx_mstate_global->__pyx_n_s_Entry +#define __pyx_kp_s_Entry_2 __pyx_mstate_global->__pyx_kp_s_Entry_2 +#define __pyx_n_s_Entry___init __pyx_mstate_global->__pyx_n_s_Entry___init +#define __pyx_n_s_Entry_from_match __pyx_mstate_global->__pyx_n_s_Entry_from_match +#define __pyx_n_s_Entry_from_match_locals_genexpr __pyx_mstate_global->__pyx_n_s_Entry_from_match_locals_genexpr +#define __pyx_n_s_Enum __pyx_mstate_global->__pyx_n_s_Enum +#define __pyx_n_s_IDNA_MAPPING_TABLE __pyx_mstate_global->__pyx_n_s_IDNA_MAPPING_TABLE +#define __pyx_n_s_IGNORED __pyx_mstate_global->__pyx_n_s_IGNORED +#define __pyx_kp_u_It_should_be_between_1_and_253 __pyx_mstate_global->__pyx_kp_u_It_should_be_between_1_and_253 +#define __pyx_kp_u_It_should_be_between_1_and_63_P __pyx_mstate_global->__pyx_kp_u_It_should_be_between_1_and_63_P +#define __pyx_kp_u_Line __pyx_mstate_global->__pyx_kp_u_Line +#define __pyx_n_u_M __pyx_mstate_global->__pyx_n_u_M +#define __pyx_n_s_MAPPED __pyx_mstate_global->__pyx_n_s_MAPPED +#define __pyx_n_s_Match __pyx_mstate_global->__pyx_n_s_Match +#define __pyx_n_u_NFC __pyx_mstate_global->__pyx_n_u_NFC +#define __pyx_n_s_None __pyx_mstate_global->__pyx_n_s_None +#define __pyx_n_s_Optional __pyx_mstate_global->__pyx_n_s_Optional +#define __pyx_kp_s_Optional_str __pyx_mstate_global->__pyx_kp_s_Optional_str +#define __pyx_n_s_Path __pyx_mstate_global->__pyx_n_s_Path +#define __pyx_n_u_R __pyx_mstate_global->__pyx_n_u_R +#define __pyx_n_s_Status __pyx_mstate_global->__pyx_n_s_Status +#define __pyx_kp_u_The_length_of_domain_name __pyx_mstate_global->__pyx_kp_u_The_length_of_domain_name +#define __pyx_kp_u_The_length_of_label __pyx_mstate_global->__pyx_kp_u_The_length_of_label +#define __pyx_n_s_Type __pyx_mstate_global->__pyx_n_s_Type +#define __pyx_kp_s_Type__Entry __pyx_mstate_global->__pyx_kp_s_Type__Entry +#define __pyx_kp_u_Unknown_IDNA_mapping_table_statu __pyx_mstate_global->__pyx_kp_u_Unknown_IDNA_mapping_table_statu +#define __pyx_n_s_VALID __pyx_mstate_global->__pyx_n_s_VALID +#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError +#define __pyx_n_s__11 __pyx_mstate_global->__pyx_n_s__11 +#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 +#define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 +#define __pyx_n_s__30 __pyx_mstate_global->__pyx_n_s__30 +#define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 +#define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 +#define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 +#define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8 +#define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9 +#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args +#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines +#define __pyx_n_s_auto __pyx_mstate_global->__pyx_n_s_auto +#define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base +#define __pyx_n_s_bidirectional __pyx_mstate_global->__pyx_n_s_bidirectional +#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool +#define __pyx_n_s_category __pyx_mstate_global->__pyx_n_s_category +#define __pyx_n_s_check_bidi __pyx_mstate_global->__pyx_n_s_check_bidi +#define __pyx_n_s_check_bidi_2 __pyx_mstate_global->__pyx_n_s_check_bidi_2 +#define __pyx_n_s_check_contextj_rules __pyx_mstate_global->__pyx_n_s_check_contextj_rules +#define __pyx_n_s_check_hyphens __pyx_mstate_global->__pyx_n_s_check_hyphens +#define __pyx_n_s_check_joiners __pyx_mstate_global->__pyx_n_s_check_joiners +#define __pyx_n_s_chr __pyx_mstate_global->__pyx_n_s_chr +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close +#define __pyx_n_s_cls __pyx_mstate_global->__pyx_n_s_cls +#define __pyx_n_s_code_point __pyx_mstate_global->__pyx_n_s_code_point +#define __pyx_kp_u_contains_a __pyx_mstate_global->__pyx_kp_u_contains_a +#define __pyx_kp_u_contains_a_code_point_U __pyx_mstate_global->__pyx_kp_u_contains_a_code_point_U +#define __pyx_kp_u_contains_an_unrecognized_code_p __pyx_mstate_global->__pyx_kp_u_contains_an_unrecognized_code_p +#define __pyx_kp_u_contains_disallowed_code_point __pyx_mstate_global->__pyx_kp_u_contains_disallowed_code_point +#define __pyx_kp_u_contains_in_its_3rd_and_4rd_pos __pyx_mstate_global->__pyx_kp_u_contains_in_its_3rd_and_4rd_pos +#define __pyx_n_s_convert_label __pyx_mstate_global->__pyx_n_s_convert_label +#define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode +#define __pyx_n_u_deviation __pyx_mstate_global->__pyx_n_u_deviation +#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict +#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable +#define __pyx_n_u_disallowed __pyx_mstate_global->__pyx_n_u_disallowed +#define __pyx_n_u_disallowed_STD3_mapped __pyx_mstate_global->__pyx_n_u_disallowed_STD3_mapped +#define __pyx_n_u_disallowed_STD3_valid __pyx_mstate_global->__pyx_n_u_disallowed_STD3_valid +#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc +#define __pyx_kp_u_does_not_match_the_expected_pat __pyx_mstate_global->__pyx_kp_u_does_not_match_the_expected_pat +#define __pyx_n_s_domain_name __pyx_mstate_global->__pyx_n_s_domain_name +#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable +#define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode +#define __pyx_n_s_encoding __pyx_mstate_global->__pyx_n_s_encoding +#define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end +#define __pyx_n_u_end __pyx_mstate_global->__pyx_n_u_end +#define __pyx_kp_u_ends_with __pyx_mstate_global->__pyx_kp_u_ends_with +#define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter +#define __pyx_n_s_entry __pyx_mstate_global->__pyx_n_s_entry +#define __pyx_n_s_enum __pyx_mstate_global->__pyx_n_s_enum +#define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate +#define __pyx_kp_u_excluding_the_root_label_and_it __pyx_mstate_global->__pyx_kp_u_excluding_the_root_label_and_it +#define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit +#define __pyx_n_s_file __pyx_mstate_global->__pyx_n_s_file +#define __pyx_n_s_file_name __pyx_mstate_global->__pyx_n_s_file_name +#define __pyx_n_s_form __pyx_mstate_global->__pyx_n_s_form +#define __pyx_kp_u_from __pyx_mstate_global->__pyx_kp_u_from +#define __pyx_kp_u_from_domain_name __pyx_mstate_global->__pyx_kp_u_from_domain_name +#define __pyx_n_s_from_match __pyx_mstate_global->__pyx_n_s_from_match +#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc +#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr +#define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get +#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i +#define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id +#define __pyx_n_u_id __pyx_mstate_global->__pyx_n_u_id +#define __pyx_n_s_idna __pyx_mstate_global->__pyx_n_s_idna +#define __pyx_kp_u_idna_txt __pyx_mstate_global->__pyx_kp_u_idna_txt +#define __pyx_n_u_ignored __pyx_mstate_global->__pyx_n_u_ignored +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_kp_u_in_the_Mark_general_category_fr __pyx_mstate_global->__pyx_kp_u_in_the_Mark_general_category_fr +#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init +#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass +#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing +#define __pyx_n_s_input __pyx_mstate_global->__pyx_n_s_input +#define __pyx_kp_u_is __pyx_mstate_global->__pyx_kp_u_is +#define __pyx_n_s_is_bidi_domain_name __pyx_mstate_global->__pyx_n_s_is_bidi_domain_name +#define __pyx_n_s_is_bidi_domain_name_locals_gene __pyx_mstate_global->__pyx_n_s_is_bidi_domain_name_locals_gene +#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine +#define __pyx_n_s_is_normalized __pyx_mstate_global->__pyx_n_s_is_normalized +#define __pyx_n_s_is_normalized_2 __pyx_mstate_global->__pyx_n_s_is_normalized_2 +#define __pyx_n_u_is_normalized_2 __pyx_mstate_global->__pyx_n_u_is_normalized_2 +#define __pyx_kp_u_is_not_in_Unicode_Normalization __pyx_mstate_global->__pyx_kp_u_is_not_in_Unicode_Normalization +#define __pyx_n_s_isascii __pyx_mstate_global->__pyx_n_s_isascii +#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled +#define __pyx_n_s_label __pyx_mstate_global->__pyx_n_s_label +#define __pyx_n_s_labels __pyx_mstate_global->__pyx_n_s_labels +#define __pyx_n_s_length __pyx_mstate_global->__pyx_n_s_length +#define __pyx_n_s_line __pyx_mstate_global->__pyx_n_s_line +#define __pyx_n_s_load_idna_mapping_table __pyx_mstate_global->__pyx_n_s_load_idna_mapping_table +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_u_mapped __pyx_mstate_global->__pyx_n_u_mapped +#define __pyx_n_s_mapping __pyx_mstate_global->__pyx_n_s_mapping +#define __pyx_n_u_mapping __pyx_mstate_global->__pyx_n_u_mapping +#define __pyx_n_s_match __pyx_mstate_global->__pyx_n_s_match +#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass +#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module +#define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_new_label __pyx_mstate_global->__pyx_n_s_new_label +#define __pyx_n_s_normalize __pyx_mstate_global->__pyx_n_s_normalize +#define __pyx_n_s_open __pyx_mstate_global->__pyx_n_s_open +#define __pyx_n_s_parent __pyx_mstate_global->__pyx_n_s_parent +#define __pyx_n_s_pathlib __pyx_mstate_global->__pyx_n_s_pathlib +#define __pyx_n_s_pattern __pyx_mstate_global->__pyx_n_s_pattern +#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare +#define __pyx_n_s_process __pyx_mstate_global->__pyx_n_s_process +#define __pyx_n_u_punycode __pyx_mstate_global->__pyx_n_u_punycode +#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname +#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range +#define __pyx_n_s_re __pyx_mstate_global->__pyx_n_s_re +#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return +#define __pyx_n_s_rfc5892 __pyx_mstate_global->__pyx_n_s_rfc5892 +#define __pyx_n_s_rstrip __pyx_mstate_global->__pyx_n_s_rstrip +#define __pyx_n_s_search __pyx_mstate_global->__pyx_n_s_search +#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self +#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send +#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name +#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec +#define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split +#define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start +#define __pyx_n_u_start __pyx_mstate_global->__pyx_n_u_start +#define __pyx_kp_u_starts_with __pyx_mstate_global->__pyx_kp_u_starts_with +#define __pyx_kp_u_starts_with_a_character __pyx_mstate_global->__pyx_kp_u_starts_with_a_character +#define __pyx_n_s_startswith __pyx_mstate_global->__pyx_n_s_startswith +#define __pyx_n_s_status __pyx_mstate_global->__pyx_n_s_status +#define __pyx_n_u_status __pyx_mstate_global->__pyx_n_u_status +#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str +#define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip +#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw +#define __pyx_n_s_to_ascii __pyx_mstate_global->__pyx_n_s_to_ascii +#define __pyx_n_s_transitional_processing __pyx_mstate_global->__pyx_n_s_transitional_processing +#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing +#define __pyx_n_s_unicodedata __pyx_mstate_global->__pyx_n_s_unicodedata +#define __pyx_n_s_unistr __pyx_mstate_global->__pyx_n_s_unistr +#define __pyx_n_s_use_std3_ascii_rules __pyx_mstate_global->__pyx_n_s_use_std3_ascii_rules +#define __pyx_kp_u_utf_8 __pyx_mstate_global->__pyx_kp_u_utf_8 +#define __pyx_n_u_valid __pyx_mstate_global->__pyx_n_u_valid +#define __pyx_n_s_validate_label __pyx_mstate_global->__pyx_n_s_validate_label +#define __pyx_n_s_verify_dns_length __pyx_mstate_global->__pyx_n_s_verify_dns_length +#define __pyx_n_s_w3lib__utr46 __pyx_mstate_global->__pyx_n_s_w3lib__utr46 +#define __pyx_kp_s_w3lib__utr46_pyx __pyx_mstate_global->__pyx_kp_s_w3lib__utr46_pyx +#define __pyx_kp_u_which_is_neither_valid_nor_a_de __pyx_mstate_global->__pyx_kp_u_which_is_neither_valid_nor_a_de +#define __pyx_kp_u_x_P_id_0_9A_F_4_6_P_start_0_9A __pyx_mstate_global->__pyx_kp_u_x_P_id_0_9A_F_4_6_P_start_0_9A +#define __pyx_kp_u_xn __pyx_mstate_global->__pyx_kp_u_xn +#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 +#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 +#define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 +#define __pyx_int_16 __pyx_mstate_global->__pyx_int_16 +#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 +#define __pyx_slice__10 __pyx_mstate_global->__pyx_slice__10 +#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 +#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 +#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 +#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 +#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 +#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 +#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 +#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 +#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 +#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 +#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 +#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 +#define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 +#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 +#define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 +#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 +#define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 +#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 +/* #### Code section: module_code ### */ + +/* "w3lib/_utr46.pyx":17 + * else: + * + * def _is_normalized(form: str, unistr: str) -> bool: # <<<<<<<<<<<<<< + * return unicodedata.normalize(form, unistr) == unistr + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_6_utr46_1_is_normalized(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46__is_normalized, "_is_normalized(unicode form: str, unicode unistr: str) -> bool"); +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_1_is_normalized = {"_is_normalized", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_1_is_normalized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46__is_normalized}; +static PyObject *__pyx_pw_5w3lib_6_utr46_1_is_normalized(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_form = 0; + PyObject *__pyx_v_unistr = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_is_normalized (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_form,&__pyx_n_s_unistr,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_form)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unistr)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_is_normalized", 1, 2, 2, 1); __PYX_ERR(0, 17, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_normalized") < 0)) __PYX_ERR(0, 17, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_form = ((PyObject*)values[0]); + __pyx_v_unistr = ((PyObject*)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_is_normalized", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 17, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._utr46._is_normalized", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_form), (&PyUnicode_Type), 0, "form", 1))) __PYX_ERR(0, 17, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unistr), (&PyUnicode_Type), 0, "unistr", 1))) __PYX_ERR(0, 17, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_6_utr46__is_normalized(__pyx_self, __pyx_v_form, __pyx_v_unistr); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_6_utr46__is_normalized(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_form, PyObject *__pyx_v_unistr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_normalized", 1); + + /* "w3lib/_utr46.pyx":18 + * + * def _is_normalized(form: str, unistr: str) -> bool: + * return unicodedata.normalize(form, unistr) == unistr # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_unicodedata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_normalize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_form, __pyx_v_unistr}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_unistr, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "w3lib/_utr46.pyx":17 + * else: + * + * def _is_normalized(form: str, unistr: str) -> bool: # <<<<<<<<<<<<<< + * return unicodedata.normalize(form, unistr) == unistr + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("w3lib._utr46._is_normalized", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_utr46.pyx":32 + * + * class _Entry: # pylint: disable=too-few-public-methods + * @classmethod # <<<<<<<<<<<<<< + * def from_match(cls: Type["_Entry"], match: Match) -> "_Entry": + * if match["status"] == "disallowed": + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_6_utr46_6_Entry_1from_match(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_6_Entry_from_match, "_Entry.from_match(cls: Type['_Entry'], match: Match) -> '_Entry'"); +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_6_Entry_1from_match = {"from_match", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_6_Entry_1from_match, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46_6_Entry_from_match}; +static PyObject *__pyx_pw_5w3lib_6_utr46_6_Entry_1from_match(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_match = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("from_match (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_match,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_match)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("from_match", 1, 2, 2, 1); __PYX_ERR(0, 32, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_match") < 0)) __PYX_ERR(0, 32, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_cls = values[0]; + __pyx_v_match = values[1]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("from_match", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 32, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._utr46._Entry.from_match", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5w3lib_6_utr46_6_Entry_from_match(__pyx_self, __pyx_v_cls, __pyx_v_match); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "w3lib/_utr46.pyx":57 + * else: + * mapping = "".join( + * chr(int(value, base=16)) for value in match["mapping"].split(" ") # <<<<<<<<<<<<<< + * ) + * return cls( + */ + +static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_10from_match_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *)__pyx_tp_new_5w3lib_6_utr46___pyx_scope_struct__genexpr(__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 57, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Entry_from_match_locals_genexpr, __pyx_n_s_w3lib__utr46); if (unlikely(!gen)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("w3lib._utr46._Entry.from_match.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 57, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 57, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 57, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 57, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_value)) __PYX_ERR(0, 57, __pyx_L1_error); + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_utr46.pyx":32 + * + * class _Entry: # pylint: disable=too-few-public-methods + * @classmethod # <<<<<<<<<<<<<< + * def from_match(cls: Type["_Entry"], match: Match) -> "_Entry": + * if match["status"] == "disallowed": + */ + +static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_from_match(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_match) { + PyObject *__pyx_v_status = NULL; + PyObject *__pyx_v_mapping = NULL; + PyObject *__pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("from_match", 1); + + /* "w3lib/_utr46.pyx":34 + * @classmethod + * def from_match(cls: Type["_Entry"], match: Match) -> "_Entry": + * if match["status"] == "disallowed": # <<<<<<<<<<<<<< + * status = _Status.DISALLOWED + * elif match["status"] == "disallowed_STD3_mapped": + */ + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_match, __pyx_n_u_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_disallowed, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "w3lib/_utr46.pyx":35 + * def from_match(cls: Type["_Entry"], match: Match) -> "_Entry": + * if match["status"] == "disallowed": + * status = _Status.DISALLOWED # <<<<<<<<<<<<<< + * elif match["status"] == "disallowed_STD3_mapped": + * status = _Status.DISALLOWED_STD3_MAPPED + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DISALLOWED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_status = __pyx_t_3; + __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":34 + * @classmethod + * def from_match(cls: Type["_Entry"], match: Match) -> "_Entry": + * if match["status"] == "disallowed": # <<<<<<<<<<<<<< + * status = _Status.DISALLOWED + * elif match["status"] == "disallowed_STD3_mapped": + */ + goto __pyx_L3; + } + + /* "w3lib/_utr46.pyx":36 + * if match["status"] == "disallowed": + * status = _Status.DISALLOWED + * elif match["status"] == "disallowed_STD3_mapped": # <<<<<<<<<<<<<< + * status = _Status.DISALLOWED_STD3_MAPPED + * elif match["status"] == "disallowed_STD3_valid": + */ + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_match, __pyx_n_u_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_disallowed_STD3_mapped, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "w3lib/_utr46.pyx":37 + * status = _Status.DISALLOWED + * elif match["status"] == "disallowed_STD3_mapped": + * status = _Status.DISALLOWED_STD3_MAPPED # <<<<<<<<<<<<<< + * elif match["status"] == "disallowed_STD3_valid": + * status = _Status.DISALLOWED_STD3_VALID + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DISALLOWED_STD3_MAPPED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_status = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":36 + * if match["status"] == "disallowed": + * status = _Status.DISALLOWED + * elif match["status"] == "disallowed_STD3_mapped": # <<<<<<<<<<<<<< + * status = _Status.DISALLOWED_STD3_MAPPED + * elif match["status"] == "disallowed_STD3_valid": + */ + goto __pyx_L3; + } + + /* "w3lib/_utr46.pyx":38 + * elif match["status"] == "disallowed_STD3_mapped": + * status = _Status.DISALLOWED_STD3_MAPPED + * elif match["status"] == "disallowed_STD3_valid": # <<<<<<<<<<<<<< + * status = _Status.DISALLOWED_STD3_VALID + * elif match["status"] == "ignored": + */ + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_match, __pyx_n_u_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_disallowed_STD3_valid, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "w3lib/_utr46.pyx":39 + * status = _Status.DISALLOWED_STD3_MAPPED + * elif match["status"] == "disallowed_STD3_valid": + * status = _Status.DISALLOWED_STD3_VALID # <<<<<<<<<<<<<< + * elif match["status"] == "ignored": + * status = _Status.IGNORED + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DISALLOWED_STD3_VALID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_status = __pyx_t_3; + __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":38 + * elif match["status"] == "disallowed_STD3_mapped": + * status = _Status.DISALLOWED_STD3_MAPPED + * elif match["status"] == "disallowed_STD3_valid": # <<<<<<<<<<<<<< + * status = _Status.DISALLOWED_STD3_VALID + * elif match["status"] == "ignored": + */ + goto __pyx_L3; + } + + /* "w3lib/_utr46.pyx":40 + * elif match["status"] == "disallowed_STD3_valid": + * status = _Status.DISALLOWED_STD3_VALID + * elif match["status"] == "ignored": # <<<<<<<<<<<<<< + * status = _Status.IGNORED + * elif match["status"] == "mapped": + */ + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_match, __pyx_n_u_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_ignored, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "w3lib/_utr46.pyx":41 + * status = _Status.DISALLOWED_STD3_VALID + * elif match["status"] == "ignored": + * status = _Status.IGNORED # <<<<<<<<<<<<<< + * elif match["status"] == "mapped": + * status = _Status.MAPPED + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_IGNORED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_status = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":40 + * elif match["status"] == "disallowed_STD3_valid": + * status = _Status.DISALLOWED_STD3_VALID + * elif match["status"] == "ignored": # <<<<<<<<<<<<<< + * status = _Status.IGNORED + * elif match["status"] == "mapped": + */ + goto __pyx_L3; + } + + /* "w3lib/_utr46.pyx":42 + * elif match["status"] == "ignored": + * status = _Status.IGNORED + * elif match["status"] == "mapped": # <<<<<<<<<<<<<< + * status = _Status.MAPPED + * elif match["status"] == "deviation": + */ + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_match, __pyx_n_u_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_mapped, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "w3lib/_utr46.pyx":43 + * status = _Status.IGNORED + * elif match["status"] == "mapped": + * status = _Status.MAPPED # <<<<<<<<<<<<<< + * elif match["status"] == "deviation": + * status = _Status.DEVIATION + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_MAPPED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_status = __pyx_t_3; + __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":42 + * elif match["status"] == "ignored": + * status = _Status.IGNORED + * elif match["status"] == "mapped": # <<<<<<<<<<<<<< + * status = _Status.MAPPED + * elif match["status"] == "deviation": + */ + goto __pyx_L3; + } + + /* "w3lib/_utr46.pyx":44 + * elif match["status"] == "mapped": + * status = _Status.MAPPED + * elif match["status"] == "deviation": # <<<<<<<<<<<<<< + * status = _Status.DEVIATION + * elif match["status"] == "valid": + */ + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_match, __pyx_n_u_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_deviation, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "w3lib/_utr46.pyx":45 + * status = _Status.MAPPED + * elif match["status"] == "deviation": + * status = _Status.DEVIATION # <<<<<<<<<<<<<< + * elif match["status"] == "valid": + * status = _Status.VALID + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DEVIATION); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_status = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":44 + * elif match["status"] == "mapped": + * status = _Status.MAPPED + * elif match["status"] == "deviation": # <<<<<<<<<<<<<< + * status = _Status.DEVIATION + * elif match["status"] == "valid": + */ + goto __pyx_L3; + } + + /* "w3lib/_utr46.pyx":46 + * elif match["status"] == "deviation": + * status = _Status.DEVIATION + * elif match["status"] == "valid": # <<<<<<<<<<<<<< + * status = _Status.VALID + * else: + */ + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_match, __pyx_n_u_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_valid, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (likely(__pyx_t_2)) { + + /* "w3lib/_utr46.pyx":47 + * status = _Status.DEVIATION + * elif match["status"] == "valid": + * status = _Status.VALID # <<<<<<<<<<<<<< + * else: + * raise ValueError( + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_VALID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_status = __pyx_t_3; + __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":46 + * elif match["status"] == "deviation": + * status = _Status.DEVIATION + * elif match["status"] == "valid": # <<<<<<<<<<<<<< + * status = _Status.VALID + * else: + */ + goto __pyx_L3; + } + + /* "w3lib/_utr46.pyx":49 + * status = _Status.VALID + * else: + * raise ValueError( # <<<<<<<<<<<<<< + * f"Unknown IDNA mapping table status value found: " + * f"{match['status']!r}" + */ + /*else*/ { + + /* "w3lib/_utr46.pyx":51 + * raise ValueError( + * f"Unknown IDNA mapping table status value found: " + * f"{match['status']!r}" # <<<<<<<<<<<<<< + * ) + * if match["mapping"] is None: + */ + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_match, __pyx_n_u_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":50 + * else: + * raise ValueError( + * f"Unknown IDNA mapping table status value found: " # <<<<<<<<<<<<<< + * f"{match['status']!r}" + * ) + */ + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_IDNA_mapping_table_statu, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":49 + * status = _Status.VALID + * else: + * raise ValueError( # <<<<<<<<<<<<<< + * f"Unknown IDNA mapping table status value found: " + * f"{match['status']!r}" + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 49, __pyx_L1_error) + } + __pyx_L3:; + + /* "w3lib/_utr46.pyx":53 + * f"{match['status']!r}" + * ) + * if match["mapping"] is None: # <<<<<<<<<<<<<< + * mapping = None + * else: + */ + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_match, __pyx_n_u_mapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "w3lib/_utr46.pyx":54 + * ) + * if match["mapping"] is None: + * mapping = None # <<<<<<<<<<<<<< + * else: + * mapping = "".join( + */ + __Pyx_INCREF(Py_None); + __pyx_v_mapping = ((PyObject*)Py_None); + + /* "w3lib/_utr46.pyx":53 + * f"{match['status']!r}" + * ) + * if match["mapping"] is None: # <<<<<<<<<<<<<< + * mapping = None + * else: + */ + goto __pyx_L4; + } + + /* "w3lib/_utr46.pyx":56 + * mapping = None + * else: + * mapping = "".join( # <<<<<<<<<<<<<< + * chr(int(value, base=16)) for value in match["mapping"].split(" ") + * ) + */ + /*else*/ { + + /* "w3lib/_utr46.pyx":57 + * else: + * mapping = "".join( + * chr(int(value, base=16)) for value in match["mapping"].split(" ") # <<<<<<<<<<<<<< + * ) + * return cls( + */ + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_match, __pyx_n_u_mapping); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__2}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_4 = __pyx_pf_5w3lib_6_utr46_6_Entry_10from_match_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":56 + * mapping = None + * else: + * mapping = "".join( # <<<<<<<<<<<<<< + * chr(int(value, base=16)) for value in match["mapping"].split(" ") + * ) + */ + __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyUnicode_Join(__pyx_kp_u_, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_mapping = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L4:; + + /* "w3lib/_utr46.pyx":59 + * chr(int(value, base=16)) for value in match["mapping"].split(" ") + * ) + * return cls( # <<<<<<<<<<<<<< + * mapping=mapping, + * status=status, + */ + __Pyx_XDECREF(__pyx_r); + + /* "w3lib/_utr46.pyx":60 + * ) + * return cls( + * mapping=mapping, # <<<<<<<<<<<<<< + * status=status, + * ) + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_mapping, __pyx_v_mapping) < 0) __PYX_ERR(0, 60, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":61 + * return cls( + * mapping=mapping, + * status=status, # <<<<<<<<<<<<<< + * ) + * + */ + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_status, __pyx_v_status) < 0) __PYX_ERR(0, 60, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":59 + * chr(int(value, base=16)) for value in match["mapping"].split(" ") + * ) + * return cls( # <<<<<<<<<<<<<< + * mapping=mapping, + * status=status, + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_cls, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_utr46.pyx":32 + * + * class _Entry: # pylint: disable=too-few-public-methods + * @classmethod # <<<<<<<<<<<<<< + * def from_match(cls: Type["_Entry"], match: Match) -> "_Entry": + * if match["status"] == "disallowed": + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._utr46._Entry.from_match", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_status); + __Pyx_XDECREF(__pyx_v_mapping); + __Pyx_XDECREF(__pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_utr46.pyx":64 + * ) + * + * def __init__(self: "_Entry", *, mapping: Optional[str], status: _Status) -> None: # <<<<<<<<<<<<<< + * self.mapping = mapping + * self.status = status + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_6_utr46_6_Entry_3__init__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_6_Entry_2__init__, "_Entry.__init__(self: '_Entry', *, unicode mapping: Optional[str], status: _Status) -> None"); +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_6_Entry_3__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_6_Entry_3__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46_6_Entry_2__init__}; +static PyObject *__pyx_pw_5w3lib_6_utr46_6_Entry_3__init__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_mapping = 0; + PyObject *__pyx_v_status = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_mapping,&__pyx_n_s_status,0}; + if (likely(__pyx_kwds)) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mapping)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("__init__", __pyx_n_s_mapping); __PYX_ERR(0, 64, __pyx_L3_error) + } + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_status)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("__init__", __pyx_n_s_status); __PYX_ERR(0, 64, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 64, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + __Pyx_RaiseKeywordRequired("__init__", __pyx_n_s_mapping); __PYX_ERR(0, 64, __pyx_L3_error) + } + __pyx_v_self = values[0]; + __pyx_v_mapping = ((PyObject*)values[1]); + __pyx_v_status = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 64, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._utr46._Entry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapping), (&PyUnicode_Type), 1, "mapping", 1))) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_6_utr46_6_Entry_2__init__(__pyx_self, __pyx_v_self, __pyx_v_mapping, __pyx_v_status); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_2__init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mapping, PyObject *__pyx_v_status) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 1); + + /* "w3lib/_utr46.pyx":65 + * + * def __init__(self: "_Entry", *, mapping: Optional[str], status: _Status) -> None: + * self.mapping = mapping # <<<<<<<<<<<<<< + * self.status = status + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mapping, __pyx_v_mapping) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":66 + * def __init__(self: "_Entry", *, mapping: Optional[str], status: _Status) -> None: + * self.mapping = mapping + * self.status = status # <<<<<<<<<<<<<< + * + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_status, __pyx_v_status) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":64 + * ) + * + * def __init__(self: "_Entry", *, mapping: Optional[str], status: _Status) -> None: # <<<<<<<<<<<<<< + * self.mapping = mapping + * self.status = status + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("w3lib._utr46._Entry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_utr46.pyx":69 + * + * + * def _load_idna_mapping_table() -> Dict[str, _Entry]: # <<<<<<<<<<<<<< + * file_name = Path(__file__).parent / "idna.txt" + * pattern = r"""(?x) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_6_utr46_3_load_idna_mapping_table(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_2_load_idna_mapping_table, "_load_idna_mapping_table() -> Dict[str, _Entry]"); +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_3_load_idna_mapping_table = {"_load_idna_mapping_table", (PyCFunction)__pyx_pw_5w3lib_6_utr46_3_load_idna_mapping_table, METH_NOARGS, __pyx_doc_5w3lib_6_utr46_2_load_idna_mapping_table}; +static PyObject *__pyx_pw_5w3lib_6_utr46_3_load_idna_mapping_table(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_load_idna_mapping_table (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_5w3lib_6_utr46_2_load_idna_mapping_table(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_6_utr46_2_load_idna_mapping_table(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_v_file_name = NULL; + PyObject *__pyx_v_pattern = NULL; + PyObject *__pyx_v_mapping = NULL; + PyObject *__pyx_v_input = NULL; + PyObject *__pyx_v_line = NULL; + PyObject *__pyx_v_match = NULL; + PyObject *__pyx_v_entry = NULL; + PyObject *__pyx_v_code_point = NULL; + PyObject *__pyx_v_start = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_v_id = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + int __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_UCS4 __pyx_t_16; + PyObject *(*__pyx_t_17)(PyObject *); + PyObject *__pyx_t_18 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_load_idna_mapping_table", 1); + + /* "w3lib/_utr46.pyx":70 + * + * def _load_idna_mapping_table() -> Dict[str, _Entry]: + * file_name = Path(__file__).parent / "idna.txt" # <<<<<<<<<<<<<< + * pattern = r"""(?x) + * ^ + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_kp_u_idna_txt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_file_name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":71 + * def _load_idna_mapping_table() -> Dict[str, _Entry]: + * file_name = Path(__file__).parent / "idna.txt" + * pattern = r"""(?x) # <<<<<<<<<<<<<< + * ^ + * (?: + */ + __Pyx_INCREF(__pyx_kp_u_x_P_id_0_9A_F_4_6_P_start_0_9A); + __pyx_v_pattern = __pyx_kp_u_x_P_id_0_9A_F_4_6_P_start_0_9A; + + /* "w3lib/_utr46.pyx":93 + * )? + * """ + * mapping = {} # <<<<<<<<<<<<<< + * with open(file_name, encoding="utf-8") as input: + * for line in input: + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_mapping = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":94 + * """ + * mapping = {} + * with open(file_name, encoding="utf-8") as input: # <<<<<<<<<<<<<< + * for line in input: + * if line.startswith("#") or not line.strip(): + */ + /*with:*/ { + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_file_name); + __Pyx_GIVEREF(__pyx_v_file_name); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_file_name)) __PYX_ERR(0, 94, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + __pyx_v_input = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":95 + * mapping = {} + * with open(file_name, encoding="utf-8") as input: + * for line in input: # <<<<<<<<<<<<<< + * if line.startswith("#") or not line.strip(): + * continue + */ + if (likely(PyList_CheckExact(__pyx_v_input)) || PyTuple_CheckExact(__pyx_v_input)) { + __pyx_t_1 = __pyx_v_input; __Pyx_INCREF(__pyx_t_1); + __pyx_t_10 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_input); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 95, __pyx_L7_error) + } + for (;;) { + if (likely(!__pyx_t_11)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 95, __pyx_L7_error) + #endif + if (__pyx_t_10 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 95, __pyx_L7_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 95, __pyx_L7_error) + #endif + if (__pyx_t_10 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 95, __pyx_L7_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_11(__pyx_t_1); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 95, __pyx_L7_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":96 + * with open(file_name, encoding="utf-8") as input: + * for line in input: + * if line.startswith("#") or not line.strip(): # <<<<<<<<<<<<<< + * continue + * match = re.search(pattern, line) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u__3}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 96, __pyx_L7_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_13) { + } else { + __pyx_t_12 = __pyx_t_13; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 96, __pyx_L7_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_14 = (!__pyx_t_13); + __pyx_t_12 = __pyx_t_14; + __pyx_L16_bool_binop_done:; + if (__pyx_t_12) { + + /* "w3lib/_utr46.pyx":97 + * for line in input: + * if line.startswith("#") or not line.strip(): + * continue # <<<<<<<<<<<<<< + * match = re.search(pattern, line) + * if not match: + */ + goto __pyx_L13_continue; + + /* "w3lib/_utr46.pyx":96 + * with open(file_name, encoding="utf-8") as input: + * for line in input: + * if line.startswith("#") or not line.strip(): # <<<<<<<<<<<<<< + * continue + * match = re.search(pattern, line) + */ + } + + /* "w3lib/_utr46.pyx":98 + * if line.startswith("#") or not line.strip(): + * continue + * match = re.search(pattern, line) # <<<<<<<<<<<<<< + * if not match: + * raise ValueError( + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_search); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_pattern, __pyx_v_line}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_match, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":99 + * continue + * match = re.search(pattern, line) + * if not match: # <<<<<<<<<<<<<< + * raise ValueError( + * f"Line {line!r} from {file_name} does not match the " + */ + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_match); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 99, __pyx_L7_error) + __pyx_t_14 = (!__pyx_t_12); + if (unlikely(__pyx_t_14)) { + + /* "w3lib/_utr46.pyx":101 + * if not match: + * raise ValueError( + * f"Line {line!r} from {file_name} does not match the " # <<<<<<<<<<<<<< + * f"expected pattern." + * ) + */ + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = 0; + __pyx_t_16 = 127; + __Pyx_INCREF(__pyx_kp_u_Line); + __pyx_t_15 += 5; + __Pyx_GIVEREF(__pyx_kp_u_Line); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Line); + __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_line), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_16; + __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_u_from); + __pyx_t_15 += 6; + __Pyx_GIVEREF(__pyx_kp_u_from); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_from); + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_file_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_16; + __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_u_does_not_match_the_expected_pat); + __pyx_t_15 += 37; + __Pyx_GIVEREF(__pyx_kp_u_does_not_match_the_expected_pat); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_does_not_match_the_expected_pat); + __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":100 + * match = re.search(pattern, line) + * if not match: + * raise ValueError( # <<<<<<<<<<<<<< + * f"Line {line!r} from {file_name} does not match the " + * f"expected pattern." + */ + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 100, __pyx_L7_error) + + /* "w3lib/_utr46.pyx":99 + * continue + * match = re.search(pattern, line) + * if not match: # <<<<<<<<<<<<<< + * raise ValueError( + * f"Line {line!r} from {file_name} does not match the " + */ + } + + /* "w3lib/_utr46.pyx":104 + * f"expected pattern." + * ) + * entry = _Entry.from_match(match) # <<<<<<<<<<<<<< + * if match["id"] is not None: + * code_point = chr(int(match["id"], base=16)) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Entry); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_from_match); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_match}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":105 + * ) + * entry = _Entry.from_match(match) + * if match["id"] is not None: # <<<<<<<<<<<<<< + * code_point = chr(int(match["id"], base=16)) + * mapping[code_point] = entry + */ + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_match, __pyx_n_u_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = (__pyx_t_3 != Py_None); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_14) { + + /* "w3lib/_utr46.pyx":106 + * entry = _Entry.from_match(match) + * if match["id"] is not None: + * code_point = chr(int(match["id"], base=16)) # <<<<<<<<<<<<<< + * mapping[code_point] = entry + * continue + */ + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_match, __pyx_n_u_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 106, __pyx_L7_error); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 106, __pyx_L7_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":107 + * if match["id"] is not None: + * code_point = chr(int(match["id"], base=16)) + * mapping[code_point] = entry # <<<<<<<<<<<<<< + * continue + * start = int(match["start"], base=16) + */ + if (unlikely((PyDict_SetItem(__pyx_v_mapping, __pyx_v_code_point, __pyx_v_entry) < 0))) __PYX_ERR(0, 107, __pyx_L7_error) + + /* "w3lib/_utr46.pyx":108 + * code_point = chr(int(match["id"], base=16)) + * mapping[code_point] = entry + * continue # <<<<<<<<<<<<<< + * start = int(match["start"], base=16) + * end = int(match["end"], base=16) + */ + goto __pyx_L13_continue; + + /* "w3lib/_utr46.pyx":105 + * ) + * entry = _Entry.from_match(match) + * if match["id"] is not None: # <<<<<<<<<<<<<< + * code_point = chr(int(match["id"], base=16)) + * mapping[code_point] = entry + */ + } + + /* "w3lib/_utr46.pyx":109 + * mapping[code_point] = entry + * continue + * start = int(match["start"], base=16) # <<<<<<<<<<<<<< + * end = int(match["end"], base=16) + * for id in range(start, end + 1): + */ + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_match, __pyx_n_u_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 109, __pyx_L7_error); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 109, __pyx_L7_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":110 + * continue + * start = int(match["start"], base=16) + * end = int(match["end"], base=16) # <<<<<<<<<<<<<< + * for id in range(start, end + 1): + * code_point = chr(id) + */ + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_match, __pyx_n_u_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 110, __pyx_L7_error); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 110, __pyx_L7_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_utr46.pyx":111 + * start = int(match["start"], base=16) + * end = int(match["end"], base=16) + * for id in range(start, end + 1): # <<<<<<<<<<<<<< + * code_point = chr(id) + * mapping[code_point] = entry + */ + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_end, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_start); + __Pyx_GIVEREF(__pyx_v_start); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_start)) __PYX_ERR(0, 111, __pyx_L7_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 111, __pyx_L7_error); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { + __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); + __pyx_t_15 = 0; + __pyx_t_17 = NULL; + } else { + __pyx_t_15 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 111, __pyx_L7_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_17)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 111, __pyx_L7_error) + #endif + if (__pyx_t_15 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(0, 111, __pyx_L7_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 111, __pyx_L7_error) + #endif + if (__pyx_t_15 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(0, 111, __pyx_L7_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_17(__pyx_t_2); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 111, __pyx_L7_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_id, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_utr46.pyx":112 + * end = int(match["end"], base=16) + * for id in range(start, end + 1): + * code_point = chr(id) # <<<<<<<<<<<<<< + * mapping[code_point] = entry + * return mapping + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_utr46.pyx":113 + * for id in range(start, end + 1): + * code_point = chr(id) + * mapping[code_point] = entry # <<<<<<<<<<<<<< + * return mapping + * + */ + if (unlikely((PyDict_SetItem(__pyx_v_mapping, __pyx_v_code_point, __pyx_v_entry) < 0))) __PYX_ERR(0, 113, __pyx_L7_error) + + /* "w3lib/_utr46.pyx":111 + * start = int(match["start"], base=16) + * end = int(match["end"], base=16) + * for id in range(start, end + 1): # <<<<<<<<<<<<<< + * code_point = chr(id) + * mapping[code_point] = entry + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":95 + * mapping = {} + * with open(file_name, encoding="utf-8") as input: + * for line in input: # <<<<<<<<<<<<<< + * if line.startswith("#") or not line.strip(): + * continue + */ + __pyx_L13_continue:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":94 + * """ + * mapping = {} + * with open(file_name, encoding="utf-8") as input: # <<<<<<<<<<<<<< + * for line in input: + * if line.startswith("#") or not line.strip(): + */ + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L12_try_end; + __pyx_L7_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + /*except:*/ { + __Pyx_AddTraceback("w3lib._utr46._load_idna_mapping_table", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_4) < 0) __PYX_ERR(0, 94, __pyx_L9_except_error) + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L9_except_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 94, __pyx_L9_except_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_18); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (__pyx_t_14 < 0) __PYX_ERR(0, 94, __pyx_L9_except_error) + __pyx_t_12 = (!__pyx_t_14); + if (unlikely(__pyx_t_12)) { + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_4); + __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; + __PYX_ERR(0, 94, __pyx_L9_except_error) + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L8_exception_handled; + } + __pyx_L9_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L8_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_L12_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_6) { + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__4, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + goto __pyx_L6; + } + __pyx_L6:; + } + goto __pyx_L27; + __pyx_L3_error:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L1_error; + __pyx_L27:; + } + + /* "w3lib/_utr46.pyx":114 + * code_point = chr(id) + * mapping[code_point] = entry + * return mapping # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_mapping); + __pyx_r = __pyx_v_mapping; + goto __pyx_L0; + + /* "w3lib/_utr46.pyx":69 + * + * + * def _load_idna_mapping_table() -> Dict[str, _Entry]: # <<<<<<<<<<<<<< + * file_name = Path(__file__).parent / "idna.txt" + * pattern = r"""(?x) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._utr46._load_idna_mapping_table", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_file_name); + __Pyx_XDECREF(__pyx_v_pattern); + __Pyx_XDECREF(__pyx_v_mapping); + __Pyx_XDECREF(__pyx_v_input); + __Pyx_XDECREF(__pyx_v_line); + __Pyx_XDECREF(__pyx_v_match); + __Pyx_XDECREF(__pyx_v_entry); + __Pyx_XDECREF(__pyx_v_code_point); + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XDECREF(__pyx_v_id); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_utr46.pyx":121 + * + * # https://www.unicode.org/reports/tr46/#Validity_Criteria + * def _validate_label( # <<<<<<<<<<<<<< + * label: str, + * *, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_6_utr46_5_validate_label(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_4_validate_label, "_validate_label(unicode label: str, *, check_hyphens: bool, check_joiners: bool, check_bidi: bool, transitional_processing: bool, use_std3_ascii_rules: bool) -> None\nValidates the *label* domain name label.\n\n Only set *check_bidi* to ``True`` if the source domain name is a bidi\n domain name, i.e. if any character in it is in the Unicode Character\n Database with Bidi_Class R, AL, or AN.\n "); +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_5_validate_label = {"_validate_label", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_5_validate_label, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46_4_validate_label}; +static PyObject *__pyx_pw_5w3lib_6_utr46_5_validate_label(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_label = 0; + PyObject *__pyx_v_check_hyphens = 0; + PyObject *__pyx_v_check_joiners = 0; + PyObject *__pyx_v_check_bidi = 0; + PyObject *__pyx_v_transitional_processing = 0; + PyObject *__pyx_v_use_std3_ascii_rules = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[6] = {0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_validate_label (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_label,&__pyx_n_s_check_hyphens,&__pyx_n_s_check_joiners,&__pyx_n_s_check_bidi,&__pyx_n_s_transitional_processing,&__pyx_n_s_use_std3_ascii_rules,0}; + if (likely(__pyx_kwds)) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_check_hyphens)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_validate_label", __pyx_n_s_check_hyphens); __PYX_ERR(0, 121, __pyx_L3_error) + } + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_check_joiners)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_validate_label", __pyx_n_s_check_joiners); __PYX_ERR(0, 121, __pyx_L3_error) + } + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_check_bidi)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_validate_label", __pyx_n_s_check_bidi); __PYX_ERR(0, 121, __pyx_L3_error) + } + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_transitional_processing)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_validate_label", __pyx_n_s_transitional_processing); __PYX_ERR(0, 121, __pyx_L3_error) + } + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_std3_ascii_rules)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_validate_label", __pyx_n_s_use_std3_ascii_rules); __PYX_ERR(0, 121, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_validate_label") < 0)) __PYX_ERR(0, 121, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + __Pyx_RaiseKeywordRequired("_validate_label", __pyx_n_s_check_hyphens); __PYX_ERR(0, 121, __pyx_L3_error) + } + __pyx_v_label = ((PyObject*)values[0]); + __pyx_v_check_hyphens = values[1]; + __pyx_v_check_joiners = values[2]; + __pyx_v_check_bidi = values[3]; + __pyx_v_transitional_processing = values[4]; + __pyx_v_use_std3_ascii_rules = values[5]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_validate_label", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 121, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._utr46._validate_label", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), (&PyUnicode_Type), 0, "label", 1))) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_6_utr46_4_validate_label(__pyx_self, __pyx_v_label, __pyx_v_check_hyphens, __pyx_v_check_joiners, __pyx_v_check_bidi, __pyx_v_transitional_processing, __pyx_v_use_std3_ascii_rules); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label, PyObject *__pyx_v_check_hyphens, PyObject *__pyx_v_check_joiners, PyObject *__pyx_v_check_bidi, PyObject *__pyx_v_transitional_processing, PyObject *__pyx_v_use_std3_ascii_rules) { + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_code_point = NULL; + PyObject *__pyx_v_entry = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_UCS4 __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + Py_UCS4 __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_validate_label", 1); + + /* "w3lib/_utr46.pyx":136 + * Database with Bidi_Class R, AL, or AN. + * """ + * if not _is_normalized("NFC", label): # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name label {label!r} is not in Unicode Normalization " f"Form NFC." + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_normalized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_u_NFC, __pyx_v_label}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = (!__pyx_t_5); + if (unlikely(__pyx_t_6)) { + + /* "w3lib/_utr46.pyx":138 + * if not _is_normalized("NFC", label): + * raise ValueError( + * f"Domain name label {label!r} is not in Unicode Normalization " f"Form NFC." # <<<<<<<<<<<<<< + * ) + * length = len(label) + */ + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = 0; + __pyx_t_8 = 127; + __Pyx_INCREF(__pyx_kp_u_Domain_name_label); + __pyx_t_7 += 18; + __Pyx_GIVEREF(__pyx_kp_u_Domain_name_label); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Domain_name_label); + __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_8; + __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_kp_u_is_not_in_Unicode_Normalization); + __pyx_t_7 += 42; + __Pyx_GIVEREF(__pyx_kp_u_is_not_in_Unicode_Normalization); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_is_not_in_Unicode_Normalization); + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":137 + * """ + * if not _is_normalized("NFC", label): + * raise ValueError( # <<<<<<<<<<<<<< + * f"Domain name label {label!r} is not in Unicode Normalization " f"Form NFC." + * ) + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 137, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":136 + * Database with Bidi_Class R, AL, or AN. + * """ + * if not _is_normalized("NFC", label): # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name label {label!r} is not in Unicode Normalization " f"Form NFC." + */ + } + + /* "w3lib/_utr46.pyx":140 + * f"Domain name label {label!r} is not in Unicode Normalization " f"Form NFC." + * ) + * length = len(label) # <<<<<<<<<<<<<< + * if check_hyphens: + * if length >= 4 and label[3:4] == "--": + */ + __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_label); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_v_length = __pyx_t_7; + + /* "w3lib/_utr46.pyx":141 + * ) + * length = len(label) + * if check_hyphens: # <<<<<<<<<<<<<< + * if length >= 4 and label[3:4] == "--": + * raise ValueError( + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_check_hyphens); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 141, __pyx_L1_error) + if (__pyx_t_6) { + + /* "w3lib/_utr46.pyx":142 + * length = len(label) + * if check_hyphens: + * if length >= 4 and label[3:4] == "--": # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name label {label!r} contains '-' in its 3rd and 4rd " + */ + __pyx_t_5 = (__pyx_v_length >= 4); + if (__pyx_t_5) { + } else { + __pyx_t_6 = __pyx_t_5; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_1 = __Pyx_PyUnicode_Substring(__pyx_v_label, 3, 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_t_5; + __pyx_L6_bool_binop_done:; + if (unlikely(__pyx_t_6)) { + + /* "w3lib/_utr46.pyx":144 + * if length >= 4 and label[3:4] == "--": + * raise ValueError( + * f"Domain name label {label!r} contains '-' in its 3rd and 4rd " # <<<<<<<<<<<<<< + * f"positions." + * ) + */ + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = 0; + __pyx_t_8 = 127; + __Pyx_INCREF(__pyx_kp_u_Domain_name_label); + __pyx_t_7 += 18; + __Pyx_GIVEREF(__pyx_kp_u_Domain_name_label); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Domain_name_label); + __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_8; + __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_kp_u_contains_in_its_3rd_and_4rd_pos); + __pyx_t_7 += 43; + __Pyx_GIVEREF(__pyx_kp_u_contains_in_its_3rd_and_4rd_pos); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_contains_in_its_3rd_and_4rd_pos); + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":143 + * if check_hyphens: + * if length >= 4 and label[3:4] == "--": + * raise ValueError( # <<<<<<<<<<<<<< + * f"Domain name label {label!r} contains '-' in its 3rd and 4rd " + * f"positions." + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 143, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":142 + * length = len(label) + * if check_hyphens: + * if length >= 4 and label[3:4] == "--": # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name label {label!r} contains '-' in its 3rd and 4rd " + */ + } + + /* "w3lib/_utr46.pyx":147 + * f"positions." + * ) + * if label.startswith("-"): # <<<<<<<<<<<<<< + * raise ValueError(f"Domain name label {label!r} starts with '-'.") + * if label.endswith("-"): + */ + __pyx_t_6 = __Pyx_PyUnicode_Tailmatch(__pyx_v_label, __pyx_kp_u__6, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 147, __pyx_L1_error) + if (unlikely(__pyx_t_6)) { + + /* "w3lib/_utr46.pyx":148 + * ) + * if label.startswith("-"): + * raise ValueError(f"Domain name label {label!r} starts with '-'.") # <<<<<<<<<<<<<< + * if label.endswith("-"): + * raise ValueError(f"Domain name label {label!r} ends with '-'.") + */ + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = 0; + __pyx_t_8 = 127; + __Pyx_INCREF(__pyx_kp_u_Domain_name_label); + __pyx_t_7 += 18; + __Pyx_GIVEREF(__pyx_kp_u_Domain_name_label); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Domain_name_label); + __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_8; + __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_kp_u_starts_with); + __pyx_t_7 += 17; + __Pyx_GIVEREF(__pyx_kp_u_starts_with); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_starts_with); + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 148, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":147 + * f"positions." + * ) + * if label.startswith("-"): # <<<<<<<<<<<<<< + * raise ValueError(f"Domain name label {label!r} starts with '-'.") + * if label.endswith("-"): + */ + } + + /* "w3lib/_utr46.pyx":149 + * if label.startswith("-"): + * raise ValueError(f"Domain name label {label!r} starts with '-'.") + * if label.endswith("-"): # <<<<<<<<<<<<<< + * raise ValueError(f"Domain name label {label!r} ends with '-'.") + * if "." in label: + */ + __pyx_t_6 = __Pyx_PyUnicode_Tailmatch(__pyx_v_label, __pyx_kp_u__6, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error) + if (unlikely(__pyx_t_6)) { + + /* "w3lib/_utr46.pyx":150 + * raise ValueError(f"Domain name label {label!r} starts with '-'.") + * if label.endswith("-"): + * raise ValueError(f"Domain name label {label!r} ends with '-'.") # <<<<<<<<<<<<<< + * if "." in label: + * raise ValueError(f"Domain name label {label!r} contains a '.'.") + */ + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = 0; + __pyx_t_8 = 127; + __Pyx_INCREF(__pyx_kp_u_Domain_name_label); + __pyx_t_7 += 18; + __Pyx_GIVEREF(__pyx_kp_u_Domain_name_label); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Domain_name_label); + __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_8; + __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_kp_u_ends_with); + __pyx_t_7 += 15; + __Pyx_GIVEREF(__pyx_kp_u_ends_with); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_ends_with); + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 150, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":149 + * if label.startswith("-"): + * raise ValueError(f"Domain name label {label!r} starts with '-'.") + * if label.endswith("-"): # <<<<<<<<<<<<<< + * raise ValueError(f"Domain name label {label!r} ends with '-'.") + * if "." in label: + */ + } + + /* "w3lib/_utr46.pyx":141 + * ) + * length = len(label) + * if check_hyphens: # <<<<<<<<<<<<<< + * if length >= 4 and label[3:4] == "--": + * raise ValueError( + */ + } + + /* "w3lib/_utr46.pyx":151 + * if label.endswith("-"): + * raise ValueError(f"Domain name label {label!r} ends with '-'.") + * if "." in label: # <<<<<<<<<<<<<< + * raise ValueError(f"Domain name label {label!r} contains a '.'.") + * if length >= 1 and unicodedata.category(label[0])[0] == "M": + */ + __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__7, __pyx_v_label, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) + if (unlikely(__pyx_t_6)) { + + /* "w3lib/_utr46.pyx":152 + * raise ValueError(f"Domain name label {label!r} ends with '-'.") + * if "." in label: + * raise ValueError(f"Domain name label {label!r} contains a '.'.") # <<<<<<<<<<<<<< + * if length >= 1 and unicodedata.category(label[0])[0] == "M": + * raise ValueError( + */ + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = 0; + __pyx_t_8 = 127; + __Pyx_INCREF(__pyx_kp_u_Domain_name_label); + __pyx_t_7 += 18; + __Pyx_GIVEREF(__pyx_kp_u_Domain_name_label); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Domain_name_label); + __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_8; + __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_kp_u_contains_a); + __pyx_t_7 += 16; + __Pyx_GIVEREF(__pyx_kp_u_contains_a); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_contains_a); + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 152, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":151 + * if label.endswith("-"): + * raise ValueError(f"Domain name label {label!r} ends with '-'.") + * if "." in label: # <<<<<<<<<<<<<< + * raise ValueError(f"Domain name label {label!r} contains a '.'.") + * if length >= 1 and unicodedata.category(label[0])[0] == "M": + */ + } + + /* "w3lib/_utr46.pyx":153 + * if "." in label: + * raise ValueError(f"Domain name label {label!r} contains a '.'.") + * if length >= 1 and unicodedata.category(label[0])[0] == "M": # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name label {label!r} starts with a character " + */ + __pyx_t_5 = (__pyx_v_length >= 1); + if (__pyx_t_5) { + } else { + __pyx_t_6 = __pyx_t_5; + goto __pyx_L12_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_unicodedata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_category); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_GetItemInt_Unicode(__pyx_v_label, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == (Py_UCS4)-1)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_M, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __pyx_t_5; + __pyx_L12_bool_binop_done:; + if (unlikely(__pyx_t_6)) { + + /* "w3lib/_utr46.pyx":155 + * if length >= 1 and unicodedata.category(label[0])[0] == "M": + * raise ValueError( + * f"Domain name label {label!r} starts with a character " # <<<<<<<<<<<<<< + * f"({label[0]!r}) in the Mark general category from the Unicode " + * f"Character Database." + */ + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = 0; + __pyx_t_8 = 127; + __Pyx_INCREF(__pyx_kp_u_Domain_name_label); + __pyx_t_7 += 18; + __Pyx_GIVEREF(__pyx_kp_u_Domain_name_label); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Domain_name_label); + __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_8; + __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_kp_u_starts_with_a_character); + __pyx_t_7 += 26; + __Pyx_GIVEREF(__pyx_kp_u_starts_with_a_character); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_starts_with_a_character); + + /* "w3lib/_utr46.pyx":156 + * raise ValueError( + * f"Domain name label {label!r} starts with a character " + * f"({label[0]!r}) in the Mark general category from the Unicode " # <<<<<<<<<<<<<< + * f"Character Database." + * ) + */ + __pyx_t_10 = __Pyx_GetItemInt_Unicode(__pyx_v_label, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == (Py_UCS4)-1)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_8; + __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_kp_u_in_the_Mark_general_category_fr); + __pyx_t_7 += 67; + __Pyx_GIVEREF(__pyx_kp_u_in_the_Mark_general_category_fr); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_in_the_Mark_general_category_fr); + + /* "w3lib/_utr46.pyx":155 + * if length >= 1 and unicodedata.category(label[0])[0] == "M": + * raise ValueError( + * f"Domain name label {label!r} starts with a character " # <<<<<<<<<<<<<< + * f"({label[0]!r}) in the Mark general category from the Unicode " + * f"Character Database." + */ + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":154 + * raise ValueError(f"Domain name label {label!r} contains a '.'.") + * if length >= 1 and unicodedata.category(label[0])[0] == "M": + * raise ValueError( # <<<<<<<<<<<<<< + * f"Domain name label {label!r} starts with a character " + * f"({label[0]!r}) in the Mark general category from the Unicode " + */ + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 154, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":153 + * if "." in label: + * raise ValueError(f"Domain name label {label!r} contains a '.'.") + * if length >= 1 and unicodedata.category(label[0])[0] == "M": # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name label {label!r} starts with a character " + */ + } + + /* "w3lib/_utr46.pyx":159 + * f"Character Database." + * ) + * for code_point in set(label): # <<<<<<<<<<<<<< + * entry = _IDNA_MAPPING_TABLE.get(code_point) + * if entry is None: + */ + __pyx_t_7 = 0; + __pyx_t_2 = PySet_New(__pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_set_iterator(__pyx_t_2, 1, (&__pyx_t_11), (&__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_1; + __pyx_t_1 = 0; + while (1) { + __pyx_t_12 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_11, &__pyx_t_7, &__pyx_t_1, __pyx_t_4); + if (unlikely(__pyx_t_12 == 0)) break; + if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":160 + * ) + * for code_point in set(label): + * entry = _IDNA_MAPPING_TABLE.get(code_point) # <<<<<<<<<<<<<< + * if entry is None: + * raise ValueError( + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IDNA_MAPPING_TABLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_12 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_12 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_code_point}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":161 + * for code_point in set(label): + * entry = _IDNA_MAPPING_TABLE.get(code_point) + * if entry is None: # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name label {label!r} contains an unrecognized code " + */ + __pyx_t_6 = (__pyx_v_entry == Py_None); + if (unlikely(__pyx_t_6)) { + + /* "w3lib/_utr46.pyx":163 + * if entry is None: + * raise ValueError( + * f"Domain name label {label!r} contains an unrecognized code " # <<<<<<<<<<<<<< + * f"point: U+{ord(code_point):04X} ({code_point})." + * ) + */ + __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = 0; + __pyx_t_8 = 127; + __Pyx_INCREF(__pyx_kp_u_Domain_name_label); + __pyx_t_13 += 18; + __Pyx_GIVEREF(__pyx_kp_u_Domain_name_label); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Domain_name_label); + __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8; + __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9); + __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_kp_u_contains_an_unrecognized_code_p); + __pyx_t_13 += 40; + __Pyx_GIVEREF(__pyx_kp_u_contains_an_unrecognized_code_p); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_contains_an_unrecognized_code_p); + + /* "w3lib/_utr46.pyx":164 + * raise ValueError( + * f"Domain name label {label!r} contains an unrecognized code " + * f"point: U+{ord(code_point):04X} ({code_point})." # <<<<<<<<<<<<<< + * ) + * if not ( + */ + __pyx_t_14 = __Pyx_PyObject_Ord(__pyx_v_code_point); if (unlikely(__pyx_t_14 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyUnicode_From_long(__pyx_t_14, 4, '0', 'X'); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_9); + __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_kp_u__8); + __pyx_t_13 += 2; + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__8); + __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_code_point, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8; + __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_9); + __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_kp_u__9); + __pyx_t_13 += 2; + __Pyx_GIVEREF(__pyx_kp_u__9); + PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__9); + + /* "w3lib/_utr46.pyx":163 + * if entry is None: + * raise ValueError( + * f"Domain name label {label!r} contains an unrecognized code " # <<<<<<<<<<<<<< + * f"point: U+{ord(code_point):04X} ({code_point})." + * ) + */ + __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_13, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":162 + * entry = _IDNA_MAPPING_TABLE.get(code_point) + * if entry is None: + * raise ValueError( # <<<<<<<<<<<<<< + * f"Domain name label {label!r} contains an unrecognized code " + * f"point: U+{ord(code_point):04X} ({code_point})." + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 162, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":161 + * for code_point in set(label): + * entry = _IDNA_MAPPING_TABLE.get(code_point) + * if entry is None: # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name label {label!r} contains an unrecognized code " + */ + } + + /* "w3lib/_utr46.pyx":167 + * ) + * if not ( + * entry.status is _Status.VALID # <<<<<<<<<<<<<< + * or not use_std3_ascii_rules + * and entry.status is _Status.DISALLOWED_STD3_VALID + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Status); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_VALID); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_5 = (__pyx_t_1 == __pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_5) { + } else { + __pyx_t_6 = __pyx_t_5; + goto __pyx_L18_bool_binop_done; + } + + /* "w3lib/_utr46.pyx":168 + * if not ( + * entry.status is _Status.VALID + * or not use_std3_ascii_rules # <<<<<<<<<<<<<< + * and entry.status is _Status.DISALLOWED_STD3_VALID + * or not transitional_processing + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_use_std3_ascii_rules); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_15 = (!__pyx_t_5); + if (!__pyx_t_15) { + goto __pyx_L20_next_or; + } else { + } + + /* "w3lib/_utr46.pyx":169 + * entry.status is _Status.VALID + * or not use_std3_ascii_rules + * and entry.status is _Status.DISALLOWED_STD3_VALID # <<<<<<<<<<<<<< + * or not transitional_processing + * and entry.status is _Status.DEVIATION + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DISALLOWED_STD3_VALID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_15 = (__pyx_t_2 == __pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!__pyx_t_15) { + } else { + __pyx_t_6 = __pyx_t_15; + goto __pyx_L18_bool_binop_done; + } + __pyx_L20_next_or:; + + /* "w3lib/_utr46.pyx":170 + * or not use_std3_ascii_rules + * and entry.status is _Status.DISALLOWED_STD3_VALID + * or not transitional_processing # <<<<<<<<<<<<<< + * and entry.status is _Status.DEVIATION + * ): + */ + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_transitional_processing); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_5 = (!__pyx_t_15); + if (__pyx_t_5) { + } else { + __pyx_t_6 = __pyx_t_5; + goto __pyx_L18_bool_binop_done; + } + + /* "w3lib/_utr46.pyx":171 + * and entry.status is _Status.DISALLOWED_STD3_VALID + * or not transitional_processing + * and entry.status is _Status.DEVIATION # <<<<<<<<<<<<<< + * ): + * raise ValueError( + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_status); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_DEVIATION); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = (__pyx_t_9 == __pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_t_5; + __pyx_L18_bool_binop_done:; + + /* "w3lib/_utr46.pyx":166 + * f"point: U+{ord(code_point):04X} ({code_point})." + * ) + * if not ( # <<<<<<<<<<<<<< + * entry.status is _Status.VALID + * or not use_std3_ascii_rules + */ + __pyx_t_5 = (!__pyx_t_6); + if (unlikely(__pyx_t_5)) { + + /* "w3lib/_utr46.pyx":174 + * ): + * raise ValueError( + * f"Domain name label {label!r} contains a code point, " # <<<<<<<<<<<<<< + * f"U+{ord(code_point):04X} ({code_point}), which is neither " + * f"valid nor a deviation." + */ + __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = 0; + __pyx_t_8 = 127; + __Pyx_INCREF(__pyx_kp_u_Domain_name_label); + __pyx_t_13 += 18; + __Pyx_GIVEREF(__pyx_kp_u_Domain_name_label); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Domain_name_label); + __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8; + __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9); + __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_kp_u_contains_a_code_point_U); + __pyx_t_13 += 26; + __Pyx_GIVEREF(__pyx_kp_u_contains_a_code_point_U); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_contains_a_code_point_U); + + /* "w3lib/_utr46.pyx":175 + * raise ValueError( + * f"Domain name label {label!r} contains a code point, " + * f"U+{ord(code_point):04X} ({code_point}), which is neither " # <<<<<<<<<<<<<< + * f"valid nor a deviation." + * ) + */ + __pyx_t_14 = __Pyx_PyObject_Ord(__pyx_v_code_point); if (unlikely(__pyx_t_14 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyUnicode_From_long(__pyx_t_14, 4, '0', 'X'); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_9); + __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_kp_u__8); + __pyx_t_13 += 2; + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__8); + __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_code_point, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8; + __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_9); + __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_kp_u_which_is_neither_valid_nor_a_de); + __pyx_t_13 += 42; + __Pyx_GIVEREF(__pyx_kp_u_which_is_neither_valid_nor_a_de); + PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_which_is_neither_valid_nor_a_de); + + /* "w3lib/_utr46.pyx":174 + * ): + * raise ValueError( + * f"Domain name label {label!r} contains a code point, " # <<<<<<<<<<<<<< + * f"U+{ord(code_point):04X} ({code_point}), which is neither " + * f"valid nor a deviation." + */ + __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_13, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":173 + * and entry.status is _Status.DEVIATION + * ): + * raise ValueError( # <<<<<<<<<<<<<< + * f"Domain name label {label!r} contains a code point, " + * f"U+{ord(code_point):04X} ({code_point}), which is neither " + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 173, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":166 + * f"point: U+{ord(code_point):04X} ({code_point})." + * ) + * if not ( # <<<<<<<<<<<<<< + * entry.status is _Status.VALID + * or not use_std3_ascii_rules + */ + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":178 + * f"valid nor a deviation." + * ) + * if check_joiners: # <<<<<<<<<<<<<< + * _check_contextj_rules(label) + * if check_bidi: + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_check_joiners); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) + if (__pyx_t_5) { + + /* "w3lib/_utr46.pyx":179 + * ) + * if check_joiners: + * _check_contextj_rules(label) # <<<<<<<<<<<<<< + * if check_bidi: + * _check_bidi(label) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_check_contextj_rules); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_label}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":178 + * f"valid nor a deviation." + * ) + * if check_joiners: # <<<<<<<<<<<<<< + * _check_contextj_rules(label) + * if check_bidi: + */ + } + + /* "w3lib/_utr46.pyx":180 + * if check_joiners: + * _check_contextj_rules(label) + * if check_bidi: # <<<<<<<<<<<<<< + * _check_bidi(label) + * + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_check_bidi); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) + if (__pyx_t_5) { + + /* "w3lib/_utr46.pyx":181 + * _check_contextj_rules(label) + * if check_bidi: + * _check_bidi(label) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_check_bidi_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_label}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":180 + * if check_joiners: + * _check_contextj_rules(label) + * if check_bidi: # <<<<<<<<<<<<<< + * _check_bidi(label) + * + */ + } + + /* "w3lib/_utr46.pyx":121 + * + * # https://www.unicode.org/reports/tr46/#Validity_Criteria + * def _validate_label( # <<<<<<<<<<<<<< + * label: str, + * *, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("w3lib._utr46._validate_label", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_code_point); + __Pyx_XDECREF(__pyx_v_entry); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_utr46.pyx":185 + * + * # https://www.unicode.org/reports/tr46/#Notation + * def _is_bidi_domain_name(domain_name: str) -> bool: # <<<<<<<<<<<<<< + * return any( + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_6_utr46_7_is_bidi_domain_name(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_6_is_bidi_domain_name, "_is_bidi_domain_name(unicode domain_name: str) -> bool"); +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_7_is_bidi_domain_name = {"_is_bidi_domain_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_7_is_bidi_domain_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46_6_is_bidi_domain_name}; +static PyObject *__pyx_pw_5w3lib_6_utr46_7_is_bidi_domain_name(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_domain_name = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_is_bidi_domain_name (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain_name,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domain_name)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_bidi_domain_name") < 0)) __PYX_ERR(0, 185, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_domain_name = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_is_bidi_domain_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 185, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._utr46._is_bidi_domain_name", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain_name), (&PyUnicode_Type), 0, "domain_name", 1))) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_6_utr46_6_is_bidi_domain_name(__pyx_self, __pyx_v_domain_name); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "w3lib/_utr46.pyx":187 + * def _is_bidi_domain_name(domain_name: str) -> bool: + * return any( + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} # <<<<<<<<<<<<<< + * for code_point in set(domain_name) + * ) + */ + +static PyObject *__pyx_pf_5w3lib_6_utr46_20_is_bidi_domain_name_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *)__pyx_tp_new_5w3lib_6_utr46___pyx_scope_struct_1_genexpr(__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 187, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_is_bidi_domain_name_locals_gene, __pyx_n_s_w3lib__utr46); if (unlikely(!gen)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("w3lib._utr46._is_bidi_domain_name.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 187, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":188 + * return any( + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} + * for code_point in set(domain_name) # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 188, __pyx_L1_error) } + __pyx_t_5 = PySet_New(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_set_iterator(__pyx_t_5, 1, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_6; + __pyx_t_6 = 0; + while (1) { + __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_6, __pyx_t_4); + if (unlikely(__pyx_t_7 == 0)) break; + if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_code_point); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + + /* "w3lib/_utr46.pyx":187 + * def _is_bidi_domain_name(domain_name: str) -> bool: + * return any( + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} # <<<<<<<<<<<<<< + * for code_point in set(domain_name) + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_unicodedata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_bidirectional); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_code_point}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_AL, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) + if (!__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_AN, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) + if (!__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_R, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_9 = __pyx_t_10; + __pyx_L7_bool_binop_done:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_10 = __pyx_t_9; + if (__pyx_t_10) { + + /* "w3lib/_utr46.pyx":186 + * # https://www.unicode.org/reports/tr46/#Notation + * def _is_bidi_domain_name(domain_name: str) -> bool: + * return any( # <<<<<<<<<<<<<< + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} + * for code_point in set(domain_name) + */ + __Pyx_XDECREF(__pyx_r); + + /* "w3lib/_utr46.pyx":187 + * def _is_bidi_domain_name(domain_name: str) -> bool: + * return any( + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} # <<<<<<<<<<<<<< + * for code_point in set(domain_name) + * ) + */ + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + } + + /* "w3lib/_utr46.pyx":186 + * # https://www.unicode.org/reports/tr46/#Notation + * def _is_bidi_domain_name(domain_name: str) -> bool: + * return any( # <<<<<<<<<<<<<< + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} + * for code_point in set(domain_name) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + + /* "w3lib/_utr46.pyx":187 + * def _is_bidi_domain_name(domain_name: str) -> bool: + * return any( + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} # <<<<<<<<<<<<<< + * for code_point in set(domain_name) + * ) + */ + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_utr46.pyx":185 + * + * # https://www.unicode.org/reports/tr46/#Notation + * def _is_bidi_domain_name(domain_name: str) -> bool: # <<<<<<<<<<<<<< + * return any( + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} + */ + +static PyObject *__pyx_pf_5w3lib_6_utr46_6_is_bidi_domain_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain_name) { + PyObject *__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1 = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_bidi_domain_name", 1); + + /* "w3lib/_utr46.pyx":186 + * # https://www.unicode.org/reports/tr46/#Notation + * def _is_bidi_domain_name(domain_name: str) -> bool: + * return any( # <<<<<<<<<<<<<< + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} + * for code_point in set(domain_name) + */ + __Pyx_XDECREF(__pyx_r); + + /* "w3lib/_utr46.pyx":187 + * def _is_bidi_domain_name(domain_name: str) -> bool: + * return any( + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} # <<<<<<<<<<<<<< + * for code_point in set(domain_name) + * ) + */ + __pyx_t_1 = __pyx_pf_5w3lib_6_utr46_20_is_bidi_domain_name_genexpr(NULL, __pyx_v_domain_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "w3lib/_utr46.pyx":185 + * + * # https://www.unicode.org/reports/tr46/#Notation + * def _is_bidi_domain_name(domain_name: str) -> bool: # <<<<<<<<<<<<<< + * return any( + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("w3lib._utr46._is_bidi_domain_name", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_utr46.pyx":193 + * + * # https://www.unicode.org/reports/tr46/#Processing + * def _process( # <<<<<<<<<<<<<< + * domain_name: str, + * *, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_6_utr46_9_process(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_8_process, "_process(unicode domain_name: str, *, use_std3_ascii_rules: bool, check_hyphens: bool, check_bidi: bool, check_joiners: bool, transitional_processing: bool) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_9_process = {"_process", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_9_process, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46_8_process}; +static PyObject *__pyx_pw_5w3lib_6_utr46_9_process(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_domain_name = 0; + PyObject *__pyx_v_use_std3_ascii_rules = 0; + PyObject *__pyx_v_check_hyphens = 0; + PyObject *__pyx_v_check_bidi = 0; + PyObject *__pyx_v_check_joiners = 0; + PyObject *__pyx_v_transitional_processing = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[6] = {0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_process (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain_name,&__pyx_n_s_use_std3_ascii_rules,&__pyx_n_s_check_hyphens,&__pyx_n_s_check_bidi,&__pyx_n_s_check_joiners,&__pyx_n_s_transitional_processing,0}; + if (likely(__pyx_kwds)) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domain_name)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_std3_ascii_rules)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_process", __pyx_n_s_use_std3_ascii_rules); __PYX_ERR(0, 193, __pyx_L3_error) + } + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_check_hyphens)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_process", __pyx_n_s_check_hyphens); __PYX_ERR(0, 193, __pyx_L3_error) + } + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_check_bidi)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_process", __pyx_n_s_check_bidi); __PYX_ERR(0, 193, __pyx_L3_error) + } + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_check_joiners)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_process", __pyx_n_s_check_joiners); __PYX_ERR(0, 193, __pyx_L3_error) + } + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_transitional_processing)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_process", __pyx_n_s_transitional_processing); __PYX_ERR(0, 193, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_process") < 0)) __PYX_ERR(0, 193, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + __Pyx_RaiseKeywordRequired("_process", __pyx_n_s_use_std3_ascii_rules); __PYX_ERR(0, 193, __pyx_L3_error) + } + __pyx_v_domain_name = ((PyObject*)values[0]); + __pyx_v_use_std3_ascii_rules = values[1]; + __pyx_v_check_hyphens = values[2]; + __pyx_v_check_bidi = values[3]; + __pyx_v_check_joiners = values[4]; + __pyx_v_transitional_processing = values[5]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_process", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 193, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._utr46._process", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain_name), (&PyUnicode_Type), 0, "domain_name", 1))) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_6_utr46_8_process(__pyx_self, __pyx_v_domain_name, __pyx_v_use_std3_ascii_rules, __pyx_v_check_hyphens, __pyx_v_check_bidi, __pyx_v_check_joiners, __pyx_v_transitional_processing); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain_name, PyObject *__pyx_v_use_std3_ascii_rules, PyObject *__pyx_v_check_hyphens, PyObject *__pyx_v_check_bidi, PyObject *__pyx_v_check_joiners, PyObject *__pyx_v_transitional_processing) { + PyObject *__pyx_v_code_point = NULL; + PyObject *__pyx_v_entry = NULL; + PyObject *__pyx_v_labels = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_label = NULL; + PyObject *__pyx_v_new_label = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_UCS4 __pyx_t_11; + long __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + PyObject *(*__pyx_t_15)(PyObject *); + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_process", 0); + __Pyx_INCREF(__pyx_v_domain_name); + __Pyx_INCREF(__pyx_v_check_bidi); + + /* "w3lib/_utr46.pyx":202 + * transitional_processing: bool, + * ) -> str: + * for code_point in set(domain_name): # <<<<<<<<<<<<<< + * entry = _IDNA_MAPPING_TABLE.get(code_point) + * if entry is None: + */ + __pyx_t_2 = 0; + __pyx_t_5 = PySet_New(__pyx_v_domain_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_set_iterator(__pyx_t_5, 1, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_6; + __pyx_t_6 = 0; + while (1) { + __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_6, __pyx_t_4); + if (unlikely(__pyx_t_7 == 0)) break; + if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_6); + __pyx_t_6 = 0; + + /* "w3lib/_utr46.pyx":203 + * ) -> str: + * for code_point in set(domain_name): + * entry = _IDNA_MAPPING_TABLE.get(code_point) # <<<<<<<<<<<<<< + * if entry is None: + * raise ValueError( + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_IDNA_MAPPING_TABLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_code_point}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_6); + __pyx_t_6 = 0; + + /* "w3lib/_utr46.pyx":204 + * for code_point in set(domain_name): + * entry = _IDNA_MAPPING_TABLE.get(code_point) + * if entry is None: # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name {domain_name!r} contains an unrecognized code " + */ + __pyx_t_9 = (__pyx_v_entry == Py_None); + if (unlikely(__pyx_t_9)) { + + /* "w3lib/_utr46.pyx":206 + * if entry is None: + * raise ValueError( + * f"Domain name {domain_name!r} contains an unrecognized code " # <<<<<<<<<<<<<< + * f"point: U+{ord(code_point):04X} ({code_point})." + * ) + */ + __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = 0; + __pyx_t_11 = 127; + __Pyx_INCREF(__pyx_kp_u_Domain_name); + __pyx_t_10 += 12; + __Pyx_GIVEREF(__pyx_kp_u_Domain_name); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_Domain_name); + __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain_name), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_11; + __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8); + __pyx_t_8 = 0; + __Pyx_INCREF(__pyx_kp_u_contains_an_unrecognized_code_p); + __pyx_t_10 += 40; + __Pyx_GIVEREF(__pyx_kp_u_contains_an_unrecognized_code_p); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_contains_an_unrecognized_code_p); + + /* "w3lib/_utr46.pyx":207 + * raise ValueError( + * f"Domain name {domain_name!r} contains an unrecognized code " + * f"point: U+{ord(code_point):04X} ({code_point})." # <<<<<<<<<<<<<< + * ) + * if entry.status is _Status.DISALLOWED or ( + */ + __pyx_t_12 = __Pyx_PyObject_Ord(__pyx_v_code_point); if (unlikely(__pyx_t_12 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyUnicode_From_long(__pyx_t_12, 4, '0', 'X'); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_8); + __pyx_t_8 = 0; + __Pyx_INCREF(__pyx_kp_u__8); + __pyx_t_10 += 2; + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u__8); + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_code_point, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_11; + __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_8); + __pyx_t_8 = 0; + __Pyx_INCREF(__pyx_kp_u__9); + __pyx_t_10 += 2; + __Pyx_GIVEREF(__pyx_kp_u__9); + PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_kp_u__9); + + /* "w3lib/_utr46.pyx":206 + * if entry is None: + * raise ValueError( + * f"Domain name {domain_name!r} contains an unrecognized code " # <<<<<<<<<<<<<< + * f"point: U+{ord(code_point):04X} ({code_point})." + * ) + */ + __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_6, 7, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_utr46.pyx":205 + * entry = _IDNA_MAPPING_TABLE.get(code_point) + * if entry is None: + * raise ValueError( # <<<<<<<<<<<<<< + * f"Domain name {domain_name!r} contains an unrecognized code " + * f"point: U+{ord(code_point):04X} ({code_point})." + */ + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(0, 205, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":204 + * for code_point in set(domain_name): + * entry = _IDNA_MAPPING_TABLE.get(code_point) + * if entry is None: # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name {domain_name!r} contains an unrecognized code " + */ + } + + /* "w3lib/_utr46.pyx":209 + * f"point: U+{ord(code_point):04X} ({code_point})." + * ) + * if entry.status is _Status.DISALLOWED or ( # <<<<<<<<<<<<<< + * use_std3_ascii_rules + * and entry.status + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_status); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Status); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_DISALLOWED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_13 = (__pyx_t_6 == __pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!__pyx_t_13) { + } else { + __pyx_t_9 = __pyx_t_13; + goto __pyx_L7_bool_binop_done; + } + + /* "w3lib/_utr46.pyx":210 + * ) + * if entry.status is _Status.DISALLOWED or ( + * use_std3_ascii_rules # <<<<<<<<<<<<<< + * and entry.status + * in ( + */ + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_use_std3_ascii_rules); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 210, __pyx_L1_error) + if (__pyx_t_13) { + } else { + __pyx_t_9 = __pyx_t_13; + goto __pyx_L7_bool_binop_done; + } + + /* "w3lib/_utr46.pyx":211 + * if entry.status is _Status.DISALLOWED or ( + * use_std3_ascii_rules + * and entry.status # <<<<<<<<<<<<<< + * in ( + * _Status.DISALLOWED_STD3_MAPPED, + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_status); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + + /* "w3lib/_utr46.pyx":213 + * and entry.status + * in ( + * _Status.DISALLOWED_STD3_MAPPED, # <<<<<<<<<<<<<< + * _Status.DISALLOWED_STD3_VALID, + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Status); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_DISALLOWED_STD3_MAPPED); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "w3lib/_utr46.pyx":212 + * use_std3_ascii_rules + * and entry.status + * in ( # <<<<<<<<<<<<<< + * _Status.DISALLOWED_STD3_MAPPED, + * _Status.DISALLOWED_STD3_VALID, + */ + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_14) { + } else { + __pyx_t_13 = __pyx_t_14; + goto __pyx_L10_bool_binop_done; + } + + /* "w3lib/_utr46.pyx":214 + * in ( + * _Status.DISALLOWED_STD3_MAPPED, + * _Status.DISALLOWED_STD3_VALID, # <<<<<<<<<<<<<< + * ) + * ): + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Status); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_DISALLOWED_STD3_VALID); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "w3lib/_utr46.pyx":212 + * use_std3_ascii_rules + * and entry.status + * in ( # <<<<<<<<<<<<<< + * _Status.DISALLOWED_STD3_MAPPED, + * _Status.DISALLOWED_STD3_VALID, + */ + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = __pyx_t_14; + __pyx_L10_bool_binop_done:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_14 = __pyx_t_13; + __pyx_t_9 = __pyx_t_14; + __pyx_L7_bool_binop_done:; + + /* "w3lib/_utr46.pyx":209 + * f"point: U+{ord(code_point):04X} ({code_point})." + * ) + * if entry.status is _Status.DISALLOWED or ( # <<<<<<<<<<<<<< + * use_std3_ascii_rules + * and entry.status + */ + if (unlikely(__pyx_t_9)) { + + /* "w3lib/_utr46.pyx":218 + * ): + * raise ValueError( + * f"Domain name {domain_name!r} contains disallowed code point " # <<<<<<<<<<<<<< + * f"U+{ord(code_point):04X} ({code_point})." + * ) + */ + __pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = 0; + __pyx_t_11 = 127; + __Pyx_INCREF(__pyx_kp_u_Domain_name); + __pyx_t_10 += 12; + __Pyx_GIVEREF(__pyx_kp_u_Domain_name); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Domain_name); + __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain_name), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_11; + __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_kp_u_contains_disallowed_code_point); + __pyx_t_10 += 34; + __Pyx_GIVEREF(__pyx_kp_u_contains_disallowed_code_point); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_contains_disallowed_code_point); + + /* "w3lib/_utr46.pyx":219 + * raise ValueError( + * f"Domain name {domain_name!r} contains disallowed code point " + * f"U+{ord(code_point):04X} ({code_point})." # <<<<<<<<<<<<<< + * ) + * if entry.status is _Status.IGNORED: + */ + __pyx_t_12 = __Pyx_PyObject_Ord(__pyx_v_code_point); if (unlikely(__pyx_t_12 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_From_long(__pyx_t_12, 4, '0', 'X'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_kp_u__8); + __pyx_t_10 += 2; + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__8); + __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_code_point, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_11; + __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_kp_u__9); + __pyx_t_10 += 2; + __Pyx_GIVEREF(__pyx_kp_u__9); + PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_kp_u__9); + + /* "w3lib/_utr46.pyx":218 + * ): + * raise ValueError( + * f"Domain name {domain_name!r} contains disallowed code point " # <<<<<<<<<<<<<< + * f"U+{ord(code_point):04X} ({code_point})." + * ) + */ + __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 7, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_utr46.pyx":217 + * ) + * ): + * raise ValueError( # <<<<<<<<<<<<<< + * f"Domain name {domain_name!r} contains disallowed code point " + * f"U+{ord(code_point):04X} ({code_point})." + */ + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 217, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":209 + * f"point: U+{ord(code_point):04X} ({code_point})." + * ) + * if entry.status is _Status.DISALLOWED or ( # <<<<<<<<<<<<<< + * use_std3_ascii_rules + * and entry.status + */ + } + + /* "w3lib/_utr46.pyx":221 + * f"U+{ord(code_point):04X} ({code_point})." + * ) + * if entry.status is _Status.IGNORED: # <<<<<<<<<<<<<< + * domain_name = domain_name.replace(code_point, "") + * elif entry.status is _Status.MAPPED or ( + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_status); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Status); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_IGNORED); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = (__pyx_t_5 == __pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "w3lib/_utr46.pyx":222 + * ) + * if entry.status is _Status.IGNORED: + * domain_name = domain_name.replace(code_point, "") # <<<<<<<<<<<<<< + * elif entry.status is _Status.MAPPED or ( + * not use_std3_ascii_rules and entry.status is _Status.DISALLOWED_STD3_MAPPED + */ + if (unlikely(__pyx_v_domain_name == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace"); + __PYX_ERR(0, 222, __pyx_L1_error) + } + __pyx_t_8 = PyUnicode_Replace(__pyx_v_domain_name, __pyx_v_code_point, __pyx_kp_u_, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_domain_name, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "w3lib/_utr46.pyx":221 + * f"U+{ord(code_point):04X} ({code_point})." + * ) + * if entry.status is _Status.IGNORED: # <<<<<<<<<<<<<< + * domain_name = domain_name.replace(code_point, "") + * elif entry.status is _Status.MAPPED or ( + */ + goto __pyx_L12; + } + + /* "w3lib/_utr46.pyx":223 + * if entry.status is _Status.IGNORED: + * domain_name = domain_name.replace(code_point, "") + * elif entry.status is _Status.MAPPED or ( # <<<<<<<<<<<<<< + * not use_std3_ascii_rules and entry.status is _Status.DISALLOWED_STD3_MAPPED + * ): + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_status); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Status); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_MAPPED); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_14 = (__pyx_t_8 == __pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_14) { + } else { + __pyx_t_9 = __pyx_t_14; + goto __pyx_L13_bool_binop_done; + } + + /* "w3lib/_utr46.pyx":224 + * domain_name = domain_name.replace(code_point, "") + * elif entry.status is _Status.MAPPED or ( + * not use_std3_ascii_rules and entry.status is _Status.DISALLOWED_STD3_MAPPED # <<<<<<<<<<<<<< + * ): + * assert entry.mapping is not None + */ + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_use_std3_ascii_rules); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_13 = (!__pyx_t_14); + if (__pyx_t_13) { + } else { + __pyx_t_9 = __pyx_t_13; + goto __pyx_L13_bool_binop_done; + } + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_status); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Status); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_DISALLOWED_STD3_MAPPED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_13 = (__pyx_t_6 == __pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = __pyx_t_13; + __pyx_L13_bool_binop_done:; + + /* "w3lib/_utr46.pyx":223 + * if entry.status is _Status.IGNORED: + * domain_name = domain_name.replace(code_point, "") + * elif entry.status is _Status.MAPPED or ( # <<<<<<<<<<<<<< + * not use_std3_ascii_rules and entry.status is _Status.DISALLOWED_STD3_MAPPED + * ): + */ + if (__pyx_t_9) { + + /* "w3lib/_utr46.pyx":226 + * not use_std3_ascii_rules and entry.status is _Status.DISALLOWED_STD3_MAPPED + * ): + * assert entry.mapping is not None # <<<<<<<<<<<<<< + * domain_name = domain_name.replace(code_point, entry.mapping) + * elif entry.status is _Status.DEVIATION and transitional_processing: + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_mapping); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = (__pyx_t_5 != Py_None); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_9)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 226, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 226, __pyx_L1_error) + #endif + + /* "w3lib/_utr46.pyx":227 + * ): + * assert entry.mapping is not None + * domain_name = domain_name.replace(code_point, entry.mapping) # <<<<<<<<<<<<<< + * elif entry.status is _Status.DEVIATION and transitional_processing: + * assert entry.mapping is not None + */ + if (unlikely(__pyx_v_domain_name == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace"); + __PYX_ERR(0, 227, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_mapping); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyUnicode_Replace(__pyx_v_domain_name, __pyx_v_code_point, __pyx_t_5, -1L); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_domain_name, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "w3lib/_utr46.pyx":223 + * if entry.status is _Status.IGNORED: + * domain_name = domain_name.replace(code_point, "") + * elif entry.status is _Status.MAPPED or ( # <<<<<<<<<<<<<< + * not use_std3_ascii_rules and entry.status is _Status.DISALLOWED_STD3_MAPPED + * ): + */ + goto __pyx_L12; + } + + /* "w3lib/_utr46.pyx":228 + * assert entry.mapping is not None + * domain_name = domain_name.replace(code_point, entry.mapping) + * elif entry.status is _Status.DEVIATION and transitional_processing: # <<<<<<<<<<<<<< + * assert entry.mapping is not None + * domain_name = domain_name.replace(code_point, entry.mapping) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_status); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Status); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_DEVIATION); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = (__pyx_t_6 == __pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_13) { + } else { + __pyx_t_9 = __pyx_t_13; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_transitional_processing); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_9 = __pyx_t_13; + __pyx_L16_bool_binop_done:; + if (__pyx_t_9) { + + /* "w3lib/_utr46.pyx":229 + * domain_name = domain_name.replace(code_point, entry.mapping) + * elif entry.status is _Status.DEVIATION and transitional_processing: + * assert entry.mapping is not None # <<<<<<<<<<<<<< + * domain_name = domain_name.replace(code_point, entry.mapping) + * domain_name = unicodedata.normalize("NFC", domain_name) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_mapping); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = (__pyx_t_8 != Py_None); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_9)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 229, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 229, __pyx_L1_error) + #endif + + /* "w3lib/_utr46.pyx":230 + * elif entry.status is _Status.DEVIATION and transitional_processing: + * assert entry.mapping is not None + * domain_name = domain_name.replace(code_point, entry.mapping) # <<<<<<<<<<<<<< + * domain_name = unicodedata.normalize("NFC", domain_name) + * labels = domain_name.split(".") + */ + if (unlikely(__pyx_v_domain_name == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace"); + __PYX_ERR(0, 230, __pyx_L1_error) + } + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_mapping); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyUnicode_Replace(__pyx_v_domain_name, __pyx_v_code_point, __pyx_t_8, -1L); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_domain_name, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "w3lib/_utr46.pyx":228 + * assert entry.mapping is not None + * domain_name = domain_name.replace(code_point, entry.mapping) + * elif entry.status is _Status.DEVIATION and transitional_processing: # <<<<<<<<<<<<<< + * assert entry.mapping is not None + * domain_name = domain_name.replace(code_point, entry.mapping) + */ + } + __pyx_L12:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":231 + * assert entry.mapping is not None + * domain_name = domain_name.replace(code_point, entry.mapping) + * domain_name = unicodedata.normalize("NFC", domain_name) # <<<<<<<<<<<<<< + * labels = domain_name.split(".") + * check_bidi = check_bidi and _is_bidi_domain_name(domain_name) + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_unicodedata); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_normalize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_n_u_NFC, __pyx_v_domain_name}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_domain_name, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":232 + * domain_name = domain_name.replace(code_point, entry.mapping) + * domain_name = unicodedata.normalize("NFC", domain_name) + * labels = domain_name.split(".") # <<<<<<<<<<<<<< + * check_bidi = check_bidi and _is_bidi_domain_name(domain_name) + * for i, label in enumerate(labels): + */ + if (unlikely(__pyx_v_domain_name == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "split"); + __PYX_ERR(0, 232, __pyx_L1_error) + } + __pyx_t_1 = PyUnicode_Split(__pyx_v_domain_name, __Pyx_NoneAsNull(__pyx_kp_u__7), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_labels = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":233 + * domain_name = unicodedata.normalize("NFC", domain_name) + * labels = domain_name.split(".") + * check_bidi = check_bidi and _is_bidi_domain_name(domain_name) # <<<<<<<<<<<<<< + * for i, label in enumerate(labels): + * if label.startswith("xn--"): + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_check_bidi); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) + if (__pyx_t_9) { + } else { + __Pyx_INCREF(__pyx_v_check_bidi); + __pyx_t_1 = __pyx_v_check_bidi; + goto __pyx_L18_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_is_bidi_domain_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_domain_name}; + __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_INCREF(__pyx_t_8); + __pyx_t_1 = __pyx_t_8; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_L18_bool_binop_done:; + __Pyx_DECREF_SET(__pyx_v_check_bidi, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":234 + * labels = domain_name.split(".") + * check_bidi = check_bidi and _is_bidi_domain_name(domain_name) + * for i, label in enumerate(labels): # <<<<<<<<<<<<<< + * if label.startswith("xn--"): + * new_label = label[4:].encode().decode("punycode") + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + if (likely(PyList_CheckExact(__pyx_v_labels)) || PyTuple_CheckExact(__pyx_v_labels)) { + __pyx_t_8 = __pyx_v_labels; __Pyx_INCREF(__pyx_t_8); + __pyx_t_3 = 0; + __pyx_t_15 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_labels); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 234, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_15)) { + if (likely(PyList_CheckExact(__pyx_t_8))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 234, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 234, __pyx_L1_error) + #else + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 234, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 234, __pyx_L1_error) + #else + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_15(__pyx_t_8); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 234, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_6; + __pyx_t_6 = 0; + + /* "w3lib/_utr46.pyx":235 + * check_bidi = check_bidi and _is_bidi_domain_name(domain_name) + * for i, label in enumerate(labels): + * if label.startswith("xn--"): # <<<<<<<<<<<<<< + * new_label = label[4:].encode().decode("punycode") + * _validate_label( + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_16)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_16); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_kp_u_xn}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_9) { + + /* "w3lib/_utr46.pyx":236 + * for i, label in enumerate(labels): + * if label.startswith("xn--"): + * new_label = label[4:].encode().decode("punycode") # <<<<<<<<<<<<<< + * _validate_label( + * new_label, + */ + __pyx_t_16 = __Pyx_PyObject_GetSlice(__pyx_v_label, 4, 0, NULL, NULL, &__pyx_slice__10, 1, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_encode); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_17))) { + __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17); + if (likely(__pyx_t_16)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); + __Pyx_INCREF(__pyx_t_16); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_17, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_16, NULL}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + } + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decode); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_17))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_17); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_17, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_n_u_punycode}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_new_label, __pyx_t_6); + __pyx_t_6 = 0; + + /* "w3lib/_utr46.pyx":237 + * if label.startswith("xn--"): + * new_label = label[4:].encode().decode("punycode") + * _validate_label( # <<<<<<<<<<<<<< + * new_label, + * transitional_processing=False, + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_validate_label); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "w3lib/_utr46.pyx":238 + * new_label = label[4:].encode().decode("punycode") + * _validate_label( + * new_label, # <<<<<<<<<<<<<< + * transitional_processing=False, + * check_hyphens=check_hyphens, + */ + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_INCREF(__pyx_v_new_label); + __Pyx_GIVEREF(__pyx_v_new_label); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_new_label)) __PYX_ERR(0, 237, __pyx_L1_error); + + /* "w3lib/_utr46.pyx":239 + * _validate_label( + * new_label, + * transitional_processing=False, # <<<<<<<<<<<<<< + * check_hyphens=check_hyphens, + * check_joiners=check_joiners, + */ + __pyx_t_5 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_transitional_processing, Py_False) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":240 + * new_label, + * transitional_processing=False, + * check_hyphens=check_hyphens, # <<<<<<<<<<<<<< + * check_joiners=check_joiners, + * check_bidi=check_bidi, + */ + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_check_hyphens, __pyx_v_check_hyphens) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":241 + * transitional_processing=False, + * check_hyphens=check_hyphens, + * check_joiners=check_joiners, # <<<<<<<<<<<<<< + * check_bidi=check_bidi, + * use_std3_ascii_rules=use_std3_ascii_rules, + */ + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_check_joiners, __pyx_v_check_joiners) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":242 + * check_hyphens=check_hyphens, + * check_joiners=check_joiners, + * check_bidi=check_bidi, # <<<<<<<<<<<<<< + * use_std3_ascii_rules=use_std3_ascii_rules, + * ) + */ + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_check_bidi, __pyx_v_check_bidi) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":243 + * check_joiners=check_joiners, + * check_bidi=check_bidi, + * use_std3_ascii_rules=use_std3_ascii_rules, # <<<<<<<<<<<<<< + * ) + * labels[i] = new_label + */ + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_use_std3_ascii_rules, __pyx_v_use_std3_ascii_rules) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":237 + * if label.startswith("xn--"): + * new_label = label[4:].encode().decode("punycode") + * _validate_label( # <<<<<<<<<<<<<< + * new_label, + * transitional_processing=False, + */ + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_17, __pyx_t_5); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "w3lib/_utr46.pyx":245 + * use_std3_ascii_rules=use_std3_ascii_rules, + * ) + * labels[i] = new_label # <<<<<<<<<<<<<< + * else: + * _validate_label( + */ + if (unlikely((PyObject_SetItem(__pyx_v_labels, __pyx_v_i, __pyx_v_new_label) < 0))) __PYX_ERR(0, 245, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":235 + * check_bidi = check_bidi and _is_bidi_domain_name(domain_name) + * for i, label in enumerate(labels): + * if label.startswith("xn--"): # <<<<<<<<<<<<<< + * new_label = label[4:].encode().decode("punycode") + * _validate_label( + */ + goto __pyx_L22; + } + + /* "w3lib/_utr46.pyx":247 + * labels[i] = new_label + * else: + * _validate_label( # <<<<<<<<<<<<<< + * label, + * transitional_processing=transitional_processing, + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_validate_label); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + + /* "w3lib/_utr46.pyx":248 + * else: + * _validate_label( + * label, # <<<<<<<<<<<<<< + * transitional_processing=transitional_processing, + * check_hyphens=check_hyphens, + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_label); + __Pyx_GIVEREF(__pyx_v_label); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_label)) __PYX_ERR(0, 247, __pyx_L1_error); + + /* "w3lib/_utr46.pyx":249 + * _validate_label( + * label, + * transitional_processing=transitional_processing, # <<<<<<<<<<<<<< + * check_hyphens=check_hyphens, + * check_joiners=check_joiners, + */ + __pyx_t_17 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_transitional_processing, __pyx_v_transitional_processing) < 0) __PYX_ERR(0, 249, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":250 + * label, + * transitional_processing=transitional_processing, + * check_hyphens=check_hyphens, # <<<<<<<<<<<<<< + * check_joiners=check_joiners, + * check_bidi=check_bidi, + */ + if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_check_hyphens, __pyx_v_check_hyphens) < 0) __PYX_ERR(0, 249, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":251 + * transitional_processing=transitional_processing, + * check_hyphens=check_hyphens, + * check_joiners=check_joiners, # <<<<<<<<<<<<<< + * check_bidi=check_bidi, + * use_std3_ascii_rules=use_std3_ascii_rules, + */ + if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_check_joiners, __pyx_v_check_joiners) < 0) __PYX_ERR(0, 249, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":252 + * check_hyphens=check_hyphens, + * check_joiners=check_joiners, + * check_bidi=check_bidi, # <<<<<<<<<<<<<< + * use_std3_ascii_rules=use_std3_ascii_rules, + * ) + */ + if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_check_bidi, __pyx_v_check_bidi) < 0) __PYX_ERR(0, 249, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":253 + * check_joiners=check_joiners, + * check_bidi=check_bidi, + * use_std3_ascii_rules=use_std3_ascii_rules, # <<<<<<<<<<<<<< + * ) + * return ".".join(labels) + */ + if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_use_std3_ascii_rules, __pyx_v_use_std3_ascii_rules) < 0) __PYX_ERR(0, 249, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":247 + * labels[i] = new_label + * else: + * _validate_label( # <<<<<<<<<<<<<< + * label, + * transitional_processing=transitional_processing, + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_5, __pyx_t_17); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_L22:; + + /* "w3lib/_utr46.pyx":234 + * labels = domain_name.split(".") + * check_bidi = check_bidi and _is_bidi_domain_name(domain_name) + * for i, label in enumerate(labels): # <<<<<<<<<<<<<< + * if label.startswith("xn--"): + * new_label = label[4:].encode().decode("punycode") + */ + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_utr46.pyx":255 + * use_std3_ascii_rules=use_std3_ascii_rules, + * ) + * return ".".join(labels) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__7, __pyx_v_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_utr46.pyx":193 + * + * # https://www.unicode.org/reports/tr46/#Processing + * def _process( # <<<<<<<<<<<<<< + * domain_name: str, + * *, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_AddTraceback("w3lib._utr46._process", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_code_point); + __Pyx_XDECREF(__pyx_v_entry); + __Pyx_XDECREF(__pyx_v_labels); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_label); + __Pyx_XDECREF(__pyx_v_new_label); + __Pyx_XDECREF(__pyx_v_domain_name); + __Pyx_XDECREF(__pyx_v_check_bidi); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_utr46.pyx":258 + * + * + * def _convert_label(label: str) -> str: # <<<<<<<<<<<<<< + * if label.isascii(): + * return label + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_6_utr46_11_convert_label(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_10_convert_label, "_convert_label(unicode label: str) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_11_convert_label = {"_convert_label", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_11_convert_label, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46_10_convert_label}; +static PyObject *__pyx_pw_5w3lib_6_utr46_11_convert_label(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_label = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_convert_label (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_label,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 258, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_convert_label") < 0)) __PYX_ERR(0, 258, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_label = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_convert_label", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 258, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._utr46._convert_label", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), (&PyUnicode_Type), 0, "label", 1))) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_6_utr46_10_convert_label(__pyx_self, __pyx_v_label); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_6_utr46_10_convert_label(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_convert_label", 1); + + /* "w3lib/_utr46.pyx":259 + * + * def _convert_label(label: str) -> str: + * if label.isascii(): # <<<<<<<<<<<<<< + * return label + * return f"xn--{label.encode('punycode').decode()}" + */ + __pyx_t_1 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyUnicode_Type_isascii, __pyx_v_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "w3lib/_utr46.pyx":260 + * def _convert_label(label: str) -> str: + * if label.isascii(): + * return label # <<<<<<<<<<<<<< + * return f"xn--{label.encode('punycode').decode()}" + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_label); + __pyx_r = __pyx_v_label; + goto __pyx_L0; + + /* "w3lib/_utr46.pyx":259 + * + * def _convert_label(label: str) -> str: + * if label.isascii(): # <<<<<<<<<<<<<< + * return label + * return f"xn--{label.encode('punycode').decode()}" + */ + } + + /* "w3lib/_utr46.pyx":261 + * if label.isascii(): + * return label + * return f"xn--{label.encode('punycode').decode()}" # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyUnicode_AsEncodedString(__pyx_v_label, ((char const *)"punycode"), NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_decode_bytes(__pyx_t_1, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_xn, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_utr46.pyx":258 + * + * + * def _convert_label(label: str) -> str: # <<<<<<<<<<<<<< + * if label.isascii(): + * return label + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("w3lib._utr46._convert_label", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_utr46.pyx":265 + * + * # https://www.unicode.org/reports/tr46/#ToASCII + * def _to_ascii( # <<<<<<<<<<<<<< + * domain_name: str, + * *, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_6_utr46_13_to_ascii(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_12_to_ascii, "_to_ascii(unicode domain_name: str, *, check_hyphens: bool, check_bidi: bool, check_joiners: bool, use_std3_ascii_rules: bool, transitional_processing: bool, verify_dns_length: bool) -> str"); +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_13_to_ascii = {"_to_ascii", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_13_to_ascii, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46_12_to_ascii}; +static PyObject *__pyx_pw_5w3lib_6_utr46_13_to_ascii(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_domain_name = 0; + PyObject *__pyx_v_check_hyphens = 0; + PyObject *__pyx_v_check_bidi = 0; + PyObject *__pyx_v_check_joiners = 0; + PyObject *__pyx_v_use_std3_ascii_rules = 0; + PyObject *__pyx_v_transitional_processing = 0; + PyObject *__pyx_v_verify_dns_length = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[7] = {0,0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_to_ascii (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain_name,&__pyx_n_s_check_hyphens,&__pyx_n_s_check_bidi,&__pyx_n_s_check_joiners,&__pyx_n_s_use_std3_ascii_rules,&__pyx_n_s_transitional_processing,&__pyx_n_s_verify_dns_length,0}; + if (likely(__pyx_kwds)) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domain_name)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_check_hyphens)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_to_ascii", __pyx_n_s_check_hyphens); __PYX_ERR(0, 265, __pyx_L3_error) + } + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_check_bidi)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_to_ascii", __pyx_n_s_check_bidi); __PYX_ERR(0, 265, __pyx_L3_error) + } + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_check_joiners)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_to_ascii", __pyx_n_s_check_joiners); __PYX_ERR(0, 265, __pyx_L3_error) + } + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_use_std3_ascii_rules)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_to_ascii", __pyx_n_s_use_std3_ascii_rules); __PYX_ERR(0, 265, __pyx_L3_error) + } + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_transitional_processing)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_to_ascii", __pyx_n_s_transitional_processing); __PYX_ERR(0, 265, __pyx_L3_error) + } + if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verify_dns_length)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_to_ascii", __pyx_n_s_verify_dns_length); __PYX_ERR(0, 265, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_to_ascii") < 0)) __PYX_ERR(0, 265, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + __Pyx_RaiseKeywordRequired("_to_ascii", __pyx_n_s_check_hyphens); __PYX_ERR(0, 265, __pyx_L3_error) + } + __pyx_v_domain_name = ((PyObject*)values[0]); + __pyx_v_check_hyphens = values[1]; + __pyx_v_check_bidi = values[2]; + __pyx_v_check_joiners = values[3]; + __pyx_v_use_std3_ascii_rules = values[4]; + __pyx_v_transitional_processing = values[5]; + __pyx_v_verify_dns_length = values[6]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_to_ascii", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 265, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._utr46._to_ascii", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain_name), (&PyUnicode_Type), 0, "domain_name", 1))) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_6_utr46_12_to_ascii(__pyx_self, __pyx_v_domain_name, __pyx_v_check_hyphens, __pyx_v_check_bidi, __pyx_v_check_joiners, __pyx_v_use_std3_ascii_rules, __pyx_v_transitional_processing, __pyx_v_verify_dns_length); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_6_utr46_12_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain_name, PyObject *__pyx_v_check_hyphens, PyObject *__pyx_v_check_bidi, PyObject *__pyx_v_check_joiners, PyObject *__pyx_v_use_std3_ascii_rules, PyObject *__pyx_v_transitional_processing, PyObject *__pyx_v_verify_dns_length) { + PyObject *__pyx_v_labels = NULL; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_label = NULL; + PyObject *__pyx_8genexpr2__pyx_v_label = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + Py_UCS4 __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_to_ascii", 0); + __Pyx_INCREF(__pyx_v_domain_name); + + /* "w3lib/_utr46.pyx":275 + * verify_dns_length: bool, + * ) -> str: + * domain_name = _process( # <<<<<<<<<<<<<< + * domain_name, + * transitional_processing=transitional_processing, + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_process); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "w3lib/_utr46.pyx":276 + * ) -> str: + * domain_name = _process( + * domain_name, # <<<<<<<<<<<<<< + * transitional_processing=transitional_processing, + * check_hyphens=check_hyphens, + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_domain_name); + __Pyx_GIVEREF(__pyx_v_domain_name); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_domain_name)) __PYX_ERR(0, 275, __pyx_L1_error); + + /* "w3lib/_utr46.pyx":277 + * domain_name = _process( + * domain_name, + * transitional_processing=transitional_processing, # <<<<<<<<<<<<<< + * check_hyphens=check_hyphens, + * check_bidi=check_bidi, + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, __pyx_v_transitional_processing) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":278 + * domain_name, + * transitional_processing=transitional_processing, + * check_hyphens=check_hyphens, # <<<<<<<<<<<<<< + * check_bidi=check_bidi, + * check_joiners=check_joiners, + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, __pyx_v_check_hyphens) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":279 + * transitional_processing=transitional_processing, + * check_hyphens=check_hyphens, + * check_bidi=check_bidi, # <<<<<<<<<<<<<< + * check_joiners=check_joiners, + * use_std3_ascii_rules=use_std3_ascii_rules, + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, __pyx_v_check_bidi) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":280 + * check_hyphens=check_hyphens, + * check_bidi=check_bidi, + * check_joiners=check_joiners, # <<<<<<<<<<<<<< + * use_std3_ascii_rules=use_std3_ascii_rules, + * ) + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, __pyx_v_check_joiners) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":281 + * check_bidi=check_bidi, + * check_joiners=check_joiners, + * use_std3_ascii_rules=use_std3_ascii_rules, # <<<<<<<<<<<<<< + * ) + * labels = [_convert_label(label) for label in domain_name.split(".")] + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_v_use_std3_ascii_rules) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":275 + * verify_dns_length: bool, + * ) -> str: + * domain_name = _process( # <<<<<<<<<<<<<< + * domain_name, + * transitional_processing=transitional_processing, + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_domain_name, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "w3lib/_utr46.pyx":283 + * use_std3_ascii_rules=use_std3_ascii_rules, + * ) + * labels = [_convert_label(label) for label in domain_name.split(".")] # <<<<<<<<<<<<<< + * domain_name = ".".join(labels) + * if verify_dns_length: + */ + { /* enter inner scope */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__pyx_v_domain_name == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "split"); + __PYX_ERR(0, 283, __pyx_L5_error) + } + __pyx_t_3 = PyUnicode_Split(__pyx_v_domain_name, __Pyx_NoneAsNull(__pyx_kp_u__7), -1L); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 283, __pyx_L5_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 283, __pyx_L5_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_label, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_convert_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_8genexpr2__pyx_v_label}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 283, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_label); __pyx_8genexpr2__pyx_v_label = 0; + goto __pyx_L9_exit_scope; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_label); __pyx_8genexpr2__pyx_v_label = 0; + goto __pyx_L1_error; + __pyx_L9_exit_scope:; + } /* exit inner scope */ + __pyx_v_labels = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_utr46.pyx":284 + * ) + * labels = [_convert_label(label) for label in domain_name.split(".")] + * domain_name = ".".join(labels) # <<<<<<<<<<<<<< + * if verify_dns_length: + * length = len(domain_name.rstrip(".")) + */ + __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__7, __pyx_v_labels); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_domain_name, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "w3lib/_utr46.pyx":285 + * labels = [_convert_label(label) for label in domain_name.split(".")] + * domain_name = ".".join(labels) + * if verify_dns_length: # <<<<<<<<<<<<<< + * length = len(domain_name.rstrip(".")) + * if not 1 <= length <= 253: + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_verify_dns_length); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 285, __pyx_L1_error) + if (__pyx_t_8) { + + /* "w3lib/_utr46.pyx":286 + * domain_name = ".".join(labels) + * if verify_dns_length: + * length = len(domain_name.rstrip(".")) # <<<<<<<<<<<<<< + * if not 1 <= length <= 253: + * raise ValueError( + */ + __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_rstrip, __pyx_v_domain_name, __pyx_kp_u__7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_length = __pyx_t_5; + + /* "w3lib/_utr46.pyx":287 + * if verify_dns_length: + * length = len(domain_name.rstrip(".")) + * if not 1 <= length <= 253: # <<<<<<<<<<<<<< + * raise ValueError( + * f"The length of domain name {domain_name!r}, excluding the " + */ + __pyx_t_8 = (1 <= __pyx_v_length); + if (__pyx_t_8) { + __pyx_t_8 = (__pyx_v_length <= 0xFD); + } + __pyx_t_9 = (!__pyx_t_8); + if (unlikely(__pyx_t_9)) { + + /* "w3lib/_utr46.pyx":289 + * if not 1 <= length <= 253: + * raise ValueError( + * f"The length of domain name {domain_name!r}, excluding the " # <<<<<<<<<<<<<< + * f"root label and its dot, is {length}. It should be between 1 " + * f"and 253. Pass verify_dns_length=False to avoid this check." + */ + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_10 = 127; + __Pyx_INCREF(__pyx_kp_u_The_length_of_domain_name); + __pyx_t_5 += 26; + __Pyx_GIVEREF(__pyx_kp_u_The_length_of_domain_name); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_The_length_of_domain_name); + __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain_name), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_10; + __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_kp_u_excluding_the_root_label_and_it); + __pyx_t_5 += 43; + __Pyx_GIVEREF(__pyx_kp_u_excluding_the_root_label_and_it); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_excluding_the_root_label_and_it); + + /* "w3lib/_utr46.pyx":290 + * raise ValueError( + * f"The length of domain name {domain_name!r}, excluding the " + * f"root label and its dot, is {length}. It should be between 1 " # <<<<<<<<<<<<<< + * f"and 253. Pass verify_dns_length=False to avoid this check." + * ) + */ + __pyx_t_2 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_length, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_kp_u_It_should_be_between_1_and_253); + __pyx_t_5 += 83; + __Pyx_GIVEREF(__pyx_kp_u_It_should_be_between_1_and_253); + PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_It_should_be_between_1_and_253); + + /* "w3lib/_utr46.pyx":289 + * if not 1 <= length <= 253: + * raise ValueError( + * f"The length of domain name {domain_name!r}, excluding the " # <<<<<<<<<<<<<< + * f"root label and its dot, is {length}. It should be between 1 " + * f"and 253. Pass verify_dns_length=False to avoid this check." + */ + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_utr46.pyx":288 + * length = len(domain_name.rstrip(".")) + * if not 1 <= length <= 253: + * raise ValueError( # <<<<<<<<<<<<<< + * f"The length of domain name {domain_name!r}, excluding the " + * f"root label and its dot, is {length}. It should be between 1 " + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 288, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":287 + * if verify_dns_length: + * length = len(domain_name.rstrip(".")) + * if not 1 <= length <= 253: # <<<<<<<<<<<<<< + * raise ValueError( + * f"The length of domain name {domain_name!r}, excluding the " + */ + } + + /* "w3lib/_utr46.pyx":293 + * f"and 253. Pass verify_dns_length=False to avoid this check." + * ) + * for label in labels: # <<<<<<<<<<<<<< + * length = len(label) + * if not 1 <= length <= 63: + */ + __pyx_t_4 = __pyx_v_labels; __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 293, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 293, __pyx_L1_error) + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":294 + * ) + * for label in labels: + * length = len(label) # <<<<<<<<<<<<<< + * if not 1 <= length <= 63: + * raise ValueError( + */ + __pyx_t_11 = PyObject_Length(__pyx_v_label); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_v_length = __pyx_t_11; + + /* "w3lib/_utr46.pyx":295 + * for label in labels: + * length = len(label) + * if not 1 <= length <= 63: # <<<<<<<<<<<<<< + * raise ValueError( + * f"The length of label {label!r} from domain name " + */ + __pyx_t_9 = (1 <= __pyx_v_length); + if (__pyx_t_9) { + __pyx_t_9 = (__pyx_v_length <= 63); + } + __pyx_t_8 = (!__pyx_t_9); + if (unlikely(__pyx_t_8)) { + + /* "w3lib/_utr46.pyx":297 + * if not 1 <= length <= 63: + * raise ValueError( + * f"The length of label {label!r} from domain name " # <<<<<<<<<<<<<< + * f"{domain_name!r} is {length}. It should be between 1 and " + * f"63. Pass verify_dns_length=False to avoid this check." + */ + __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = 0; + __pyx_t_10 = 127; + __Pyx_INCREF(__pyx_kp_u_The_length_of_label); + __pyx_t_11 += 20; + __Pyx_GIVEREF(__pyx_kp_u_The_length_of_label); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_The_length_of_label); + __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_10; + __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_kp_u_from_domain_name); + __pyx_t_11 += 18; + __Pyx_GIVEREF(__pyx_kp_u_from_domain_name); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_from_domain_name); + + /* "w3lib/_utr46.pyx":298 + * raise ValueError( + * f"The length of label {label!r} from domain name " + * f"{domain_name!r} is {length}. It should be between 1 and " # <<<<<<<<<<<<<< + * f"63. Pass verify_dns_length=False to avoid this check." + * ) + */ + __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain_name), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_10; + __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_kp_u_is); + __pyx_t_11 += 4; + __Pyx_GIVEREF(__pyx_kp_u_is); + PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_is); + __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_length, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_kp_u_It_should_be_between_1_and_63_P); + __pyx_t_11 += 82; + __Pyx_GIVEREF(__pyx_kp_u_It_should_be_between_1_and_63_P); + PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_kp_u_It_should_be_between_1_and_63_P); + + /* "w3lib/_utr46.pyx":297 + * if not 1 <= length <= 63: + * raise ValueError( + * f"The length of label {label!r} from domain name " # <<<<<<<<<<<<<< + * f"{domain_name!r} is {length}. It should be between 1 and " + * f"63. Pass verify_dns_length=False to avoid this check." + */ + __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 7, __pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":296 + * length = len(label) + * if not 1 <= length <= 63: + * raise ValueError( # <<<<<<<<<<<<<< + * f"The length of label {label!r} from domain name " + * f"{domain_name!r} is {length}. It should be between 1 and " + */ + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 296, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":295 + * for label in labels: + * length = len(label) + * if not 1 <= length <= 63: # <<<<<<<<<<<<<< + * raise ValueError( + * f"The length of label {label!r} from domain name " + */ + } + + /* "w3lib/_utr46.pyx":293 + * f"and 253. Pass verify_dns_length=False to avoid this check." + * ) + * for label in labels: # <<<<<<<<<<<<<< + * length = len(label) + * if not 1 <= length <= 63: + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_utr46.pyx":285 + * labels = [_convert_label(label) for label in domain_name.split(".")] + * domain_name = ".".join(labels) + * if verify_dns_length: # <<<<<<<<<<<<<< + * length = len(domain_name.rstrip(".")) + * if not 1 <= length <= 253: + */ + } + + /* "w3lib/_utr46.pyx":301 + * f"63. Pass verify_dns_length=False to avoid this check." + * ) + * return domain_name # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_domain_name); + __pyx_r = __pyx_v_domain_name; + goto __pyx_L0; + + /* "w3lib/_utr46.pyx":265 + * + * # https://www.unicode.org/reports/tr46/#ToASCII + * def _to_ascii( # <<<<<<<<<<<<<< + * domain_name: str, + * *, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("w3lib._utr46._to_ascii", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_labels); + __Pyx_XDECREF(__pyx_v_label); + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_label); + __Pyx_XDECREF(__pyx_v_domain_name); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *__pyx_freelist_5w3lib_6_utr46___pyx_scope_struct__genexpr[8]; +static int __pyx_freecount_5w3lib_6_utr46___pyx_scope_struct__genexpr = 0; + +static PyObject *__pyx_tp_new_5w3lib_6_utr46___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + #if CYTHON_COMPILING_IN_CPYTHON + if (likely((int)(__pyx_freecount_5w3lib_6_utr46___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr)))) { + o = (PyObject*)__pyx_freelist_5w3lib_6_utr46___pyx_scope_struct__genexpr[--__pyx_freecount_5w3lib_6_utr46___pyx_scope_struct__genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else + #endif + { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc_5w3lib_6_utr46___pyx_scope_struct__genexpr(PyObject *o) { + struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *p = (struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5w3lib_6_utr46___pyx_scope_struct__genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_value); + #if CYTHON_COMPILING_IN_CPYTHON + if (((int)(__pyx_freecount_5w3lib_6_utr46___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr)))) { + __pyx_freelist_5w3lib_6_utr46___pyx_scope_struct__genexpr[__pyx_freecount_5w3lib_6_utr46___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *)o); + } else + #endif + { + #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + (*Py_TYPE(o)->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + if (tp_free) tp_free(o); + } + #endif + } +} + +static int __pyx_tp_traverse_5w3lib_6_utr46___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *p = (struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *)o; + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + } + if (p->__pyx_v_value) { + e = (*v)(p->__pyx_v_value, a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5w3lib_6_utr46___pyx_scope_struct__genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_5w3lib_6_utr46___pyx_scope_struct__genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_5w3lib_6_utr46___pyx_scope_struct__genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr_spec = { + "w3lib._utr46.__pyx_scope_struct__genexpr", + sizeof(struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "w3lib._utr46.""__pyx_scope_struct__genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_5w3lib_6_utr46___pyx_scope_struct__genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_5w3lib_6_utr46___pyx_scope_struct__genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_5w3lib_6_utr46___pyx_scope_struct__genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *__pyx_freelist_5w3lib_6_utr46___pyx_scope_struct_1_genexpr[8]; +static int __pyx_freecount_5w3lib_6_utr46___pyx_scope_struct_1_genexpr = 0; + +static PyObject *__pyx_tp_new_5w3lib_6_utr46___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + #if CYTHON_COMPILING_IN_CPYTHON + if (likely((int)(__pyx_freecount_5w3lib_6_utr46___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr)))) { + o = (PyObject*)__pyx_freelist_5w3lib_6_utr46___pyx_scope_struct_1_genexpr[--__pyx_freecount_5w3lib_6_utr46___pyx_scope_struct_1_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else + #endif + { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc_5w3lib_6_utr46___pyx_scope_struct_1_genexpr(PyObject *o) { + struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5w3lib_6_utr46___pyx_scope_struct_1_genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_code_point); + #if CYTHON_COMPILING_IN_CPYTHON + if (((int)(__pyx_freecount_5w3lib_6_utr46___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr)))) { + __pyx_freelist_5w3lib_6_utr46___pyx_scope_struct_1_genexpr[__pyx_freecount_5w3lib_6_utr46___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *)o); + } else + #endif + { + #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + (*Py_TYPE(o)->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + if (tp_free) tp_free(o); + } + #endif + } +} + +static int __pyx_tp_traverse_5w3lib_6_utr46___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *)o; + if (p->__pyx_v_code_point) { + e = (*v)(p->__pyx_v_code_point, a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5w3lib_6_utr46___pyx_scope_struct_1_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_5w3lib_6_utr46___pyx_scope_struct_1_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_5w3lib_6_utr46___pyx_scope_struct_1_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr_spec = { + "w3lib._utr46.__pyx_scope_struct_1_genexpr", + sizeof(struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "w3lib._utr46.""__pyx_scope_struct_1_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_5w3lib_6_utr46___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_5w3lib_6_utr46___pyx_scope_struct_1_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_5w3lib_6_utr46___pyx_scope_struct_1_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, + {&__pyx_kp_u_04X, __pyx_k_04X, sizeof(__pyx_k_04X), 0, 1, 0, 0}, + {&__pyx_n_u_AL, __pyx_k_AL, sizeof(__pyx_k_AL), 0, 1, 0, 1}, + {&__pyx_n_u_AN, __pyx_k_AN, sizeof(__pyx_k_AN), 0, 1, 0, 1}, + {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, + {&__pyx_n_s_DEVIATION, __pyx_k_DEVIATION, sizeof(__pyx_k_DEVIATION), 0, 0, 1, 1}, + {&__pyx_n_s_DISALLOWED, __pyx_k_DISALLOWED, sizeof(__pyx_k_DISALLOWED), 0, 0, 1, 1}, + {&__pyx_n_s_DISALLOWED_STD3_MAPPED, __pyx_k_DISALLOWED_STD3_MAPPED, sizeof(__pyx_k_DISALLOWED_STD3_MAPPED), 0, 0, 1, 1}, + {&__pyx_n_s_DISALLOWED_STD3_VALID, __pyx_k_DISALLOWED_STD3_VALID, sizeof(__pyx_k_DISALLOWED_STD3_VALID), 0, 0, 1, 1}, + {&__pyx_n_s_Dict, __pyx_k_Dict, sizeof(__pyx_k_Dict), 0, 0, 1, 1}, + {&__pyx_kp_s_Dict_str__Entry, __pyx_k_Dict_str__Entry, sizeof(__pyx_k_Dict_str__Entry), 0, 0, 1, 0}, + {&__pyx_kp_u_Domain_name, __pyx_k_Domain_name, sizeof(__pyx_k_Domain_name), 0, 1, 0, 0}, + {&__pyx_kp_u_Domain_name_label, __pyx_k_Domain_name_label, sizeof(__pyx_k_Domain_name_label), 0, 1, 0, 0}, + {&__pyx_n_s_Entry, __pyx_k_Entry, sizeof(__pyx_k_Entry), 0, 0, 1, 1}, + {&__pyx_kp_s_Entry_2, __pyx_k_Entry_2, sizeof(__pyx_k_Entry_2), 0, 0, 1, 0}, + {&__pyx_n_s_Entry___init, __pyx_k_Entry___init, sizeof(__pyx_k_Entry___init), 0, 0, 1, 1}, + {&__pyx_n_s_Entry_from_match, __pyx_k_Entry_from_match, sizeof(__pyx_k_Entry_from_match), 0, 0, 1, 1}, + {&__pyx_n_s_Entry_from_match_locals_genexpr, __pyx_k_Entry_from_match_locals_genexpr, sizeof(__pyx_k_Entry_from_match_locals_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_Enum, __pyx_k_Enum, sizeof(__pyx_k_Enum), 0, 0, 1, 1}, + {&__pyx_n_s_IDNA_MAPPING_TABLE, __pyx_k_IDNA_MAPPING_TABLE, sizeof(__pyx_k_IDNA_MAPPING_TABLE), 0, 0, 1, 1}, + {&__pyx_n_s_IGNORED, __pyx_k_IGNORED, sizeof(__pyx_k_IGNORED), 0, 0, 1, 1}, + {&__pyx_kp_u_It_should_be_between_1_and_253, __pyx_k_It_should_be_between_1_and_253, sizeof(__pyx_k_It_should_be_between_1_and_253), 0, 1, 0, 0}, + {&__pyx_kp_u_It_should_be_between_1_and_63_P, __pyx_k_It_should_be_between_1_and_63_P, sizeof(__pyx_k_It_should_be_between_1_and_63_P), 0, 1, 0, 0}, + {&__pyx_kp_u_Line, __pyx_k_Line, sizeof(__pyx_k_Line), 0, 1, 0, 0}, + {&__pyx_n_u_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 1, 0, 1}, + {&__pyx_n_s_MAPPED, __pyx_k_MAPPED, sizeof(__pyx_k_MAPPED), 0, 0, 1, 1}, + {&__pyx_n_s_Match, __pyx_k_Match, sizeof(__pyx_k_Match), 0, 0, 1, 1}, + {&__pyx_n_u_NFC, __pyx_k_NFC, sizeof(__pyx_k_NFC), 0, 1, 0, 1}, + {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1}, + {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1}, + {&__pyx_kp_s_Optional_str, __pyx_k_Optional_str, sizeof(__pyx_k_Optional_str), 0, 0, 1, 0}, + {&__pyx_n_s_Path, __pyx_k_Path, sizeof(__pyx_k_Path), 0, 0, 1, 1}, + {&__pyx_n_u_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 1, 0, 1}, + {&__pyx_n_s_Status, __pyx_k_Status, sizeof(__pyx_k_Status), 0, 0, 1, 1}, + {&__pyx_kp_u_The_length_of_domain_name, __pyx_k_The_length_of_domain_name, sizeof(__pyx_k_The_length_of_domain_name), 0, 1, 0, 0}, + {&__pyx_kp_u_The_length_of_label, __pyx_k_The_length_of_label, sizeof(__pyx_k_The_length_of_label), 0, 1, 0, 0}, + {&__pyx_n_s_Type, __pyx_k_Type, sizeof(__pyx_k_Type), 0, 0, 1, 1}, + {&__pyx_kp_s_Type__Entry, __pyx_k_Type__Entry, sizeof(__pyx_k_Type__Entry), 0, 0, 1, 0}, + {&__pyx_kp_u_Unknown_IDNA_mapping_table_statu, __pyx_k_Unknown_IDNA_mapping_table_statu, sizeof(__pyx_k_Unknown_IDNA_mapping_table_statu), 0, 1, 0, 0}, + {&__pyx_n_s_VALID, __pyx_k_VALID, sizeof(__pyx_k_VALID), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 1, 1}, + {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, + {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, + {&__pyx_n_s__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 0, 1, 1}, + {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, + {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, + {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, + {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, + {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, + {&__pyx_n_s_auto, __pyx_k_auto, sizeof(__pyx_k_auto), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_bidirectional, __pyx_k_bidirectional, sizeof(__pyx_k_bidirectional), 0, 0, 1, 1}, + {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_category, __pyx_k_category, sizeof(__pyx_k_category), 0, 0, 1, 1}, + {&__pyx_n_s_check_bidi, __pyx_k_check_bidi, sizeof(__pyx_k_check_bidi), 0, 0, 1, 1}, + {&__pyx_n_s_check_bidi_2, __pyx_k_check_bidi_2, sizeof(__pyx_k_check_bidi_2), 0, 0, 1, 1}, + {&__pyx_n_s_check_contextj_rules, __pyx_k_check_contextj_rules, sizeof(__pyx_k_check_contextj_rules), 0, 0, 1, 1}, + {&__pyx_n_s_check_hyphens, __pyx_k_check_hyphens, sizeof(__pyx_k_check_hyphens), 0, 0, 1, 1}, + {&__pyx_n_s_check_joiners, __pyx_k_check_joiners, sizeof(__pyx_k_check_joiners), 0, 0, 1, 1}, + {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_code_point, __pyx_k_code_point, sizeof(__pyx_k_code_point), 0, 0, 1, 1}, + {&__pyx_kp_u_contains_a, __pyx_k_contains_a, sizeof(__pyx_k_contains_a), 0, 1, 0, 0}, + {&__pyx_kp_u_contains_a_code_point_U, __pyx_k_contains_a_code_point_U, sizeof(__pyx_k_contains_a_code_point_U), 0, 1, 0, 0}, + {&__pyx_kp_u_contains_an_unrecognized_code_p, __pyx_k_contains_an_unrecognized_code_p, sizeof(__pyx_k_contains_an_unrecognized_code_p), 0, 1, 0, 0}, + {&__pyx_kp_u_contains_disallowed_code_point, __pyx_k_contains_disallowed_code_point, sizeof(__pyx_k_contains_disallowed_code_point), 0, 1, 0, 0}, + {&__pyx_kp_u_contains_in_its_3rd_and_4rd_pos, __pyx_k_contains_in_its_3rd_and_4rd_pos, sizeof(__pyx_k_contains_in_its_3rd_and_4rd_pos), 0, 1, 0, 0}, + {&__pyx_n_s_convert_label, __pyx_k_convert_label, sizeof(__pyx_k_convert_label), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_u_deviation, __pyx_k_deviation, sizeof(__pyx_k_deviation), 0, 1, 0, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, + {&__pyx_n_u_disallowed, __pyx_k_disallowed, sizeof(__pyx_k_disallowed), 0, 1, 0, 1}, + {&__pyx_n_u_disallowed_STD3_mapped, __pyx_k_disallowed_STD3_mapped, sizeof(__pyx_k_disallowed_STD3_mapped), 0, 1, 0, 1}, + {&__pyx_n_u_disallowed_STD3_valid, __pyx_k_disallowed_STD3_valid, sizeof(__pyx_k_disallowed_STD3_valid), 0, 1, 0, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_kp_u_does_not_match_the_expected_pat, __pyx_k_does_not_match_the_expected_pat, sizeof(__pyx_k_does_not_match_the_expected_pat), 0, 1, 0, 0}, + {&__pyx_n_s_domain_name, __pyx_k_domain_name, sizeof(__pyx_k_domain_name), 0, 0, 1, 1}, + {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_u_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 1, 0, 1}, + {&__pyx_kp_u_ends_with, __pyx_k_ends_with, sizeof(__pyx_k_ends_with), 0, 1, 0, 0}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_entry, __pyx_k_entry, sizeof(__pyx_k_entry), 0, 0, 1, 1}, + {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_kp_u_excluding_the_root_label_and_it, __pyx_k_excluding_the_root_label_and_it, sizeof(__pyx_k_excluding_the_root_label_and_it), 0, 1, 0, 0}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_file_name, __pyx_k_file_name, sizeof(__pyx_k_file_name), 0, 0, 1, 1}, + {&__pyx_n_s_form, __pyx_k_form, sizeof(__pyx_k_form), 0, 0, 1, 1}, + {&__pyx_kp_u_from, __pyx_k_from, sizeof(__pyx_k_from), 0, 1, 0, 0}, + {&__pyx_kp_u_from_domain_name, __pyx_k_from_domain_name, sizeof(__pyx_k_from_domain_name), 0, 1, 0, 0}, + {&__pyx_n_s_from_match, __pyx_k_from_match, sizeof(__pyx_k_from_match), 0, 0, 1, 1}, + {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, + {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_u_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 1, 0, 1}, + {&__pyx_n_s_idna, __pyx_k_idna, sizeof(__pyx_k_idna), 0, 0, 1, 1}, + {&__pyx_kp_u_idna_txt, __pyx_k_idna_txt, sizeof(__pyx_k_idna_txt), 0, 1, 0, 0}, + {&__pyx_n_u_ignored, __pyx_k_ignored, sizeof(__pyx_k_ignored), 0, 1, 0, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_kp_u_in_the_Mark_general_category_fr, __pyx_k_in_the_Mark_general_category_fr, sizeof(__pyx_k_in_the_Mark_general_category_fr), 0, 1, 0, 0}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, + {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, + {&__pyx_n_s_input, __pyx_k_input, sizeof(__pyx_k_input), 0, 0, 1, 1}, + {&__pyx_kp_u_is, __pyx_k_is, sizeof(__pyx_k_is), 0, 1, 0, 0}, + {&__pyx_n_s_is_bidi_domain_name, __pyx_k_is_bidi_domain_name, sizeof(__pyx_k_is_bidi_domain_name), 0, 0, 1, 1}, + {&__pyx_n_s_is_bidi_domain_name_locals_gene, __pyx_k_is_bidi_domain_name_locals_gene, sizeof(__pyx_k_is_bidi_domain_name_locals_gene), 0, 0, 1, 1}, + {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, + {&__pyx_n_s_is_normalized, __pyx_k_is_normalized, sizeof(__pyx_k_is_normalized), 0, 0, 1, 1}, + {&__pyx_n_s_is_normalized_2, __pyx_k_is_normalized_2, sizeof(__pyx_k_is_normalized_2), 0, 0, 1, 1}, + {&__pyx_n_u_is_normalized_2, __pyx_k_is_normalized_2, sizeof(__pyx_k_is_normalized_2), 0, 1, 0, 1}, + {&__pyx_kp_u_is_not_in_Unicode_Normalization, __pyx_k_is_not_in_Unicode_Normalization, sizeof(__pyx_k_is_not_in_Unicode_Normalization), 0, 1, 0, 0}, + {&__pyx_n_s_isascii, __pyx_k_isascii, sizeof(__pyx_k_isascii), 0, 0, 1, 1}, + {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, + {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1}, + {&__pyx_n_s_labels, __pyx_k_labels, sizeof(__pyx_k_labels), 0, 0, 1, 1}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1}, + {&__pyx_n_s_load_idna_mapping_table, __pyx_k_load_idna_mapping_table, sizeof(__pyx_k_load_idna_mapping_table), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_u_mapped, __pyx_k_mapped, sizeof(__pyx_k_mapped), 0, 1, 0, 1}, + {&__pyx_n_s_mapping, __pyx_k_mapping, sizeof(__pyx_k_mapping), 0, 0, 1, 1}, + {&__pyx_n_u_mapping, __pyx_k_mapping, sizeof(__pyx_k_mapping), 0, 1, 0, 1}, + {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_new_label, __pyx_k_new_label, sizeof(__pyx_k_new_label), 0, 0, 1, 1}, + {&__pyx_n_s_normalize, __pyx_k_normalize, sizeof(__pyx_k_normalize), 0, 0, 1, 1}, + {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, + {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1}, + {&__pyx_n_s_pathlib, __pyx_k_pathlib, sizeof(__pyx_k_pathlib), 0, 0, 1, 1}, + {&__pyx_n_s_pattern, __pyx_k_pattern, sizeof(__pyx_k_pattern), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_process, __pyx_k_process, sizeof(__pyx_k_process), 0, 0, 1, 1}, + {&__pyx_n_u_punycode, __pyx_k_punycode, sizeof(__pyx_k_punycode), 0, 1, 0, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, + {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, + {&__pyx_n_s_rfc5892, __pyx_k_rfc5892, sizeof(__pyx_k_rfc5892), 0, 0, 1, 1}, + {&__pyx_n_s_rstrip, __pyx_k_rstrip, sizeof(__pyx_k_rstrip), 0, 0, 1, 1}, + {&__pyx_n_s_search, __pyx_k_search, sizeof(__pyx_k_search), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, + {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_u_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 1, 0, 1}, + {&__pyx_kp_u_starts_with, __pyx_k_starts_with, sizeof(__pyx_k_starts_with), 0, 1, 0, 0}, + {&__pyx_kp_u_starts_with_a_character, __pyx_k_starts_with_a_character, sizeof(__pyx_k_starts_with_a_character), 0, 1, 0, 0}, + {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, + {&__pyx_n_s_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1}, + {&__pyx_n_u_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 1, 0, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_to_ascii, __pyx_k_to_ascii, sizeof(__pyx_k_to_ascii), 0, 0, 1, 1}, + {&__pyx_n_s_transitional_processing, __pyx_k_transitional_processing, sizeof(__pyx_k_transitional_processing), 0, 0, 1, 1}, + {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, + {&__pyx_n_s_unicodedata, __pyx_k_unicodedata, sizeof(__pyx_k_unicodedata), 0, 0, 1, 1}, + {&__pyx_n_s_unistr, __pyx_k_unistr, sizeof(__pyx_k_unistr), 0, 0, 1, 1}, + {&__pyx_n_s_use_std3_ascii_rules, __pyx_k_use_std3_ascii_rules, sizeof(__pyx_k_use_std3_ascii_rules), 0, 0, 1, 1}, + {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, + {&__pyx_n_u_valid, __pyx_k_valid, sizeof(__pyx_k_valid), 0, 1, 0, 1}, + {&__pyx_n_s_validate_label, __pyx_k_validate_label, sizeof(__pyx_k_validate_label), 0, 0, 1, 1}, + {&__pyx_n_s_verify_dns_length, __pyx_k_verify_dns_length, sizeof(__pyx_k_verify_dns_length), 0, 0, 1, 1}, + {&__pyx_n_s_w3lib__utr46, __pyx_k_w3lib__utr46, sizeof(__pyx_k_w3lib__utr46), 0, 0, 1, 1}, + {&__pyx_kp_s_w3lib__utr46_pyx, __pyx_k_w3lib__utr46_pyx, sizeof(__pyx_k_w3lib__utr46_pyx), 0, 0, 1, 0}, + {&__pyx_kp_u_which_is_neither_valid_nor_a_de, __pyx_k_which_is_neither_valid_nor_a_de, sizeof(__pyx_k_which_is_neither_valid_nor_a_de), 0, 1, 0, 0}, + {&__pyx_kp_u_x_P_id_0_9A_F_4_6_P_start_0_9A, __pyx_k_x_P_id_0_9A_F_4_6_P_start_0_9A, sizeof(__pyx_k_x_P_id_0_9A_F_4_6_P_start_0_9A), 0, 1, 0, 0}, + {&__pyx_kp_u_xn, __pyx_k_xn, sizeof(__pyx_k_xn), 0, 1, 0, 0}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 234, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "w3lib/_utr46.pyx":94 + * """ + * mapping = {} + * with open(file_name, encoding="utf-8") as input: # <<<<<<<<<<<<<< + * for line in input: + * if line.startswith("#") or not line.strip(): + */ + __pyx_tuple__4 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "w3lib/_utr46.pyx":236 + * for i, label in enumerate(labels): + * if label.startswith("xn--"): + * new_label = label[4:].encode().decode("punycode") # <<<<<<<<<<<<<< + * _validate_label( + * new_label, + */ + __pyx_slice__10 = PySlice_New(__pyx_int_4, Py_None, Py_None); if (unlikely(!__pyx_slice__10)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__10); + __Pyx_GIVEREF(__pyx_slice__10); + + /* "w3lib/_utr46.pyx":17 + * else: + * + * def _is_normalized(form: str, unistr: str) -> bool: # <<<<<<<<<<<<<< + * return unicodedata.normalize(form, unistr) == unistr + * + */ + __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_form, __pyx_n_s_unistr); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_is_normalized, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 17, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":32 + * + * class _Entry: # pylint: disable=too-few-public-methods + * @classmethod # <<<<<<<<<<<<<< + * def from_match(cls: Type["_Entry"], match: Match) -> "_Entry": + * if match["status"] == "disallowed": + */ + __pyx_tuple__14 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_match, __pyx_n_s_status, __pyx_n_s_mapping, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_from_match, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 32, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":64 + * ) + * + * def __init__(self: "_Entry", *, mapping: Optional[str], status: _Status) -> None: # <<<<<<<<<<<<<< + * self.mapping = mapping + * self.status = status + */ + __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_mapping, __pyx_n_s_status); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_init, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 64, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":69 + * + * + * def _load_idna_mapping_table() -> Dict[str, _Entry]: # <<<<<<<<<<<<<< + * file_name = Path(__file__).parent / "idna.txt" + * pattern = r"""(?x) + */ + __pyx_tuple__18 = PyTuple_Pack(11, __pyx_n_s_file_name, __pyx_n_s_pattern, __pyx_n_s_mapping, __pyx_n_s_input, __pyx_n_s_line, __pyx_n_s_match, __pyx_n_s_entry, __pyx_n_s_code_point, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_id); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_load_idna_mapping_table, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 69, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":121 + * + * # https://www.unicode.org/reports/tr46/#Validity_Criteria + * def _validate_label( # <<<<<<<<<<<<<< + * label: str, + * *, + */ + __pyx_tuple__20 = PyTuple_Pack(9, __pyx_n_s_label, __pyx_n_s_check_hyphens, __pyx_n_s_check_joiners, __pyx_n_s_check_bidi, __pyx_n_s_transitional_processing, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_length, __pyx_n_s_code_point, __pyx_n_s_entry); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_validate_label, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 121, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":185 + * + * # https://www.unicode.org/reports/tr46/#Notation + * def _is_bidi_domain_name(domain_name: str) -> bool: # <<<<<<<<<<<<<< + * return any( + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} + */ + __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_domain_name, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_is_bidi_domain_name, 185, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 185, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":193 + * + * # https://www.unicode.org/reports/tr46/#Processing + * def _process( # <<<<<<<<<<<<<< + * domain_name: str, + * *, + */ + __pyx_tuple__24 = PyTuple_Pack(12, __pyx_n_s_domain_name, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_check_hyphens, __pyx_n_s_check_bidi, __pyx_n_s_check_joiners, __pyx_n_s_transitional_processing, __pyx_n_s_code_point, __pyx_n_s_entry, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_label, __pyx_n_s_new_label); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_process, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 193, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":258 + * + * + * def _convert_label(label: str) -> str: # <<<<<<<<<<<<<< + * if label.isascii(): + * return label + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_label); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_convert_label, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 258, __pyx_L1_error) + + /* "w3lib/_utr46.pyx":265 + * + * # https://www.unicode.org/reports/tr46/#ToASCII + * def _to_ascii( # <<<<<<<<<<<<<< + * domain_name: str, + * *, + */ + __pyx_tuple__28 = PyTuple_Pack(11, __pyx_n_s_domain_name, __pyx_n_s_check_hyphens, __pyx_n_s_check_bidi, __pyx_n_s_check_joiners, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_transitional_processing, __pyx_n_s_verify_dns_length, __pyx_n_s_labels, __pyx_n_s_length, __pyx_n_s_label, __pyx_n_s_label); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_to_ascii, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + __pyx_umethod_PyUnicode_Type_isascii.type = (PyObject*)&PyUnicode_Type; + __pyx_umethod_PyUnicode_Type_isascii.method_name = &__pyx_n_s_isascii; + __pyx_umethod_PyUnicode_Type_rstrip.type = (PyObject*)&PyUnicode_Type; + __pyx_umethod_PyUnicode_Type_rstrip.method_name = &__pyx_n_s_rstrip; + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + /* AssertionsEnabled.init */ + if (likely(__Pyx_init_assertions_enabled() == 0)); else + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr)) __PYX_ERR(0, 57, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr_spec, __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 57, __pyx_L1_error) + #else + __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr = &__pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 57, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 187, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 187, __pyx_L1_error) + #else + __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr = &__pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 187, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__utr46(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__utr46}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "_utr46", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_utr46(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_utr46(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__utr46(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__utr46(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__utr46(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_utr46' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_utr46", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_utr46" pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__utr46(void)", 0); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_w3lib___utr46) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "w3lib._utr46")) { + if (unlikely((PyDict_SetItemString(modules, "w3lib._utr46", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "w3lib/_utr46.pyx":3 + * # https://www.unicode.org/reports/tr46/ + * + * import re # <<<<<<<<<<<<<< + * import unicodedata + * from enum import auto, Enum + */ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":4 + * + * import re + * import unicodedata # <<<<<<<<<<<<<< + * from enum import auto, Enum + * from pathlib import Path + */ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_unicodedata, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicodedata, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":5 + * import re + * import unicodedata + * from enum import auto, Enum # <<<<<<<<<<<<<< + * from pathlib import Path + * from typing import Dict, Match, Optional, Type + */ + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_auto); + __Pyx_GIVEREF(__pyx_n_s_auto); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_auto)) __PYX_ERR(0, 5, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Enum); + __Pyx_GIVEREF(__pyx_n_s_Enum); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_Enum)) __PYX_ERR(0, 5, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_enum, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_auto); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_auto, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Enum, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":6 + * import unicodedata + * from enum import auto, Enum + * from pathlib import Path # <<<<<<<<<<<<<< + * from typing import Dict, Match, Optional, Type + * + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_Path); + __Pyx_GIVEREF(__pyx_n_s_Path); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Path)) __PYX_ERR(0, 6, __pyx_L1_error); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pathlib, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Path, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":7 + * from enum import auto, Enum + * from pathlib import Path + * from typing import Dict, Match, Optional, Type # <<<<<<<<<<<<<< + * + * from ._rfc5892 import _check_contextj_rules + */ + __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_Dict); + __Pyx_GIVEREF(__pyx_n_s_Dict); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Dict)) __PYX_ERR(0, 7, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Match); + __Pyx_GIVEREF(__pyx_n_s_Match); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_Match)) __PYX_ERR(0, 7, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Optional); + __Pyx_GIVEREF(__pyx_n_s_Optional); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_Optional)) __PYX_ERR(0, 7, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Type); + __Pyx_GIVEREF(__pyx_n_s_Type); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_Type)) __PYX_ERR(0, 7, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Dict, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Match); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Match, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Optional); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":9 + * from typing import Dict, Match, Optional, Type + * + * from ._rfc5892 import _check_contextj_rules # <<<<<<<<<<<<<< + * from idna import check_bidi as _check_bidi + * + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_check_contextj_rules); + __Pyx_GIVEREF(__pyx_n_s_check_contextj_rules); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_check_contextj_rules)) __PYX_ERR(0, 9, __pyx_L1_error); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_rfc5892, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_check_contextj_rules); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_contextj_rules, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":10 + * + * from ._rfc5892 import _check_contextj_rules + * from idna import check_bidi as _check_bidi # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_check_bidi); + __Pyx_GIVEREF(__pyx_n_s_check_bidi); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_check_bidi)) __PYX_ERR(0, 10, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_idna, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_check_bidi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_bidi_2, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":13 + * + * + * if hasattr(unicodedata, "is_normalized"): # <<<<<<<<<<<<<< + * _is_normalized = unicodedata.is_normalized + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_unicodedata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_HasAttr(__pyx_t_3, __pyx_n_u_is_normalized_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "w3lib/_utr46.pyx":14 + * + * if hasattr(unicodedata, "is_normalized"): + * _is_normalized = unicodedata.is_normalized # <<<<<<<<<<<<<< + * else: + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_unicodedata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_is_normalized_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_normalized, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":13 + * + * + * if hasattr(unicodedata, "is_normalized"): # <<<<<<<<<<<<<< + * _is_normalized = unicodedata.is_normalized + * else: + */ + goto __pyx_L2; + } + + /* "w3lib/_utr46.pyx":17 + * else: + * + * def _is_normalized(form: str, unistr: str) -> bool: # <<<<<<<<<<<<<< + * return unicodedata.normalize(form, unistr) == unistr + * + */ + /*else*/ { + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_form, __pyx_n_s_str) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_unistr, __pyx_n_s_str) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_1_is_normalized, 0, __pyx_n_s_is_normalized, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_normalized, __pyx_t_3) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L2:; + + /* "w3lib/_utr46.pyx":21 + * + * + * class _Status(Enum): # <<<<<<<<<<<<<< + * DISALLOWED = auto() + * DISALLOWED_STD3_MAPPED = auto() + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_n_s_Status, __pyx_n_s_Status, (PyObject *) NULL, __pyx_n_s_w3lib__utr46, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_3 != __pyx_t_2) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 21, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":22 + * + * class _Status(Enum): + * DISALLOWED = auto() # <<<<<<<<<<<<<< + * DISALLOWED_STD3_MAPPED = auto() + * DISALLOWED_STD3_VALID = auto() + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_auto); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_DISALLOWED, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":23 + * class _Status(Enum): + * DISALLOWED = auto() + * DISALLOWED_STD3_MAPPED = auto() # <<<<<<<<<<<<<< + * DISALLOWED_STD3_VALID = auto() + * IGNORED = auto() + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_auto); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_DISALLOWED_STD3_MAPPED, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":24 + * DISALLOWED = auto() + * DISALLOWED_STD3_MAPPED = auto() + * DISALLOWED_STD3_VALID = auto() # <<<<<<<<<<<<<< + * IGNORED = auto() + * MAPPED = auto() + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_auto); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_DISALLOWED_STD3_VALID, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":25 + * DISALLOWED_STD3_MAPPED = auto() + * DISALLOWED_STD3_VALID = auto() + * IGNORED = auto() # <<<<<<<<<<<<<< + * MAPPED = auto() + * DEVIATION = auto() + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_auto); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_IGNORED, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":26 + * DISALLOWED_STD3_VALID = auto() + * IGNORED = auto() + * MAPPED = auto() # <<<<<<<<<<<<<< + * DEVIATION = auto() + * VALID = auto() + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_auto); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_MAPPED, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":27 + * IGNORED = auto() + * MAPPED = auto() + * DEVIATION = auto() # <<<<<<<<<<<<<< + * VALID = auto() + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_auto); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_DEVIATION, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":28 + * MAPPED = auto() + * DEVIATION = auto() + * VALID = auto() # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_auto); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_VALID, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_utr46.pyx":21 + * + * + * class _Status(Enum): # <<<<<<<<<<<<<< + * DISALLOWED = auto() + * DISALLOWED_STD3_MAPPED = auto() + */ + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_Status, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Status, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":31 + * + * + * class _Entry: # pylint: disable=too-few-public-methods # <<<<<<<<<<<<<< + * @classmethod + * def from_match(cls: Type["_Entry"], match: Match) -> "_Entry": + */ + __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Entry, __pyx_n_s_Entry, (PyObject *) NULL, __pyx_n_s_w3lib__utr46, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_utr46.pyx":32 + * + * class _Entry: # pylint: disable=too-few-public-methods + * @classmethod # <<<<<<<<<<<<<< + * def from_match(cls: Type["_Entry"], match: Match) -> "_Entry": + * if match["status"] == "disallowed": + */ + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_cls, __pyx_kp_s_Type__Entry) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_match, __pyx_n_s_Match) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_Entry_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_6_Entry_1from_match, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Entry_from_match, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_from_match, __pyx_t_5) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_utr46.pyx":64 + * ) + * + * def __init__(self: "_Entry", *, mapping: Optional[str], status: _Status) -> None: # <<<<<<<<<<<<<< + * self.mapping = mapping + * self.status = status + */ + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_self, __pyx_kp_s_Entry_2) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mapping, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_status, __pyx_n_s_Status) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_6_Entry_3__init__, 0, __pyx_n_s_Entry___init, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_utr46.pyx":31 + * + * + * class _Entry: # pylint: disable=too-few-public-methods # <<<<<<<<<<<<<< + * @classmethod + * def from_match(cls: Type["_Entry"], match: Match) -> "_Entry": + */ + __pyx_t_6 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Entry, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Entry, __pyx_t_6) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":69 + * + * + * def _load_idna_mapping_table() -> Dict[str, _Entry]: # <<<<<<<<<<<<<< + * file_name = Path(__file__).parent / "idna.txt" + * pattern = r"""(?x) + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Dict_str__Entry) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_3_load_idna_mapping_table, 0, __pyx_n_s_load_idna_mapping_table, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_load_idna_mapping_table, __pyx_t_6) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_utr46.pyx":117 + * + * + * _IDNA_MAPPING_TABLE = _load_idna_mapping_table() # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_load_idna_mapping_table); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_IDNA_MAPPING_TABLE, __pyx_t_3) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":121 + * + * # https://www.unicode.org/reports/tr46/#Validity_Criteria + * def _validate_label( # <<<<<<<<<<<<<< + * label: str, + * *, + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 121, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, __pyx_n_s_bool) < 0) __PYX_ERR(0, 121, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, __pyx_n_s_bool) < 0) __PYX_ERR(0, 121, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, __pyx_n_s_bool) < 0) __PYX_ERR(0, 121, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, __pyx_n_s_bool) < 0) __PYX_ERR(0, 121, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_bool) < 0) __PYX_ERR(0, 121, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_5_validate_label, 0, __pyx_n_s_validate_label, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_validate_label, __pyx_t_6) < 0) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_utr46.pyx":185 + * + * # https://www.unicode.org/reports/tr46/#Notation + * def _is_bidi_domain_name(domain_name: str) -> bool: # <<<<<<<<<<<<<< + * return any( + * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} + */ + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domain_name, __pyx_n_s_str) < 0) __PYX_ERR(0, 185, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_7_is_bidi_domain_name, 0, __pyx_n_s_is_bidi_domain_name, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_bidi_domain_name, __pyx_t_3) < 0) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":193 + * + * # https://www.unicode.org/reports/tr46/#Processing + * def _process( # <<<<<<<<<<<<<< + * domain_name: str, + * *, + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_domain_name, __pyx_n_s_str) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_bool) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, __pyx_n_s_bool) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, __pyx_n_s_bool) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, __pyx_n_s_bool) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, __pyx_n_s_bool) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_9_process, 0, __pyx_n_s_process, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_process, __pyx_t_6) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_utr46.pyx":258 + * + * + * def _convert_label(label: str) -> str: # <<<<<<<<<<<<<< + * if label.isascii(): + * return label + */ + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 258, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_11_convert_label, 0, __pyx_n_s_convert_label, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_label, __pyx_t_3) < 0) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_utr46.pyx":265 + * + * # https://www.unicode.org/reports/tr46/#ToASCII + * def _to_ascii( # <<<<<<<<<<<<<< + * domain_name: str, + * *, + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_domain_name, __pyx_n_s_str) < 0) __PYX_ERR(0, 265, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, __pyx_n_s_bool) < 0) __PYX_ERR(0, 265, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, __pyx_n_s_bool) < 0) __PYX_ERR(0, 265, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, __pyx_n_s_bool) < 0) __PYX_ERR(0, 265, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_bool) < 0) __PYX_ERR(0, 265, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, __pyx_n_s_bool) < 0) __PYX_ERR(0, 265, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_n_s_bool) < 0) __PYX_ERR(0, 265, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_13_to_ascii, 0, __pyx_n_s_to_ascii, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_ascii, __pyx_t_6) < 0) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_utr46.pyx":1 + * # https://www.unicode.org/reports/tr46/ # <<<<<<<<<<<<<< + * + * import re + */ + __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init w3lib._utr46", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init w3lib._utr46"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +#endif +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* TupleAndListFromArray */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + Py_INCREF(__pyx_empty_tuple); + return __pyx_empty_tuple; + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} +static CYTHON_INLINE PyObject * +__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return PyList_New(0); + } + res = PyList_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); + return res; +} +#endif + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* fastcall */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) +{ + Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + for (i = 0; i < n; i++) + { + if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + } + for (i = 0; i < n; i++) + { + int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + if (unlikely(eq != 0)) { + if (unlikely(eq < 0)) return NULL; + return kwvalues[i]; + } + } + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { + Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + PyObject *dict; + dict = PyDict_New(); + if (unlikely(!dict)) + return NULL; + for (i=0; i= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); + while (1) { + Py_XDECREF(key); key = NULL; + Py_XDECREF(value); value = NULL; + if (kwds_is_tuple) { + Py_ssize_t size; +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(kwds); +#else + size = PyTuple_Size(kwds); + if (size < 0) goto bad; +#endif + if (pos >= size) break; +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); + if (!key) goto bad; +#elif CYTHON_ASSUME_SAFE_MACROS + key = PyTuple_GET_ITEM(kwds, pos); +#else + key = PyTuple_GetItem(kwds, pos); + if (!key) goto bad; +#endif + value = kwvalues[pos]; + pos++; + } + else + { + if (!PyDict_Next(kwds, &pos, &key, &value)) break; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + } + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(value); + Py_DECREF(key); +#endif + key = NULL; + value = NULL; + continue; + } +#if !CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + Py_INCREF(value); + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = ( + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key) + ); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + Py_XDECREF(key); + Py_XDECREF(value); + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + #if PY_MAJOR_VERSION < 3 + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + Py_XDECREF(key); + Py_XDECREF(value); + return -1; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + type_name = __Pyx_PyType_GetName(type); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { + return NULL; + } + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { + return NULL; + } + #endif + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectFastCall */ +#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result = 0; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: + Py_DECREF(argstuple); + return result; +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); + } + else if (nargs == 1 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); + } +#endif + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); + } + } + #if PY_VERSION_HEX >= 0x030700A1 + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + if (kwargs == NULL) { + #if CYTHON_VECTORCALL + #if PY_VERSION_HEX < 0x03090000 + vectorcallfunc f = _PyVectorcall_Function(func); + #else + vectorcallfunc f = PyVectorcall_Function(func); + #endif + if (f) { + return f(func, args, (size_t)nargs, NULL); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, NULL); + } + #endif + } + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + } + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif +} + +/* RaiseUnboundLocalError */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type = NULL, *local_value, *local_tb = NULL; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030C00A6 + local_value = tstate->current_exception; + tstate->current_exception = 0; + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } + #else + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + #endif +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 + if (unlikely(tstate->current_exception)) +#elif CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + #if PY_VERSION_HEX >= 0x030B00a4 + tmp_value = exc_info->exc_value; + exc_info->exc_value = local_value; + tmp_type = NULL; + tmp_tb = NULL; + Py_XDECREF(local_type); + Py_XDECREF(local_tb); + #else + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + #endif + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* pep479 */ +static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { + PyObject *exc, *val, *tb, *cur_exc; + __Pyx_PyThreadState_declare + #ifdef __Pyx_StopAsyncIteration_USED + int is_async_stopiteration = 0; + #endif + CYTHON_MAYBE_UNUSED_VAR(in_async_gen); + cur_exc = PyErr_Occurred(); + if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { + #ifdef __Pyx_StopAsyncIteration_USED + if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { + is_async_stopiteration = 1; + } else + #endif + return; + } + __Pyx_PyThreadState_assign + __Pyx_GetException(&exc, &val, &tb); + Py_XDECREF(exc); + Py_XDECREF(val); + Py_XDECREF(tb); + PyErr_SetString(PyExc_RuntimeError, + #ifdef __Pyx_StopAsyncIteration_USED + is_async_stopiteration ? "async generator raised StopAsyncIteration" : + in_async_gen ? "async generator raised StopIteration" : + #endif + "generator raised StopIteration"); +} + +/* DictGetItem */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); + } + } else { + PyErr_SetObject(PyExc_KeyError, key); + } + } + return NULL; + } + Py_INCREF(value); + return value; +} +#endif + +/* PyObjectFormatAndDecref */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { + if (unlikely(!s)) return NULL; + if (likely(PyUnicode_CheckExact(s))) return s; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(s))) { + PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); + Py_DECREF(s); + return result; + } + #endif + return __Pyx_PyObject_FormatAndDecref(s, f); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { + PyObject *result; + if (unlikely(!s)) return NULL; + result = PyObject_Format(s, f); + Py_DECREF(s); + return result; +} + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + __Pyx_PyThreadState_declare + CYTHON_UNUSED_VAR(cause); + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + #if PY_VERSION_HEX >= 0x030C00A6 + PyException_SetTraceback(value, tb); + #elif CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* RaiseKeywordRequired */ +static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name) { + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() needs keyword-only argument %U", func_name, kw_name); + #else + "%s() needs keyword-only argument %s", func_name, + PyString_AS_STRING(kw_name)); + #endif +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* PyObjectLookupSpecial */ +#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { + PyObject *res; + PyTypeObject *tp = Py_TYPE(obj); +#if PY_MAJOR_VERSION < 3 + if (unlikely(PyInstance_Check(obj))) + return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); +#endif + res = _PyType_Lookup(tp, attr_name); + if (likely(res)) { + descrgetfunc f = Py_TYPE(res)->tp_descr_get; + if (!f) { + Py_INCREF(res); + } else { + res = f(res, obj, (PyObject *)tp); + } + } else if (with_error) { + PyErr_SetObject(PyExc_AttributeError, attr_name); + } + return res; +} +#endif + +/* JoinPyUnicode */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char) { +#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyObject *result_uval; + int result_ukind, kind_shift; + Py_ssize_t i, char_pos; + void *result_udata; + CYTHON_MAYBE_UNUSED_VAR(max_char); +#if CYTHON_PEP393_ENABLED + result_uval = PyUnicode_New(result_ulength, max_char); + if (unlikely(!result_uval)) return NULL; + result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; + kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; + result_udata = PyUnicode_DATA(result_uval); +#else + result_uval = PyUnicode_FromUnicode(NULL, result_ulength); + if (unlikely(!result_uval)) return NULL; + result_ukind = sizeof(Py_UNICODE); + kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; + result_udata = PyUnicode_AS_UNICODE(result_uval); +#endif + assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + char_pos = 0; + for (i=0; i < value_count; i++) { + int ukind; + Py_ssize_t ulength; + void *udata; + PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); + if (unlikely(__Pyx_PyUnicode_READY(uval))) + goto bad; + ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + if (unlikely(!ulength)) + continue; + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) + goto overflow; + ukind = __Pyx_PyUnicode_KIND(uval); + udata = __Pyx_PyUnicode_DATA(uval); + if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); + } else { + #if PY_VERSION_HEX >= 0x030d0000 + if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; + #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); + #else + Py_ssize_t j; + for (j=0; j < ulength; j++) { + Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); + __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); + } + #endif + } + char_pos += ulength; + } + return result_uval; +overflow: + PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); +bad: + Py_DECREF(result_uval); + return NULL; +#else + CYTHON_UNUSED_VAR(max_char); + CYTHON_UNUSED_VAR(result_ulength); + CYTHON_UNUSED_VAR(value_count); + return PyUnicode_Join(__pyx_empty_unicode, value_tuple); +#endif +} + +/* PyIntBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_MAYBE_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + + x = (long)((unsigned long)a + (unsigned long)b); + if (likely((x^a) >= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + return __Pyx_NewRef(op2); + } + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } else { + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + double result; + + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + PyObject *exc_value = exc_info->exc_value; + if (exc_value == NULL || exc_value == Py_None) { + *value = NULL; + *type = NULL; + *tb = NULL; + } else { + *value = exc_value; + Py_INCREF(*value); + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + *tb = PyException_GetTraceback(exc_value); + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #endif +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + PyObject *tmp_value = exc_info->exc_value; + exc_info->exc_value = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); + #else + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); + #endif +} +#endif + +/* PyUnicode_Substring */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring( + PyObject* text, Py_ssize_t start, Py_ssize_t stop) { + Py_ssize_t length; + if (unlikely(__Pyx_PyUnicode_READY(text) == -1)) return NULL; + length = __Pyx_PyUnicode_GET_LENGTH(text); + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + else if (stop > length) + stop = length; + if (stop <= start) + return __Pyx_NewRef(__pyx_empty_unicode); + if (start == 0 && stop == length) + return __Pyx_NewRef(text); +#if CYTHON_PEP393_ENABLED + return PyUnicode_FromKindAndData(PyUnicode_KIND(text), + PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start); +#else + return PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(text)+start, stop-start); +#endif +} + +/* unicode_tailmatch */ +static int __Pyx_PyUnicode_TailmatchTuple(PyObject* s, PyObject* substrings, + Py_ssize_t start, Py_ssize_t end, int direction) { + Py_ssize_t i, count = PyTuple_GET_SIZE(substrings); + for (i = 0; i < count; i++) { + Py_ssize_t result; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + result = PyUnicode_Tailmatch(s, PyTuple_GET_ITEM(substrings, i), + start, end, direction); +#else + PyObject* sub = PySequence_ITEM(substrings, i); + if (unlikely(!sub)) return -1; + result = PyUnicode_Tailmatch(s, sub, start, end, direction); + Py_DECREF(sub); +#endif + if (result) { + return (int) result; + } + } + return 0; +} +static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr, + Py_ssize_t start, Py_ssize_t end, int direction) { + if (unlikely(PyTuple_Check(substr))) { + return __Pyx_PyUnicode_TailmatchTuple(s, substr, start, end, direction); + } + return (int) PyUnicode_Tailmatch(s, substr, start, end, direction); +} + +/* GetItemIntUnicode */ +static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i, + int wraparound, int boundscheck) { + Py_ssize_t length; + if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return (Py_UCS4)-1; + if (wraparound | boundscheck) { + length = __Pyx_PyUnicode_GET_LENGTH(ustring); + if (wraparound & unlikely(i < 0)) i += length; + if ((!boundscheck) || likely(__Pyx_is_valid_index(i, length))) { + return __Pyx_PyUnicode_READ_CHAR(ustring, i); + } else { + PyErr_SetString(PyExc_IndexError, "string index out of range"); + return (Py_UCS4)-1; + } + } else { + return __Pyx_PyUnicode_READ_CHAR(ustring, i); + } +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (unlikely(!j)) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (mm && mm->mp_subscript) { + PyObject *r, *key = PyInt_FromSsize_t(i); + if (unlikely(!key)) return NULL; + r = mm->mp_subscript(o, key); + Py_DECREF(key); + return r; + } + if (likely(sm && sm->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return sm->sq_item(o, i); + } + } +#else + if (is_list || !PyMapping_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { + PyObject* exc_type; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + exc_type = __Pyx_PyErr_CurrentExceptionType(); + if (unlikely(exc_type)) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) + return -1; + __Pyx_PyErr_Clear(); + return 0; + } + return 0; +} + +/* set_iter */ +static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set, + Py_ssize_t* p_orig_length, int* p_source_is_set) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 + is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable)); + *p_source_is_set = is_set; + if (likely(is_set)) { + *p_orig_length = PySet_Size(iterable); + Py_INCREF(iterable); + return iterable; + } +#else + CYTHON_UNUSED_VAR(is_set); + *p_source_is_set = 0; +#endif + *p_orig_length = 0; + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_set_iter_next( + PyObject* iter_obj, Py_ssize_t orig_length, + Py_ssize_t* ppos, PyObject **value, + int source_is_set) { + if (!CYTHON_COMPILING_IN_CPYTHON || PY_VERSION_HEX >= 0x030d0000 || unlikely(!source_is_set)) { + *value = PyIter_Next(iter_obj); + if (unlikely(!*value)) { + return __Pyx_IterFinish(); + } + CYTHON_UNUSED_VAR(orig_length); + CYTHON_UNUSED_VAR(ppos); + return 1; + } +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 + if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) { + PyErr_SetString( + PyExc_RuntimeError, + "set changed size during iteration"); + return -1; + } + { + Py_hash_t hash; + int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash); + assert (ret != -1); + if (likely(ret)) { + Py_INCREF(*value); + return 1; + } + } +#endif + return 0; +} + +/* UnicodeAsUCS4 */ +static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { + Py_ssize_t length; + #if CYTHON_PEP393_ENABLED + length = PyUnicode_GET_LENGTH(x); + if (likely(length == 1)) { + return PyUnicode_READ_CHAR(x, 0); + } + #else + length = PyUnicode_GET_SIZE(x); + if (likely(length == 1)) { + return PyUnicode_AS_UNICODE(x)[0]; + } + #if Py_UNICODE_SIZE == 2 + else if (PyUnicode_GET_SIZE(x) == 2) { + Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0]; + if (high_val >= 0xD800 && high_val <= 0xDBFF) { + Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1]; + if (low_val >= 0xDC00 && low_val <= 0xDFFF) { + return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1))); + } + } + } + #endif + #endif + PyErr_Format(PyExc_ValueError, + "only single character unicode strings can be converted to Py_UCS4, " + "got length %" CYTHON_FORMAT_SSIZE_T "d", length); + return (Py_UCS4)-1; +} + +/* object_ord */ +static long __Pyx__PyObject_Ord(PyObject* c) { + Py_ssize_t size; + if (PyBytes_Check(c)) { + size = PyBytes_GET_SIZE(c); + if (likely(size == 1)) { + return (unsigned char) PyBytes_AS_STRING(c)[0]; + } +#if PY_MAJOR_VERSION < 3 + } else if (PyUnicode_Check(c)) { + return (long)__Pyx_PyUnicode_AsPy_UCS4(c); +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + } else if (PyByteArray_Check(c)) { + size = PyByteArray_GET_SIZE(c); + if (likely(size == 1)) { + return (unsigned char) PyByteArray_AS_STRING(c)[0]; + } +#endif + } else { + __Pyx_TypeName c_type_name = __Pyx_PyType_GetName(Py_TYPE(c)); + PyErr_Format(PyExc_TypeError, + "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found", + c_type_name); + __Pyx_DECREF_TypeName(c_type_name); + return (long)(Py_UCS4)-1; + } + PyErr_Format(PyExc_TypeError, + "ord() expected a character, but string of length %zd found", size); + return (long)(Py_UCS4)-1; +} + +/* CIntToDigits */ +static const char DIGIT_PAIRS_10[2*10*10+1] = { + "00010203040506070809" + "10111213141516171819" + "20212223242526272829" + "30313233343536373839" + "40414243444546474849" + "50515253545556575859" + "60616263646566676869" + "70717273747576777879" + "80818283848586878889" + "90919293949596979899" +}; +static const char DIGIT_PAIRS_8[2*8*8+1] = { + "0001020304050607" + "1011121314151617" + "2021222324252627" + "3031323334353637" + "4041424344454647" + "5051525354555657" + "6061626364656667" + "7071727374757677" +}; +static const char DIGITS_HEX[2*16+1] = { + "0123456789abcdef" + "0123456789ABCDEF" +}; + +/* BuildPyUnicode */ +static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, + int prepend_sign, char padding_char) { + PyObject *uval; + Py_ssize_t uoffset = ulength - clength; +#if CYTHON_USE_UNICODE_INTERNALS + Py_ssize_t i; +#if CYTHON_PEP393_ENABLED + void *udata; + uval = PyUnicode_New(ulength, 127); + if (unlikely(!uval)) return NULL; + udata = PyUnicode_DATA(uval); +#else + Py_UNICODE *udata; + uval = PyUnicode_FromUnicode(NULL, ulength); + if (unlikely(!uval)) return NULL; + udata = PyUnicode_AS_UNICODE(uval); +#endif + if (uoffset > 0) { + i = 0; + if (prepend_sign) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); + i++; + } + for (; i < uoffset; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); + } + } + for (i=0; i < clength; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); + } +#else + { + PyObject *sign = NULL, *padding = NULL; + uval = NULL; + if (uoffset > 0) { + prepend_sign = !!prepend_sign; + if (uoffset > prepend_sign) { + padding = PyUnicode_FromOrdinal(padding_char); + if (likely(padding) && uoffset > prepend_sign + 1) { + PyObject *tmp; + PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign); + if (unlikely(!repeat)) goto done_or_error; + tmp = PyNumber_Multiply(padding, repeat); + Py_DECREF(repeat); + Py_DECREF(padding); + padding = tmp; + } + if (unlikely(!padding)) goto done_or_error; + } + if (prepend_sign) { + sign = PyUnicode_FromOrdinal('-'); + if (unlikely(!sign)) goto done_or_error; + } + } + uval = PyUnicode_DecodeASCII(chars, clength, NULL); + if (likely(uval) && padding) { + PyObject *tmp = PyNumber_Add(padding, uval); + Py_DECREF(uval); + uval = tmp; + } + if (likely(uval) && sign) { + PyObject *tmp = PyNumber_Add(sign, uval); + Py_DECREF(uval); + uval = tmp; + } +done_or_error: + Py_XDECREF(padding); + Py_XDECREF(sign); + } +#endif + return uval; +} + +/* CIntToPyUnicode */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) { + char digits[sizeof(long)*3+2]; + char *dpos, *end = digits + sizeof(long)*3+2; + const char *hex_digits = DIGITS_HEX; + Py_ssize_t length, ulength; + int prepend_sign, last_one_off; + long remaining; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (format_char == 'X') { + hex_digits += 16; + format_char = 'x'; + } + remaining = value; + last_one_off = 0; + dpos = end; + do { + int digit_pos; + switch (format_char) { + case 'o': + digit_pos = abs((int)(remaining % (8*8))); + remaining = (long) (remaining / (8*8)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); + last_one_off = (digit_pos < 8); + break; + case 'd': + digit_pos = abs((int)(remaining % (10*10))); + remaining = (long) (remaining / (10*10)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); + last_one_off = (digit_pos < 10); + break; + case 'x': + *(--dpos) = hex_digits[abs((int)(remaining % 16))]; + remaining = (long) (remaining / 16); + break; + default: + assert(0); + break; + } + } while (unlikely(remaining != 0)); + assert(!last_one_off || *dpos == '0'); + dpos += last_one_off; + length = end - dpos; + ulength = length; + prepend_sign = 0; + if (!is_unsigned && value <= neg_one) { + if (padding_char == ' ' || width <= length + 1) { + *(--dpos) = '-'; + ++length; + } else { + prepend_sign = 1; + } + ++ulength; + } + if (width > ulength) { + ulength = width; + } + if (ulength == 1) { + return PyUnicode_FromOrdinal(*dpos); + } + return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); +} + +/* RaiseUnexpectedTypeError */ +static int +__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) +{ + __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, + expected, obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* SliceObject */ +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) { + __Pyx_TypeName obj_type_name; +#if CYTHON_USE_TYPE_SLOTS + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + goto bad; + PyErr_Clear(); + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#else + CYTHON_UNUSED_VAR(wraparound); +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#else + CYTHON_UNUSED_VAR(wraparound); +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_USE_TYPE_SLOTS + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); +bad: + return NULL; +} + +/* UnpackUnboundCMethod */ +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), + METH_VARARGS | METH_KEYWORDS, + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #else + if (likely(!__Pyx_CyOrPyCFunction_Check(method))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY +#else + if (PyCFunction_Check(method)) +#endif + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); + } +#else + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + target->method = unbound_method; + } + } + return 0; +} + +/* CallUnboundCMethod0 */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *args, *result = NULL; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_ASSUME_SAFE_MACROS + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); +#else + args = PyTuple_Pack(1, self); + if (unlikely(!args)) goto bad; +#endif + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + Py_DECREF(args); +bad: + return result; +} + +/* decode_c_bytes */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( + const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + if (unlikely((start < 0) | (stop < 0))) { + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + if (stop > length) + stop = length; + if (unlikely(stop <= start)) + return __Pyx_NewRef(__pyx_empty_unicode); + length = stop - start; + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + if (likely(cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return (*(cfunc->func))(self, arg); + } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { + #if PY_VERSION_HEX >= 0x030700A0 + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + #else + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + #endif + } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } + return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(2, self, arg); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* CIntToPyUnicode */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) { + char digits[sizeof(Py_ssize_t)*3+2]; + char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2; + const char *hex_digits = DIGITS_HEX; + Py_ssize_t length, ulength; + int prepend_sign, last_one_off; + Py_ssize_t remaining; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (format_char == 'X') { + hex_digits += 16; + format_char = 'x'; + } + remaining = value; + last_one_off = 0; + dpos = end; + do { + int digit_pos; + switch (format_char) { + case 'o': + digit_pos = abs((int)(remaining % (8*8))); + remaining = (Py_ssize_t) (remaining / (8*8)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); + last_one_off = (digit_pos < 8); + break; + case 'd': + digit_pos = abs((int)(remaining % (10*10))); + remaining = (Py_ssize_t) (remaining / (10*10)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); + last_one_off = (digit_pos < 10); + break; + case 'x': + *(--dpos) = hex_digits[abs((int)(remaining % 16))]; + remaining = (Py_ssize_t) (remaining / 16); + break; + default: + assert(0); + break; + } + } while (unlikely(remaining != 0)); + assert(!last_one_off || *dpos == '0'); + dpos += last_one_off; + length = end - dpos; + ulength = length; + prepend_sign = 0; + if (!is_unsigned && value <= neg_one) { + if (padding_char == ' ' || width <= length + 1) { + *(--dpos) = '-'; + ++length; + } else { + prepend_sign = 1; + } + ++ulength; + } + if (width > ulength) { + ulength = width; + } + if (ulength == 1) { + return PyUnicode_FromOrdinal(*dpos); + } + return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); +} + +/* FixUpExtensionType */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { +#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + CYTHON_UNUSED_VAR(spec); + CYTHON_UNUSED_VAR(type); +#else + const PyType_Slot *slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_members) + slot++; + if (slot && slot->slot == Py_tp_members) { + int changed = 0; +#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) + const +#endif + PyMemberDef *memb = (PyMemberDef*) slot->pfunc; + while (memb && memb->name) { + if (memb->name[0] == '_' && memb->name[1] == '_') { +#if PY_VERSION_HEX < 0x030900b1 + if (strcmp(memb->name, "__weaklistoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_weaklistoffset = memb->offset; + changed = 1; + } + else if (strcmp(memb->name, "__dictoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_dictoffset = memb->offset; + changed = 1; + } +#if CYTHON_METH_FASTCALL + else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); +#if PY_VERSION_HEX >= 0x030800b4 + type->tp_vectorcall_offset = memb->offset; +#else + type->tp_print = (printfunc) memb->offset; +#endif + changed = 1; + } +#endif +#else + if ((0)); +#endif +#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON + else if (strcmp(memb->name, "__module__") == 0) { + PyObject *descr; + assert(memb->type == T_OBJECT); + assert(memb->flags == 0 || memb->flags == READONLY); + descr = PyDescr_NewMember(type, memb); + if (unlikely(!descr)) + return -1; + if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { + Py_DECREF(descr); + return -1; + } + Py_DECREF(descr); + changed = 1; + } +#endif + } + memb++; + } + if (changed) + PyType_Modified(type); + } +#endif + return 0; +} +#endif + +/* PyObjectCallNoArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { + PyObject *arg[2] = {NULL, NULL}; + return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + __Pyx_TypeName type_name; + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR + if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) +#elif PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (likely(descr != NULL)) { + *method = descr; + return 0; + } + type_name = __Pyx_PyType_GetName(tp); + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", + type_name, name); +#else + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", + type_name, PyString_AS_STRING(name)); +#endif + __Pyx_DECREF_TypeName(type_name); + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* ValidateBasesTuple */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { + Py_ssize_t i, n; +#if CYTHON_ASSUME_SAFE_MACROS + n = PyTuple_GET_SIZE(bases); +#else + n = PyTuple_Size(bases); + if (n < 0) return -1; +#endif + for (i = 1; i < n; i++) + { +#if CYTHON_AVOID_BORROWED_REFS + PyObject *b0 = PySequence_GetItem(bases, i); + if (!b0) return -1; +#elif CYTHON_ASSUME_SAFE_MACROS + PyObject *b0 = PyTuple_GET_ITEM(bases, i); +#else + PyObject *b0 = PyTuple_GetItem(bases, i); + if (!b0) return -1; +#endif + PyTypeObject *b; +#if PY_MAJOR_VERSION < 3 + if (PyClass_Check(b0)) + { + PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", + PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } +#endif + b = (PyTypeObject*) b0; + if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); + __Pyx_DECREF_TypeName(b_name); +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } + if (dictoffset == 0) + { + Py_ssize_t b_dictoffset = 0; +#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + b_dictoffset = b->tp_dictoffset; +#else + PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); + if (!py_b_dictoffset) goto dictoffset_return; + b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); + Py_DECREF(py_b_dictoffset); + if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; +#endif + if (b_dictoffset) { + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "extension type '%.200s' has no __dict__ slot, " + "but base type '" __Pyx_FMT_TYPENAME "' has: " + "either add 'cdef dict __dict__' to the extension type " + "or add '__slots__ = [...]' to the base type", + type_name, b_name); + __Pyx_DECREF_TypeName(b_name); + } +#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) + dictoffset_return: +#endif +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } + } +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + } + return 0; +} +#endif + +/* PyType_Ready */ +static int __Pyx_PyType_Ready(PyTypeObject *t) { +#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) + (void)__Pyx_PyObject_CallMethod0; +#if CYTHON_USE_TYPE_SPECS + (void)__Pyx_validate_bases_tuple; +#endif + return PyType_Ready(t); +#else + int r; + PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); + if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) + return -1; +#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) + { + int gc_was_enabled; + #if PY_VERSION_HEX >= 0x030A00b1 + gc_was_enabled = PyGC_Disable(); + (void)__Pyx_PyObject_CallMethod0; + #else + PyObject *ret, *py_status; + PyObject *gc = NULL; + #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) + gc = PyImport_GetModule(__pyx_kp_u_gc); + #endif + if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) return -1; + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + if (unlikely(!py_status)) { + Py_DECREF(gc); + return -1; + } + gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); + Py_DECREF(py_status); + if (gc_was_enabled > 0) { + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + if (unlikely(!ret)) { + Py_DECREF(gc); + return -1; + } + Py_DECREF(ret); + } else if (unlikely(gc_was_enabled == -1)) { + Py_DECREF(gc); + return -1; + } + #endif + t->tp_flags |= Py_TPFLAGS_HEAPTYPE; +#if PY_VERSION_HEX >= 0x030A0000 + t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; +#endif +#else + (void)__Pyx_PyObject_CallMethod0; +#endif + r = PyType_Ready(t); +#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) + t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; + #if PY_VERSION_HEX >= 0x030A00b1 + if (gc_was_enabled) + PyGC_Enable(); + #else + if (gc_was_enabled) { + PyObject *tp, *v, *tb; + PyErr_Fetch(&tp, &v, &tb); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + if (likely(ret || r == -1)) { + Py_XDECREF(ret); + PyErr_Restore(tp, v, tb); + } else { + Py_XDECREF(tp); + Py_XDECREF(v); + Py_XDECREF(tb); + r = -1; + } + } + Py_DECREF(gc); + #endif + } +#endif + return r; +#endif +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", + type_name, attr_name); +#else + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", + type_name, PyString_AS_STRING(attr_name)); +#endif + __Pyx_DECREF_TypeName(type_name); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportDottedModule */ +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { + PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + if (unlikely(PyErr_Occurred())) { + PyErr_Clear(); + } + if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { + partial_name = name; + } else { + slice = PySequence_GetSlice(parts_tuple, 0, count); + if (unlikely(!slice)) + goto bad; + sep = PyUnicode_FromStringAndSize(".", 1); + if (unlikely(!sep)) + goto bad; + partial_name = PyUnicode_Join(sep, slice); + } + PyErr_Format( +#if PY_MAJOR_VERSION < 3 + PyExc_ImportError, + "No module named '%s'", PyString_AS_STRING(partial_name)); +#else +#if PY_VERSION_HEX >= 0x030600B1 + PyExc_ModuleNotFoundError, +#else + PyExc_ImportError, +#endif + "No module named '%U'", partial_name); +#endif +bad: + Py_XDECREF(sep); + Py_XDECREF(slice); + Py_XDECREF(partial_name); + return NULL; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { + PyObject *imported_module; +#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + return NULL; + imported_module = __Pyx_PyDict_GetItemStr(modules, name); + Py_XINCREF(imported_module); +#else + imported_module = PyImport_GetModule(name); +#endif + return imported_module; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { + Py_ssize_t i, nparts; + nparts = PyTuple_GET_SIZE(parts_tuple); + for (i=1; i < nparts && module; i++) { + PyObject *part, *submodule; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + part = PyTuple_GET_ITEM(parts_tuple, i); +#else + part = PySequence_ITEM(parts_tuple, i); +#endif + submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); +#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(part); +#endif + Py_DECREF(module); + module = submodule; + } + if (unlikely(!module)) { + return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); + } + return module; +} +#endif +static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if PY_MAJOR_VERSION < 3 + PyObject *module, *from_list, *star = __pyx_n_s__11; + CYTHON_UNUSED_VAR(parts_tuple); + from_list = PyList_New(1); + if (unlikely(!from_list)) + return NULL; + Py_INCREF(star); + PyList_SET_ITEM(from_list, 0, star); + module = __Pyx_Import(name, from_list, 0); + Py_DECREF(from_list); + return module; +#else + PyObject *imported_module; + PyObject *module = __Pyx_Import(name, NULL, 0); + if (!parts_tuple || unlikely(!module)) + return module; + imported_module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(imported_module)) { + Py_DECREF(module); + return imported_module; + } + PyErr_Clear(); + return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); +#endif +} +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 + PyObject *module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(module)) { + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + if (likely(spec)) { + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { + Py_DECREF(spec); + spec = NULL; + } + Py_XDECREF(unsafe); + } + if (likely(!spec)) { + PyErr_Clear(); + return module; + } + Py_DECREF(spec); + Py_DECREF(module); + } else if (PyErr_Occurred()) { + PyErr_Clear(); + } +#endif + return __Pyx__ImportDottedModule(name, parts_tuple); +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + const char* module_name_str = 0; + PyObject* module_name = 0; + PyObject* module_dot = 0; + PyObject* full_name = 0; + PyErr_Clear(); + module_name_str = PyModule_GetName(module); + if (unlikely(!module_name_str)) { goto modbad; } + module_name = PyUnicode_FromString(module_name_str); + if (unlikely(!module_name)) { goto modbad; } + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__7); + if (unlikely(!module_dot)) { goto modbad; } + full_name = PyUnicode_Concat(module_dot, name); + if (unlikely(!full_name)) { goto modbad; } + #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + { + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + goto modbad; + value = PyObject_GetItem(modules, full_name); + } + #else + value = PyImport_GetModule(full_name); + #endif + modbad: + Py_XDECREF(full_name); + Py_XDECREF(module_dot); + Py_XDECREF(module_name); + } + if (unlikely(!value)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* HasAttr */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (!r) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} +#endif + +/* FetchSharedCythonModule */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); +} + +/* FetchCommonType */ +static int __Pyx_VerifyCachedType(PyObject *cached_type, + const char *name, + Py_ssize_t basicsize, + Py_ssize_t expected_basicsize) { + if (!PyType_Check(cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", name); + return -1; + } + if (basicsize != expected_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + name); + return -1; + } + return 0; +} +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* abi_module; + const char* object_name; + PyTypeObject *cached_type = NULL; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + object_name = strrchr(type->tp_name, '.'); + object_name = object_name ? object_name+1 : type->tp_name; + cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + if (__Pyx_VerifyCachedType( + (PyObject *)cached_type, + object_name, + cached_type->tp_basicsize, + type->tp_basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; +done: + Py_DECREF(abi_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#else +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { + PyObject *abi_module, *cached_type = NULL; + const char* object_name = strrchr(spec->name, '.'); + object_name = object_name ? object_name+1 : spec->name; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + cached_type = PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + Py_ssize_t basicsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; +#else + basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; +#endif + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + basicsize, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + CYTHON_UNUSED_VAR(module); + cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + if (unlikely(!cached_type)) goto bad; + if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; +done: + Py_DECREF(abi_module); + assert(cached_type == NULL || PyType_Check(cached_type)); + return (PyTypeObject *) cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#endif + +/* PyVectorcallFastCallDict */ +#if CYTHON_METH_FASTCALL +static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + PyObject *res = NULL; + PyObject *kwnames; + PyObject **newargs; + PyObject **kwvalues; + Py_ssize_t i, pos; + size_t j; + PyObject *key, *value; + unsigned long keys_are_strings; + Py_ssize_t nkw = PyDict_GET_SIZE(kw); + newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); + if (unlikely(newargs == NULL)) { + PyErr_NoMemory(); + return NULL; + } + for (j = 0; j < nargs; j++) newargs[j] = args[j]; + kwnames = PyTuple_New(nkw); + if (unlikely(kwnames == NULL)) { + PyMem_Free(newargs); + return NULL; + } + kwvalues = newargs + nargs; + pos = i = 0; + keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; + while (PyDict_Next(kw, &pos, &key, &value)) { + keys_are_strings &= Py_TYPE(key)->tp_flags; + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(kwnames, i, key); + kwvalues[i] = value; + i++; + } + if (unlikely(!keys_are_strings)) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + goto cleanup; + } + res = vc(func, newargs, nargs, kwnames); +cleanup: + Py_DECREF(kwnames); + for (i = 0; i < nkw; i++) + Py_DECREF(kwvalues[i]); + PyMem_Free(newargs); + return res; +} +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + return vc(func, args, nargs, NULL); + } + return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); +} +#endif + +/* CythonFunctionShared */ +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if (__Pyx_CyFunction_Check(func)) { + return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; + } else if (PyCFunction_Check(func)) { + return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; + } + return 0; +} +#else +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +} +#endif +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + __Pyx_Py_XDECREF_SET( + __Pyx_CyFunction_GetClassObj(f), + ((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#else + __Pyx_Py_XDECREF_SET( + ((PyCMethodObject *) (f))->mm_class, + (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#endif +} +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +{ + CYTHON_UNUSED_VAR(closure); + if (unlikely(op->func_doc == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); + if (unlikely(!op->func_doc)) return NULL; +#else + if (((PyCFunctionObject*)op)->m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } +#endif + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_doc, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_name == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_name = PyObject_GetAttrString(op->func, "__name__"); +#elif PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_name, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_qualname, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_dict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(op); + CYTHON_UNUSED_VAR(context); + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + CYTHON_UNUSED_VAR(context); + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_tuple; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_kwdict; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value || value == Py_None) { + value = NULL; + } else if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + __Pyx_Py_XDECREF_SET(op->func_annotations, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->func_annotations; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + int is_coroutine; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; +#if PY_VERSION_HEX >= 0x03050000 + if (is_coroutine) { + PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + fromlist = PyList_New(1); + if (unlikely(!fromlist)) return NULL; + Py_INCREF(marker); +#if CYTHON_ASSUME_SAFE_MACROS + PyList_SET_ITEM(fromlist, 0, marker); +#else + if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { + Py_DECREF(marker); + Py_DECREF(fromlist); + return NULL; + } +#endif + module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + if (unlikely(!module)) goto ignore; + op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + Py_DECREF(module); + if (likely(op->func_is_coroutine)) { + return __Pyx_NewRef(op->func_is_coroutine); + } +ignore: + PyErr_Clear(); + } +#endif + op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); + return __Pyx_NewRef(op->func_is_coroutine); +} +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_GetAttrString(op->func, "__module__"); +} +static int +__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_SetAttrString(op->func, "__module__", value); +} +#endif +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, +#endif + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { +#if !CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#endif +#if CYTHON_USE_TYPE_SPECS + {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#if CYTHON_METH_FASTCALL +#if CYTHON_BACKPORT_VECTORCALL + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#else +#if !CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, +#endif +#endif +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#else + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, +#endif +#endif + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) +{ + CYTHON_UNUSED_VAR(args); +#if PY_MAJOR_VERSION >= 3 + Py_INCREF(m->func_qualname); + return m->func_qualname; +#else + return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { +#if !CYTHON_COMPILING_IN_LIMITED_API + PyCFunctionObject *cf = (PyCFunctionObject*) op; +#endif + if (unlikely(op == NULL)) + return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API + op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); + if (unlikely(!op->func)) return NULL; +#endif + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; +#if !CYTHON_COMPILING_IN_LIMITED_API + cf->m_ml = ml; + cf->m_self = (PyObject *) op; +#endif + Py_XINCREF(closure); + op->func_closure = closure; +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_XINCREF(module); + cf->m_module = module; +#endif + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + op->func_classobj = NULL; +#else + ((PyCMethodObject*)op)->mm_class = NULL; +#endif + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults_size = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + op->func_is_coroutine = NULL; +#if CYTHON_METH_FASTCALL + switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { + case METH_NOARGS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; + break; + case METH_O: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; + break; + case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; + break; + case METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; + break; + case METH_VARARGS | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = NULL; + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + Py_DECREF(op); + return NULL; + } +#endif + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_CLEAR(m->func); +#else + Py_CLEAR(((PyCFunctionObject*)m)->m_module); +#endif + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API +#if PY_VERSION_HEX < 0x030900B1 + Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); +#else + { + PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; + ((PyCMethodObject *) (m))->mm_class = NULL; + Py_XDECREF(cls); + } +#endif +#endif + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + Py_CLEAR(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + __Pyx_PyHeapTypeObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(m->func); +#else + Py_VISIT(((PyCFunctionObject*)m)->m_module); +#endif + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); +#endif + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *f = ((__pyx_CyFunctionObject*)func)->func; + PyObject *py_name = NULL; + PyCFunction meth; + int flags; + meth = PyCFunction_GetFunction(f); + if (unlikely(!meth)) return NULL; + flags = PyCFunction_GetFlags(f); + if (unlikely(flags < 0)) return NULL; +#else + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + int flags = f->m_ml->ml_flags; +#endif + Py_ssize_t size; + switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 0)) + return (*meth)(self, NULL); +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); +#endif + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); +#endif + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + return NULL; + } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", + py_name); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); +#endif + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *self, *result; +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)func)->m_self; +#endif + result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); + return result; +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; +#if CYTHON_METH_FASTCALL + __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); + if (vc) { +#if CYTHON_ASSUME_SAFE_MACROS + return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); +#else + (void) &__Pyx_PyVectorcall_FastCallDict; + return PyVectorcall_Call(func, args, kw); +#endif + } +#endif + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; +#if CYTHON_ASSUME_SAFE_MACROS + argc = PyTuple_GET_SIZE(args); +#else + argc = PyTuple_Size(args); + if (unlikely(!argc) < 0) return NULL; +#endif + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); +#if PY_MAJOR_VERSION > 2 + PyErr_Format(PyExc_TypeError, + "unbound method %.200S() needs an argument", + cyfunc->func_qualname); +#else + PyErr_SetString(PyExc_TypeError, + "unbound method needs an argument"); +#endif + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) +{ + int ret = 0; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + if (unlikely(nargs < 1)) { + PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", + ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + ret = 1; + } + if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + return ret; +} +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 0)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, NULL); +} +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 1)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, args[0]); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; + PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); +} +#endif +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_CyFunctionType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, + {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, + {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, + {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, + {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, + {Py_tp_methods, (void *)__pyx_CyFunction_methods}, + {Py_tp_members, (void *)__pyx_CyFunction_members}, + {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, + {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, + {0, 0}, +}; +static PyType_Spec __pyx_CyFunctionType_spec = { + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + __pyx_CyFunctionType_slots +}; +#else +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, +#if !CYTHON_METH_FASTCALL + 0, +#elif CYTHON_BACKPORT_VECTORCALL + (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), +#else + offsetof(PyCFunctionObject, vectorcall), +#endif + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_PyMethod_New, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_CyFunction_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); +#endif + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + m->defaults_size = size; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + +/* Py3UpdateBases */ +static PyObject* +__Pyx_PEP560_update_bases(PyObject *bases) +{ + Py_ssize_t i, j, size_bases; + PyObject *base, *meth, *new_base, *result, *new_bases = NULL; + size_bases = PyTuple_GET_SIZE(bases); + for (i = 0; i < size_bases; i++) { + base = PyTuple_GET_ITEM(bases, i); + if (PyType_Check(base)) { + if (new_bases) { + if (PyList_Append(new_bases, base) < 0) { + goto error; + } + } + continue; + } + meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); + if (!meth && PyErr_Occurred()) { + goto error; + } + if (!meth) { + if (new_bases) { + if (PyList_Append(new_bases, base) < 0) { + goto error; + } + } + continue; + } + new_base = __Pyx_PyObject_CallOneArg(meth, bases); + Py_DECREF(meth); + if (!new_base) { + goto error; + } + if (!PyTuple_Check(new_base)) { + PyErr_SetString(PyExc_TypeError, + "__mro_entries__ must return a tuple"); + Py_DECREF(new_base); + goto error; + } + if (!new_bases) { + if (!(new_bases = PyList_New(i))) { + goto error; + } + for (j = 0; j < i; j++) { + base = PyTuple_GET_ITEM(bases, j); + PyList_SET_ITEM(new_bases, j, base); + Py_INCREF(base); + } + } + j = PyList_GET_SIZE(new_bases); + if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { + goto error; + } + Py_DECREF(new_base); + } + if (!new_bases) { + Py_INCREF(bases); + return bases; + } + result = PyList_AsTuple(new_bases); + Py_DECREF(new_bases); + return result; +error: + Py_XDECREF(new_bases); + return NULL; +} + +/* CalculateMetaclass */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases; +#if CYTHON_ASSUME_SAFE_MACROS + nbases = PyTuple_GET_SIZE(bases); +#else + nbases = PyTuple_Size(bases); + if (nbases < 0) return NULL; +#endif + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; +#if CYTHON_ASSUME_SAFE_MACROS + PyObject *tmp = PyTuple_GET_ITEM(bases, i); +#else + PyObject *tmp = PyTuple_GetItem(bases, i); + if (!tmp) return NULL; +#endif + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +/* PyObjectCall2Args */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args[3] = {NULL, arg1, arg2}; + return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* Py3ClassCreate */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs[3] = {NULL, name, bases}; + ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); + Py_DECREF(prep); + } else { + if (unlikely(PyErr_Occurred())) + return NULL; + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; +#if PY_VERSION_HEX >= 0x03030000 + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; +#else + CYTHON_MAYBE_UNUSED_VAR(qualname); +#endif + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS +static int __Pyx_SetNamesPEP487(PyObject *type_obj) { + PyTypeObject *type = (PyTypeObject*) type_obj; + PyObject *names_to_set, *key, *value, *set_name, *tmp; + Py_ssize_t i = 0; +#if CYTHON_USE_TYPE_SLOTS + names_to_set = PyDict_Copy(type->tp_dict); +#else + { + PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); + names_to_set = NULL; + if (likely(d)) { + PyObject *names_to_set = PyDict_New(); + int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; + Py_DECREF(d); + if (unlikely(ret < 0)) + Py_CLEAR(names_to_set); + } + } +#endif + if (unlikely(names_to_set == NULL)) + goto bad; + while (PyDict_Next(names_to_set, &i, &key, &value)) { + set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); + if (unlikely(set_name != NULL)) { + tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); + Py_DECREF(set_name); + if (unlikely(tmp == NULL)) { + __Pyx_TypeName value_type_name = + __Pyx_PyType_GetName(Py_TYPE(value)); + __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); + PyErr_Format(PyExc_RuntimeError, +#if PY_MAJOR_VERSION >= 3 + "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", + value_type_name, key, type_name); +#else + "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", + value_type_name, + PyString_Check(key) ? PyString_AS_STRING(key) : "?", + type_name); +#endif + goto bad; + } else { + Py_DECREF(tmp); + } + } + else if (unlikely(PyErr_Occurred())) { + goto bad; + } + } + Py_DECREF(names_to_set); + return 0; +bad: + Py_XDECREF(names_to_set); + return -1; +} +static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { +#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyTypeObject *type = (PyTypeObject*) type_obj; + PyObject *mro = type->tp_mro; + Py_ssize_t i, nbases; + if (unlikely(!mro)) goto done; + (void) &__Pyx_GetBuiltinName; + Py_INCREF(mro); + nbases = PyTuple_GET_SIZE(mro); + assert(PyTuple_GET_ITEM(mro, 0) == type_obj); + for (i = 1; i < nbases-1; i++) { + PyObject *base, *dict, *meth; + base = PyTuple_GET_ITEM(mro, i); + dict = ((PyTypeObject *)base)->tp_dict; + meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); + if (unlikely(meth)) { + descrgetfunc f = Py_TYPE(meth)->tp_descr_get; + PyObject *res; + Py_INCREF(meth); + if (likely(f)) { + res = f(meth, NULL, type_obj); + Py_DECREF(meth); + if (unlikely(!res)) goto bad; + meth = res; + } + res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); + Py_DECREF(meth); + if (unlikely(!res)) goto bad; + Py_DECREF(res); + goto done; + } else if (unlikely(PyErr_Occurred())) { + goto bad; + } + } +done: + Py_XDECREF(mro); + return type_obj; +bad: + Py_XDECREF(mro); + Py_DECREF(type_obj); + return NULL; +#else + PyObject *super_type, *super, *func, *res; +#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) + super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); +#else + super_type = (PyObject*) &PySuper_Type; + (void) &__Pyx_GetBuiltinName; +#endif + super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; +#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) + Py_XDECREF(super_type); +#endif + if (unlikely(!super)) { + Py_CLEAR(type_obj); + goto done; + } + func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); + Py_DECREF(super); + if (likely(!func)) { + if (unlikely(PyErr_Occurred())) + Py_CLEAR(type_obj); + goto done; + } + res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); + Py_DECREF(func); + if (unlikely(!res)) + Py_CLEAR(type_obj); + Py_XDECREF(res); +done: + return type_obj; +#endif +} +#endif +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result; + PyObject *owned_metaclass = NULL; + PyObject *margs[4] = {NULL, name, bases, dict}; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, +#if PY_VERSION_HEX < 0x030600A4 + (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw +#else + mkw +#endif + ); + Py_XDECREF(owned_metaclass); +#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS + if (likely(result) && likely(PyType_Check(result))) { + if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { + Py_CLEAR(result); + } else { + result = __Pyx_InitSubclassPEP487(result, mkw); + } + } +#else + (void) &__Pyx_GetBuiltinName; +#endif + return result; +} + +/* ClassMethod */ +static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { +#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000 + if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { + return PyClassMethod_New(method); + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (PyMethodDescr_Check(method)) +#else + #if PY_MAJOR_VERSION == 2 + static PyTypeObject *methoddescr_type = NULL; + if (unlikely(methoddescr_type == NULL)) { + PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append"); + if (unlikely(!meth)) return NULL; + methoddescr_type = Py_TYPE(meth); + Py_DECREF(meth); + } + #else + PyTypeObject *methoddescr_type = &PyMethodDescr_Type; + #endif + if (__Pyx_TypeCheck(method, methoddescr_type)) +#endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject *)method; + #if PY_VERSION_HEX < 0x03020000 + PyTypeObject *d_type = descr->d_type; + #else + PyTypeObject *d_type = descr->d_common.d_type; + #endif + return PyDescr_NewClassMethod(d_type, descr->d_method); + } +#endif + else if (PyMethod_Check(method)) { + return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); + } + else { + return PyClassMethod_New(method); + } +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, + PyObject *firstlineno, PyObject *name) { + PyObject *replace = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; + replace = PyObject_GetAttrString(code, "replace"); + if (likely(replace)) { + PyObject *result; + result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + Py_DECREF(replace); + return result; + } + PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 + { + PyObject *compiled = NULL, *result = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; + compiled = Py_CompileString( + "out = type(code)(\n" + " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" + " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" + " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" + " code.co_lnotab)\n", "", Py_file_input); + if (!compiled) return NULL; + result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); + Py_DECREF(compiled); + if (!result) PyErr_Print(); + Py_DECREF(result); + result = PyDict_GetItemString(scratch_dict, "out"); + if (result) Py_INCREF(result); + return result; + } + #else + return NULL; + #endif +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; + PyObject *replace = NULL, *getframe = NULL, *frame = NULL; + PyObject *exc_type, *exc_value, *exc_traceback; + int success = 0; + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + getframe = PySys_GetObject("_getframe"); + if (unlikely(!getframe)) goto bad; + if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; + frame = PyEval_EvalCode(code_object, dict, dict); + if (unlikely(!frame) || frame == Py_None) goto bad; + success = 1; + bad: + PyErr_Restore(exc_type, exc_value, exc_traceback); + Py_XDECREF(code_object); + Py_XDECREF(py_py_line); + Py_XDECREF(py_funcname); + Py_XDECREF(dict); + Py_XDECREF(replace); + if (success) { + PyTraceBack_Here( + (struct _frame*)frame); + } + Py_XDECREF(frame); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__30); + } + return name; +} +#endif + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_value = exc_info->exc_value; + exc_info->exc_value = *value; + if (tmp_value == NULL || tmp_value == Py_None) { + Py_XDECREF(tmp_value); + tmp_value = NULL; + tmp_type = NULL; + tmp_tb = NULL; + } else { + tmp_type = (PyObject*) Py_TYPE(tmp_value); + Py_INCREF(tmp_type); + #if CYTHON_COMPILING_IN_CPYTHON + tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; + Py_XINCREF(tmp_tb); + #else + tmp_tb = PyException_GetTraceback(tmp_value); + #endif + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* PyObjectCallMethod1 */ +#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +#endif +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { +#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 + PyObject *args[2] = {obj, arg}; + (void) __Pyx_PyObject_GetMethod; + (void) __Pyx_PyObject_CallOneArg; + (void) __Pyx_PyObject_Call2Args; + return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#else + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +#endif +} + +/* CoroutineBase */ +#include +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + CYTHON_UNUSED_VAR(__pyx_tstate); + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (likely(et == PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + value = Py_None; + } +#if PY_VERSION_HEX >= 0x030300A0 + else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); + } +#endif + else if (unlikely(PyTuple_Check(ev))) { + if (PyTuple_GET_SIZE(ev) >= 1) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + value = PyTuple_GET_ITEM(ev, 0); + Py_INCREF(value); +#else + value = PySequence_ITEM(ev, 0); +#endif + } else { + Py_INCREF(Py_None); + value = Py_None; + } + Py_DECREF(ev); + } + else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { + value = ev; + } + if (likely(value)) { + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = value; + return 0; + } + } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); + Py_DECREF(ev); + if (likely(args)) { + value = PySequence_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +static CYTHON_INLINE +void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { +#if PY_VERSION_HEX >= 0x030B00a4 + Py_CLEAR(exc_state->exc_value); +#else + PyObject *t, *v, *tb; + t = exc_state->exc_type; + v = exc_state->exc_value; + tb = exc_state->exc_traceback; + exc_state->exc_type = NULL; + exc_state->exc_value = NULL; + exc_state->exc_traceback = NULL; + Py_XDECREF(t); + Py_XDECREF(v); + Py_XDECREF(tb); +#endif +} +#define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { + const char *msg; + CYTHON_MAYBE_UNUSED_VAR(gen); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { + msg = "coroutine already executing"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { + msg = "async generator already executing"; + #endif + } else { + msg = "generator already executing"; + } + PyErr_SetString(PyExc_ValueError, msg); +} +#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { + const char *msg; + CYTHON_MAYBE_UNUSED_VAR(gen); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(gen)) { + msg = "can't send non-None value to a just-started coroutine"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(gen)) { + msg = "can't send non-None value to a just-started async generator"; + #endif + } else { + msg = "can't send non-None value to a just-started generator"; + } + PyErr_SetString(PyExc_TypeError, msg); +} +#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { + CYTHON_MAYBE_UNUSED_VAR(gen); + CYTHON_MAYBE_UNUSED_VAR(closing); + #ifdef __Pyx_Coroutine_USED + if (!closing && __Pyx_Coroutine_Check(gen)) { + PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); + } else + #endif + if (value) { + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + else + #endif + PyErr_SetNone(PyExc_StopIteration); + } +} +static +PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { + __Pyx_PyThreadState_declare + PyThreadState *tstate; + __Pyx_ExcInfoStruct *exc_state; + PyObject *retval; + assert(!self->is_running); + if (unlikely(self->resume_label == 0)) { + if (unlikely(value && value != Py_None)) { + return __Pyx_Coroutine_NotStartedError((PyObject*)self); + } + } + if (unlikely(self->resume_label == -1)) { + return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + } +#if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + tstate = __pyx_tstate; +#else + tstate = __Pyx_PyThreadState_Current; +#endif + exc_state = &self->gi_exc_state; + if (exc_state->exc_value) { + #if CYTHON_COMPILING_IN_PYPY + #else + PyObject *exc_tb; + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON + exc_tb = PyException_GetTraceback(exc_state->exc_value); + #elif PY_VERSION_HEX >= 0x030B00a4 + exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback; + #else + exc_tb = exc_state->exc_traceback; + #endif + if (exc_tb) { + PyTracebackObject *tb = (PyTracebackObject *) exc_tb; + PyFrameObject *f = tb->tb_frame; + assert(f->f_back == NULL); + #if PY_VERSION_HEX >= 0x030B00A1 + f->f_back = PyThreadState_GetFrame(tstate); + #else + Py_XINCREF(tstate->frame); + f->f_back = tstate->frame; + #endif + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON + Py_DECREF(exc_tb); + #endif + } + #endif + } +#if CYTHON_USE_EXC_INFO_STACK + exc_state->previous_item = tstate->exc_info; + tstate->exc_info = exc_state; +#else + if (exc_state->exc_type) { + __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } else { + __Pyx_Coroutine_ExceptionClear(exc_state); + __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } +#endif + self->is_running = 1; + retval = self->body(self, tstate, value); + self->is_running = 0; +#if CYTHON_USE_EXC_INFO_STACK + exc_state = &self->gi_exc_state; + tstate->exc_info = exc_state->previous_item; + exc_state->previous_item = NULL; + __Pyx_Coroutine_ResetFrameBackpointer(exc_state); +#endif + return retval; +} +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { +#if CYTHON_COMPILING_IN_PYPY + CYTHON_UNUSED_VAR(exc_state); +#else + PyObject *exc_tb; + #if PY_VERSION_HEX >= 0x030B00a4 + if (!exc_state->exc_value) return; + exc_tb = PyException_GetTraceback(exc_state->exc_value); + #else + exc_tb = exc_state->exc_traceback; + #endif + if (likely(exc_tb)) { + PyTracebackObject *tb = (PyTracebackObject *) exc_tb; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); + #if PY_VERSION_HEX >= 0x030B00a4 + Py_DECREF(exc_tb); + #endif + } +#endif +} +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { + CYTHON_MAYBE_UNUSED_VAR(gen); + if (unlikely(!retval)) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (!__Pyx_PyErr_Occurred()) { + PyObject *exc = PyExc_StopIteration; + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + exc = __Pyx_PyExc_StopAsyncIteration; + #endif + __Pyx_PyErr_SetNone(exc); + } + } + return retval; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) +static CYTHON_INLINE +PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { +#if PY_VERSION_HEX <= 0x030A00A1 + return _PyGen_Send(gen, arg); +#else + PyObject *result; + if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) { + if (PyAsyncGen_CheckExact(gen)) { + assert(result == Py_None); + PyErr_SetNone(PyExc_StopAsyncIteration); + } + else if (result == Py_None) { + PyErr_SetNone(PyExc_StopIteration); + } + else { +#if PY_VERSION_HEX < 0x030d00A1 + _PyGen_SetStopIterationValue(result); +#else + if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) { + PyErr_SetObject(PyExc_StopIteration, result); + } else { + PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result); + if (likely(exc != NULL)) { + PyErr_SetObject(PyExc_StopIteration, exc); + Py_DECREF(exc); + } + } +#endif + } + Py_DECREF(result); + result = NULL; + } + return result; +#endif +} +#endif +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Coroutine_Undelegate(gen); + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); + ret = __Pyx_Coroutine_SendEx(gen, val, 0); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { + PyObject *retval; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + ret = __Pyx_async_gen_asend_send(yf, value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyCoro_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + { + if (value == Py_None) + ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + else + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + retval = __Pyx_Coroutine_FinishDelegation(gen); + } else { + retval = __Pyx_Coroutine_SendEx(gen, value, 0); + } + return __Pyx_Coroutine_MethodReturn(self, retval); +} +static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + if (__Pyx_CoroutineAwait_CheckExact(yf)) { + retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + retval = __Pyx_async_gen_asend_close(yf, NULL); + } else + if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { + retval = __Pyx_async_gen_athrow_close(yf, NULL); + } else + #endif + { + PyObject *meth; + gen->is_running = 1; + meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); + if (unlikely(!meth)) { + if (unlikely(PyErr_Occurred())) { + PyErr_WriteUnraisable(yf); + } + } else { + retval = __Pyx_PyObject_CallNoArg(meth); + Py_DECREF(meth); + if (unlikely(!retval)) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Next(yf); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, Py_None); + } else + #endif + ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_SendEx(gen, Py_None, 0); +} +static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { + CYTHON_UNUSED_VAR(arg); + return __Pyx_Coroutine_Close(self); +} +static PyObject *__Pyx_Coroutine_Close(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + Py_INCREF(yf); + err = __Pyx_Coroutine_CloseIter(gen, yf); + __Pyx_Coroutine_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) + PyErr_SetNone(PyExc_GeneratorExit); + retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); + if (unlikely(retval)) { + const char *msg; + Py_DECREF(retval); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(self)) { + msg = "coroutine ignored GeneratorExit"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(self)) { +#if PY_VERSION_HEX < 0x03060000 + msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; +#else + msg = "async generator ignored GeneratorExit"; +#endif + #endif + } else { + msg = "generator ignored GeneratorExit"; + } + PyErr_SetString(PyExc_RuntimeError, msg); + return NULL; + } + raised_exception = PyErr_Occurred(); + if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { + if (raised_exception) PyErr_Clear(); + Py_INCREF(Py_None); + return Py_None; + } + return NULL; +} +static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, + PyObject *args, int close_on_genexit) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + Py_INCREF(yf); + if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { + int err = __Pyx_Coroutine_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Coroutine_Undelegate(gen); + if (err < 0) + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto throw_here; + } + gen->is_running = 1; + if (0 + #ifdef __Pyx_Generator_USED + || __Pyx_Generator_CheckExact(yf) + #endif + #ifdef __Pyx_Coroutine_USED + || __Pyx_Coroutine_Check(yf) + #endif + ) { + ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { + ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); + #endif + } else { + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (unlikely(PyErr_Occurred())) { + gen->is_running = 0; + return NULL; + } + __Pyx_Coroutine_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + if (likely(args)) { + ret = __Pyx_PyObject_Call(meth, args, NULL); + } else { + PyObject *cargs[4] = {NULL, typ, val, tb}; + ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_MethodReturn(self, ret); + } +throw_here: + __Pyx_Raise(typ, val, tb, NULL); + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +} +static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { + PyObject *typ; + PyObject *val = NULL; + PyObject *tb = NULL; + if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) + return NULL; + return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); +} +static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { +#if PY_VERSION_HEX >= 0x030B00a4 + Py_VISIT(exc_state->exc_value); +#else + Py_VISIT(exc_state->exc_type); + Py_VISIT(exc_state->exc_value); + Py_VISIT(exc_state->exc_traceback); +#endif + return 0; +} +static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + Py_VISIT(gen->closure); + Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); + return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); +} +static int __Pyx_Coroutine_clear(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); + } +#endif + Py_CLEAR(gen->gi_code); + Py_CLEAR(gen->gi_frame); + Py_CLEAR(gen->gi_name); + Py_CLEAR(gen->gi_qualname); + Py_CLEAR(gen->gi_modulename); + return 0; +} +static void __Pyx_Coroutine_dealloc(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject_GC_UnTrack(gen); + if (gen->gi_weakreflist != NULL) + PyObject_ClearWeakRefs(self); + if (gen->resume_label >= 0) { + PyObject_GC_Track(self); +#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE + if (unlikely(PyObject_CallFinalizerFromDealloc(self))) +#else + Py_TYPE(gen)->tp_del(self); + if (unlikely(Py_REFCNT(self) > 0)) +#endif + { + return; + } + PyObject_GC_UnTrack(self); + } +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + /* We have to handle this case for asynchronous generators + right here, because this code has to be between UNTRACK + and GC_Del. */ + Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); + } +#endif + __Pyx_Coroutine_clear(self); + __Pyx_PyHeapTypeObject_GC_Del(gen); +} +static void __Pyx_Coroutine_del(PyObject *self) { + PyObject *error_type, *error_value, *error_traceback; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + __Pyx_PyThreadState_declare + if (gen->resume_label < 0) { + return; + } +#if !CYTHON_USE_TP_FINALIZE + assert(self->ob_refcnt == 0); + __Pyx_SET_REFCNT(self, 1); +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; + PyObject *finalizer = agen->ag_finalizer; + if (finalizer && !agen->ag_closed) { + PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); + if (unlikely(!res)) { + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); + return; + } + } +#endif + if (unlikely(gen->resume_label == 0 && !error_value)) { +#ifdef __Pyx_Coroutine_USED +#ifdef __Pyx_Generator_USED + if (!__Pyx_Generator_CheckExact(self)) +#endif + { + PyObject_GC_UnTrack(self); +#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) + if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) + PyErr_WriteUnraisable(self); +#else + {PyObject *msg; + char *cmsg; + #if CYTHON_COMPILING_IN_PYPY + msg = NULL; + cmsg = (char*) "coroutine was never awaited"; + #else + char *cname; + PyObject *qualname; + qualname = gen->gi_qualname; + cname = PyString_AS_STRING(qualname); + msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); + if (unlikely(!msg)) { + PyErr_Clear(); + cmsg = (char*) "coroutine was never awaited"; + } else { + cmsg = PyString_AS_STRING(msg); + } + #endif + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) + PyErr_WriteUnraisable(self); + Py_XDECREF(msg);} +#endif + PyObject_GC_Track(self); + } +#endif + } else { + PyObject *res = __Pyx_Coroutine_Close(self); + if (unlikely(!res)) { + if (PyErr_Occurred()) + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); +#if !CYTHON_USE_TP_FINALIZE + assert(Py_REFCNT(self) > 0); + if (likely(--self->ob_refcnt == 0)) { + return; + } + { + Py_ssize_t refcnt = Py_REFCNT(self); + _Py_NewReference(self); + __Pyx_SET_REFCNT(self, refcnt); + } +#if CYTHON_COMPILING_IN_CPYTHON + assert(PyType_IS_GC(Py_TYPE(self)) && + _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); + _Py_DEC_REFTOTAL; +#endif +#ifdef COUNT_ALLOCS + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; +#endif +#endif +} +static PyObject * +__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) +{ + PyObject *name = self->gi_name; + CYTHON_UNUSED_VAR(context); + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(self->gi_name, value); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context) +{ + PyObject *name = self->gi_qualname; + CYTHON_UNUSED_VAR(context); + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(self->gi_qualname, value); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) +{ + PyObject *frame = self->gi_frame; + CYTHON_UNUSED_VAR(context); + if (!frame) { + if (unlikely(!self->gi_code)) { + Py_RETURN_NONE; + } + frame = (PyObject *) PyFrame_New( + PyThreadState_Get(), /*PyThreadState *tstate,*/ + (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (unlikely(!frame)) + return NULL; + self->gi_frame = frame; + } + Py_INCREF(frame); + return frame; +} +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); + if (unlikely(!gen)) + return NULL; + return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); +} +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + gen->body = body; + gen->closure = closure; + Py_XINCREF(closure); + gen->is_running = 0; + gen->resume_label = 0; + gen->classobj = NULL; + gen->yieldfrom = NULL; + #if PY_VERSION_HEX >= 0x030B00a4 + gen->gi_exc_state.exc_value = NULL; + #else + gen->gi_exc_state.exc_type = NULL; + gen->gi_exc_state.exc_value = NULL; + gen->gi_exc_state.exc_traceback = NULL; + #endif +#if CYTHON_USE_EXC_INFO_STACK + gen->gi_exc_state.previous_item = NULL; +#endif + gen->gi_weakreflist = NULL; + Py_XINCREF(qualname); + gen->gi_qualname = qualname; + Py_XINCREF(name); + gen->gi_name = name; + Py_XINCREF(module_name); + gen->gi_modulename = module_name; + Py_XINCREF(code); + gen->gi_code = code; + gen->gi_frame = NULL; + PyObject_GC_Track(gen); + return gen; +} + +/* PatchModuleWithCoroutine */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + int result; + PyObject *globals, *result_obj; + globals = PyDict_New(); if (unlikely(!globals)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_coroutine_type", + #ifdef __Pyx_Coroutine_USED + (PyObject*)__pyx_CoroutineType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_generator_type", + #ifdef __Pyx_Generator_USED + (PyObject*)__pyx_GeneratorType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; + result_obj = PyRun_String(py_code, Py_file_input, globals, globals); + if (unlikely(!result_obj)) goto ignore; + Py_DECREF(result_obj); + Py_DECREF(globals); + return module; +ignore: + Py_XDECREF(globals); + PyErr_WriteUnraisable(module); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { + Py_DECREF(module); + module = NULL; + } +#else + py_code++; +#endif + return module; +} + +/* PatchGeneratorABC */ +#ifndef CYTHON_REGISTER_ABCS +#define CYTHON_REGISTER_ABCS 1 +#endif +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) +static PyObject* __Pyx_patch_abc_module(PyObject *module); +static PyObject* __Pyx_patch_abc_module(PyObject *module) { + module = __Pyx_Coroutine_patch_module( + module, "" +"if _cython_generator_type is not None:\n" +" try: Generator = _module.Generator\n" +" except AttributeError: pass\n" +" else: Generator.register(_cython_generator_type)\n" +"if _cython_coroutine_type is not None:\n" +" try: Coroutine = _module.Coroutine\n" +" except AttributeError: pass\n" +" else: Coroutine.register(_cython_coroutine_type)\n" + ); + return module; +} +#endif +static int __Pyx_patch_abc(void) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + static int abc_patched = 0; + if (CYTHON_REGISTER_ABCS && !abc_patched) { + PyObject *module; + module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); + if (unlikely(!module)) { + PyErr_WriteUnraisable(NULL); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, + ((PY_MAJOR_VERSION >= 3) ? + "Cython module failed to register with collections.abc module" : + "Cython module failed to register with collections module"), 1) < 0)) { + return -1; + } + } else { + module = __Pyx_patch_abc_module(module); + abc_patched = 1; + if (unlikely(!module)) + return -1; + Py_DECREF(module); + } + module = PyImport_ImportModule("backports_abc"); + if (module) { + module = __Pyx_patch_abc_module(module); + Py_XDECREF(module); + } + if (!module) { + PyErr_Clear(); + } + } +#else + if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); +#endif + return 0; +} + +/* Generator */ +static PyMethodDef __pyx_Generator_methods[] = { + {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, + (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, + (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, + (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + {0, 0, 0, 0} +}; +static PyMemberDef __pyx_Generator_memberlist[] = { + {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, + {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, + {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, +#if CYTHON_USE_TYPE_SPECS + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, +#endif + {0, 0, 0, 0, 0} +}; +static PyGetSetDef __pyx_Generator_getsets[] = { + {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + (char*) PyDoc_STR("name of the generator"), 0}, + {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + (char*) PyDoc_STR("qualified name of the generator"), 0}, + {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, + (char*) PyDoc_STR("Frame of the generator"), 0}, + {0, 0, 0, 0, 0} +}; +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_GeneratorType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, + {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, + {Py_tp_iter, (void *)PyObject_SelfIter}, + {Py_tp_iternext, (void *)__Pyx_Generator_Next}, + {Py_tp_methods, (void *)__pyx_Generator_methods}, + {Py_tp_members, (void *)__pyx_Generator_memberlist}, + {Py_tp_getset, (void *)__pyx_Generator_getsets}, + {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, +#if CYTHON_USE_TP_FINALIZE + {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, +#endif + {0, 0}, +}; +static PyType_Spec __pyx_GeneratorType_spec = { + __PYX_TYPE_MODULE_PREFIX "generator", + sizeof(__pyx_CoroutineObject), + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + __pyx_GeneratorType_slots +}; +#else +static PyTypeObject __pyx_GeneratorType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "generator", + sizeof(__pyx_CoroutineObject), + 0, + (destructor) __Pyx_Coroutine_dealloc, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + 0, + (traverseproc) __Pyx_Coroutine_traverse, + 0, + 0, + offsetof(__pyx_CoroutineObject, gi_weakreflist), + 0, + (iternextfunc) __Pyx_Generator_Next, + __pyx_Generator_methods, + __pyx_Generator_memberlist, + __pyx_Generator_getsets, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if CYTHON_USE_TP_FINALIZE + 0, +#else + __Pyx_Coroutine_del, +#endif + 0, +#if CYTHON_USE_TP_FINALIZE + __Pyx_Coroutine_del, +#elif PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_Generator_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); +#endif + if (unlikely(!__pyx_GeneratorType)) { + return -1; + } + return 0; +} + +/* CheckBinaryVersion */ +static unsigned long __Pyx_get_runtime_version(void) { +#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 + return Py_Version & ~0xFFUL; +#else + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + return version; +#endif +} +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { + const unsigned long MAJOR_MINOR = 0xFFFF0000UL; + if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) + return 0; + if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) + return 1; + { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compile time Python version %d.%d " + "of module '%.100s' " + "%s " + "runtime version %d.%d", + (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), + __Pyx_MODULE_NAME, + (allow_newer) ? "was newer than" : "does not match", + (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) + ); + return PyErr_WarnEx(NULL, message, 1); + } +} + +/* InitStrings */ +#if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +#include +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { + size_t len = strlen(s); + if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, "byte string is too long"); + return -1; + } + return (Py_ssize_t) len; +} +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return __Pyx_PyUnicode_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return PyByteArray_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/w3lib/_utr46.py b/w3lib/_utr46.pyx similarity index 100% rename from w3lib/_utr46.py rename to w3lib/_utr46.pyx From 8185cdccd520fcdd6267c5fb7fbf27aa979deb2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 13 Feb 2024 10:41:58 +0100 Subject: [PATCH 29/34] Merge _encoding into _url and use uchar for state control --- .gitignore | 1 + setup.py | 13 +- w3lib/_encoding.c | 13419 --------------- w3lib/_encoding.pyx | 453 - w3lib/_url.c | 38287 ++++++++++++++++++++++++------------------ w3lib/_url.pyx | 501 +- 6 files changed, 22293 insertions(+), 30381 deletions(-) delete mode 100644 w3lib/_encoding.c delete mode 100644 w3lib/_encoding.pyx diff --git a/.gitignore b/.gitignore index ed4d9137..e47f2043 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ coverage.xml .dmypy.json .hypothesis/ *.so +*.html diff --git a/setup.py b/setup.py index 427370cf..4e3be0f4 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,6 @@ import os from setuptools import setup, find_packages, Extension -try: - from Cython.Build import cythonize -except ImportError: - cythonize = None - # https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#distributing-cython-modules def no_cythonize(extensions, **_ignore): @@ -26,7 +21,6 @@ def no_cythonize(extensions, **_ignore): extensions = [ Extension(f"w3lib._{name}", [f"w3lib/_{name}.pyx"]) for name in ( - "encoding", "infra", "rfc2396", "rfc3986", @@ -38,10 +32,9 @@ def no_cythonize(extensions, **_ignore): ) ] -CYTHONIZE = bool(int(os.getenv("CYTHONIZE", 0))) and cythonize is not None - -if CYTHONIZE: - compiler_directives = {"language_level": 3, "embedsignature": True} +if bool(int(os.getenv("CYTHONIZE", 0))): + from Cython.Build import cythonize + compiler_directives = {"language_level": 3} extensions = cythonize(extensions, compiler_directives=compiler_directives) else: extensions = no_cythonize(extensions) diff --git a/w3lib/_encoding.c b/w3lib/_encoding.c deleted file mode 100644 index e52febcd..00000000 --- a/w3lib/_encoding.c +++ /dev/null @@ -1,13419 +0,0 @@ -/* Generated by Cython 3.0.8 */ - -/* BEGIN: Cython Metadata -{ - "distutils": { - "name": "w3lib._encoding", - "sources": [ - "w3lib/_encoding.pyx" - ] - }, - "module_name": "w3lib._encoding" -} -END: Cython Metadata */ - -#ifndef PY_SSIZE_T_CLEAN -#define PY_SSIZE_T_CLEAN -#endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif -#endif - -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" -#else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030008F0 -#define CYTHON_FUTURE_DIVISION 1 -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#define __PYX_COMMA , -#ifndef HAVE_LONG_LONG - #define HAVE_LONG_LONG -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX -#if defined(GRAALVM_PYTHON) - /* For very preliminary testing purposes. Most variables are set the same as PyPy. - The existence of this section does not imply that anything works or is even tested */ - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(PYPY_VERSION) - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) - #endif - #if PY_VERSION_HEX < 0x03090000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(CYTHON_LIMITED_API) - #ifdef Py_LIMITED_API - #undef __PYX_LIMITED_VERSION_HEX - #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API - #endif - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 1 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_CLINE_IN_TRACEBACK - #define CYTHON_CLINE_IN_TRACEBACK 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 1 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #endif - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #ifndef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 1 - #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 1 - #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 1 - #endif - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #elif !defined(CYTHON_USE_UNICODE_WRITER) - #define CYTHON_USE_UNICODE_WRITER 1 - #endif - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #ifndef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 1 - #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) - #endif - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) - #endif - #ifndef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 1 - #endif - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #if PY_VERSION_HEX < 0x030600B1 - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) - #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) - #define CYTHON_USE_EXC_INFO_STACK 1 - #endif - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif -#endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) -#endif -#if !defined(CYTHON_VECTORCALL) -#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) -#endif -#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) -#if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif - #undef SHIFT - #undef BASE - #undef MASK - #ifdef SIZEOF_VOID_P - enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; - #endif -#endif -#ifndef __has_attribute - #define __has_attribute(x) 0 -#endif -#ifndef __has_cpp_attribute - #define __has_cpp_attribute(x) 0 -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#ifndef CYTHON_UNUSED - #if defined(__cplusplus) - /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 - * but leads to warnings with -pedantic, since it is a C++17 feature */ - #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) - #if __has_cpp_attribute(maybe_unused) - #define CYTHON_UNUSED [[maybe_unused]] - #endif - #endif - #endif -#endif -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_UNUSED_VAR -# if defined(__cplusplus) - template void CYTHON_UNUSED_VAR( const T& ) { } -# else -# define CYTHON_UNUSED_VAR(x) (void)(x) -# endif -#endif -#ifndef CYTHON_MAYBE_UNUSED_VAR - #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_USE_CPP_STD_MOVE - #if defined(__cplusplus) && (\ - __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) - #define CYTHON_USE_CPP_STD_MOVE 1 - #else - #define CYTHON_USE_CPP_STD_MOVE 0 - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) -#ifdef _MSC_VER - #ifndef _MSC_STDINT_H_ - #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; - #endif - #endif - #if _MSC_VER < 1300 - #ifdef _WIN64 - typedef unsigned long long __pyx_uintptr_t; - #else - typedef unsigned int __pyx_uintptr_t; - #endif - #else - #ifdef _WIN64 - typedef unsigned __int64 __pyx_uintptr_t; - #else - typedef unsigned __int32 __pyx_uintptr_t; - #endif - #endif -#else - #include - typedef uintptr_t __pyx_uintptr_t; -#endif -#ifndef CYTHON_FALLTHROUGH - #if defined(__cplusplus) - /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 - * but leads to warnings with -pedantic, since it is a C++17 feature */ - #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) - #if __has_cpp_attribute(fallthrough) - #define CYTHON_FALLTHROUGH [[fallthrough]] - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #if __has_cpp_attribute(clang::fallthrough) - #define CYTHON_FALLTHROUGH [[clang::fallthrough]] - #elif __has_cpp_attribute(gnu::fallthrough) - #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] - #endif - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #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 -#ifdef __cplusplus - template - struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; - #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) -#else - #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) -#endif -#if CYTHON_COMPILING_IN_PYPY == 1 - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) -#else - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) -#endif -#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) - -#ifndef CYTHON_INLINE - #if defined(__clang__) - #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) - #elif defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type -#if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } - #ifndef CO_OPTIMIZED - #define CO_OPTIMIZED 0x0001 - #endif - #ifndef CO_NEWLOCALS - #define CO_NEWLOCALS 0x0002 - #endif - #ifndef CO_VARARGS - #define CO_VARARGS 0x0004 - #endif - #ifndef CO_VARKEYWORDS - #define CO_VARKEYWORDS 0x0008 - #endif - #ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x0200 - #endif - #ifndef CO_GENERATOR - #define CO_GENERATOR 0x0020 - #endif - #ifndef CO_COROUTINE - #define CO_COROUTINE 0x0080 - #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif -#endif -#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) - #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) -#else - #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) - #define __Pyx_Py_Is(x, y) Py_Is(x, y) -#else - #define __Pyx_Py_Is(x, y) ((x) == (y)) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) - #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) -#else - #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) - #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) -#else - #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) - #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) -#else - #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) -#endif -#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) -#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) -#else - #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) -#endif -#ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 -#endif -#ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#ifndef Py_TPFLAGS_SEQUENCE - #define Py_TPFLAGS_SEQUENCE 0 -#endif -#ifndef Py_TPFLAGS_MAPPING - #define Py_TPFLAGS_MAPPING 0 -#endif -#ifndef METH_STACKLESS - #define METH_STACKLESS 0 -#endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) - #ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - #endif - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); - typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, - Py_ssize_t nargs, PyObject *kwnames); -#else - #define __Pyx_PyCFunctionFast _PyCFunctionFast - #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords -#endif -#if CYTHON_METH_FASTCALL - #define __Pyx_METH_FASTCALL METH_FASTCALL - #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast - #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords -#else - #define __Pyx_METH_FASTCALL METH_VARARGS - #define __Pyx_PyCFunction_FastCall PyCFunction - #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords -#endif -#if CYTHON_VECTORCALL - #define __pyx_vectorcallfunc vectorcallfunc - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET - #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) -#elif CYTHON_BACKPORT_VECTORCALL - typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, - size_t nargsf, PyObject *kwnames); - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) -#else - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) -#endif -#if PY_MAJOR_VERSION >= 0x030900B1 -#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) -#else -#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) -#endif -#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) -#elif !CYTHON_COMPILING_IN_LIMITED_API -#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) -#endif -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) -static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { - return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; -} -#endif -static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { -#if CYTHON_COMPILING_IN_LIMITED_API - return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; -#else - return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; -#endif -} -#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 - #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) - typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); -#else - #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) - #define __Pyx_PyCMethod PyCMethod -#endif -#ifndef METH_METHOD - #define METH_METHOD 0x200 -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) -#else - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyThreadState_Current PyThreadState_Get() -#elif !CYTHON_FAST_THREAD_STATE - #define __Pyx_PyThreadState_Current PyThreadState_GET() -#elif PY_VERSION_HEX >= 0x030d00A1 - #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() -#else - #define __Pyx_PyThreadState_Current _PyThreadState_Current -#endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) -{ - void *result; - result = PyModule_GetState(op); - if (!result) - Py_FatalError("Couldn't find the module state"); - return result; -} -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) -#else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} -#endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) -#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) -#else -#define __Pyx_PyDict_NewPresized(n) PyDict_New() -#endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS -#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) -static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { - PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); - if (res == NULL) PyErr_Clear(); - return res; -} -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) -#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError -#define __Pyx_PyDict_GetItemStr PyDict_GetItem -#else -static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { -#if CYTHON_COMPILING_IN_PYPY - return PyDict_GetItem(dict, name); -#else - PyDictEntry *ep; - PyDictObject *mp = (PyDictObject*) dict; - long hash = ((PyStringObject *) name)->ob_shash; - assert(hash != -1); - ep = (mp->ma_lookup)(mp, name, hash); - if (ep == NULL) { - return NULL; - } - return ep->me_value; -#endif -} -#define __Pyx_PyDict_GetItemStr PyDict_GetItem -#endif -#if CYTHON_USE_TYPE_SLOTS - #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) - #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) -#else - #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) - #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) -#endif -#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 -#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE((PyObject*)obj);\ - assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ - PyObject_GC_Del(obj);\ - Py_DECREF(type);\ -} -#else -#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) - #define __Pyx_PyUnicode_DATA(u) ((void*)u) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #if PY_VERSION_HEX >= 0x030C0000 - #define __Pyx_PyUnicode_READY(op) (0) - #else - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) - #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) - #if PY_VERSION_HEX >= 0x030C0000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) - #else - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif - #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #if !defined(PyUnicode_DecodeUnicodeEscape) - #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) - #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) - #endif - #if !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) - #endif - #if !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) - #endif -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#if CYTHON_COMPILING_IN_CPYTHON - #define __Pyx_PySequence_ListKeepNew(obj)\ - (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) -#else - #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) -#endif -#if PY_VERSION_HEX >= 0x030900A4 - #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) - #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) -#else - #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) - #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) -#endif -#if CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) - #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) - #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) - #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) - #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) - #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) - #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) - #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) -#else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) - #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) - #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) - #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) - #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) - #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) -#endif -#if PY_VERSION_HEX >= 0x030d00A1 - #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) -#else - static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { - PyObject *module = PyImport_AddModule(name); - Py_XINCREF(module); - return module; - } -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t -#endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif -#else - #define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef __Pyx_PyAsyncMethodsStruct - typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; - } __Pyx_PyAsyncMethodsStruct; -#endif - -#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) - #define _USE_MATH_DEFINES - #endif -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } -#define __PYX_ERR(f_index, lineno, Ln_error) \ - { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } - -#ifdef CYTHON_EXTERN_C - #undef __PYX_EXTERN_C - #define __PYX_EXTERN_C CYTHON_EXTERN_C -#elif defined(__PYX_EXTERN_C) - #ifdef _MSC_VER - #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") - #else - #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. - #endif -#else - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE__w3lib___encoding -#define __PYX_HAVE_API__w3lib___encoding -/* Early includes */ -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { - return (size_t) i < (size_t) limit; -} -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) - #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); -static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) -{ - const wchar_t *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#endif -#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -#define __Pyx_PySequence_Tuple(obj)\ - (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); -#if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #if PY_VERSION_HEX >= 0x030C00A7 - #ifndef _PyLong_SIGN_MASK - #define _PyLong_SIGN_MASK 3 - #endif - #ifndef _PyLong_NON_SIZE_BITS - #define _PyLong_NON_SIZE_BITS 3 - #endif - #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) - #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) - #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) - #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) - #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) - #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) - #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) - #define __Pyx_PyLong_SignedDigitCount(x)\ - ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) - #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) - #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) - #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) - #else - #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) - #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) - #endif - typedef Py_ssize_t __Pyx_compact_pylong; - typedef size_t __Pyx_compact_upylong; - #else - #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) - #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) - #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) - #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) - #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) - #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) - #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) - #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) - #define __Pyx_PyLong_CompactValue(x)\ - ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) - typedef sdigit __Pyx_compact_pylong; - typedef digit __Pyx_compact_upylong; - #endif - #if PY_VERSION_HEX >= 0x030C00A5 - #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) - #else - #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) - #endif -#endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -#include -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#include -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ -static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } - -#if !CYTHON_USE_MODULE_STATE -static PyObject *__pyx_m = NULL; -#endif -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; -static const char *__pyx_filename; - -/* #### Code section: filename_table ### */ - -static const char *__pyx_f[] = { - "w3lib/_encoding.pyx", -}; -/* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 -#endif - -/* #### Code section: numeric_typedefs ### */ -/* #### Code section: complex_type_declarations ### */ -/* #### Code section: type_declarations ### */ - -/*--- Type declarations ---*/ -/* #### Code section: utility_code_proto ### */ - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, Py_ssize_t); - void (*DECREF)(void*, PyObject*, Py_ssize_t); - void (*GOTREF)(void*, PyObject*, Py_ssize_t); - void (*GIVEREF)(void*, PyObject*, Py_ssize_t); - void* (*SetupContext)(const char*, Py_ssize_t, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ - } - #define __Pyx_RefNannyFinishContextNogil() {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __Pyx_RefNannyFinishContext();\ - PyGILState_Release(__pyx_gilstate_save);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif - #define __Pyx_RefNannyFinishContextNogil() {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __Pyx_RefNannyFinishContext();\ - PyGILState_Release(__pyx_gilstate_save);\ - } - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContextNogil() - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_Py_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; Py_XDECREF(tmp);\ - } while (0) -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; -#if PY_VERSION_HEX >= 0x030C00A6 -#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) -#else -#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) -#endif -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) -#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 -#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) -#else -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#endif -#else -#define __Pyx_PyErr_Clear() PyErr_Clear() -#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 - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* PyObjectGetAttrStrNoError.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* TupleAndListFromArray.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); -static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); -#endif - -/* IncludeStringH.proto */ -#include - -/* BytesEquals.proto */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); - -/* UnicodeEquals.proto */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); - -/* fastcall.proto */ -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) -#elif CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) -#else - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) -#endif -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) - #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) -#else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg - #define __Pyx_Arg_XDECREF_VARARGS(arg) -#endif -#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) -#define __Pyx_KwValues_VARARGS(args, nargs) NULL -#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) -#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) -#if CYTHON_METH_FASTCALL - #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) - #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) - static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 - CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); - #else - #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) - #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs - to have the same reference counting */ - #define __Pyx_Arg_XDECREF_FASTCALL(arg) -#else - #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS - #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS - #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS - #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS - #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS - #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) - #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) -#else -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) -#endif - -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, - const char* function_name); - -/* RaiseArgTupleInvalid.proto */ -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); - -/* ArgTypeTest.proto */ -#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ - ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ - __Pyx__ArgTypeTest(obj, type, name, exact)) -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); - -/* PyObjectFormatSimple.proto */ -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - PyObject_Format(s, f)) -#elif PY_MAJOR_VERSION < 3 - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ - PyObject_Format(s, f)) -#elif CYTHON_USE_TYPE_SLOTS - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\ - likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\ - PyObject_Format(s, f)) -#else - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - PyObject_Format(s, f)) -#endif - -/* PyDictVersioning.proto */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif - -/* GetModuleGlobalName.proto */ -#if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) do {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ - (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ - __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ - PY_UINT64_T __pyx_dict_version;\ - PyObject *__pyx_dict_cached_value;\ - (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); -#else -#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) -#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); -#endif - -/* PyFunctionFastCall.proto */ -#if CYTHON_FAST_PYCALL -#if !CYTHON_VECTORCALL -#define __Pyx_PyFunction_FastCall(func, args, nargs)\ - __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); -#endif -#define __Pyx_BUILD_ASSERT_EXPR(cond)\ - (sizeof(char [1 - 2*!(cond)]) - 1) -#ifndef Py_MEMBER_SIZE -#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) -#endif -#if !CYTHON_VECTORCALL -#if PY_VERSION_HEX >= 0x03080000 - #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #define __Pxy_PyFrame_Initialize_Offsets() - #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) -#else - static size_t __pyx_pyframe_localsplus_offset = 0; - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets()\ - ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ - (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) - #define __Pyx_PyFrame_GetLocalsplus(frame)\ - (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) -#endif -#endif -#endif - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* PyObjectCallMethO.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); -#endif - -/* PyObjectFastCall.proto */ -#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); - -/* UnpackUnboundCMethod.proto */ -typedef struct { - PyObject *type; - PyObject **method_name; - PyCFunction func; - PyObject *method; - int flag; -} __Pyx_CachedCFunction; - -/* CallUnboundCMethod1.proto */ -static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); -#else -#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) -#endif - -/* RaiseUnexpectedTypeError.proto */ -static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); - -/* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); -#define __Pyx_PyObject_Dict_GetItem(obj, name)\ - (likely(PyDict_CheckExact(obj)) ?\ - __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) -#else -#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) -#endif - -/* GetTopmostException.proto */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); -#endif - -/* SaveResetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -#else -#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) -#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) -#endif - -/* GetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); -#endif - -/* PyObjectFormatAndDecref.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); -static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); - -/* UnicodeConcatInPlace.proto */ -# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 - #if CYTHON_REFNANNY - #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) - #else - #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right) - #endif - static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right - #if CYTHON_REFNANNY - , void* __pyx_refnanny - #endif - ); -#else -#define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat -#endif -#define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ - PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right)) - -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* PySequenceContains.proto */ -static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { - int result = PySequence_Contains(seq, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportDottedModule.proto */ -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); -#endif - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* GetItemInt.proto */ -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ - __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -/* ObjectGetItem.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); -#else -#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) -#endif - -/* IncludeStructmemberH.proto */ -#include - -/* FixUpExtensionType.proto */ -#if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); -#endif - -/* FetchSharedCythonModule.proto */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void); - -/* FetchCommonType.proto */ -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); -#else -static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); -#endif - -/* PyMethodNew.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - typesModule = PyImport_ImportModule("types"); - if (!typesModule) return NULL; - methodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - if (!methodType) return NULL; - result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); - Py_DECREF(methodType); - return result; -} -#elif PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} -#else - #define __Pyx_PyMethod_New PyMethod_New -#endif - -/* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); -#endif - -/* CythonFunctionShared.proto */ -#define __Pyx_CyFunction_USED -#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 -#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 -#define __Pyx_CYFUNCTION_CCLASS 0x04 -#define __Pyx_CYFUNCTION_COROUTINE 0x08 -#define __Pyx_CyFunction_GetClosure(f)\ - (((__pyx_CyFunctionObject *) (f))->func_closure) -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_CyFunction_GetClassObj(f)\ - (((__pyx_CyFunctionObject *) (f))->func_classobj) -#else - #define __Pyx_CyFunction_GetClassObj(f)\ - ((PyObject*) ((PyCMethodObject *) (f))->mm_class) -#endif -#define __Pyx_CyFunction_SetClassObj(f, classobj)\ - __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) -#define __Pyx_CyFunction_Defaults(type, f)\ - ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) -#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ - ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) -typedef struct { -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject_HEAD - PyObject *func; -#elif PY_VERSION_HEX < 0x030900B1 - PyCFunctionObject func; -#else - PyCMethodObject func; -#endif -#if CYTHON_BACKPORT_VECTORCALL - __pyx_vectorcallfunc func_vectorcall; -#endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - PyObject *func_weakreflist; -#endif - PyObject *func_dict; - PyObject *func_name; - PyObject *func_qualname; - PyObject *func_doc; - PyObject *func_globals; - PyObject *func_code; - PyObject *func_closure; -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - PyObject *func_classobj; -#endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; - int flags; - PyObject *defaults_tuple; - PyObject *defaults_kwdict; - PyObject *(*defaults_getter)(PyObject *); - PyObject *func_annotations; - PyObject *func_is_coroutine; -} __pyx_CyFunctionObject; -#undef __Pyx_CyOrPyCFunction_Check -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); -#undef __Pyx_IsSameCFunction -#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) -static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *closure, - PyObject *module, PyObject *globals, - PyObject* code); -static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, - PyObject *tuple); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, - PyObject *dict); -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, - PyObject *dict); -static int __pyx_CyFunction_init(PyObject *module); -#if CYTHON_METH_FASTCALL -static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL -#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) -#else -#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) -#endif -#endif - -/* CythonFunction.proto */ -static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *closure, - PyObject *module, PyObject *globals, - PyObject* code); - -/* RaiseMappingExpected.proto */ -static void __Pyx_RaiseMappingExpectedError(PyObject* arg); - -/* CLineInTraceback.proto */ -#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 */ -#if !CYTHON_COMPILING_IN_LIMITED_API -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* FormatTypeName.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -typedef PyObject *__Pyx_TypeName; -#define __Pyx_FMT_TYPENAME "%U" -static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); -#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) -#else -typedef const char *__Pyx_TypeName; -#define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) -#define __Pyx_DECREF_TypeName(obj) -#endif - -/* GCCDiagnostics.proto */ -#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -#define __Pyx_HAS_GCC_DIAGNOSTIC -#endif - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* FastTypeChecks.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) -#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); -#else -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) -#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) -#endif -#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) -#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) - -/* CheckBinaryVersion.proto */ -static unsigned long __Pyx_get_runtime_version(void); -static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - -/* #### Code section: module_declarations ### */ - -/* Module declarations from "w3lib._encoding" */ -static PyObject *__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label; -static PyObject *__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label; -/* #### Code section: typeinfo ### */ -/* #### Code section: before_global_var ### */ -#define __Pyx_MODULE_NAME "w3lib._encoding" -extern int __pyx_module_is_main_w3lib___encoding; -int __pyx_module_is_main_w3lib___encoding = 0; - -/* Implementation of "w3lib._encoding" */ -/* #### Code section: global_var ### */ -static PyObject *__pyx_builtin_KeyError; -static PyObject *__pyx_builtin_ValueError; -/* #### Code section: string_decls ### */ -static const char __pyx_k_[] = "*"; -static const char __pyx_k__2[] = "."; -static const char __pyx_k_l1[] = "l1"; -static const char __pyx_k_l2[] = "l2"; -static const char __pyx_k_l3[] = "l3"; -static const char __pyx_k_l4[] = "l4"; -static const char __pyx_k_l5[] = "l5"; -static const char __pyx_k_l6[] = "l6"; -static const char __pyx_k_l9[] = "l9"; -static const char __pyx_k_866[] = "866"; -static const char __pyx_k__49[] = "?"; -static const char __pyx_k_gbk[] = "gbk"; -static const char __pyx_k_int[] = "int"; -static const char __pyx_k_koi[] = "koi"; -static const char __pyx_k_mac[] = "mac"; -static const char __pyx_k_str[] = "str"; -static const char __pyx_k_Dict[] = "Dict"; -static const char __pyx_k_big5[] = "big5"; -static const char __pyx_k_koi8[] = "koi8"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_name[] = "__name__"; -static const char __pyx_k_sjis[] = "sjis"; -static const char __pyx_k_spec[] = "__spec__"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_utf8[] = "utf8"; -static const char __pyx_k_Tuple[] = "Tuple"; -static const char __pyx_k_ascii[] = "ascii"; -static const char __pyx_k_cp125[] = "cp125"; -static const char __pyx_k_cp819[] = "cp819"; -static const char __pyx_k_cp866[] = "cp866"; -static const char __pyx_k_cp874[] = "cp874"; -static const char __pyx_k_greek[] = "greek"; -static const char __pyx_k_infra[] = "_infra"; -static const char __pyx_k_label[] = "label"; -static const char __pyx_k_lower[] = "lower"; -static const char __pyx_k_ms932[] = "ms932"; -static const char __pyx_k_strip[] = "strip"; -static const char __pyx_k_ucs_2[] = "ucs-2"; -static const char __pyx_k_utf_8[] = "utf-8"; -static const char __pyx_k_x_gbk[] = "x-gbk"; -static const char __pyx_k_AnyStr[] = "AnyStr"; -static const char __pyx_k_arabic[] = "arabic"; -static const char __pyx_k_codecs[] = "codecs"; -static const char __pyx_k_cp1252[] = "cp1252"; -static const char __pyx_k_cp1254[] = "cp1254"; -static const char __pyx_k_csbig5[] = "csbig5"; -static const char __pyx_k_encode[] = "encode"; -static const char __pyx_k_euc_jp[] = "euc-jp"; -static const char __pyx_k_euc_kr[] = "euc-kr"; -static const char __pyx_k_gb2312[] = "gb2312"; -static const char __pyx_k_greek8[] = "greek8"; -static const char __pyx_k_hebrew[] = "hebrew"; -static const char __pyx_k_ibm819[] = "ibm819"; -static const char __pyx_k_ibm866[] = "ibm866"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_koi8_r[] = "koi8-r"; -static const char __pyx_k_koi8_u[] = "koi8-u"; -static const char __pyx_k_korean[] = "korean"; -static const char __pyx_k_latin1[] = "latin1"; -static const char __pyx_k_latin2[] = "latin2"; -static const char __pyx_k_latin3[] = "latin3"; -static const char __pyx_k_latin4[] = "latin4"; -static const char __pyx_k_latin5[] = "latin5"; -static const char __pyx_k_latin6[] = "latin6"; -static const char __pyx_k_lookup[] = "lookup"; -static const char __pyx_k_return[] = "return"; -static const char __pyx_k_typing[] = "typing"; -static const char __pyx_k_utf_16[] = "utf-16"; -static const char __pyx_k_visual[] = "visual"; -static const char __pyx_k_x_sjis[] = "x-sjis"; -static const char __pyx_k_chinese[] = "chinese"; -static const char __pyx_k_cn_big5[] = "cn-big5"; -static const char __pyx_k_cseuckr[] = "cseuckr"; -static const char __pyx_k_cskoi8r[] = "cskoi8r"; -static const char __pyx_k_dos_874[] = "dos-874"; -static const char __pyx_k_gb18030[] = "gb18030"; -static const char __pyx_k_gb_2312[] = "gb_2312"; -static const char __pyx_k_koi8_ru[] = "koi8-ru"; -static const char __pyx_k_ksc5601[] = "ksc5601"; -static const char __pyx_k_logical[] = "logical"; -static const char __pyx_k_maxsize[] = "maxsize"; -static const char __pyx_k_tis_620[] = "tis-620"; -static const char __pyx_k_unicode[] = "unicode"; -static const char __pyx_k_x_cp125[] = "x-cp125"; -static const char __pyx_k_Callable[] = "Callable"; -static const char __pyx_k_KeyError[] = "KeyError"; -static const char __pyx_k_asmo_708[] = "asmo-708"; -static const char __pyx_k_csgb2312[] = "csgb2312"; -static const char __pyx_k_csibm866[] = "csibm866"; -static const char __pyx_k_cyrillic[] = "cyrillic"; -static const char __pyx_k_ecma_114[] = "ecma-114"; -static const char __pyx_k_ecma_118[] = "ecma-118"; -static const char __pyx_k_elot_928[] = "elot_928"; -static const char __pyx_k_encoding[] = "encoding"; -static const char __pyx_k_iso88591[] = "iso88591"; -static const char __pyx_k_iso88592[] = "iso88592"; -static const char __pyx_k_iso88593[] = "iso88593"; -static const char __pyx_k_iso88594[] = "iso88594"; -static const char __pyx_k_iso88595[] = "iso88595"; -static const char __pyx_k_iso88596[] = "iso88596"; -static const char __pyx_k_iso88597[] = "iso88597"; -static const char __pyx_k_iso88598[] = "iso88598"; -static const char __pyx_k_iso88599[] = "iso88599"; -static const char __pyx_k_koi8_r_2[] = "koi8_r"; -static const char __pyx_k_ksc_5601[] = "ksc_5601"; -static const char __pyx_k_ms_kanji[] = "ms_kanji"; -static const char __pyx_k_us_ascii[] = "us-ascii"; -static const char __pyx_k_utf_16be[] = "utf-16be"; -static const char __pyx_k_utf_16le[] = "utf-16le"; -static const char __pyx_k_x_cp1252[] = "x-cp1252"; -static const char __pyx_k_x_cp1254[] = "x-cp1254"; -static const char __pyx_k_x_euc_jp[] = "x-euc-jp"; -static const char __pyx_k_x_x_big5[] = "x-x-big5"; -static const char __pyx_k_csunicode[] = "csunicode"; -static const char __pyx_k_functools[] = "functools"; -static const char __pyx_k_iso885910[] = "iso885910"; -static const char __pyx_k_iso885911[] = "iso885911"; -static const char __pyx_k_iso885913[] = "iso885913"; -static const char __pyx_k_iso885914[] = "iso885914"; -static const char __pyx_k_iso885915[] = "iso885915"; -static const char __pyx_k_iso8859_1[] = "iso8859-1"; -static const char __pyx_k_iso8859_2[] = "iso8859-2"; -static const char __pyx_k_iso8859_3[] = "iso8859-3"; -static const char __pyx_k_iso8859_4[] = "iso8859-4"; -static const char __pyx_k_iso8859_5[] = "iso8859-5"; -static const char __pyx_k_iso8859_6[] = "iso8859-6"; -static const char __pyx_k_iso8859_7[] = "iso8859-7"; -static const char __pyx_k_iso8859_8[] = "iso8859-8"; -static const char __pyx_k_iso8859_9[] = "iso8859-9"; -static const char __pyx_k_iso_ir_58[] = "iso-ir-58"; -static const char __pyx_k_lru_cache[] = "lru_cache"; -static const char __pyx_k_macintosh[] = "macintosh"; -static const char __pyx_k_shift_jis[] = "shift-jis"; -static const char __pyx_k_ValueError[] = "ValueError"; -static const char __pyx_k_big5_hkscs[] = "big5-hkscs"; -static const char __pyx_k_codec_info[] = "codec_info"; -static const char __pyx_k_csshiftjis[] = "csshiftjis"; -static const char __pyx_k_gb_2312_80[] = "gb_2312-80"; -static const char __pyx_k_hz_gb_2312[] = "hz-gb-2312"; -static const char __pyx_k_iso8859_10[] = "iso8859-10"; -static const char __pyx_k_iso8859_11[] = "iso8859-11"; -static const char __pyx_k_iso8859_13[] = "iso8859-13"; -static const char __pyx_k_iso8859_14[] = "iso8859-14"; -static const char __pyx_k_iso8859_15[] = "iso8859-15"; -static const char __pyx_k_iso_8859_1[] = "iso-8859-1"; -static const char __pyx_k_iso_8859_2[] = "iso-8859-2"; -static const char __pyx_k_iso_8859_3[] = "iso-8859-3"; -static const char __pyx_k_iso_8859_4[] = "iso-8859-4"; -static const char __pyx_k_iso_8859_5[] = "iso-8859-5"; -static const char __pyx_k_iso_8859_6[] = "iso-8859-6"; -static const char __pyx_k_iso_8859_7[] = "iso-8859-7"; -static const char __pyx_k_iso_8859_8[] = "iso-8859-8"; -static const char __pyx_k_iso_8859_9[] = "iso-8859-9"; -static const char __pyx_k_iso_ir_100[] = "iso-ir-100"; -static const char __pyx_k_iso_ir_101[] = "iso-ir-101"; -static const char __pyx_k_iso_ir_109[] = "iso-ir-109"; -static const char __pyx_k_iso_ir_110[] = "iso-ir-110"; -static const char __pyx_k_iso_ir_126[] = "iso-ir-126"; -static const char __pyx_k_iso_ir_127[] = "iso-ir-127"; -static const char __pyx_k_iso_ir_138[] = "iso-ir-138"; -static const char __pyx_k_iso_ir_144[] = "iso-ir-144"; -static const char __pyx_k_iso_ir_148[] = "iso-ir-148"; -static const char __pyx_k_iso_ir_149[] = "iso-ir-149"; -static const char __pyx_k_iso_ir_157[] = "iso-ir-157"; -static const char __pyx_k_last_digit[] = "last_digit"; -static const char __pyx_k_csiso2022jp[] = "csiso2022jp"; -static const char __pyx_k_csiso2022kr[] = "csiso2022kr"; -static const char __pyx_k_csiso88596e[] = "csiso88596e"; -static const char __pyx_k_csiso88596i[] = "csiso88596i"; -static const char __pyx_k_csiso88598e[] = "csiso88598e"; -static const char __pyx_k_csiso88598i[] = "csiso88598i"; -static const char __pyx_k_csisolatin1[] = "csisolatin1"; -static const char __pyx_k_csisolatin2[] = "csisolatin2"; -static const char __pyx_k_csisolatin3[] = "csisolatin3"; -static const char __pyx_k_csisolatin4[] = "csisolatin4"; -static const char __pyx_k_csisolatin5[] = "csisolatin5"; -static const char __pyx_k_csisolatin6[] = "csisolatin6"; -static const char __pyx_k_csisolatin9[] = "csisolatin9"; -static const char __pyx_k_csmacintosh[] = "csmacintosh"; -static const char __pyx_k_get_encoder[] = "_get_encoder"; -static const char __pyx_k_iso_2022_cn[] = "iso-2022-cn"; -static const char __pyx_k_iso_2022_jp[] = "iso-2022-jp"; -static const char __pyx_k_iso_2022_kr[] = "iso-2022-kr"; -static const char __pyx_k_iso_8859_10[] = "iso-8859-10"; -static const char __pyx_k_iso_8859_11[] = "iso-8859-11"; -static const char __pyx_k_iso_8859_13[] = "iso-8859-13"; -static const char __pyx_k_iso_8859_14[] = "iso-8859-14"; -static const char __pyx_k_iso_8859_15[] = "iso-8859-15"; -static const char __pyx_k_iso_8859_16[] = "iso-8859-16"; -static const char __pyx_k_replacement[] = "replacement"; -static const char __pyx_k_shift_jis_2[] = "shift_jis"; -static const char __pyx_k_unicodefeff[] = "unicodefeff"; -static const char __pyx_k_unicodefffe[] = "unicodefffe"; -static const char __pyx_k_windows_125[] = "windows-125"; -static const char __pyx_k_windows_31j[] = "windows-31j"; -static const char __pyx_k_windows_874[] = "windows-874"; -static const char __pyx_k_windows_949[] = "windows-949"; -static const char __pyx_k_x_mac_roman[] = "x-mac-roman"; -static const char __pyx_k_Dict_str_str[] = "Dict[str, str]"; -static const char __pyx_k_get_encoding[] = "_get_encoding"; -static const char __pyx_k_initializing[] = "_initializing"; -static const char __pyx_k_is_coroutine[] = "_is_coroutine"; -static const char __pyx_k_iso_8859_1_2[] = "iso_8859-1"; -static const char __pyx_k_iso_8859_2_2[] = "iso_8859-2"; -static const char __pyx_k_iso_8859_3_2[] = "iso_8859-3"; -static const char __pyx_k_iso_8859_4_2[] = "iso_8859-4"; -static const char __pyx_k_iso_8859_5_2[] = "iso_8859-5"; -static const char __pyx_k_iso_8859_6_2[] = "iso_8859-6"; -static const char __pyx_k_iso_8859_6_e[] = "iso-8859-6-e"; -static const char __pyx_k_iso_8859_6_i[] = "iso-8859-6-i"; -static const char __pyx_k_iso_8859_7_2[] = "iso_8859-7"; -static const char __pyx_k_iso_8859_8_2[] = "iso_8859-8"; -static const char __pyx_k_iso_8859_8_e[] = "iso-8859-8-e"; -static const char __pyx_k_iso_8859_8_i[] = "iso-8859-8-i"; -static const char __pyx_k_iso_8859_9_2[] = "iso_8859-9"; -static const char __pyx_k_mac_cyrillic[] = "mac-cyrillic"; -static const char __pyx_k_sun_eu_greek[] = "sun_eu_greek"; -static const char __pyx_k_windows_1252[] = "windows-1252"; -static const char __pyx_k_windows_1254[] = "windows-1254"; -static const char __pyx_k_CodecFunction[] = "CodecFunction"; -static const char __pyx_k_UTF_8_ENCODER[] = "_UTF_8_ENCODER"; -static const char __pyx_k_class_getitem[] = "__class_getitem__"; -static const char __pyx_k_csksc56011987[] = "csksc56011987"; -static const char __pyx_k_iso_8859_15_2[] = "iso_8859-15"; -static const char __pyx_k_unicode11utf8[] = "unicode11utf8"; -static const char __pyx_k_unicode20utf8[] = "unicode20utf8"; -static const char __pyx_k_DecodeFunction[] = "DecodeFunction"; -static const char __pyx_k_EncodeFunction[] = "EncodeFunction"; -static const char __pyx_k_UTF_8_ENCODING[] = "_UTF_8_ENCODING"; -static const char __pyx_k_ansi_x3_4_1968[] = "ansi_x3.4-1968"; -static const char __pyx_k_ks_c_5601_1987[] = "ks_c_5601-1987"; -static const char __pyx_k_ks_c_5601_1989[] = "ks_c_5601-1989"; -static const char __pyx_k_x_mac_cyrillic[] = "x-mac-cyrillic"; -static const char __pyx_k_x_user_defined[] = "x-user-defined"; -static const char __pyx_k_LABEL_ENCODINGS[] = "_LABEL_ENCODINGS"; -static const char __pyx_k_csiso58gb231280[] = "csiso58gb231280"; -static const char __pyx_k_csisolatingreek[] = "csisolatingreek"; -static const char __pyx_k_iso_10646_ucs_2[] = "iso-10646-ucs-2"; -static const char __pyx_k_iso_2022_cn_ext[] = "iso-2022-cn-ext"; -static const char __pyx_k_iso_8859_1_1987[] = "iso_8859-1:1987"; -static const char __pyx_k_iso_8859_2_1987[] = "iso_8859-2:1987"; -static const char __pyx_k_iso_8859_3_1988[] = "iso_8859-3:1988"; -static const char __pyx_k_iso_8859_4_1988[] = "iso_8859-4:1988"; -static const char __pyx_k_iso_8859_5_1988[] = "iso_8859-5:1988"; -static const char __pyx_k_iso_8859_6_1987[] = "iso_8859-6:1987"; -static const char __pyx_k_iso_8859_7_1987[] = "iso_8859-7:1987"; -static const char __pyx_k_iso_8859_8_1988[] = "iso_8859-8:1988"; -static const char __pyx_k_iso_8859_9_1989[] = "iso_8859-9:1989"; -static const char __pyx_k_w3lib__encoding[] = "w3lib._encoding"; -static const char __pyx_k_x_mac_ukrainian[] = "x-mac-ukrainian"; -static const char __pyx_k_x_unicode20utf8[] = "x-unicode20utf8"; -static const char __pyx_k_ASCII_WHITESPACE[] = "_ASCII_WHITESPACE"; -static const char __pyx_k_csisolatinarabic[] = "csisolatinarabic"; -static const char __pyx_k_csisolatinhebrew[] = "csisolatinhebrew"; -static const char __pyx_k_UTF_16BE_ENCODING[] = "_UTF_16BE_ENCODING"; -static const char __pyx_k_UTF_16LE_ENCODING[] = "_UTF_16LE_ENCODING"; -static const char __pyx_k_short_windows_125[] = "_short_windows_125"; -static const char __pyx_k_unicode_1_1_utf_8[] = "unicode-1-1-utf-8"; -static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; -static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_csisolatincyrillic[] = "csisolatincyrillic"; -static const char __pyx_k_cseucpkdfmtjapanese[] = "cseucpkdfmtjapanese"; -static const char __pyx_k_get_output_encoding[] = "_get_output_encoding"; -static const char __pyx_k_w3lib__encoding_pyx[] = "w3lib/_encoding.pyx"; -static const char __pyx_k_REPLACEMENT_ENCODING[] = "_REPLACEMENT_ENCODING"; -static const char __pyx_k_OUTPUT_ENCODING_UTF8_ENCODINGS[] = "_OUTPUT_ENCODING_UTF8_ENCODINGS"; -static const char __pyx_k_does_not_match_any_encoding_lab[] = " does not match any encoding label from the Encoding Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)"; -/* #### Code section: decls ### */ -static PyObject *__pyx_pf_5w3lib_9_encoding__short_windows_125(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_last_digit); /* proto */ -static PyObject *__pyx_pf_5w3lib_9_encoding_2_get_encoder(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_encoding); /* proto */ -static PyObject *__pyx_pf_5w3lib_9_encoding_4_get_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label); /* proto */ -static PyObject *__pyx_pf_5w3lib_9_encoding_6_get_output_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_encoding); /* proto */ -static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_strip = {0, 0, 0, 0, 0}; -/* #### Code section: late_includes ### */ -/* #### Code section: module_state ### */ -typedef struct { - PyObject *__pyx_d; - PyObject *__pyx_b; - PyObject *__pyx_cython_runtime; - PyObject *__pyx_empty_tuple; - PyObject *__pyx_empty_bytes; - PyObject *__pyx_empty_unicode; - #ifdef __Pyx_CyFunction_USED - PyTypeObject *__pyx_CyFunctionType; - #endif - #ifdef __Pyx_FusedFunction_USED - PyTypeObject *__pyx_FusedFunctionType; - #endif - #ifdef __Pyx_Generator_USED - PyTypeObject *__pyx_GeneratorType; - #endif - #ifdef __Pyx_IterableCoroutine_USED - PyTypeObject *__pyx_IterableCoroutineType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineAwaitType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineType; - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyObject *__pyx_n_s_; - PyObject *__pyx_kp_u_866; - PyObject *__pyx_n_s_ASCII_WHITESPACE; - PyObject *__pyx_n_s_AnyStr; - PyObject *__pyx_n_s_Callable; - PyObject *__pyx_n_s_CodecFunction; - PyObject *__pyx_n_s_DecodeFunction; - PyObject *__pyx_n_s_Dict; - PyObject *__pyx_kp_s_Dict_str_str; - PyObject *__pyx_n_s_EncodeFunction; - PyObject *__pyx_n_s_KeyError; - PyObject *__pyx_n_s_LABEL_ENCODINGS; - PyObject *__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS; - PyObject *__pyx_n_s_REPLACEMENT_ENCODING; - PyObject *__pyx_n_s_Tuple; - PyObject *__pyx_n_s_UTF_16BE_ENCODING; - PyObject *__pyx_n_s_UTF_16LE_ENCODING; - PyObject *__pyx_n_s_UTF_8_ENCODER; - PyObject *__pyx_n_s_UTF_8_ENCODING; - PyObject *__pyx_n_s_ValueError; - PyObject *__pyx_kp_u__2; - PyObject *__pyx_n_s__49; - PyObject *__pyx_kp_u_ansi_x3_4_1968; - PyObject *__pyx_n_u_arabic; - PyObject *__pyx_n_u_ascii; - PyObject *__pyx_kp_u_asmo_708; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_n_u_big5; - PyObject *__pyx_kp_u_big5_hkscs; - PyObject *__pyx_n_u_chinese; - PyObject *__pyx_n_s_class_getitem; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_kp_u_cn_big5; - PyObject *__pyx_n_s_codec_info; - PyObject *__pyx_n_s_codecs; - PyObject *__pyx_n_u_cp125; - PyObject *__pyx_n_u_cp1252; - PyObject *__pyx_n_u_cp1254; - PyObject *__pyx_n_u_cp819; - PyObject *__pyx_n_u_cp866; - PyObject *__pyx_n_u_cp874; - PyObject *__pyx_n_u_csbig5; - PyObject *__pyx_n_u_cseuckr; - PyObject *__pyx_n_u_cseucpkdfmtjapanese; - PyObject *__pyx_n_u_csgb2312; - PyObject *__pyx_n_u_csibm866; - PyObject *__pyx_n_u_csiso2022jp; - PyObject *__pyx_n_u_csiso2022kr; - PyObject *__pyx_n_u_csiso58gb231280; - PyObject *__pyx_n_u_csiso88596e; - PyObject *__pyx_n_u_csiso88596i; - PyObject *__pyx_n_u_csiso88598e; - PyObject *__pyx_n_u_csiso88598i; - PyObject *__pyx_n_u_csisolatin1; - PyObject *__pyx_n_u_csisolatin2; - PyObject *__pyx_n_u_csisolatin3; - PyObject *__pyx_n_u_csisolatin4; - PyObject *__pyx_n_u_csisolatin5; - PyObject *__pyx_n_u_csisolatin6; - PyObject *__pyx_n_u_csisolatin9; - PyObject *__pyx_n_u_csisolatinarabic; - PyObject *__pyx_n_u_csisolatincyrillic; - PyObject *__pyx_n_u_csisolatingreek; - PyObject *__pyx_n_u_csisolatinhebrew; - PyObject *__pyx_n_u_cskoi8r; - PyObject *__pyx_n_u_csksc56011987; - PyObject *__pyx_n_u_csmacintosh; - PyObject *__pyx_n_u_csshiftjis; - PyObject *__pyx_n_u_csunicode; - PyObject *__pyx_n_u_cyrillic; - PyObject *__pyx_kp_u_does_not_match_any_encoding_lab; - PyObject *__pyx_kp_u_dos_874; - PyObject *__pyx_kp_u_ecma_114; - PyObject *__pyx_kp_u_ecma_118; - PyObject *__pyx_n_u_elot_928; - PyObject *__pyx_n_s_encode; - PyObject *__pyx_n_s_encoding; - PyObject *__pyx_kp_u_euc_jp; - PyObject *__pyx_kp_u_euc_kr; - PyObject *__pyx_n_s_functools; - PyObject *__pyx_n_u_gb18030; - PyObject *__pyx_n_u_gb2312; - PyObject *__pyx_n_u_gb_2312; - PyObject *__pyx_kp_u_gb_2312_80; - PyObject *__pyx_n_u_gbk; - PyObject *__pyx_n_s_get_encoder; - PyObject *__pyx_n_s_get_encoding; - PyObject *__pyx_n_s_get_output_encoding; - PyObject *__pyx_n_u_greek; - PyObject *__pyx_n_u_greek8; - PyObject *__pyx_n_u_hebrew; - PyObject *__pyx_kp_u_hz_gb_2312; - PyObject *__pyx_n_u_ibm819; - PyObject *__pyx_n_u_ibm866; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_infra; - PyObject *__pyx_n_s_initializing; - PyObject *__pyx_n_s_int; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_n_u_iso88591; - PyObject *__pyx_n_u_iso885910; - PyObject *__pyx_n_u_iso885911; - PyObject *__pyx_n_u_iso885913; - PyObject *__pyx_n_u_iso885914; - PyObject *__pyx_n_u_iso885915; - PyObject *__pyx_n_u_iso88592; - PyObject *__pyx_n_u_iso88593; - PyObject *__pyx_n_u_iso88594; - PyObject *__pyx_n_u_iso88595; - PyObject *__pyx_n_u_iso88596; - PyObject *__pyx_n_u_iso88597; - PyObject *__pyx_n_u_iso88598; - PyObject *__pyx_n_u_iso88599; - PyObject *__pyx_kp_u_iso8859_1; - PyObject *__pyx_kp_u_iso8859_10; - PyObject *__pyx_kp_u_iso8859_11; - PyObject *__pyx_kp_u_iso8859_13; - PyObject *__pyx_kp_u_iso8859_14; - PyObject *__pyx_kp_u_iso8859_15; - PyObject *__pyx_kp_u_iso8859_2; - PyObject *__pyx_kp_u_iso8859_3; - PyObject *__pyx_kp_u_iso8859_4; - PyObject *__pyx_kp_u_iso8859_5; - PyObject *__pyx_kp_u_iso8859_6; - PyObject *__pyx_kp_u_iso8859_7; - PyObject *__pyx_kp_u_iso8859_8; - PyObject *__pyx_kp_u_iso8859_9; - PyObject *__pyx_kp_u_iso_10646_ucs_2; - PyObject *__pyx_kp_u_iso_2022_cn; - PyObject *__pyx_kp_u_iso_2022_cn_ext; - PyObject *__pyx_kp_u_iso_2022_jp; - PyObject *__pyx_kp_u_iso_2022_kr; - PyObject *__pyx_kp_u_iso_8859_1; - PyObject *__pyx_kp_u_iso_8859_10; - PyObject *__pyx_kp_u_iso_8859_11; - PyObject *__pyx_kp_u_iso_8859_13; - PyObject *__pyx_kp_u_iso_8859_14; - PyObject *__pyx_kp_u_iso_8859_15; - PyObject *__pyx_kp_u_iso_8859_15_2; - PyObject *__pyx_kp_u_iso_8859_16; - PyObject *__pyx_kp_u_iso_8859_1_1987; - PyObject *__pyx_kp_u_iso_8859_1_2; - PyObject *__pyx_kp_u_iso_8859_2; - PyObject *__pyx_kp_u_iso_8859_2_1987; - PyObject *__pyx_kp_u_iso_8859_2_2; - PyObject *__pyx_kp_u_iso_8859_3; - PyObject *__pyx_kp_u_iso_8859_3_1988; - PyObject *__pyx_kp_u_iso_8859_3_2; - PyObject *__pyx_kp_u_iso_8859_4; - PyObject *__pyx_kp_u_iso_8859_4_1988; - PyObject *__pyx_kp_u_iso_8859_4_2; - PyObject *__pyx_kp_u_iso_8859_5; - PyObject *__pyx_kp_u_iso_8859_5_1988; - PyObject *__pyx_kp_u_iso_8859_5_2; - PyObject *__pyx_kp_u_iso_8859_6; - PyObject *__pyx_kp_u_iso_8859_6_1987; - PyObject *__pyx_kp_u_iso_8859_6_2; - PyObject *__pyx_kp_u_iso_8859_6_e; - PyObject *__pyx_kp_u_iso_8859_6_i; - PyObject *__pyx_kp_u_iso_8859_7; - PyObject *__pyx_kp_u_iso_8859_7_1987; - PyObject *__pyx_kp_u_iso_8859_7_2; - PyObject *__pyx_kp_u_iso_8859_8; - PyObject *__pyx_kp_u_iso_8859_8_1988; - PyObject *__pyx_kp_u_iso_8859_8_2; - PyObject *__pyx_kp_u_iso_8859_8_e; - PyObject *__pyx_kp_u_iso_8859_8_i; - PyObject *__pyx_kp_u_iso_8859_9; - PyObject *__pyx_kp_u_iso_8859_9_1989; - PyObject *__pyx_kp_u_iso_8859_9_2; - PyObject *__pyx_kp_u_iso_ir_100; - PyObject *__pyx_kp_u_iso_ir_101; - PyObject *__pyx_kp_u_iso_ir_109; - PyObject *__pyx_kp_u_iso_ir_110; - PyObject *__pyx_kp_u_iso_ir_126; - PyObject *__pyx_kp_u_iso_ir_127; - PyObject *__pyx_kp_u_iso_ir_138; - PyObject *__pyx_kp_u_iso_ir_144; - PyObject *__pyx_kp_u_iso_ir_148; - PyObject *__pyx_kp_u_iso_ir_149; - PyObject *__pyx_kp_u_iso_ir_157; - PyObject *__pyx_kp_u_iso_ir_58; - PyObject *__pyx_n_u_koi; - PyObject *__pyx_n_u_koi8; - PyObject *__pyx_kp_u_koi8_r; - PyObject *__pyx_n_u_koi8_r_2; - PyObject *__pyx_kp_u_koi8_ru; - PyObject *__pyx_kp_u_koi8_u; - PyObject *__pyx_n_u_korean; - PyObject *__pyx_kp_u_ks_c_5601_1987; - PyObject *__pyx_kp_u_ks_c_5601_1989; - PyObject *__pyx_n_u_ksc5601; - PyObject *__pyx_n_u_ksc_5601; - PyObject *__pyx_n_u_l1; - PyObject *__pyx_n_u_l2; - PyObject *__pyx_n_u_l3; - PyObject *__pyx_n_u_l4; - PyObject *__pyx_n_u_l5; - PyObject *__pyx_n_u_l6; - PyObject *__pyx_n_u_l9; - PyObject *__pyx_n_s_label; - PyObject *__pyx_n_s_last_digit; - PyObject *__pyx_n_u_latin1; - PyObject *__pyx_n_u_latin2; - PyObject *__pyx_n_u_latin3; - PyObject *__pyx_n_u_latin4; - PyObject *__pyx_n_u_latin5; - PyObject *__pyx_n_u_latin6; - PyObject *__pyx_n_u_logical; - PyObject *__pyx_n_s_lookup; - PyObject *__pyx_n_s_lower; - PyObject *__pyx_n_s_lru_cache; - PyObject *__pyx_n_u_mac; - PyObject *__pyx_kp_u_mac_cyrillic; - PyObject *__pyx_n_u_macintosh; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_maxsize; - PyObject *__pyx_n_u_ms932; - PyObject *__pyx_n_u_ms_kanji; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_u_replacement; - PyObject *__pyx_n_s_return; - PyObject *__pyx_kp_u_shift_jis; - PyObject *__pyx_n_u_shift_jis_2; - PyObject *__pyx_n_s_short_windows_125; - PyObject *__pyx_n_u_sjis; - PyObject *__pyx_n_s_spec; - PyObject *__pyx_n_s_str; - PyObject *__pyx_n_s_strip; - PyObject *__pyx_n_u_sun_eu_greek; - PyObject *__pyx_n_s_test; - PyObject *__pyx_kp_u_tis_620; - PyObject *__pyx_n_s_typing; - PyObject *__pyx_kp_u_ucs_2; - PyObject *__pyx_n_u_unicode; - PyObject *__pyx_n_u_unicode11utf8; - PyObject *__pyx_n_u_unicode20utf8; - PyObject *__pyx_kp_u_unicode_1_1_utf_8; - PyObject *__pyx_n_u_unicodefeff; - PyObject *__pyx_n_u_unicodefffe; - PyObject *__pyx_kp_u_us_ascii; - PyObject *__pyx_n_u_utf8; - PyObject *__pyx_kp_u_utf_16; - PyObject *__pyx_kp_u_utf_16be; - PyObject *__pyx_kp_u_utf_16le; - PyObject *__pyx_kp_u_utf_8; - PyObject *__pyx_n_u_visual; - PyObject *__pyx_n_s_w3lib__encoding; - PyObject *__pyx_kp_s_w3lib__encoding_pyx; - PyObject *__pyx_kp_u_windows_125; - PyObject *__pyx_kp_u_windows_1252; - PyObject *__pyx_kp_u_windows_1254; - PyObject *__pyx_kp_u_windows_31j; - PyObject *__pyx_kp_u_windows_874; - PyObject *__pyx_kp_u_windows_949; - PyObject *__pyx_kp_u_x_cp125; - PyObject *__pyx_kp_u_x_cp1252; - PyObject *__pyx_kp_u_x_cp1254; - PyObject *__pyx_kp_u_x_euc_jp; - PyObject *__pyx_kp_u_x_gbk; - PyObject *__pyx_kp_u_x_mac_cyrillic; - PyObject *__pyx_kp_u_x_mac_roman; - PyObject *__pyx_kp_u_x_mac_ukrainian; - PyObject *__pyx_kp_u_x_sjis; - PyObject *__pyx_kp_u_x_unicode20utf8; - PyObject *__pyx_kp_u_x_user_defined; - PyObject *__pyx_kp_u_x_x_big5; - PyObject *__pyx_int_0; - PyObject *__pyx_int_1; - PyObject *__pyx_int_3; - PyObject *__pyx_int_5; - PyObject *__pyx_int_6; - PyObject *__pyx_int_7; - PyObject *__pyx_int_8; - PyObject *__pyx_tuple__3; - PyObject *__pyx_tuple__5; - PyObject *__pyx_tuple__6; - PyObject *__pyx_tuple__7; - PyObject *__pyx_tuple__8; - PyObject *__pyx_tuple__9; - PyObject *__pyx_tuple__10; - PyObject *__pyx_tuple__11; - PyObject *__pyx_tuple__12; - PyObject *__pyx_tuple__13; - PyObject *__pyx_tuple__14; - PyObject *__pyx_tuple__15; - PyObject *__pyx_tuple__16; - PyObject *__pyx_tuple__17; - PyObject *__pyx_tuple__18; - PyObject *__pyx_tuple__19; - PyObject *__pyx_tuple__20; - PyObject *__pyx_tuple__21; - PyObject *__pyx_tuple__22; - PyObject *__pyx_tuple__23; - PyObject *__pyx_tuple__24; - PyObject *__pyx_tuple__25; - PyObject *__pyx_tuple__26; - PyObject *__pyx_tuple__27; - PyObject *__pyx_tuple__28; - PyObject *__pyx_tuple__29; - PyObject *__pyx_tuple__30; - PyObject *__pyx_tuple__31; - PyObject *__pyx_tuple__32; - PyObject *__pyx_tuple__33; - PyObject *__pyx_tuple__34; - PyObject *__pyx_tuple__35; - PyObject *__pyx_tuple__36; - PyObject *__pyx_tuple__37; - PyObject *__pyx_tuple__38; - PyObject *__pyx_tuple__39; - PyObject *__pyx_tuple__40; - PyObject *__pyx_tuple__41; - PyObject *__pyx_tuple__42; - PyObject *__pyx_tuple__44; - PyObject *__pyx_tuple__45; - PyObject *__pyx_tuple__47; - PyObject *__pyx_codeobj__4; - PyObject *__pyx_codeobj__43; - PyObject *__pyx_codeobj__46; - PyObject *__pyx_codeobj__48; -} __pyx_mstate; - -#if CYTHON_USE_MODULE_STATE -#ifdef __cplusplus -namespace { - extern struct PyModuleDef __pyx_moduledef; -} /* anonymous namespace */ -#else -static struct PyModuleDef __pyx_moduledef; -#endif - -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) - -#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) -#else -static __pyx_mstate __pyx_mstate_global_static = -#ifdef __cplusplus - {}; -#else - {0}; -#endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif -/* #### Code section: module_state_clear ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); - if (!clear_module_state) return 0; - Py_CLEAR(clear_module_state->__pyx_d); - Py_CLEAR(clear_module_state->__pyx_b); - Py_CLEAR(clear_module_state->__pyx_cython_runtime); - Py_CLEAR(clear_module_state->__pyx_empty_tuple); - Py_CLEAR(clear_module_state->__pyx_empty_bytes); - Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif - Py_CLEAR(clear_module_state->__pyx_n_s_); - Py_CLEAR(clear_module_state->__pyx_kp_u_866); - Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_WHITESPACE); - Py_CLEAR(clear_module_state->__pyx_n_s_AnyStr); - Py_CLEAR(clear_module_state->__pyx_n_s_Callable); - Py_CLEAR(clear_module_state->__pyx_n_s_CodecFunction); - Py_CLEAR(clear_module_state->__pyx_n_s_DecodeFunction); - Py_CLEAR(clear_module_state->__pyx_n_s_Dict); - Py_CLEAR(clear_module_state->__pyx_kp_s_Dict_str_str); - Py_CLEAR(clear_module_state->__pyx_n_s_EncodeFunction); - Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); - Py_CLEAR(clear_module_state->__pyx_n_s_LABEL_ENCODINGS); - Py_CLEAR(clear_module_state->__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); - Py_CLEAR(clear_module_state->__pyx_n_s_REPLACEMENT_ENCODING); - Py_CLEAR(clear_module_state->__pyx_n_s_Tuple); - Py_CLEAR(clear_module_state->__pyx_n_s_UTF_16BE_ENCODING); - Py_CLEAR(clear_module_state->__pyx_n_s_UTF_16LE_ENCODING); - Py_CLEAR(clear_module_state->__pyx_n_s_UTF_8_ENCODER); - Py_CLEAR(clear_module_state->__pyx_n_s_UTF_8_ENCODING); - Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); - Py_CLEAR(clear_module_state->__pyx_kp_u__2); - Py_CLEAR(clear_module_state->__pyx_n_s__49); - Py_CLEAR(clear_module_state->__pyx_kp_u_ansi_x3_4_1968); - Py_CLEAR(clear_module_state->__pyx_n_u_arabic); - Py_CLEAR(clear_module_state->__pyx_n_u_ascii); - Py_CLEAR(clear_module_state->__pyx_kp_u_asmo_708); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_n_u_big5); - Py_CLEAR(clear_module_state->__pyx_kp_u_big5_hkscs); - Py_CLEAR(clear_module_state->__pyx_n_u_chinese); - Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_kp_u_cn_big5); - Py_CLEAR(clear_module_state->__pyx_n_s_codec_info); - Py_CLEAR(clear_module_state->__pyx_n_s_codecs); - Py_CLEAR(clear_module_state->__pyx_n_u_cp125); - Py_CLEAR(clear_module_state->__pyx_n_u_cp1252); - Py_CLEAR(clear_module_state->__pyx_n_u_cp1254); - Py_CLEAR(clear_module_state->__pyx_n_u_cp819); - Py_CLEAR(clear_module_state->__pyx_n_u_cp866); - Py_CLEAR(clear_module_state->__pyx_n_u_cp874); - Py_CLEAR(clear_module_state->__pyx_n_u_csbig5); - Py_CLEAR(clear_module_state->__pyx_n_u_cseuckr); - Py_CLEAR(clear_module_state->__pyx_n_u_cseucpkdfmtjapanese); - Py_CLEAR(clear_module_state->__pyx_n_u_csgb2312); - Py_CLEAR(clear_module_state->__pyx_n_u_csibm866); - Py_CLEAR(clear_module_state->__pyx_n_u_csiso2022jp); - Py_CLEAR(clear_module_state->__pyx_n_u_csiso2022kr); - Py_CLEAR(clear_module_state->__pyx_n_u_csiso58gb231280); - Py_CLEAR(clear_module_state->__pyx_n_u_csiso88596e); - Py_CLEAR(clear_module_state->__pyx_n_u_csiso88596i); - Py_CLEAR(clear_module_state->__pyx_n_u_csiso88598e); - Py_CLEAR(clear_module_state->__pyx_n_u_csiso88598i); - Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin1); - Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin2); - Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin3); - Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin4); - Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin5); - Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin6); - Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin9); - Py_CLEAR(clear_module_state->__pyx_n_u_csisolatinarabic); - Py_CLEAR(clear_module_state->__pyx_n_u_csisolatincyrillic); - Py_CLEAR(clear_module_state->__pyx_n_u_csisolatingreek); - Py_CLEAR(clear_module_state->__pyx_n_u_csisolatinhebrew); - Py_CLEAR(clear_module_state->__pyx_n_u_cskoi8r); - Py_CLEAR(clear_module_state->__pyx_n_u_csksc56011987); - Py_CLEAR(clear_module_state->__pyx_n_u_csmacintosh); - Py_CLEAR(clear_module_state->__pyx_n_u_csshiftjis); - Py_CLEAR(clear_module_state->__pyx_n_u_csunicode); - Py_CLEAR(clear_module_state->__pyx_n_u_cyrillic); - Py_CLEAR(clear_module_state->__pyx_kp_u_does_not_match_any_encoding_lab); - Py_CLEAR(clear_module_state->__pyx_kp_u_dos_874); - Py_CLEAR(clear_module_state->__pyx_kp_u_ecma_114); - Py_CLEAR(clear_module_state->__pyx_kp_u_ecma_118); - Py_CLEAR(clear_module_state->__pyx_n_u_elot_928); - Py_CLEAR(clear_module_state->__pyx_n_s_encode); - Py_CLEAR(clear_module_state->__pyx_n_s_encoding); - Py_CLEAR(clear_module_state->__pyx_kp_u_euc_jp); - Py_CLEAR(clear_module_state->__pyx_kp_u_euc_kr); - Py_CLEAR(clear_module_state->__pyx_n_s_functools); - Py_CLEAR(clear_module_state->__pyx_n_u_gb18030); - Py_CLEAR(clear_module_state->__pyx_n_u_gb2312); - Py_CLEAR(clear_module_state->__pyx_n_u_gb_2312); - Py_CLEAR(clear_module_state->__pyx_kp_u_gb_2312_80); - Py_CLEAR(clear_module_state->__pyx_n_u_gbk); - Py_CLEAR(clear_module_state->__pyx_n_s_get_encoder); - Py_CLEAR(clear_module_state->__pyx_n_s_get_encoding); - Py_CLEAR(clear_module_state->__pyx_n_s_get_output_encoding); - Py_CLEAR(clear_module_state->__pyx_n_u_greek); - Py_CLEAR(clear_module_state->__pyx_n_u_greek8); - Py_CLEAR(clear_module_state->__pyx_n_u_hebrew); - Py_CLEAR(clear_module_state->__pyx_kp_u_hz_gb_2312); - Py_CLEAR(clear_module_state->__pyx_n_u_ibm819); - Py_CLEAR(clear_module_state->__pyx_n_u_ibm866); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_infra); - Py_CLEAR(clear_module_state->__pyx_n_s_initializing); - Py_CLEAR(clear_module_state->__pyx_n_s_int); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_n_u_iso88591); - Py_CLEAR(clear_module_state->__pyx_n_u_iso885910); - Py_CLEAR(clear_module_state->__pyx_n_u_iso885911); - Py_CLEAR(clear_module_state->__pyx_n_u_iso885913); - Py_CLEAR(clear_module_state->__pyx_n_u_iso885914); - Py_CLEAR(clear_module_state->__pyx_n_u_iso885915); - Py_CLEAR(clear_module_state->__pyx_n_u_iso88592); - Py_CLEAR(clear_module_state->__pyx_n_u_iso88593); - Py_CLEAR(clear_module_state->__pyx_n_u_iso88594); - Py_CLEAR(clear_module_state->__pyx_n_u_iso88595); - Py_CLEAR(clear_module_state->__pyx_n_u_iso88596); - Py_CLEAR(clear_module_state->__pyx_n_u_iso88597); - Py_CLEAR(clear_module_state->__pyx_n_u_iso88598); - Py_CLEAR(clear_module_state->__pyx_n_u_iso88599); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_1); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_10); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_11); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_13); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_14); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_15); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_3); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_4); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_5); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_6); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_7); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_8); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_9); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_10646_ucs_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_2022_cn); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_2022_cn_ext); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_2022_jp); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_2022_kr); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_1); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_10); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_11); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_13); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_14); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_15); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_15_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_16); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_1_1987); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_1_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_2_1987); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_2_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_3); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_3_1988); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_3_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_4); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_4_1988); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_4_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_5); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_5_1988); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_5_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6_1987); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6_e); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6_i); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_7); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_7_1987); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_7_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8_1988); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8_e); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8_i); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_9); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_9_1989); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_9_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_100); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_101); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_109); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_110); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_126); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_127); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_138); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_144); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_148); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_149); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_157); - Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_58); - Py_CLEAR(clear_module_state->__pyx_n_u_koi); - Py_CLEAR(clear_module_state->__pyx_n_u_koi8); - Py_CLEAR(clear_module_state->__pyx_kp_u_koi8_r); - Py_CLEAR(clear_module_state->__pyx_n_u_koi8_r_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_koi8_ru); - Py_CLEAR(clear_module_state->__pyx_kp_u_koi8_u); - Py_CLEAR(clear_module_state->__pyx_n_u_korean); - Py_CLEAR(clear_module_state->__pyx_kp_u_ks_c_5601_1987); - Py_CLEAR(clear_module_state->__pyx_kp_u_ks_c_5601_1989); - Py_CLEAR(clear_module_state->__pyx_n_u_ksc5601); - Py_CLEAR(clear_module_state->__pyx_n_u_ksc_5601); - Py_CLEAR(clear_module_state->__pyx_n_u_l1); - Py_CLEAR(clear_module_state->__pyx_n_u_l2); - Py_CLEAR(clear_module_state->__pyx_n_u_l3); - Py_CLEAR(clear_module_state->__pyx_n_u_l4); - Py_CLEAR(clear_module_state->__pyx_n_u_l5); - Py_CLEAR(clear_module_state->__pyx_n_u_l6); - Py_CLEAR(clear_module_state->__pyx_n_u_l9); - Py_CLEAR(clear_module_state->__pyx_n_s_label); - Py_CLEAR(clear_module_state->__pyx_n_s_last_digit); - Py_CLEAR(clear_module_state->__pyx_n_u_latin1); - Py_CLEAR(clear_module_state->__pyx_n_u_latin2); - Py_CLEAR(clear_module_state->__pyx_n_u_latin3); - Py_CLEAR(clear_module_state->__pyx_n_u_latin4); - Py_CLEAR(clear_module_state->__pyx_n_u_latin5); - Py_CLEAR(clear_module_state->__pyx_n_u_latin6); - Py_CLEAR(clear_module_state->__pyx_n_u_logical); - Py_CLEAR(clear_module_state->__pyx_n_s_lookup); - Py_CLEAR(clear_module_state->__pyx_n_s_lower); - Py_CLEAR(clear_module_state->__pyx_n_s_lru_cache); - Py_CLEAR(clear_module_state->__pyx_n_u_mac); - Py_CLEAR(clear_module_state->__pyx_kp_u_mac_cyrillic); - Py_CLEAR(clear_module_state->__pyx_n_u_macintosh); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_maxsize); - Py_CLEAR(clear_module_state->__pyx_n_u_ms932); - Py_CLEAR(clear_module_state->__pyx_n_u_ms_kanji); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_u_replacement); - Py_CLEAR(clear_module_state->__pyx_n_s_return); - Py_CLEAR(clear_module_state->__pyx_kp_u_shift_jis); - Py_CLEAR(clear_module_state->__pyx_n_u_shift_jis_2); - Py_CLEAR(clear_module_state->__pyx_n_s_short_windows_125); - Py_CLEAR(clear_module_state->__pyx_n_u_sjis); - Py_CLEAR(clear_module_state->__pyx_n_s_spec); - Py_CLEAR(clear_module_state->__pyx_n_s_str); - Py_CLEAR(clear_module_state->__pyx_n_s_strip); - Py_CLEAR(clear_module_state->__pyx_n_u_sun_eu_greek); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_kp_u_tis_620); - Py_CLEAR(clear_module_state->__pyx_n_s_typing); - Py_CLEAR(clear_module_state->__pyx_kp_u_ucs_2); - Py_CLEAR(clear_module_state->__pyx_n_u_unicode); - Py_CLEAR(clear_module_state->__pyx_n_u_unicode11utf8); - Py_CLEAR(clear_module_state->__pyx_n_u_unicode20utf8); - Py_CLEAR(clear_module_state->__pyx_kp_u_unicode_1_1_utf_8); - Py_CLEAR(clear_module_state->__pyx_n_u_unicodefeff); - Py_CLEAR(clear_module_state->__pyx_n_u_unicodefffe); - Py_CLEAR(clear_module_state->__pyx_kp_u_us_ascii); - Py_CLEAR(clear_module_state->__pyx_n_u_utf8); - Py_CLEAR(clear_module_state->__pyx_kp_u_utf_16); - Py_CLEAR(clear_module_state->__pyx_kp_u_utf_16be); - Py_CLEAR(clear_module_state->__pyx_kp_u_utf_16le); - Py_CLEAR(clear_module_state->__pyx_kp_u_utf_8); - Py_CLEAR(clear_module_state->__pyx_n_u_visual); - Py_CLEAR(clear_module_state->__pyx_n_s_w3lib__encoding); - Py_CLEAR(clear_module_state->__pyx_kp_s_w3lib__encoding_pyx); - Py_CLEAR(clear_module_state->__pyx_kp_u_windows_125); - Py_CLEAR(clear_module_state->__pyx_kp_u_windows_1252); - Py_CLEAR(clear_module_state->__pyx_kp_u_windows_1254); - Py_CLEAR(clear_module_state->__pyx_kp_u_windows_31j); - Py_CLEAR(clear_module_state->__pyx_kp_u_windows_874); - Py_CLEAR(clear_module_state->__pyx_kp_u_windows_949); - Py_CLEAR(clear_module_state->__pyx_kp_u_x_cp125); - Py_CLEAR(clear_module_state->__pyx_kp_u_x_cp1252); - Py_CLEAR(clear_module_state->__pyx_kp_u_x_cp1254); - Py_CLEAR(clear_module_state->__pyx_kp_u_x_euc_jp); - Py_CLEAR(clear_module_state->__pyx_kp_u_x_gbk); - Py_CLEAR(clear_module_state->__pyx_kp_u_x_mac_cyrillic); - Py_CLEAR(clear_module_state->__pyx_kp_u_x_mac_roman); - Py_CLEAR(clear_module_state->__pyx_kp_u_x_mac_ukrainian); - Py_CLEAR(clear_module_state->__pyx_kp_u_x_sjis); - Py_CLEAR(clear_module_state->__pyx_kp_u_x_unicode20utf8); - Py_CLEAR(clear_module_state->__pyx_kp_u_x_user_defined); - Py_CLEAR(clear_module_state->__pyx_kp_u_x_x_big5); - Py_CLEAR(clear_module_state->__pyx_int_0); - Py_CLEAR(clear_module_state->__pyx_int_1); - Py_CLEAR(clear_module_state->__pyx_int_3); - Py_CLEAR(clear_module_state->__pyx_int_5); - Py_CLEAR(clear_module_state->__pyx_int_6); - Py_CLEAR(clear_module_state->__pyx_int_7); - Py_CLEAR(clear_module_state->__pyx_int_8); - Py_CLEAR(clear_module_state->__pyx_tuple__3); - Py_CLEAR(clear_module_state->__pyx_tuple__5); - Py_CLEAR(clear_module_state->__pyx_tuple__6); - Py_CLEAR(clear_module_state->__pyx_tuple__7); - Py_CLEAR(clear_module_state->__pyx_tuple__8); - Py_CLEAR(clear_module_state->__pyx_tuple__9); - Py_CLEAR(clear_module_state->__pyx_tuple__10); - Py_CLEAR(clear_module_state->__pyx_tuple__11); - Py_CLEAR(clear_module_state->__pyx_tuple__12); - Py_CLEAR(clear_module_state->__pyx_tuple__13); - Py_CLEAR(clear_module_state->__pyx_tuple__14); - Py_CLEAR(clear_module_state->__pyx_tuple__15); - Py_CLEAR(clear_module_state->__pyx_tuple__16); - Py_CLEAR(clear_module_state->__pyx_tuple__17); - Py_CLEAR(clear_module_state->__pyx_tuple__18); - Py_CLEAR(clear_module_state->__pyx_tuple__19); - Py_CLEAR(clear_module_state->__pyx_tuple__20); - Py_CLEAR(clear_module_state->__pyx_tuple__21); - Py_CLEAR(clear_module_state->__pyx_tuple__22); - Py_CLEAR(clear_module_state->__pyx_tuple__23); - Py_CLEAR(clear_module_state->__pyx_tuple__24); - Py_CLEAR(clear_module_state->__pyx_tuple__25); - Py_CLEAR(clear_module_state->__pyx_tuple__26); - Py_CLEAR(clear_module_state->__pyx_tuple__27); - Py_CLEAR(clear_module_state->__pyx_tuple__28); - Py_CLEAR(clear_module_state->__pyx_tuple__29); - Py_CLEAR(clear_module_state->__pyx_tuple__30); - Py_CLEAR(clear_module_state->__pyx_tuple__31); - Py_CLEAR(clear_module_state->__pyx_tuple__32); - Py_CLEAR(clear_module_state->__pyx_tuple__33); - Py_CLEAR(clear_module_state->__pyx_tuple__34); - Py_CLEAR(clear_module_state->__pyx_tuple__35); - Py_CLEAR(clear_module_state->__pyx_tuple__36); - Py_CLEAR(clear_module_state->__pyx_tuple__37); - Py_CLEAR(clear_module_state->__pyx_tuple__38); - Py_CLEAR(clear_module_state->__pyx_tuple__39); - Py_CLEAR(clear_module_state->__pyx_tuple__40); - Py_CLEAR(clear_module_state->__pyx_tuple__41); - Py_CLEAR(clear_module_state->__pyx_tuple__42); - Py_CLEAR(clear_module_state->__pyx_tuple__44); - Py_CLEAR(clear_module_state->__pyx_tuple__45); - Py_CLEAR(clear_module_state->__pyx_tuple__47); - Py_CLEAR(clear_module_state->__pyx_codeobj__4); - Py_CLEAR(clear_module_state->__pyx_codeobj__43); - Py_CLEAR(clear_module_state->__pyx_codeobj__46); - Py_CLEAR(clear_module_state->__pyx_codeobj__48); - return 0; -} -#endif -/* #### Code section: module_state_traverse ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); - if (!traverse_module_state) return 0; - Py_VISIT(traverse_module_state->__pyx_d); - Py_VISIT(traverse_module_state->__pyx_b); - Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); - #endif - Py_VISIT(traverse_module_state->__pyx_n_s_); - Py_VISIT(traverse_module_state->__pyx_kp_u_866); - Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_WHITESPACE); - Py_VISIT(traverse_module_state->__pyx_n_s_AnyStr); - Py_VISIT(traverse_module_state->__pyx_n_s_Callable); - Py_VISIT(traverse_module_state->__pyx_n_s_CodecFunction); - Py_VISIT(traverse_module_state->__pyx_n_s_DecodeFunction); - Py_VISIT(traverse_module_state->__pyx_n_s_Dict); - Py_VISIT(traverse_module_state->__pyx_kp_s_Dict_str_str); - Py_VISIT(traverse_module_state->__pyx_n_s_EncodeFunction); - Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); - Py_VISIT(traverse_module_state->__pyx_n_s_LABEL_ENCODINGS); - Py_VISIT(traverse_module_state->__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); - Py_VISIT(traverse_module_state->__pyx_n_s_REPLACEMENT_ENCODING); - Py_VISIT(traverse_module_state->__pyx_n_s_Tuple); - Py_VISIT(traverse_module_state->__pyx_n_s_UTF_16BE_ENCODING); - Py_VISIT(traverse_module_state->__pyx_n_s_UTF_16LE_ENCODING); - Py_VISIT(traverse_module_state->__pyx_n_s_UTF_8_ENCODER); - Py_VISIT(traverse_module_state->__pyx_n_s_UTF_8_ENCODING); - Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); - Py_VISIT(traverse_module_state->__pyx_kp_u__2); - Py_VISIT(traverse_module_state->__pyx_n_s__49); - Py_VISIT(traverse_module_state->__pyx_kp_u_ansi_x3_4_1968); - Py_VISIT(traverse_module_state->__pyx_n_u_arabic); - Py_VISIT(traverse_module_state->__pyx_n_u_ascii); - Py_VISIT(traverse_module_state->__pyx_kp_u_asmo_708); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_n_u_big5); - Py_VISIT(traverse_module_state->__pyx_kp_u_big5_hkscs); - Py_VISIT(traverse_module_state->__pyx_n_u_chinese); - Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_kp_u_cn_big5); - Py_VISIT(traverse_module_state->__pyx_n_s_codec_info); - Py_VISIT(traverse_module_state->__pyx_n_s_codecs); - Py_VISIT(traverse_module_state->__pyx_n_u_cp125); - Py_VISIT(traverse_module_state->__pyx_n_u_cp1252); - Py_VISIT(traverse_module_state->__pyx_n_u_cp1254); - Py_VISIT(traverse_module_state->__pyx_n_u_cp819); - Py_VISIT(traverse_module_state->__pyx_n_u_cp866); - Py_VISIT(traverse_module_state->__pyx_n_u_cp874); - Py_VISIT(traverse_module_state->__pyx_n_u_csbig5); - Py_VISIT(traverse_module_state->__pyx_n_u_cseuckr); - Py_VISIT(traverse_module_state->__pyx_n_u_cseucpkdfmtjapanese); - Py_VISIT(traverse_module_state->__pyx_n_u_csgb2312); - Py_VISIT(traverse_module_state->__pyx_n_u_csibm866); - Py_VISIT(traverse_module_state->__pyx_n_u_csiso2022jp); - Py_VISIT(traverse_module_state->__pyx_n_u_csiso2022kr); - Py_VISIT(traverse_module_state->__pyx_n_u_csiso58gb231280); - Py_VISIT(traverse_module_state->__pyx_n_u_csiso88596e); - Py_VISIT(traverse_module_state->__pyx_n_u_csiso88596i); - Py_VISIT(traverse_module_state->__pyx_n_u_csiso88598e); - Py_VISIT(traverse_module_state->__pyx_n_u_csiso88598i); - Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin1); - Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin2); - Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin3); - Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin4); - Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin5); - Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin6); - Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin9); - Py_VISIT(traverse_module_state->__pyx_n_u_csisolatinarabic); - Py_VISIT(traverse_module_state->__pyx_n_u_csisolatincyrillic); - Py_VISIT(traverse_module_state->__pyx_n_u_csisolatingreek); - Py_VISIT(traverse_module_state->__pyx_n_u_csisolatinhebrew); - Py_VISIT(traverse_module_state->__pyx_n_u_cskoi8r); - Py_VISIT(traverse_module_state->__pyx_n_u_csksc56011987); - Py_VISIT(traverse_module_state->__pyx_n_u_csmacintosh); - Py_VISIT(traverse_module_state->__pyx_n_u_csshiftjis); - Py_VISIT(traverse_module_state->__pyx_n_u_csunicode); - Py_VISIT(traverse_module_state->__pyx_n_u_cyrillic); - Py_VISIT(traverse_module_state->__pyx_kp_u_does_not_match_any_encoding_lab); - Py_VISIT(traverse_module_state->__pyx_kp_u_dos_874); - Py_VISIT(traverse_module_state->__pyx_kp_u_ecma_114); - Py_VISIT(traverse_module_state->__pyx_kp_u_ecma_118); - Py_VISIT(traverse_module_state->__pyx_n_u_elot_928); - Py_VISIT(traverse_module_state->__pyx_n_s_encode); - Py_VISIT(traverse_module_state->__pyx_n_s_encoding); - Py_VISIT(traverse_module_state->__pyx_kp_u_euc_jp); - Py_VISIT(traverse_module_state->__pyx_kp_u_euc_kr); - Py_VISIT(traverse_module_state->__pyx_n_s_functools); - Py_VISIT(traverse_module_state->__pyx_n_u_gb18030); - Py_VISIT(traverse_module_state->__pyx_n_u_gb2312); - Py_VISIT(traverse_module_state->__pyx_n_u_gb_2312); - Py_VISIT(traverse_module_state->__pyx_kp_u_gb_2312_80); - Py_VISIT(traverse_module_state->__pyx_n_u_gbk); - Py_VISIT(traverse_module_state->__pyx_n_s_get_encoder); - Py_VISIT(traverse_module_state->__pyx_n_s_get_encoding); - Py_VISIT(traverse_module_state->__pyx_n_s_get_output_encoding); - Py_VISIT(traverse_module_state->__pyx_n_u_greek); - Py_VISIT(traverse_module_state->__pyx_n_u_greek8); - Py_VISIT(traverse_module_state->__pyx_n_u_hebrew); - Py_VISIT(traverse_module_state->__pyx_kp_u_hz_gb_2312); - Py_VISIT(traverse_module_state->__pyx_n_u_ibm819); - Py_VISIT(traverse_module_state->__pyx_n_u_ibm866); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_infra); - Py_VISIT(traverse_module_state->__pyx_n_s_initializing); - Py_VISIT(traverse_module_state->__pyx_n_s_int); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_n_u_iso88591); - Py_VISIT(traverse_module_state->__pyx_n_u_iso885910); - Py_VISIT(traverse_module_state->__pyx_n_u_iso885911); - Py_VISIT(traverse_module_state->__pyx_n_u_iso885913); - Py_VISIT(traverse_module_state->__pyx_n_u_iso885914); - Py_VISIT(traverse_module_state->__pyx_n_u_iso885915); - Py_VISIT(traverse_module_state->__pyx_n_u_iso88592); - Py_VISIT(traverse_module_state->__pyx_n_u_iso88593); - Py_VISIT(traverse_module_state->__pyx_n_u_iso88594); - Py_VISIT(traverse_module_state->__pyx_n_u_iso88595); - Py_VISIT(traverse_module_state->__pyx_n_u_iso88596); - Py_VISIT(traverse_module_state->__pyx_n_u_iso88597); - Py_VISIT(traverse_module_state->__pyx_n_u_iso88598); - Py_VISIT(traverse_module_state->__pyx_n_u_iso88599); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_1); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_10); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_11); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_13); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_14); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_15); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_3); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_4); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_5); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_6); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_7); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_8); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_9); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_10646_ucs_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_2022_cn); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_2022_cn_ext); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_2022_jp); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_2022_kr); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_1); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_10); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_11); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_13); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_14); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_15); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_15_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_16); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_1_1987); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_1_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_2_1987); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_2_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_3); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_3_1988); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_3_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_4); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_4_1988); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_4_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_5); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_5_1988); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_5_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6_1987); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6_e); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6_i); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_7); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_7_1987); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_7_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8_1988); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8_e); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8_i); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_9); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_9_1989); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_9_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_100); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_101); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_109); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_110); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_126); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_127); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_138); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_144); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_148); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_149); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_157); - Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_58); - Py_VISIT(traverse_module_state->__pyx_n_u_koi); - Py_VISIT(traverse_module_state->__pyx_n_u_koi8); - Py_VISIT(traverse_module_state->__pyx_kp_u_koi8_r); - Py_VISIT(traverse_module_state->__pyx_n_u_koi8_r_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_koi8_ru); - Py_VISIT(traverse_module_state->__pyx_kp_u_koi8_u); - Py_VISIT(traverse_module_state->__pyx_n_u_korean); - Py_VISIT(traverse_module_state->__pyx_kp_u_ks_c_5601_1987); - Py_VISIT(traverse_module_state->__pyx_kp_u_ks_c_5601_1989); - Py_VISIT(traverse_module_state->__pyx_n_u_ksc5601); - Py_VISIT(traverse_module_state->__pyx_n_u_ksc_5601); - Py_VISIT(traverse_module_state->__pyx_n_u_l1); - Py_VISIT(traverse_module_state->__pyx_n_u_l2); - Py_VISIT(traverse_module_state->__pyx_n_u_l3); - Py_VISIT(traverse_module_state->__pyx_n_u_l4); - Py_VISIT(traverse_module_state->__pyx_n_u_l5); - Py_VISIT(traverse_module_state->__pyx_n_u_l6); - Py_VISIT(traverse_module_state->__pyx_n_u_l9); - Py_VISIT(traverse_module_state->__pyx_n_s_label); - Py_VISIT(traverse_module_state->__pyx_n_s_last_digit); - Py_VISIT(traverse_module_state->__pyx_n_u_latin1); - Py_VISIT(traverse_module_state->__pyx_n_u_latin2); - Py_VISIT(traverse_module_state->__pyx_n_u_latin3); - Py_VISIT(traverse_module_state->__pyx_n_u_latin4); - Py_VISIT(traverse_module_state->__pyx_n_u_latin5); - Py_VISIT(traverse_module_state->__pyx_n_u_latin6); - Py_VISIT(traverse_module_state->__pyx_n_u_logical); - Py_VISIT(traverse_module_state->__pyx_n_s_lookup); - Py_VISIT(traverse_module_state->__pyx_n_s_lower); - Py_VISIT(traverse_module_state->__pyx_n_s_lru_cache); - Py_VISIT(traverse_module_state->__pyx_n_u_mac); - Py_VISIT(traverse_module_state->__pyx_kp_u_mac_cyrillic); - Py_VISIT(traverse_module_state->__pyx_n_u_macintosh); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_maxsize); - Py_VISIT(traverse_module_state->__pyx_n_u_ms932); - Py_VISIT(traverse_module_state->__pyx_n_u_ms_kanji); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_u_replacement); - Py_VISIT(traverse_module_state->__pyx_n_s_return); - Py_VISIT(traverse_module_state->__pyx_kp_u_shift_jis); - Py_VISIT(traverse_module_state->__pyx_n_u_shift_jis_2); - Py_VISIT(traverse_module_state->__pyx_n_s_short_windows_125); - Py_VISIT(traverse_module_state->__pyx_n_u_sjis); - Py_VISIT(traverse_module_state->__pyx_n_s_spec); - Py_VISIT(traverse_module_state->__pyx_n_s_str); - Py_VISIT(traverse_module_state->__pyx_n_s_strip); - Py_VISIT(traverse_module_state->__pyx_n_u_sun_eu_greek); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_kp_u_tis_620); - Py_VISIT(traverse_module_state->__pyx_n_s_typing); - Py_VISIT(traverse_module_state->__pyx_kp_u_ucs_2); - Py_VISIT(traverse_module_state->__pyx_n_u_unicode); - Py_VISIT(traverse_module_state->__pyx_n_u_unicode11utf8); - Py_VISIT(traverse_module_state->__pyx_n_u_unicode20utf8); - Py_VISIT(traverse_module_state->__pyx_kp_u_unicode_1_1_utf_8); - Py_VISIT(traverse_module_state->__pyx_n_u_unicodefeff); - Py_VISIT(traverse_module_state->__pyx_n_u_unicodefffe); - Py_VISIT(traverse_module_state->__pyx_kp_u_us_ascii); - Py_VISIT(traverse_module_state->__pyx_n_u_utf8); - Py_VISIT(traverse_module_state->__pyx_kp_u_utf_16); - Py_VISIT(traverse_module_state->__pyx_kp_u_utf_16be); - Py_VISIT(traverse_module_state->__pyx_kp_u_utf_16le); - Py_VISIT(traverse_module_state->__pyx_kp_u_utf_8); - Py_VISIT(traverse_module_state->__pyx_n_u_visual); - Py_VISIT(traverse_module_state->__pyx_n_s_w3lib__encoding); - Py_VISIT(traverse_module_state->__pyx_kp_s_w3lib__encoding_pyx); - Py_VISIT(traverse_module_state->__pyx_kp_u_windows_125); - Py_VISIT(traverse_module_state->__pyx_kp_u_windows_1252); - Py_VISIT(traverse_module_state->__pyx_kp_u_windows_1254); - Py_VISIT(traverse_module_state->__pyx_kp_u_windows_31j); - Py_VISIT(traverse_module_state->__pyx_kp_u_windows_874); - Py_VISIT(traverse_module_state->__pyx_kp_u_windows_949); - Py_VISIT(traverse_module_state->__pyx_kp_u_x_cp125); - Py_VISIT(traverse_module_state->__pyx_kp_u_x_cp1252); - Py_VISIT(traverse_module_state->__pyx_kp_u_x_cp1254); - Py_VISIT(traverse_module_state->__pyx_kp_u_x_euc_jp); - Py_VISIT(traverse_module_state->__pyx_kp_u_x_gbk); - Py_VISIT(traverse_module_state->__pyx_kp_u_x_mac_cyrillic); - Py_VISIT(traverse_module_state->__pyx_kp_u_x_mac_roman); - Py_VISIT(traverse_module_state->__pyx_kp_u_x_mac_ukrainian); - Py_VISIT(traverse_module_state->__pyx_kp_u_x_sjis); - Py_VISIT(traverse_module_state->__pyx_kp_u_x_unicode20utf8); - Py_VISIT(traverse_module_state->__pyx_kp_u_x_user_defined); - Py_VISIT(traverse_module_state->__pyx_kp_u_x_x_big5); - Py_VISIT(traverse_module_state->__pyx_int_0); - Py_VISIT(traverse_module_state->__pyx_int_1); - Py_VISIT(traverse_module_state->__pyx_int_3); - Py_VISIT(traverse_module_state->__pyx_int_5); - Py_VISIT(traverse_module_state->__pyx_int_6); - Py_VISIT(traverse_module_state->__pyx_int_7); - Py_VISIT(traverse_module_state->__pyx_int_8); - Py_VISIT(traverse_module_state->__pyx_tuple__3); - Py_VISIT(traverse_module_state->__pyx_tuple__5); - Py_VISIT(traverse_module_state->__pyx_tuple__6); - Py_VISIT(traverse_module_state->__pyx_tuple__7); - Py_VISIT(traverse_module_state->__pyx_tuple__8); - Py_VISIT(traverse_module_state->__pyx_tuple__9); - Py_VISIT(traverse_module_state->__pyx_tuple__10); - Py_VISIT(traverse_module_state->__pyx_tuple__11); - Py_VISIT(traverse_module_state->__pyx_tuple__12); - Py_VISIT(traverse_module_state->__pyx_tuple__13); - Py_VISIT(traverse_module_state->__pyx_tuple__14); - Py_VISIT(traverse_module_state->__pyx_tuple__15); - Py_VISIT(traverse_module_state->__pyx_tuple__16); - Py_VISIT(traverse_module_state->__pyx_tuple__17); - Py_VISIT(traverse_module_state->__pyx_tuple__18); - Py_VISIT(traverse_module_state->__pyx_tuple__19); - Py_VISIT(traverse_module_state->__pyx_tuple__20); - Py_VISIT(traverse_module_state->__pyx_tuple__21); - Py_VISIT(traverse_module_state->__pyx_tuple__22); - Py_VISIT(traverse_module_state->__pyx_tuple__23); - Py_VISIT(traverse_module_state->__pyx_tuple__24); - Py_VISIT(traverse_module_state->__pyx_tuple__25); - Py_VISIT(traverse_module_state->__pyx_tuple__26); - Py_VISIT(traverse_module_state->__pyx_tuple__27); - Py_VISIT(traverse_module_state->__pyx_tuple__28); - Py_VISIT(traverse_module_state->__pyx_tuple__29); - Py_VISIT(traverse_module_state->__pyx_tuple__30); - Py_VISIT(traverse_module_state->__pyx_tuple__31); - Py_VISIT(traverse_module_state->__pyx_tuple__32); - Py_VISIT(traverse_module_state->__pyx_tuple__33); - Py_VISIT(traverse_module_state->__pyx_tuple__34); - Py_VISIT(traverse_module_state->__pyx_tuple__35); - Py_VISIT(traverse_module_state->__pyx_tuple__36); - Py_VISIT(traverse_module_state->__pyx_tuple__37); - Py_VISIT(traverse_module_state->__pyx_tuple__38); - Py_VISIT(traverse_module_state->__pyx_tuple__39); - Py_VISIT(traverse_module_state->__pyx_tuple__40); - Py_VISIT(traverse_module_state->__pyx_tuple__41); - Py_VISIT(traverse_module_state->__pyx_tuple__42); - Py_VISIT(traverse_module_state->__pyx_tuple__44); - Py_VISIT(traverse_module_state->__pyx_tuple__45); - Py_VISIT(traverse_module_state->__pyx_tuple__47); - Py_VISIT(traverse_module_state->__pyx_codeobj__4); - Py_VISIT(traverse_module_state->__pyx_codeobj__43); - Py_VISIT(traverse_module_state->__pyx_codeobj__46); - Py_VISIT(traverse_module_state->__pyx_codeobj__48); - return 0; -} -#endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ -#define __pyx_kp_u_866 __pyx_mstate_global->__pyx_kp_u_866 -#define __pyx_n_s_ASCII_WHITESPACE __pyx_mstate_global->__pyx_n_s_ASCII_WHITESPACE -#define __pyx_n_s_AnyStr __pyx_mstate_global->__pyx_n_s_AnyStr -#define __pyx_n_s_Callable __pyx_mstate_global->__pyx_n_s_Callable -#define __pyx_n_s_CodecFunction __pyx_mstate_global->__pyx_n_s_CodecFunction -#define __pyx_n_s_DecodeFunction __pyx_mstate_global->__pyx_n_s_DecodeFunction -#define __pyx_n_s_Dict __pyx_mstate_global->__pyx_n_s_Dict -#define __pyx_kp_s_Dict_str_str __pyx_mstate_global->__pyx_kp_s_Dict_str_str -#define __pyx_n_s_EncodeFunction __pyx_mstate_global->__pyx_n_s_EncodeFunction -#define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError -#define __pyx_n_s_LABEL_ENCODINGS __pyx_mstate_global->__pyx_n_s_LABEL_ENCODINGS -#define __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS __pyx_mstate_global->__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS -#define __pyx_n_s_REPLACEMENT_ENCODING __pyx_mstate_global->__pyx_n_s_REPLACEMENT_ENCODING -#define __pyx_n_s_Tuple __pyx_mstate_global->__pyx_n_s_Tuple -#define __pyx_n_s_UTF_16BE_ENCODING __pyx_mstate_global->__pyx_n_s_UTF_16BE_ENCODING -#define __pyx_n_s_UTF_16LE_ENCODING __pyx_mstate_global->__pyx_n_s_UTF_16LE_ENCODING -#define __pyx_n_s_UTF_8_ENCODER __pyx_mstate_global->__pyx_n_s_UTF_8_ENCODER -#define __pyx_n_s_UTF_8_ENCODING __pyx_mstate_global->__pyx_n_s_UTF_8_ENCODING -#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError -#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 -#define __pyx_n_s__49 __pyx_mstate_global->__pyx_n_s__49 -#define __pyx_kp_u_ansi_x3_4_1968 __pyx_mstate_global->__pyx_kp_u_ansi_x3_4_1968 -#define __pyx_n_u_arabic __pyx_mstate_global->__pyx_n_u_arabic -#define __pyx_n_u_ascii __pyx_mstate_global->__pyx_n_u_ascii -#define __pyx_kp_u_asmo_708 __pyx_mstate_global->__pyx_kp_u_asmo_708 -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_n_u_big5 __pyx_mstate_global->__pyx_n_u_big5 -#define __pyx_kp_u_big5_hkscs __pyx_mstate_global->__pyx_kp_u_big5_hkscs -#define __pyx_n_u_chinese __pyx_mstate_global->__pyx_n_u_chinese -#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_kp_u_cn_big5 __pyx_mstate_global->__pyx_kp_u_cn_big5 -#define __pyx_n_s_codec_info __pyx_mstate_global->__pyx_n_s_codec_info -#define __pyx_n_s_codecs __pyx_mstate_global->__pyx_n_s_codecs -#define __pyx_n_u_cp125 __pyx_mstate_global->__pyx_n_u_cp125 -#define __pyx_n_u_cp1252 __pyx_mstate_global->__pyx_n_u_cp1252 -#define __pyx_n_u_cp1254 __pyx_mstate_global->__pyx_n_u_cp1254 -#define __pyx_n_u_cp819 __pyx_mstate_global->__pyx_n_u_cp819 -#define __pyx_n_u_cp866 __pyx_mstate_global->__pyx_n_u_cp866 -#define __pyx_n_u_cp874 __pyx_mstate_global->__pyx_n_u_cp874 -#define __pyx_n_u_csbig5 __pyx_mstate_global->__pyx_n_u_csbig5 -#define __pyx_n_u_cseuckr __pyx_mstate_global->__pyx_n_u_cseuckr -#define __pyx_n_u_cseucpkdfmtjapanese __pyx_mstate_global->__pyx_n_u_cseucpkdfmtjapanese -#define __pyx_n_u_csgb2312 __pyx_mstate_global->__pyx_n_u_csgb2312 -#define __pyx_n_u_csibm866 __pyx_mstate_global->__pyx_n_u_csibm866 -#define __pyx_n_u_csiso2022jp __pyx_mstate_global->__pyx_n_u_csiso2022jp -#define __pyx_n_u_csiso2022kr __pyx_mstate_global->__pyx_n_u_csiso2022kr -#define __pyx_n_u_csiso58gb231280 __pyx_mstate_global->__pyx_n_u_csiso58gb231280 -#define __pyx_n_u_csiso88596e __pyx_mstate_global->__pyx_n_u_csiso88596e -#define __pyx_n_u_csiso88596i __pyx_mstate_global->__pyx_n_u_csiso88596i -#define __pyx_n_u_csiso88598e __pyx_mstate_global->__pyx_n_u_csiso88598e -#define __pyx_n_u_csiso88598i __pyx_mstate_global->__pyx_n_u_csiso88598i -#define __pyx_n_u_csisolatin1 __pyx_mstate_global->__pyx_n_u_csisolatin1 -#define __pyx_n_u_csisolatin2 __pyx_mstate_global->__pyx_n_u_csisolatin2 -#define __pyx_n_u_csisolatin3 __pyx_mstate_global->__pyx_n_u_csisolatin3 -#define __pyx_n_u_csisolatin4 __pyx_mstate_global->__pyx_n_u_csisolatin4 -#define __pyx_n_u_csisolatin5 __pyx_mstate_global->__pyx_n_u_csisolatin5 -#define __pyx_n_u_csisolatin6 __pyx_mstate_global->__pyx_n_u_csisolatin6 -#define __pyx_n_u_csisolatin9 __pyx_mstate_global->__pyx_n_u_csisolatin9 -#define __pyx_n_u_csisolatinarabic __pyx_mstate_global->__pyx_n_u_csisolatinarabic -#define __pyx_n_u_csisolatincyrillic __pyx_mstate_global->__pyx_n_u_csisolatincyrillic -#define __pyx_n_u_csisolatingreek __pyx_mstate_global->__pyx_n_u_csisolatingreek -#define __pyx_n_u_csisolatinhebrew __pyx_mstate_global->__pyx_n_u_csisolatinhebrew -#define __pyx_n_u_cskoi8r __pyx_mstate_global->__pyx_n_u_cskoi8r -#define __pyx_n_u_csksc56011987 __pyx_mstate_global->__pyx_n_u_csksc56011987 -#define __pyx_n_u_csmacintosh __pyx_mstate_global->__pyx_n_u_csmacintosh -#define __pyx_n_u_csshiftjis __pyx_mstate_global->__pyx_n_u_csshiftjis -#define __pyx_n_u_csunicode __pyx_mstate_global->__pyx_n_u_csunicode -#define __pyx_n_u_cyrillic __pyx_mstate_global->__pyx_n_u_cyrillic -#define __pyx_kp_u_does_not_match_any_encoding_lab __pyx_mstate_global->__pyx_kp_u_does_not_match_any_encoding_lab -#define __pyx_kp_u_dos_874 __pyx_mstate_global->__pyx_kp_u_dos_874 -#define __pyx_kp_u_ecma_114 __pyx_mstate_global->__pyx_kp_u_ecma_114 -#define __pyx_kp_u_ecma_118 __pyx_mstate_global->__pyx_kp_u_ecma_118 -#define __pyx_n_u_elot_928 __pyx_mstate_global->__pyx_n_u_elot_928 -#define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode -#define __pyx_n_s_encoding __pyx_mstate_global->__pyx_n_s_encoding -#define __pyx_kp_u_euc_jp __pyx_mstate_global->__pyx_kp_u_euc_jp -#define __pyx_kp_u_euc_kr __pyx_mstate_global->__pyx_kp_u_euc_kr -#define __pyx_n_s_functools __pyx_mstate_global->__pyx_n_s_functools -#define __pyx_n_u_gb18030 __pyx_mstate_global->__pyx_n_u_gb18030 -#define __pyx_n_u_gb2312 __pyx_mstate_global->__pyx_n_u_gb2312 -#define __pyx_n_u_gb_2312 __pyx_mstate_global->__pyx_n_u_gb_2312 -#define __pyx_kp_u_gb_2312_80 __pyx_mstate_global->__pyx_kp_u_gb_2312_80 -#define __pyx_n_u_gbk __pyx_mstate_global->__pyx_n_u_gbk -#define __pyx_n_s_get_encoder __pyx_mstate_global->__pyx_n_s_get_encoder -#define __pyx_n_s_get_encoding __pyx_mstate_global->__pyx_n_s_get_encoding -#define __pyx_n_s_get_output_encoding __pyx_mstate_global->__pyx_n_s_get_output_encoding -#define __pyx_n_u_greek __pyx_mstate_global->__pyx_n_u_greek -#define __pyx_n_u_greek8 __pyx_mstate_global->__pyx_n_u_greek8 -#define __pyx_n_u_hebrew __pyx_mstate_global->__pyx_n_u_hebrew -#define __pyx_kp_u_hz_gb_2312 __pyx_mstate_global->__pyx_kp_u_hz_gb_2312 -#define __pyx_n_u_ibm819 __pyx_mstate_global->__pyx_n_u_ibm819 -#define __pyx_n_u_ibm866 __pyx_mstate_global->__pyx_n_u_ibm866 -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_infra __pyx_mstate_global->__pyx_n_s_infra -#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing -#define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_n_u_iso88591 __pyx_mstate_global->__pyx_n_u_iso88591 -#define __pyx_n_u_iso885910 __pyx_mstate_global->__pyx_n_u_iso885910 -#define __pyx_n_u_iso885911 __pyx_mstate_global->__pyx_n_u_iso885911 -#define __pyx_n_u_iso885913 __pyx_mstate_global->__pyx_n_u_iso885913 -#define __pyx_n_u_iso885914 __pyx_mstate_global->__pyx_n_u_iso885914 -#define __pyx_n_u_iso885915 __pyx_mstate_global->__pyx_n_u_iso885915 -#define __pyx_n_u_iso88592 __pyx_mstate_global->__pyx_n_u_iso88592 -#define __pyx_n_u_iso88593 __pyx_mstate_global->__pyx_n_u_iso88593 -#define __pyx_n_u_iso88594 __pyx_mstate_global->__pyx_n_u_iso88594 -#define __pyx_n_u_iso88595 __pyx_mstate_global->__pyx_n_u_iso88595 -#define __pyx_n_u_iso88596 __pyx_mstate_global->__pyx_n_u_iso88596 -#define __pyx_n_u_iso88597 __pyx_mstate_global->__pyx_n_u_iso88597 -#define __pyx_n_u_iso88598 __pyx_mstate_global->__pyx_n_u_iso88598 -#define __pyx_n_u_iso88599 __pyx_mstate_global->__pyx_n_u_iso88599 -#define __pyx_kp_u_iso8859_1 __pyx_mstate_global->__pyx_kp_u_iso8859_1 -#define __pyx_kp_u_iso8859_10 __pyx_mstate_global->__pyx_kp_u_iso8859_10 -#define __pyx_kp_u_iso8859_11 __pyx_mstate_global->__pyx_kp_u_iso8859_11 -#define __pyx_kp_u_iso8859_13 __pyx_mstate_global->__pyx_kp_u_iso8859_13 -#define __pyx_kp_u_iso8859_14 __pyx_mstate_global->__pyx_kp_u_iso8859_14 -#define __pyx_kp_u_iso8859_15 __pyx_mstate_global->__pyx_kp_u_iso8859_15 -#define __pyx_kp_u_iso8859_2 __pyx_mstate_global->__pyx_kp_u_iso8859_2 -#define __pyx_kp_u_iso8859_3 __pyx_mstate_global->__pyx_kp_u_iso8859_3 -#define __pyx_kp_u_iso8859_4 __pyx_mstate_global->__pyx_kp_u_iso8859_4 -#define __pyx_kp_u_iso8859_5 __pyx_mstate_global->__pyx_kp_u_iso8859_5 -#define __pyx_kp_u_iso8859_6 __pyx_mstate_global->__pyx_kp_u_iso8859_6 -#define __pyx_kp_u_iso8859_7 __pyx_mstate_global->__pyx_kp_u_iso8859_7 -#define __pyx_kp_u_iso8859_8 __pyx_mstate_global->__pyx_kp_u_iso8859_8 -#define __pyx_kp_u_iso8859_9 __pyx_mstate_global->__pyx_kp_u_iso8859_9 -#define __pyx_kp_u_iso_10646_ucs_2 __pyx_mstate_global->__pyx_kp_u_iso_10646_ucs_2 -#define __pyx_kp_u_iso_2022_cn __pyx_mstate_global->__pyx_kp_u_iso_2022_cn -#define __pyx_kp_u_iso_2022_cn_ext __pyx_mstate_global->__pyx_kp_u_iso_2022_cn_ext -#define __pyx_kp_u_iso_2022_jp __pyx_mstate_global->__pyx_kp_u_iso_2022_jp -#define __pyx_kp_u_iso_2022_kr __pyx_mstate_global->__pyx_kp_u_iso_2022_kr -#define __pyx_kp_u_iso_8859_1 __pyx_mstate_global->__pyx_kp_u_iso_8859_1 -#define __pyx_kp_u_iso_8859_10 __pyx_mstate_global->__pyx_kp_u_iso_8859_10 -#define __pyx_kp_u_iso_8859_11 __pyx_mstate_global->__pyx_kp_u_iso_8859_11 -#define __pyx_kp_u_iso_8859_13 __pyx_mstate_global->__pyx_kp_u_iso_8859_13 -#define __pyx_kp_u_iso_8859_14 __pyx_mstate_global->__pyx_kp_u_iso_8859_14 -#define __pyx_kp_u_iso_8859_15 __pyx_mstate_global->__pyx_kp_u_iso_8859_15 -#define __pyx_kp_u_iso_8859_15_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_15_2 -#define __pyx_kp_u_iso_8859_16 __pyx_mstate_global->__pyx_kp_u_iso_8859_16 -#define __pyx_kp_u_iso_8859_1_1987 __pyx_mstate_global->__pyx_kp_u_iso_8859_1_1987 -#define __pyx_kp_u_iso_8859_1_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_1_2 -#define __pyx_kp_u_iso_8859_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_2 -#define __pyx_kp_u_iso_8859_2_1987 __pyx_mstate_global->__pyx_kp_u_iso_8859_2_1987 -#define __pyx_kp_u_iso_8859_2_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_2_2 -#define __pyx_kp_u_iso_8859_3 __pyx_mstate_global->__pyx_kp_u_iso_8859_3 -#define __pyx_kp_u_iso_8859_3_1988 __pyx_mstate_global->__pyx_kp_u_iso_8859_3_1988 -#define __pyx_kp_u_iso_8859_3_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_3_2 -#define __pyx_kp_u_iso_8859_4 __pyx_mstate_global->__pyx_kp_u_iso_8859_4 -#define __pyx_kp_u_iso_8859_4_1988 __pyx_mstate_global->__pyx_kp_u_iso_8859_4_1988 -#define __pyx_kp_u_iso_8859_4_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_4_2 -#define __pyx_kp_u_iso_8859_5 __pyx_mstate_global->__pyx_kp_u_iso_8859_5 -#define __pyx_kp_u_iso_8859_5_1988 __pyx_mstate_global->__pyx_kp_u_iso_8859_5_1988 -#define __pyx_kp_u_iso_8859_5_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_5_2 -#define __pyx_kp_u_iso_8859_6 __pyx_mstate_global->__pyx_kp_u_iso_8859_6 -#define __pyx_kp_u_iso_8859_6_1987 __pyx_mstate_global->__pyx_kp_u_iso_8859_6_1987 -#define __pyx_kp_u_iso_8859_6_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_6_2 -#define __pyx_kp_u_iso_8859_6_e __pyx_mstate_global->__pyx_kp_u_iso_8859_6_e -#define __pyx_kp_u_iso_8859_6_i __pyx_mstate_global->__pyx_kp_u_iso_8859_6_i -#define __pyx_kp_u_iso_8859_7 __pyx_mstate_global->__pyx_kp_u_iso_8859_7 -#define __pyx_kp_u_iso_8859_7_1987 __pyx_mstate_global->__pyx_kp_u_iso_8859_7_1987 -#define __pyx_kp_u_iso_8859_7_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_7_2 -#define __pyx_kp_u_iso_8859_8 __pyx_mstate_global->__pyx_kp_u_iso_8859_8 -#define __pyx_kp_u_iso_8859_8_1988 __pyx_mstate_global->__pyx_kp_u_iso_8859_8_1988 -#define __pyx_kp_u_iso_8859_8_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_8_2 -#define __pyx_kp_u_iso_8859_8_e __pyx_mstate_global->__pyx_kp_u_iso_8859_8_e -#define __pyx_kp_u_iso_8859_8_i __pyx_mstate_global->__pyx_kp_u_iso_8859_8_i -#define __pyx_kp_u_iso_8859_9 __pyx_mstate_global->__pyx_kp_u_iso_8859_9 -#define __pyx_kp_u_iso_8859_9_1989 __pyx_mstate_global->__pyx_kp_u_iso_8859_9_1989 -#define __pyx_kp_u_iso_8859_9_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_9_2 -#define __pyx_kp_u_iso_ir_100 __pyx_mstate_global->__pyx_kp_u_iso_ir_100 -#define __pyx_kp_u_iso_ir_101 __pyx_mstate_global->__pyx_kp_u_iso_ir_101 -#define __pyx_kp_u_iso_ir_109 __pyx_mstate_global->__pyx_kp_u_iso_ir_109 -#define __pyx_kp_u_iso_ir_110 __pyx_mstate_global->__pyx_kp_u_iso_ir_110 -#define __pyx_kp_u_iso_ir_126 __pyx_mstate_global->__pyx_kp_u_iso_ir_126 -#define __pyx_kp_u_iso_ir_127 __pyx_mstate_global->__pyx_kp_u_iso_ir_127 -#define __pyx_kp_u_iso_ir_138 __pyx_mstate_global->__pyx_kp_u_iso_ir_138 -#define __pyx_kp_u_iso_ir_144 __pyx_mstate_global->__pyx_kp_u_iso_ir_144 -#define __pyx_kp_u_iso_ir_148 __pyx_mstate_global->__pyx_kp_u_iso_ir_148 -#define __pyx_kp_u_iso_ir_149 __pyx_mstate_global->__pyx_kp_u_iso_ir_149 -#define __pyx_kp_u_iso_ir_157 __pyx_mstate_global->__pyx_kp_u_iso_ir_157 -#define __pyx_kp_u_iso_ir_58 __pyx_mstate_global->__pyx_kp_u_iso_ir_58 -#define __pyx_n_u_koi __pyx_mstate_global->__pyx_n_u_koi -#define __pyx_n_u_koi8 __pyx_mstate_global->__pyx_n_u_koi8 -#define __pyx_kp_u_koi8_r __pyx_mstate_global->__pyx_kp_u_koi8_r -#define __pyx_n_u_koi8_r_2 __pyx_mstate_global->__pyx_n_u_koi8_r_2 -#define __pyx_kp_u_koi8_ru __pyx_mstate_global->__pyx_kp_u_koi8_ru -#define __pyx_kp_u_koi8_u __pyx_mstate_global->__pyx_kp_u_koi8_u -#define __pyx_n_u_korean __pyx_mstate_global->__pyx_n_u_korean -#define __pyx_kp_u_ks_c_5601_1987 __pyx_mstate_global->__pyx_kp_u_ks_c_5601_1987 -#define __pyx_kp_u_ks_c_5601_1989 __pyx_mstate_global->__pyx_kp_u_ks_c_5601_1989 -#define __pyx_n_u_ksc5601 __pyx_mstate_global->__pyx_n_u_ksc5601 -#define __pyx_n_u_ksc_5601 __pyx_mstate_global->__pyx_n_u_ksc_5601 -#define __pyx_n_u_l1 __pyx_mstate_global->__pyx_n_u_l1 -#define __pyx_n_u_l2 __pyx_mstate_global->__pyx_n_u_l2 -#define __pyx_n_u_l3 __pyx_mstate_global->__pyx_n_u_l3 -#define __pyx_n_u_l4 __pyx_mstate_global->__pyx_n_u_l4 -#define __pyx_n_u_l5 __pyx_mstate_global->__pyx_n_u_l5 -#define __pyx_n_u_l6 __pyx_mstate_global->__pyx_n_u_l6 -#define __pyx_n_u_l9 __pyx_mstate_global->__pyx_n_u_l9 -#define __pyx_n_s_label __pyx_mstate_global->__pyx_n_s_label -#define __pyx_n_s_last_digit __pyx_mstate_global->__pyx_n_s_last_digit -#define __pyx_n_u_latin1 __pyx_mstate_global->__pyx_n_u_latin1 -#define __pyx_n_u_latin2 __pyx_mstate_global->__pyx_n_u_latin2 -#define __pyx_n_u_latin3 __pyx_mstate_global->__pyx_n_u_latin3 -#define __pyx_n_u_latin4 __pyx_mstate_global->__pyx_n_u_latin4 -#define __pyx_n_u_latin5 __pyx_mstate_global->__pyx_n_u_latin5 -#define __pyx_n_u_latin6 __pyx_mstate_global->__pyx_n_u_latin6 -#define __pyx_n_u_logical __pyx_mstate_global->__pyx_n_u_logical -#define __pyx_n_s_lookup __pyx_mstate_global->__pyx_n_s_lookup -#define __pyx_n_s_lower __pyx_mstate_global->__pyx_n_s_lower -#define __pyx_n_s_lru_cache __pyx_mstate_global->__pyx_n_s_lru_cache -#define __pyx_n_u_mac __pyx_mstate_global->__pyx_n_u_mac -#define __pyx_kp_u_mac_cyrillic __pyx_mstate_global->__pyx_kp_u_mac_cyrillic -#define __pyx_n_u_macintosh __pyx_mstate_global->__pyx_n_u_macintosh -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_maxsize __pyx_mstate_global->__pyx_n_s_maxsize -#define __pyx_n_u_ms932 __pyx_mstate_global->__pyx_n_u_ms932 -#define __pyx_n_u_ms_kanji __pyx_mstate_global->__pyx_n_u_ms_kanji -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_u_replacement __pyx_mstate_global->__pyx_n_u_replacement -#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return -#define __pyx_kp_u_shift_jis __pyx_mstate_global->__pyx_kp_u_shift_jis -#define __pyx_n_u_shift_jis_2 __pyx_mstate_global->__pyx_n_u_shift_jis_2 -#define __pyx_n_s_short_windows_125 __pyx_mstate_global->__pyx_n_s_short_windows_125 -#define __pyx_n_u_sjis __pyx_mstate_global->__pyx_n_u_sjis -#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec -#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str -#define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip -#define __pyx_n_u_sun_eu_greek __pyx_mstate_global->__pyx_n_u_sun_eu_greek -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_kp_u_tis_620 __pyx_mstate_global->__pyx_kp_u_tis_620 -#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing -#define __pyx_kp_u_ucs_2 __pyx_mstate_global->__pyx_kp_u_ucs_2 -#define __pyx_n_u_unicode __pyx_mstate_global->__pyx_n_u_unicode -#define __pyx_n_u_unicode11utf8 __pyx_mstate_global->__pyx_n_u_unicode11utf8 -#define __pyx_n_u_unicode20utf8 __pyx_mstate_global->__pyx_n_u_unicode20utf8 -#define __pyx_kp_u_unicode_1_1_utf_8 __pyx_mstate_global->__pyx_kp_u_unicode_1_1_utf_8 -#define __pyx_n_u_unicodefeff __pyx_mstate_global->__pyx_n_u_unicodefeff -#define __pyx_n_u_unicodefffe __pyx_mstate_global->__pyx_n_u_unicodefffe -#define __pyx_kp_u_us_ascii __pyx_mstate_global->__pyx_kp_u_us_ascii -#define __pyx_n_u_utf8 __pyx_mstate_global->__pyx_n_u_utf8 -#define __pyx_kp_u_utf_16 __pyx_mstate_global->__pyx_kp_u_utf_16 -#define __pyx_kp_u_utf_16be __pyx_mstate_global->__pyx_kp_u_utf_16be -#define __pyx_kp_u_utf_16le __pyx_mstate_global->__pyx_kp_u_utf_16le -#define __pyx_kp_u_utf_8 __pyx_mstate_global->__pyx_kp_u_utf_8 -#define __pyx_n_u_visual __pyx_mstate_global->__pyx_n_u_visual -#define __pyx_n_s_w3lib__encoding __pyx_mstate_global->__pyx_n_s_w3lib__encoding -#define __pyx_kp_s_w3lib__encoding_pyx __pyx_mstate_global->__pyx_kp_s_w3lib__encoding_pyx -#define __pyx_kp_u_windows_125 __pyx_mstate_global->__pyx_kp_u_windows_125 -#define __pyx_kp_u_windows_1252 __pyx_mstate_global->__pyx_kp_u_windows_1252 -#define __pyx_kp_u_windows_1254 __pyx_mstate_global->__pyx_kp_u_windows_1254 -#define __pyx_kp_u_windows_31j __pyx_mstate_global->__pyx_kp_u_windows_31j -#define __pyx_kp_u_windows_874 __pyx_mstate_global->__pyx_kp_u_windows_874 -#define __pyx_kp_u_windows_949 __pyx_mstate_global->__pyx_kp_u_windows_949 -#define __pyx_kp_u_x_cp125 __pyx_mstate_global->__pyx_kp_u_x_cp125 -#define __pyx_kp_u_x_cp1252 __pyx_mstate_global->__pyx_kp_u_x_cp1252 -#define __pyx_kp_u_x_cp1254 __pyx_mstate_global->__pyx_kp_u_x_cp1254 -#define __pyx_kp_u_x_euc_jp __pyx_mstate_global->__pyx_kp_u_x_euc_jp -#define __pyx_kp_u_x_gbk __pyx_mstate_global->__pyx_kp_u_x_gbk -#define __pyx_kp_u_x_mac_cyrillic __pyx_mstate_global->__pyx_kp_u_x_mac_cyrillic -#define __pyx_kp_u_x_mac_roman __pyx_mstate_global->__pyx_kp_u_x_mac_roman -#define __pyx_kp_u_x_mac_ukrainian __pyx_mstate_global->__pyx_kp_u_x_mac_ukrainian -#define __pyx_kp_u_x_sjis __pyx_mstate_global->__pyx_kp_u_x_sjis -#define __pyx_kp_u_x_unicode20utf8 __pyx_mstate_global->__pyx_kp_u_x_unicode20utf8 -#define __pyx_kp_u_x_user_defined __pyx_mstate_global->__pyx_kp_u_x_user_defined -#define __pyx_kp_u_x_x_big5 __pyx_mstate_global->__pyx_kp_u_x_x_big5 -#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 -#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 -#define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 -#define __pyx_int_5 __pyx_mstate_global->__pyx_int_5 -#define __pyx_int_6 __pyx_mstate_global->__pyx_int_6 -#define __pyx_int_7 __pyx_mstate_global->__pyx_int_7 -#define __pyx_int_8 __pyx_mstate_global->__pyx_int_8 -#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 -#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 -#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 -#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 -#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 -#define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 -#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 -#define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 -#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 -#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 -#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 -#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 -#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 -#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 -#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 -#define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 -#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 -#define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 -#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 -#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 -#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 -#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 -#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 -#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 -#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 -#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 -#define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 -#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 -#define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 -#define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 -#define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 -#define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 -#define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 -#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 -#define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 -#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 -#define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 -#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 -#define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 -#define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44 -#define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 -#define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 -#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 -#define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43 -#define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 -#define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 -/* #### Code section: module_code ### */ - -/* "w3lib/_encoding.pyx":15 - * - * - * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< - * return { - * label: f"windows-125{last_digit}" - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_9_encoding_1_short_windows_125(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_9_encoding__short_windows_125, "_short_windows_125(int last_digit: int) -> Dict[str, str]"); -static PyMethodDef __pyx_mdef_5w3lib_9_encoding_1_short_windows_125 = {"_short_windows_125", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_9_encoding_1_short_windows_125, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_9_encoding__short_windows_125}; -static PyObject *__pyx_pw_5w3lib_9_encoding_1_short_windows_125(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_last_digit = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_short_windows_125 (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_last_digit,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_last_digit)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 15, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_short_windows_125") < 0)) __PYX_ERR(0, 15, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_last_digit = ((PyObject*)values[0]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_short_windows_125", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 15, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("w3lib._encoding._short_windows_125", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_digit), (&PyInt_Type), 0, "last_digit", 1))) __PYX_ERR(0, 15, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_9_encoding__short_windows_125(__pyx_self, __pyx_v_last_digit); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5w3lib_9_encoding__short_windows_125(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_last_digit) { - PyObject *__pyx_7genexpr__pyx_v_label = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_short_windows_125", 1); - - /* "w3lib/_encoding.pyx":16 - * - * def _short_windows_125(last_digit: int) -> Dict[str, str]: - * return { # <<<<<<<<<<<<<< - * label: f"windows-125{last_digit}" - * for label in ( - */ - __Pyx_XDECREF(__pyx_r); - { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_1); - - /* "w3lib/_encoding.pyx":19 - * label: f"windows-125{last_digit}" - * for label in ( - * f"cp125{last_digit}", # <<<<<<<<<<<<<< - * f"windows-125{last_digit}", - * f"x-cp125{last_digit}", - */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_n_u_cp125, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "w3lib/_encoding.pyx":20 - * for label in ( - * f"cp125{last_digit}", - * f"windows-125{last_digit}", # <<<<<<<<<<<<<< - * f"x-cp125{last_digit}", - * ) - */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_windows_125, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "w3lib/_encoding.pyx":21 - * f"cp125{last_digit}", - * f"windows-125{last_digit}", - * f"x-cp125{last_digit}", # <<<<<<<<<<<<<< - * ) - * } - */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_x_cp125, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "w3lib/_encoding.pyx":19 - * label: f"windows-125{last_digit}" - * for label in ( - * f"cp125{last_digit}", # <<<<<<<<<<<<<< - * f"windows-125{last_digit}", - * f"x-cp125{last_digit}", - */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 19, __pyx_L5_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 19, __pyx_L5_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5)) __PYX_ERR(0, 19, __pyx_L5_error); - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_t_5 = 0; - - /* "w3lib/_encoding.pyx":18 - * return { - * label: f"windows-125{last_digit}" - * for label in ( # <<<<<<<<<<<<<< - * f"cp125{last_digit}", - * f"windows-125{last_digit}", - */ - __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_6 >= 3) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 18, __pyx_L5_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_label, ((PyObject*)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "w3lib/_encoding.pyx":17 - * def _short_windows_125(last_digit: int) -> Dict[str, str]: - * return { - * label: f"windows-125{last_digit}" # <<<<<<<<<<<<<< - * for label in ( - * f"cp125{last_digit}", - */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_windows_125, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 17, __pyx_L5_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":18 - * return { - * label: f"windows-125{last_digit}" - * for label in ( # <<<<<<<<<<<<<< - * f"cp125{last_digit}", - * f"windows-125{last_digit}", - */ - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_7genexpr__pyx_v_label); __pyx_7genexpr__pyx_v_label = 0; - goto __pyx_L9_exit_scope; - __pyx_L5_error:; - __Pyx_XDECREF(__pyx_7genexpr__pyx_v_label); __pyx_7genexpr__pyx_v_label = 0; - goto __pyx_L1_error; - __pyx_L9_exit_scope:; - } /* exit inner scope */ - __pyx_r = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "w3lib/_encoding.pyx":15 - * - * - * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< - * return { - * label: f"windows-125{last_digit}" - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("w3lib._encoding._short_windows_125", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_7genexpr__pyx_v_label); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "w3lib/_encoding.pyx":416 - * - * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder - * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< - * def _get_encoder(encoding: str) -> EncodeFunction: - * codec_info = codecs.lookup(encoding) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_9_encoding_3_get_encoder(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_9_encoding_2_get_encoder, "_get_encoder(unicode encoding: str) -> EncodeFunction"); -static PyMethodDef __pyx_mdef_5w3lib_9_encoding_3_get_encoder = {"_get_encoder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_9_encoding_3_get_encoder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_9_encoding_2_get_encoder}; -static PyObject *__pyx_pw_5w3lib_9_encoding_3_get_encoder(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_encoding = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_get_encoder (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_encoding,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_encoder") < 0)) __PYX_ERR(0, 416, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_encoding = ((PyObject*)values[0]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_encoder", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 416, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("w3lib._encoding._get_encoder", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 417, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_9_encoding_2_get_encoder(__pyx_self, __pyx_v_encoding); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5w3lib_9_encoding_2_get_encoder(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_encoding) { - PyObject *__pyx_v_codec_info = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_get_encoder", 1); - - /* "w3lib/_encoding.pyx":418 - * @lru_cache(maxsize=None) - * def _get_encoder(encoding: str) -> EncodeFunction: - * codec_info = codecs.lookup(encoding) # <<<<<<<<<<<<<< - * return codec_info.encode - * - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_codecs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_encoding}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_v_codec_info = __pyx_t_1; - __pyx_t_1 = 0; - - /* "w3lib/_encoding.pyx":419 - * def _get_encoder(encoding: str) -> EncodeFunction: - * codec_info = codecs.lookup(encoding) - * return codec_info.encode # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec_info, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "w3lib/_encoding.pyx":416 - * - * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder - * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< - * def _get_encoder(encoding: str) -> EncodeFunction: - * codec_info = codecs.lookup(encoding) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("w3lib._encoding._get_encoder", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_codec_info); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "w3lib/_encoding.pyx":426 - * - * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get - * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< - * def _get_encoding(label: str) -> str: - * label = label.strip(_ASCII_WHITESPACE).lower() - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_9_encoding_5_get_encoding(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_9_encoding_4_get_encoding, "_get_encoding(unicode label: str) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_9_encoding_5_get_encoding = {"_get_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_9_encoding_5_get_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_9_encoding_4_get_encoding}; -static PyObject *__pyx_pw_5w3lib_9_encoding_5_get_encoding(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_label = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_get_encoding (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_label,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_encoding") < 0)) __PYX_ERR(0, 426, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_label = ((PyObject*)values[0]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 426, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("w3lib._encoding._get_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), (&PyUnicode_Type), 0, "label", 1))) __PYX_ERR(0, 427, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_9_encoding_4_get_encoding(__pyx_self, __pyx_v_label); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5w3lib_9_encoding_4_get_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label) { - PyObject *__pyx_v_encoding = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_get_encoding", 0); - __Pyx_INCREF(__pyx_v_label); - - /* "w3lib/_encoding.pyx":428 - * @lru_cache(maxsize=None) - * def _get_encoding(label: str) -> str: - * label = label.strip(_ASCII_WHITESPACE).lower() # <<<<<<<<<<<<<< - * try: - * encoding = _LABEL_ENCODINGS[label] - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_WHITESPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_label, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_label, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "w3lib/_encoding.pyx":429 - * def _get_encoding(label: str) -> str: - * label = label.strip(_ASCII_WHITESPACE).lower() - * try: # <<<<<<<<<<<<<< - * encoding = _LABEL_ENCODINGS[label] - * except KeyError: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - /*try:*/ { - - /* "w3lib/_encoding.pyx":430 - * label = label.strip(_ASCII_WHITESPACE).lower() - * try: - * encoding = _LABEL_ENCODINGS[label] # <<<<<<<<<<<<<< - * except KeyError: - * raise ValueError( - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_LABEL_ENCODINGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_encoding = __pyx_t_2; - __pyx_t_2 = 0; - - /* "w3lib/_encoding.pyx":429 - * def _get_encoding(label: str) -> str: - * label = label.strip(_ASCII_WHITESPACE).lower() - * try: # <<<<<<<<<<<<<< - * encoding = _LABEL_ENCODINGS[label] - * except KeyError: - */ - } - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L8_try_end; - __pyx_L3_error:; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "w3lib/_encoding.pyx":431 - * try: - * encoding = _LABEL_ENCODINGS[label] - * except KeyError: # <<<<<<<<<<<<<< - * raise ValueError( - * f"{label!r} does not match any encoding label from the Encoding " - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); - if (__pyx_t_4) { - __Pyx_AddTraceback("w3lib._encoding._get_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 431, __pyx_L5_except_error) - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":433 - * except KeyError: - * raise ValueError( - * f"{label!r} does not match any encoding label from the Encoding " # <<<<<<<<<<<<<< - * f"Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721" - * f"bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)" - */ - __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 433, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_8, __pyx_kp_u_does_not_match_any_encoding_lab); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 433, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "w3lib/_encoding.pyx":432 - * encoding = _LABEL_ENCODINGS[label] - * except KeyError: - * raise ValueError( # <<<<<<<<<<<<<< - * f"{label!r} does not match any encoding label from the Encoding " - * f"Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721" - */ - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L5_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 432, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - - /* "w3lib/_encoding.pyx":429 - * def _get_encoding(label: str) -> str: - * label = label.strip(_ASCII_WHITESPACE).lower() - * try: # <<<<<<<<<<<<<< - * encoding = _LABEL_ENCODINGS[label] - * except KeyError: - */ - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); - goto __pyx_L1_error; - __pyx_L8_try_end:; - } - - /* "w3lib/_encoding.pyx":437 - * f"bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)" - * ) - * return encoding # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_encoding))||((__pyx_v_encoding) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_encoding))) __PYX_ERR(0, 437, __pyx_L1_error) - __Pyx_INCREF(__pyx_v_encoding); - __pyx_r = ((PyObject*)__pyx_v_encoding); - goto __pyx_L0; - - /* "w3lib/_encoding.pyx":426 - * - * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get - * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< - * def _get_encoding(label: str) -> str: - * label = label.strip(_ASCII_WHITESPACE).lower() - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("w3lib._encoding._get_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_encoding); - __Pyx_XDECREF(__pyx_v_label); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "w3lib/_encoding.pyx":448 - * - * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings - * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< - * def _get_output_encoding(encoding: str) -> str: - * encoding = _get_encoding(encoding) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_9_encoding_7_get_output_encoding(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_9_encoding_6_get_output_encoding, "_get_output_encoding(unicode encoding: str) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_9_encoding_7_get_output_encoding = {"_get_output_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_9_encoding_7_get_output_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_9_encoding_6_get_output_encoding}; -static PyObject *__pyx_pw_5w3lib_9_encoding_7_get_output_encoding(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_encoding = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_get_output_encoding (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_encoding,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_output_encoding") < 0)) __PYX_ERR(0, 448, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_encoding = ((PyObject*)values[0]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_output_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 448, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("w3lib._encoding._get_output_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 449, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_9_encoding_6_get_output_encoding(__pyx_self, __pyx_v_encoding); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5w3lib_9_encoding_6_get_output_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_encoding) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_get_output_encoding", 0); - __Pyx_INCREF(__pyx_v_encoding); - - /* "w3lib/_encoding.pyx":450 - * @lru_cache(maxsize=None) - * def _get_output_encoding(encoding: str) -> str: - * encoding = _get_encoding(encoding) # <<<<<<<<<<<<<< - * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: - * return _UTF_8_ENCODING - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 450, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_encoding, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "w3lib/_encoding.pyx":451 - * def _get_output_encoding(encoding: str) -> str: - * encoding = _get_encoding(encoding) - * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: # <<<<<<<<<<<<<< - * return _UTF_8_ENCODING - * return encoding - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_encoding, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 451, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "w3lib/_encoding.pyx":452 - * encoding = _get_encoding(encoding) - * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: - * return _UTF_8_ENCODING # <<<<<<<<<<<<<< - * return encoding - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_UTF_8_ENCODING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 452, __pyx_L1_error) - __pyx_r = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "w3lib/_encoding.pyx":451 - * def _get_output_encoding(encoding: str) -> str: - * encoding = _get_encoding(encoding) - * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: # <<<<<<<<<<<<<< - * return _UTF_8_ENCODING - * return encoding - */ - } - - /* "w3lib/_encoding.pyx":453 - * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: - * return _UTF_8_ENCODING - * return encoding # <<<<<<<<<<<<<< - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_encoding); - __pyx_r = __pyx_v_encoding; - goto __pyx_L0; - - /* "w3lib/_encoding.pyx":448 - * - * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings - * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< - * def _get_output_encoding(encoding: str) -> str: - * encoding = _get_encoding(encoding) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("w3lib._encoding._get_output_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_encoding); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ - -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, - {&__pyx_kp_u_866, __pyx_k_866, sizeof(__pyx_k_866), 0, 1, 0, 0}, - {&__pyx_n_s_ASCII_WHITESPACE, __pyx_k_ASCII_WHITESPACE, sizeof(__pyx_k_ASCII_WHITESPACE), 0, 0, 1, 1}, - {&__pyx_n_s_AnyStr, __pyx_k_AnyStr, sizeof(__pyx_k_AnyStr), 0, 0, 1, 1}, - {&__pyx_n_s_Callable, __pyx_k_Callable, sizeof(__pyx_k_Callable), 0, 0, 1, 1}, - {&__pyx_n_s_CodecFunction, __pyx_k_CodecFunction, sizeof(__pyx_k_CodecFunction), 0, 0, 1, 1}, - {&__pyx_n_s_DecodeFunction, __pyx_k_DecodeFunction, sizeof(__pyx_k_DecodeFunction), 0, 0, 1, 1}, - {&__pyx_n_s_Dict, __pyx_k_Dict, sizeof(__pyx_k_Dict), 0, 0, 1, 1}, - {&__pyx_kp_s_Dict_str_str, __pyx_k_Dict_str_str, sizeof(__pyx_k_Dict_str_str), 0, 0, 1, 0}, - {&__pyx_n_s_EncodeFunction, __pyx_k_EncodeFunction, sizeof(__pyx_k_EncodeFunction), 0, 0, 1, 1}, - {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, - {&__pyx_n_s_LABEL_ENCODINGS, __pyx_k_LABEL_ENCODINGS, sizeof(__pyx_k_LABEL_ENCODINGS), 0, 0, 1, 1}, - {&__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS, __pyx_k_OUTPUT_ENCODING_UTF8_ENCODINGS, sizeof(__pyx_k_OUTPUT_ENCODING_UTF8_ENCODINGS), 0, 0, 1, 1}, - {&__pyx_n_s_REPLACEMENT_ENCODING, __pyx_k_REPLACEMENT_ENCODING, sizeof(__pyx_k_REPLACEMENT_ENCODING), 0, 0, 1, 1}, - {&__pyx_n_s_Tuple, __pyx_k_Tuple, sizeof(__pyx_k_Tuple), 0, 0, 1, 1}, - {&__pyx_n_s_UTF_16BE_ENCODING, __pyx_k_UTF_16BE_ENCODING, sizeof(__pyx_k_UTF_16BE_ENCODING), 0, 0, 1, 1}, - {&__pyx_n_s_UTF_16LE_ENCODING, __pyx_k_UTF_16LE_ENCODING, sizeof(__pyx_k_UTF_16LE_ENCODING), 0, 0, 1, 1}, - {&__pyx_n_s_UTF_8_ENCODER, __pyx_k_UTF_8_ENCODER, sizeof(__pyx_k_UTF_8_ENCODER), 0, 0, 1, 1}, - {&__pyx_n_s_UTF_8_ENCODING, __pyx_k_UTF_8_ENCODING, sizeof(__pyx_k_UTF_8_ENCODING), 0, 0, 1, 1}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, - {&__pyx_n_s__49, __pyx_k__49, sizeof(__pyx_k__49), 0, 0, 1, 1}, - {&__pyx_kp_u_ansi_x3_4_1968, __pyx_k_ansi_x3_4_1968, sizeof(__pyx_k_ansi_x3_4_1968), 0, 1, 0, 0}, - {&__pyx_n_u_arabic, __pyx_k_arabic, sizeof(__pyx_k_arabic), 0, 1, 0, 1}, - {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1}, - {&__pyx_kp_u_asmo_708, __pyx_k_asmo_708, sizeof(__pyx_k_asmo_708), 0, 1, 0, 0}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_n_u_big5, __pyx_k_big5, sizeof(__pyx_k_big5), 0, 1, 0, 1}, - {&__pyx_kp_u_big5_hkscs, __pyx_k_big5_hkscs, sizeof(__pyx_k_big5_hkscs), 0, 1, 0, 0}, - {&__pyx_n_u_chinese, __pyx_k_chinese, sizeof(__pyx_k_chinese), 0, 1, 0, 1}, - {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_kp_u_cn_big5, __pyx_k_cn_big5, sizeof(__pyx_k_cn_big5), 0, 1, 0, 0}, - {&__pyx_n_s_codec_info, __pyx_k_codec_info, sizeof(__pyx_k_codec_info), 0, 0, 1, 1}, - {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1}, - {&__pyx_n_u_cp125, __pyx_k_cp125, sizeof(__pyx_k_cp125), 0, 1, 0, 1}, - {&__pyx_n_u_cp1252, __pyx_k_cp1252, sizeof(__pyx_k_cp1252), 0, 1, 0, 1}, - {&__pyx_n_u_cp1254, __pyx_k_cp1254, sizeof(__pyx_k_cp1254), 0, 1, 0, 1}, - {&__pyx_n_u_cp819, __pyx_k_cp819, sizeof(__pyx_k_cp819), 0, 1, 0, 1}, - {&__pyx_n_u_cp866, __pyx_k_cp866, sizeof(__pyx_k_cp866), 0, 1, 0, 1}, - {&__pyx_n_u_cp874, __pyx_k_cp874, sizeof(__pyx_k_cp874), 0, 1, 0, 1}, - {&__pyx_n_u_csbig5, __pyx_k_csbig5, sizeof(__pyx_k_csbig5), 0, 1, 0, 1}, - {&__pyx_n_u_cseuckr, __pyx_k_cseuckr, sizeof(__pyx_k_cseuckr), 0, 1, 0, 1}, - {&__pyx_n_u_cseucpkdfmtjapanese, __pyx_k_cseucpkdfmtjapanese, sizeof(__pyx_k_cseucpkdfmtjapanese), 0, 1, 0, 1}, - {&__pyx_n_u_csgb2312, __pyx_k_csgb2312, sizeof(__pyx_k_csgb2312), 0, 1, 0, 1}, - {&__pyx_n_u_csibm866, __pyx_k_csibm866, sizeof(__pyx_k_csibm866), 0, 1, 0, 1}, - {&__pyx_n_u_csiso2022jp, __pyx_k_csiso2022jp, sizeof(__pyx_k_csiso2022jp), 0, 1, 0, 1}, - {&__pyx_n_u_csiso2022kr, __pyx_k_csiso2022kr, sizeof(__pyx_k_csiso2022kr), 0, 1, 0, 1}, - {&__pyx_n_u_csiso58gb231280, __pyx_k_csiso58gb231280, sizeof(__pyx_k_csiso58gb231280), 0, 1, 0, 1}, - {&__pyx_n_u_csiso88596e, __pyx_k_csiso88596e, sizeof(__pyx_k_csiso88596e), 0, 1, 0, 1}, - {&__pyx_n_u_csiso88596i, __pyx_k_csiso88596i, sizeof(__pyx_k_csiso88596i), 0, 1, 0, 1}, - {&__pyx_n_u_csiso88598e, __pyx_k_csiso88598e, sizeof(__pyx_k_csiso88598e), 0, 1, 0, 1}, - {&__pyx_n_u_csiso88598i, __pyx_k_csiso88598i, sizeof(__pyx_k_csiso88598i), 0, 1, 0, 1}, - {&__pyx_n_u_csisolatin1, __pyx_k_csisolatin1, sizeof(__pyx_k_csisolatin1), 0, 1, 0, 1}, - {&__pyx_n_u_csisolatin2, __pyx_k_csisolatin2, sizeof(__pyx_k_csisolatin2), 0, 1, 0, 1}, - {&__pyx_n_u_csisolatin3, __pyx_k_csisolatin3, sizeof(__pyx_k_csisolatin3), 0, 1, 0, 1}, - {&__pyx_n_u_csisolatin4, __pyx_k_csisolatin4, sizeof(__pyx_k_csisolatin4), 0, 1, 0, 1}, - {&__pyx_n_u_csisolatin5, __pyx_k_csisolatin5, sizeof(__pyx_k_csisolatin5), 0, 1, 0, 1}, - {&__pyx_n_u_csisolatin6, __pyx_k_csisolatin6, sizeof(__pyx_k_csisolatin6), 0, 1, 0, 1}, - {&__pyx_n_u_csisolatin9, __pyx_k_csisolatin9, sizeof(__pyx_k_csisolatin9), 0, 1, 0, 1}, - {&__pyx_n_u_csisolatinarabic, __pyx_k_csisolatinarabic, sizeof(__pyx_k_csisolatinarabic), 0, 1, 0, 1}, - {&__pyx_n_u_csisolatincyrillic, __pyx_k_csisolatincyrillic, sizeof(__pyx_k_csisolatincyrillic), 0, 1, 0, 1}, - {&__pyx_n_u_csisolatingreek, __pyx_k_csisolatingreek, sizeof(__pyx_k_csisolatingreek), 0, 1, 0, 1}, - {&__pyx_n_u_csisolatinhebrew, __pyx_k_csisolatinhebrew, sizeof(__pyx_k_csisolatinhebrew), 0, 1, 0, 1}, - {&__pyx_n_u_cskoi8r, __pyx_k_cskoi8r, sizeof(__pyx_k_cskoi8r), 0, 1, 0, 1}, - {&__pyx_n_u_csksc56011987, __pyx_k_csksc56011987, sizeof(__pyx_k_csksc56011987), 0, 1, 0, 1}, - {&__pyx_n_u_csmacintosh, __pyx_k_csmacintosh, sizeof(__pyx_k_csmacintosh), 0, 1, 0, 1}, - {&__pyx_n_u_csshiftjis, __pyx_k_csshiftjis, sizeof(__pyx_k_csshiftjis), 0, 1, 0, 1}, - {&__pyx_n_u_csunicode, __pyx_k_csunicode, sizeof(__pyx_k_csunicode), 0, 1, 0, 1}, - {&__pyx_n_u_cyrillic, __pyx_k_cyrillic, sizeof(__pyx_k_cyrillic), 0, 1, 0, 1}, - {&__pyx_kp_u_does_not_match_any_encoding_lab, __pyx_k_does_not_match_any_encoding_lab, sizeof(__pyx_k_does_not_match_any_encoding_lab), 0, 1, 0, 0}, - {&__pyx_kp_u_dos_874, __pyx_k_dos_874, sizeof(__pyx_k_dos_874), 0, 1, 0, 0}, - {&__pyx_kp_u_ecma_114, __pyx_k_ecma_114, sizeof(__pyx_k_ecma_114), 0, 1, 0, 0}, - {&__pyx_kp_u_ecma_118, __pyx_k_ecma_118, sizeof(__pyx_k_ecma_118), 0, 1, 0, 0}, - {&__pyx_n_u_elot_928, __pyx_k_elot_928, sizeof(__pyx_k_elot_928), 0, 1, 0, 1}, - {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, - {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, - {&__pyx_kp_u_euc_jp, __pyx_k_euc_jp, sizeof(__pyx_k_euc_jp), 0, 1, 0, 0}, - {&__pyx_kp_u_euc_kr, __pyx_k_euc_kr, sizeof(__pyx_k_euc_kr), 0, 1, 0, 0}, - {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, - {&__pyx_n_u_gb18030, __pyx_k_gb18030, sizeof(__pyx_k_gb18030), 0, 1, 0, 1}, - {&__pyx_n_u_gb2312, __pyx_k_gb2312, sizeof(__pyx_k_gb2312), 0, 1, 0, 1}, - {&__pyx_n_u_gb_2312, __pyx_k_gb_2312, sizeof(__pyx_k_gb_2312), 0, 1, 0, 1}, - {&__pyx_kp_u_gb_2312_80, __pyx_k_gb_2312_80, sizeof(__pyx_k_gb_2312_80), 0, 1, 0, 0}, - {&__pyx_n_u_gbk, __pyx_k_gbk, sizeof(__pyx_k_gbk), 0, 1, 0, 1}, - {&__pyx_n_s_get_encoder, __pyx_k_get_encoder, sizeof(__pyx_k_get_encoder), 0, 0, 1, 1}, - {&__pyx_n_s_get_encoding, __pyx_k_get_encoding, sizeof(__pyx_k_get_encoding), 0, 0, 1, 1}, - {&__pyx_n_s_get_output_encoding, __pyx_k_get_output_encoding, sizeof(__pyx_k_get_output_encoding), 0, 0, 1, 1}, - {&__pyx_n_u_greek, __pyx_k_greek, sizeof(__pyx_k_greek), 0, 1, 0, 1}, - {&__pyx_n_u_greek8, __pyx_k_greek8, sizeof(__pyx_k_greek8), 0, 1, 0, 1}, - {&__pyx_n_u_hebrew, __pyx_k_hebrew, sizeof(__pyx_k_hebrew), 0, 1, 0, 1}, - {&__pyx_kp_u_hz_gb_2312, __pyx_k_hz_gb_2312, sizeof(__pyx_k_hz_gb_2312), 0, 1, 0, 0}, - {&__pyx_n_u_ibm819, __pyx_k_ibm819, sizeof(__pyx_k_ibm819), 0, 1, 0, 1}, - {&__pyx_n_u_ibm866, __pyx_k_ibm866, sizeof(__pyx_k_ibm866), 0, 1, 0, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_infra, __pyx_k_infra, sizeof(__pyx_k_infra), 0, 0, 1, 1}, - {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, - {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_n_u_iso88591, __pyx_k_iso88591, sizeof(__pyx_k_iso88591), 0, 1, 0, 1}, - {&__pyx_n_u_iso885910, __pyx_k_iso885910, sizeof(__pyx_k_iso885910), 0, 1, 0, 1}, - {&__pyx_n_u_iso885911, __pyx_k_iso885911, sizeof(__pyx_k_iso885911), 0, 1, 0, 1}, - {&__pyx_n_u_iso885913, __pyx_k_iso885913, sizeof(__pyx_k_iso885913), 0, 1, 0, 1}, - {&__pyx_n_u_iso885914, __pyx_k_iso885914, sizeof(__pyx_k_iso885914), 0, 1, 0, 1}, - {&__pyx_n_u_iso885915, __pyx_k_iso885915, sizeof(__pyx_k_iso885915), 0, 1, 0, 1}, - {&__pyx_n_u_iso88592, __pyx_k_iso88592, sizeof(__pyx_k_iso88592), 0, 1, 0, 1}, - {&__pyx_n_u_iso88593, __pyx_k_iso88593, sizeof(__pyx_k_iso88593), 0, 1, 0, 1}, - {&__pyx_n_u_iso88594, __pyx_k_iso88594, sizeof(__pyx_k_iso88594), 0, 1, 0, 1}, - {&__pyx_n_u_iso88595, __pyx_k_iso88595, sizeof(__pyx_k_iso88595), 0, 1, 0, 1}, - {&__pyx_n_u_iso88596, __pyx_k_iso88596, sizeof(__pyx_k_iso88596), 0, 1, 0, 1}, - {&__pyx_n_u_iso88597, __pyx_k_iso88597, sizeof(__pyx_k_iso88597), 0, 1, 0, 1}, - {&__pyx_n_u_iso88598, __pyx_k_iso88598, sizeof(__pyx_k_iso88598), 0, 1, 0, 1}, - {&__pyx_n_u_iso88599, __pyx_k_iso88599, sizeof(__pyx_k_iso88599), 0, 1, 0, 1}, - {&__pyx_kp_u_iso8859_1, __pyx_k_iso8859_1, sizeof(__pyx_k_iso8859_1), 0, 1, 0, 0}, - {&__pyx_kp_u_iso8859_10, __pyx_k_iso8859_10, sizeof(__pyx_k_iso8859_10), 0, 1, 0, 0}, - {&__pyx_kp_u_iso8859_11, __pyx_k_iso8859_11, sizeof(__pyx_k_iso8859_11), 0, 1, 0, 0}, - {&__pyx_kp_u_iso8859_13, __pyx_k_iso8859_13, sizeof(__pyx_k_iso8859_13), 0, 1, 0, 0}, - {&__pyx_kp_u_iso8859_14, __pyx_k_iso8859_14, sizeof(__pyx_k_iso8859_14), 0, 1, 0, 0}, - {&__pyx_kp_u_iso8859_15, __pyx_k_iso8859_15, sizeof(__pyx_k_iso8859_15), 0, 1, 0, 0}, - {&__pyx_kp_u_iso8859_2, __pyx_k_iso8859_2, sizeof(__pyx_k_iso8859_2), 0, 1, 0, 0}, - {&__pyx_kp_u_iso8859_3, __pyx_k_iso8859_3, sizeof(__pyx_k_iso8859_3), 0, 1, 0, 0}, - {&__pyx_kp_u_iso8859_4, __pyx_k_iso8859_4, sizeof(__pyx_k_iso8859_4), 0, 1, 0, 0}, - {&__pyx_kp_u_iso8859_5, __pyx_k_iso8859_5, sizeof(__pyx_k_iso8859_5), 0, 1, 0, 0}, - {&__pyx_kp_u_iso8859_6, __pyx_k_iso8859_6, sizeof(__pyx_k_iso8859_6), 0, 1, 0, 0}, - {&__pyx_kp_u_iso8859_7, __pyx_k_iso8859_7, sizeof(__pyx_k_iso8859_7), 0, 1, 0, 0}, - {&__pyx_kp_u_iso8859_8, __pyx_k_iso8859_8, sizeof(__pyx_k_iso8859_8), 0, 1, 0, 0}, - {&__pyx_kp_u_iso8859_9, __pyx_k_iso8859_9, sizeof(__pyx_k_iso8859_9), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_10646_ucs_2, __pyx_k_iso_10646_ucs_2, sizeof(__pyx_k_iso_10646_ucs_2), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_2022_cn, __pyx_k_iso_2022_cn, sizeof(__pyx_k_iso_2022_cn), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_2022_cn_ext, __pyx_k_iso_2022_cn_ext, sizeof(__pyx_k_iso_2022_cn_ext), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_2022_jp, __pyx_k_iso_2022_jp, sizeof(__pyx_k_iso_2022_jp), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_2022_kr, __pyx_k_iso_2022_kr, sizeof(__pyx_k_iso_2022_kr), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_1, __pyx_k_iso_8859_1, sizeof(__pyx_k_iso_8859_1), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_10, __pyx_k_iso_8859_10, sizeof(__pyx_k_iso_8859_10), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_11, __pyx_k_iso_8859_11, sizeof(__pyx_k_iso_8859_11), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_13, __pyx_k_iso_8859_13, sizeof(__pyx_k_iso_8859_13), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_14, __pyx_k_iso_8859_14, sizeof(__pyx_k_iso_8859_14), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_15, __pyx_k_iso_8859_15, sizeof(__pyx_k_iso_8859_15), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_15_2, __pyx_k_iso_8859_15_2, sizeof(__pyx_k_iso_8859_15_2), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_16, __pyx_k_iso_8859_16, sizeof(__pyx_k_iso_8859_16), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_1_1987, __pyx_k_iso_8859_1_1987, sizeof(__pyx_k_iso_8859_1_1987), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_1_2, __pyx_k_iso_8859_1_2, sizeof(__pyx_k_iso_8859_1_2), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_2, __pyx_k_iso_8859_2, sizeof(__pyx_k_iso_8859_2), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_2_1987, __pyx_k_iso_8859_2_1987, sizeof(__pyx_k_iso_8859_2_1987), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_2_2, __pyx_k_iso_8859_2_2, sizeof(__pyx_k_iso_8859_2_2), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_3, __pyx_k_iso_8859_3, sizeof(__pyx_k_iso_8859_3), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_3_1988, __pyx_k_iso_8859_3_1988, sizeof(__pyx_k_iso_8859_3_1988), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_3_2, __pyx_k_iso_8859_3_2, sizeof(__pyx_k_iso_8859_3_2), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_4, __pyx_k_iso_8859_4, sizeof(__pyx_k_iso_8859_4), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_4_1988, __pyx_k_iso_8859_4_1988, sizeof(__pyx_k_iso_8859_4_1988), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_4_2, __pyx_k_iso_8859_4_2, sizeof(__pyx_k_iso_8859_4_2), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_5, __pyx_k_iso_8859_5, sizeof(__pyx_k_iso_8859_5), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_5_1988, __pyx_k_iso_8859_5_1988, sizeof(__pyx_k_iso_8859_5_1988), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_5_2, __pyx_k_iso_8859_5_2, sizeof(__pyx_k_iso_8859_5_2), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_6, __pyx_k_iso_8859_6, sizeof(__pyx_k_iso_8859_6), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_6_1987, __pyx_k_iso_8859_6_1987, sizeof(__pyx_k_iso_8859_6_1987), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_6_2, __pyx_k_iso_8859_6_2, sizeof(__pyx_k_iso_8859_6_2), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_6_e, __pyx_k_iso_8859_6_e, sizeof(__pyx_k_iso_8859_6_e), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_6_i, __pyx_k_iso_8859_6_i, sizeof(__pyx_k_iso_8859_6_i), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_7, __pyx_k_iso_8859_7, sizeof(__pyx_k_iso_8859_7), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_7_1987, __pyx_k_iso_8859_7_1987, sizeof(__pyx_k_iso_8859_7_1987), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_7_2, __pyx_k_iso_8859_7_2, sizeof(__pyx_k_iso_8859_7_2), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_8, __pyx_k_iso_8859_8, sizeof(__pyx_k_iso_8859_8), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_8_1988, __pyx_k_iso_8859_8_1988, sizeof(__pyx_k_iso_8859_8_1988), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_8_2, __pyx_k_iso_8859_8_2, sizeof(__pyx_k_iso_8859_8_2), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_8_e, __pyx_k_iso_8859_8_e, sizeof(__pyx_k_iso_8859_8_e), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_8_i, __pyx_k_iso_8859_8_i, sizeof(__pyx_k_iso_8859_8_i), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_9, __pyx_k_iso_8859_9, sizeof(__pyx_k_iso_8859_9), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_9_1989, __pyx_k_iso_8859_9_1989, sizeof(__pyx_k_iso_8859_9_1989), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_8859_9_2, __pyx_k_iso_8859_9_2, sizeof(__pyx_k_iso_8859_9_2), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_ir_100, __pyx_k_iso_ir_100, sizeof(__pyx_k_iso_ir_100), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_ir_101, __pyx_k_iso_ir_101, sizeof(__pyx_k_iso_ir_101), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_ir_109, __pyx_k_iso_ir_109, sizeof(__pyx_k_iso_ir_109), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_ir_110, __pyx_k_iso_ir_110, sizeof(__pyx_k_iso_ir_110), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_ir_126, __pyx_k_iso_ir_126, sizeof(__pyx_k_iso_ir_126), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_ir_127, __pyx_k_iso_ir_127, sizeof(__pyx_k_iso_ir_127), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_ir_138, __pyx_k_iso_ir_138, sizeof(__pyx_k_iso_ir_138), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_ir_144, __pyx_k_iso_ir_144, sizeof(__pyx_k_iso_ir_144), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_ir_148, __pyx_k_iso_ir_148, sizeof(__pyx_k_iso_ir_148), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_ir_149, __pyx_k_iso_ir_149, sizeof(__pyx_k_iso_ir_149), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_ir_157, __pyx_k_iso_ir_157, sizeof(__pyx_k_iso_ir_157), 0, 1, 0, 0}, - {&__pyx_kp_u_iso_ir_58, __pyx_k_iso_ir_58, sizeof(__pyx_k_iso_ir_58), 0, 1, 0, 0}, - {&__pyx_n_u_koi, __pyx_k_koi, sizeof(__pyx_k_koi), 0, 1, 0, 1}, - {&__pyx_n_u_koi8, __pyx_k_koi8, sizeof(__pyx_k_koi8), 0, 1, 0, 1}, - {&__pyx_kp_u_koi8_r, __pyx_k_koi8_r, sizeof(__pyx_k_koi8_r), 0, 1, 0, 0}, - {&__pyx_n_u_koi8_r_2, __pyx_k_koi8_r_2, sizeof(__pyx_k_koi8_r_2), 0, 1, 0, 1}, - {&__pyx_kp_u_koi8_ru, __pyx_k_koi8_ru, sizeof(__pyx_k_koi8_ru), 0, 1, 0, 0}, - {&__pyx_kp_u_koi8_u, __pyx_k_koi8_u, sizeof(__pyx_k_koi8_u), 0, 1, 0, 0}, - {&__pyx_n_u_korean, __pyx_k_korean, sizeof(__pyx_k_korean), 0, 1, 0, 1}, - {&__pyx_kp_u_ks_c_5601_1987, __pyx_k_ks_c_5601_1987, sizeof(__pyx_k_ks_c_5601_1987), 0, 1, 0, 0}, - {&__pyx_kp_u_ks_c_5601_1989, __pyx_k_ks_c_5601_1989, sizeof(__pyx_k_ks_c_5601_1989), 0, 1, 0, 0}, - {&__pyx_n_u_ksc5601, __pyx_k_ksc5601, sizeof(__pyx_k_ksc5601), 0, 1, 0, 1}, - {&__pyx_n_u_ksc_5601, __pyx_k_ksc_5601, sizeof(__pyx_k_ksc_5601), 0, 1, 0, 1}, - {&__pyx_n_u_l1, __pyx_k_l1, sizeof(__pyx_k_l1), 0, 1, 0, 1}, - {&__pyx_n_u_l2, __pyx_k_l2, sizeof(__pyx_k_l2), 0, 1, 0, 1}, - {&__pyx_n_u_l3, __pyx_k_l3, sizeof(__pyx_k_l3), 0, 1, 0, 1}, - {&__pyx_n_u_l4, __pyx_k_l4, sizeof(__pyx_k_l4), 0, 1, 0, 1}, - {&__pyx_n_u_l5, __pyx_k_l5, sizeof(__pyx_k_l5), 0, 1, 0, 1}, - {&__pyx_n_u_l6, __pyx_k_l6, sizeof(__pyx_k_l6), 0, 1, 0, 1}, - {&__pyx_n_u_l9, __pyx_k_l9, sizeof(__pyx_k_l9), 0, 1, 0, 1}, - {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1}, - {&__pyx_n_s_last_digit, __pyx_k_last_digit, sizeof(__pyx_k_last_digit), 0, 0, 1, 1}, - {&__pyx_n_u_latin1, __pyx_k_latin1, sizeof(__pyx_k_latin1), 0, 1, 0, 1}, - {&__pyx_n_u_latin2, __pyx_k_latin2, sizeof(__pyx_k_latin2), 0, 1, 0, 1}, - {&__pyx_n_u_latin3, __pyx_k_latin3, sizeof(__pyx_k_latin3), 0, 1, 0, 1}, - {&__pyx_n_u_latin4, __pyx_k_latin4, sizeof(__pyx_k_latin4), 0, 1, 0, 1}, - {&__pyx_n_u_latin5, __pyx_k_latin5, sizeof(__pyx_k_latin5), 0, 1, 0, 1}, - {&__pyx_n_u_latin6, __pyx_k_latin6, sizeof(__pyx_k_latin6), 0, 1, 0, 1}, - {&__pyx_n_u_logical, __pyx_k_logical, sizeof(__pyx_k_logical), 0, 1, 0, 1}, - {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1}, - {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, - {&__pyx_n_s_lru_cache, __pyx_k_lru_cache, sizeof(__pyx_k_lru_cache), 0, 0, 1, 1}, - {&__pyx_n_u_mac, __pyx_k_mac, sizeof(__pyx_k_mac), 0, 1, 0, 1}, - {&__pyx_kp_u_mac_cyrillic, __pyx_k_mac_cyrillic, sizeof(__pyx_k_mac_cyrillic), 0, 1, 0, 0}, - {&__pyx_n_u_macintosh, __pyx_k_macintosh, sizeof(__pyx_k_macintosh), 0, 1, 0, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1}, - {&__pyx_n_u_ms932, __pyx_k_ms932, sizeof(__pyx_k_ms932), 0, 1, 0, 1}, - {&__pyx_n_u_ms_kanji, __pyx_k_ms_kanji, sizeof(__pyx_k_ms_kanji), 0, 1, 0, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_u_replacement, __pyx_k_replacement, sizeof(__pyx_k_replacement), 0, 1, 0, 1}, - {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, - {&__pyx_kp_u_shift_jis, __pyx_k_shift_jis, sizeof(__pyx_k_shift_jis), 0, 1, 0, 0}, - {&__pyx_n_u_shift_jis_2, __pyx_k_shift_jis_2, sizeof(__pyx_k_shift_jis_2), 0, 1, 0, 1}, - {&__pyx_n_s_short_windows_125, __pyx_k_short_windows_125, sizeof(__pyx_k_short_windows_125), 0, 0, 1, 1}, - {&__pyx_n_u_sjis, __pyx_k_sjis, sizeof(__pyx_k_sjis), 0, 1, 0, 1}, - {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, - {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, - {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, - {&__pyx_n_u_sun_eu_greek, __pyx_k_sun_eu_greek, sizeof(__pyx_k_sun_eu_greek), 0, 1, 0, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_kp_u_tis_620, __pyx_k_tis_620, sizeof(__pyx_k_tis_620), 0, 1, 0, 0}, - {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, - {&__pyx_kp_u_ucs_2, __pyx_k_ucs_2, sizeof(__pyx_k_ucs_2), 0, 1, 0, 0}, - {&__pyx_n_u_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 1, 0, 1}, - {&__pyx_n_u_unicode11utf8, __pyx_k_unicode11utf8, sizeof(__pyx_k_unicode11utf8), 0, 1, 0, 1}, - {&__pyx_n_u_unicode20utf8, __pyx_k_unicode20utf8, sizeof(__pyx_k_unicode20utf8), 0, 1, 0, 1}, - {&__pyx_kp_u_unicode_1_1_utf_8, __pyx_k_unicode_1_1_utf_8, sizeof(__pyx_k_unicode_1_1_utf_8), 0, 1, 0, 0}, - {&__pyx_n_u_unicodefeff, __pyx_k_unicodefeff, sizeof(__pyx_k_unicodefeff), 0, 1, 0, 1}, - {&__pyx_n_u_unicodefffe, __pyx_k_unicodefffe, sizeof(__pyx_k_unicodefffe), 0, 1, 0, 1}, - {&__pyx_kp_u_us_ascii, __pyx_k_us_ascii, sizeof(__pyx_k_us_ascii), 0, 1, 0, 0}, - {&__pyx_n_u_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 1, 0, 1}, - {&__pyx_kp_u_utf_16, __pyx_k_utf_16, sizeof(__pyx_k_utf_16), 0, 1, 0, 0}, - {&__pyx_kp_u_utf_16be, __pyx_k_utf_16be, sizeof(__pyx_k_utf_16be), 0, 1, 0, 0}, - {&__pyx_kp_u_utf_16le, __pyx_k_utf_16le, sizeof(__pyx_k_utf_16le), 0, 1, 0, 0}, - {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, - {&__pyx_n_u_visual, __pyx_k_visual, sizeof(__pyx_k_visual), 0, 1, 0, 1}, - {&__pyx_n_s_w3lib__encoding, __pyx_k_w3lib__encoding, sizeof(__pyx_k_w3lib__encoding), 0, 0, 1, 1}, - {&__pyx_kp_s_w3lib__encoding_pyx, __pyx_k_w3lib__encoding_pyx, sizeof(__pyx_k_w3lib__encoding_pyx), 0, 0, 1, 0}, - {&__pyx_kp_u_windows_125, __pyx_k_windows_125, sizeof(__pyx_k_windows_125), 0, 1, 0, 0}, - {&__pyx_kp_u_windows_1252, __pyx_k_windows_1252, sizeof(__pyx_k_windows_1252), 0, 1, 0, 0}, - {&__pyx_kp_u_windows_1254, __pyx_k_windows_1254, sizeof(__pyx_k_windows_1254), 0, 1, 0, 0}, - {&__pyx_kp_u_windows_31j, __pyx_k_windows_31j, sizeof(__pyx_k_windows_31j), 0, 1, 0, 0}, - {&__pyx_kp_u_windows_874, __pyx_k_windows_874, sizeof(__pyx_k_windows_874), 0, 1, 0, 0}, - {&__pyx_kp_u_windows_949, __pyx_k_windows_949, sizeof(__pyx_k_windows_949), 0, 1, 0, 0}, - {&__pyx_kp_u_x_cp125, __pyx_k_x_cp125, sizeof(__pyx_k_x_cp125), 0, 1, 0, 0}, - {&__pyx_kp_u_x_cp1252, __pyx_k_x_cp1252, sizeof(__pyx_k_x_cp1252), 0, 1, 0, 0}, - {&__pyx_kp_u_x_cp1254, __pyx_k_x_cp1254, sizeof(__pyx_k_x_cp1254), 0, 1, 0, 0}, - {&__pyx_kp_u_x_euc_jp, __pyx_k_x_euc_jp, sizeof(__pyx_k_x_euc_jp), 0, 1, 0, 0}, - {&__pyx_kp_u_x_gbk, __pyx_k_x_gbk, sizeof(__pyx_k_x_gbk), 0, 1, 0, 0}, - {&__pyx_kp_u_x_mac_cyrillic, __pyx_k_x_mac_cyrillic, sizeof(__pyx_k_x_mac_cyrillic), 0, 1, 0, 0}, - {&__pyx_kp_u_x_mac_roman, __pyx_k_x_mac_roman, sizeof(__pyx_k_x_mac_roman), 0, 1, 0, 0}, - {&__pyx_kp_u_x_mac_ukrainian, __pyx_k_x_mac_ukrainian, sizeof(__pyx_k_x_mac_ukrainian), 0, 1, 0, 0}, - {&__pyx_kp_u_x_sjis, __pyx_k_x_sjis, sizeof(__pyx_k_x_sjis), 0, 1, 0, 0}, - {&__pyx_kp_u_x_unicode20utf8, __pyx_k_x_unicode20utf8, sizeof(__pyx_k_x_unicode20utf8), 0, 1, 0, 0}, - {&__pyx_kp_u_x_user_defined, __pyx_k_x_user_defined, sizeof(__pyx_k_x_user_defined), 0, 1, 0, 0}, - {&__pyx_kp_u_x_x_big5, __pyx_k_x_x_big5, sizeof(__pyx_k_x_x_big5), 0, 1, 0, 0}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 431, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 432, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "w3lib/_encoding.pyx":15 - * - * - * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< - * return { - * label: f"windows-125{last_digit}" - */ - __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_last_digit, __pyx_n_s_label); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__encoding_pyx, __pyx_n_s_short_windows_125, 15, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 15, __pyx_L1_error) - - /* "w3lib/_encoding.pyx":39 - * label: _UTF_8_ENCODING - * for label in ( - * "unicode-1-1-utf-8", # <<<<<<<<<<<<<< - * "unicode11utf8", - * "unicode20utf8", - */ - __pyx_tuple__5 = PyTuple_Pack(6, __pyx_kp_u_unicode_1_1_utf_8, __pyx_n_u_unicode11utf8, __pyx_n_u_unicode20utf8, __pyx_kp_u_utf_8, __pyx_n_u_utf8, __pyx_kp_u_x_unicode20utf8); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - - /* "w3lib/_encoding.pyx":50 - * label: "ibm866" - * for label in ( - * "866", # <<<<<<<<<<<<<< - * "cp866", - * "csibm866", - */ - __pyx_tuple__6 = PyTuple_Pack(4, __pyx_kp_u_866, __pyx_n_u_cp866, __pyx_n_u_csibm866, __pyx_n_u_ibm866); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 50, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - - /* "w3lib/_encoding.pyx":59 - * label: "iso-8859-2" - * for label in ( - * "csisolatin2", # <<<<<<<<<<<<<< - * "iso-8859-2", - * "iso-ir-101", - */ - __pyx_tuple__7 = PyTuple_Pack(9, __pyx_n_u_csisolatin2, __pyx_kp_u_iso_8859_2, __pyx_kp_u_iso_ir_101, __pyx_kp_u_iso8859_2, __pyx_n_u_iso88592, __pyx_kp_u_iso_8859_2_2, __pyx_kp_u_iso_8859_2_1987, __pyx_n_u_l2, __pyx_n_u_latin2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - - /* "w3lib/_encoding.pyx":73 - * label: "iso-8859-3" - * for label in ( - * "csisolatin3", # <<<<<<<<<<<<<< - * "iso-8859-3", - * "iso-ir-109", - */ - __pyx_tuple__8 = PyTuple_Pack(9, __pyx_n_u_csisolatin3, __pyx_kp_u_iso_8859_3, __pyx_kp_u_iso_ir_109, __pyx_kp_u_iso8859_3, __pyx_n_u_iso88593, __pyx_kp_u_iso_8859_3_2, __pyx_kp_u_iso_8859_3_1988, __pyx_n_u_l3, __pyx_n_u_latin3); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - - /* "w3lib/_encoding.pyx":87 - * label: "iso-8859-4" - * for label in ( - * "csisolatin4", # <<<<<<<<<<<<<< - * "iso-8859-4", - * "iso-ir-110", - */ - __pyx_tuple__9 = PyTuple_Pack(9, __pyx_n_u_csisolatin4, __pyx_kp_u_iso_8859_4, __pyx_kp_u_iso_ir_110, __pyx_kp_u_iso8859_4, __pyx_n_u_iso88594, __pyx_kp_u_iso_8859_4_2, __pyx_kp_u_iso_8859_4_1988, __pyx_n_u_l4, __pyx_n_u_latin4); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - - /* "w3lib/_encoding.pyx":101 - * label: "iso-8859-5" - * for label in ( - * "csisolatincyrillic", # <<<<<<<<<<<<<< - * "cyrillic", - * "iso-8859-5", - */ - __pyx_tuple__10 = PyTuple_Pack(8, __pyx_n_u_csisolatincyrillic, __pyx_n_u_cyrillic, __pyx_kp_u_iso_8859_5, __pyx_kp_u_iso_ir_144, __pyx_kp_u_iso8859_5, __pyx_n_u_iso88595, __pyx_kp_u_iso_8859_5_2, __pyx_kp_u_iso_8859_5_1988); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - - /* "w3lib/_encoding.pyx":114 - * label: "iso-8859-6" - * for label in ( - * "arabic", # <<<<<<<<<<<<<< - * "asmo-708", - * "csiso88596e", - */ - __pyx_tuple__11 = PyTuple_Pack(14, __pyx_n_u_arabic, __pyx_kp_u_asmo_708, __pyx_n_u_csiso88596e, __pyx_n_u_csiso88596i, __pyx_n_u_csisolatinarabic, __pyx_kp_u_ecma_114, __pyx_kp_u_iso_8859_6, __pyx_kp_u_iso_8859_6_e, __pyx_kp_u_iso_8859_6_i, __pyx_kp_u_iso_ir_127, __pyx_kp_u_iso8859_6, __pyx_n_u_iso88596, __pyx_kp_u_iso_8859_6_2, __pyx_kp_u_iso_8859_6_1987); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - - /* "w3lib/_encoding.pyx":133 - * label: "iso-8859-7" - * for label in ( - * "csisolatingreek", # <<<<<<<<<<<<<< - * "ecma-118", - * "elot_928", - */ - __pyx_tuple__12 = PyTuple_Pack(12, __pyx_n_u_csisolatingreek, __pyx_kp_u_ecma_118, __pyx_n_u_elot_928, __pyx_n_u_greek, __pyx_n_u_greek8, __pyx_kp_u_iso_8859_7, __pyx_kp_u_iso_ir_126, __pyx_kp_u_iso8859_7, __pyx_n_u_iso88597, __pyx_kp_u_iso_8859_7_2, __pyx_kp_u_iso_8859_7_1987, __pyx_n_u_sun_eu_greek); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - - /* "w3lib/_encoding.pyx":150 - * label: "iso-8859-8" - * for label in ( - * "csiso88598e", # <<<<<<<<<<<<<< - * "csisolatinhebrew", - * "hebrew", - */ - __pyx_tuple__13 = PyTuple_Pack(11, __pyx_n_u_csiso88598e, __pyx_n_u_csisolatinhebrew, __pyx_n_u_hebrew, __pyx_kp_u_iso_8859_8, __pyx_kp_u_iso_8859_8_e, __pyx_kp_u_iso_ir_138, __pyx_kp_u_iso8859_8, __pyx_n_u_iso88598, __pyx_kp_u_iso_8859_8_2, __pyx_kp_u_iso_8859_8_1988, __pyx_n_u_visual); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); - - /* "w3lib/_encoding.pyx":166 - * label: "iso-8859-8-i" - * for label in ( - * "csiso88598i", # <<<<<<<<<<<<<< - * "iso-8859-8-i", - * "logical", - */ - __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_u_csiso88598i, __pyx_kp_u_iso_8859_8_i, __pyx_n_u_logical); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - - /* "w3lib/_encoding.pyx":174 - * label: "iso-8859-10" - * for label in ( - * "csisolatin6", # <<<<<<<<<<<<<< - * "iso-8859-10", - * "iso-ir-157", - */ - __pyx_tuple__15 = PyTuple_Pack(7, __pyx_n_u_csisolatin6, __pyx_kp_u_iso_8859_10, __pyx_kp_u_iso_ir_157, __pyx_kp_u_iso8859_10, __pyx_n_u_iso885910, __pyx_n_u_l6, __pyx_n_u_latin6); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - - /* "w3lib/_encoding.pyx":198 - * label: "iso-8859-13" - * for label in ( - * "iso-8859-13", # <<<<<<<<<<<<<< - * "iso8859-13", - * "iso885913", - */ - __pyx_tuple__16 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_13, __pyx_kp_u_iso8859_13, __pyx_n_u_iso885913); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - - /* "w3lib/_encoding.pyx":206 - * label: "iso-8859-14" - * for label in ( - * "iso-8859-14", # <<<<<<<<<<<<<< - * "iso8859-14", - * "iso885914", - */ - __pyx_tuple__17 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_14, __pyx_kp_u_iso8859_14, __pyx_n_u_iso885914); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - - /* "w3lib/_encoding.pyx":214 - * label: "iso-8859-15" - * for label in ( - * "csisolatin9", # <<<<<<<<<<<<<< - * "iso-8859-15", - * "iso8859-15", - */ - __pyx_tuple__18 = PyTuple_Pack(6, __pyx_n_u_csisolatin9, __pyx_kp_u_iso_8859_15, __pyx_kp_u_iso8859_15, __pyx_n_u_iso885915, __pyx_kp_u_iso_8859_15_2, __pyx_n_u_l9); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - - /* "w3lib/_encoding.pyx":226 - * label: "koi8-r" - * for label in ( - * "cskoi8r", # <<<<<<<<<<<<<< - * "koi", - * "koi8", - */ - __pyx_tuple__19 = PyTuple_Pack(5, __pyx_n_u_cskoi8r, __pyx_n_u_koi, __pyx_n_u_koi8, __pyx_kp_u_koi8_r, __pyx_n_u_koi8_r_2); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); - - /* "w3lib/_encoding.pyx":236 - * label: "koi8-u" - * for label in ( - * "koi8-ru", # <<<<<<<<<<<<<< - * "koi8-u", - * ) - */ - __pyx_tuple__20 = PyTuple_Pack(2, __pyx_kp_u_koi8_ru, __pyx_kp_u_koi8_u); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - - /* "w3lib/_encoding.pyx":243 - * label: "macintosh" - * for label in ( - * "csmacintosh", # <<<<<<<<<<<<<< - * "mac", - * "macintosh", - */ - __pyx_tuple__21 = PyTuple_Pack(4, __pyx_n_u_csmacintosh, __pyx_n_u_mac, __pyx_n_u_macintosh, __pyx_kp_u_x_mac_roman); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); - - /* "w3lib/_encoding.pyx":252 - * label: "cp874" - * for label in ( - * "dos-874", # <<<<<<<<<<<<<< - * "iso-8859-11", - * "iso8859-11", - */ - __pyx_tuple__22 = PyTuple_Pack(6, __pyx_kp_u_dos_874, __pyx_kp_u_iso_8859_11, __pyx_kp_u_iso8859_11, __pyx_n_u_iso885911, __pyx_kp_u_tis_620, __pyx_kp_u_windows_874); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - - /* "w3lib/_encoding.pyx":260 - * ) - * }, - * **_short_windows_125(0), # <<<<<<<<<<<<<< - * **_short_windows_125(1), - * **{ - */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - - /* "w3lib/_encoding.pyx":261 - * }, - * **_short_windows_125(0), - * **_short_windows_125(1), # <<<<<<<<<<<<<< - * **{ - * label: "windows-1252" - */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 261, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - - /* "w3lib/_encoding.pyx":265 - * label: "windows-1252" - * for label in ( - * "ansi_x3.4-1968", # <<<<<<<<<<<<<< - * "ascii", - * "cp1252", - */ - __pyx_tuple__25 = PyTuple_Pack(17, __pyx_kp_u_ansi_x3_4_1968, __pyx_n_u_ascii, __pyx_n_u_cp1252, __pyx_n_u_cp819, __pyx_n_u_csisolatin1, __pyx_n_u_ibm819, __pyx_kp_u_iso_8859_1, __pyx_kp_u_iso_ir_100, __pyx_kp_u_iso8859_1, __pyx_n_u_iso88591, __pyx_kp_u_iso_8859_1_2, __pyx_kp_u_iso_8859_1_1987, __pyx_n_u_l1, __pyx_n_u_latin1, __pyx_kp_u_us_ascii, __pyx_kp_u_windows_1252, __pyx_kp_u_x_cp1252); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - - /* "w3lib/_encoding.pyx":284 - * ) - * }, - * **_short_windows_125(3), # <<<<<<<<<<<<<< - * **{ - * label: "windows-1254" - */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - - /* "w3lib/_encoding.pyx":288 - * label: "windows-1254" - * for label in ( - * "cp1254", # <<<<<<<<<<<<<< - * "csisolatin5", - * "iso-8859-9", - */ - __pyx_tuple__27 = PyTuple_Pack(12, __pyx_n_u_cp1254, __pyx_n_u_csisolatin5, __pyx_kp_u_iso_8859_9, __pyx_kp_u_iso_ir_148, __pyx_kp_u_iso8859_9, __pyx_n_u_iso88599, __pyx_kp_u_iso_8859_9_2, __pyx_kp_u_iso_8859_9_1989, __pyx_n_u_l5, __pyx_n_u_latin5, __pyx_kp_u_windows_1254, __pyx_kp_u_x_cp1254); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - - /* "w3lib/_encoding.pyx":302 - * ) - * }, - * **_short_windows_125(5), # <<<<<<<<<<<<<< - * **_short_windows_125(6), - * **_short_windows_125(7), - */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - - /* "w3lib/_encoding.pyx":303 - * }, - * **_short_windows_125(5), - * **_short_windows_125(6), # <<<<<<<<<<<<<< - * **_short_windows_125(7), - * **_short_windows_125(8), - */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_int_6); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - - /* "w3lib/_encoding.pyx":304 - * **_short_windows_125(5), - * **_short_windows_125(6), - * **_short_windows_125(7), # <<<<<<<<<<<<<< - * **_short_windows_125(8), - * **{ - */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_int_7); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 304, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); - - /* "w3lib/_encoding.pyx":305 - * **_short_windows_125(6), - * **_short_windows_125(7), - * **_short_windows_125(8), # <<<<<<<<<<<<<< - * **{ - * label: "mac-cyrillic" - */ - __pyx_tuple__31 = PyTuple_Pack(1, __pyx_int_8); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - - /* "w3lib/_encoding.pyx":309 - * label: "mac-cyrillic" - * for label in ( - * "x-mac-cyrillic", # <<<<<<<<<<<<<< - * "x-mac-ukrainian", - * ) - */ - __pyx_tuple__32 = PyTuple_Pack(2, __pyx_kp_u_x_mac_cyrillic, __pyx_kp_u_x_mac_ukrainian); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 309, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); - - /* "w3lib/_encoding.pyx":316 - * label: "gbk" - * for label in ( - * "chinese", # <<<<<<<<<<<<<< - * "csgb2312", - * "csiso58gb231280", - */ - __pyx_tuple__33 = PyTuple_Pack(9, __pyx_n_u_chinese, __pyx_n_u_csgb2312, __pyx_n_u_csiso58gb231280, __pyx_n_u_gb2312, __pyx_n_u_gb_2312, __pyx_kp_u_gb_2312_80, __pyx_n_u_gbk, __pyx_kp_u_iso_ir_58, __pyx_kp_u_x_gbk); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); - - /* "w3lib/_encoding.pyx":331 - * label: "big5" - * for label in ( - * "big5", # <<<<<<<<<<<<<< - * "big5-hkscs", - * "cn-big5", - */ - __pyx_tuple__34 = PyTuple_Pack(5, __pyx_n_u_big5, __pyx_kp_u_big5_hkscs, __pyx_kp_u_cn_big5, __pyx_n_u_csbig5, __pyx_kp_u_x_x_big5); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); - - /* "w3lib/_encoding.pyx":341 - * label: "euc-jp" - * for label in ( - * "cseucpkdfmtjapanese", # <<<<<<<<<<<<<< - * "euc-jp", - * "x-euc-jp", - */ - __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_u_cseucpkdfmtjapanese, __pyx_kp_u_euc_jp, __pyx_kp_u_x_euc_jp); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); - - /* "w3lib/_encoding.pyx":349 - * label: "iso-2022-jp" - * for label in ( - * "csiso2022jp", # <<<<<<<<<<<<<< - * "iso-2022-jp", - * ) - */ - __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_u_csiso2022jp, __pyx_kp_u_iso_2022_jp); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); - - /* "w3lib/_encoding.pyx":356 - * label: "shift_jis" - * for label in ( - * "csshiftjis", # <<<<<<<<<<<<<< - * "ms932", - * "ms_kanji", - */ - __pyx_tuple__37 = PyTuple_Pack(8, __pyx_n_u_csshiftjis, __pyx_n_u_ms932, __pyx_n_u_ms_kanji, __pyx_kp_u_shift_jis, __pyx_n_u_shift_jis_2, __pyx_n_u_sjis, __pyx_kp_u_windows_31j, __pyx_kp_u_x_sjis); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); - - /* "w3lib/_encoding.pyx":369 - * label: "euc-kr" - * for label in ( - * "cseuckr", # <<<<<<<<<<<<<< - * "csksc56011987", - * "euc-kr", - */ - __pyx_tuple__38 = PyTuple_Pack(10, __pyx_n_u_cseuckr, __pyx_n_u_csksc56011987, __pyx_kp_u_euc_kr, __pyx_kp_u_iso_ir_149, __pyx_n_u_korean, __pyx_kp_u_ks_c_5601_1987, __pyx_kp_u_ks_c_5601_1989, __pyx_n_u_ksc5601, __pyx_n_u_ksc_5601, __pyx_kp_u_windows_949); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); - - /* "w3lib/_encoding.pyx":384 - * label: _REPLACEMENT_ENCODING - * for label in ( - * "csiso2022kr", # <<<<<<<<<<<<<< - * "hz-gb-2312", - * "iso-2022-cn", - */ - __pyx_tuple__39 = PyTuple_Pack(6, __pyx_n_u_csiso2022kr, __pyx_kp_u_hz_gb_2312, __pyx_kp_u_iso_2022_cn, __pyx_kp_u_iso_2022_cn_ext, __pyx_kp_u_iso_2022_kr, __pyx_n_u_replacement); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - - /* "w3lib/_encoding.pyx":395 - * label: _UTF_16BE_ENCODING - * for label in ( - * "unicodefffe", # <<<<<<<<<<<<<< - * "utf-16be", - * ) - */ - __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_u_unicodefffe, __pyx_kp_u_utf_16be); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); - - /* "w3lib/_encoding.pyx":402 - * label: _UTF_16LE_ENCODING - * for label in ( - * "csunicode", # <<<<<<<<<<<<<< - * "iso-10646-ucs-2", - * "ucs-2", - */ - __pyx_tuple__41 = PyTuple_Pack(7, __pyx_n_u_csunicode, __pyx_kp_u_iso_10646_ucs_2, __pyx_kp_u_ucs_2, __pyx_n_u_unicode, __pyx_n_u_unicodefeff, __pyx_kp_u_utf_16, __pyx_kp_u_utf_16le); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 402, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - - /* "w3lib/_encoding.pyx":416 - * - * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder - * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< - * def _get_encoder(encoding: str) -> EncodeFunction: - * codec_info = codecs.lookup(encoding) - */ - __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_encoding, __pyx_n_s_codec_info); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); - __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__encoding_pyx, __pyx_n_s_get_encoder, 416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 416, __pyx_L1_error) - - /* "w3lib/_encoding.pyx":422 - * - * - * _UTF_8_ENCODER = _get_encoder("utf-8") # <<<<<<<<<<<<<< - * - * - */ - __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); - - /* "w3lib/_encoding.pyx":426 - * - * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get - * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< - * def _get_encoding(label: str) -> str: - * label = label.strip(_ASCII_WHITESPACE).lower() - */ - __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_label, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 426, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); - __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__encoding_pyx, __pyx_n_s_get_encoding, 426, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 426, __pyx_L1_error) - - /* "w3lib/_encoding.pyx":448 - * - * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings - * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< - * def _get_output_encoding(encoding: str) -> str: - * encoding = _get_encoding(encoding) - */ - __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); - __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__encoding_pyx, __pyx_n_s_get_output_encoding, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - __pyx_umethod_PyUnicode_Type_strip.type = (PyObject*)&PyUnicode_Type; - __pyx_umethod_PyUnicode_Type_strip.method_name = &__pyx_n_s_strip; - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - return 0; -} -/* #### Code section: init_module ### */ - -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); - /*--- Global init code ---*/ - __pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label = Py_None; Py_INCREF(Py_None); - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); - /*--- Variable export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); - /*--- Function export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); - /*--- Type init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); - /*--- Type import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); - /*--- Variable import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); - /*--- Function import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - - -#if PY_MAJOR_VERSION >= 3 -#if CYTHON_PEP489_MULTI_PHASE_INIT -static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ -static int __pyx_pymod_exec__encoding(PyObject* module); /*proto*/ -static PyModuleDef_Slot __pyx_moduledef_slots[] = { - {Py_mod_create, (void*)__pyx_pymod_create}, - {Py_mod_exec, (void*)__pyx_pymod_exec__encoding}, - {0, NULL} -}; -#endif - -#ifdef __cplusplus -namespace { - struct PyModuleDef __pyx_moduledef = - #else - static struct PyModuleDef __pyx_moduledef = - #endif - { - PyModuleDef_HEAD_INIT, - "_encoding", - 0, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ - #else - -1, /* m_size */ - #endif - __pyx_methods /* m_methods */, - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_moduledef_slots, /* m_slots */ - #else - NULL, /* m_reload */ - #endif - #if CYTHON_USE_MODULE_STATE - __pyx_m_traverse, /* m_traverse */ - __pyx_m_clear, /* m_clear */ - NULL /* m_free */ - #else - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ - #endif - }; - #ifdef __cplusplus -} /* anonymous namespace */ -#endif -#endif - -#ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * -#else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif -#endif - - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC init_encoding(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC init_encoding(void) -#else -__Pyx_PyMODINIT_FUNC PyInit__encoding(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC PyInit__encoding(void) -#if CYTHON_PEP489_MULTI_PHASE_INIT -{ - return PyModuleDef_Init(&__pyx_moduledef); -} -static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 - static PY_INT64_T main_interpreter_id = -1; - PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); - if (main_interpreter_id == -1) { - main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { - PyErr_SetString( - PyExc_ImportError, - "Interpreter change detected - this module can only be loaded into one interpreter per process."); - return -1; - } - return 0; -} -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) -#endif -{ - PyObject *value = PyObject_GetAttrString(spec, from_name); - int result = 0; - if (likely(value)) { - if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else - result = PyDict_SetItemString(moddict, to_name, value); -#endif - } - Py_DECREF(value); - } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - } else { - result = -1; - } - return result; -} -static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { - PyObject *module = NULL, *moddict, *modname; - CYTHON_UNUSED_VAR(def); - if (__Pyx_check_single_interpreter()) - return NULL; - if (__pyx_m) - return __Pyx_NewRef(__pyx_m); - modname = PyObject_GetAttrString(spec, "name"); - if (unlikely(!modname)) goto bad; - module = PyModule_NewObject(modname); - Py_DECREF(modname); - if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else - moddict = PyModule_GetDict(module); - if (unlikely(!moddict)) goto bad; -#endif - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; - return module; -bad: - Py_XDECREF(module); - return NULL; -} - - -static CYTHON_SMALL_CODE int __pyx_pymod_exec__encoding(PyObject *__pyx_pyinit_module) -#endif -#endif -{ - int stringtab_initialized = 0; - #if CYTHON_USE_MODULE_STATE - int pystate_addmodule_run = 0; - #endif - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - Py_ssize_t __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_PEP489_MULTI_PHASE_INIT - if (__pyx_m) { - if (__pyx_m == __pyx_pyinit_module) return 0; - PyErr_SetString(PyExc_RuntimeError, "Module '_encoding' has already been imported. Re-initialisation is not supported."); - return -1; - } - #elif PY_MAJOR_VERSION >= 3 - if (__pyx_m) return __Pyx_NewRef(__pyx_m); - #endif - /*--- Module creation code ---*/ - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); - #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("_encoding", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE - __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_encoding" pseudovariable */ - if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - pystate_addmodule_run = 1; - } - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #endif - CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__encoding(void)", 0); - if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); - #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main_w3lib___encoding) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "w3lib._encoding")) { - if (unlikely((PyDict_SetItemString(modules, "w3lib._encoding", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - (void)__Pyx_modinit_type_init_code(); - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - - /* "w3lib/_encoding.pyx":3 - * # https://encoding.spec.whatwg.org/ - * - * import codecs # <<<<<<<<<<<<<< - * from functools import lru_cache - * from typing import AnyStr, Callable, Dict, Tuple - */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_codecs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_codecs, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "w3lib/_encoding.pyx":4 - * - * import codecs - * from functools import lru_cache # <<<<<<<<<<<<<< - * from typing import AnyStr, Callable, Dict, Tuple - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_lru_cache); - __Pyx_GIVEREF(__pyx_n_s_lru_cache); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_lru_cache)) __PYX_ERR(0, 4, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_lru_cache, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "w3lib/_encoding.pyx":5 - * import codecs - * from functools import lru_cache - * from typing import AnyStr, Callable, Dict, Tuple # <<<<<<<<<<<<<< - * - * from ._infra import _ASCII_WHITESPACE - */ - __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_AnyStr); - __Pyx_GIVEREF(__pyx_n_s_AnyStr); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_AnyStr)) __PYX_ERR(0, 5, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Callable); - __Pyx_GIVEREF(__pyx_n_s_Callable); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Callable)) __PYX_ERR(0, 5, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Dict); - __Pyx_GIVEREF(__pyx_n_s_Dict); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_Dict)) __PYX_ERR(0, 5, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Tuple); - __Pyx_GIVEREF(__pyx_n_s_Tuple); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_Tuple)) __PYX_ERR(0, 5, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AnyStr, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Callable, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Dict, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tuple, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "w3lib/_encoding.pyx":7 - * from typing import AnyStr, Callable, Dict, Tuple - * - * from ._infra import _ASCII_WHITESPACE # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_ASCII_WHITESPACE); - __Pyx_GIVEREF(__pyx_n_s_ASCII_WHITESPACE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ASCII_WHITESPACE)) __PYX_ERR(0, 7, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_infra, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ASCII_WHITESPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_WHITESPACE, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "w3lib/_encoding.pyx":10 - * - * - * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] # <<<<<<<<<<<<<< - * DecodeFunction = Callable[[bytes], Tuple[str, int]] - * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error); - __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 10, __pyx_L1_error); - __Pyx_INCREF((PyObject *)(&PyInt_Type)); - __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 10, __pyx_L1_error); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 10, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CodecFunction, __pyx_t_5) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "w3lib/_encoding.pyx":11 - * - * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] - * DecodeFunction = Callable[[bytes], Tuple[str, int]] # <<<<<<<<<<<<<< - * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] - * - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Callable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF((PyObject *)(&PyBytes_Type)); - __Pyx_GIVEREF((PyObject *)(&PyBytes_Type)); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 11, __pyx_L1_error); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); - __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 11, __pyx_L1_error); - __Pyx_INCREF((PyObject *)(&PyInt_Type)); - __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 11, __pyx_L1_error); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(0, 11, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error); - __pyx_t_6 = 0; - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DecodeFunction, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "w3lib/_encoding.pyx":12 - * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] - * DecodeFunction = Callable[[bytes], Tuple[str, int]] - * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] # <<<<<<<<<<<<<< - * - * - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); - __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 12, __pyx_L1_error); - __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); - __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 12, __pyx_L1_error); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF((PyObject *)(&PyBytes_Type)); - __Pyx_GIVEREF((PyObject *)(&PyBytes_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 12, __pyx_L1_error); - __Pyx_INCREF((PyObject *)(&PyInt_Type)); - __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 12, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 12, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_EncodeFunction, __pyx_t_3) < 0) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "w3lib/_encoding.pyx":15 - * - * - * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< - * return { - * label: f"windows-125{last_digit}" - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_last_digit, __pyx_n_s_int) < 0) __PYX_ERR(0, 15, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Dict_str_str) < 0) __PYX_ERR(0, 15, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_9_encoding_1_short_windows_125, 0, __pyx_n_s_short_windows_125, NULL, __pyx_n_s_w3lib__encoding, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_short_windows_125, __pyx_t_6) < 0) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "w3lib/_encoding.pyx":26 - * - * - * _REPLACEMENT_ENCODING = "replacement" # <<<<<<<<<<<<<< - * _UTF_8_ENCODING = "utf-8" - * _UTF_16BE_ENCODING = "utf-16be" - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_REPLACEMENT_ENCODING, __pyx_n_u_replacement) < 0) __PYX_ERR(0, 26, __pyx_L1_error) - - /* "w3lib/_encoding.pyx":27 - * - * _REPLACEMENT_ENCODING = "replacement" - * _UTF_8_ENCODING = "utf-8" # <<<<<<<<<<<<<< - * _UTF_16BE_ENCODING = "utf-16be" - * _UTF_16LE_ENCODING = "utf-16le" - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODING, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 27, __pyx_L1_error) - - /* "w3lib/_encoding.pyx":28 - * _REPLACEMENT_ENCODING = "replacement" - * _UTF_8_ENCODING = "utf-8" - * _UTF_16BE_ENCODING = "utf-16be" # <<<<<<<<<<<<<< - * _UTF_16LE_ENCODING = "utf-16le" - * - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_16BE_ENCODING, __pyx_kp_u_utf_16be) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - - /* "w3lib/_encoding.pyx":29 - * _UTF_8_ENCODING = "utf-8" - * _UTF_16BE_ENCODING = "utf-16be" - * _UTF_16LE_ENCODING = "utf-16le" # <<<<<<<<<<<<<< - * - * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_16LE_ENCODING, __pyx_kp_u_utf_16le) < 0) __PYX_ERR(0, 29, __pyx_L1_error) - - /* "w3lib/_encoding.pyx":35 - * # Maps the labels defined in the standard to an encoding label that Python - * # understands. - * _LABEL_ENCODINGS = { # <<<<<<<<<<<<<< - * **{ - * label: _UTF_8_ENCODING - */ - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":36 - * # understands. - * _LABEL_ENCODINGS = { - * **{ # <<<<<<<<<<<<<< - * label: _UTF_8_ENCODING - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":38 - * **{ - * label: _UTF_8_ENCODING - * for label in ( # <<<<<<<<<<<<<< - * "unicode-1-1-utf-8", - * "unicode11utf8", - */ - __pyx_t_2 = __pyx_tuple__5; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 6) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 38, __pyx_L4_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":37 - * _LABEL_ENCODINGS = { - * **{ - * label: _UTF_8_ENCODING # <<<<<<<<<<<<<< - * for label in ( - * "unicode-1-1-utf-8", - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_8_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 37, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":38 - * **{ - * label: _UTF_8_ENCODING - * for label in ( # <<<<<<<<<<<<<< - * "unicode-1-1-utf-8", - * "unicode11utf8", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L8_exit_scope; - __pyx_L4_error:; - __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L8_exit_scope:; - } /* exit inner scope */ - __pyx_t_6 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 36, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":47 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "ibm866" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":49 - * **{ - * label: "ibm866" - * for label in ( # <<<<<<<<<<<<<< - * "866", - * "cp866", - */ - __pyx_t_2 = __pyx_tuple__6; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 4) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 49, __pyx_L11_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":48 - * }, - * **{ - * label: "ibm866" # <<<<<<<<<<<<<< - * for label in ( - * "866", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_n_u_ibm866))) __PYX_ERR(0, 48, __pyx_L11_error) - - /* "w3lib/_encoding.pyx":49 - * **{ - * label: "ibm866" - * for label in ( # <<<<<<<<<<<<<< - * "866", - * "cp866", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L15_exit_scope; - __pyx_L11_error:; - __Pyx_GOTREF(__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr2__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L15_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 47, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":56 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "iso-8859-2" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":58 - * **{ - * label: "iso-8859-2" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatin2", - * "iso-8859-2", - */ - __pyx_t_2 = __pyx_tuple__7; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 9) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 58, __pyx_L18_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":57 - * }, - * **{ - * label: "iso-8859-2" # <<<<<<<<<<<<<< - * for label in ( - * "csisolatin2", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_2))) __PYX_ERR(0, 57, __pyx_L18_error) - - /* "w3lib/_encoding.pyx":58 - * **{ - * label: "iso-8859-2" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatin2", - * "iso-8859-2", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L22_exit_scope; - __pyx_L18_error:; - __Pyx_GOTREF(__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr3__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L22_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 56, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":70 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "iso-8859-3" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":72 - * **{ - * label: "iso-8859-3" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatin3", - * "iso-8859-3", - */ - __pyx_t_2 = __pyx_tuple__8; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 9) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 72, __pyx_L25_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":71 - * }, - * **{ - * label: "iso-8859-3" # <<<<<<<<<<<<<< - * for label in ( - * "csisolatin3", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_3))) __PYX_ERR(0, 71, __pyx_L25_error) - - /* "w3lib/_encoding.pyx":72 - * **{ - * label: "iso-8859-3" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatin3", - * "iso-8859-3", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L29_exit_scope; - __pyx_L25_error:; - __Pyx_GOTREF(__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr4__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L29_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 70, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":84 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "iso-8859-4" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L32_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":86 - * **{ - * label: "iso-8859-4" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatin4", - * "iso-8859-4", - */ - __pyx_t_2 = __pyx_tuple__9; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 9) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 86, __pyx_L32_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L32_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":85 - * }, - * **{ - * label: "iso-8859-4" # <<<<<<<<<<<<<< - * for label in ( - * "csisolatin4", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_4))) __PYX_ERR(0, 85, __pyx_L32_error) - - /* "w3lib/_encoding.pyx":86 - * **{ - * label: "iso-8859-4" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatin4", - * "iso-8859-4", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L36_exit_scope; - __pyx_L32_error:; - __Pyx_GOTREF(__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr5__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L36_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 84, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":98 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "iso-8859-5" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L39_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":100 - * **{ - * label: "iso-8859-5" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatincyrillic", - * "cyrillic", - */ - __pyx_t_2 = __pyx_tuple__10; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 8) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 100, __pyx_L39_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L39_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":99 - * }, - * **{ - * label: "iso-8859-5" # <<<<<<<<<<<<<< - * for label in ( - * "csisolatincyrillic", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_5))) __PYX_ERR(0, 99, __pyx_L39_error) - - /* "w3lib/_encoding.pyx":100 - * **{ - * label: "iso-8859-5" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatincyrillic", - * "cyrillic", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L43_exit_scope; - __pyx_L39_error:; - __Pyx_GOTREF(__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr6__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L43_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 98, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":111 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "iso-8859-6" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L46_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":113 - * **{ - * label: "iso-8859-6" - * for label in ( # <<<<<<<<<<<<<< - * "arabic", - * "asmo-708", - */ - __pyx_t_2 = __pyx_tuple__11; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 14) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 113, __pyx_L46_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L46_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":112 - * }, - * **{ - * label: "iso-8859-6" # <<<<<<<<<<<<<< - * for label in ( - * "arabic", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_6))) __PYX_ERR(0, 112, __pyx_L46_error) - - /* "w3lib/_encoding.pyx":113 - * **{ - * label: "iso-8859-6" - * for label in ( # <<<<<<<<<<<<<< - * "arabic", - * "asmo-708", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L50_exit_scope; - __pyx_L46_error:; - __Pyx_GOTREF(__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr7__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L50_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 111, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":130 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "iso-8859-7" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L53_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":132 - * **{ - * label: "iso-8859-7" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatingreek", - * "ecma-118", - */ - __pyx_t_2 = __pyx_tuple__12; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 12) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 132, __pyx_L53_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L53_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":131 - * }, - * **{ - * label: "iso-8859-7" # <<<<<<<<<<<<<< - * for label in ( - * "csisolatingreek", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_7))) __PYX_ERR(0, 131, __pyx_L53_error) - - /* "w3lib/_encoding.pyx":132 - * **{ - * label: "iso-8859-7" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatingreek", - * "ecma-118", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L57_exit_scope; - __pyx_L53_error:; - __Pyx_GOTREF(__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr8__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L57_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 130, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":147 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "iso-8859-8" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L60_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":149 - * **{ - * label: "iso-8859-8" - * for label in ( # <<<<<<<<<<<<<< - * "csiso88598e", - * "csisolatinhebrew", - */ - __pyx_t_2 = __pyx_tuple__13; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 11) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 149, __pyx_L60_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L60_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":148 - * }, - * **{ - * label: "iso-8859-8" # <<<<<<<<<<<<<< - * for label in ( - * "csiso88598e", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_8))) __PYX_ERR(0, 148, __pyx_L60_error) - - /* "w3lib/_encoding.pyx":149 - * **{ - * label: "iso-8859-8" - * for label in ( # <<<<<<<<<<<<<< - * "csiso88598e", - * "csisolatinhebrew", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L64_exit_scope; - __pyx_L60_error:; - __Pyx_GOTREF(__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_8genexpr9__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L64_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 147, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":163 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "iso-8859-8-i" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L67_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":165 - * **{ - * label: "iso-8859-8-i" - * for label in ( # <<<<<<<<<<<<<< - * "csiso88598i", - * "iso-8859-8-i", - */ - __pyx_t_2 = __pyx_tuple__14; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 3) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 165, __pyx_L67_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L67_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":164 - * }, - * **{ - * label: "iso-8859-8-i" # <<<<<<<<<<<<<< - * for label in ( - * "csiso88598i", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_8_i))) __PYX_ERR(0, 164, __pyx_L67_error) - - /* "w3lib/_encoding.pyx":165 - * **{ - * label: "iso-8859-8-i" - * for label in ( # <<<<<<<<<<<<<< - * "csiso88598i", - * "iso-8859-8-i", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L71_exit_scope; - __pyx_L67_error:; - __Pyx_GOTREF(__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr10__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L71_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 163, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":171 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "iso-8859-10" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L74_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":173 - * **{ - * label: "iso-8859-10" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatin6", - * "iso-8859-10", - */ - __pyx_t_2 = __pyx_tuple__15; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 7) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 173, __pyx_L74_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L74_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":172 - * }, - * **{ - * label: "iso-8859-10" # <<<<<<<<<<<<<< - * for label in ( - * "csisolatin6", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_10))) __PYX_ERR(0, 172, __pyx_L74_error) - - /* "w3lib/_encoding.pyx":173 - * **{ - * label: "iso-8859-10" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatin6", - * "iso-8859-10", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L78_exit_scope; - __pyx_L74_error:; - __Pyx_GOTREF(__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr11__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L78_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 171, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":183 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "iso-8859-10" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L81_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":185 - * **{ - * label: "iso-8859-10" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatin6", - * "iso-8859-10", - */ - __pyx_t_2 = __pyx_tuple__15; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 7) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 185, __pyx_L81_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L81_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":184 - * }, - * **{ - * label: "iso-8859-10" # <<<<<<<<<<<<<< - * for label in ( - * "csisolatin6", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_10))) __PYX_ERR(0, 184, __pyx_L81_error) - - /* "w3lib/_encoding.pyx":185 - * **{ - * label: "iso-8859-10" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatin6", - * "iso-8859-10", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L85_exit_scope; - __pyx_L81_error:; - __Pyx_GOTREF(__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr12__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L85_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 183, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":195 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "iso-8859-13" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L88_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":197 - * **{ - * label: "iso-8859-13" - * for label in ( # <<<<<<<<<<<<<< - * "iso-8859-13", - * "iso8859-13", - */ - __pyx_t_2 = __pyx_tuple__16; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 3) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 197, __pyx_L88_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L88_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":196 - * }, - * **{ - * label: "iso-8859-13" # <<<<<<<<<<<<<< - * for label in ( - * "iso-8859-13", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_13))) __PYX_ERR(0, 196, __pyx_L88_error) - - /* "w3lib/_encoding.pyx":197 - * **{ - * label: "iso-8859-13" - * for label in ( # <<<<<<<<<<<<<< - * "iso-8859-13", - * "iso8859-13", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L92_exit_scope; - __pyx_L88_error:; - __Pyx_GOTREF(__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr13__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L92_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 195, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":203 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "iso-8859-14" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L95_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":205 - * **{ - * label: "iso-8859-14" - * for label in ( # <<<<<<<<<<<<<< - * "iso-8859-14", - * "iso8859-14", - */ - __pyx_t_2 = __pyx_tuple__17; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 3) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 205, __pyx_L95_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L95_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":204 - * }, - * **{ - * label: "iso-8859-14" # <<<<<<<<<<<<<< - * for label in ( - * "iso-8859-14", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_14))) __PYX_ERR(0, 204, __pyx_L95_error) - - /* "w3lib/_encoding.pyx":205 - * **{ - * label: "iso-8859-14" - * for label in ( # <<<<<<<<<<<<<< - * "iso-8859-14", - * "iso8859-14", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L99_exit_scope; - __pyx_L95_error:; - __Pyx_GOTREF(__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr14__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L99_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 203, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":211 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "iso-8859-15" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L102_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":213 - * **{ - * label: "iso-8859-15" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatin9", - * "iso-8859-15", - */ - __pyx_t_2 = __pyx_tuple__18; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 6) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 213, __pyx_L102_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L102_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":212 - * }, - * **{ - * label: "iso-8859-15" # <<<<<<<<<<<<<< - * for label in ( - * "csisolatin9", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_8859_15))) __PYX_ERR(0, 212, __pyx_L102_error) - - /* "w3lib/_encoding.pyx":213 - * **{ - * label: "iso-8859-15" - * for label in ( # <<<<<<<<<<<<<< - * "csisolatin9", - * "iso-8859-15", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L106_exit_scope; - __pyx_L102_error:; - __Pyx_GOTREF(__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr15__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L106_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 211, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_kp_u_iso_8859_16, __pyx_kp_u_iso_8859_16) < 0) __PYX_ERR(0, 222, __pyx_L1_error) - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":223 - * }, - * "iso-8859-16": "iso-8859-16", - * **{ # <<<<<<<<<<<<<< - * label: "koi8-r" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L109_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":225 - * **{ - * label: "koi8-r" - * for label in ( # <<<<<<<<<<<<<< - * "cskoi8r", - * "koi", - */ - __pyx_t_2 = __pyx_tuple__19; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 5) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 225, __pyx_L109_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L109_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":224 - * "iso-8859-16": "iso-8859-16", - * **{ - * label: "koi8-r" # <<<<<<<<<<<<<< - * for label in ( - * "cskoi8r", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_koi8_r))) __PYX_ERR(0, 224, __pyx_L109_error) - - /* "w3lib/_encoding.pyx":225 - * **{ - * label: "koi8-r" - * for label in ( # <<<<<<<<<<<<<< - * "cskoi8r", - * "koi", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L113_exit_scope; - __pyx_L109_error:; - __Pyx_GOTREF(__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr16__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L113_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 223, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":233 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "koi8-u" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L116_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":235 - * **{ - * label: "koi8-u" - * for label in ( # <<<<<<<<<<<<<< - * "koi8-ru", - * "koi8-u", - */ - __pyx_t_2 = __pyx_tuple__20; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 2) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 235, __pyx_L116_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L116_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":234 - * }, - * **{ - * label: "koi8-u" # <<<<<<<<<<<<<< - * for label in ( - * "koi8-ru", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_koi8_u))) __PYX_ERR(0, 234, __pyx_L116_error) - - /* "w3lib/_encoding.pyx":235 - * **{ - * label: "koi8-u" - * for label in ( # <<<<<<<<<<<<<< - * "koi8-ru", - * "koi8-u", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L120_exit_scope; - __pyx_L116_error:; - __Pyx_GOTREF(__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr17__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L120_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 233, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":240 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "macintosh" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L123_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":242 - * **{ - * label: "macintosh" - * for label in ( # <<<<<<<<<<<<<< - * "csmacintosh", - * "mac", - */ - __pyx_t_2 = __pyx_tuple__21; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 4) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 242, __pyx_L123_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L123_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":241 - * }, - * **{ - * label: "macintosh" # <<<<<<<<<<<<<< - * for label in ( - * "csmacintosh", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_n_u_macintosh))) __PYX_ERR(0, 241, __pyx_L123_error) - - /* "w3lib/_encoding.pyx":242 - * **{ - * label: "macintosh" - * for label in ( # <<<<<<<<<<<<<< - * "csmacintosh", - * "mac", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L127_exit_scope; - __pyx_L123_error:; - __Pyx_GOTREF(__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr18__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L127_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 240, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":249 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "cp874" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L130_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":251 - * **{ - * label: "cp874" - * for label in ( # <<<<<<<<<<<<<< - * "dos-874", - * "iso-8859-11", - */ - __pyx_t_2 = __pyx_tuple__22; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 6) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 251, __pyx_L130_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L130_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":250 - * }, - * **{ - * label: "cp874" # <<<<<<<<<<<<<< - * for label in ( - * "dos-874", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_n_u_cp874))) __PYX_ERR(0, 250, __pyx_L130_error) - - /* "w3lib/_encoding.pyx":251 - * **{ - * label: "cp874" - * for label in ( # <<<<<<<<<<<<<< - * "dos-874", - * "iso-8859-11", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L134_exit_scope; - __pyx_L130_error:; - __Pyx_GOTREF(__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr19__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L134_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 249, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "w3lib/_encoding.pyx":260 - * ) - * }, - * **_short_windows_125(0), # <<<<<<<<<<<<<< - * **_short_windows_125(1), - * **{ - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(__pyx_t_2 == Py_None)) { - PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 260, __pyx_L1_error) - } - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 260, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "w3lib/_encoding.pyx":261 - * }, - * **_short_windows_125(0), - * **_short_windows_125(1), # <<<<<<<<<<<<<< - * **{ - * label: "windows-1252" - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(__pyx_t_3 == Py_None)) { - PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 261, __pyx_L1_error) - } - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 261, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":262 - * **_short_windows_125(0), - * **_short_windows_125(1), - * **{ # <<<<<<<<<<<<<< - * label: "windows-1252" - * for label in ( - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L137_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":264 - * **{ - * label: "windows-1252" - * for label in ( # <<<<<<<<<<<<<< - * "ansi_x3.4-1968", - * "ascii", - */ - __pyx_t_2 = __pyx_tuple__25; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 17) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 264, __pyx_L137_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L137_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":263 - * **_short_windows_125(1), - * **{ - * label: "windows-1252" # <<<<<<<<<<<<<< - * for label in ( - * "ansi_x3.4-1968", - */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_windows_1252))) __PYX_ERR(0, 263, __pyx_L137_error) - - /* "w3lib/_encoding.pyx":264 - * **{ - * label: "windows-1252" - * for label in ( # <<<<<<<<<<<<<< - * "ansi_x3.4-1968", - * "ascii", - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L141_exit_scope; - __pyx_L137_error:; - __Pyx_GOTREF(__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr20__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L141_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 262, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "w3lib/_encoding.pyx":284 - * ) - * }, - * **_short_windows_125(3), # <<<<<<<<<<<<<< - * **{ - * label: "windows-1254" - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(__pyx_t_2 == Py_None)) { - PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 284, __pyx_L1_error) - } - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 284, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":285 - * }, - * **_short_windows_125(3), - * **{ # <<<<<<<<<<<<<< - * label: "windows-1254" - * for label in ( - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L144_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "w3lib/_encoding.pyx":287 - * **{ - * label: "windows-1254" - * for label in ( # <<<<<<<<<<<<<< - * "cp1254", - * "csisolatin5", - */ - __pyx_t_3 = __pyx_tuple__27; __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 12) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 287, __pyx_L144_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L144_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":286 - * **_short_windows_125(3), - * **{ - * label: "windows-1254" # <<<<<<<<<<<<<< - * for label in ( - * "cp1254", - */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_windows_1254))) __PYX_ERR(0, 286, __pyx_L144_error) - - /* "w3lib/_encoding.pyx":287 - * **{ - * label: "windows-1254" - * for label in ( # <<<<<<<<<<<<<< - * "cp1254", - * "csisolatin5", - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L148_exit_scope; - __pyx_L144_error:; - __Pyx_GOTREF(__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr21__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L148_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 285, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "w3lib/_encoding.pyx":302 - * ) - * }, - * **_short_windows_125(5), # <<<<<<<<<<<<<< - * **_short_windows_125(6), - * **_short_windows_125(7), - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(__pyx_t_3 == Py_None)) { - PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 302, __pyx_L1_error) - } - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 302, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "w3lib/_encoding.pyx":303 - * }, - * **_short_windows_125(5), - * **_short_windows_125(6), # <<<<<<<<<<<<<< - * **_short_windows_125(7), - * **_short_windows_125(8), - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(__pyx_t_2 == Py_None)) { - PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 303, __pyx_L1_error) - } - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 303, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "w3lib/_encoding.pyx":304 - * **_short_windows_125(5), - * **_short_windows_125(6), - * **_short_windows_125(7), # <<<<<<<<<<<<<< - * **_short_windows_125(8), - * **{ - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(__pyx_t_3 == Py_None)) { - PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 304, __pyx_L1_error) - } - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 304, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "w3lib/_encoding.pyx":305 - * **_short_windows_125(6), - * **_short_windows_125(7), - * **_short_windows_125(8), # <<<<<<<<<<<<<< - * **{ - * label: "mac-cyrillic" - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(__pyx_t_2 == Py_None)) { - PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 305, __pyx_L1_error) - } - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 305, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":306 - * **_short_windows_125(7), - * **_short_windows_125(8), - * **{ # <<<<<<<<<<<<<< - * label: "mac-cyrillic" - * for label in ( - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L151_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "w3lib/_encoding.pyx":308 - * **{ - * label: "mac-cyrillic" - * for label in ( # <<<<<<<<<<<<<< - * "x-mac-cyrillic", - * "x-mac-ukrainian", - */ - __pyx_t_3 = __pyx_tuple__32; __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 2) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 308, __pyx_L151_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L151_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":307 - * **_short_windows_125(8), - * **{ - * label: "mac-cyrillic" # <<<<<<<<<<<<<< - * for label in ( - * "x-mac-cyrillic", - */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_mac_cyrillic))) __PYX_ERR(0, 307, __pyx_L151_error) - - /* "w3lib/_encoding.pyx":308 - * **{ - * label: "mac-cyrillic" - * for label in ( # <<<<<<<<<<<<<< - * "x-mac-cyrillic", - * "x-mac-ukrainian", - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L155_exit_scope; - __pyx_L151_error:; - __Pyx_GOTREF(__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr22__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L155_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 306, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":313 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "gbk" - * for label in ( - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L158_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "w3lib/_encoding.pyx":315 - * **{ - * label: "gbk" - * for label in ( # <<<<<<<<<<<<<< - * "chinese", - * "csgb2312", - */ - __pyx_t_3 = __pyx_tuple__33; __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 9) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 315, __pyx_L158_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L158_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":314 - * }, - * **{ - * label: "gbk" # <<<<<<<<<<<<<< - * for label in ( - * "chinese", - */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_n_u_gbk))) __PYX_ERR(0, 314, __pyx_L158_error) - - /* "w3lib/_encoding.pyx":315 - * **{ - * label: "gbk" - * for label in ( # <<<<<<<<<<<<<< - * "chinese", - * "csgb2312", - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L162_exit_scope; - __pyx_L158_error:; - __Pyx_GOTREF(__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr23__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L162_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 313, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_gb18030, __pyx_n_u_gb18030) < 0) __PYX_ERR(0, 327, __pyx_L1_error) - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":328 - * }, - * "gb18030": "gb18030", - * **{ # <<<<<<<<<<<<<< - * label: "big5" - * for label in ( - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L165_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "w3lib/_encoding.pyx":330 - * **{ - * label: "big5" - * for label in ( # <<<<<<<<<<<<<< - * "big5", - * "big5-hkscs", - */ - __pyx_t_3 = __pyx_tuple__34; __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 5) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 330, __pyx_L165_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L165_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":329 - * "gb18030": "gb18030", - * **{ - * label: "big5" # <<<<<<<<<<<<<< - * for label in ( - * "big5", - */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_n_u_big5))) __PYX_ERR(0, 329, __pyx_L165_error) - - /* "w3lib/_encoding.pyx":330 - * **{ - * label: "big5" - * for label in ( # <<<<<<<<<<<<<< - * "big5", - * "big5-hkscs", - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L169_exit_scope; - __pyx_L165_error:; - __Pyx_GOTREF(__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr24__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L169_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 328, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":338 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "euc-jp" - * for label in ( - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L172_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "w3lib/_encoding.pyx":340 - * **{ - * label: "euc-jp" - * for label in ( # <<<<<<<<<<<<<< - * "cseucpkdfmtjapanese", - * "euc-jp", - */ - __pyx_t_3 = __pyx_tuple__35; __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 3) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 340, __pyx_L172_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L172_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":339 - * }, - * **{ - * label: "euc-jp" # <<<<<<<<<<<<<< - * for label in ( - * "cseucpkdfmtjapanese", - */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_euc_jp))) __PYX_ERR(0, 339, __pyx_L172_error) - - /* "w3lib/_encoding.pyx":340 - * **{ - * label: "euc-jp" - * for label in ( # <<<<<<<<<<<<<< - * "cseucpkdfmtjapanese", - * "euc-jp", - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L176_exit_scope; - __pyx_L172_error:; - __Pyx_GOTREF(__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr25__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L176_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 338, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":346 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "iso-2022-jp" - * for label in ( - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L179_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "w3lib/_encoding.pyx":348 - * **{ - * label: "iso-2022-jp" - * for label in ( # <<<<<<<<<<<<<< - * "csiso2022jp", - * "iso-2022-jp", - */ - __pyx_t_3 = __pyx_tuple__36; __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 2) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 348, __pyx_L179_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L179_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":347 - * }, - * **{ - * label: "iso-2022-jp" # <<<<<<<<<<<<<< - * for label in ( - * "csiso2022jp", - */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_iso_2022_jp))) __PYX_ERR(0, 347, __pyx_L179_error) - - /* "w3lib/_encoding.pyx":348 - * **{ - * label: "iso-2022-jp" - * for label in ( # <<<<<<<<<<<<<< - * "csiso2022jp", - * "iso-2022-jp", - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L183_exit_scope; - __pyx_L179_error:; - __Pyx_GOTREF(__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr26__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L183_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 346, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":353 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "shift_jis" - * for label in ( - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L186_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "w3lib/_encoding.pyx":355 - * **{ - * label: "shift_jis" - * for label in ( # <<<<<<<<<<<<<< - * "csshiftjis", - * "ms932", - */ - __pyx_t_3 = __pyx_tuple__37; __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 8) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 355, __pyx_L186_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L186_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":354 - * }, - * **{ - * label: "shift_jis" # <<<<<<<<<<<<<< - * for label in ( - * "csshiftjis", - */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_n_u_shift_jis_2))) __PYX_ERR(0, 354, __pyx_L186_error) - - /* "w3lib/_encoding.pyx":355 - * **{ - * label: "shift_jis" - * for label in ( # <<<<<<<<<<<<<< - * "csshiftjis", - * "ms932", - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L190_exit_scope; - __pyx_L186_error:; - __Pyx_GOTREF(__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr27__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L190_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 353, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":366 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: "euc-kr" - * for label in ( - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L193_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "w3lib/_encoding.pyx":368 - * **{ - * label: "euc-kr" - * for label in ( # <<<<<<<<<<<<<< - * "cseuckr", - * "csksc56011987", - */ - __pyx_t_3 = __pyx_tuple__38; __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 10) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 368, __pyx_L193_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L193_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":367 - * }, - * **{ - * label: "euc-kr" # <<<<<<<<<<<<<< - * for label in ( - * "cseuckr", - */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_kp_u_euc_kr))) __PYX_ERR(0, 367, __pyx_L193_error) - - /* "w3lib/_encoding.pyx":368 - * **{ - * label: "euc-kr" - * for label in ( # <<<<<<<<<<<<<< - * "cseuckr", - * "csksc56011987", - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L197_exit_scope; - __pyx_L193_error:; - __Pyx_GOTREF(__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr28__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L197_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 366, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":381 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: _REPLACEMENT_ENCODING - * for label in ( - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L200_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "w3lib/_encoding.pyx":383 - * **{ - * label: _REPLACEMENT_ENCODING - * for label in ( # <<<<<<<<<<<<<< - * "csiso2022kr", - * "hz-gb-2312", - */ - __pyx_t_3 = __pyx_tuple__39; __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 6) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 383, __pyx_L200_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L200_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":382 - * }, - * **{ - * label: _REPLACEMENT_ENCODING # <<<<<<<<<<<<<< - * for label in ( - * "csiso2022kr", - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_REPLACEMENT_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L200_error) - __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 382, __pyx_L200_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":383 - * **{ - * label: _REPLACEMENT_ENCODING - * for label in ( # <<<<<<<<<<<<<< - * "csiso2022kr", - * "hz-gb-2312", - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L204_exit_scope; - __pyx_L200_error:; - __Pyx_GOTREF(__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr29__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L204_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 381, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":392 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: _UTF_16BE_ENCODING - * for label in ( - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L207_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "w3lib/_encoding.pyx":394 - * **{ - * label: _UTF_16BE_ENCODING - * for label in ( # <<<<<<<<<<<<<< - * "unicodefffe", - * "utf-16be", - */ - __pyx_t_3 = __pyx_tuple__40; __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 2) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 394, __pyx_L207_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L207_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":393 - * }, - * **{ - * label: _UTF_16BE_ENCODING # <<<<<<<<<<<<<< - * for label in ( - * "unicodefffe", - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_16BE_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L207_error) - __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 393, __pyx_L207_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":394 - * **{ - * label: _UTF_16BE_ENCODING - * for label in ( # <<<<<<<<<<<<<< - * "unicodefffe", - * "utf-16be", - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L211_exit_scope; - __pyx_L207_error:; - __Pyx_GOTREF(__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr30__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L211_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 392, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - { /* enter inner scope */ - - /* "w3lib/_encoding.pyx":399 - * ) - * }, - * **{ # <<<<<<<<<<<<<< - * label: _UTF_16LE_ENCODING - * for label in ( - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L214_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "w3lib/_encoding.pyx":401 - * **{ - * label: _UTF_16LE_ENCODING - * for label in ( # <<<<<<<<<<<<<< - * "csunicode", - * "iso-10646-ucs-2", - */ - __pyx_t_3 = __pyx_tuple__41; __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = 0; - for (;;) { - if (__pyx_t_7 >= 7) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 401, __pyx_L214_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L214_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XGOTREF(__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":400 - * }, - * **{ - * label: _UTF_16LE_ENCODING # <<<<<<<<<<<<<< - * for label in ( - * "csunicode", - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_16LE_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L214_error) - __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 400, __pyx_L214_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":401 - * **{ - * label: _UTF_16LE_ENCODING - * for label in ( # <<<<<<<<<<<<<< - * "csunicode", - * "iso-10646-ucs-2", - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L218_exit_scope; - __pyx_L214_error:; - __Pyx_GOTREF(__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label); - __Pyx_DECREF_SET(__pyx_9genexpr31__pyx_v_5w3lib_9_encoding_label, Py_None); - goto __pyx_L1_error; - __pyx_L218_exit_scope:; - } /* exit inner scope */ - if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 399, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_kp_u_x_user_defined, __pyx_kp_u_x_user_defined) < 0) __PYX_ERR(0, 411, __pyx_L1_error) - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LABEL_ENCODINGS, __pyx_t_6) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "w3lib/_encoding.pyx":416 - * - * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder - * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< - * def _get_encoder(encoding: str) -> EncodeFunction: - * codec_info = codecs.lookup(encoding) - */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 416, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 416, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_EncodeFunction) < 0) __PYX_ERR(0, 416, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_9_encoding_3_get_encoder, 0, __pyx_n_s_get_encoder, NULL, __pyx_n_s_w3lib__encoding, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoder, __pyx_t_2) < 0) __PYX_ERR(0, 416, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "w3lib/_encoding.pyx":422 - * - * - * _UTF_8_ENCODER = _get_encoder("utf-8") # <<<<<<<<<<<<<< - * - * - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODER, __pyx_t_6) < 0) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "w3lib/_encoding.pyx":426 - * - * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get - * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< - * def _get_encoding(label: str) -> str: - * label = label.strip(_ASCII_WHITESPACE).lower() - */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 426, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 426, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 426, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_9_encoding_5_get_encoding, 0, __pyx_n_s_get_encoding, NULL, __pyx_n_s_w3lib__encoding, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 426, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "w3lib/_encoding.pyx":441 - * - * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( - * _REPLACEMENT_ENCODING, # <<<<<<<<<<<<<< - * _UTF_16BE_ENCODING, - * _UTF_16LE_ENCODING, - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_REPLACEMENT_ENCODING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "w3lib/_encoding.pyx":442 - * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( - * _REPLACEMENT_ENCODING, - * _UTF_16BE_ENCODING, # <<<<<<<<<<<<<< - * _UTF_16LE_ENCODING, - * ) - */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_UTF_16BE_ENCODING); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - - /* "w3lib/_encoding.pyx":443 - * _REPLACEMENT_ENCODING, - * _UTF_16BE_ENCODING, - * _UTF_16LE_ENCODING, # <<<<<<<<<<<<<< - * ) - * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_UTF_16LE_ENCODING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "w3lib/_encoding.pyx":441 - * - * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( - * _REPLACEMENT_ENCODING, # <<<<<<<<<<<<<< - * _UTF_16BE_ENCODING, - * _UTF_16LE_ENCODING, - */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 441, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_6 = 0; - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS, __pyx_t_4) < 0) __PYX_ERR(0, 440, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_encoding.pyx":448 - * - * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings - * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< - * def _get_output_encoding(encoding: str) -> str: - * encoding = _get_encoding(encoding) - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 448, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 448, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 448, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_9_encoding_7_get_output_encoding, 0, __pyx_n_s_get_output_encoding, NULL, __pyx_n_s_w3lib__encoding, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_output_encoding, __pyx_t_3) < 0) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "w3lib/_encoding.pyx":1 - * # https://encoding.spec.whatwg.org/ # <<<<<<<<<<<<<< - * - * import codecs - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { - __Pyx_AddTraceback("init w3lib._encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - #if !CYTHON_USE_MODULE_STATE - Py_CLEAR(__pyx_m); - #else - Py_DECREF(__pyx_m); - if (pystate_addmodule_run) { - PyObject *tp, *value, *tb; - PyErr_Fetch(&tp, &value, &tb); - PyState_RemoveModule(&__pyx_moduledef); - PyErr_Restore(tp, value, tb); - } - #endif - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init w3lib._encoding"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if CYTHON_PEP489_MULTI_PHASE_INIT - return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; - #else - return; - #endif -} -/* #### Code section: cleanup_globals ### */ -/* #### Code section: cleanup_module ### */ -/* #### Code section: main_method ### */ -/* #### Code section: utility_code_pragmas ### */ -#ifdef _MSC_VER -#pragma warning( push ) -/* Warning 4127: conditional expression is constant - * Cython uses constant conditional expressions to allow in inline functions to be optimized at - * compile-time, so this warning is not useful - */ -#pragma warning( disable : 4127 ) -#endif - - - -/* #### Code section: utility_code_def ### */ - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule(modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, "RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* PyErrExceptionMatches */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; i= 0x030C00A6 - PyObject *current_exception = tstate->current_exception; - if (unlikely(!current_exception)) return 0; - exc_type = (PyObject*) Py_TYPE(current_exception); - if (exc_type == err) return 1; -#else - exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; -#endif - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(exc_type); - #endif - if (unlikely(PyTuple_Check(err))) { - result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); - } else { - result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); - } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(exc_type); - #endif - return result; -} -#endif - -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *tmp_value; - assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); - if (value) { - #if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) - #endif - PyException_SetTraceback(value, tb); - } - tmp_value = tstate->current_exception; - tstate->current_exception = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject* exc_value; - exc_value = tstate->current_exception; - tstate->current_exception = 0; - *value = exc_value; - *type = NULL; - *tb = NULL; - if (exc_value) { - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - #if CYTHON_COMPILING_IN_CPYTHON - *tb = ((PyBaseExceptionObject*) exc_value)->traceback; - Py_XINCREF(*tb); - #else - *tb = PyException_GetTraceback(exc_value); - #endif - } -#else - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#endif -} -#endif - -/* PyObjectGetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#endif - -/* PyObjectGetAttrStrNoError */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 -static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) - __Pyx_PyErr_Clear(); -} -#endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { - PyObject *result; -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 - (void) PyObject_GetOptionalAttr(obj, attr_name, &result); - return result; -#else -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { - return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); - } -#endif - result = __Pyx_PyObject_GetAttrStr(obj, attr_name); - if (unlikely(!result)) { - __Pyx_PyObject_GetAttrStr_ClearAttributeError(); - } - return result; -#endif -} - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); - if (unlikely(!result) && !PyErr_Occurred()) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { - PyObject *v; - Py_ssize_t i; - for (i = 0; i < length; i++) { - v = dest[i] = src[i]; - Py_INCREF(v); - } -} -static CYTHON_INLINE PyObject * -__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; - } - res = PyTuple_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); - return res; -} -static CYTHON_INLINE PyObject * -__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - return PyList_New(0); - } - res = PyList_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); - return res; -} -#endif - -/* BytesEquals */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API - return PyObject_RichCompareBool(s1, s2, equals); -#else - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { - const char *ps1, *ps2; - Py_ssize_t length = PyBytes_GET_SIZE(s1); - if (length != PyBytes_GET_SIZE(s2)) - return (equals == Py_NE); - ps1 = PyBytes_AS_STRING(s1); - ps2 = PyBytes_AS_STRING(s2); - if (ps1[0] != ps2[0]) { - return (equals == Py_NE); - } else if (length == 1) { - return (equals == Py_EQ); - } else { - int result; -#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) - Py_hash_t hash1, hash2; - hash1 = ((PyBytesObject*)s1)->ob_shash; - hash2 = ((PyBytesObject*)s2)->ob_shash; - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - return (equals == Py_NE); - } -#endif - result = memcmp(ps1, ps2, (size_t)length); - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { - return (equals == Py_NE); - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -#endif -} - -/* UnicodeEquals */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API - return PyObject_RichCompareBool(s1, s2, equals); -#else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif - int s1_is_unicode, s2_is_unicode; - if (s1 == s2) { - goto return_eq; - } - s1_is_unicode = PyUnicode_CheckExact(s1); - s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; - } -#if CYTHON_USE_UNICODE_INTERNALS - { - Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED - hash1 = ((PyASCIIObject*)s1)->hash; - hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - goto return_ne; - } - } -#endif - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ); -return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_NE); -#endif -} - -/* fastcall */ -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) -{ - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); - for (i = 0; i < n; i++) - { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; - } - for (i = 0; i < n; i++) - { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); - if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; - return kwvalues[i]; - } - } - return NULL; -} -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 -CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { - Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); - PyObject *dict; - dict = PyDict_New(); - if (unlikely(!dict)) - return NULL; - for (i=0; i= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); - while (1) { - Py_XDECREF(key); key = NULL; - Py_XDECREF(value); value = NULL; - if (kwds_is_tuple) { - Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(kwds); -#else - size = PyTuple_Size(kwds); - if (size < 0) goto bad; -#endif - if (pos >= size) break; -#if CYTHON_AVOID_BORROWED_REFS - key = __Pyx_PySequence_ITEM(kwds, pos); - if (!key) goto bad; -#elif CYTHON_ASSUME_SAFE_MACROS - key = PyTuple_GET_ITEM(kwds, pos); -#else - key = PyTuple_GetItem(kwds, pos); - if (!key) goto bad; -#endif - value = kwvalues[pos]; - pos++; - } - else - { - if (!PyDict_Next(kwds, &pos, &key, &value)) break; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); -#endif - } - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); - Py_DECREF(key); -#endif - key = NULL; - value = NULL; - continue; - } -#if !CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); -#endif - Py_INCREF(value); - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key) - ); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - Py_XDECREF(key); - Py_XDECREF(value); - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - Py_XDECREF(key); - Py_XDECREF(value); - return -1; -} - -/* RaiseArgTupleInvalid */ -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* ArgTypeTest */ -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) -{ - __Pyx_TypeName type_name; - __Pyx_TypeName obj_type_name; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(__Pyx_TypeCheck(obj, type))) return 1; - } - type_name = __Pyx_PyType_GetName(type); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); - __Pyx_DECREF_TypeName(type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; -} - -/* PyDictVersioning */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); -#else - dictptr = _PyObject_GetDictPtr(obj); -#endif - } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; -} -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); -} -#endif - -/* GetModuleGlobalName */ -#if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) -#else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) -#endif -{ - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(!__pyx_m)) { - return NULL; - } - result = PyObject_GetAttr(__pyx_m, name); - if (likely(result)) { - return result; - } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } -#endif -#else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } - PyErr_Clear(); -#endif - return __Pyx_GetBuiltinName(name); -} - -/* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; - } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; -} -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; -#if PY_MAJOR_VERSION >= 3 - PyObject *kwdefs; -#endif - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - #else - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { - return NULL; - } - #endif - if ( -#if PY_MAJOR_VERSION >= 3 - co->co_kwonlyargcount == 0 && -#endif - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; - } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 - kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; - } -#if PY_MAJOR_VERSION >= 3 - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} -#endif - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = Py_TYPE(func)->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) - return NULL; - #endif - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectCallMethO */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); - self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) - return NULL; - #endif - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectFastCall */ -#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API -static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { - PyObject *argstuple; - PyObject *result = 0; - size_t i; - argstuple = PyTuple_New((Py_ssize_t)nargs); - if (unlikely(!argstuple)) return NULL; - for (i = 0; i < nargs; i++) { - Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; - } - result = __Pyx_PyObject_Call(func, argstuple, kwargs); - bad: - Py_DECREF(argstuple); - return result; -} -#endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { - Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); -#if CYTHON_COMPILING_IN_CPYTHON - if (nargs == 0 && kwargs == NULL) { - if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) - return __Pyx_PyObject_CallMethO(func, NULL); - } - else if (nargs == 1 && kwargs == NULL) { - if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) - return __Pyx_PyObject_CallMethO(func, args[0]); - } -#endif - #if PY_VERSION_HEX < 0x030800B1 - #if CYTHON_FAST_PYCCALL - if (PyCFunction_Check(func)) { - if (kwargs) { - return _PyCFunction_FastCallDict(func, args, nargs, kwargs); - } else { - return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); - } - } - #if PY_VERSION_HEX >= 0x030700A1 - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); - } - #endif - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); - } - #endif - #endif - if (kwargs == NULL) { - #if CYTHON_VECTORCALL - #if PY_VERSION_HEX < 0x03090000 - vectorcallfunc f = _PyVectorcall_Function(func); - #else - vectorcallfunc f = PyVectorcall_Function(func); - #endif - if (f) { - return f(func, args, (size_t)nargs, NULL); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, (size_t)nargs, NULL); - } - #endif - } - if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); - } - #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API - return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); - #else - return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); - #endif -} - -/* UnpackUnboundCMethod */ -static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { - PyObject *result; - PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); - if (unlikely(!selfless_args)) return NULL; - result = PyObject_Call(method, selfless_args, kwargs); - Py_DECREF(selfless_args); - return result; -} -static PyMethodDef __Pyx_UnboundCMethod_Def = { - "CythonUnboundCMethod", - __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), - METH_VARARGS | METH_KEYWORDS, - NULL -}; -static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { - PyObject *method; - method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); - if (unlikely(!method)) - return -1; - target->method = method; -#if CYTHON_COMPILING_IN_CPYTHON - #if PY_MAJOR_VERSION >= 3 - if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) - #else - if (likely(!__Pyx_CyOrPyCFunction_Check(method))) - #endif - { - PyMethodDescrObject *descr = (PyMethodDescrObject*) method; - target->func = descr->d_method->ml_meth; - target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); - } else -#endif -#if CYTHON_COMPILING_IN_PYPY -#else - if (PyCFunction_Check(method)) -#endif - { - PyObject *self; - int self_found; -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - self = PyObject_GetAttrString(method, "__self__"); - if (!self) { - PyErr_Clear(); - } -#else - self = PyCFunction_GET_SELF(method); -#endif - self_found = (self && self != Py_None); -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - Py_XDECREF(self); -#endif - if (self_found) { - PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); - if (unlikely(!unbound_method)) return -1; - Py_DECREF(method); - target->method = unbound_method; - } - } - return 0; -} - -/* CallUnboundCMethod1 */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { - if (likely(cfunc->func)) { - int flag = cfunc->flag; - if (flag == METH_O) { - return (*(cfunc->func))(self, arg); - } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { - #if PY_VERSION_HEX >= 0x030700A0 - return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); - #else - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); - #endif - } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); - } - } - return __Pyx__CallUnboundCMethod1(cfunc, self, arg); -} -#endif -static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ - PyObject *args, *result = NULL; - if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_COMPILING_IN_CPYTHON - if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - args = PyTuple_New(1); - if (unlikely(!args)) goto bad; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - if (cfunc->flag & METH_KEYWORDS) - result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); - else - result = (*cfunc->func)(self, args); - } else { - args = PyTuple_New(2); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 1, arg); - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - } -#else - args = PyTuple_Pack(2, self, arg); - if (unlikely(!args)) goto bad; - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); -#endif -bad: - Py_XDECREF(args); - return result; -} - -/* RaiseUnexpectedTypeError */ -static int -__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) -{ - __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, - expected, obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; -} - -/* DictGetItem */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - if (unlikely(PyTuple_Check(key))) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) { - PyErr_SetObject(PyExc_KeyError, args); - Py_DECREF(args); - } - } else { - PyErr_SetObject(PyExc_KeyError, key); - } - } - return NULL; - } - Py_INCREF(value); - return value; -} -#endif - -/* GetTopmostException */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * -__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) -{ - _PyErr_StackItem *exc_info = tstate->exc_info; - while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && - exc_info->previous_item != NULL) - { - exc_info = exc_info->previous_item; - } - return exc_info; -} -#endif - -/* SaveResetException */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - PyObject *exc_value = exc_info->exc_value; - if (exc_value == NULL || exc_value == Py_None) { - *value = NULL; - *type = NULL; - *tb = NULL; - } else { - *value = exc_value; - Py_INCREF(*value); - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - *tb = PyException_GetTraceback(exc_value); - } - #elif CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - *type = exc_info->exc_type; - *value = exc_info->exc_value; - *tb = exc_info->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #else - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #endif -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = tstate->exc_info; - PyObject *tmp_value = exc_info->exc_value; - exc_info->exc_value = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); - #else - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = type; - exc_info->exc_value = value; - exc_info->exc_traceback = tb; - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - #endif -} -#endif - -/* GetException */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) -#endif -{ - PyObject *local_type = NULL, *local_value, *local_tb = NULL; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030C00A6 - local_value = tstate->current_exception; - tstate->current_exception = 0; - if (likely(local_value)) { - local_type = (PyObject*) Py_TYPE(local_value); - Py_INCREF(local_type); - local_tb = PyException_GetTraceback(local_value); - } - #else - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - #endif -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 - if (unlikely(tstate->current_exception)) -#elif CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - #if CYTHON_USE_EXC_INFO_STACK - { - _PyErr_StackItem *exc_info = tstate->exc_info; - #if PY_VERSION_HEX >= 0x030B00a4 - tmp_value = exc_info->exc_value; - exc_info->exc_value = local_value; - tmp_type = NULL; - tmp_tb = NULL; - Py_XDECREF(local_type); - Py_XDECREF(local_tb); - #else - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = local_type; - exc_info->exc_value = local_value; - exc_info->exc_traceback = local_tb; - #endif - } - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -} - -/* PyObjectFormatAndDecref */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { - if (unlikely(!s)) return NULL; - if (likely(PyUnicode_CheckExact(s))) return s; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(s))) { - PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); - Py_DECREF(s); - return result; - } - #endif - return __Pyx_PyObject_FormatAndDecref(s, f); -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { - PyObject *result; - if (unlikely(!s)) return NULL; - result = PyObject_Format(s, f); - Py_DECREF(s); - return result; -} - -/* UnicodeConcatInPlace */ -# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -static int -__Pyx_unicode_modifiable(PyObject *unicode) -{ - if (Py_REFCNT(unicode) != 1) - return 0; - if (!PyUnicode_CheckExact(unicode)) - return 0; - if (PyUnicode_CHECK_INTERNED(unicode)) - return 0; - return 1; -} -static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right - #if CYTHON_REFNANNY - , void* __pyx_refnanny - #endif - ) { - PyObject *left = *p_left; - Py_ssize_t left_len, right_len, new_len; - if (unlikely(__Pyx_PyUnicode_READY(left) == -1)) - return NULL; - if (unlikely(__Pyx_PyUnicode_READY(right) == -1)) - return NULL; - left_len = PyUnicode_GET_LENGTH(left); - if (left_len == 0) { - Py_INCREF(right); - return right; - } - right_len = PyUnicode_GET_LENGTH(right); - if (right_len == 0) { - Py_INCREF(left); - return left; - } - if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) { - PyErr_SetString(PyExc_OverflowError, - "strings are too large to concat"); - return NULL; - } - new_len = left_len + right_len; - if (__Pyx_unicode_modifiable(left) - && PyUnicode_CheckExact(right) - && PyUnicode_KIND(right) <= PyUnicode_KIND(left) - && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) { - int ret; - __Pyx_GIVEREF(*p_left); - ret = PyUnicode_Resize(p_left, new_len); - __Pyx_GOTREF(*p_left); - if (unlikely(ret != 0)) - return NULL; - #if PY_VERSION_HEX >= 0x030d0000 - if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL; - #else - _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len); - #endif - __Pyx_INCREF(*p_left); - __Pyx_GIVEREF(*p_left); - return *p_left; - } else { - return __Pyx_PyUnicode_Concat(left, right); - } - } -#endif - -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - if (cause) { - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 - PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *module = 0; - PyObject *empty_dict = 0; - PyObject *empty_list = 0; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (unlikely(!py_import)) - goto bad; - if (!from_list) { - empty_list = PyList_New(0); - if (unlikely(!empty_list)) - goto bad; - from_list = empty_list; - } - #endif - empty_dict = PyDict_New(); - if (unlikely(!empty_dict)) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif - } - } -bad: - Py_XDECREF(empty_dict); - Py_XDECREF(empty_list); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif - return module; -} - -/* ImportDottedModule */ -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { - PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; - if (unlikely(PyErr_Occurred())) { - PyErr_Clear(); - } - if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { - partial_name = name; - } else { - slice = PySequence_GetSlice(parts_tuple, 0, count); - if (unlikely(!slice)) - goto bad; - sep = PyUnicode_FromStringAndSize(".", 1); - if (unlikely(!sep)) - goto bad; - partial_name = PyUnicode_Join(sep, slice); - } - PyErr_Format( -#if PY_MAJOR_VERSION < 3 - PyExc_ImportError, - "No module named '%s'", PyString_AS_STRING(partial_name)); -#else -#if PY_VERSION_HEX >= 0x030600B1 - PyExc_ModuleNotFoundError, -#else - PyExc_ImportError, -#endif - "No module named '%U'", partial_name); -#endif -bad: - Py_XDECREF(sep); - Py_XDECREF(slice); - Py_XDECREF(partial_name); - return NULL; -} -#endif -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { - PyObject *imported_module; -#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - return NULL; - imported_module = __Pyx_PyDict_GetItemStr(modules, name); - Py_XINCREF(imported_module); -#else - imported_module = PyImport_GetModule(name); -#endif - return imported_module; -} -#endif -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { - Py_ssize_t i, nparts; - nparts = PyTuple_GET_SIZE(parts_tuple); - for (i=1; i < nparts && module; i++) { - PyObject *part, *submodule; -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - part = PyTuple_GET_ITEM(parts_tuple, i); -#else - part = PySequence_ITEM(parts_tuple, i); -#endif - submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(part); -#endif - Py_DECREF(module); - module = submodule; - } - if (unlikely(!module)) { - return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); - } - return module; -} -#endif -static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s_; - CYTHON_UNUSED_VAR(parts_tuple); - from_list = PyList_New(1); - if (unlikely(!from_list)) - return NULL; - Py_INCREF(star); - PyList_SET_ITEM(from_list, 0, star); - module = __Pyx_Import(name, from_list, 0); - Py_DECREF(from_list); - return module; -#else - PyObject *imported_module; - PyObject *module = __Pyx_Import(name, NULL, 0); - if (!parts_tuple || unlikely(!module)) - return module; - imported_module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(imported_module)) { - Py_DECREF(module); - return imported_module; - } - PyErr_Clear(); - return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -#endif -} -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 - PyObject *module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); - if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); - if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { - Py_DECREF(spec); - spec = NULL; - } - Py_XDECREF(unsafe); - } - if (likely(!spec)) { - PyErr_Clear(); - return module; - } - Py_DECREF(spec); - Py_DECREF(module); - } else if (PyErr_Occurred()) { - PyErr_Clear(); - } -#endif - return __Pyx__ImportDottedModule(name, parts_tuple); -} - -/* ImportFrom */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - const char* module_name_str = 0; - PyObject* module_name = 0; - PyObject* module_dot = 0; - PyObject* full_name = 0; - PyErr_Clear(); - module_name_str = PyModule_GetName(module); - if (unlikely(!module_name_str)) { goto modbad; } - module_name = PyUnicode_FromString(module_name_str); - if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); - if (unlikely(!module_dot)) { goto modbad; } - full_name = PyUnicode_Concat(module_dot, name); - if (unlikely(!full_name)) { goto modbad; } - #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) - { - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - goto modbad; - value = PyObject_GetItem(modules, full_name); - } - #else - value = PyImport_GetModule(full_name); - #endif - modbad: - Py_XDECREF(full_name); - Py_XDECREF(module_dot); - Py_XDECREF(module_name); - } - if (unlikely(!value)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif - } - return value; -} - -/* GetItemInt */ -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (unlikely(!j)) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyList_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyTuple_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; - PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_subscript) { - PyObject *r, *key = PyInt_FromSsize_t(i); - if (unlikely(!key)) return NULL; - r = mm->mp_subscript(o, key); - Py_DECREF(key); - return r; - } - if (likely(sm && sm->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { - Py_ssize_t l = sm->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } - } - return sm->sq_item(o, i); - } - } -#else - if (is_list || !PyMapping_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -/* ObjectGetItem */ -#if CYTHON_USE_TYPE_SLOTS -static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { - PyObject *runerr = NULL; - Py_ssize_t key_value; - key_value = __Pyx_PyIndex_AsSsize_t(index); - if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { - return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); - } - if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { - __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); - PyErr_Clear(); - PyErr_Format(PyExc_IndexError, - "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); - __Pyx_DECREF_TypeName(index_type_name); - } - return NULL; -} -static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { - __Pyx_TypeName obj_type_name; - if (likely(PyType_Check(obj))) { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); - if (!meth) { - PyErr_Clear(); - } else { - PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); - Py_DECREF(meth); - return result; - } - } - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return NULL; -} -static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { - PyTypeObject *tp = Py_TYPE(obj); - PyMappingMethods *mm = tp->tp_as_mapping; - PySequenceMethods *sm = tp->tp_as_sequence; - if (likely(mm && mm->mp_subscript)) { - return mm->mp_subscript(obj, key); - } - if (likely(sm && sm->sq_item)) { - return __Pyx_PyObject_GetIndex(obj, key); - } - return __Pyx_PyObject_GetItem_Slow(obj, key); -} -#endif - -/* FixUpExtensionType */ -#if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { -#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - CYTHON_UNUSED_VAR(spec); - CYTHON_UNUSED_VAR(type); -#else - const PyType_Slot *slot = spec->slots; - while (slot && slot->slot && slot->slot != Py_tp_members) - slot++; - if (slot && slot->slot == Py_tp_members) { - int changed = 0; -#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) - const -#endif - PyMemberDef *memb = (PyMemberDef*) slot->pfunc; - while (memb && memb->name) { - if (memb->name[0] == '_' && memb->name[1] == '_') { -#if PY_VERSION_HEX < 0x030900b1 - if (strcmp(memb->name, "__weaklistoffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); - type->tp_weaklistoffset = memb->offset; - changed = 1; - } - else if (strcmp(memb->name, "__dictoffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); - type->tp_dictoffset = memb->offset; - changed = 1; - } -#if CYTHON_METH_FASTCALL - else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); -#if PY_VERSION_HEX >= 0x030800b4 - type->tp_vectorcall_offset = memb->offset; -#else - type->tp_print = (printfunc) memb->offset; -#endif - changed = 1; - } -#endif -#else - if ((0)); -#endif -#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON - else if (strcmp(memb->name, "__module__") == 0) { - PyObject *descr; - assert(memb->type == T_OBJECT); - assert(memb->flags == 0 || memb->flags == READONLY); - descr = PyDescr_NewMember(type, memb); - if (unlikely(!descr)) - return -1; - if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { - Py_DECREF(descr); - return -1; - } - Py_DECREF(descr); - changed = 1; - } -#endif - } - memb++; - } - if (changed) - PyType_Modified(type); - } -#endif - return 0; -} -#endif - -/* FetchSharedCythonModule */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); -} - -/* FetchCommonType */ -static int __Pyx_VerifyCachedType(PyObject *cached_type, - const char *name, - Py_ssize_t basicsize, - Py_ssize_t expected_basicsize) { - if (!PyType_Check(cached_type)) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s is not a type object", name); - return -1; - } - if (basicsize != expected_basicsize) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s has the wrong size, try recompiling", - name); - return -1; - } - return 0; -} -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { - PyObject* abi_module; - const char* object_name; - PyTypeObject *cached_type = NULL; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - object_name = strrchr(type->tp_name, '.'); - object_name = object_name ? object_name+1 : type->tp_name; - cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - if (__Pyx_VerifyCachedType( - (PyObject *)cached_type, - object_name, - cached_type->tp_basicsize, - type->tp_basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - if (PyType_Ready(type) < 0) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) - goto bad; - Py_INCREF(type); - cached_type = type; -done: - Py_DECREF(abi_module); - return cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#else -static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { - PyObject *abi_module, *cached_type = NULL; - const char* object_name = strrchr(spec->name, '.'); - object_name = object_name ? object_name+1 : spec->name; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - cached_type = PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - Py_ssize_t basicsize; -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); - if (unlikely(!py_basicsize)) goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; -#else - basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; -#endif - if (__Pyx_VerifyCachedType( - cached_type, - object_name, - basicsize, - spec->basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); - if (unlikely(!cached_type)) goto bad; - if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; -done: - Py_DECREF(abi_module); - assert(cached_type == NULL || PyType_Check(cached_type)); - return (PyTypeObject *) cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#endif - -/* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL -static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) -{ - PyObject *res = NULL; - PyObject *kwnames; - PyObject **newargs; - PyObject **kwvalues; - Py_ssize_t i, pos; - size_t j; - PyObject *key, *value; - unsigned long keys_are_strings; - Py_ssize_t nkw = PyDict_GET_SIZE(kw); - newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); - if (unlikely(newargs == NULL)) { - PyErr_NoMemory(); - return NULL; - } - for (j = 0; j < nargs; j++) newargs[j] = args[j]; - kwnames = PyTuple_New(nkw); - if (unlikely(kwnames == NULL)) { - PyMem_Free(newargs); - return NULL; - } - kwvalues = newargs + nargs; - pos = i = 0; - keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; - while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; - Py_INCREF(key); - Py_INCREF(value); - PyTuple_SET_ITEM(kwnames, i, key); - kwvalues[i] = value; - i++; - } - if (unlikely(!keys_are_strings)) { - PyErr_SetString(PyExc_TypeError, "keywords must be strings"); - goto cleanup; - } - res = vc(func, newargs, nargs, kwnames); -cleanup: - Py_DECREF(kwnames); - for (i = 0; i < nkw; i++) - Py_DECREF(kwvalues[i]); - PyMem_Free(newargs); - return res; -} -static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) -{ - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { - return vc(func, args, nargs, NULL); - } - return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); -} -#endif - -/* CythonFunctionShared */ -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { - if (__Pyx_CyFunction_Check(func)) { - return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; - } else if (PyCFunction_Check(func)) { - return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; - } - return 0; -} -#else -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { - return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; -} -#endif -static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - __Pyx_Py_XDECREF_SET( - __Pyx_CyFunction_GetClassObj(f), - ((classobj) ? __Pyx_NewRef(classobj) : NULL)); -#else - __Pyx_Py_XDECREF_SET( - ((PyCMethodObject *) (f))->mm_class, - (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); -#endif -} -static PyObject * -__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) -{ - CYTHON_UNUSED_VAR(closure); - if (unlikely(op->func_doc == NULL)) { -#if CYTHON_COMPILING_IN_LIMITED_API - op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); - if (unlikely(!op->func_doc)) return NULL; -#else - if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 - op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif - if (unlikely(op->func_doc == NULL)) - return NULL; - } else { - Py_INCREF(Py_None); - return Py_None; - } -#endif - } - Py_INCREF(op->func_doc); - return op->func_doc; -} -static int -__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (value == NULL) { - value = Py_None; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_doc, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(op->func_name == NULL)) { -#if CYTHON_COMPILING_IN_LIMITED_API - op->func_name = PyObject_GetAttrString(op->func, "__name__"); -#elif PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); -#else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); -#endif - if (unlikely(op->func_name == NULL)) - return NULL; - } - Py_INCREF(op->func_name); - return op->func_name; -} -static int -__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { - PyErr_SetString(PyExc_TypeError, - "__name__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_name, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - Py_INCREF(op->func_qualname); - return op->func_qualname; -} -static int -__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { - PyErr_SetString(PyExc_TypeError, - "__qualname__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_qualname, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(op->func_dict == NULL)) { - op->func_dict = PyDict_New(); - if (unlikely(op->func_dict == NULL)) - return NULL; - } - Py_INCREF(op->func_dict); - return op->func_dict; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_dict, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - Py_INCREF(op->func_globals); - return op->func_globals; -} -static PyObject * -__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(op); - CYTHON_UNUSED_VAR(context); - Py_INCREF(Py_None); - return Py_None; -} -static PyObject * -__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) -{ - PyObject* result = (op->func_code) ? op->func_code : Py_None; - CYTHON_UNUSED_VAR(context); - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { - int result = 0; - PyObject *res = op->defaults_getter((PyObject *) op); - if (unlikely(!res)) - return -1; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - op->defaults_tuple = PyTuple_GET_ITEM(res, 0); - Py_INCREF(op->defaults_tuple); - op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); - Py_INCREF(op->defaults_kwdict); - #else - op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); - if (unlikely(!op->defaults_tuple)) result = -1; - else { - op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); - if (unlikely(!op->defaults_kwdict)) result = -1; - } - #endif - Py_DECREF(res); - return result; -} -static int -__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value) { - value = Py_None; - } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__defaults__ must be set to a tuple object"); - return -1; - } - PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " - "currently affect the values used in function calls", 1); - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->defaults_tuple; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - if (op->defaults_getter) { - if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; - result = op->defaults_tuple; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value) { - value = Py_None; - } else if (unlikely(value != Py_None && !PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__kwdefaults__ must be set to a dict object"); - return -1; - } - PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " - "currently affect the values used in function calls", 1); - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->defaults_kwdict; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - if (op->defaults_getter) { - if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; - result = op->defaults_kwdict; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value || value == Py_None) { - value = NULL; - } else if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__annotations__ must be set to a dict object"); - return -1; - } - Py_XINCREF(value); - __Pyx_Py_XDECREF_SET(op->func_annotations, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->func_annotations; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - result = PyDict_New(); - if (unlikely(!result)) return NULL; - op->func_annotations = result; - } - Py_INCREF(result); - return result; -} -static PyObject * -__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { - int is_coroutine; - CYTHON_UNUSED_VAR(context); - if (op->func_is_coroutine) { - return __Pyx_NewRef(op->func_is_coroutine); - } - is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 - if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; - fromlist = PyList_New(1); - if (unlikely(!fromlist)) return NULL; - Py_INCREF(marker); -#if CYTHON_ASSUME_SAFE_MACROS - PyList_SET_ITEM(fromlist, 0, marker); -#else - if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { - Py_DECREF(marker); - Py_DECREF(fromlist); - return NULL; - } -#endif - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); - Py_DECREF(fromlist); - if (unlikely(!module)) goto ignore; - op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); - Py_DECREF(module); - if (likely(op->func_is_coroutine)) { - return __Pyx_NewRef(op->func_is_coroutine); - } -ignore: - PyErr_Clear(); - } -#endif - op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); - return __Pyx_NewRef(op->func_is_coroutine); -} -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject * -__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { - CYTHON_UNUSED_VAR(context); - return PyObject_GetAttrString(op->func, "__module__"); -} -static int -__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - return PyObject_SetAttrString(op->func, "__module__", value); -} -#endif -static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, -#if CYTHON_COMPILING_IN_LIMITED_API - {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, -#endif - {0, 0, 0, 0, 0} -}; -static PyMemberDef __pyx_CyFunction_members[] = { -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, -#endif -#if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, -#if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, -#else -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, -#endif -#endif -#endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, -#else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, -#endif -#endif - {0, 0, 0, 0, 0} -}; -static PyObject * -__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) -{ - CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 - Py_INCREF(m->func_qualname); - return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif -} -static PyMethodDef __pyx_CyFunction_methods[] = { - {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, - {0, 0, 0, 0} -}; -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API -#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) -#else -#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) -#endif -static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { -#if !CYTHON_COMPILING_IN_LIMITED_API - PyCFunctionObject *cf = (PyCFunctionObject*) op; -#endif - if (unlikely(op == NULL)) - return NULL; -#if CYTHON_COMPILING_IN_LIMITED_API - op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); - if (unlikely(!op->func)) return NULL; -#endif - op->flags = flags; - __Pyx_CyFunction_weakreflist(op) = NULL; -#if !CYTHON_COMPILING_IN_LIMITED_API - cf->m_ml = ml; - cf->m_self = (PyObject *) op; -#endif - Py_XINCREF(closure); - op->func_closure = closure; -#if !CYTHON_COMPILING_IN_LIMITED_API - Py_XINCREF(module); - cf->m_module = module; -#endif - op->func_dict = NULL; - op->func_name = NULL; - Py_INCREF(qualname); - op->func_qualname = qualname; - op->func_doc = NULL; -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - op->func_classobj = NULL; -#else - ((PyCMethodObject*)op)->mm_class = NULL; -#endif - op->func_globals = globals; - Py_INCREF(op->func_globals); - Py_XINCREF(code); - op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; - op->defaults = NULL; - op->defaults_tuple = NULL; - op->defaults_kwdict = NULL; - op->defaults_getter = NULL; - op->func_annotations = NULL; - op->func_is_coroutine = NULL; -#if CYTHON_METH_FASTCALL - switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { - case METH_NOARGS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; - break; - case METH_O: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; - break; - case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; - break; - case METH_FASTCALL | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; - break; - case METH_VARARGS | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = NULL; - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); - Py_DECREF(op); - return NULL; - } -#endif - return (PyObject *) op; -} -static int -__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) -{ - Py_CLEAR(m->func_closure); -#if CYTHON_COMPILING_IN_LIMITED_API - Py_CLEAR(m->func); -#else - Py_CLEAR(((PyCFunctionObject*)m)->m_module); -#endif - Py_CLEAR(m->func_dict); - Py_CLEAR(m->func_name); - Py_CLEAR(m->func_qualname); - Py_CLEAR(m->func_doc); - Py_CLEAR(m->func_globals); - Py_CLEAR(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API -#if PY_VERSION_HEX < 0x030900B1 - Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); -#else - { - PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; - ((PyCMethodObject *) (m))->mm_class = NULL; - Py_XDECREF(cls); - } -#endif -#endif - Py_CLEAR(m->defaults_tuple); - Py_CLEAR(m->defaults_kwdict); - Py_CLEAR(m->func_annotations); - Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } - return 0; -} -static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - if (__Pyx_CyFunction_weakreflist(m) != NULL) - PyObject_ClearWeakRefs((PyObject *) m); - __Pyx_CyFunction_clear(m); - __Pyx_PyHeapTypeObject_GC_Del(m); -} -static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - PyObject_GC_UnTrack(m); - __Pyx__CyFunction_dealloc(m); -} -static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) -{ - Py_VISIT(m->func_closure); -#if CYTHON_COMPILING_IN_LIMITED_API - Py_VISIT(m->func); -#else - Py_VISIT(((PyCFunctionObject*)m)->m_module); -#endif - Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); - Py_VISIT(m->func_doc); - Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API - Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); -#endif - Py_VISIT(m->defaults_tuple); - Py_VISIT(m->defaults_kwdict); - Py_VISIT(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } - return 0; -} -static PyObject* -__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) -{ -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromFormat("", - op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif -} -static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *f = ((__pyx_CyFunctionObject*)func)->func; - PyObject *py_name = NULL; - PyCFunction meth; - int flags; - meth = PyCFunction_GetFunction(f); - if (unlikely(!meth)) return NULL; - flags = PyCFunction_GetFlags(f); - if (unlikely(flags < 0)) return NULL; -#else - PyCFunctionObject* f = (PyCFunctionObject*)func; - PyCFunction meth = f->m_ml->ml_meth; - int flags = f->m_ml->ml_flags; -#endif - Py_ssize_t size; - switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { - case METH_VARARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) - return (*meth)(self, arg); - break; - case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); - case METH_NOARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(arg); -#else - size = PyTuple_Size(arg); - if (unlikely(size < 0)) return NULL; -#endif - if (likely(size == 0)) - return (*meth)(self, NULL); -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif - return NULL; - } - break; - case METH_O: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(arg); -#else - size = PyTuple_Size(arg); - if (unlikely(size < 0)) return NULL; -#endif - if (likely(size == 1)) { - PyObject *result, *arg0; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - arg0 = PyTuple_GET_ITEM(arg, 0); - #else - arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; - #endif - result = (*meth)(self, arg0); - #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(arg0); - #endif - return result; - } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif - return NULL; - } - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); - return NULL; - } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", - py_name); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); -#endif - return NULL; -} -static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *self, *result; -#if CYTHON_COMPILING_IN_LIMITED_API - self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); - if (unlikely(!self) && PyErr_Occurred()) return NULL; -#else - self = ((PyCFunctionObject*)func)->m_self; -#endif - result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); - return result; -} -static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { - PyObject *result; - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL - __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); - if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS - return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); -#else - (void) &__Pyx_PyVectorcall_FastCallDict; - return PyVectorcall_Call(func, args, kw); -#endif - } -#endif - if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { - Py_ssize_t argc; - PyObject *new_args; - PyObject *self; -#if CYTHON_ASSUME_SAFE_MACROS - argc = PyTuple_GET_SIZE(args); -#else - argc = PyTuple_Size(args); - if (unlikely(!argc) < 0) return NULL; -#endif - new_args = PyTuple_GetSlice(args, 1, argc); - if (unlikely(!new_args)) - return NULL; - self = PyTuple_GetItem(args, 0); - if (unlikely(!self)) { - Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 - PyErr_Format(PyExc_TypeError, - "unbound method %.200S() needs an argument", - cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif - return NULL; - } - result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); - Py_DECREF(new_args); - } else { - result = __Pyx_CyFunction_Call(func, args, kw); - } - return result; -} -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) -{ - int ret = 0; - if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { - if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); - return -1; - } - ret = 1; - } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); - return -1; - } - return ret; -} -static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); - return NULL; - } - return def->ml_meth(self, NULL); -} -static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); - return NULL; - } - return def->ml_meth(self, args[0]); -} -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); -} -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; - PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); -} -#endif -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_CyFunctionType_slots[] = { - {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, - {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, - {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, - {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, - {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, - {Py_tp_methods, (void *)__pyx_CyFunction_methods}, - {Py_tp_members, (void *)__pyx_CyFunction_members}, - {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, - {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, - {0, 0}, -}; -static PyType_Spec __pyx_CyFunctionType_spec = { - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) - _Py_TPFLAGS_HAVE_VECTORCALL | -#endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - __pyx_CyFunctionType_slots -}; -#else -static PyTypeObject __pyx_CyFunctionType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, - (destructor) __Pyx_CyFunction_dealloc, -#if !CYTHON_METH_FASTCALL - 0, -#elif CYTHON_BACKPORT_VECTORCALL - (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), -#else - offsetof(PyCFunctionObject, vectorcall), -#endif - 0, - 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else - 0, -#endif - (reprfunc) __Pyx_CyFunction_repr, - 0, - 0, - 0, - 0, - __Pyx_CyFunction_CallAsMethod, - 0, - 0, - 0, - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL - _Py_TPFLAGS_HAVE_VECTORCALL | -#endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - 0, - (traverseproc) __Pyx_CyFunction_traverse, - (inquiry) __Pyx_CyFunction_clear, - 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else - offsetof(PyCFunctionObject, m_weakreflist), -#endif - 0, - 0, - __pyx_CyFunction_methods, - __pyx_CyFunction_members, - __pyx_CyFunction_getsets, - 0, - 0, - __Pyx_PyMethod_New, - 0, - offsetof(__pyx_CyFunctionObject, func_dict), - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, -#endif -}; -#endif -static int __pyx_CyFunction_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); -#endif - if (unlikely(__pyx_CyFunctionType == NULL)) { - return -1; - } - return 0; -} -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); - if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; - return m->defaults; -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_tuple = tuple; - Py_INCREF(tuple); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_kwdict = dict; - Py_INCREF(dict); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->func_annotations = dict; - Py_INCREF(dict); -} - -/* CythonFunction */ -static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { - PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), - ml, flags, qualname, closure, module, globals, code - ); - if (likely(op)) { - PyObject_GC_Track(op); - } - return op; -} - -/* RaiseMappingExpected */ -static void __Pyx_RaiseMappingExpectedError(PyObject* arg) { - __Pyx_TypeName arg_type_name = __Pyx_PyType_GetName(Py_TYPE(arg)); - PyErr_Format(PyExc_TypeError, - "'" __Pyx_FMT_TYPENAME "' object is not a mapping", arg_type_name); - __Pyx_DECREF_TypeName(arg_type_name); -} - -/* CLineInTraceback */ -#ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { - PyObject *use_cline; - PyObject *ptype, *pvalue, *ptraceback; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject **cython_runtime_dict; -#endif - CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { - return c_line; - } - __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); -#if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); - if (likely(cython_runtime_dict)) { - __PYX_PY_DICT_LOOKUP_IF_MODIFIED( - use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) - } else -#endif - { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); - if (use_cline_obj) { - use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; - Py_DECREF(use_cline_obj); - } else { - PyErr_Clear(); - use_cline = NULL; - } - } - if (!use_cline) { - c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); - } - else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { - c_line = 0; - } - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - return c_line; -} -#endif - -/* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} -#endif - -/* AddTraceback */ -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, - PyObject *firstlineno, PyObject *name) { - PyObject *replace = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; - replace = PyObject_GetAttrString(code, "replace"); - if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); - Py_DECREF(replace); - return result; - } - PyErr_Clear(); - #if __PYX_LIMITED_VERSION_HEX < 0x030780000 - { - PyObject *compiled = NULL, *result = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; - compiled = Py_CompileString( - "out = type(code)(\n" - " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" - " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" - " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" - " code.co_lnotab)\n", "", Py_file_input); - if (!compiled) return NULL; - result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); - Py_DECREF(compiled); - if (!result) PyErr_Print(); - Py_DECREF(result); - result = PyDict_GetItemString(scratch_dict, "out"); - if (result) Py_INCREF(result); - return result; - } - #else - return NULL; - #endif -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; - PyObject *replace = NULL, *getframe = NULL, *frame = NULL; - PyObject *exc_type, *exc_value, *exc_traceback; - int success = 0; - if (c_line) { - (void) __pyx_cfilenm; - (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); - } - PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - if (unlikely(!code_object)) goto bad; - py_py_line = PyLong_FromLong(py_line); - if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); - } - if (unlikely(!code_object)) goto bad; - getframe = PySys_GetObject("_getframe"); - if (unlikely(!getframe)) goto bad; - if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; - frame = PyEval_EvalCode(code_object, dict, dict); - if (unlikely(!frame) || frame == Py_None) goto bad; - success = 1; - bad: - PyErr_Restore(exc_type, exc_value, exc_traceback); - Py_XDECREF(code_object); - Py_XDECREF(py_py_line); - Py_XDECREF(py_funcname); - Py_XDECREF(dict); - Py_XDECREF(replace); - if (success) { - PyTraceBack_Here( - (struct _frame*)frame); - } - Py_XDECREF(frame); -} -#else -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = NULL; - PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - funcname = PyUnicode_AsUTF8(py_funcname); - if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif - } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else - py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif - Py_XDECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject *ptype, *pvalue, *ptraceback; - if (c_line) { - c_line = __Pyx_CLineForTraceback(tstate, c_line); - } - py_code = __pyx_find_code_object(c_line ? -c_line : py_line); - if (!py_code) { - __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) { - /* If the code object creation fails, then we should clear the - fetched exception references and propagate the new exception */ - Py_XDECREF(ptype); - Py_XDECREF(pvalue); - Py_XDECREF(ptraceback); - goto bad; - } - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); - } - py_frame = PyFrame_New( - tstate, /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - __Pyx_PyFrame_SetLineNumber(py_frame, py_line); - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} -#endif - -/* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API -static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) -{ - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__49); - } - return name; -} -#endif - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); -#else - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); - if (!from_bytes) return NULL; - py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); - if (!py_bytes) goto limited_bad; - order_str = PyUnicode_FromString(little ? "little" : "big"); - if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; - } - result = PyObject_Call(from_bytes, arg_tuple, kwds); - limited_bad: - Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); - Py_XDECREF(order_str); - Py_XDECREF(py_bytes); - Py_XDECREF(from_bytes); - return result; -#endif - } -} - -/* CIntFromPyVerify */ -#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(long) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(long) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (long) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (long) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (long) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (long) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int neg_one = (int) -1, const_zero = (int) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(int) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(int) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (int) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (int) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (int) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (int) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* FastTypeChecks */ -#if CYTHON_COMPILING_IN_CPYTHON -static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { - while (a) { - a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); - if (a == b) - return 1; - } - return b == &PyBaseObject_Type; -} -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (a == b) return 1; - mro = a->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(a, b); -} -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (cls == a || cls == b) return 1; - mro = cls->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - PyObject *base = PyTuple_GET_ITEM(mro, i); - if (base == (PyObject *)a || base == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); -} -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else -static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { - if (exc_type1) { - return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); - } else { - return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); - } -} -#endif -static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - assert(PyExceptionClass_Check(exc_type)); - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; i= 0x030B00A4 - return Py_Version & ~0xFFUL; -#else - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); - ++i; - } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; - } - return version; -#endif -} -static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { - const unsigned long MAJOR_MINOR = 0xFFFF0000UL; - if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) - return 0; - if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) - return 1; - { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compile time Python version %d.%d " - "of module '%.100s' " - "%s " - "runtime version %d.%d", - (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), - __Pyx_MODULE_NAME, - (allow_newer) ? "was newer than" : "does not match", - (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) - ); - return PyErr_WarnEx(NULL, message, 1); - } -} - -/* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); - } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); - } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); - } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} -#endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - if (!*t->p) - return -1; - if (PyObject_Hash(*t->p) == -1) - return -1; - #endif - ++t; - } - return 0; -} - -#include -static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { - size_t len = strlen(s); - if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { - PyErr_SetString(PyExc_OverflowError, "byte string is too long"); - return -1; - } - return (Py_ssize_t) len; -} -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - Py_ssize_t len = __Pyx_ssize_strlen(c_str); - if (unlikely(len < 0)) return NULL; - return __Pyx_PyUnicode_FromStringAndSize(c_str, len); -} -static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { - Py_ssize_t len = __Pyx_ssize_strlen(c_str); - if (unlikely(len < 0)) return NULL; - return PyByteArray_FromStringAndSize(c_str, len); -} -static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} -#else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (likely(PyUnicode_IS_ASCII(o))) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -} -#endif -#endif -static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { - return __Pyx_PyUnicode_AsStringAndSize(o, length); - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { - int retval; - if (unlikely(!x)) return -1; - retval = __Pyx_PyObject_IsTrue(x); - Py_DECREF(x); - return retval; -} -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 - if (PyLong_Check(result)) { - if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, - "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " - "The ability to return an instance of a strict subclass of int is deprecated, " - "and may be removed in a future version of Python.", - result_type_name)) { - __Pyx_DECREF_TypeName(result_type_name); - Py_DECREF(result); - return NULL; - } - __Pyx_DECREF_TypeName(result_type_name); - return result; - } -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); - __Pyx_DECREF_TypeName(result_type_name); - Py_DECREF(result); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { -#if CYTHON_USE_TYPE_SLOTS - PyNumberMethods *m; -#endif - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else - if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); -#if CYTHON_USE_TYPE_SLOTS - m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else - if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); - } - #endif -#else - if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); - } -#endif - if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(__Pyx_PyLong_IsCompact(b))) { - return __Pyx_PyLong_CompactValue(b); - } else { - const digit* digits = __Pyx_PyLong_Digits(b); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { - if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { - return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif - } else { - Py_ssize_t ival; - PyObject *x; - x = PyNumber_Index(o); - if (!x) return -1; - ival = PyInt_AsLong(x); - Py_DECREF(x); - return ival; - } -} -static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { - return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -/* #### Code section: utility_code_pragmas_end ### */ -#ifdef _MSC_VER -#pragma warning( pop ) -#endif - - - -/* #### Code section: end ### */ -#endif /* Py_PYTHON_H */ diff --git a/w3lib/_encoding.pyx b/w3lib/_encoding.pyx deleted file mode 100644 index 2172bbf6..00000000 --- a/w3lib/_encoding.pyx +++ /dev/null @@ -1,453 +0,0 @@ -# https://encoding.spec.whatwg.org/ - -import codecs -from functools import lru_cache -from typing import AnyStr, Callable, Dict, Tuple - -from ._infra import _ASCII_WHITESPACE - - -CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] -DecodeFunction = Callable[[bytes], Tuple[str, int]] -EncodeFunction = Callable[[str, str], Tuple[bytes, int]] - - -def _short_windows_125(last_digit: int) -> Dict[str, str]: - return { - label: f"windows-125{last_digit}" - for label in ( - f"cp125{last_digit}", - f"windows-125{last_digit}", - f"x-cp125{last_digit}", - ) - } - - -_REPLACEMENT_ENCODING = "replacement" -_UTF_8_ENCODING = "utf-8" -_UTF_16BE_ENCODING = "utf-16be" -_UTF_16LE_ENCODING = "utf-16le" - -# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get -# -# Maps the labels defined in the standard to an encoding label that Python -# understands. -_LABEL_ENCODINGS = { - **{ - label: _UTF_8_ENCODING - for label in ( - "unicode-1-1-utf-8", - "unicode11utf8", - "unicode20utf8", - "utf-8", - "utf8", - "x-unicode20utf8", - ) - }, - **{ - label: "ibm866" - for label in ( - "866", - "cp866", - "csibm866", - "ibm866", - ) - }, - **{ - label: "iso-8859-2" - for label in ( - "csisolatin2", - "iso-8859-2", - "iso-ir-101", - "iso8859-2", - "iso88592", - "iso_8859-2", - "iso_8859-2:1987", - "l2", - "latin2", - ) - }, - **{ - label: "iso-8859-3" - for label in ( - "csisolatin3", - "iso-8859-3", - "iso-ir-109", - "iso8859-3", - "iso88593", - "iso_8859-3", - "iso_8859-3:1988", - "l3", - "latin3", - ) - }, - **{ - label: "iso-8859-4" - for label in ( - "csisolatin4", - "iso-8859-4", - "iso-ir-110", - "iso8859-4", - "iso88594", - "iso_8859-4", - "iso_8859-4:1988", - "l4", - "latin4", - ) - }, - **{ - label: "iso-8859-5" - for label in ( - "csisolatincyrillic", - "cyrillic", - "iso-8859-5", - "iso-ir-144", - "iso8859-5", - "iso88595", - "iso_8859-5", - "iso_8859-5:1988", - ) - }, - **{ - label: "iso-8859-6" - for label in ( - "arabic", - "asmo-708", - "csiso88596e", - "csiso88596i", - "csisolatinarabic", - "ecma-114", - "iso-8859-6", - "iso-8859-6-e", - "iso-8859-6-i", - "iso-ir-127", - "iso8859-6", - "iso88596", - "iso_8859-6", - "iso_8859-6:1987", - ) - }, - **{ - label: "iso-8859-7" - for label in ( - "csisolatingreek", - "ecma-118", - "elot_928", - "greek", - "greek8", - "iso-8859-7", - "iso-ir-126", - "iso8859-7", - "iso88597", - "iso_8859-7", - "iso_8859-7:1987", - "sun_eu_greek", - ) - }, - **{ - label: "iso-8859-8" - for label in ( - "csiso88598e", - "csisolatinhebrew", - "hebrew", - "iso-8859-8", - "iso-8859-8-e", - "iso-ir-138", - "iso8859-8", - "iso88598", - "iso_8859-8", - "iso_8859-8:1988", - "visual", - ) - }, - **{ - label: "iso-8859-8-i" - for label in ( - "csiso88598i", - "iso-8859-8-i", - "logical", - ) - }, - **{ - label: "iso-8859-10" - for label in ( - "csisolatin6", - "iso-8859-10", - "iso-ir-157", - "iso8859-10", - "iso885910", - "l6", - "latin6", - ) - }, - **{ - label: "iso-8859-10" - for label in ( - "csisolatin6", - "iso-8859-10", - "iso-ir-157", - "iso8859-10", - "iso885910", - "l6", - "latin6", - ) - }, - **{ - label: "iso-8859-13" - for label in ( - "iso-8859-13", - "iso8859-13", - "iso885913", - ) - }, - **{ - label: "iso-8859-14" - for label in ( - "iso-8859-14", - "iso8859-14", - "iso885914", - ) - }, - **{ - label: "iso-8859-15" - for label in ( - "csisolatin9", - "iso-8859-15", - "iso8859-15", - "iso885915", - "iso_8859-15", - "l9", - ) - }, - "iso-8859-16": "iso-8859-16", - **{ - label: "koi8-r" - for label in ( - "cskoi8r", - "koi", - "koi8", - "koi8-r", - "koi8_r", - ) - }, - **{ - label: "koi8-u" - for label in ( - "koi8-ru", - "koi8-u", - ) - }, - **{ - label: "macintosh" - for label in ( - "csmacintosh", - "mac", - "macintosh", - "x-mac-roman", - ) - }, - **{ - label: "cp874" - for label in ( - "dos-874", - "iso-8859-11", - "iso8859-11", - "iso885911", - "tis-620", - "windows-874", - ) - }, - **_short_windows_125(0), - **_short_windows_125(1), - **{ - label: "windows-1252" - for label in ( - "ansi_x3.4-1968", - "ascii", - "cp1252", - "cp819", - "csisolatin1", - "ibm819", - "iso-8859-1", - "iso-ir-100", - "iso8859-1", - "iso88591", - "iso_8859-1", - "iso_8859-1:1987", - "l1", - "latin1", - "us-ascii", - "windows-1252", - "x-cp1252", - ) - }, - **_short_windows_125(3), - **{ - label: "windows-1254" - for label in ( - "cp1254", - "csisolatin5", - "iso-8859-9", - "iso-ir-148", - "iso8859-9", - "iso88599", - "iso_8859-9", - "iso_8859-9:1989", - "l5", - "latin5", - "windows-1254", - "x-cp1254", - ) - }, - **_short_windows_125(5), - **_short_windows_125(6), - **_short_windows_125(7), - **_short_windows_125(8), - **{ - label: "mac-cyrillic" - for label in ( - "x-mac-cyrillic", - "x-mac-ukrainian", - ) - }, - **{ - label: "gbk" - for label in ( - "chinese", - "csgb2312", - "csiso58gb231280", - "gb2312", - "gb_2312", - "gb_2312-80", - "gbk", - "iso-ir-58", - "x-gbk", - ) - }, - "gb18030": "gb18030", - **{ - label: "big5" - for label in ( - "big5", - "big5-hkscs", - "cn-big5", - "csbig5", - "x-x-big5", - ) - }, - **{ - label: "euc-jp" - for label in ( - "cseucpkdfmtjapanese", - "euc-jp", - "x-euc-jp", - ) - }, - **{ - label: "iso-2022-jp" - for label in ( - "csiso2022jp", - "iso-2022-jp", - ) - }, - **{ - label: "shift_jis" - for label in ( - "csshiftjis", - "ms932", - "ms_kanji", - "shift-jis", - "shift_jis", - "sjis", - "windows-31j", - "x-sjis", - ) - }, - **{ - label: "euc-kr" - for label in ( - "cseuckr", - "csksc56011987", - "euc-kr", - "iso-ir-149", - "korean", - "ks_c_5601-1987", - "ks_c_5601-1989", - "ksc5601", - "ksc_5601", - "windows-949", - ) - }, - **{ - label: _REPLACEMENT_ENCODING - for label in ( - "csiso2022kr", - "hz-gb-2312", - "iso-2022-cn", - "iso-2022-cn-ext", - "iso-2022-kr", - "replacement", - ) - }, - **{ - label: _UTF_16BE_ENCODING - for label in ( - "unicodefffe", - "utf-16be", - ) - }, - **{ - label: _UTF_16LE_ENCODING - for label in ( - "csunicode", - "iso-10646-ucs-2", - "ucs-2", - "unicode", - "unicodefeff", - "utf-16", - "utf-16le", - ) - }, - "x-user-defined": "x-user-defined", -} - - -# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder -@lru_cache(maxsize=None) -def _get_encoder(encoding: str) -> EncodeFunction: - codec_info = codecs.lookup(encoding) - return codec_info.encode - - -_UTF_8_ENCODER = _get_encoder("utf-8") - - -# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get -@lru_cache(maxsize=None) -def _get_encoding(label: str) -> str: - label = label.strip(_ASCII_WHITESPACE).lower() - try: - encoding = _LABEL_ENCODINGS[label] - except KeyError: - raise ValueError( - f"{label!r} does not match any encoding label from the Encoding " - f"Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721" - f"bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)" - ) - return encoding - - -_OUTPUT_ENCODING_UTF8_ENCODINGS = ( - _REPLACEMENT_ENCODING, - _UTF_16BE_ENCODING, - _UTF_16LE_ENCODING, -) - - -# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings -@lru_cache(maxsize=None) -def _get_output_encoding(encoding: str) -> str: - encoding = _get_encoding(encoding) - if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: - return _UTF_8_ENCODING - return encoding diff --git a/w3lib/_url.c b/w3lib/_url.c index c83e476d..2b1ffa7b 100644 --- a/w3lib/_url.c +++ b/w3lib/_url.c @@ -1,17 +1,5 @@ /* Generated by Cython 3.0.8 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "name": "w3lib._url", - "sources": [ - "w3lib/_url.pyx" - ] - }, - "module_name": "w3lib._url" -} -END: Cython Metadata */ - #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ @@ -1491,7 +1479,7 @@ struct __pyx_defaults1 { PyObject *__pyx_arg_min_length; }; -/* "w3lib/_url.pyx":308 +/* "w3lib/_url.pyx":757 * parts = parts[:-1] * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< @@ -1505,7 +1493,7 @@ struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr { }; -/* "w3lib/_url.pyx":328 +/* "w3lib/_url.pyx":777 * result = _parse_ipv4_number(part) * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< @@ -1741,24 +1729,34 @@ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); -/* PyObjectSetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); -#else -#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) -#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) -#endif - -/* RaiseUnexpectedTypeError.proto */ -static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); - /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); +/* PyObjectFormatSimple.proto */ +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#elif PY_MAJOR_VERSION < 3 + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ + PyObject_Format(s, f)) +#elif CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\ + likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\ + PyObject_Format(s, f)) +#else + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#endif + /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) @@ -1806,34 +1804,6 @@ static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_ve static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif -/* PySequenceContains.proto */ -static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { - int result = PySequence_Contains(seq, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - -/* GetItemInt.proto */ -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ - __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL @@ -1885,6 +1855,126 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod1.proto */ +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + +/* RaiseUnexpectedTypeError.proto */ +static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) +#else +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectFormatAndDecref.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); + +/* UnicodeConcatInPlace.proto */ +# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_REFNANNY + #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) + #else + #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right) + #endif + static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right + #if CYTHON_REFNANNY + , void* __pyx_refnanny + #endif + ); +#else +#define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat +#endif +#define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right)) + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, @@ -1906,9 +1996,6 @@ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); @@ -1934,9 +2021,6 @@ static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f); #define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f) #endif -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); @@ -2006,33 +2090,9 @@ static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py /* RaiseUnboundLocalError.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); -/* GetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); -#endif - /* pep479.proto */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); -/* GetTopmostException.proto */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); -#endif - -/* SaveResetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -#else -#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) -#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) -#endif - /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { @@ -2071,10 +2131,6 @@ static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long int (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif -/* PyObjectFormatAndDecref.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); -static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); - /* JoinPyUnicode.proto */ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); @@ -2083,23 +2139,6 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co static int __Pyx_PyUnicode_Tailmatch( PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction); -/* UnpackUnboundCMethod.proto */ -typedef struct { - PyObject *type; - PyObject **method_name; - PyCFunction func; - PyObject *method; - int flag; -} __Pyx_CachedCFunction; - -/* CallUnboundCMethod1.proto */ -static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); -#else -#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) -#endif - /* PyUnicodeContains.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_ContainsTF(PyObject* substring, PyObject* text, int eq) { int result = PyUnicode_Contains(text, substring); @@ -2138,52 +2177,12 @@ static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long i (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) #endif -/* UnicodeConcatInPlace.proto */ -# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 - #if CYTHON_REFNANNY - #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) - #else - #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right) - #endif - static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right - #if CYTHON_REFNANNY - , void* __pyx_refnanny - #endif - ); -#else -#define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat -#endif -#define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ - PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right)) - -/* PyObjectFormatSimple.proto */ -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - PyObject_Format(s, f)) -#elif PY_MAJOR_VERSION < 3 - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ - PyObject_Format(s, f)) -#elif CYTHON_USE_TYPE_SLOTS - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\ - likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\ - PyObject_Format(s, f)) -#else - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - PyObject_Format(s, f)) -#endif - -/* IncludeStructmemberH.proto */ -#include - -/* FixUpExtensionType.proto */ -#if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); +/* IncludeStructmemberH.proto */ +#include + +/* FixUpExtensionType.proto */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ @@ -2210,31 +2209,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* UnicodeAsUCS4.proto */ -static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*); - -/* object_ord.proto */ +/* ImportDottedModule.proto */ +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #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) +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif -static long __Pyx__PyObject_Ord(PyObject* c); -/* SetNameInClass.proto */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 -#define __Pyx_SetNameInClass(ns, name, value)\ - (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) -#elif CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_SetNameInClass(ns, name, value)\ - (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) -#else -#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) -#endif +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); @@ -2376,6 +2358,32 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, PyObject *module, PyObject *globals, PyObject* code); +/* RaiseMappingExpected.proto */ +static void __Pyx_RaiseMappingExpectedError(PyObject* arg); + +/* 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); + +/* SetNameInClass.proto */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) +#elif CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) +#else +#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) +#endif + /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); @@ -2564,7 +2572,59 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "w3lib._url" */ -static PyObject *__pyx_7genexpr__pyx_v_5w3lib_4_url_char; +static unsigned char __pyx_v_5w3lib_4_url_SCHEME_START; +static unsigned char __pyx_v_5w3lib_4_url_SCHEME; +static unsigned char __pyx_v_5w3lib_4_url_NO_SCHEME; +static unsigned char __pyx_v_5w3lib_4_url_SPECIAL_RELATIVE_OR_AUTHORITY; +static unsigned char __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY; +static unsigned char __pyx_v_5w3lib_4_url_RELATIVE; +static unsigned char __pyx_v_5w3lib_4_url_RELATIVE_SLASH; +static unsigned char __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES; +static unsigned char __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; +static unsigned char __pyx_v_5w3lib_4_url_AUTHORITY; +static unsigned char __pyx_v_5w3lib_4_url_HOST; +static unsigned char __pyx_v_5w3lib_4_url_PORT; +static unsigned char __pyx_v_5w3lib_4_url_FILE; +static unsigned char __pyx_v_5w3lib_4_url_FILE_SLASH; +static unsigned char __pyx_v_5w3lib_4_url_FILE_HOST; +static unsigned char __pyx_v_5w3lib_4_url_PATH_START; +static unsigned char __pyx_v_5w3lib_4_url_PATH; +static unsigned char __pyx_v_5w3lib_4_url_OPAQUE_PATH; +static unsigned char __pyx_v_5w3lib_4_url_QUERY; +static unsigned char __pyx_v_5w3lib_4_url_FRAGMENT; +static PyObject *__pyx_8genexpr1__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_8genexpr2__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_8genexpr3__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_8genexpr4__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_8genexpr5__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_8genexpr6__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_8genexpr7__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_8genexpr8__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_8genexpr9__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr10__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr11__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr12__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr13__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr14__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr15__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr16__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr17__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr18__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr19__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr20__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr21__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr22__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr23__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr24__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr25__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr26__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr27__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr28__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr29__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr30__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr31__pyx_v_5w3lib_4_url_label; +static PyObject *__pyx_9genexpr32__pyx_v_5w3lib_4_url_char; +static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "w3lib._url" @@ -2574,9 +2634,10 @@ int __pyx_module_is_main_w3lib___url = 0; /* Implementation of "w3lib._url" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_property; +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_chr; -static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_enumerate; @@ -2600,8 +2661,16 @@ static const char __pyx_k__6[] = "."; static const char __pyx_k__8[] = "["; static const char __pyx_k__9[] = "]"; static const char __pyx_k_gc[] = "gc"; +static const char __pyx_k_l1[] = "l1"; +static const char __pyx_k_l2[] = "l2"; +static const char __pyx_k_l3[] = "l3"; +static const char __pyx_k_l4[] = "l4"; +static const char __pyx_k_l5[] = "l5"; +static const char __pyx_k_l6[] = "l6"; +static const char __pyx_k_l9[] = "l9"; static const char __pyx_k_ws[] = "ws"; static const char __pyx_k_02X[] = "02X"; +static const char __pyx_k_866[] = "866"; static const char __pyx_k_URL[] = "_URL"; static const char __pyx_k__10[] = ".."; static const char __pyx_k__11[] = "/"; @@ -2616,21 +2685,25 @@ static const char __pyx_k__19[] = "?#"; static const char __pyx_k__21[] = "::"; static const char __pyx_k__22[] = "//"; static const char __pyx_k__23[] = "/."; -static const char __pyx_k__30[] = "+-."; -static const char __pyx_k__33[] = "_"; -static const char __pyx_k__36[] = "~"; -static const char __pyx_k__37[] = " \"<>`"; -static const char __pyx_k__38[] = " \"#<>"; -static const char __pyx_k__39[] = "'"; -static const char __pyx_k__40[] = "?`{}"; -static const char __pyx_k__41[] = "/:;=@[\\]^|"; -static const char __pyx_k__42[] = "\000\t\n\r #/:<>?@[\\]^|"; -static const char __pyx_k__43[] = "%"; +static const char __pyx_k__24[] = "*"; +static const char __pyx_k__75[] = "+-."; +static const char __pyx_k__78[] = "_"; +static const char __pyx_k__81[] = "~"; +static const char __pyx_k__82[] = " \"<>`"; +static const char __pyx_k__83[] = " \"#<>"; +static const char __pyx_k__84[] = "'"; +static const char __pyx_k__85[] = "?`{}"; +static const char __pyx_k__86[] = "/:;=@[\\]^|"; +static const char __pyx_k__87[] = "\000\t\n\r #/:<>?@[\\]^|"; +static const char __pyx_k__88[] = "%"; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_ftp[] = "ftp"; +static const char __pyx_k_gbk[] = "gbk"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_int[] = "int"; +static const char __pyx_k_koi[] = "koi"; +static const char __pyx_k_mac[] = "mac"; static const char __pyx_k_str[] = "str"; static const char __pyx_k_url[] = "url"; static const char __pyx_k_wss[] = "wss"; @@ -2638,14 +2711,12 @@ static const char __pyx_k_2E_2[] = "%2E."; static const char __pyx_k_2E_3[] = "%2E"; static const char __pyx_k_2e_2[] = "%2e."; static const char __pyx_k_2e_3[] = "%2e"; -static const char __pyx_k_FILE[] = "FILE"; -static const char __pyx_k_HOST[] = "HOST"; +static const char __pyx_k_Dict[] = "Dict"; static const char __pyx_k_List[] = "List"; static const char __pyx_k_None[] = "None"; -static const char __pyx_k_PATH[] = "PATH"; -static const char __pyx_k_PORT[] = "PORT"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "base"; +static const char __pyx_k_big5[] = "big5"; static const char __pyx_k_bool[] = "bool"; static const char __pyx_k_byte[] = "byte"; static const char __pyx_k_dict[] = "__dict__"; @@ -2655,6 +2726,7 @@ static const char __pyx_k_http[] = "http"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_ipv4[] = "ipv4"; static const char __pyx_k_keys[] = "keys"; +static const char __pyx_k_koi8[] = "koi8"; static const char __pyx_k_last[] = "last"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_math[] = "math"; @@ -2664,22 +2736,32 @@ static const char __pyx_k_path[] = "path"; static const char __pyx_k_port[] = "port"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_send[] = "send"; +static const char __pyx_k_sjis[] = "sjis"; +static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_utf8[] = "utf8"; static const char __pyx_k_util[] = "_util"; static const char __pyx_k_2E_2E[] = "%2E%2E"; static const char __pyx_k_2E_2e[] = "%2E%2e"; static const char __pyx_k_2e_2E[] = "%2e%2E"; static const char __pyx_k_2e_2e[] = "%2e%2e"; -static const char __pyx_k_QUERY[] = "QUERY"; static const char __pyx_k_Tuple[] = "Tuple"; static const char __pyx_k_Union[] = "Union"; +static const char __pyx_k_ascii[] = "ascii"; static const char __pyx_k_close[] = "close"; +static const char __pyx_k_cp125[] = "cp125"; +static const char __pyx_k_cp819[] = "cp819"; +static const char __pyx_k_cp866[] = "cp866"; +static const char __pyx_k_cp874[] = "cp874"; static const char __pyx_k_floor[] = "floor"; +static const char __pyx_k_greek[] = "greek"; static const char __pyx_k_https[] = "https"; static const char __pyx_k_index[] = "index"; static const char __pyx_k_infra[] = "_infra"; static const char __pyx_k_input[] = "input"; +static const char __pyx_k_label[] = "label"; static const char __pyx_k_lower[] = "lower"; +static const char __pyx_k_ms932[] = "ms932"; static const char __pyx_k_parts[] = "parts"; static const char __pyx_k_piece[] = "piece"; static const char __pyx_k_query[] = "query"; @@ -2689,16 +2771,41 @@ static const char __pyx_k_strip[] = "strip"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_swaps[] = "swaps"; static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_ucs_2[] = "ucs-2"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_utr46[] = "_utr46"; static const char __pyx_k_value[] = "value"; -static const char __pyx_k_SCHEME[] = "SCHEME"; +static const char __pyx_k_x_gbk[] = "x-gbk"; +static const char __pyx_k_AnyStr[] = "AnyStr"; static const char __pyx_k_append[] = "append"; +static const char __pyx_k_arabic[] = "arabic"; static const char __pyx_k_buffer[] = "buffer"; +static const char __pyx_k_codecs[] = "codecs"; +static const char __pyx_k_cp1252[] = "cp1252"; +static const char __pyx_k_cp1254[] = "cp1254"; +static const char __pyx_k_csbig5[] = "csbig5"; static const char __pyx_k_domain[] = "domain"; static const char __pyx_k_enable[] = "enable"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_euc_jp[] = "euc-jp"; +static const char __pyx_k_euc_kr[] = "euc-kr"; +static const char __pyx_k_gb2312[] = "gb2312"; +static const char __pyx_k_greek8[] = "greek8"; +static const char __pyx_k_hebrew[] = "hebrew"; +static const char __pyx_k_ibm819[] = "ibm819"; +static const char __pyx_k_ibm866[] = "ibm866"; static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_koi8_r[] = "koi8-r"; +static const char __pyx_k_koi8_u[] = "koi8-u"; +static const char __pyx_k_korean[] = "korean"; +static const char __pyx_k_latin1[] = "latin1"; +static const char __pyx_k_latin2[] = "latin2"; +static const char __pyx_k_latin3[] = "latin3"; +static const char __pyx_k_latin4[] = "latin4"; +static const char __pyx_k_latin5[] = "latin5"; +static const char __pyx_k_latin6[] = "latin6"; static const char __pyx_k_length[] = "length"; +static const char __pyx_k_lookup[] = "lookup"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_number[] = "number"; static const char __pyx_k_output[] = "output"; @@ -2707,59 +2814,147 @@ static const char __pyx_k_return[] = "return"; static const char __pyx_k_scheme[] = "_scheme"; static const char __pyx_k_setter[] = "setter"; static const char __pyx_k_typing[] = "typing"; +static const char __pyx_k_utf_16[] = "utf-16"; +static const char __pyx_k_visual[] = "visual"; +static const char __pyx_k_x_sjis[] = "x-sjis"; static const char __pyx_k_address[] = "address"; +static const char __pyx_k_chinese[] = "chinese"; +static const char __pyx_k_cn_big5[] = "cn-big5"; static const char __pyx_k_counter[] = "counter"; +static const char __pyx_k_cseuckr[] = "cseuckr"; +static const char __pyx_k_cskoi8r[] = "cskoi8r"; static const char __pyx_k_disable[] = "disable"; +static const char __pyx_k_dos_874[] = "dos-874"; static const char __pyx_k_encoded[] = "encoded"; static const char __pyx_k_encoder[] = "encoder"; +static const char __pyx_k_gb18030[] = "gb18030"; +static const char __pyx_k_gb_2312[] = "gb_2312"; static const char __pyx_k_genexpr[] = "genexpr"; static const char __pyx_k_ignore0[] = "ignore0"; +static const char __pyx_k_koi8_ru[] = "koi8-ru"; +static const char __pyx_k_ksc5601[] = "ksc5601"; +static const char __pyx_k_logical[] = "logical"; +static const char __pyx_k_maxsize[] = "maxsize"; static const char __pyx_k_numbers[] = "numbers"; static const char __pyx_k_pointer[] = "pointer"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_segment[] = "segment"; +static const char __pyx_k_tis_620[] = "tis-620"; +static const char __pyx_k_unicode[] = "unicode"; static const char __pyx_k_unquote[] = "unquote"; -static const char __pyx_k_FRAGMENT[] = "FRAGMENT"; +static const char __pyx_k_x_cp125[] = "x-cp125"; +static const char __pyx_k_Callable[] = "Callable"; +static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_List_int[] = "List[int]"; static const char __pyx_k_Optional[] = "Optional"; -static const char __pyx_k_RELATIVE[] = "RELATIVE"; +static const char __pyx_k_asmo_708[] = "asmo-708"; static const char __pyx_k_base_url[] = "base_url"; static const char __pyx_k_compress[] = "compress"; +static const char __pyx_k_csgb2312[] = "csgb2312"; +static const char __pyx_k_csibm866[] = "csibm866"; +static const char __pyx_k_cyrillic[] = "cyrillic"; +static const char __pyx_k_ecma_114[] = "ecma-114"; +static const char __pyx_k_ecma_118[] = "ecma-118"; +static const char __pyx_k_elot_928[] = "elot_928"; static const char __pyx_k_encoding[] = "encoding"; static const char __pyx_k_fragment[] = "fragment"; static const char __pyx_k_hostname[] = "hostname"; +static const char __pyx_k_iso88591[] = "iso88591"; +static const char __pyx_k_iso88592[] = "iso88592"; +static const char __pyx_k_iso88593[] = "iso88593"; +static const char __pyx_k_iso88594[] = "iso88594"; +static const char __pyx_k_iso88595[] = "iso88595"; +static const char __pyx_k_iso88596[] = "iso88596"; +static const char __pyx_k_iso88597[] = "iso88597"; +static const char __pyx_k_iso88598[] = "iso88598"; +static const char __pyx_k_iso88599[] = "iso88599"; static const char __pyx_k_isomorph[] = "isomorph"; +static const char __pyx_k_koi8_r_2[] = "koi8_r"; +static const char __pyx_k_ksc_5601[] = "ksc_5601"; +static const char __pyx_k_ms_kanji[] = "ms_kanji"; static const char __pyx_k_password[] = "password"; static const char __pyx_k_property[] = "property"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_scheme_2[] = "scheme"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_to_ascii[] = "_to_ascii"; +static const char __pyx_k_us_ascii[] = "us-ascii"; static const char __pyx_k_username[] = "username"; -static const char __pyx_k_AUTHORITY[] = "AUTHORITY"; -static const char __pyx_k_FILE_HOST[] = "FILE_HOST"; -static const char __pyx_k_NO_SCHEME[] = "NO_SCHEME"; +static const char __pyx_k_utf_16be[] = "utf-16be"; +static const char __pyx_k_utf_16le[] = "utf-16le"; +static const char __pyx_k_x_cp1252[] = "x-cp1252"; +static const char __pyx_k_x_cp1254[] = "x-cp1254"; +static const char __pyx_k_x_euc_jp[] = "x-euc-jp"; +static const char __pyx_k_x_x_big5[] = "x-x-big5"; static const char __pyx_k_be_strict[] = "be_strict"; +static const char __pyx_k_csunicode[] = "csunicode"; static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_functools[] = "functools"; static const char __pyx_k_isenabled[] = "isenabled"; +static const char __pyx_k_iso885910[] = "iso885910"; +static const char __pyx_k_iso885911[] = "iso885911"; +static const char __pyx_k_iso885913[] = "iso885913"; +static const char __pyx_k_iso885914[] = "iso885914"; +static const char __pyx_k_iso885915[] = "iso885915"; +static const char __pyx_k_iso8859_1[] = "iso8859-1"; +static const char __pyx_k_iso8859_2[] = "iso8859-2"; +static const char __pyx_k_iso8859_3[] = "iso8859-3"; +static const char __pyx_k_iso8859_4[] = "iso8859-4"; +static const char __pyx_k_iso8859_5[] = "iso8859-5"; +static const char __pyx_k_iso8859_6[] = "iso8859-6"; +static const char __pyx_k_iso8859_7[] = "iso8859-7"; +static const char __pyx_k_iso8859_8[] = "iso8859-8"; +static const char __pyx_k_iso8859_9[] = "iso8859-9"; +static const char __pyx_k_iso_ir_58[] = "iso-ir-58"; static const char __pyx_k_localhost[] = "localhost"; +static const char __pyx_k_lru_cache[] = "lru_cache"; +static const char __pyx_k_macintosh[] = "macintosh"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_parse_url[] = "_parse_url"; static const char __pyx_k_separator[] = "separator"; +static const char __pyx_k_shift_jis[] = "shift-jis"; static const char __pyx_k_translate[] = "translate"; static const char __pyx_k_C0_CONTROL[] = "_C0_CONTROL"; -static const char __pyx_k_FILE_SLASH[] = "FILE_SLASH"; static const char __pyx_k_IndexError[] = "IndexError"; -static const char __pyx_k_PATH_START[] = "PATH_START"; static const char __pyx_k_URL___init[] = "_URL.__init__"; static const char __pyx_k_URL_scheme[] = "_URL.scheme"; static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_big5_hkscs[] = "big5-hkscs"; static const char __pyx_k_check_bidi[] = "check_bidi"; static const char __pyx_k_code_point[] = "code_point"; +static const char __pyx_k_codec_info[] = "codec_info"; +static const char __pyx_k_csshiftjis[] = "csshiftjis"; static const char __pyx_k_encode_set[] = "encode_set"; -static const char __pyx_k_encoding_2[] = "_encoding"; +static const char __pyx_k_gb_2312_80[] = "gb_2312-80"; +static const char __pyx_k_hz_gb_2312[] = "hz-gb-2312"; static const char __pyx_k_ipv4_piece[] = "ipv4_piece"; static const char __pyx_k_is_special[] = "is_special"; +static const char __pyx_k_iso8859_10[] = "iso8859-10"; +static const char __pyx_k_iso8859_11[] = "iso8859-11"; +static const char __pyx_k_iso8859_13[] = "iso8859-13"; +static const char __pyx_k_iso8859_14[] = "iso8859-14"; +static const char __pyx_k_iso8859_15[] = "iso8859-15"; +static const char __pyx_k_iso_8859_1[] = "iso-8859-1"; +static const char __pyx_k_iso_8859_2[] = "iso-8859-2"; +static const char __pyx_k_iso_8859_3[] = "iso-8859-3"; +static const char __pyx_k_iso_8859_4[] = "iso-8859-4"; +static const char __pyx_k_iso_8859_5[] = "iso-8859-5"; +static const char __pyx_k_iso_8859_6[] = "iso-8859-6"; +static const char __pyx_k_iso_8859_7[] = "iso-8859-7"; +static const char __pyx_k_iso_8859_8[] = "iso-8859-8"; +static const char __pyx_k_iso_8859_9[] = "iso-8859-9"; +static const char __pyx_k_iso_ir_100[] = "iso-ir-100"; +static const char __pyx_k_iso_ir_101[] = "iso-ir-101"; +static const char __pyx_k_iso_ir_109[] = "iso-ir-109"; +static const char __pyx_k_iso_ir_110[] = "iso-ir-110"; +static const char __pyx_k_iso_ir_126[] = "iso-ir-126"; +static const char __pyx_k_iso_ir_127[] = "iso-ir-127"; +static const char __pyx_k_iso_ir_138[] = "iso-ir-138"; +static const char __pyx_k_iso_ir_144[] = "iso-ir-144"; +static const char __pyx_k_iso_ir_148[] = "iso-ir-148"; +static const char __pyx_k_iso_ir_149[] = "iso-ir-149"; +static const char __pyx_k_iso_ir_157[] = "iso-ir-157"; +static const char __pyx_k_last_digit[] = "last_digit"; static const char __pyx_k_min_length[] = "min_length"; static const char __pyx_k_parse_host[] = "_parse_host"; static const char __pyx_k_parse_ipv4[] = "_parse_ipv4"; @@ -2768,73 +2963,160 @@ static const char __pyx_k_w3lib__url[] = "w3lib._url"; static const char __pyx_k_ASCII_ALPHA[] = "_ASCII_ALPHA"; static const char __pyx_k_ASCII_DIGIT[] = "_ASCII_DIGIT"; static const char __pyx_k_Domain_name[] = "Domain name "; -static const char __pyx_k_OPAQUE_PATH[] = "OPAQUE_PATH"; static const char __pyx_k_annotations[] = "__annotations__"; +static const char __pyx_k_csiso2022jp[] = "csiso2022jp"; +static const char __pyx_k_csiso2022kr[] = "csiso2022kr"; +static const char __pyx_k_csiso88596e[] = "csiso88596e"; +static const char __pyx_k_csiso88596i[] = "csiso88596i"; +static const char __pyx_k_csiso88598e[] = "csiso88598e"; +static const char __pyx_k_csiso88598i[] = "csiso88598i"; +static const char __pyx_k_csisolatin1[] = "csisolatin1"; +static const char __pyx_k_csisolatin2[] = "csisolatin2"; +static const char __pyx_k_csisolatin3[] = "csisolatin3"; +static const char __pyx_k_csisolatin4[] = "csisolatin4"; +static const char __pyx_k_csisolatin5[] = "csisolatin5"; +static const char __pyx_k_csisolatin6[] = "csisolatin6"; +static const char __pyx_k_csisolatin9[] = "csisolatin9"; +static const char __pyx_k_csmacintosh[] = "csmacintosh"; static const char __pyx_k_get_encoder[] = "_get_encoder"; +static const char __pyx_k_iso_2022_cn[] = "iso-2022-cn"; +static const char __pyx_k_iso_2022_jp[] = "iso-2022-jp"; +static const char __pyx_k_iso_2022_kr[] = "iso-2022-kr"; +static const char __pyx_k_iso_8859_10[] = "iso-8859-10"; +static const char __pyx_k_iso_8859_11[] = "iso-8859-11"; +static const char __pyx_k_iso_8859_13[] = "iso-8859-13"; +static const char __pyx_k_iso_8859_14[] = "iso-8859-14"; +static const char __pyx_k_iso_8859_15[] = "iso-8859-15"; +static const char __pyx_k_iso_8859_16[] = "iso-8859-16"; static const char __pyx_k_piece_index[] = "piece_index"; +static const char __pyx_k_replacement[] = "replacement"; +static const char __pyx_k_shift_jis_2[] = "shift_jis"; +static const char __pyx_k_unicodefeff[] = "unicodefeff"; +static const char __pyx_k_unicodefffe[] = "unicodefffe"; +static const char __pyx_k_windows_125[] = "windows-125"; +static const char __pyx_k_windows_31j[] = "windows-31j"; +static const char __pyx_k_windows_874[] = "windows-874"; +static const char __pyx_k_windows_949[] = "windows-949"; +static const char __pyx_k_x_mac_roman[] = "x-mac-roman"; +static const char __pyx_k_Dict_str_str[] = "Dict[str, str]"; static const char __pyx_k_Optional_int[] = "Optional[int]"; static const char __pyx_k_Optional_str[] = "Optional[str]"; static const char __pyx_k_SCHEME_CHARS[] = "_SCHEME_CHARS"; -static const char __pyx_k_SCHEME_START[] = "SCHEME_START"; static const char __pyx_k_ascii_domain[] = "ascii_domain"; static const char __pyx_k_at_sign_seen[] = "at_sign_seen"; static const char __pyx_k_canonicalize[] = "canonicalize"; +static const char __pyx_k_get_encoding[] = "_get_encoding"; static const char __pyx_k_greater_than[] = "greater_than"; static const char __pyx_k_index_length[] = "index_length"; +static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_input_lenght[] = "input_lenght"; static const char __pyx_k_input_length[] = "input_length"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; +static const char __pyx_k_iso_8859_1_2[] = "iso_8859-1"; +static const char __pyx_k_iso_8859_2_2[] = "iso_8859-2"; +static const char __pyx_k_iso_8859_3_2[] = "iso_8859-3"; +static const char __pyx_k_iso_8859_4_2[] = "iso_8859-4"; +static const char __pyx_k_iso_8859_5_2[] = "iso_8859-5"; +static const char __pyx_k_iso_8859_6_2[] = "iso_8859-6"; +static const char __pyx_k_iso_8859_6_e[] = "iso-8859-6-e"; +static const char __pyx_k_iso_8859_6_i[] = "iso-8859-6-i"; +static const char __pyx_k_iso_8859_7_2[] = "iso_8859-7"; +static const char __pyx_k_iso_8859_8_2[] = "iso_8859-8"; +static const char __pyx_k_iso_8859_8_e[] = "iso-8859-8-e"; +static const char __pyx_k_iso_8859_8_i[] = "iso-8859-8-i"; +static const char __pyx_k_iso_8859_9_2[] = "iso_8859-9"; +static const char __pyx_k_mac_cyrillic[] = "mac-cyrillic"; static const char __pyx_k_numbers_seen[] = "numbers_seen"; static const char __pyx_k_shorten_path[] = "_shorten_path"; +static const char __pyx_k_sun_eu_greek[] = "sun_eu_greek"; static const char __pyx_k_urllib_parse[] = "urllib.parse"; +static const char __pyx_k_windows_1252[] = "windows-1252"; +static const char __pyx_k_windows_1254[] = "windows-1254"; +static const char __pyx_k_CodecFunction[] = "CodecFunction"; static const char __pyx_k_DEFAULT_PORTS[] = "_DEFAULT_PORTS"; static const char __pyx_k_Optional_bool[] = "Optional[bool]"; +static const char __pyx_k_UTF_8_ENCODER[] = "_UTF_8_ENCODER"; static const char __pyx_k_at_sign_index[] = "at_sign_index"; static const char __pyx_k_check_hyphens[] = "check_hyphens"; static const char __pyx_k_check_joiners[] = "check_joiners"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; +static const char __pyx_k_csksc56011987[] = "csksc56011987"; static const char __pyx_k_current_index[] = "current_index"; static const char __pyx_k_encode_output[] = "encode_output"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; +static const char __pyx_k_iso_8859_15_2[] = "iso_8859-15"; static const char __pyx_k_serialize_url[] = "_serialize_url"; static const char __pyx_k_space_as_plus[] = "space_as_plus"; +static const char __pyx_k_unicode11utf8[] = "unicode11utf8"; +static const char __pyx_k_unicode20utf8[] = "unicode20utf8"; static const char __pyx_k_AssertionError[] = "AssertionError"; -static const char __pyx_k_RELATIVE_SLASH[] = "RELATIVE_SLASH"; +static const char __pyx_k_DecodeFunction[] = "DecodeFunction"; +static const char __pyx_k_EncodeFunction[] = "EncodeFunction"; static const char __pyx_k_Tuple_int_bool[] = "Tuple[int, bool]"; +static const char __pyx_k_UTF_8_ENCODING[] = "_UTF_8_ENCODING"; +static const char __pyx_k_ansi_x3_4_1968[] = "ansi_x3.4-1968"; static const char __pyx_k_current_length[] = "current_length"; static const char __pyx_k_ends_in_number[] = "_ends_in_number"; +static const char __pyx_k_ks_c_5601_1987[] = "ks_c_5601-1987"; +static const char __pyx_k_ks_c_5601_1989[] = "ks_c_5601-1989"; static const char __pyx_k_serialize_host[] = "_serialize_host"; static const char __pyx_k_serialize_ipv4[] = "_serialize_ipv4"; static const char __pyx_k_serialize_ipv6[] = "_serialize_ipv6"; static const char __pyx_k_w3lib__url_pyx[] = "w3lib/_url.pyx"; +static const char __pyx_k_x_mac_cyrillic[] = "x-mac-cyrillic"; +static const char __pyx_k_x_user_defined[] = "x-user-defined"; static const char __pyx_k_ASCII_HEX_DIGIT[] = "_ASCII_HEX_DIGIT"; +static const char __pyx_k_LABEL_ENCODINGS[] = "_LABEL_ENCODINGS"; static const char __pyx_k_SPECIAL_SCHEMES[] = "_SPECIAL_SCHEMES"; +static const char __pyx_k_csiso58gb231280[] = "csiso58gb231280"; +static const char __pyx_k_csisolatingreek[] = "csisolatingreek"; static const char __pyx_k_domain_to_ascii[] = "_domain_to_ascii"; static const char __pyx_k_has_opaque_path[] = "has_opaque_path"; static const char __pyx_k_inside_brackets[] = "inside_brackets"; +static const char __pyx_k_iso_10646_ucs_2[] = "iso-10646-ucs-2"; +static const char __pyx_k_iso_2022_cn_ext[] = "iso-2022-cn-ext"; +static const char __pyx_k_iso_8859_1_1987[] = "iso_8859-1:1987"; +static const char __pyx_k_iso_8859_2_1987[] = "iso_8859-2:1987"; +static const char __pyx_k_iso_8859_3_1988[] = "iso_8859-3:1988"; +static const char __pyx_k_iso_8859_4_1988[] = "iso_8859-4:1988"; +static const char __pyx_k_iso_8859_5_1988[] = "iso_8859-5:1988"; +static const char __pyx_k_iso_8859_6_1987[] = "iso_8859-6:1987"; +static const char __pyx_k_iso_8859_7_1987[] = "iso_8859-7:1987"; +static const char __pyx_k_iso_8859_8_1988[] = "iso_8859-8:1988"; +static const char __pyx_k_iso_8859_9_1989[] = "iso_8859-9:1989"; static const char __pyx_k_path_token_seen[] = "_path_token_seen"; static const char __pyx_k_port_token_seen[] = "_port_token_seen"; +static const char __pyx_k_x_mac_ukrainian[] = "x-mac-ukrainian"; +static const char __pyx_k_x_unicode20utf8[] = "x-unicode20utf8"; +static const char __pyx_k_ASCII_WHITESPACE[] = "_ASCII_WHITESPACE"; static const char __pyx_k_PercentEncodeSet[] = "_PercentEncodeSet"; +static const char __pyx_k_csisolatinarabic[] = "csisolatinarabic"; +static const char __pyx_k_csisolatinhebrew[] = "csisolatinhebrew"; static const char __pyx_k_exclude_fragment[] = "exclude_fragment"; static const char __pyx_k_validation_error[] = "validation_error"; -static const char __pyx_k_PATH_OR_AUTHORITY[] = "PATH_OR_AUTHORITY"; +static const char __pyx_k_UTF_16BE_ENCODING[] = "_UTF_16BE_ENCODING"; +static const char __pyx_k_UTF_16LE_ENCODING[] = "_UTF_16LE_ENCODING"; static const char __pyx_k_default_port_seen[] = "_default_port_seen"; static const char __pyx_k_parse_ipv4_number[] = "_parse_ipv4_number"; static const char __pyx_k_parse_opaque_host[] = "_parse_opaque_host"; +static const char __pyx_k_short_windows_125[] = "_short_windows_125"; +static const char __pyx_k_unicode_1_1_utf_8[] = "unicode-1-1-utf-8"; static const char __pyx_k_verify_dns_length[] = "verify_dns_length"; static const char __pyx_k_xmlcharrefreplace[] = "xmlcharrefreplace"; static const char __pyx_k_ASCII_ALPHANUMERIC[] = "_ASCII_ALPHANUMERIC"; static const char __pyx_k_Union_str_List_str[] = "Union[str, List[str]]"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_csisolatincyrillic[] = "csisolatincyrillic"; static const char __pyx_k_percent_encode_set[] = "percent_encode_set"; static const char __pyx_k_serialize_url_path[] = "_serialize_url_path"; static const char __pyx_k_C0_CONTROL_OR_SPACE[] = "_C0_CONTROL_OR_SPACE"; static const char __pyx_k_URL_has_opaque_path[] = "_URL.has_opaque_path"; +static const char __pyx_k_cseucpkdfmtjapanese[] = "cseucpkdfmtjapanese"; static const char __pyx_k_encoded_code_points[] = "encoded_code_points"; -static const char __pyx_k_get_output_encoding[] = "_get_output_encoding"; static const char __pyx_k_password_token_seen[] = "_password_token_seen"; static const char __pyx_k_ASCII_TAB_OR_NEWLINE[] = "_ASCII_TAB_OR_NEWLINE"; +static const char __pyx_k_REPLACEMENT_ENCODING[] = "_REPLACEMENT_ENCODING"; static const char __pyx_k_use_std3_ascii_rules[] = "use_std3_ascii_rules"; static const char __pyx_k_utf_8_percent_encode[] = "_utf_8_percent_encode"; static const char __pyx_k_Union_int_List_int_str[] = "Union[int, List[int], str]"; @@ -2846,7 +3128,6 @@ static const char __pyx_k_skip_authority_shortcut[] = "skip_authority_shortcut"; static const char __pyx_k_transitional_processing[] = "transitional_processing"; static const char __pyx_k_QUERY_PERCENT_ENCODE_SET[] = "_QUERY_PERCENT_ENCODE_SET"; static const char __pyx_k_query_percent_encode_set[] = "query_percent_encode_set"; -static const char __pyx_k_SPECIAL_AUTHORITY_SLASHES[] = "SPECIAL_AUTHORITY_SLASHES"; static const char __pyx_k_parse_ipv4_locals_genexpr[] = "_parse_ipv4..genexpr"; static const char __pyx_k_FORBIDDEN_HOST_CODE_POINTS[] = "_FORBIDDEN_HOST_CODE_POINTS"; static const char __pyx_k_is_double_dot_path_segment[] = "_is_double_dot_path_segment"; @@ -2857,48 +3138,51 @@ static const char __pyx_k_fragment_percent_encode_set[] = "fragment_percent_enco static const char __pyx_k_userinfo_percent_encode_set[] = "userinfo_percent_encode_set"; static const char __pyx_k_FORBIDDEN_DOMAIN_CODE_POINTS[] = "_FORBIDDEN_DOMAIN_CODE_POINTS"; static const char __pyx_k_C0_CONTROL_PERCENT_ENCODE_SET[] = "_C0_CONTROL_PERCENT_ENCODE_SET"; -static const char __pyx_k_SPECIAL_RELATIVE_OR_AUTHORITY[] = "SPECIAL_RELATIVE_OR_AUTHORITY"; static const char __pyx_k_ends_in_number_locals_genexpr[] = "_ends_in_number..genexpr"; static const char __pyx_k_percent_encode_after_encoding[] = "_percent_encode_after_encoding"; +static const char __pyx_k_OUTPUT_ENCODING_UTF8_ENCODINGS[] = "_OUTPUT_ENCODING_UTF8_ENCODINGS"; static const char __pyx_k_get_ipv6_first_longest_0_piece[] = "_get_ipv6_first_longest_0_piece_index"; static const char __pyx_k_ASCII_TAB_OR_NEWLINE_TRANSLATIO[] = "_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE"; static const char __pyx_k_SPECIAL_QUERY_PERCENT_ENCODE_SE[] = "_SPECIAL_QUERY_PERCENT_ENCODE_SET"; +static const char __pyx_k_does_not_match_any_encoding_lab[] = " does not match any encoding label from the Encoding Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)"; static const char __pyx_k_idempotent_utf_8_percent_encode[] = "_idempotent_utf_8_percent_encode"; static const char __pyx_k_is_an_empty_string_after_conver[] = " is an empty string after conversion to ASCII, which makes for an invalid domain name."; static const char __pyx_k_starts_with_windows_drive_lette[] = "_starts_with_windows_drive_letter"; -static const char __pyx_k_SPECIAL_AUTHORITY_IGNORE_SLASHES[] = "SPECIAL_AUTHORITY_IGNORE_SLASHES"; static const char __pyx_k_special_query_percent_encode_set[] = "special_query_percent_encode_set"; /* #### Code section: decls ### */ +static PyObject *__pyx_pf_5w3lib_4_url__short_windows_125(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_last_digit); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_2_get_encoder(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_encoding); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_4scheme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_6scheme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url__shorten_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set, PyObject *__pyx_v_space_as_plus); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_6_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_8_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_6_shorten_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set, PyObject *__pyx_v_space_as_plus); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_16_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, PyObject *__pyx_v_be_strict); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_is_special); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_20_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_24_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_26_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_44__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_base_url, PyObject *__pyx_v_encoding, PyObject *__pyx_v_userinfo_percent_encode_set, PyObject *__pyx_v_path_percent_encode_set, PyObject *__pyx_v_query_percent_encode_set, PyObject *__pyx_v_special_query_percent_encode_set, PyObject *__pyx_v_fragment_percent_encode_set); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_32_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_46__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_canonicalize); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_exclude_fragment, PyObject *__pyx_v_canonicalize); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, PyObject *__pyx_v_be_strict); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_is_special); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_50__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_base_url, PyObject *__pyx_v_encoding, PyObject *__pyx_v_userinfo_percent_encode_set, PyObject *__pyx_v_path_percent_encode_set, PyObject *__pyx_v_query_percent_encode_set, PyObject *__pyx_v_special_query_percent_encode_set, PyObject *__pyx_v_fragment_percent_encode_set); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_canonicalize); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_exclude_fragment, PyObject *__pyx_v_canonicalize); /* proto */ static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_strip = {0, 0, 0, 0, 0}; @@ -2951,54 +3235,47 @@ typedef struct { PyObject *__pyx_kp_u_2e_2e; PyObject *__pyx_kp_u_2e_3; PyObject *__pyx_kp_u_40; + PyObject *__pyx_kp_u_866; PyObject *__pyx_n_s_ASCII_ALPHA; PyObject *__pyx_n_s_ASCII_ALPHANUMERIC; PyObject *__pyx_n_s_ASCII_DIGIT; PyObject *__pyx_n_s_ASCII_HEX_DIGIT; PyObject *__pyx_n_s_ASCII_TAB_OR_NEWLINE; PyObject *__pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO; - PyObject *__pyx_n_s_AUTHORITY; + PyObject *__pyx_n_s_ASCII_WHITESPACE; + PyObject *__pyx_n_s_AnyStr; PyObject *__pyx_n_s_AssertionError; PyObject *__pyx_n_s_C0_CONTROL; PyObject *__pyx_n_s_C0_CONTROL_OR_SPACE; PyObject *__pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_Callable; + PyObject *__pyx_n_s_CodecFunction; PyObject *__pyx_n_s_DEFAULT_PORTS; + PyObject *__pyx_n_s_DecodeFunction; + PyObject *__pyx_n_s_Dict; + PyObject *__pyx_kp_s_Dict_str_str; PyObject *__pyx_kp_u_Domain_name; - PyObject *__pyx_n_s_FILE; - PyObject *__pyx_n_s_FILE_HOST; - PyObject *__pyx_n_s_FILE_SLASH; + PyObject *__pyx_n_s_EncodeFunction; PyObject *__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS; PyObject *__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS; - PyObject *__pyx_n_s_FRAGMENT; PyObject *__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET; - PyObject *__pyx_n_s_HOST; PyObject *__pyx_n_s_IndexError; + PyObject *__pyx_n_s_KeyError; + PyObject *__pyx_n_s_LABEL_ENCODINGS; PyObject *__pyx_n_s_List; PyObject *__pyx_kp_s_List_int; - PyObject *__pyx_n_s_NO_SCHEME; PyObject *__pyx_n_s_None; - PyObject *__pyx_n_s_OPAQUE_PATH; + PyObject *__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS; PyObject *__pyx_n_s_Optional; PyObject *__pyx_kp_s_Optional_bool; PyObject *__pyx_kp_s_Optional_int; PyObject *__pyx_kp_s_Optional_str; - PyObject *__pyx_n_s_PATH; - PyObject *__pyx_n_s_PATH_OR_AUTHORITY; PyObject *__pyx_n_s_PATH_PERCENT_ENCODE_SET; - PyObject *__pyx_n_s_PATH_START; - PyObject *__pyx_n_s_PORT; PyObject *__pyx_n_s_PercentEncodeSet; - PyObject *__pyx_n_s_QUERY; PyObject *__pyx_n_s_QUERY_PERCENT_ENCODE_SET; - PyObject *__pyx_n_s_RELATIVE; - PyObject *__pyx_n_s_RELATIVE_SLASH; - PyObject *__pyx_n_s_SCHEME; + PyObject *__pyx_n_s_REPLACEMENT_ENCODING; PyObject *__pyx_n_s_SCHEME_CHARS; - PyObject *__pyx_n_s_SCHEME_START; - PyObject *__pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES; - PyObject *__pyx_n_s_SPECIAL_AUTHORITY_SLASHES; PyObject *__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE; - PyObject *__pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY; PyObject *__pyx_n_s_SPECIAL_SCHEMES; PyObject *__pyx_n_s_Tuple; PyObject *__pyx_kp_s_Tuple_int_bool; @@ -3007,6 +3284,10 @@ typedef struct { PyObject *__pyx_n_s_URL_has_opaque_path; PyObject *__pyx_n_s_URL_scheme; PyObject *__pyx_n_s_USERINFO_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_UTF_16BE_ENCODING; + PyObject *__pyx_n_s_UTF_16LE_ENCODING; + PyObject *__pyx_n_s_UTF_8_ENCODER; + PyObject *__pyx_n_s_UTF_8_ENCODING; PyObject *__pyx_n_s_Union; PyObject *__pyx_kp_s_Union_int_List_int_str; PyObject *__pyx_kp_s_Union_str_List_str; @@ -3028,33 +3309,40 @@ typedef struct { PyObject *__pyx_kp_u__21; PyObject *__pyx_kp_u__22; PyObject *__pyx_kp_u__23; + PyObject *__pyx_n_s__24; PyObject *__pyx_kp_u__3; - PyObject *__pyx_kp_u__30; - PyObject *__pyx_n_s__33; - PyObject *__pyx_kp_u__36; - PyObject *__pyx_kp_u__37; - PyObject *__pyx_kp_u__38; - PyObject *__pyx_kp_u__39; PyObject *__pyx_kp_u__4; - PyObject *__pyx_kp_u__40; - PyObject *__pyx_kp_u__41; - PyObject *__pyx_kp_u__42; - PyObject *__pyx_kp_u__43; PyObject *__pyx_kp_u__5; PyObject *__pyx_kp_u__6; + PyObject *__pyx_kp_u__75; + PyObject *__pyx_n_s__78; PyObject *__pyx_kp_u__8; + PyObject *__pyx_kp_u__81; + PyObject *__pyx_kp_u__82; + PyObject *__pyx_kp_u__83; + PyObject *__pyx_kp_u__84; + PyObject *__pyx_kp_u__85; + PyObject *__pyx_kp_u__86; + PyObject *__pyx_kp_u__87; + PyObject *__pyx_kp_u__88; PyObject *__pyx_kp_u__9; PyObject *__pyx_n_s_address; PyObject *__pyx_n_s_annotations; + PyObject *__pyx_kp_u_ansi_x3_4_1968; PyObject *__pyx_n_s_append; + PyObject *__pyx_n_u_arabic; PyObject *__pyx_n_s_args; + PyObject *__pyx_n_u_ascii; PyObject *__pyx_n_s_ascii_domain; + PyObject *__pyx_kp_u_asmo_708; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_at_sign_index; PyObject *__pyx_n_s_at_sign_seen; PyObject *__pyx_n_s_base; PyObject *__pyx_n_s_base_url; PyObject *__pyx_n_s_be_strict; + PyObject *__pyx_n_u_big5; + PyObject *__pyx_kp_u_big5_hkscs; PyObject *__pyx_n_s_bool; PyObject *__pyx_n_s_buffer; PyObject *__pyx_n_s_byte; @@ -3063,51 +3351,109 @@ typedef struct { PyObject *__pyx_n_s_check_bidi; PyObject *__pyx_n_s_check_hyphens; PyObject *__pyx_n_s_check_joiners; + PyObject *__pyx_n_u_chinese; PyObject *__pyx_n_s_chr; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_close; + PyObject *__pyx_kp_u_cn_big5; PyObject *__pyx_n_s_code_point; + PyObject *__pyx_n_s_codec_info; + PyObject *__pyx_n_s_codecs; PyObject *__pyx_n_s_compress; PyObject *__pyx_n_s_counter; + PyObject *__pyx_n_u_cp125; + PyObject *__pyx_n_u_cp1252; + PyObject *__pyx_n_u_cp1254; + PyObject *__pyx_n_u_cp819; + PyObject *__pyx_n_u_cp866; + PyObject *__pyx_n_u_cp874; + PyObject *__pyx_n_u_csbig5; + PyObject *__pyx_n_u_cseuckr; + PyObject *__pyx_n_u_cseucpkdfmtjapanese; + PyObject *__pyx_n_u_csgb2312; + PyObject *__pyx_n_u_csibm866; + PyObject *__pyx_n_u_csiso2022jp; + PyObject *__pyx_n_u_csiso2022kr; + PyObject *__pyx_n_u_csiso58gb231280; + PyObject *__pyx_n_u_csiso88596e; + PyObject *__pyx_n_u_csiso88596i; + PyObject *__pyx_n_u_csiso88598e; + PyObject *__pyx_n_u_csiso88598i; + PyObject *__pyx_n_u_csisolatin1; + PyObject *__pyx_n_u_csisolatin2; + PyObject *__pyx_n_u_csisolatin3; + PyObject *__pyx_n_u_csisolatin4; + PyObject *__pyx_n_u_csisolatin5; + PyObject *__pyx_n_u_csisolatin6; + PyObject *__pyx_n_u_csisolatin9; + PyObject *__pyx_n_u_csisolatinarabic; + PyObject *__pyx_n_u_csisolatincyrillic; + PyObject *__pyx_n_u_csisolatingreek; + PyObject *__pyx_n_u_csisolatinhebrew; + PyObject *__pyx_n_u_cskoi8r; + PyObject *__pyx_n_u_csksc56011987; + PyObject *__pyx_n_u_csmacintosh; + PyObject *__pyx_n_u_csshiftjis; + PyObject *__pyx_n_u_csunicode; PyObject *__pyx_n_s_current_index; PyObject *__pyx_n_s_current_length; + PyObject *__pyx_n_u_cyrillic; PyObject *__pyx_n_s_default_port_seen; PyObject *__pyx_n_s_dict; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_doc; + PyObject *__pyx_kp_u_does_not_match_any_encoding_lab; PyObject *__pyx_n_s_domain; PyObject *__pyx_n_s_domain_to_ascii; + PyObject *__pyx_kp_u_dos_874; + PyObject *__pyx_kp_u_ecma_114; + PyObject *__pyx_kp_u_ecma_118; + PyObject *__pyx_n_u_elot_928; PyObject *__pyx_kp_u_enable; + PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_encode_output; PyObject *__pyx_n_s_encode_set; PyObject *__pyx_n_s_encoded; PyObject *__pyx_n_s_encoded_code_points; PyObject *__pyx_n_s_encoder; PyObject *__pyx_n_s_encoding; - PyObject *__pyx_n_s_encoding_2; PyObject *__pyx_n_s_ends_in_number; PyObject *__pyx_n_s_ends_in_number_locals_genexpr; PyObject *__pyx_n_s_enumerate; + PyObject *__pyx_kp_u_euc_jp; + PyObject *__pyx_kp_u_euc_kr; PyObject *__pyx_n_s_exclude_fragment; PyObject *__pyx_n_u_file; PyObject *__pyx_n_s_floor; PyObject *__pyx_n_s_fragment; PyObject *__pyx_n_s_fragment_percent_encode_set; PyObject *__pyx_n_u_ftp; + PyObject *__pyx_n_s_functools; + PyObject *__pyx_n_u_gb18030; + PyObject *__pyx_n_u_gb2312; + PyObject *__pyx_n_u_gb_2312; + PyObject *__pyx_kp_u_gb_2312_80; + PyObject *__pyx_n_u_gbk; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_genexpr; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_encoder; + PyObject *__pyx_n_s_get_encoding; PyObject *__pyx_n_s_get_ipv6_first_longest_0_piece; - PyObject *__pyx_n_s_get_output_encoding; PyObject *__pyx_n_s_greater_than; + PyObject *__pyx_n_u_greek; + PyObject *__pyx_n_u_greek8; PyObject *__pyx_n_s_has_opaque_path; + PyObject *__pyx_n_u_hebrew; PyObject *__pyx_n_s_host; PyObject *__pyx_n_s_hostname; PyObject *__pyx_n_u_http; PyObject *__pyx_n_u_https; + PyObject *__pyx_kp_u_hz_gb_2312; PyObject *__pyx_n_s_i; + PyObject *__pyx_n_u_ibm819; + PyObject *__pyx_n_u_ibm866; PyObject *__pyx_n_s_idempotent_utf_8_percent_encode; PyObject *__pyx_n_s_ignore0; PyObject *__pyx_n_s_import; @@ -3116,6 +3462,7 @@ typedef struct { PyObject *__pyx_n_s_infra; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_subclass; + PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_input; PyObject *__pyx_n_s_input_lenght; PyObject *__pyx_n_s_input_length; @@ -3130,17 +3477,135 @@ typedef struct { PyObject *__pyx_n_s_is_special; PyObject *__pyx_n_s_is_windows_drive_letter; PyObject *__pyx_kp_u_isenabled; + PyObject *__pyx_n_u_iso88591; + PyObject *__pyx_n_u_iso885910; + PyObject *__pyx_n_u_iso885911; + PyObject *__pyx_n_u_iso885913; + PyObject *__pyx_n_u_iso885914; + PyObject *__pyx_n_u_iso885915; + PyObject *__pyx_n_u_iso88592; + PyObject *__pyx_n_u_iso88593; + PyObject *__pyx_n_u_iso88594; + PyObject *__pyx_n_u_iso88595; + PyObject *__pyx_n_u_iso88596; + PyObject *__pyx_n_u_iso88597; + PyObject *__pyx_n_u_iso88598; + PyObject *__pyx_n_u_iso88599; + PyObject *__pyx_kp_u_iso8859_1; + PyObject *__pyx_kp_u_iso8859_10; + PyObject *__pyx_kp_u_iso8859_11; + PyObject *__pyx_kp_u_iso8859_13; + PyObject *__pyx_kp_u_iso8859_14; + PyObject *__pyx_kp_u_iso8859_15; + PyObject *__pyx_kp_u_iso8859_2; + PyObject *__pyx_kp_u_iso8859_3; + PyObject *__pyx_kp_u_iso8859_4; + PyObject *__pyx_kp_u_iso8859_5; + PyObject *__pyx_kp_u_iso8859_6; + PyObject *__pyx_kp_u_iso8859_7; + PyObject *__pyx_kp_u_iso8859_8; + PyObject *__pyx_kp_u_iso8859_9; + PyObject *__pyx_kp_u_iso_10646_ucs_2; + PyObject *__pyx_kp_u_iso_2022_cn; + PyObject *__pyx_kp_u_iso_2022_cn_ext; + PyObject *__pyx_kp_u_iso_2022_jp; + PyObject *__pyx_kp_u_iso_2022_kr; + PyObject *__pyx_kp_u_iso_8859_1; + PyObject *__pyx_kp_u_iso_8859_10; + PyObject *__pyx_kp_u_iso_8859_11; + PyObject *__pyx_kp_u_iso_8859_13; + PyObject *__pyx_kp_u_iso_8859_14; + PyObject *__pyx_kp_u_iso_8859_15; + PyObject *__pyx_kp_u_iso_8859_15_2; + PyObject *__pyx_kp_u_iso_8859_16; + PyObject *__pyx_kp_u_iso_8859_1_1987; + PyObject *__pyx_kp_u_iso_8859_1_2; + PyObject *__pyx_kp_u_iso_8859_2; + PyObject *__pyx_kp_u_iso_8859_2_1987; + PyObject *__pyx_kp_u_iso_8859_2_2; + PyObject *__pyx_kp_u_iso_8859_3; + PyObject *__pyx_kp_u_iso_8859_3_1988; + PyObject *__pyx_kp_u_iso_8859_3_2; + PyObject *__pyx_kp_u_iso_8859_4; + PyObject *__pyx_kp_u_iso_8859_4_1988; + PyObject *__pyx_kp_u_iso_8859_4_2; + PyObject *__pyx_kp_u_iso_8859_5; + PyObject *__pyx_kp_u_iso_8859_5_1988; + PyObject *__pyx_kp_u_iso_8859_5_2; + PyObject *__pyx_kp_u_iso_8859_6; + PyObject *__pyx_kp_u_iso_8859_6_1987; + PyObject *__pyx_kp_u_iso_8859_6_2; + PyObject *__pyx_kp_u_iso_8859_6_e; + PyObject *__pyx_kp_u_iso_8859_6_i; + PyObject *__pyx_kp_u_iso_8859_7; + PyObject *__pyx_kp_u_iso_8859_7_1987; + PyObject *__pyx_kp_u_iso_8859_7_2; + PyObject *__pyx_kp_u_iso_8859_8; + PyObject *__pyx_kp_u_iso_8859_8_1988; + PyObject *__pyx_kp_u_iso_8859_8_2; + PyObject *__pyx_kp_u_iso_8859_8_e; + PyObject *__pyx_kp_u_iso_8859_8_i; + PyObject *__pyx_kp_u_iso_8859_9; + PyObject *__pyx_kp_u_iso_8859_9_1989; + PyObject *__pyx_kp_u_iso_8859_9_2; + PyObject *__pyx_kp_u_iso_ir_100; + PyObject *__pyx_kp_u_iso_ir_101; + PyObject *__pyx_kp_u_iso_ir_109; + PyObject *__pyx_kp_u_iso_ir_110; + PyObject *__pyx_kp_u_iso_ir_126; + PyObject *__pyx_kp_u_iso_ir_127; + PyObject *__pyx_kp_u_iso_ir_138; + PyObject *__pyx_kp_u_iso_ir_144; + PyObject *__pyx_kp_u_iso_ir_148; + PyObject *__pyx_kp_u_iso_ir_149; + PyObject *__pyx_kp_u_iso_ir_157; + PyObject *__pyx_kp_u_iso_ir_58; PyObject *__pyx_n_s_isomorph; PyObject *__pyx_n_s_keys; + PyObject *__pyx_n_u_koi; + PyObject *__pyx_n_u_koi8; + PyObject *__pyx_kp_u_koi8_r; + PyObject *__pyx_n_u_koi8_r_2; + PyObject *__pyx_kp_u_koi8_ru; + PyObject *__pyx_kp_u_koi8_u; + PyObject *__pyx_n_u_korean; + PyObject *__pyx_kp_u_ks_c_5601_1987; + PyObject *__pyx_kp_u_ks_c_5601_1989; + PyObject *__pyx_n_u_ksc5601; + PyObject *__pyx_n_u_ksc_5601; + PyObject *__pyx_n_u_l1; + PyObject *__pyx_n_u_l2; + PyObject *__pyx_n_u_l3; + PyObject *__pyx_n_u_l4; + PyObject *__pyx_n_u_l5; + PyObject *__pyx_n_u_l6; + PyObject *__pyx_n_u_l9; + PyObject *__pyx_n_s_label; PyObject *__pyx_n_s_last; + PyObject *__pyx_n_s_last_digit; + PyObject *__pyx_n_u_latin1; + PyObject *__pyx_n_u_latin2; + PyObject *__pyx_n_u_latin3; + PyObject *__pyx_n_u_latin4; + PyObject *__pyx_n_u_latin5; + PyObject *__pyx_n_u_latin6; PyObject *__pyx_n_s_length; PyObject *__pyx_n_u_localhost; + PyObject *__pyx_n_u_logical; + PyObject *__pyx_n_s_lookup; PyObject *__pyx_n_s_lower; + PyObject *__pyx_n_s_lru_cache; + PyObject *__pyx_n_u_mac; + PyObject *__pyx_kp_u_mac_cyrillic; + PyObject *__pyx_n_u_macintosh; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_math; + PyObject *__pyx_n_s_maxsize; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_min_length; PyObject *__pyx_n_s_module; + PyObject *__pyx_n_u_ms932; + PyObject *__pyx_n_u_ms_kanji; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_number; @@ -3175,6 +3640,7 @@ typedef struct { PyObject *__pyx_n_s_query_percent_encode_set; PyObject *__pyx_n_s_r; PyObject *__pyx_n_s_range; + PyObject *__pyx_n_u_replacement; PyObject *__pyx_n_s_result; PyObject *__pyx_n_s_return; PyObject *__pyx_n_s_scheme; @@ -3190,28 +3656,47 @@ typedef struct { PyObject *__pyx_n_s_serialize_url_path; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_setter; + PyObject *__pyx_kp_u_shift_jis; + PyObject *__pyx_n_u_shift_jis_2; + PyObject *__pyx_n_s_short_windows_125; PyObject *__pyx_n_s_shorten_path; + PyObject *__pyx_n_u_sjis; PyObject *__pyx_n_s_skip_authority_shortcut; PyObject *__pyx_n_s_space_as_plus; + PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_special_query_percent_encode_set; PyObject *__pyx_n_s_starts_with_windows_drive_lette; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_str; PyObject *__pyx_n_s_strip; + PyObject *__pyx_n_u_sun_eu_greek; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_swaps; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_throw; + PyObject *__pyx_kp_u_tis_620; PyObject *__pyx_n_s_to_ascii; PyObject *__pyx_n_s_transitional_processing; PyObject *__pyx_n_s_translate; PyObject *__pyx_n_s_typing; + PyObject *__pyx_kp_u_ucs_2; + PyObject *__pyx_n_u_unicode; + PyObject *__pyx_n_u_unicode11utf8; + PyObject *__pyx_n_u_unicode20utf8; + PyObject *__pyx_kp_u_unicode_1_1_utf_8; + PyObject *__pyx_n_u_unicodefeff; + PyObject *__pyx_n_u_unicodefffe; PyObject *__pyx_n_s_unquote; PyObject *__pyx_n_s_url; PyObject *__pyx_n_s_urllib_parse; + PyObject *__pyx_kp_u_us_ascii; PyObject *__pyx_n_s_use_std3_ascii_rules; PyObject *__pyx_n_s_userinfo_percent_encode_set; PyObject *__pyx_n_s_username; + PyObject *__pyx_n_u_utf8; + PyObject *__pyx_kp_u_utf_16; + PyObject *__pyx_kp_u_utf_16be; + PyObject *__pyx_kp_u_utf_16le; PyObject *__pyx_kp_u_utf_8; PyObject *__pyx_n_s_utf_8_percent_encode; PyObject *__pyx_n_s_util; @@ -3219,11 +3704,30 @@ typedef struct { PyObject *__pyx_n_s_validation_error; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_verify_dns_length; + PyObject *__pyx_n_u_visual; PyObject *__pyx_n_s_w3lib__url; PyObject *__pyx_kp_s_w3lib__url_pyx; + PyObject *__pyx_kp_u_windows_125; + PyObject *__pyx_kp_u_windows_1252; + PyObject *__pyx_kp_u_windows_1254; + PyObject *__pyx_kp_u_windows_31j; + PyObject *__pyx_kp_u_windows_874; + PyObject *__pyx_kp_u_windows_949; PyObject *__pyx_n_u_ws; PyObject *__pyx_n_u_wss; PyObject *__pyx_n_u_x; + PyObject *__pyx_kp_u_x_cp125; + PyObject *__pyx_kp_u_x_cp1252; + PyObject *__pyx_kp_u_x_cp1254; + PyObject *__pyx_kp_u_x_euc_jp; + PyObject *__pyx_kp_u_x_gbk; + PyObject *__pyx_kp_u_x_mac_cyrillic; + PyObject *__pyx_kp_u_x_mac_roman; + PyObject *__pyx_kp_u_x_mac_ukrainian; + PyObject *__pyx_kp_u_x_sjis; + PyObject *__pyx_kp_u_x_unicode20utf8; + PyObject *__pyx_kp_u_x_user_defined; + PyObject *__pyx_kp_u_x_x_big5; PyObject *__pyx_n_u_xmlcharrefreplace; PyObject *__pyx_int_0; PyObject *__pyx_int_1; @@ -3234,17 +3738,8 @@ typedef struct { PyObject *__pyx_int_6; PyObject *__pyx_int_7; PyObject *__pyx_int_8; - PyObject *__pyx_int_9; PyObject *__pyx_int_10; - PyObject *__pyx_int_11; - PyObject *__pyx_int_12; - PyObject *__pyx_int_13; - PyObject *__pyx_int_14; - PyObject *__pyx_int_15; PyObject *__pyx_int_16; - PyObject *__pyx_int_17; - PyObject *__pyx_int_18; - PyObject *__pyx_int_19; PyObject *__pyx_int_21; PyObject *__pyx_int_32; PyObject *__pyx_int_80; @@ -3256,54 +3751,98 @@ typedef struct { PyObject *__pyx_slice_; PyObject *__pyx_tuple__7; PyObject *__pyx_slice__20; - PyObject *__pyx_tuple__24; + PyObject *__pyx_tuple__25; + PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__28; + PyObject *__pyx_tuple__29; + PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__31; + PyObject *__pyx_tuple__32; + PyObject *__pyx_tuple__33; PyObject *__pyx_tuple__34; + PyObject *__pyx_tuple__35; + PyObject *__pyx_tuple__36; + PyObject *__pyx_tuple__37; + PyObject *__pyx_tuple__38; + PyObject *__pyx_tuple__39; + PyObject *__pyx_tuple__40; + PyObject *__pyx_tuple__41; + PyObject *__pyx_tuple__42; + PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__44; + PyObject *__pyx_tuple__45; PyObject *__pyx_tuple__46; + PyObject *__pyx_tuple__47; PyObject *__pyx_tuple__48; + PyObject *__pyx_tuple__49; PyObject *__pyx_tuple__50; + PyObject *__pyx_tuple__51; PyObject *__pyx_tuple__52; + PyObject *__pyx_tuple__53; PyObject *__pyx_tuple__54; + PyObject *__pyx_tuple__55; PyObject *__pyx_tuple__56; + PyObject *__pyx_tuple__57; PyObject *__pyx_tuple__58; + PyObject *__pyx_tuple__59; PyObject *__pyx_tuple__60; + PyObject *__pyx_tuple__61; PyObject *__pyx_tuple__62; + PyObject *__pyx_tuple__63; + PyObject *__pyx_tuple__64; PyObject *__pyx_tuple__66; - PyObject *__pyx_tuple__68; - PyObject *__pyx_tuple__70; - PyObject *__pyx_tuple__72; - PyObject *__pyx_tuple__74; + PyObject *__pyx_tuple__67; + PyObject *__pyx_tuple__69; + PyObject *__pyx_tuple__73; PyObject *__pyx_tuple__76; - PyObject *__pyx_tuple__78; - PyObject *__pyx_tuple__80; - PyObject *__pyx_codeobj__25; + PyObject *__pyx_tuple__79; + PyObject *__pyx_tuple__89; + PyObject *__pyx_tuple__91; + PyObject *__pyx_tuple__93; + PyObject *__pyx_tuple__95; + PyObject *__pyx_tuple__97; + PyObject *__pyx_tuple__99; + PyObject *__pyx_tuple__101; + PyObject *__pyx_tuple__103; + PyObject *__pyx_tuple__105; + PyObject *__pyx_tuple__107; + PyObject *__pyx_tuple__111; + PyObject *__pyx_tuple__113; + PyObject *__pyx_tuple__115; + PyObject *__pyx_tuple__117; + PyObject *__pyx_tuple__119; + PyObject *__pyx_tuple__121; + PyObject *__pyx_tuple__123; + PyObject *__pyx_tuple__125; PyObject *__pyx_codeobj__26; - PyObject *__pyx_codeobj__27; - PyObject *__pyx_codeobj__29; - PyObject *__pyx_codeobj__32; - PyObject *__pyx_codeobj__35; - PyObject *__pyx_codeobj__45; - PyObject *__pyx_codeobj__47; - PyObject *__pyx_codeobj__49; - PyObject *__pyx_codeobj__51; - PyObject *__pyx_codeobj__53; - PyObject *__pyx_codeobj__55; - PyObject *__pyx_codeobj__57; - PyObject *__pyx_codeobj__59; - PyObject *__pyx_codeobj__61; - PyObject *__pyx_codeobj__63; - PyObject *__pyx_codeobj__64; PyObject *__pyx_codeobj__65; - PyObject *__pyx_codeobj__67; - PyObject *__pyx_codeobj__69; + PyObject *__pyx_codeobj__68; + PyObject *__pyx_codeobj__70; PyObject *__pyx_codeobj__71; - PyObject *__pyx_codeobj__73; - PyObject *__pyx_codeobj__75; + PyObject *__pyx_codeobj__72; + PyObject *__pyx_codeobj__74; PyObject *__pyx_codeobj__77; - PyObject *__pyx_codeobj__79; - PyObject *__pyx_codeobj__81; + PyObject *__pyx_codeobj__80; + PyObject *__pyx_codeobj__90; + PyObject *__pyx_codeobj__92; + PyObject *__pyx_codeobj__94; + PyObject *__pyx_codeobj__96; + PyObject *__pyx_codeobj__98; + PyObject *__pyx_codeobj__100; + PyObject *__pyx_codeobj__102; + PyObject *__pyx_codeobj__104; + PyObject *__pyx_codeobj__106; + PyObject *__pyx_codeobj__108; + PyObject *__pyx_codeobj__109; + PyObject *__pyx_codeobj__110; + PyObject *__pyx_codeobj__112; + PyObject *__pyx_codeobj__114; + PyObject *__pyx_codeobj__116; + PyObject *__pyx_codeobj__118; + PyObject *__pyx_codeobj__120; + PyObject *__pyx_codeobj__122; + PyObject *__pyx_codeobj__124; + PyObject *__pyx_codeobj__126; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -3365,54 +3904,47 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_u_2e_2e); Py_CLEAR(clear_module_state->__pyx_kp_u_2e_3); Py_CLEAR(clear_module_state->__pyx_kp_u_40); + Py_CLEAR(clear_module_state->__pyx_kp_u_866); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_ALPHA); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_ALPHANUMERIC); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_DIGIT); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_HEX_DIGIT); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_TAB_OR_NEWLINE); Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); - Py_CLEAR(clear_module_state->__pyx_n_s_AUTHORITY); + Py_CLEAR(clear_module_state->__pyx_n_s_ASCII_WHITESPACE); + Py_CLEAR(clear_module_state->__pyx_n_s_AnyStr); Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); Py_CLEAR(clear_module_state->__pyx_n_s_C0_CONTROL); Py_CLEAR(clear_module_state->__pyx_n_s_C0_CONTROL_OR_SPACE); Py_CLEAR(clear_module_state->__pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_Callable); + Py_CLEAR(clear_module_state->__pyx_n_s_CodecFunction); Py_CLEAR(clear_module_state->__pyx_n_s_DEFAULT_PORTS); + Py_CLEAR(clear_module_state->__pyx_n_s_DecodeFunction); + Py_CLEAR(clear_module_state->__pyx_n_s_Dict); + Py_CLEAR(clear_module_state->__pyx_kp_s_Dict_str_str); Py_CLEAR(clear_module_state->__pyx_kp_u_Domain_name); - Py_CLEAR(clear_module_state->__pyx_n_s_FILE); - Py_CLEAR(clear_module_state->__pyx_n_s_FILE_HOST); - Py_CLEAR(clear_module_state->__pyx_n_s_FILE_SLASH); + Py_CLEAR(clear_module_state->__pyx_n_s_EncodeFunction); Py_CLEAR(clear_module_state->__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); Py_CLEAR(clear_module_state->__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); - Py_CLEAR(clear_module_state->__pyx_n_s_FRAGMENT); Py_CLEAR(clear_module_state->__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); - Py_CLEAR(clear_module_state->__pyx_n_s_HOST); Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); + Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); + Py_CLEAR(clear_module_state->__pyx_n_s_LABEL_ENCODINGS); Py_CLEAR(clear_module_state->__pyx_n_s_List); Py_CLEAR(clear_module_state->__pyx_kp_s_List_int); - Py_CLEAR(clear_module_state->__pyx_n_s_NO_SCHEME); Py_CLEAR(clear_module_state->__pyx_n_s_None); - Py_CLEAR(clear_module_state->__pyx_n_s_OPAQUE_PATH); + Py_CLEAR(clear_module_state->__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); Py_CLEAR(clear_module_state->__pyx_n_s_Optional); Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_bool); Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_int); Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_str); - Py_CLEAR(clear_module_state->__pyx_n_s_PATH); - Py_CLEAR(clear_module_state->__pyx_n_s_PATH_OR_AUTHORITY); Py_CLEAR(clear_module_state->__pyx_n_s_PATH_PERCENT_ENCODE_SET); - Py_CLEAR(clear_module_state->__pyx_n_s_PATH_START); - Py_CLEAR(clear_module_state->__pyx_n_s_PORT); Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet); - Py_CLEAR(clear_module_state->__pyx_n_s_QUERY); Py_CLEAR(clear_module_state->__pyx_n_s_QUERY_PERCENT_ENCODE_SET); - Py_CLEAR(clear_module_state->__pyx_n_s_RELATIVE); - Py_CLEAR(clear_module_state->__pyx_n_s_RELATIVE_SLASH); - Py_CLEAR(clear_module_state->__pyx_n_s_SCHEME); + Py_CLEAR(clear_module_state->__pyx_n_s_REPLACEMENT_ENCODING); Py_CLEAR(clear_module_state->__pyx_n_s_SCHEME_CHARS); - Py_CLEAR(clear_module_state->__pyx_n_s_SCHEME_START); - Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); - Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_AUTHORITY_SLASHES); Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); - Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY); Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_SCHEMES); Py_CLEAR(clear_module_state->__pyx_n_s_Tuple); Py_CLEAR(clear_module_state->__pyx_kp_s_Tuple_int_bool); @@ -3421,6 +3953,10 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_URL_has_opaque_path); Py_CLEAR(clear_module_state->__pyx_n_s_URL_scheme); Py_CLEAR(clear_module_state->__pyx_n_s_USERINFO_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_UTF_16BE_ENCODING); + Py_CLEAR(clear_module_state->__pyx_n_s_UTF_16LE_ENCODING); + Py_CLEAR(clear_module_state->__pyx_n_s_UTF_8_ENCODER); + Py_CLEAR(clear_module_state->__pyx_n_s_UTF_8_ENCODING); Py_CLEAR(clear_module_state->__pyx_n_s_Union); Py_CLEAR(clear_module_state->__pyx_kp_s_Union_int_List_int_str); Py_CLEAR(clear_module_state->__pyx_kp_s_Union_str_List_str); @@ -3442,33 +3978,40 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_u__21); Py_CLEAR(clear_module_state->__pyx_kp_u__22); Py_CLEAR(clear_module_state->__pyx_kp_u__23); + Py_CLEAR(clear_module_state->__pyx_n_s__24); Py_CLEAR(clear_module_state->__pyx_kp_u__3); - Py_CLEAR(clear_module_state->__pyx_kp_u__30); - Py_CLEAR(clear_module_state->__pyx_n_s__33); - Py_CLEAR(clear_module_state->__pyx_kp_u__36); - Py_CLEAR(clear_module_state->__pyx_kp_u__37); - Py_CLEAR(clear_module_state->__pyx_kp_u__38); - Py_CLEAR(clear_module_state->__pyx_kp_u__39); Py_CLEAR(clear_module_state->__pyx_kp_u__4); - Py_CLEAR(clear_module_state->__pyx_kp_u__40); - Py_CLEAR(clear_module_state->__pyx_kp_u__41); - Py_CLEAR(clear_module_state->__pyx_kp_u__42); - Py_CLEAR(clear_module_state->__pyx_kp_u__43); Py_CLEAR(clear_module_state->__pyx_kp_u__5); Py_CLEAR(clear_module_state->__pyx_kp_u__6); + Py_CLEAR(clear_module_state->__pyx_kp_u__75); + Py_CLEAR(clear_module_state->__pyx_n_s__78); Py_CLEAR(clear_module_state->__pyx_kp_u__8); + Py_CLEAR(clear_module_state->__pyx_kp_u__81); + Py_CLEAR(clear_module_state->__pyx_kp_u__82); + Py_CLEAR(clear_module_state->__pyx_kp_u__83); + Py_CLEAR(clear_module_state->__pyx_kp_u__84); + Py_CLEAR(clear_module_state->__pyx_kp_u__85); + Py_CLEAR(clear_module_state->__pyx_kp_u__86); + Py_CLEAR(clear_module_state->__pyx_kp_u__87); + Py_CLEAR(clear_module_state->__pyx_kp_u__88); Py_CLEAR(clear_module_state->__pyx_kp_u__9); Py_CLEAR(clear_module_state->__pyx_n_s_address); Py_CLEAR(clear_module_state->__pyx_n_s_annotations); + Py_CLEAR(clear_module_state->__pyx_kp_u_ansi_x3_4_1968); Py_CLEAR(clear_module_state->__pyx_n_s_append); + Py_CLEAR(clear_module_state->__pyx_n_u_arabic); Py_CLEAR(clear_module_state->__pyx_n_s_args); + Py_CLEAR(clear_module_state->__pyx_n_u_ascii); Py_CLEAR(clear_module_state->__pyx_n_s_ascii_domain); + Py_CLEAR(clear_module_state->__pyx_kp_u_asmo_708); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_at_sign_index); Py_CLEAR(clear_module_state->__pyx_n_s_at_sign_seen); Py_CLEAR(clear_module_state->__pyx_n_s_base); Py_CLEAR(clear_module_state->__pyx_n_s_base_url); Py_CLEAR(clear_module_state->__pyx_n_s_be_strict); + Py_CLEAR(clear_module_state->__pyx_n_u_big5); + Py_CLEAR(clear_module_state->__pyx_kp_u_big5_hkscs); Py_CLEAR(clear_module_state->__pyx_n_s_bool); Py_CLEAR(clear_module_state->__pyx_n_s_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_byte); @@ -3477,51 +4020,109 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_check_bidi); Py_CLEAR(clear_module_state->__pyx_n_s_check_hyphens); Py_CLEAR(clear_module_state->__pyx_n_s_check_joiners); + Py_CLEAR(clear_module_state->__pyx_n_u_chinese); Py_CLEAR(clear_module_state->__pyx_n_s_chr); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_close); + Py_CLEAR(clear_module_state->__pyx_kp_u_cn_big5); Py_CLEAR(clear_module_state->__pyx_n_s_code_point); + Py_CLEAR(clear_module_state->__pyx_n_s_codec_info); + Py_CLEAR(clear_module_state->__pyx_n_s_codecs); Py_CLEAR(clear_module_state->__pyx_n_s_compress); Py_CLEAR(clear_module_state->__pyx_n_s_counter); + Py_CLEAR(clear_module_state->__pyx_n_u_cp125); + Py_CLEAR(clear_module_state->__pyx_n_u_cp1252); + Py_CLEAR(clear_module_state->__pyx_n_u_cp1254); + Py_CLEAR(clear_module_state->__pyx_n_u_cp819); + Py_CLEAR(clear_module_state->__pyx_n_u_cp866); + Py_CLEAR(clear_module_state->__pyx_n_u_cp874); + Py_CLEAR(clear_module_state->__pyx_n_u_csbig5); + Py_CLEAR(clear_module_state->__pyx_n_u_cseuckr); + Py_CLEAR(clear_module_state->__pyx_n_u_cseucpkdfmtjapanese); + Py_CLEAR(clear_module_state->__pyx_n_u_csgb2312); + Py_CLEAR(clear_module_state->__pyx_n_u_csibm866); + Py_CLEAR(clear_module_state->__pyx_n_u_csiso2022jp); + Py_CLEAR(clear_module_state->__pyx_n_u_csiso2022kr); + Py_CLEAR(clear_module_state->__pyx_n_u_csiso58gb231280); + Py_CLEAR(clear_module_state->__pyx_n_u_csiso88596e); + Py_CLEAR(clear_module_state->__pyx_n_u_csiso88596i); + Py_CLEAR(clear_module_state->__pyx_n_u_csiso88598e); + Py_CLEAR(clear_module_state->__pyx_n_u_csiso88598i); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin1); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin2); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin3); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin4); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin5); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin6); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatin9); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatinarabic); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatincyrillic); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatingreek); + Py_CLEAR(clear_module_state->__pyx_n_u_csisolatinhebrew); + Py_CLEAR(clear_module_state->__pyx_n_u_cskoi8r); + Py_CLEAR(clear_module_state->__pyx_n_u_csksc56011987); + Py_CLEAR(clear_module_state->__pyx_n_u_csmacintosh); + Py_CLEAR(clear_module_state->__pyx_n_u_csshiftjis); + Py_CLEAR(clear_module_state->__pyx_n_u_csunicode); Py_CLEAR(clear_module_state->__pyx_n_s_current_index); Py_CLEAR(clear_module_state->__pyx_n_s_current_length); + Py_CLEAR(clear_module_state->__pyx_n_u_cyrillic); Py_CLEAR(clear_module_state->__pyx_n_s_default_port_seen); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_doc); + Py_CLEAR(clear_module_state->__pyx_kp_u_does_not_match_any_encoding_lab); Py_CLEAR(clear_module_state->__pyx_n_s_domain); Py_CLEAR(clear_module_state->__pyx_n_s_domain_to_ascii); + Py_CLEAR(clear_module_state->__pyx_kp_u_dos_874); + Py_CLEAR(clear_module_state->__pyx_kp_u_ecma_114); + Py_CLEAR(clear_module_state->__pyx_kp_u_ecma_118); + Py_CLEAR(clear_module_state->__pyx_n_u_elot_928); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); + Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_encode_output); Py_CLEAR(clear_module_state->__pyx_n_s_encode_set); Py_CLEAR(clear_module_state->__pyx_n_s_encoded); Py_CLEAR(clear_module_state->__pyx_n_s_encoded_code_points); Py_CLEAR(clear_module_state->__pyx_n_s_encoder); Py_CLEAR(clear_module_state->__pyx_n_s_encoding); - Py_CLEAR(clear_module_state->__pyx_n_s_encoding_2); Py_CLEAR(clear_module_state->__pyx_n_s_ends_in_number); Py_CLEAR(clear_module_state->__pyx_n_s_ends_in_number_locals_genexpr); Py_CLEAR(clear_module_state->__pyx_n_s_enumerate); + Py_CLEAR(clear_module_state->__pyx_kp_u_euc_jp); + Py_CLEAR(clear_module_state->__pyx_kp_u_euc_kr); Py_CLEAR(clear_module_state->__pyx_n_s_exclude_fragment); Py_CLEAR(clear_module_state->__pyx_n_u_file); Py_CLEAR(clear_module_state->__pyx_n_s_floor); Py_CLEAR(clear_module_state->__pyx_n_s_fragment); Py_CLEAR(clear_module_state->__pyx_n_s_fragment_percent_encode_set); Py_CLEAR(clear_module_state->__pyx_n_u_ftp); + Py_CLEAR(clear_module_state->__pyx_n_s_functools); + Py_CLEAR(clear_module_state->__pyx_n_u_gb18030); + Py_CLEAR(clear_module_state->__pyx_n_u_gb2312); + Py_CLEAR(clear_module_state->__pyx_n_u_gb_2312); + Py_CLEAR(clear_module_state->__pyx_kp_u_gb_2312_80); + Py_CLEAR(clear_module_state->__pyx_n_u_gbk); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_encoder); + Py_CLEAR(clear_module_state->__pyx_n_s_get_encoding); Py_CLEAR(clear_module_state->__pyx_n_s_get_ipv6_first_longest_0_piece); - Py_CLEAR(clear_module_state->__pyx_n_s_get_output_encoding); Py_CLEAR(clear_module_state->__pyx_n_s_greater_than); + Py_CLEAR(clear_module_state->__pyx_n_u_greek); + Py_CLEAR(clear_module_state->__pyx_n_u_greek8); Py_CLEAR(clear_module_state->__pyx_n_s_has_opaque_path); + Py_CLEAR(clear_module_state->__pyx_n_u_hebrew); Py_CLEAR(clear_module_state->__pyx_n_s_host); Py_CLEAR(clear_module_state->__pyx_n_s_hostname); Py_CLEAR(clear_module_state->__pyx_n_u_http); Py_CLEAR(clear_module_state->__pyx_n_u_https); + Py_CLEAR(clear_module_state->__pyx_kp_u_hz_gb_2312); Py_CLEAR(clear_module_state->__pyx_n_s_i); + Py_CLEAR(clear_module_state->__pyx_n_u_ibm819); + Py_CLEAR(clear_module_state->__pyx_n_u_ibm866); Py_CLEAR(clear_module_state->__pyx_n_s_idempotent_utf_8_percent_encode); Py_CLEAR(clear_module_state->__pyx_n_s_ignore0); Py_CLEAR(clear_module_state->__pyx_n_s_import); @@ -3530,6 +4131,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_infra); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); + Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_input); Py_CLEAR(clear_module_state->__pyx_n_s_input_lenght); Py_CLEAR(clear_module_state->__pyx_n_s_input_length); @@ -3544,17 +4146,135 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_is_special); Py_CLEAR(clear_module_state->__pyx_n_s_is_windows_drive_letter); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88591); + Py_CLEAR(clear_module_state->__pyx_n_u_iso885910); + Py_CLEAR(clear_module_state->__pyx_n_u_iso885911); + Py_CLEAR(clear_module_state->__pyx_n_u_iso885913); + Py_CLEAR(clear_module_state->__pyx_n_u_iso885914); + Py_CLEAR(clear_module_state->__pyx_n_u_iso885915); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88592); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88593); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88594); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88595); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88596); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88597); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88598); + Py_CLEAR(clear_module_state->__pyx_n_u_iso88599); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_1); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_10); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_11); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_13); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_14); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_15); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_3); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_4); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_5); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_6); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_7); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_8); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso8859_9); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_10646_ucs_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_2022_cn); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_2022_cn_ext); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_2022_jp); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_2022_kr); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_1); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_10); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_11); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_13); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_14); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_15); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_15_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_16); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_1_1987); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_1_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_2_1987); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_2_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_3); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_3_1988); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_3_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_4); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_4_1988); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_4_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_5); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_5_1988); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_5_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6_1987); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6_e); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_6_i); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_7); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_7_1987); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_7_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8_1988); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8_e); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_8_i); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_9); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_9_1989); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_8859_9_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_100); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_101); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_109); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_110); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_126); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_127); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_138); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_144); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_148); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_149); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_157); + Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_58); Py_CLEAR(clear_module_state->__pyx_n_s_isomorph); Py_CLEAR(clear_module_state->__pyx_n_s_keys); + Py_CLEAR(clear_module_state->__pyx_n_u_koi); + Py_CLEAR(clear_module_state->__pyx_n_u_koi8); + Py_CLEAR(clear_module_state->__pyx_kp_u_koi8_r); + Py_CLEAR(clear_module_state->__pyx_n_u_koi8_r_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_koi8_ru); + Py_CLEAR(clear_module_state->__pyx_kp_u_koi8_u); + Py_CLEAR(clear_module_state->__pyx_n_u_korean); + Py_CLEAR(clear_module_state->__pyx_kp_u_ks_c_5601_1987); + Py_CLEAR(clear_module_state->__pyx_kp_u_ks_c_5601_1989); + Py_CLEAR(clear_module_state->__pyx_n_u_ksc5601); + Py_CLEAR(clear_module_state->__pyx_n_u_ksc_5601); + Py_CLEAR(clear_module_state->__pyx_n_u_l1); + Py_CLEAR(clear_module_state->__pyx_n_u_l2); + Py_CLEAR(clear_module_state->__pyx_n_u_l3); + Py_CLEAR(clear_module_state->__pyx_n_u_l4); + Py_CLEAR(clear_module_state->__pyx_n_u_l5); + Py_CLEAR(clear_module_state->__pyx_n_u_l6); + Py_CLEAR(clear_module_state->__pyx_n_u_l9); + Py_CLEAR(clear_module_state->__pyx_n_s_label); Py_CLEAR(clear_module_state->__pyx_n_s_last); + Py_CLEAR(clear_module_state->__pyx_n_s_last_digit); + Py_CLEAR(clear_module_state->__pyx_n_u_latin1); + Py_CLEAR(clear_module_state->__pyx_n_u_latin2); + Py_CLEAR(clear_module_state->__pyx_n_u_latin3); + Py_CLEAR(clear_module_state->__pyx_n_u_latin4); + Py_CLEAR(clear_module_state->__pyx_n_u_latin5); + Py_CLEAR(clear_module_state->__pyx_n_u_latin6); Py_CLEAR(clear_module_state->__pyx_n_s_length); Py_CLEAR(clear_module_state->__pyx_n_u_localhost); + Py_CLEAR(clear_module_state->__pyx_n_u_logical); + Py_CLEAR(clear_module_state->__pyx_n_s_lookup); Py_CLEAR(clear_module_state->__pyx_n_s_lower); + Py_CLEAR(clear_module_state->__pyx_n_s_lru_cache); + Py_CLEAR(clear_module_state->__pyx_n_u_mac); + Py_CLEAR(clear_module_state->__pyx_kp_u_mac_cyrillic); + Py_CLEAR(clear_module_state->__pyx_n_u_macintosh); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_math); + Py_CLEAR(clear_module_state->__pyx_n_s_maxsize); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_min_length); Py_CLEAR(clear_module_state->__pyx_n_s_module); + Py_CLEAR(clear_module_state->__pyx_n_u_ms932); + Py_CLEAR(clear_module_state->__pyx_n_u_ms_kanji); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_number); @@ -3589,6 +4309,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_query_percent_encode_set); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_range); + Py_CLEAR(clear_module_state->__pyx_n_u_replacement); Py_CLEAR(clear_module_state->__pyx_n_s_result); Py_CLEAR(clear_module_state->__pyx_n_s_return); Py_CLEAR(clear_module_state->__pyx_n_s_scheme); @@ -3604,28 +4325,47 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_serialize_url_path); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_setter); + Py_CLEAR(clear_module_state->__pyx_kp_u_shift_jis); + Py_CLEAR(clear_module_state->__pyx_n_u_shift_jis_2); + Py_CLEAR(clear_module_state->__pyx_n_s_short_windows_125); Py_CLEAR(clear_module_state->__pyx_n_s_shorten_path); + Py_CLEAR(clear_module_state->__pyx_n_u_sjis); Py_CLEAR(clear_module_state->__pyx_n_s_skip_authority_shortcut); Py_CLEAR(clear_module_state->__pyx_n_s_space_as_plus); + Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_special_query_percent_encode_set); Py_CLEAR(clear_module_state->__pyx_n_s_starts_with_windows_drive_lette); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_str); Py_CLEAR(clear_module_state->__pyx_n_s_strip); + Py_CLEAR(clear_module_state->__pyx_n_u_sun_eu_greek); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_swaps); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_throw); + Py_CLEAR(clear_module_state->__pyx_kp_u_tis_620); Py_CLEAR(clear_module_state->__pyx_n_s_to_ascii); Py_CLEAR(clear_module_state->__pyx_n_s_transitional_processing); Py_CLEAR(clear_module_state->__pyx_n_s_translate); Py_CLEAR(clear_module_state->__pyx_n_s_typing); + Py_CLEAR(clear_module_state->__pyx_kp_u_ucs_2); + Py_CLEAR(clear_module_state->__pyx_n_u_unicode); + Py_CLEAR(clear_module_state->__pyx_n_u_unicode11utf8); + Py_CLEAR(clear_module_state->__pyx_n_u_unicode20utf8); + Py_CLEAR(clear_module_state->__pyx_kp_u_unicode_1_1_utf_8); + Py_CLEAR(clear_module_state->__pyx_n_u_unicodefeff); + Py_CLEAR(clear_module_state->__pyx_n_u_unicodefffe); Py_CLEAR(clear_module_state->__pyx_n_s_unquote); Py_CLEAR(clear_module_state->__pyx_n_s_url); Py_CLEAR(clear_module_state->__pyx_n_s_urllib_parse); + Py_CLEAR(clear_module_state->__pyx_kp_u_us_ascii); Py_CLEAR(clear_module_state->__pyx_n_s_use_std3_ascii_rules); Py_CLEAR(clear_module_state->__pyx_n_s_userinfo_percent_encode_set); Py_CLEAR(clear_module_state->__pyx_n_s_username); + Py_CLEAR(clear_module_state->__pyx_n_u_utf8); + Py_CLEAR(clear_module_state->__pyx_kp_u_utf_16); + Py_CLEAR(clear_module_state->__pyx_kp_u_utf_16be); + Py_CLEAR(clear_module_state->__pyx_kp_u_utf_16le); Py_CLEAR(clear_module_state->__pyx_kp_u_utf_8); Py_CLEAR(clear_module_state->__pyx_n_s_utf_8_percent_encode); Py_CLEAR(clear_module_state->__pyx_n_s_util); @@ -3633,11 +4373,30 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_validation_error); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_verify_dns_length); + Py_CLEAR(clear_module_state->__pyx_n_u_visual); Py_CLEAR(clear_module_state->__pyx_n_s_w3lib__url); Py_CLEAR(clear_module_state->__pyx_kp_s_w3lib__url_pyx); + Py_CLEAR(clear_module_state->__pyx_kp_u_windows_125); + Py_CLEAR(clear_module_state->__pyx_kp_u_windows_1252); + Py_CLEAR(clear_module_state->__pyx_kp_u_windows_1254); + Py_CLEAR(clear_module_state->__pyx_kp_u_windows_31j); + Py_CLEAR(clear_module_state->__pyx_kp_u_windows_874); + Py_CLEAR(clear_module_state->__pyx_kp_u_windows_949); Py_CLEAR(clear_module_state->__pyx_n_u_ws); Py_CLEAR(clear_module_state->__pyx_n_u_wss); Py_CLEAR(clear_module_state->__pyx_n_u_x); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_cp125); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_cp1252); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_cp1254); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_euc_jp); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_gbk); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_mac_cyrillic); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_mac_roman); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_mac_ukrainian); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_sjis); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_unicode20utf8); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_user_defined); + Py_CLEAR(clear_module_state->__pyx_kp_u_x_x_big5); Py_CLEAR(clear_module_state->__pyx_n_u_xmlcharrefreplace); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); @@ -3648,17 +4407,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_int_6); Py_CLEAR(clear_module_state->__pyx_int_7); Py_CLEAR(clear_module_state->__pyx_int_8); - Py_CLEAR(clear_module_state->__pyx_int_9); Py_CLEAR(clear_module_state->__pyx_int_10); - Py_CLEAR(clear_module_state->__pyx_int_11); - Py_CLEAR(clear_module_state->__pyx_int_12); - Py_CLEAR(clear_module_state->__pyx_int_13); - Py_CLEAR(clear_module_state->__pyx_int_14); - Py_CLEAR(clear_module_state->__pyx_int_15); Py_CLEAR(clear_module_state->__pyx_int_16); - Py_CLEAR(clear_module_state->__pyx_int_17); - Py_CLEAR(clear_module_state->__pyx_int_18); - Py_CLEAR(clear_module_state->__pyx_int_19); Py_CLEAR(clear_module_state->__pyx_int_21); Py_CLEAR(clear_module_state->__pyx_int_32); Py_CLEAR(clear_module_state->__pyx_int_80); @@ -3670,54 +4420,98 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_slice_); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_slice__20); - Py_CLEAR(clear_module_state->__pyx_tuple__24); + Py_CLEAR(clear_module_state->__pyx_tuple__25); + Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__28); + Py_CLEAR(clear_module_state->__pyx_tuple__29); + Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__31); + Py_CLEAR(clear_module_state->__pyx_tuple__32); + Py_CLEAR(clear_module_state->__pyx_tuple__33); Py_CLEAR(clear_module_state->__pyx_tuple__34); + Py_CLEAR(clear_module_state->__pyx_tuple__35); + Py_CLEAR(clear_module_state->__pyx_tuple__36); + Py_CLEAR(clear_module_state->__pyx_tuple__37); + Py_CLEAR(clear_module_state->__pyx_tuple__38); + Py_CLEAR(clear_module_state->__pyx_tuple__39); + Py_CLEAR(clear_module_state->__pyx_tuple__40); + Py_CLEAR(clear_module_state->__pyx_tuple__41); + Py_CLEAR(clear_module_state->__pyx_tuple__42); + Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__44); + Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_tuple__46); + Py_CLEAR(clear_module_state->__pyx_tuple__47); Py_CLEAR(clear_module_state->__pyx_tuple__48); + Py_CLEAR(clear_module_state->__pyx_tuple__49); Py_CLEAR(clear_module_state->__pyx_tuple__50); + Py_CLEAR(clear_module_state->__pyx_tuple__51); Py_CLEAR(clear_module_state->__pyx_tuple__52); + Py_CLEAR(clear_module_state->__pyx_tuple__53); Py_CLEAR(clear_module_state->__pyx_tuple__54); + Py_CLEAR(clear_module_state->__pyx_tuple__55); Py_CLEAR(clear_module_state->__pyx_tuple__56); + Py_CLEAR(clear_module_state->__pyx_tuple__57); Py_CLEAR(clear_module_state->__pyx_tuple__58); + Py_CLEAR(clear_module_state->__pyx_tuple__59); Py_CLEAR(clear_module_state->__pyx_tuple__60); + Py_CLEAR(clear_module_state->__pyx_tuple__61); Py_CLEAR(clear_module_state->__pyx_tuple__62); + Py_CLEAR(clear_module_state->__pyx_tuple__63); + Py_CLEAR(clear_module_state->__pyx_tuple__64); Py_CLEAR(clear_module_state->__pyx_tuple__66); - Py_CLEAR(clear_module_state->__pyx_tuple__68); - Py_CLEAR(clear_module_state->__pyx_tuple__70); - Py_CLEAR(clear_module_state->__pyx_tuple__72); - Py_CLEAR(clear_module_state->__pyx_tuple__74); + Py_CLEAR(clear_module_state->__pyx_tuple__67); + Py_CLEAR(clear_module_state->__pyx_tuple__69); + Py_CLEAR(clear_module_state->__pyx_tuple__73); Py_CLEAR(clear_module_state->__pyx_tuple__76); - Py_CLEAR(clear_module_state->__pyx_tuple__78); - Py_CLEAR(clear_module_state->__pyx_tuple__80); - Py_CLEAR(clear_module_state->__pyx_codeobj__25); + Py_CLEAR(clear_module_state->__pyx_tuple__79); + Py_CLEAR(clear_module_state->__pyx_tuple__89); + Py_CLEAR(clear_module_state->__pyx_tuple__91); + Py_CLEAR(clear_module_state->__pyx_tuple__93); + Py_CLEAR(clear_module_state->__pyx_tuple__95); + Py_CLEAR(clear_module_state->__pyx_tuple__97); + Py_CLEAR(clear_module_state->__pyx_tuple__99); + Py_CLEAR(clear_module_state->__pyx_tuple__101); + Py_CLEAR(clear_module_state->__pyx_tuple__103); + Py_CLEAR(clear_module_state->__pyx_tuple__105); + Py_CLEAR(clear_module_state->__pyx_tuple__107); + Py_CLEAR(clear_module_state->__pyx_tuple__111); + Py_CLEAR(clear_module_state->__pyx_tuple__113); + Py_CLEAR(clear_module_state->__pyx_tuple__115); + Py_CLEAR(clear_module_state->__pyx_tuple__117); + Py_CLEAR(clear_module_state->__pyx_tuple__119); + Py_CLEAR(clear_module_state->__pyx_tuple__121); + Py_CLEAR(clear_module_state->__pyx_tuple__123); + Py_CLEAR(clear_module_state->__pyx_tuple__125); Py_CLEAR(clear_module_state->__pyx_codeobj__26); - Py_CLEAR(clear_module_state->__pyx_codeobj__27); - Py_CLEAR(clear_module_state->__pyx_codeobj__29); - Py_CLEAR(clear_module_state->__pyx_codeobj__32); - Py_CLEAR(clear_module_state->__pyx_codeobj__35); - Py_CLEAR(clear_module_state->__pyx_codeobj__45); - Py_CLEAR(clear_module_state->__pyx_codeobj__47); - Py_CLEAR(clear_module_state->__pyx_codeobj__49); - Py_CLEAR(clear_module_state->__pyx_codeobj__51); - Py_CLEAR(clear_module_state->__pyx_codeobj__53); - Py_CLEAR(clear_module_state->__pyx_codeobj__55); - Py_CLEAR(clear_module_state->__pyx_codeobj__57); - Py_CLEAR(clear_module_state->__pyx_codeobj__59); - Py_CLEAR(clear_module_state->__pyx_codeobj__61); - Py_CLEAR(clear_module_state->__pyx_codeobj__63); - Py_CLEAR(clear_module_state->__pyx_codeobj__64); Py_CLEAR(clear_module_state->__pyx_codeobj__65); - Py_CLEAR(clear_module_state->__pyx_codeobj__67); - Py_CLEAR(clear_module_state->__pyx_codeobj__69); + Py_CLEAR(clear_module_state->__pyx_codeobj__68); + Py_CLEAR(clear_module_state->__pyx_codeobj__70); Py_CLEAR(clear_module_state->__pyx_codeobj__71); - Py_CLEAR(clear_module_state->__pyx_codeobj__73); - Py_CLEAR(clear_module_state->__pyx_codeobj__75); + Py_CLEAR(clear_module_state->__pyx_codeobj__72); + Py_CLEAR(clear_module_state->__pyx_codeobj__74); Py_CLEAR(clear_module_state->__pyx_codeobj__77); - Py_CLEAR(clear_module_state->__pyx_codeobj__79); - Py_CLEAR(clear_module_state->__pyx_codeobj__81); + Py_CLEAR(clear_module_state->__pyx_codeobj__80); + Py_CLEAR(clear_module_state->__pyx_codeobj__90); + Py_CLEAR(clear_module_state->__pyx_codeobj__92); + Py_CLEAR(clear_module_state->__pyx_codeobj__94); + Py_CLEAR(clear_module_state->__pyx_codeobj__96); + Py_CLEAR(clear_module_state->__pyx_codeobj__98); + Py_CLEAR(clear_module_state->__pyx_codeobj__100); + Py_CLEAR(clear_module_state->__pyx_codeobj__102); + Py_CLEAR(clear_module_state->__pyx_codeobj__104); + Py_CLEAR(clear_module_state->__pyx_codeobj__106); + Py_CLEAR(clear_module_state->__pyx_codeobj__108); + Py_CLEAR(clear_module_state->__pyx_codeobj__109); + Py_CLEAR(clear_module_state->__pyx_codeobj__110); + Py_CLEAR(clear_module_state->__pyx_codeobj__112); + Py_CLEAR(clear_module_state->__pyx_codeobj__114); + Py_CLEAR(clear_module_state->__pyx_codeobj__116); + Py_CLEAR(clear_module_state->__pyx_codeobj__118); + Py_CLEAR(clear_module_state->__pyx_codeobj__120); + Py_CLEAR(clear_module_state->__pyx_codeobj__122); + Py_CLEAR(clear_module_state->__pyx_codeobj__124); + Py_CLEAR(clear_module_state->__pyx_codeobj__126); return 0; } #endif @@ -3757,54 +4551,47 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_u_2e_2e); Py_VISIT(traverse_module_state->__pyx_kp_u_2e_3); Py_VISIT(traverse_module_state->__pyx_kp_u_40); + Py_VISIT(traverse_module_state->__pyx_kp_u_866); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_ALPHA); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_ALPHANUMERIC); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_DIGIT); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_HEX_DIGIT); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_TAB_OR_NEWLINE); Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); - Py_VISIT(traverse_module_state->__pyx_n_s_AUTHORITY); + Py_VISIT(traverse_module_state->__pyx_n_s_ASCII_WHITESPACE); + Py_VISIT(traverse_module_state->__pyx_n_s_AnyStr); Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); Py_VISIT(traverse_module_state->__pyx_n_s_C0_CONTROL); Py_VISIT(traverse_module_state->__pyx_n_s_C0_CONTROL_OR_SPACE); Py_VISIT(traverse_module_state->__pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_Callable); + Py_VISIT(traverse_module_state->__pyx_n_s_CodecFunction); Py_VISIT(traverse_module_state->__pyx_n_s_DEFAULT_PORTS); + Py_VISIT(traverse_module_state->__pyx_n_s_DecodeFunction); + Py_VISIT(traverse_module_state->__pyx_n_s_Dict); + Py_VISIT(traverse_module_state->__pyx_kp_s_Dict_str_str); Py_VISIT(traverse_module_state->__pyx_kp_u_Domain_name); - Py_VISIT(traverse_module_state->__pyx_n_s_FILE); - Py_VISIT(traverse_module_state->__pyx_n_s_FILE_HOST); - Py_VISIT(traverse_module_state->__pyx_n_s_FILE_SLASH); + Py_VISIT(traverse_module_state->__pyx_n_s_EncodeFunction); Py_VISIT(traverse_module_state->__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); Py_VISIT(traverse_module_state->__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); - Py_VISIT(traverse_module_state->__pyx_n_s_FRAGMENT); Py_VISIT(traverse_module_state->__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); - Py_VISIT(traverse_module_state->__pyx_n_s_HOST); Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); + Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); + Py_VISIT(traverse_module_state->__pyx_n_s_LABEL_ENCODINGS); Py_VISIT(traverse_module_state->__pyx_n_s_List); Py_VISIT(traverse_module_state->__pyx_kp_s_List_int); - Py_VISIT(traverse_module_state->__pyx_n_s_NO_SCHEME); Py_VISIT(traverse_module_state->__pyx_n_s_None); - Py_VISIT(traverse_module_state->__pyx_n_s_OPAQUE_PATH); + Py_VISIT(traverse_module_state->__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); Py_VISIT(traverse_module_state->__pyx_n_s_Optional); Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_bool); Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_int); Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_str); - Py_VISIT(traverse_module_state->__pyx_n_s_PATH); - Py_VISIT(traverse_module_state->__pyx_n_s_PATH_OR_AUTHORITY); Py_VISIT(traverse_module_state->__pyx_n_s_PATH_PERCENT_ENCODE_SET); - Py_VISIT(traverse_module_state->__pyx_n_s_PATH_START); - Py_VISIT(traverse_module_state->__pyx_n_s_PORT); Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet); - Py_VISIT(traverse_module_state->__pyx_n_s_QUERY); Py_VISIT(traverse_module_state->__pyx_n_s_QUERY_PERCENT_ENCODE_SET); - Py_VISIT(traverse_module_state->__pyx_n_s_RELATIVE); - Py_VISIT(traverse_module_state->__pyx_n_s_RELATIVE_SLASH); - Py_VISIT(traverse_module_state->__pyx_n_s_SCHEME); + Py_VISIT(traverse_module_state->__pyx_n_s_REPLACEMENT_ENCODING); Py_VISIT(traverse_module_state->__pyx_n_s_SCHEME_CHARS); - Py_VISIT(traverse_module_state->__pyx_n_s_SCHEME_START); - Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); - Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_AUTHORITY_SLASHES); Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); - Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY); Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_SCHEMES); Py_VISIT(traverse_module_state->__pyx_n_s_Tuple); Py_VISIT(traverse_module_state->__pyx_kp_s_Tuple_int_bool); @@ -3813,6 +4600,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_URL_has_opaque_path); Py_VISIT(traverse_module_state->__pyx_n_s_URL_scheme); Py_VISIT(traverse_module_state->__pyx_n_s_USERINFO_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_UTF_16BE_ENCODING); + Py_VISIT(traverse_module_state->__pyx_n_s_UTF_16LE_ENCODING); + Py_VISIT(traverse_module_state->__pyx_n_s_UTF_8_ENCODER); + Py_VISIT(traverse_module_state->__pyx_n_s_UTF_8_ENCODING); Py_VISIT(traverse_module_state->__pyx_n_s_Union); Py_VISIT(traverse_module_state->__pyx_kp_s_Union_int_List_int_str); Py_VISIT(traverse_module_state->__pyx_kp_s_Union_str_List_str); @@ -3834,33 +4625,40 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_u__21); Py_VISIT(traverse_module_state->__pyx_kp_u__22); Py_VISIT(traverse_module_state->__pyx_kp_u__23); + Py_VISIT(traverse_module_state->__pyx_n_s__24); Py_VISIT(traverse_module_state->__pyx_kp_u__3); - Py_VISIT(traverse_module_state->__pyx_kp_u__30); - Py_VISIT(traverse_module_state->__pyx_n_s__33); - Py_VISIT(traverse_module_state->__pyx_kp_u__36); - Py_VISIT(traverse_module_state->__pyx_kp_u__37); - Py_VISIT(traverse_module_state->__pyx_kp_u__38); - Py_VISIT(traverse_module_state->__pyx_kp_u__39); Py_VISIT(traverse_module_state->__pyx_kp_u__4); - Py_VISIT(traverse_module_state->__pyx_kp_u__40); - Py_VISIT(traverse_module_state->__pyx_kp_u__41); - Py_VISIT(traverse_module_state->__pyx_kp_u__42); - Py_VISIT(traverse_module_state->__pyx_kp_u__43); Py_VISIT(traverse_module_state->__pyx_kp_u__5); Py_VISIT(traverse_module_state->__pyx_kp_u__6); + Py_VISIT(traverse_module_state->__pyx_kp_u__75); + Py_VISIT(traverse_module_state->__pyx_n_s__78); Py_VISIT(traverse_module_state->__pyx_kp_u__8); + Py_VISIT(traverse_module_state->__pyx_kp_u__81); + Py_VISIT(traverse_module_state->__pyx_kp_u__82); + Py_VISIT(traverse_module_state->__pyx_kp_u__83); + Py_VISIT(traverse_module_state->__pyx_kp_u__84); + Py_VISIT(traverse_module_state->__pyx_kp_u__85); + Py_VISIT(traverse_module_state->__pyx_kp_u__86); + Py_VISIT(traverse_module_state->__pyx_kp_u__87); + Py_VISIT(traverse_module_state->__pyx_kp_u__88); Py_VISIT(traverse_module_state->__pyx_kp_u__9); Py_VISIT(traverse_module_state->__pyx_n_s_address); Py_VISIT(traverse_module_state->__pyx_n_s_annotations); + Py_VISIT(traverse_module_state->__pyx_kp_u_ansi_x3_4_1968); Py_VISIT(traverse_module_state->__pyx_n_s_append); + Py_VISIT(traverse_module_state->__pyx_n_u_arabic); Py_VISIT(traverse_module_state->__pyx_n_s_args); + Py_VISIT(traverse_module_state->__pyx_n_u_ascii); Py_VISIT(traverse_module_state->__pyx_n_s_ascii_domain); + Py_VISIT(traverse_module_state->__pyx_kp_u_asmo_708); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_at_sign_index); Py_VISIT(traverse_module_state->__pyx_n_s_at_sign_seen); Py_VISIT(traverse_module_state->__pyx_n_s_base); Py_VISIT(traverse_module_state->__pyx_n_s_base_url); Py_VISIT(traverse_module_state->__pyx_n_s_be_strict); + Py_VISIT(traverse_module_state->__pyx_n_u_big5); + Py_VISIT(traverse_module_state->__pyx_kp_u_big5_hkscs); Py_VISIT(traverse_module_state->__pyx_n_s_bool); Py_VISIT(traverse_module_state->__pyx_n_s_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_byte); @@ -3869,51 +4667,109 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_check_bidi); Py_VISIT(traverse_module_state->__pyx_n_s_check_hyphens); Py_VISIT(traverse_module_state->__pyx_n_s_check_joiners); + Py_VISIT(traverse_module_state->__pyx_n_u_chinese); Py_VISIT(traverse_module_state->__pyx_n_s_chr); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_close); + Py_VISIT(traverse_module_state->__pyx_kp_u_cn_big5); Py_VISIT(traverse_module_state->__pyx_n_s_code_point); + Py_VISIT(traverse_module_state->__pyx_n_s_codec_info); + Py_VISIT(traverse_module_state->__pyx_n_s_codecs); Py_VISIT(traverse_module_state->__pyx_n_s_compress); Py_VISIT(traverse_module_state->__pyx_n_s_counter); + Py_VISIT(traverse_module_state->__pyx_n_u_cp125); + Py_VISIT(traverse_module_state->__pyx_n_u_cp1252); + Py_VISIT(traverse_module_state->__pyx_n_u_cp1254); + Py_VISIT(traverse_module_state->__pyx_n_u_cp819); + Py_VISIT(traverse_module_state->__pyx_n_u_cp866); + Py_VISIT(traverse_module_state->__pyx_n_u_cp874); + Py_VISIT(traverse_module_state->__pyx_n_u_csbig5); + Py_VISIT(traverse_module_state->__pyx_n_u_cseuckr); + Py_VISIT(traverse_module_state->__pyx_n_u_cseucpkdfmtjapanese); + Py_VISIT(traverse_module_state->__pyx_n_u_csgb2312); + Py_VISIT(traverse_module_state->__pyx_n_u_csibm866); + Py_VISIT(traverse_module_state->__pyx_n_u_csiso2022jp); + Py_VISIT(traverse_module_state->__pyx_n_u_csiso2022kr); + Py_VISIT(traverse_module_state->__pyx_n_u_csiso58gb231280); + Py_VISIT(traverse_module_state->__pyx_n_u_csiso88596e); + Py_VISIT(traverse_module_state->__pyx_n_u_csiso88596i); + Py_VISIT(traverse_module_state->__pyx_n_u_csiso88598e); + Py_VISIT(traverse_module_state->__pyx_n_u_csiso88598i); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin1); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin2); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin3); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin4); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin5); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin6); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatin9); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatinarabic); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatincyrillic); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatingreek); + Py_VISIT(traverse_module_state->__pyx_n_u_csisolatinhebrew); + Py_VISIT(traverse_module_state->__pyx_n_u_cskoi8r); + Py_VISIT(traverse_module_state->__pyx_n_u_csksc56011987); + Py_VISIT(traverse_module_state->__pyx_n_u_csmacintosh); + Py_VISIT(traverse_module_state->__pyx_n_u_csshiftjis); + Py_VISIT(traverse_module_state->__pyx_n_u_csunicode); Py_VISIT(traverse_module_state->__pyx_n_s_current_index); Py_VISIT(traverse_module_state->__pyx_n_s_current_length); + Py_VISIT(traverse_module_state->__pyx_n_u_cyrillic); Py_VISIT(traverse_module_state->__pyx_n_s_default_port_seen); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_doc); + Py_VISIT(traverse_module_state->__pyx_kp_u_does_not_match_any_encoding_lab); Py_VISIT(traverse_module_state->__pyx_n_s_domain); Py_VISIT(traverse_module_state->__pyx_n_s_domain_to_ascii); + Py_VISIT(traverse_module_state->__pyx_kp_u_dos_874); + Py_VISIT(traverse_module_state->__pyx_kp_u_ecma_114); + Py_VISIT(traverse_module_state->__pyx_kp_u_ecma_118); + Py_VISIT(traverse_module_state->__pyx_n_u_elot_928); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); + Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_encode_output); Py_VISIT(traverse_module_state->__pyx_n_s_encode_set); Py_VISIT(traverse_module_state->__pyx_n_s_encoded); Py_VISIT(traverse_module_state->__pyx_n_s_encoded_code_points); Py_VISIT(traverse_module_state->__pyx_n_s_encoder); Py_VISIT(traverse_module_state->__pyx_n_s_encoding); - Py_VISIT(traverse_module_state->__pyx_n_s_encoding_2); Py_VISIT(traverse_module_state->__pyx_n_s_ends_in_number); Py_VISIT(traverse_module_state->__pyx_n_s_ends_in_number_locals_genexpr); Py_VISIT(traverse_module_state->__pyx_n_s_enumerate); + Py_VISIT(traverse_module_state->__pyx_kp_u_euc_jp); + Py_VISIT(traverse_module_state->__pyx_kp_u_euc_kr); Py_VISIT(traverse_module_state->__pyx_n_s_exclude_fragment); Py_VISIT(traverse_module_state->__pyx_n_u_file); Py_VISIT(traverse_module_state->__pyx_n_s_floor); Py_VISIT(traverse_module_state->__pyx_n_s_fragment); Py_VISIT(traverse_module_state->__pyx_n_s_fragment_percent_encode_set); Py_VISIT(traverse_module_state->__pyx_n_u_ftp); + Py_VISIT(traverse_module_state->__pyx_n_s_functools); + Py_VISIT(traverse_module_state->__pyx_n_u_gb18030); + Py_VISIT(traverse_module_state->__pyx_n_u_gb2312); + Py_VISIT(traverse_module_state->__pyx_n_u_gb_2312); + Py_VISIT(traverse_module_state->__pyx_kp_u_gb_2312_80); + Py_VISIT(traverse_module_state->__pyx_n_u_gbk); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_encoder); + Py_VISIT(traverse_module_state->__pyx_n_s_get_encoding); Py_VISIT(traverse_module_state->__pyx_n_s_get_ipv6_first_longest_0_piece); - Py_VISIT(traverse_module_state->__pyx_n_s_get_output_encoding); Py_VISIT(traverse_module_state->__pyx_n_s_greater_than); + Py_VISIT(traverse_module_state->__pyx_n_u_greek); + Py_VISIT(traverse_module_state->__pyx_n_u_greek8); Py_VISIT(traverse_module_state->__pyx_n_s_has_opaque_path); + Py_VISIT(traverse_module_state->__pyx_n_u_hebrew); Py_VISIT(traverse_module_state->__pyx_n_s_host); Py_VISIT(traverse_module_state->__pyx_n_s_hostname); Py_VISIT(traverse_module_state->__pyx_n_u_http); Py_VISIT(traverse_module_state->__pyx_n_u_https); + Py_VISIT(traverse_module_state->__pyx_kp_u_hz_gb_2312); Py_VISIT(traverse_module_state->__pyx_n_s_i); + Py_VISIT(traverse_module_state->__pyx_n_u_ibm819); + Py_VISIT(traverse_module_state->__pyx_n_u_ibm866); Py_VISIT(traverse_module_state->__pyx_n_s_idempotent_utf_8_percent_encode); Py_VISIT(traverse_module_state->__pyx_n_s_ignore0); Py_VISIT(traverse_module_state->__pyx_n_s_import); @@ -3922,6 +4778,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_infra); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); + Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_input); Py_VISIT(traverse_module_state->__pyx_n_s_input_lenght); Py_VISIT(traverse_module_state->__pyx_n_s_input_length); @@ -3936,17 +4793,135 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_is_special); Py_VISIT(traverse_module_state->__pyx_n_s_is_windows_drive_letter); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88591); + Py_VISIT(traverse_module_state->__pyx_n_u_iso885910); + Py_VISIT(traverse_module_state->__pyx_n_u_iso885911); + Py_VISIT(traverse_module_state->__pyx_n_u_iso885913); + Py_VISIT(traverse_module_state->__pyx_n_u_iso885914); + Py_VISIT(traverse_module_state->__pyx_n_u_iso885915); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88592); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88593); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88594); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88595); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88596); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88597); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88598); + Py_VISIT(traverse_module_state->__pyx_n_u_iso88599); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_1); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_10); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_11); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_13); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_14); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_15); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_3); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_4); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_5); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_6); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_7); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_8); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso8859_9); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_10646_ucs_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_2022_cn); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_2022_cn_ext); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_2022_jp); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_2022_kr); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_1); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_10); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_11); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_13); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_14); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_15); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_15_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_16); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_1_1987); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_1_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_2_1987); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_2_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_3); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_3_1988); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_3_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_4); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_4_1988); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_4_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_5); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_5_1988); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_5_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6_1987); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6_e); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_6_i); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_7); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_7_1987); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_7_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8_1988); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8_e); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_8_i); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_9); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_9_1989); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_8859_9_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_100); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_101); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_109); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_110); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_126); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_127); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_138); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_144); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_148); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_149); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_157); + Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_58); Py_VISIT(traverse_module_state->__pyx_n_s_isomorph); Py_VISIT(traverse_module_state->__pyx_n_s_keys); + Py_VISIT(traverse_module_state->__pyx_n_u_koi); + Py_VISIT(traverse_module_state->__pyx_n_u_koi8); + Py_VISIT(traverse_module_state->__pyx_kp_u_koi8_r); + Py_VISIT(traverse_module_state->__pyx_n_u_koi8_r_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_koi8_ru); + Py_VISIT(traverse_module_state->__pyx_kp_u_koi8_u); + Py_VISIT(traverse_module_state->__pyx_n_u_korean); + Py_VISIT(traverse_module_state->__pyx_kp_u_ks_c_5601_1987); + Py_VISIT(traverse_module_state->__pyx_kp_u_ks_c_5601_1989); + Py_VISIT(traverse_module_state->__pyx_n_u_ksc5601); + Py_VISIT(traverse_module_state->__pyx_n_u_ksc_5601); + Py_VISIT(traverse_module_state->__pyx_n_u_l1); + Py_VISIT(traverse_module_state->__pyx_n_u_l2); + Py_VISIT(traverse_module_state->__pyx_n_u_l3); + Py_VISIT(traverse_module_state->__pyx_n_u_l4); + Py_VISIT(traverse_module_state->__pyx_n_u_l5); + Py_VISIT(traverse_module_state->__pyx_n_u_l6); + Py_VISIT(traverse_module_state->__pyx_n_u_l9); + Py_VISIT(traverse_module_state->__pyx_n_s_label); Py_VISIT(traverse_module_state->__pyx_n_s_last); + Py_VISIT(traverse_module_state->__pyx_n_s_last_digit); + Py_VISIT(traverse_module_state->__pyx_n_u_latin1); + Py_VISIT(traverse_module_state->__pyx_n_u_latin2); + Py_VISIT(traverse_module_state->__pyx_n_u_latin3); + Py_VISIT(traverse_module_state->__pyx_n_u_latin4); + Py_VISIT(traverse_module_state->__pyx_n_u_latin5); + Py_VISIT(traverse_module_state->__pyx_n_u_latin6); Py_VISIT(traverse_module_state->__pyx_n_s_length); Py_VISIT(traverse_module_state->__pyx_n_u_localhost); + Py_VISIT(traverse_module_state->__pyx_n_u_logical); + Py_VISIT(traverse_module_state->__pyx_n_s_lookup); Py_VISIT(traverse_module_state->__pyx_n_s_lower); + Py_VISIT(traverse_module_state->__pyx_n_s_lru_cache); + Py_VISIT(traverse_module_state->__pyx_n_u_mac); + Py_VISIT(traverse_module_state->__pyx_kp_u_mac_cyrillic); + Py_VISIT(traverse_module_state->__pyx_n_u_macintosh); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_math); + Py_VISIT(traverse_module_state->__pyx_n_s_maxsize); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_min_length); Py_VISIT(traverse_module_state->__pyx_n_s_module); + Py_VISIT(traverse_module_state->__pyx_n_u_ms932); + Py_VISIT(traverse_module_state->__pyx_n_u_ms_kanji); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_number); @@ -3981,6 +4956,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_query_percent_encode_set); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_range); + Py_VISIT(traverse_module_state->__pyx_n_u_replacement); Py_VISIT(traverse_module_state->__pyx_n_s_result); Py_VISIT(traverse_module_state->__pyx_n_s_return); Py_VISIT(traverse_module_state->__pyx_n_s_scheme); @@ -3996,28 +4972,47 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_serialize_url_path); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_setter); + Py_VISIT(traverse_module_state->__pyx_kp_u_shift_jis); + Py_VISIT(traverse_module_state->__pyx_n_u_shift_jis_2); + Py_VISIT(traverse_module_state->__pyx_n_s_short_windows_125); Py_VISIT(traverse_module_state->__pyx_n_s_shorten_path); + Py_VISIT(traverse_module_state->__pyx_n_u_sjis); Py_VISIT(traverse_module_state->__pyx_n_s_skip_authority_shortcut); Py_VISIT(traverse_module_state->__pyx_n_s_space_as_plus); + Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_special_query_percent_encode_set); Py_VISIT(traverse_module_state->__pyx_n_s_starts_with_windows_drive_lette); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_str); Py_VISIT(traverse_module_state->__pyx_n_s_strip); + Py_VISIT(traverse_module_state->__pyx_n_u_sun_eu_greek); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_swaps); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_throw); + Py_VISIT(traverse_module_state->__pyx_kp_u_tis_620); Py_VISIT(traverse_module_state->__pyx_n_s_to_ascii); Py_VISIT(traverse_module_state->__pyx_n_s_transitional_processing); Py_VISIT(traverse_module_state->__pyx_n_s_translate); Py_VISIT(traverse_module_state->__pyx_n_s_typing); + Py_VISIT(traverse_module_state->__pyx_kp_u_ucs_2); + Py_VISIT(traverse_module_state->__pyx_n_u_unicode); + Py_VISIT(traverse_module_state->__pyx_n_u_unicode11utf8); + Py_VISIT(traverse_module_state->__pyx_n_u_unicode20utf8); + Py_VISIT(traverse_module_state->__pyx_kp_u_unicode_1_1_utf_8); + Py_VISIT(traverse_module_state->__pyx_n_u_unicodefeff); + Py_VISIT(traverse_module_state->__pyx_n_u_unicodefffe); Py_VISIT(traverse_module_state->__pyx_n_s_unquote); Py_VISIT(traverse_module_state->__pyx_n_s_url); Py_VISIT(traverse_module_state->__pyx_n_s_urllib_parse); + Py_VISIT(traverse_module_state->__pyx_kp_u_us_ascii); Py_VISIT(traverse_module_state->__pyx_n_s_use_std3_ascii_rules); Py_VISIT(traverse_module_state->__pyx_n_s_userinfo_percent_encode_set); Py_VISIT(traverse_module_state->__pyx_n_s_username); + Py_VISIT(traverse_module_state->__pyx_n_u_utf8); + Py_VISIT(traverse_module_state->__pyx_kp_u_utf_16); + Py_VISIT(traverse_module_state->__pyx_kp_u_utf_16be); + Py_VISIT(traverse_module_state->__pyx_kp_u_utf_16le); Py_VISIT(traverse_module_state->__pyx_kp_u_utf_8); Py_VISIT(traverse_module_state->__pyx_n_s_utf_8_percent_encode); Py_VISIT(traverse_module_state->__pyx_n_s_util); @@ -4025,11 +5020,30 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_validation_error); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_verify_dns_length); + Py_VISIT(traverse_module_state->__pyx_n_u_visual); Py_VISIT(traverse_module_state->__pyx_n_s_w3lib__url); Py_VISIT(traverse_module_state->__pyx_kp_s_w3lib__url_pyx); + Py_VISIT(traverse_module_state->__pyx_kp_u_windows_125); + Py_VISIT(traverse_module_state->__pyx_kp_u_windows_1252); + Py_VISIT(traverse_module_state->__pyx_kp_u_windows_1254); + Py_VISIT(traverse_module_state->__pyx_kp_u_windows_31j); + Py_VISIT(traverse_module_state->__pyx_kp_u_windows_874); + Py_VISIT(traverse_module_state->__pyx_kp_u_windows_949); Py_VISIT(traverse_module_state->__pyx_n_u_ws); Py_VISIT(traverse_module_state->__pyx_n_u_wss); Py_VISIT(traverse_module_state->__pyx_n_u_x); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_cp125); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_cp1252); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_cp1254); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_euc_jp); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_gbk); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_mac_cyrillic); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_mac_roman); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_mac_ukrainian); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_sjis); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_unicode20utf8); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_user_defined); + Py_VISIT(traverse_module_state->__pyx_kp_u_x_x_big5); Py_VISIT(traverse_module_state->__pyx_n_u_xmlcharrefreplace); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); @@ -4040,17 +5054,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_int_6); Py_VISIT(traverse_module_state->__pyx_int_7); Py_VISIT(traverse_module_state->__pyx_int_8); - Py_VISIT(traverse_module_state->__pyx_int_9); Py_VISIT(traverse_module_state->__pyx_int_10); - Py_VISIT(traverse_module_state->__pyx_int_11); - Py_VISIT(traverse_module_state->__pyx_int_12); - Py_VISIT(traverse_module_state->__pyx_int_13); - Py_VISIT(traverse_module_state->__pyx_int_14); - Py_VISIT(traverse_module_state->__pyx_int_15); Py_VISIT(traverse_module_state->__pyx_int_16); - Py_VISIT(traverse_module_state->__pyx_int_17); - Py_VISIT(traverse_module_state->__pyx_int_18); - Py_VISIT(traverse_module_state->__pyx_int_19); Py_VISIT(traverse_module_state->__pyx_int_21); Py_VISIT(traverse_module_state->__pyx_int_32); Py_VISIT(traverse_module_state->__pyx_int_80); @@ -4062,54 +5067,98 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_slice_); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_slice__20); - Py_VISIT(traverse_module_state->__pyx_tuple__24); + Py_VISIT(traverse_module_state->__pyx_tuple__25); + Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__28); + Py_VISIT(traverse_module_state->__pyx_tuple__29); + Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__31); + Py_VISIT(traverse_module_state->__pyx_tuple__32); + Py_VISIT(traverse_module_state->__pyx_tuple__33); Py_VISIT(traverse_module_state->__pyx_tuple__34); + Py_VISIT(traverse_module_state->__pyx_tuple__35); + Py_VISIT(traverse_module_state->__pyx_tuple__36); + Py_VISIT(traverse_module_state->__pyx_tuple__37); + Py_VISIT(traverse_module_state->__pyx_tuple__38); + Py_VISIT(traverse_module_state->__pyx_tuple__39); + Py_VISIT(traverse_module_state->__pyx_tuple__40); + Py_VISIT(traverse_module_state->__pyx_tuple__41); + Py_VISIT(traverse_module_state->__pyx_tuple__42); + Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__44); + Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_tuple__46); + Py_VISIT(traverse_module_state->__pyx_tuple__47); Py_VISIT(traverse_module_state->__pyx_tuple__48); + Py_VISIT(traverse_module_state->__pyx_tuple__49); Py_VISIT(traverse_module_state->__pyx_tuple__50); + Py_VISIT(traverse_module_state->__pyx_tuple__51); Py_VISIT(traverse_module_state->__pyx_tuple__52); + Py_VISIT(traverse_module_state->__pyx_tuple__53); Py_VISIT(traverse_module_state->__pyx_tuple__54); + Py_VISIT(traverse_module_state->__pyx_tuple__55); Py_VISIT(traverse_module_state->__pyx_tuple__56); + Py_VISIT(traverse_module_state->__pyx_tuple__57); Py_VISIT(traverse_module_state->__pyx_tuple__58); + Py_VISIT(traverse_module_state->__pyx_tuple__59); Py_VISIT(traverse_module_state->__pyx_tuple__60); + Py_VISIT(traverse_module_state->__pyx_tuple__61); Py_VISIT(traverse_module_state->__pyx_tuple__62); + Py_VISIT(traverse_module_state->__pyx_tuple__63); + Py_VISIT(traverse_module_state->__pyx_tuple__64); Py_VISIT(traverse_module_state->__pyx_tuple__66); - Py_VISIT(traverse_module_state->__pyx_tuple__68); - Py_VISIT(traverse_module_state->__pyx_tuple__70); - Py_VISIT(traverse_module_state->__pyx_tuple__72); - Py_VISIT(traverse_module_state->__pyx_tuple__74); + Py_VISIT(traverse_module_state->__pyx_tuple__67); + Py_VISIT(traverse_module_state->__pyx_tuple__69); + Py_VISIT(traverse_module_state->__pyx_tuple__73); Py_VISIT(traverse_module_state->__pyx_tuple__76); - Py_VISIT(traverse_module_state->__pyx_tuple__78); - Py_VISIT(traverse_module_state->__pyx_tuple__80); - Py_VISIT(traverse_module_state->__pyx_codeobj__25); + Py_VISIT(traverse_module_state->__pyx_tuple__79); + Py_VISIT(traverse_module_state->__pyx_tuple__89); + Py_VISIT(traverse_module_state->__pyx_tuple__91); + Py_VISIT(traverse_module_state->__pyx_tuple__93); + Py_VISIT(traverse_module_state->__pyx_tuple__95); + Py_VISIT(traverse_module_state->__pyx_tuple__97); + Py_VISIT(traverse_module_state->__pyx_tuple__99); + Py_VISIT(traverse_module_state->__pyx_tuple__101); + Py_VISIT(traverse_module_state->__pyx_tuple__103); + Py_VISIT(traverse_module_state->__pyx_tuple__105); + Py_VISIT(traverse_module_state->__pyx_tuple__107); + Py_VISIT(traverse_module_state->__pyx_tuple__111); + Py_VISIT(traverse_module_state->__pyx_tuple__113); + Py_VISIT(traverse_module_state->__pyx_tuple__115); + Py_VISIT(traverse_module_state->__pyx_tuple__117); + Py_VISIT(traverse_module_state->__pyx_tuple__119); + Py_VISIT(traverse_module_state->__pyx_tuple__121); + Py_VISIT(traverse_module_state->__pyx_tuple__123); + Py_VISIT(traverse_module_state->__pyx_tuple__125); Py_VISIT(traverse_module_state->__pyx_codeobj__26); - Py_VISIT(traverse_module_state->__pyx_codeobj__27); - Py_VISIT(traverse_module_state->__pyx_codeobj__29); - Py_VISIT(traverse_module_state->__pyx_codeobj__32); - Py_VISIT(traverse_module_state->__pyx_codeobj__35); - Py_VISIT(traverse_module_state->__pyx_codeobj__45); - Py_VISIT(traverse_module_state->__pyx_codeobj__47); - Py_VISIT(traverse_module_state->__pyx_codeobj__49); - Py_VISIT(traverse_module_state->__pyx_codeobj__51); - Py_VISIT(traverse_module_state->__pyx_codeobj__53); - Py_VISIT(traverse_module_state->__pyx_codeobj__55); - Py_VISIT(traverse_module_state->__pyx_codeobj__57); - Py_VISIT(traverse_module_state->__pyx_codeobj__59); - Py_VISIT(traverse_module_state->__pyx_codeobj__61); - Py_VISIT(traverse_module_state->__pyx_codeobj__63); - Py_VISIT(traverse_module_state->__pyx_codeobj__64); Py_VISIT(traverse_module_state->__pyx_codeobj__65); - Py_VISIT(traverse_module_state->__pyx_codeobj__67); - Py_VISIT(traverse_module_state->__pyx_codeobj__69); + Py_VISIT(traverse_module_state->__pyx_codeobj__68); + Py_VISIT(traverse_module_state->__pyx_codeobj__70); Py_VISIT(traverse_module_state->__pyx_codeobj__71); - Py_VISIT(traverse_module_state->__pyx_codeobj__73); - Py_VISIT(traverse_module_state->__pyx_codeobj__75); + Py_VISIT(traverse_module_state->__pyx_codeobj__72); + Py_VISIT(traverse_module_state->__pyx_codeobj__74); Py_VISIT(traverse_module_state->__pyx_codeobj__77); - Py_VISIT(traverse_module_state->__pyx_codeobj__79); - Py_VISIT(traverse_module_state->__pyx_codeobj__81); + Py_VISIT(traverse_module_state->__pyx_codeobj__80); + Py_VISIT(traverse_module_state->__pyx_codeobj__90); + Py_VISIT(traverse_module_state->__pyx_codeobj__92); + Py_VISIT(traverse_module_state->__pyx_codeobj__94); + Py_VISIT(traverse_module_state->__pyx_codeobj__96); + Py_VISIT(traverse_module_state->__pyx_codeobj__98); + Py_VISIT(traverse_module_state->__pyx_codeobj__100); + Py_VISIT(traverse_module_state->__pyx_codeobj__102); + Py_VISIT(traverse_module_state->__pyx_codeobj__104); + Py_VISIT(traverse_module_state->__pyx_codeobj__106); + Py_VISIT(traverse_module_state->__pyx_codeobj__108); + Py_VISIT(traverse_module_state->__pyx_codeobj__109); + Py_VISIT(traverse_module_state->__pyx_codeobj__110); + Py_VISIT(traverse_module_state->__pyx_codeobj__112); + Py_VISIT(traverse_module_state->__pyx_codeobj__114); + Py_VISIT(traverse_module_state->__pyx_codeobj__116); + Py_VISIT(traverse_module_state->__pyx_codeobj__118); + Py_VISIT(traverse_module_state->__pyx_codeobj__120); + Py_VISIT(traverse_module_state->__pyx_codeobj__122); + Py_VISIT(traverse_module_state->__pyx_codeobj__124); + Py_VISIT(traverse_module_state->__pyx_codeobj__126); return 0; } #endif @@ -4159,54 +5208,47 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_u_2e_2e __pyx_mstate_global->__pyx_kp_u_2e_2e #define __pyx_kp_u_2e_3 __pyx_mstate_global->__pyx_kp_u_2e_3 #define __pyx_kp_u_40 __pyx_mstate_global->__pyx_kp_u_40 +#define __pyx_kp_u_866 __pyx_mstate_global->__pyx_kp_u_866 #define __pyx_n_s_ASCII_ALPHA __pyx_mstate_global->__pyx_n_s_ASCII_ALPHA #define __pyx_n_s_ASCII_ALPHANUMERIC __pyx_mstate_global->__pyx_n_s_ASCII_ALPHANUMERIC #define __pyx_n_s_ASCII_DIGIT __pyx_mstate_global->__pyx_n_s_ASCII_DIGIT #define __pyx_n_s_ASCII_HEX_DIGIT __pyx_mstate_global->__pyx_n_s_ASCII_HEX_DIGIT #define __pyx_n_s_ASCII_TAB_OR_NEWLINE __pyx_mstate_global->__pyx_n_s_ASCII_TAB_OR_NEWLINE #define __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO __pyx_mstate_global->__pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO -#define __pyx_n_s_AUTHORITY __pyx_mstate_global->__pyx_n_s_AUTHORITY +#define __pyx_n_s_ASCII_WHITESPACE __pyx_mstate_global->__pyx_n_s_ASCII_WHITESPACE +#define __pyx_n_s_AnyStr __pyx_mstate_global->__pyx_n_s_AnyStr #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError #define __pyx_n_s_C0_CONTROL __pyx_mstate_global->__pyx_n_s_C0_CONTROL #define __pyx_n_s_C0_CONTROL_OR_SPACE __pyx_mstate_global->__pyx_n_s_C0_CONTROL_OR_SPACE #define __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET +#define __pyx_n_s_Callable __pyx_mstate_global->__pyx_n_s_Callable +#define __pyx_n_s_CodecFunction __pyx_mstate_global->__pyx_n_s_CodecFunction #define __pyx_n_s_DEFAULT_PORTS __pyx_mstate_global->__pyx_n_s_DEFAULT_PORTS +#define __pyx_n_s_DecodeFunction __pyx_mstate_global->__pyx_n_s_DecodeFunction +#define __pyx_n_s_Dict __pyx_mstate_global->__pyx_n_s_Dict +#define __pyx_kp_s_Dict_str_str __pyx_mstate_global->__pyx_kp_s_Dict_str_str #define __pyx_kp_u_Domain_name __pyx_mstate_global->__pyx_kp_u_Domain_name -#define __pyx_n_s_FILE __pyx_mstate_global->__pyx_n_s_FILE -#define __pyx_n_s_FILE_HOST __pyx_mstate_global->__pyx_n_s_FILE_HOST -#define __pyx_n_s_FILE_SLASH __pyx_mstate_global->__pyx_n_s_FILE_SLASH +#define __pyx_n_s_EncodeFunction __pyx_mstate_global->__pyx_n_s_EncodeFunction #define __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS __pyx_mstate_global->__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS #define __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS __pyx_mstate_global->__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS -#define __pyx_n_s_FRAGMENT __pyx_mstate_global->__pyx_n_s_FRAGMENT #define __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET -#define __pyx_n_s_HOST __pyx_mstate_global->__pyx_n_s_HOST #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError +#define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError +#define __pyx_n_s_LABEL_ENCODINGS __pyx_mstate_global->__pyx_n_s_LABEL_ENCODINGS #define __pyx_n_s_List __pyx_mstate_global->__pyx_n_s_List #define __pyx_kp_s_List_int __pyx_mstate_global->__pyx_kp_s_List_int -#define __pyx_n_s_NO_SCHEME __pyx_mstate_global->__pyx_n_s_NO_SCHEME #define __pyx_n_s_None __pyx_mstate_global->__pyx_n_s_None -#define __pyx_n_s_OPAQUE_PATH __pyx_mstate_global->__pyx_n_s_OPAQUE_PATH +#define __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS __pyx_mstate_global->__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS #define __pyx_n_s_Optional __pyx_mstate_global->__pyx_n_s_Optional #define __pyx_kp_s_Optional_bool __pyx_mstate_global->__pyx_kp_s_Optional_bool #define __pyx_kp_s_Optional_int __pyx_mstate_global->__pyx_kp_s_Optional_int #define __pyx_kp_s_Optional_str __pyx_mstate_global->__pyx_kp_s_Optional_str -#define __pyx_n_s_PATH __pyx_mstate_global->__pyx_n_s_PATH -#define __pyx_n_s_PATH_OR_AUTHORITY __pyx_mstate_global->__pyx_n_s_PATH_OR_AUTHORITY #define __pyx_n_s_PATH_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_PATH_PERCENT_ENCODE_SET -#define __pyx_n_s_PATH_START __pyx_mstate_global->__pyx_n_s_PATH_START -#define __pyx_n_s_PORT __pyx_mstate_global->__pyx_n_s_PORT #define __pyx_n_s_PercentEncodeSet __pyx_mstate_global->__pyx_n_s_PercentEncodeSet -#define __pyx_n_s_QUERY __pyx_mstate_global->__pyx_n_s_QUERY #define __pyx_n_s_QUERY_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_QUERY_PERCENT_ENCODE_SET -#define __pyx_n_s_RELATIVE __pyx_mstate_global->__pyx_n_s_RELATIVE -#define __pyx_n_s_RELATIVE_SLASH __pyx_mstate_global->__pyx_n_s_RELATIVE_SLASH -#define __pyx_n_s_SCHEME __pyx_mstate_global->__pyx_n_s_SCHEME +#define __pyx_n_s_REPLACEMENT_ENCODING __pyx_mstate_global->__pyx_n_s_REPLACEMENT_ENCODING #define __pyx_n_s_SCHEME_CHARS __pyx_mstate_global->__pyx_n_s_SCHEME_CHARS -#define __pyx_n_s_SCHEME_START __pyx_mstate_global->__pyx_n_s_SCHEME_START -#define __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES __pyx_mstate_global->__pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES -#define __pyx_n_s_SPECIAL_AUTHORITY_SLASHES __pyx_mstate_global->__pyx_n_s_SPECIAL_AUTHORITY_SLASHES #define __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE __pyx_mstate_global->__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE -#define __pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY __pyx_mstate_global->__pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY #define __pyx_n_s_SPECIAL_SCHEMES __pyx_mstate_global->__pyx_n_s_SPECIAL_SCHEMES #define __pyx_n_s_Tuple __pyx_mstate_global->__pyx_n_s_Tuple #define __pyx_kp_s_Tuple_int_bool __pyx_mstate_global->__pyx_kp_s_Tuple_int_bool @@ -4215,6 +5257,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_URL_has_opaque_path __pyx_mstate_global->__pyx_n_s_URL_has_opaque_path #define __pyx_n_s_URL_scheme __pyx_mstate_global->__pyx_n_s_URL_scheme #define __pyx_n_s_USERINFO_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_USERINFO_PERCENT_ENCODE_SET +#define __pyx_n_s_UTF_16BE_ENCODING __pyx_mstate_global->__pyx_n_s_UTF_16BE_ENCODING +#define __pyx_n_s_UTF_16LE_ENCODING __pyx_mstate_global->__pyx_n_s_UTF_16LE_ENCODING +#define __pyx_n_s_UTF_8_ENCODER __pyx_mstate_global->__pyx_n_s_UTF_8_ENCODER +#define __pyx_n_s_UTF_8_ENCODING __pyx_mstate_global->__pyx_n_s_UTF_8_ENCODING #define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union #define __pyx_kp_s_Union_int_List_int_str __pyx_mstate_global->__pyx_kp_s_Union_int_List_int_str #define __pyx_kp_s_Union_str_List_str __pyx_mstate_global->__pyx_kp_s_Union_str_List_str @@ -4236,33 +5282,40 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_u__21 __pyx_mstate_global->__pyx_kp_u__21 #define __pyx_kp_u__22 __pyx_mstate_global->__pyx_kp_u__22 #define __pyx_kp_u__23 __pyx_mstate_global->__pyx_kp_u__23 +#define __pyx_n_s__24 __pyx_mstate_global->__pyx_n_s__24 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 -#define __pyx_kp_u__30 __pyx_mstate_global->__pyx_kp_u__30 -#define __pyx_n_s__33 __pyx_mstate_global->__pyx_n_s__33 -#define __pyx_kp_u__36 __pyx_mstate_global->__pyx_kp_u__36 -#define __pyx_kp_u__37 __pyx_mstate_global->__pyx_kp_u__37 -#define __pyx_kp_u__38 __pyx_mstate_global->__pyx_kp_u__38 -#define __pyx_kp_u__39 __pyx_mstate_global->__pyx_kp_u__39 #define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 -#define __pyx_kp_u__40 __pyx_mstate_global->__pyx_kp_u__40 -#define __pyx_kp_u__41 __pyx_mstate_global->__pyx_kp_u__41 -#define __pyx_kp_u__42 __pyx_mstate_global->__pyx_kp_u__42 -#define __pyx_kp_u__43 __pyx_mstate_global->__pyx_kp_u__43 #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 #define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 +#define __pyx_kp_u__75 __pyx_mstate_global->__pyx_kp_u__75 +#define __pyx_n_s__78 __pyx_mstate_global->__pyx_n_s__78 #define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8 +#define __pyx_kp_u__81 __pyx_mstate_global->__pyx_kp_u__81 +#define __pyx_kp_u__82 __pyx_mstate_global->__pyx_kp_u__82 +#define __pyx_kp_u__83 __pyx_mstate_global->__pyx_kp_u__83 +#define __pyx_kp_u__84 __pyx_mstate_global->__pyx_kp_u__84 +#define __pyx_kp_u__85 __pyx_mstate_global->__pyx_kp_u__85 +#define __pyx_kp_u__86 __pyx_mstate_global->__pyx_kp_u__86 +#define __pyx_kp_u__87 __pyx_mstate_global->__pyx_kp_u__87 +#define __pyx_kp_u__88 __pyx_mstate_global->__pyx_kp_u__88 #define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9 #define __pyx_n_s_address __pyx_mstate_global->__pyx_n_s_address #define __pyx_n_s_annotations __pyx_mstate_global->__pyx_n_s_annotations +#define __pyx_kp_u_ansi_x3_4_1968 __pyx_mstate_global->__pyx_kp_u_ansi_x3_4_1968 #define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append +#define __pyx_n_u_arabic __pyx_mstate_global->__pyx_n_u_arabic #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args +#define __pyx_n_u_ascii __pyx_mstate_global->__pyx_n_u_ascii #define __pyx_n_s_ascii_domain __pyx_mstate_global->__pyx_n_s_ascii_domain +#define __pyx_kp_u_asmo_708 __pyx_mstate_global->__pyx_kp_u_asmo_708 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_at_sign_index __pyx_mstate_global->__pyx_n_s_at_sign_index #define __pyx_n_s_at_sign_seen __pyx_mstate_global->__pyx_n_s_at_sign_seen #define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base #define __pyx_n_s_base_url __pyx_mstate_global->__pyx_n_s_base_url #define __pyx_n_s_be_strict __pyx_mstate_global->__pyx_n_s_be_strict +#define __pyx_n_u_big5 __pyx_mstate_global->__pyx_n_u_big5 +#define __pyx_kp_u_big5_hkscs __pyx_mstate_global->__pyx_kp_u_big5_hkscs #define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool #define __pyx_n_s_buffer __pyx_mstate_global->__pyx_n_s_buffer #define __pyx_n_s_byte __pyx_mstate_global->__pyx_n_s_byte @@ -4271,51 +5324,109 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_check_bidi __pyx_mstate_global->__pyx_n_s_check_bidi #define __pyx_n_s_check_hyphens __pyx_mstate_global->__pyx_n_s_check_hyphens #define __pyx_n_s_check_joiners __pyx_mstate_global->__pyx_n_s_check_joiners +#define __pyx_n_u_chinese __pyx_mstate_global->__pyx_n_u_chinese #define __pyx_n_s_chr __pyx_mstate_global->__pyx_n_s_chr #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close +#define __pyx_kp_u_cn_big5 __pyx_mstate_global->__pyx_kp_u_cn_big5 #define __pyx_n_s_code_point __pyx_mstate_global->__pyx_n_s_code_point +#define __pyx_n_s_codec_info __pyx_mstate_global->__pyx_n_s_codec_info +#define __pyx_n_s_codecs __pyx_mstate_global->__pyx_n_s_codecs #define __pyx_n_s_compress __pyx_mstate_global->__pyx_n_s_compress #define __pyx_n_s_counter __pyx_mstate_global->__pyx_n_s_counter +#define __pyx_n_u_cp125 __pyx_mstate_global->__pyx_n_u_cp125 +#define __pyx_n_u_cp1252 __pyx_mstate_global->__pyx_n_u_cp1252 +#define __pyx_n_u_cp1254 __pyx_mstate_global->__pyx_n_u_cp1254 +#define __pyx_n_u_cp819 __pyx_mstate_global->__pyx_n_u_cp819 +#define __pyx_n_u_cp866 __pyx_mstate_global->__pyx_n_u_cp866 +#define __pyx_n_u_cp874 __pyx_mstate_global->__pyx_n_u_cp874 +#define __pyx_n_u_csbig5 __pyx_mstate_global->__pyx_n_u_csbig5 +#define __pyx_n_u_cseuckr __pyx_mstate_global->__pyx_n_u_cseuckr +#define __pyx_n_u_cseucpkdfmtjapanese __pyx_mstate_global->__pyx_n_u_cseucpkdfmtjapanese +#define __pyx_n_u_csgb2312 __pyx_mstate_global->__pyx_n_u_csgb2312 +#define __pyx_n_u_csibm866 __pyx_mstate_global->__pyx_n_u_csibm866 +#define __pyx_n_u_csiso2022jp __pyx_mstate_global->__pyx_n_u_csiso2022jp +#define __pyx_n_u_csiso2022kr __pyx_mstate_global->__pyx_n_u_csiso2022kr +#define __pyx_n_u_csiso58gb231280 __pyx_mstate_global->__pyx_n_u_csiso58gb231280 +#define __pyx_n_u_csiso88596e __pyx_mstate_global->__pyx_n_u_csiso88596e +#define __pyx_n_u_csiso88596i __pyx_mstate_global->__pyx_n_u_csiso88596i +#define __pyx_n_u_csiso88598e __pyx_mstate_global->__pyx_n_u_csiso88598e +#define __pyx_n_u_csiso88598i __pyx_mstate_global->__pyx_n_u_csiso88598i +#define __pyx_n_u_csisolatin1 __pyx_mstate_global->__pyx_n_u_csisolatin1 +#define __pyx_n_u_csisolatin2 __pyx_mstate_global->__pyx_n_u_csisolatin2 +#define __pyx_n_u_csisolatin3 __pyx_mstate_global->__pyx_n_u_csisolatin3 +#define __pyx_n_u_csisolatin4 __pyx_mstate_global->__pyx_n_u_csisolatin4 +#define __pyx_n_u_csisolatin5 __pyx_mstate_global->__pyx_n_u_csisolatin5 +#define __pyx_n_u_csisolatin6 __pyx_mstate_global->__pyx_n_u_csisolatin6 +#define __pyx_n_u_csisolatin9 __pyx_mstate_global->__pyx_n_u_csisolatin9 +#define __pyx_n_u_csisolatinarabic __pyx_mstate_global->__pyx_n_u_csisolatinarabic +#define __pyx_n_u_csisolatincyrillic __pyx_mstate_global->__pyx_n_u_csisolatincyrillic +#define __pyx_n_u_csisolatingreek __pyx_mstate_global->__pyx_n_u_csisolatingreek +#define __pyx_n_u_csisolatinhebrew __pyx_mstate_global->__pyx_n_u_csisolatinhebrew +#define __pyx_n_u_cskoi8r __pyx_mstate_global->__pyx_n_u_cskoi8r +#define __pyx_n_u_csksc56011987 __pyx_mstate_global->__pyx_n_u_csksc56011987 +#define __pyx_n_u_csmacintosh __pyx_mstate_global->__pyx_n_u_csmacintosh +#define __pyx_n_u_csshiftjis __pyx_mstate_global->__pyx_n_u_csshiftjis +#define __pyx_n_u_csunicode __pyx_mstate_global->__pyx_n_u_csunicode #define __pyx_n_s_current_index __pyx_mstate_global->__pyx_n_s_current_index #define __pyx_n_s_current_length __pyx_mstate_global->__pyx_n_s_current_length +#define __pyx_n_u_cyrillic __pyx_mstate_global->__pyx_n_u_cyrillic #define __pyx_n_s_default_port_seen __pyx_mstate_global->__pyx_n_s_default_port_seen #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc +#define __pyx_kp_u_does_not_match_any_encoding_lab __pyx_mstate_global->__pyx_kp_u_does_not_match_any_encoding_lab #define __pyx_n_s_domain __pyx_mstate_global->__pyx_n_s_domain #define __pyx_n_s_domain_to_ascii __pyx_mstate_global->__pyx_n_s_domain_to_ascii +#define __pyx_kp_u_dos_874 __pyx_mstate_global->__pyx_kp_u_dos_874 +#define __pyx_kp_u_ecma_114 __pyx_mstate_global->__pyx_kp_u_ecma_114 +#define __pyx_kp_u_ecma_118 __pyx_mstate_global->__pyx_kp_u_ecma_118 +#define __pyx_n_u_elot_928 __pyx_mstate_global->__pyx_n_u_elot_928 #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable +#define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_encode_output __pyx_mstate_global->__pyx_n_s_encode_output #define __pyx_n_s_encode_set __pyx_mstate_global->__pyx_n_s_encode_set #define __pyx_n_s_encoded __pyx_mstate_global->__pyx_n_s_encoded #define __pyx_n_s_encoded_code_points __pyx_mstate_global->__pyx_n_s_encoded_code_points #define __pyx_n_s_encoder __pyx_mstate_global->__pyx_n_s_encoder #define __pyx_n_s_encoding __pyx_mstate_global->__pyx_n_s_encoding -#define __pyx_n_s_encoding_2 __pyx_mstate_global->__pyx_n_s_encoding_2 #define __pyx_n_s_ends_in_number __pyx_mstate_global->__pyx_n_s_ends_in_number #define __pyx_n_s_ends_in_number_locals_genexpr __pyx_mstate_global->__pyx_n_s_ends_in_number_locals_genexpr #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate +#define __pyx_kp_u_euc_jp __pyx_mstate_global->__pyx_kp_u_euc_jp +#define __pyx_kp_u_euc_kr __pyx_mstate_global->__pyx_kp_u_euc_kr #define __pyx_n_s_exclude_fragment __pyx_mstate_global->__pyx_n_s_exclude_fragment #define __pyx_n_u_file __pyx_mstate_global->__pyx_n_u_file #define __pyx_n_s_floor __pyx_mstate_global->__pyx_n_s_floor #define __pyx_n_s_fragment __pyx_mstate_global->__pyx_n_s_fragment #define __pyx_n_s_fragment_percent_encode_set __pyx_mstate_global->__pyx_n_s_fragment_percent_encode_set #define __pyx_n_u_ftp __pyx_mstate_global->__pyx_n_u_ftp +#define __pyx_n_s_functools __pyx_mstate_global->__pyx_n_s_functools +#define __pyx_n_u_gb18030 __pyx_mstate_global->__pyx_n_u_gb18030 +#define __pyx_n_u_gb2312 __pyx_mstate_global->__pyx_n_u_gb2312 +#define __pyx_n_u_gb_2312 __pyx_mstate_global->__pyx_n_u_gb_2312 +#define __pyx_kp_u_gb_2312_80 __pyx_mstate_global->__pyx_kp_u_gb_2312_80 +#define __pyx_n_u_gbk __pyx_mstate_global->__pyx_n_u_gbk #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_encoder __pyx_mstate_global->__pyx_n_s_get_encoder +#define __pyx_n_s_get_encoding __pyx_mstate_global->__pyx_n_s_get_encoding #define __pyx_n_s_get_ipv6_first_longest_0_piece __pyx_mstate_global->__pyx_n_s_get_ipv6_first_longest_0_piece -#define __pyx_n_s_get_output_encoding __pyx_mstate_global->__pyx_n_s_get_output_encoding #define __pyx_n_s_greater_than __pyx_mstate_global->__pyx_n_s_greater_than +#define __pyx_n_u_greek __pyx_mstate_global->__pyx_n_u_greek +#define __pyx_n_u_greek8 __pyx_mstate_global->__pyx_n_u_greek8 #define __pyx_n_s_has_opaque_path __pyx_mstate_global->__pyx_n_s_has_opaque_path +#define __pyx_n_u_hebrew __pyx_mstate_global->__pyx_n_u_hebrew #define __pyx_n_s_host __pyx_mstate_global->__pyx_n_s_host #define __pyx_n_s_hostname __pyx_mstate_global->__pyx_n_s_hostname #define __pyx_n_u_http __pyx_mstate_global->__pyx_n_u_http #define __pyx_n_u_https __pyx_mstate_global->__pyx_n_u_https +#define __pyx_kp_u_hz_gb_2312 __pyx_mstate_global->__pyx_kp_u_hz_gb_2312 #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i +#define __pyx_n_u_ibm819 __pyx_mstate_global->__pyx_n_u_ibm819 +#define __pyx_n_u_ibm866 __pyx_mstate_global->__pyx_n_u_ibm866 #define __pyx_n_s_idempotent_utf_8_percent_encode __pyx_mstate_global->__pyx_n_s_idempotent_utf_8_percent_encode #define __pyx_n_s_ignore0 __pyx_mstate_global->__pyx_n_s_ignore0 #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import @@ -4324,6 +5435,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_infra __pyx_mstate_global->__pyx_n_s_infra #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass +#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_input __pyx_mstate_global->__pyx_n_s_input #define __pyx_n_s_input_lenght __pyx_mstate_global->__pyx_n_s_input_lenght #define __pyx_n_s_input_length __pyx_mstate_global->__pyx_n_s_input_length @@ -4338,17 +5450,135 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_is_special __pyx_mstate_global->__pyx_n_s_is_special #define __pyx_n_s_is_windows_drive_letter __pyx_mstate_global->__pyx_n_s_is_windows_drive_letter #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled +#define __pyx_n_u_iso88591 __pyx_mstate_global->__pyx_n_u_iso88591 +#define __pyx_n_u_iso885910 __pyx_mstate_global->__pyx_n_u_iso885910 +#define __pyx_n_u_iso885911 __pyx_mstate_global->__pyx_n_u_iso885911 +#define __pyx_n_u_iso885913 __pyx_mstate_global->__pyx_n_u_iso885913 +#define __pyx_n_u_iso885914 __pyx_mstate_global->__pyx_n_u_iso885914 +#define __pyx_n_u_iso885915 __pyx_mstate_global->__pyx_n_u_iso885915 +#define __pyx_n_u_iso88592 __pyx_mstate_global->__pyx_n_u_iso88592 +#define __pyx_n_u_iso88593 __pyx_mstate_global->__pyx_n_u_iso88593 +#define __pyx_n_u_iso88594 __pyx_mstate_global->__pyx_n_u_iso88594 +#define __pyx_n_u_iso88595 __pyx_mstate_global->__pyx_n_u_iso88595 +#define __pyx_n_u_iso88596 __pyx_mstate_global->__pyx_n_u_iso88596 +#define __pyx_n_u_iso88597 __pyx_mstate_global->__pyx_n_u_iso88597 +#define __pyx_n_u_iso88598 __pyx_mstate_global->__pyx_n_u_iso88598 +#define __pyx_n_u_iso88599 __pyx_mstate_global->__pyx_n_u_iso88599 +#define __pyx_kp_u_iso8859_1 __pyx_mstate_global->__pyx_kp_u_iso8859_1 +#define __pyx_kp_u_iso8859_10 __pyx_mstate_global->__pyx_kp_u_iso8859_10 +#define __pyx_kp_u_iso8859_11 __pyx_mstate_global->__pyx_kp_u_iso8859_11 +#define __pyx_kp_u_iso8859_13 __pyx_mstate_global->__pyx_kp_u_iso8859_13 +#define __pyx_kp_u_iso8859_14 __pyx_mstate_global->__pyx_kp_u_iso8859_14 +#define __pyx_kp_u_iso8859_15 __pyx_mstate_global->__pyx_kp_u_iso8859_15 +#define __pyx_kp_u_iso8859_2 __pyx_mstate_global->__pyx_kp_u_iso8859_2 +#define __pyx_kp_u_iso8859_3 __pyx_mstate_global->__pyx_kp_u_iso8859_3 +#define __pyx_kp_u_iso8859_4 __pyx_mstate_global->__pyx_kp_u_iso8859_4 +#define __pyx_kp_u_iso8859_5 __pyx_mstate_global->__pyx_kp_u_iso8859_5 +#define __pyx_kp_u_iso8859_6 __pyx_mstate_global->__pyx_kp_u_iso8859_6 +#define __pyx_kp_u_iso8859_7 __pyx_mstate_global->__pyx_kp_u_iso8859_7 +#define __pyx_kp_u_iso8859_8 __pyx_mstate_global->__pyx_kp_u_iso8859_8 +#define __pyx_kp_u_iso8859_9 __pyx_mstate_global->__pyx_kp_u_iso8859_9 +#define __pyx_kp_u_iso_10646_ucs_2 __pyx_mstate_global->__pyx_kp_u_iso_10646_ucs_2 +#define __pyx_kp_u_iso_2022_cn __pyx_mstate_global->__pyx_kp_u_iso_2022_cn +#define __pyx_kp_u_iso_2022_cn_ext __pyx_mstate_global->__pyx_kp_u_iso_2022_cn_ext +#define __pyx_kp_u_iso_2022_jp __pyx_mstate_global->__pyx_kp_u_iso_2022_jp +#define __pyx_kp_u_iso_2022_kr __pyx_mstate_global->__pyx_kp_u_iso_2022_kr +#define __pyx_kp_u_iso_8859_1 __pyx_mstate_global->__pyx_kp_u_iso_8859_1 +#define __pyx_kp_u_iso_8859_10 __pyx_mstate_global->__pyx_kp_u_iso_8859_10 +#define __pyx_kp_u_iso_8859_11 __pyx_mstate_global->__pyx_kp_u_iso_8859_11 +#define __pyx_kp_u_iso_8859_13 __pyx_mstate_global->__pyx_kp_u_iso_8859_13 +#define __pyx_kp_u_iso_8859_14 __pyx_mstate_global->__pyx_kp_u_iso_8859_14 +#define __pyx_kp_u_iso_8859_15 __pyx_mstate_global->__pyx_kp_u_iso_8859_15 +#define __pyx_kp_u_iso_8859_15_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_15_2 +#define __pyx_kp_u_iso_8859_16 __pyx_mstate_global->__pyx_kp_u_iso_8859_16 +#define __pyx_kp_u_iso_8859_1_1987 __pyx_mstate_global->__pyx_kp_u_iso_8859_1_1987 +#define __pyx_kp_u_iso_8859_1_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_1_2 +#define __pyx_kp_u_iso_8859_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_2 +#define __pyx_kp_u_iso_8859_2_1987 __pyx_mstate_global->__pyx_kp_u_iso_8859_2_1987 +#define __pyx_kp_u_iso_8859_2_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_2_2 +#define __pyx_kp_u_iso_8859_3 __pyx_mstate_global->__pyx_kp_u_iso_8859_3 +#define __pyx_kp_u_iso_8859_3_1988 __pyx_mstate_global->__pyx_kp_u_iso_8859_3_1988 +#define __pyx_kp_u_iso_8859_3_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_3_2 +#define __pyx_kp_u_iso_8859_4 __pyx_mstate_global->__pyx_kp_u_iso_8859_4 +#define __pyx_kp_u_iso_8859_4_1988 __pyx_mstate_global->__pyx_kp_u_iso_8859_4_1988 +#define __pyx_kp_u_iso_8859_4_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_4_2 +#define __pyx_kp_u_iso_8859_5 __pyx_mstate_global->__pyx_kp_u_iso_8859_5 +#define __pyx_kp_u_iso_8859_5_1988 __pyx_mstate_global->__pyx_kp_u_iso_8859_5_1988 +#define __pyx_kp_u_iso_8859_5_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_5_2 +#define __pyx_kp_u_iso_8859_6 __pyx_mstate_global->__pyx_kp_u_iso_8859_6 +#define __pyx_kp_u_iso_8859_6_1987 __pyx_mstate_global->__pyx_kp_u_iso_8859_6_1987 +#define __pyx_kp_u_iso_8859_6_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_6_2 +#define __pyx_kp_u_iso_8859_6_e __pyx_mstate_global->__pyx_kp_u_iso_8859_6_e +#define __pyx_kp_u_iso_8859_6_i __pyx_mstate_global->__pyx_kp_u_iso_8859_6_i +#define __pyx_kp_u_iso_8859_7 __pyx_mstate_global->__pyx_kp_u_iso_8859_7 +#define __pyx_kp_u_iso_8859_7_1987 __pyx_mstate_global->__pyx_kp_u_iso_8859_7_1987 +#define __pyx_kp_u_iso_8859_7_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_7_2 +#define __pyx_kp_u_iso_8859_8 __pyx_mstate_global->__pyx_kp_u_iso_8859_8 +#define __pyx_kp_u_iso_8859_8_1988 __pyx_mstate_global->__pyx_kp_u_iso_8859_8_1988 +#define __pyx_kp_u_iso_8859_8_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_8_2 +#define __pyx_kp_u_iso_8859_8_e __pyx_mstate_global->__pyx_kp_u_iso_8859_8_e +#define __pyx_kp_u_iso_8859_8_i __pyx_mstate_global->__pyx_kp_u_iso_8859_8_i +#define __pyx_kp_u_iso_8859_9 __pyx_mstate_global->__pyx_kp_u_iso_8859_9 +#define __pyx_kp_u_iso_8859_9_1989 __pyx_mstate_global->__pyx_kp_u_iso_8859_9_1989 +#define __pyx_kp_u_iso_8859_9_2 __pyx_mstate_global->__pyx_kp_u_iso_8859_9_2 +#define __pyx_kp_u_iso_ir_100 __pyx_mstate_global->__pyx_kp_u_iso_ir_100 +#define __pyx_kp_u_iso_ir_101 __pyx_mstate_global->__pyx_kp_u_iso_ir_101 +#define __pyx_kp_u_iso_ir_109 __pyx_mstate_global->__pyx_kp_u_iso_ir_109 +#define __pyx_kp_u_iso_ir_110 __pyx_mstate_global->__pyx_kp_u_iso_ir_110 +#define __pyx_kp_u_iso_ir_126 __pyx_mstate_global->__pyx_kp_u_iso_ir_126 +#define __pyx_kp_u_iso_ir_127 __pyx_mstate_global->__pyx_kp_u_iso_ir_127 +#define __pyx_kp_u_iso_ir_138 __pyx_mstate_global->__pyx_kp_u_iso_ir_138 +#define __pyx_kp_u_iso_ir_144 __pyx_mstate_global->__pyx_kp_u_iso_ir_144 +#define __pyx_kp_u_iso_ir_148 __pyx_mstate_global->__pyx_kp_u_iso_ir_148 +#define __pyx_kp_u_iso_ir_149 __pyx_mstate_global->__pyx_kp_u_iso_ir_149 +#define __pyx_kp_u_iso_ir_157 __pyx_mstate_global->__pyx_kp_u_iso_ir_157 +#define __pyx_kp_u_iso_ir_58 __pyx_mstate_global->__pyx_kp_u_iso_ir_58 #define __pyx_n_s_isomorph __pyx_mstate_global->__pyx_n_s_isomorph #define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys +#define __pyx_n_u_koi __pyx_mstate_global->__pyx_n_u_koi +#define __pyx_n_u_koi8 __pyx_mstate_global->__pyx_n_u_koi8 +#define __pyx_kp_u_koi8_r __pyx_mstate_global->__pyx_kp_u_koi8_r +#define __pyx_n_u_koi8_r_2 __pyx_mstate_global->__pyx_n_u_koi8_r_2 +#define __pyx_kp_u_koi8_ru __pyx_mstate_global->__pyx_kp_u_koi8_ru +#define __pyx_kp_u_koi8_u __pyx_mstate_global->__pyx_kp_u_koi8_u +#define __pyx_n_u_korean __pyx_mstate_global->__pyx_n_u_korean +#define __pyx_kp_u_ks_c_5601_1987 __pyx_mstate_global->__pyx_kp_u_ks_c_5601_1987 +#define __pyx_kp_u_ks_c_5601_1989 __pyx_mstate_global->__pyx_kp_u_ks_c_5601_1989 +#define __pyx_n_u_ksc5601 __pyx_mstate_global->__pyx_n_u_ksc5601 +#define __pyx_n_u_ksc_5601 __pyx_mstate_global->__pyx_n_u_ksc_5601 +#define __pyx_n_u_l1 __pyx_mstate_global->__pyx_n_u_l1 +#define __pyx_n_u_l2 __pyx_mstate_global->__pyx_n_u_l2 +#define __pyx_n_u_l3 __pyx_mstate_global->__pyx_n_u_l3 +#define __pyx_n_u_l4 __pyx_mstate_global->__pyx_n_u_l4 +#define __pyx_n_u_l5 __pyx_mstate_global->__pyx_n_u_l5 +#define __pyx_n_u_l6 __pyx_mstate_global->__pyx_n_u_l6 +#define __pyx_n_u_l9 __pyx_mstate_global->__pyx_n_u_l9 +#define __pyx_n_s_label __pyx_mstate_global->__pyx_n_s_label #define __pyx_n_s_last __pyx_mstate_global->__pyx_n_s_last +#define __pyx_n_s_last_digit __pyx_mstate_global->__pyx_n_s_last_digit +#define __pyx_n_u_latin1 __pyx_mstate_global->__pyx_n_u_latin1 +#define __pyx_n_u_latin2 __pyx_mstate_global->__pyx_n_u_latin2 +#define __pyx_n_u_latin3 __pyx_mstate_global->__pyx_n_u_latin3 +#define __pyx_n_u_latin4 __pyx_mstate_global->__pyx_n_u_latin4 +#define __pyx_n_u_latin5 __pyx_mstate_global->__pyx_n_u_latin5 +#define __pyx_n_u_latin6 __pyx_mstate_global->__pyx_n_u_latin6 #define __pyx_n_s_length __pyx_mstate_global->__pyx_n_s_length #define __pyx_n_u_localhost __pyx_mstate_global->__pyx_n_u_localhost +#define __pyx_n_u_logical __pyx_mstate_global->__pyx_n_u_logical +#define __pyx_n_s_lookup __pyx_mstate_global->__pyx_n_s_lookup #define __pyx_n_s_lower __pyx_mstate_global->__pyx_n_s_lower +#define __pyx_n_s_lru_cache __pyx_mstate_global->__pyx_n_s_lru_cache +#define __pyx_n_u_mac __pyx_mstate_global->__pyx_n_u_mac +#define __pyx_kp_u_mac_cyrillic __pyx_mstate_global->__pyx_kp_u_mac_cyrillic +#define __pyx_n_u_macintosh __pyx_mstate_global->__pyx_n_u_macintosh #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_math __pyx_mstate_global->__pyx_n_s_math +#define __pyx_n_s_maxsize __pyx_mstate_global->__pyx_n_s_maxsize #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_min_length __pyx_mstate_global->__pyx_n_s_min_length #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module +#define __pyx_n_u_ms932 __pyx_mstate_global->__pyx_n_u_ms932 +#define __pyx_n_u_ms_kanji __pyx_mstate_global->__pyx_n_u_ms_kanji #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_number __pyx_mstate_global->__pyx_n_s_number @@ -4383,6 +5613,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_query_percent_encode_set __pyx_mstate_global->__pyx_n_s_query_percent_encode_set #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range +#define __pyx_n_u_replacement __pyx_mstate_global->__pyx_n_u_replacement #define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result #define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return #define __pyx_n_s_scheme __pyx_mstate_global->__pyx_n_s_scheme @@ -4398,28 +5629,47 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_serialize_url_path __pyx_mstate_global->__pyx_n_s_serialize_url_path #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_setter __pyx_mstate_global->__pyx_n_s_setter +#define __pyx_kp_u_shift_jis __pyx_mstate_global->__pyx_kp_u_shift_jis +#define __pyx_n_u_shift_jis_2 __pyx_mstate_global->__pyx_n_u_shift_jis_2 +#define __pyx_n_s_short_windows_125 __pyx_mstate_global->__pyx_n_s_short_windows_125 #define __pyx_n_s_shorten_path __pyx_mstate_global->__pyx_n_s_shorten_path +#define __pyx_n_u_sjis __pyx_mstate_global->__pyx_n_u_sjis #define __pyx_n_s_skip_authority_shortcut __pyx_mstate_global->__pyx_n_s_skip_authority_shortcut #define __pyx_n_s_space_as_plus __pyx_mstate_global->__pyx_n_s_space_as_plus +#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_special_query_percent_encode_set __pyx_mstate_global->__pyx_n_s_special_query_percent_encode_set #define __pyx_n_s_starts_with_windows_drive_lette __pyx_mstate_global->__pyx_n_s_starts_with_windows_drive_lette #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str #define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip +#define __pyx_n_u_sun_eu_greek __pyx_mstate_global->__pyx_n_u_sun_eu_greek #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_swaps __pyx_mstate_global->__pyx_n_s_swaps #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw +#define __pyx_kp_u_tis_620 __pyx_mstate_global->__pyx_kp_u_tis_620 #define __pyx_n_s_to_ascii __pyx_mstate_global->__pyx_n_s_to_ascii #define __pyx_n_s_transitional_processing __pyx_mstate_global->__pyx_n_s_transitional_processing #define __pyx_n_s_translate __pyx_mstate_global->__pyx_n_s_translate #define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing +#define __pyx_kp_u_ucs_2 __pyx_mstate_global->__pyx_kp_u_ucs_2 +#define __pyx_n_u_unicode __pyx_mstate_global->__pyx_n_u_unicode +#define __pyx_n_u_unicode11utf8 __pyx_mstate_global->__pyx_n_u_unicode11utf8 +#define __pyx_n_u_unicode20utf8 __pyx_mstate_global->__pyx_n_u_unicode20utf8 +#define __pyx_kp_u_unicode_1_1_utf_8 __pyx_mstate_global->__pyx_kp_u_unicode_1_1_utf_8 +#define __pyx_n_u_unicodefeff __pyx_mstate_global->__pyx_n_u_unicodefeff +#define __pyx_n_u_unicodefffe __pyx_mstate_global->__pyx_n_u_unicodefffe #define __pyx_n_s_unquote __pyx_mstate_global->__pyx_n_s_unquote #define __pyx_n_s_url __pyx_mstate_global->__pyx_n_s_url #define __pyx_n_s_urllib_parse __pyx_mstate_global->__pyx_n_s_urllib_parse +#define __pyx_kp_u_us_ascii __pyx_mstate_global->__pyx_kp_u_us_ascii #define __pyx_n_s_use_std3_ascii_rules __pyx_mstate_global->__pyx_n_s_use_std3_ascii_rules #define __pyx_n_s_userinfo_percent_encode_set __pyx_mstate_global->__pyx_n_s_userinfo_percent_encode_set #define __pyx_n_s_username __pyx_mstate_global->__pyx_n_s_username +#define __pyx_n_u_utf8 __pyx_mstate_global->__pyx_n_u_utf8 +#define __pyx_kp_u_utf_16 __pyx_mstate_global->__pyx_kp_u_utf_16 +#define __pyx_kp_u_utf_16be __pyx_mstate_global->__pyx_kp_u_utf_16be +#define __pyx_kp_u_utf_16le __pyx_mstate_global->__pyx_kp_u_utf_16le #define __pyx_kp_u_utf_8 __pyx_mstate_global->__pyx_kp_u_utf_8 #define __pyx_n_s_utf_8_percent_encode __pyx_mstate_global->__pyx_n_s_utf_8_percent_encode #define __pyx_n_s_util __pyx_mstate_global->__pyx_n_s_util @@ -4427,11 +5677,30 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_validation_error __pyx_mstate_global->__pyx_n_s_validation_error #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_verify_dns_length __pyx_mstate_global->__pyx_n_s_verify_dns_length +#define __pyx_n_u_visual __pyx_mstate_global->__pyx_n_u_visual #define __pyx_n_s_w3lib__url __pyx_mstate_global->__pyx_n_s_w3lib__url #define __pyx_kp_s_w3lib__url_pyx __pyx_mstate_global->__pyx_kp_s_w3lib__url_pyx +#define __pyx_kp_u_windows_125 __pyx_mstate_global->__pyx_kp_u_windows_125 +#define __pyx_kp_u_windows_1252 __pyx_mstate_global->__pyx_kp_u_windows_1252 +#define __pyx_kp_u_windows_1254 __pyx_mstate_global->__pyx_kp_u_windows_1254 +#define __pyx_kp_u_windows_31j __pyx_mstate_global->__pyx_kp_u_windows_31j +#define __pyx_kp_u_windows_874 __pyx_mstate_global->__pyx_kp_u_windows_874 +#define __pyx_kp_u_windows_949 __pyx_mstate_global->__pyx_kp_u_windows_949 #define __pyx_n_u_ws __pyx_mstate_global->__pyx_n_u_ws #define __pyx_n_u_wss __pyx_mstate_global->__pyx_n_u_wss #define __pyx_n_u_x __pyx_mstate_global->__pyx_n_u_x +#define __pyx_kp_u_x_cp125 __pyx_mstate_global->__pyx_kp_u_x_cp125 +#define __pyx_kp_u_x_cp1252 __pyx_mstate_global->__pyx_kp_u_x_cp1252 +#define __pyx_kp_u_x_cp1254 __pyx_mstate_global->__pyx_kp_u_x_cp1254 +#define __pyx_kp_u_x_euc_jp __pyx_mstate_global->__pyx_kp_u_x_euc_jp +#define __pyx_kp_u_x_gbk __pyx_mstate_global->__pyx_kp_u_x_gbk +#define __pyx_kp_u_x_mac_cyrillic __pyx_mstate_global->__pyx_kp_u_x_mac_cyrillic +#define __pyx_kp_u_x_mac_roman __pyx_mstate_global->__pyx_kp_u_x_mac_roman +#define __pyx_kp_u_x_mac_ukrainian __pyx_mstate_global->__pyx_kp_u_x_mac_ukrainian +#define __pyx_kp_u_x_sjis __pyx_mstate_global->__pyx_kp_u_x_sjis +#define __pyx_kp_u_x_unicode20utf8 __pyx_mstate_global->__pyx_kp_u_x_unicode20utf8 +#define __pyx_kp_u_x_user_defined __pyx_mstate_global->__pyx_kp_u_x_user_defined +#define __pyx_kp_u_x_x_big5 __pyx_mstate_global->__pyx_kp_u_x_x_big5 #define __pyx_n_u_xmlcharrefreplace __pyx_mstate_global->__pyx_n_u_xmlcharrefreplace #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 @@ -4442,17 +5711,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_int_6 __pyx_mstate_global->__pyx_int_6 #define __pyx_int_7 __pyx_mstate_global->__pyx_int_7 #define __pyx_int_8 __pyx_mstate_global->__pyx_int_8 -#define __pyx_int_9 __pyx_mstate_global->__pyx_int_9 #define __pyx_int_10 __pyx_mstate_global->__pyx_int_10 -#define __pyx_int_11 __pyx_mstate_global->__pyx_int_11 -#define __pyx_int_12 __pyx_mstate_global->__pyx_int_12 -#define __pyx_int_13 __pyx_mstate_global->__pyx_int_13 -#define __pyx_int_14 __pyx_mstate_global->__pyx_int_14 -#define __pyx_int_15 __pyx_mstate_global->__pyx_int_15 #define __pyx_int_16 __pyx_mstate_global->__pyx_int_16 -#define __pyx_int_17 __pyx_mstate_global->__pyx_int_17 -#define __pyx_int_18 __pyx_mstate_global->__pyx_int_18 -#define __pyx_int_19 __pyx_mstate_global->__pyx_int_19 #define __pyx_int_21 __pyx_mstate_global->__pyx_int_21 #define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 #define __pyx_int_80 __pyx_mstate_global->__pyx_int_80 @@ -4464,82 +5724,125 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_slice_ __pyx_mstate_global->__pyx_slice_ #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_slice__20 __pyx_mstate_global->__pyx_slice__20 -#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 +#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 +#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 +#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 +#define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 +#define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 +#define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 +#define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 +#define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 +#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 +#define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 +#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 +#define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 +#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 +#define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 +#define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44 +#define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46 +#define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 #define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48 +#define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 #define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50 +#define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51 #define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52 +#define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 +#define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55 #define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 +#define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57 #define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58 +#define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59 #define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60 +#define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 #define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 +#define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63 +#define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 #define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 -#define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 -#define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70 -#define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72 -#define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74 +#define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 +#define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 +#define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 #define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 -#define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78 -#define __pyx_tuple__80 __pyx_mstate_global->__pyx_tuple__80 -#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 +#define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 +#define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89 +#define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91 +#define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93 +#define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95 +#define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97 +#define __pyx_tuple__99 __pyx_mstate_global->__pyx_tuple__99 +#define __pyx_tuple__101 __pyx_mstate_global->__pyx_tuple__101 +#define __pyx_tuple__103 __pyx_mstate_global->__pyx_tuple__103 +#define __pyx_tuple__105 __pyx_mstate_global->__pyx_tuple__105 +#define __pyx_tuple__107 __pyx_mstate_global->__pyx_tuple__107 +#define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111 +#define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113 +#define __pyx_tuple__115 __pyx_mstate_global->__pyx_tuple__115 +#define __pyx_tuple__117 __pyx_mstate_global->__pyx_tuple__117 +#define __pyx_tuple__119 __pyx_mstate_global->__pyx_tuple__119 +#define __pyx_tuple__121 __pyx_mstate_global->__pyx_tuple__121 +#define __pyx_tuple__123 __pyx_mstate_global->__pyx_tuple__123 +#define __pyx_tuple__125 __pyx_mstate_global->__pyx_tuple__125 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 -#define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 -#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 -#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 -#define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 -#define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45 -#define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 -#define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 -#define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 -#define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 -#define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 -#define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 -#define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 -#define __pyx_codeobj__61 __pyx_mstate_global->__pyx_codeobj__61 -#define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63 -#define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64 #define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 -#define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67 -#define __pyx_codeobj__69 __pyx_mstate_global->__pyx_codeobj__69 +#define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68 +#define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 #define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71 -#define __pyx_codeobj__73 __pyx_mstate_global->__pyx_codeobj__73 -#define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75 +#define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72 +#define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74 #define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77 -#define __pyx_codeobj__79 __pyx_mstate_global->__pyx_codeobj__79 -#define __pyx_codeobj__81 __pyx_mstate_global->__pyx_codeobj__81 +#define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80 +#define __pyx_codeobj__90 __pyx_mstate_global->__pyx_codeobj__90 +#define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92 +#define __pyx_codeobj__94 __pyx_mstate_global->__pyx_codeobj__94 +#define __pyx_codeobj__96 __pyx_mstate_global->__pyx_codeobj__96 +#define __pyx_codeobj__98 __pyx_mstate_global->__pyx_codeobj__98 +#define __pyx_codeobj__100 __pyx_mstate_global->__pyx_codeobj__100 +#define __pyx_codeobj__102 __pyx_mstate_global->__pyx_codeobj__102 +#define __pyx_codeobj__104 __pyx_mstate_global->__pyx_codeobj__104 +#define __pyx_codeobj__106 __pyx_mstate_global->__pyx_codeobj__106 +#define __pyx_codeobj__108 __pyx_mstate_global->__pyx_codeobj__108 +#define __pyx_codeobj__109 __pyx_mstate_global->__pyx_codeobj__109 +#define __pyx_codeobj__110 __pyx_mstate_global->__pyx_codeobj__110 +#define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112 +#define __pyx_codeobj__114 __pyx_mstate_global->__pyx_codeobj__114 +#define __pyx_codeobj__116 __pyx_mstate_global->__pyx_codeobj__116 +#define __pyx_codeobj__118 __pyx_mstate_global->__pyx_codeobj__118 +#define __pyx_codeobj__120 __pyx_mstate_global->__pyx_codeobj__120 +#define __pyx_codeobj__122 __pyx_mstate_global->__pyx_codeobj__122 +#define __pyx_codeobj__124 __pyx_mstate_global->__pyx_codeobj__124 +#define __pyx_codeobj__126 __pyx_mstate_global->__pyx_codeobj__126 /* #### Code section: module_code ### */ -/* "w3lib/_url.pyx":94 - * _path_token_seen: bool = False +/* "w3lib/_url.pyx":32 * - * def __init__(self) -> None: # <<<<<<<<<<<<<< - * self.path = [] - * self.is_special = False + * + * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< + * return { + * label: f"windows-125{last_digit}" */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_4_URL_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_1_short_windows_125(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_4_URL___init__, "_URL.__init__(self) -> None"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_4_URL___init__}; -static PyObject *__pyx_pw_5w3lib_4_url_4_URL_1__init__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_1_short_windows_125 = {"_short_windows_125", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_1_short_windows_125, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_1_short_windows_125(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_last_digit = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -4550,7 +5853,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __Pyx_RefNannySetupContext("_short_windows_125 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -4560,7 +5863,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_last_digit,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -4572,27 +5875,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_last_digit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 94, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_short_windows_125") < 0)) __PYX_ERR(0, 32, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_self = values[0]; + __pyx_v_last_digit = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 94, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_short_windows_125", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 32, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4602,13 +5905,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._URL.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._short_windows_125", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_4_URL___init__(__pyx_self, __pyx_v_self); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_digit), (&PyInt_Type), 0, "last_digit", 1))) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url__short_windows_125(__pyx_self, __pyx_v_last_digit); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -4619,83 +5927,196 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_5w3lib_4_url__short_windows_125(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_last_digit) { + PyObject *__pyx_7genexpr__pyx_v_label = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("_short_windows_125", 1); - /* "w3lib/_url.pyx":95 - * - * def __init__(self) -> None: - * self.path = [] # <<<<<<<<<<<<<< - * self.is_special = False + /* "w3lib/_url.pyx":33 * + * def _short_windows_125(last_digit: int) -> Dict[str, str]: + * return { # <<<<<<<<<<<<<< + * label: f"windows-125{last_digit}" + * for label in ( */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 95, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":96 - * def __init__(self) -> None: - * self.path = [] - * self.is_special = False # <<<<<<<<<<<<<< - * - * def has_opaque_path(self) -> bool: + /* "w3lib/_url.pyx":36 + * label: f"windows-125{last_digit}" + * for label in ( + * f"cp125{last_digit}", # <<<<<<<<<<<<<< + * f"windows-125{last_digit}", + * f"x-cp125{last_digit}", */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, Py_False) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_n_u_cp125, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":94 - * _path_token_seen: bool = False + /* "w3lib/_url.pyx":37 + * for label in ( + * f"cp125{last_digit}", + * f"windows-125{last_digit}", # <<<<<<<<<<<<<< + * f"x-cp125{last_digit}", + * ) + */ + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_windows_125, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":38 + * f"cp125{last_digit}", + * f"windows-125{last_digit}", + * f"x-cp125{last_digit}", # <<<<<<<<<<<<<< + * ) + * } + */ + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_x_cp125, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 38, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":36 + * label: f"windows-125{last_digit}" + * for label in ( + * f"cp125{last_digit}", # <<<<<<<<<<<<<< + * f"windows-125{last_digit}", + * f"x-cp125{last_digit}", + */ + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 36, __pyx_L5_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 36, __pyx_L5_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5)) __PYX_ERR(0, 36, __pyx_L5_error); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":35 + * return { + * label: f"windows-125{last_digit}" + * for label in ( # <<<<<<<<<<<<<< + * f"cp125{last_digit}", + * f"windows-125{last_digit}", + */ + __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); + __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_6 >= 3) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 35, __pyx_L5_error) + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_label, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":34 + * def _short_windows_125(last_digit: int) -> Dict[str, str]: + * return { + * label: f"windows-125{last_digit}" # <<<<<<<<<<<<<< + * for label in ( + * f"cp125{last_digit}", + */ + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_windows_125, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 34, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":35 + * return { + * label: f"windows-125{last_digit}" + * for label in ( # <<<<<<<<<<<<<< + * f"cp125{last_digit}", + * f"windows-125{last_digit}", + */ + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_label); __pyx_7genexpr__pyx_v_label = 0; + goto __pyx_L9_exit_scope; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_label); __pyx_7genexpr__pyx_v_label = 0; + goto __pyx_L1_error; + __pyx_L9_exit_scope:; + } /* exit inner scope */ + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":32 * - * def __init__(self) -> None: # <<<<<<<<<<<<<< - * self.path = [] - * self.is_special = False + * + * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< + * return { + * label: f"windows-125{last_digit}" */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("w3lib._url._URL.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("w3lib._url._short_windows_125", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":98 - * self.is_special = False - * - * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< - * return isinstance(self.path, str) +/* "w3lib/_url.pyx":433 * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoder(encoding: str) -> EncodeFunction: + * codec_info = codecs.lookup(encoding) */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_3_get_encoder(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_4_URL_2has_opaque_path, "_URL.has_opaque_path(self) -> bool"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_3has_opaque_path = {"has_opaque_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_4_URL_2has_opaque_path}; -static PyObject *__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_3_get_encoder = {"_get_encoder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_3_get_encoder, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_3_get_encoder(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_encoding = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -4706,7 +6127,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("has_opaque_path (wrapper)", 0); + __Pyx_RefNannySetupContext("_get_encoder (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -4716,7 +6137,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_encoding,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -4728,27 +6149,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "has_opaque_path") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_encoder") < 0)) __PYX_ERR(0, 433, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_self = values[0]; + __pyx_v_encoding = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("has_opaque_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 98, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_encoder", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 433, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4758,13 +6179,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._URL.has_opaque_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._get_encoder", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(__pyx_self, __pyx_v_self); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_2_get_encoder(__pyx_self, __pyx_v_encoding); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -4775,79 +6201,117 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_5w3lib_4_url_2_get_encoder(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_encoding) { + PyObject *__pyx_v_codec_info = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("has_opaque_path", 1); + __Pyx_RefNannySetupContext("_get_encoder", 1); - /* "w3lib/_url.pyx":99 + /* "w3lib/_url.pyx":435 + * @lru_cache(maxsize=None) + * def _get_encoder(encoding: str) -> EncodeFunction: + * codec_info = codecs.lookup(encoding) # <<<<<<<<<<<<<< + * return codec_info.encode + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_codecs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_encoding}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_v_codec_info = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":436 + * def _get_encoder(encoding: str) -> EncodeFunction: + * codec_info = codecs.lookup(encoding) + * return codec_info.encode # <<<<<<<<<<<<<< * - * def has_opaque_path(self) -> bool: - * return isinstance(self.path, str) # <<<<<<<<<<<<<< * - * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyUnicode_Check(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec_info, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":98 - * self.is_special = False - * - * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< - * return isinstance(self.path, str) + /* "w3lib/_url.pyx":433 * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoder(encoding: str) -> EncodeFunction: + * codec_info = codecs.lookup(encoding) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("w3lib._url._URL.has_opaque_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("w3lib._url._get_encoder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_codec_info); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":101 - * return isinstance(self.path, str) +/* "w3lib/_url.pyx":443 * - * @property # <<<<<<<<<<<<<< - * def scheme(self) -> str: - * return self._scheme + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_4_URL_5scheme(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_5_get_encoding(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_4_URL_4scheme, "_URL.scheme(self) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_5scheme = {"scheme", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_5scheme, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_4_URL_4scheme}; -static PyObject *__pyx_pw_5w3lib_4_url_4_URL_5scheme(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_5_get_encoding = {"_get_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_5_get_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_5_get_encoding(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_label = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -4858,7 +6322,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("scheme (wrapper)", 0); + __Pyx_RefNannySetupContext("_get_encoding (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -4868,7 +6332,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_label,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -4880,27 +6344,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_label)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 443, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 101, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_encoding") < 0)) __PYX_ERR(0, 443, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_self = values[0]; + __pyx_v_label = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scheme", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 101, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 443, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4910,13 +6374,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._get_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_4_URL_4scheme(__pyx_self, __pyx_v_self); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), (&PyUnicode_Type), 0, "label", 1))) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_4_get_encoding(__pyx_self, __pyx_v_label); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -4927,68 +6396,358 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_4_URL_4scheme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label) { + PyObject *__pyx_v_encoding = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("scheme", 1); + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_encoding", 0); + __Pyx_INCREF(__pyx_v_label); - /* "w3lib/_url.pyx":103 - * @property - * def scheme(self) -> str: - * return self._scheme # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":445 + * @lru_cache(maxsize=None) + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() # <<<<<<<<<<<<<< + * try: + * encoding = _LABEL_ENCODINGS[label] + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_WHITESPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_label, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_label, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":446 + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() + * try: # <<<<<<<<<<<<<< + * encoding = _LABEL_ENCODINGS[label] + * except KeyError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "w3lib/_url.pyx":447 + * label = label.strip(_ASCII_WHITESPACE).lower() + * try: + * encoding = _LABEL_ENCODINGS[label] # <<<<<<<<<<<<<< + * except KeyError: + * raise ValueError( + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_LABEL_ENCODINGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_encoding = __pyx_t_2; + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":446 + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() + * try: # <<<<<<<<<<<<<< + * encoding = _LABEL_ENCODINGS[label] + * except KeyError: + */ + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":448 + * try: + * encoding = _LABEL_ENCODINGS[label] + * except KeyError: # <<<<<<<<<<<<<< + * raise ValueError( + * f"{label!r} does not match any encoding label from the Encoding " + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_4) { + __Pyx_AddTraceback("w3lib._url._get_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 448, __pyx_L5_except_error) + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":450 + * except KeyError: + * raise ValueError( + * f"{label!r} does not match any encoding label from the Encoding " # <<<<<<<<<<<<<< + * f"Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721" + * f"bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)" + */ + __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 450, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_8, __pyx_kp_u_does_not_match_any_encoding_lab); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 450, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "w3lib/_url.pyx":449 + * encoding = _LABEL_ENCODINGS[label] + * except KeyError: + * raise ValueError( # <<<<<<<<<<<<<< + * f"{label!r} does not match any encoding label from the Encoding " + * f"Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721" + */ + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 449, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(0, 449, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + + /* "w3lib/_url.pyx":446 + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() + * try: # <<<<<<<<<<<<<< + * encoding = _LABEL_ENCODINGS[label] + * except KeyError: + */ + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "w3lib/_url.pyx":454 + * f"bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)" + * ) + * return encoding # <<<<<<<<<<<<<< + * * - * @scheme.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 103, __pyx_L1_error) - __pyx_r = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_v_encoding))||((__pyx_v_encoding) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_encoding))) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_encoding); + __pyx_r = ((PyObject*)__pyx_v_encoding); goto __pyx_L0; - /* "w3lib/_url.pyx":101 - * return isinstance(self.path, str) + /* "w3lib/_url.pyx":443 * - * @property # <<<<<<<<<<<<<< - * def scheme(self) -> str: - * return self._scheme + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("w3lib._url._get_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_encoding); + __Pyx_XDECREF(__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":105 - * return self._scheme +/* "w3lib/_url.pyx":465 * - * @scheme.setter # <<<<<<<<<<<<<< - * def scheme(self, value: str) -> None: - * self._scheme = value + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings + * @cfunc # <<<<<<<<<<<<<< + * def _get_output_encoding(encoding: str) -> str: + * encoding = _get_encoding(encoding) + */ + +static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *__pyx_v_encoding) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_output_encoding", 0); + __Pyx_INCREF(__pyx_v_encoding); + + /* "w3lib/_url.pyx":467 + * @cfunc + * def _get_output_encoding(encoding: str) -> str: + * encoding = _get_encoding(encoding) # <<<<<<<<<<<<<< + * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: + * return _UTF_8_ENCODING + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_encoding, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":468 + * def _get_output_encoding(encoding: str) -> str: + * encoding = _get_encoding(encoding) + * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: # <<<<<<<<<<<<<< + * return _UTF_8_ENCODING + * return encoding + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_encoding, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":469 + * encoding = _get_encoding(encoding) + * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: + * return _UTF_8_ENCODING # <<<<<<<<<<<<<< + * return encoding + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_UTF_8_ENCODING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":468 + * def _get_output_encoding(encoding: str) -> str: + * encoding = _get_encoding(encoding) + * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: # <<<<<<<<<<<<<< + * return _UTF_8_ENCODING + * return encoding + */ + } + + /* "w3lib/_url.pyx":470 + * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: + * return _UTF_8_ENCODING + * return encoding # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_encoding); + __pyx_r = __pyx_v_encoding; + goto __pyx_L0; + + /* "w3lib/_url.pyx":465 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings + * @cfunc # <<<<<<<<<<<<<< + * def _get_output_encoding(encoding: str) -> str: + * encoding = _get_encoding(encoding) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("w3lib._url._get_output_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_encoding); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":543 + * _path_token_seen: bool = False + * + * def __init__(self) -> None: # <<<<<<<<<<<<<< + * self.path = [] + * self.is_special = False */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_4_URL_7scheme(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_4_URL_6scheme, "_URL.scheme(self, unicode value: str) -> None"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_7scheme = {"scheme", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_7scheme, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_4_URL_6scheme}; -static PyObject *__pyx_pw_5w3lib_4_url_4_URL_7scheme(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -4996,18 +6755,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("scheme (wrapper)", 0); + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -5017,12 +6775,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -5035,35 +6791,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 543, __pyx_L3_error) else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, 1); __PYX_ERR(0, 105, __pyx_L3_error) - } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 105, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 543, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 2)) { + } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; - __pyx_v_value = ((PyObject*)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 543, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5073,18 +6817,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._URL.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyUnicode_Type), 0, "value", 1))) __PYX_ERR(0, 106, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_4_URL_6scheme(__pyx_self, __pyx_v_self, __pyx_v_value); + __pyx_r = __pyx_pf_5w3lib_4_url_4_URL___init__(__pyx_self, __pyx_v_self); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -5095,47 +6834,42 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_4_URL_6scheme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("scheme", 1); - - /* "w3lib/_url.pyx":107 - * @scheme.setter - * def scheme(self, value: str) -> None: - * self._scheme = value # <<<<<<<<<<<<<< - * self.is_special = value in _SPECIAL_SCHEMES - * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scheme, __pyx_v_value) < 0) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_RefNannySetupContext("__init__", 1); - /* "w3lib/_url.pyx":108 - * def scheme(self, value: str) -> None: - * self._scheme = value - * self.is_special = value in _SPECIAL_SCHEMES # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":544 * + * def __init__(self) -> None: + * self.path = [] # <<<<<<<<<<<<<< + * self.is_special = False * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 108, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, __pyx_t_1) < 0) __PYX_ERR(0, 108, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":105 - * return self._scheme + /* "w3lib/_url.pyx":545 + * def __init__(self) -> None: + * self.path = [] + * self.is_special = False # <<<<<<<<<<<<<< * - * @scheme.setter # <<<<<<<<<<<<<< - * def scheme(self, value: str) -> None: - * self._scheme = value + * def has_opaque_path(self) -> bool: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, Py_False) < 0) __PYX_ERR(0, 545, __pyx_L1_error) + + /* "w3lib/_url.pyx":543 + * _path_token_seen: bool = False + * + * def __init__(self) -> None: # <<<<<<<<<<<<<< + * self.path = [] + * self.is_special = False */ /* function exit code */ @@ -5143,7 +6877,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_6scheme(CYTHON_UNUSED PyObject *__p goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._URL.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -5151,32 +6885,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_6scheme(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":115 +/* "w3lib/_url.pyx":547 + * self.is_special = False + * + * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< + * return isinstance(self.path, str) * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path - * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< - * path = url.path - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_1_shorten_path(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url__shorten_path, "_shorten_path(url: _URL) -> None"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_1_shorten_path = {"_shorten_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_1_shorten_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url__shorten_path}; -static PyObject *__pyx_pw_5w3lib_4_url_1_shorten_path(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_3has_opaque_path = {"has_opaque_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_url = 0; + PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -5187,7 +6920,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_shorten_path (wrapper)", 0); + __Pyx_RefNannySetupContext("has_opaque_path (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -5197,7 +6930,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -5209,27 +6942,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_shorten_path") < 0)) __PYX_ERR(0, 115, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "has_opaque_path") < 0)) __PYX_ERR(0, 547, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_url = values[0]; + __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_shorten_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 115, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("has_opaque_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 547, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5239,11 +6972,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._shorten_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._URL.has_opaque_path", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url__shorten_path(__pyx_self, __pyx_v_url); + __pyx_r = __pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -5256,188 +6989,89 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url__shorten_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { - PyObject *__pyx_v_path = NULL; +static PyObject *__pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_shorten_path", 1); - - /* "w3lib/_url.pyx":116 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path - * def _shorten_path(url: _URL) -> None: - * path = url.path # <<<<<<<<<<<<<< - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): - * return - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_path = __pyx_t_1; - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":117 - * def _shorten_path(url: _URL) -> None: - * path = url.path - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): # <<<<<<<<<<<<<< - * return - * url.path = path[:-1] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = PyObject_Length(__pyx_v_path); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 117, __pyx_L1_error) - __pyx_t_3 = (__pyx_t_4 == 1); - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L4_bool_binop_done; - } - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __pyx_t_3; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "w3lib/_url.pyx":118 - * path = url.path - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): - * return # <<<<<<<<<<<<<< - * url.path = path[:-1] - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "w3lib/_url.pyx":117 - * def _shorten_path(url: _URL) -> None: - * path = url.path - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): # <<<<<<<<<<<<<< - * return - * url.path = path[:-1] - */ - } + __Pyx_RefNannySetupContext("has_opaque_path", 1); - /* "w3lib/_url.pyx":119 - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): - * return - * url.path = path[:-1] # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":548 * + * def has_opaque_path(self) -> bool: + * return isinstance(self.path, str) # <<<<<<<<<<<<<< * + * @property */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_2 = PyUnicode_Check(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "w3lib/_url.pyx":115 + /* "w3lib/_url.pyx":547 + * self.is_special = False + * + * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< + * return isinstance(self.path, str) * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path - * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< - * path = url.path - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("w3lib._url._shorten_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._URL.has_opaque_path", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_path); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":124 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode - * # Extended to handled cases where % is to be percent-encoded. - * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input: str, - * *, +/* "w3lib/_url.pyx":550 + * return isinstance(self.path, str) + * + * @property # <<<<<<<<<<<<<< + * def scheme(self) -> str: + * return self._scheme */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_3_percent_encode_after_encoding(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_5scheme(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_2_percent_encode_after_encoding, "_percent_encode_after_encoding(unicode input: str, *, unicode encoding: str, percent_encode_set: _PercentEncodeSet, space_as_plus: bool = False) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_3_percent_encode_after_encoding = {"_percent_encode_after_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_3_percent_encode_after_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_2_percent_encode_after_encoding}; -static PyObject *__pyx_pw_5w3lib_4_url_3_percent_encode_after_encoding(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_5scheme = {"scheme", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_5scheme, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_5scheme(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_input = 0; - PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_v_percent_encode_set = 0; - PyObject *__pyx_v_space_as_plus = 0; + PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[4] = {0,0,0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_percent_encode_after_encoding (wrapper)", 0); + __Pyx_RefNannySetupContext("scheme (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -5447,17 +7081,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_encoding,&__pyx_n_s_percent_encode_set,&__pyx_n_s_space_as_plus,0}; - - /* "w3lib/_url.pyx":129 - * encoding: str, - * percent_encode_set: _PercentEncodeSet, - * space_as_plus: bool = False, # <<<<<<<<<<<<<< - * ) -> str: - * encoder = _get_encoder(encoding) - */ - values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (likely(__pyx_kwds)) { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -5468,54 +7093,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error) else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L3_error) - else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 124, __pyx_L3_error) - } - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_percent_encode_set)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L3_error) - else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_percent_encode_set); __PYX_ERR(0, 124, __pyx_L3_error) - } - } - if (kw_args == 1) { - const Py_ssize_t index = 3; - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); - if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_percent_encode_after_encoding") < 0)) __PYX_ERR(0, 124, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 550, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 124, __pyx_L3_error) + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_input = ((PyObject*)values[0]); - __pyx_v_encoding = ((PyObject*)values[1]); - __pyx_v_percent_encode_set = values[2]; - __pyx_v_space_as_plus = values[3]; + __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_percent_encode_after_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 124, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scheme", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 550, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5525,27 +7123,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._percent_encode_after_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 125, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 127, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(__pyx_self, __pyx_v_input, __pyx_v_encoding, __pyx_v_percent_encode_set, __pyx_v_space_as_plus); - - /* "w3lib/_url.pyx":124 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode - * # Extended to handled cases where % is to be percent-encoded. - * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input: str, - * *, - */ + __pyx_r = __pyx_pf_5w3lib_4_url_4_URL_4scheme(__pyx_self, __pyx_v_self); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -5556,561 +7140,493 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_2_percent_encode_after_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set, PyObject *__pyx_v_space_as_plus) { - PyObject *__pyx_v_encoder = NULL; - PyObject *__pyx_v_output = NULL; - PyObject *__pyx_v_encode_output = NULL; - CYTHON_UNUSED PyObject *__pyx_v__ = NULL; - PyObject *__pyx_v_i = NULL; - PyObject *__pyx_v_byte = NULL; - PyObject *__pyx_v_isomorph = NULL; +static PyObject *__pyx_pf_5w3lib_4_url_4_URL_4scheme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - Py_ssize_t __pyx_t_7; - PyObject *(*__pyx_t_8)(PyObject *); - int __pyx_t_9; - int __pyx_t_10; - Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_percent_encode_after_encoding", 1); + __Pyx_RefNannySetupContext("scheme", 1); - /* "w3lib/_url.pyx":131 - * space_as_plus: bool = False, - * ) -> str: - * encoder = _get_encoder(encoding) # <<<<<<<<<<<<<< - * output = "" - * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B + /* "w3lib/_url.pyx":552 + * @property + * def scheme(self) -> str: + * return self._scheme # <<<<<<<<<<<<<< + * + * @scheme.setter */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_v_encoder = __pyx_t_1; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 552, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; - /* "w3lib/_url.pyx":132 - * ) -> str: - * encoder = _get_encoder(encoding) - * output = "" # <<<<<<<<<<<<<< - * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B - * # instead of &#NNN; + /* "w3lib/_url.pyx":550 + * return isinstance(self.path, str) + * + * @property # <<<<<<<<<<<<<< + * def scheme(self) -> str: + * return self._scheme */ - __Pyx_INCREF(__pyx_kp_u__2); - __pyx_v_output = __pyx_kp_u__2; - /* "w3lib/_url.pyx":135 - * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B - * # instead of &#NNN; - * encode_output, _ = encoder(input, "xmlcharrefreplace") # <<<<<<<<<<<<<< - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate - * byte = encode_output[i] + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":554 + * return self._scheme + * + * @scheme.setter # <<<<<<<<<<<<<< + * def scheme(self, value: str) -> None: + * self._scheme = value */ - __Pyx_INCREF(__pyx_v_encoder); - __pyx_t_2 = __pyx_v_encoder; __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_7scheme(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_7scheme = {"scheme", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_7scheme, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_4_URL_7scheme(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_value = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("scheme (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_input, __pyx_n_u_xmlcharrefreplace}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, 1); __PYX_ERR(0, 554, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 554, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_value = ((PyObject*)values[1]); } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 135, __pyx_L1_error) + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 554, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyUnicode_Type), 0, "value", 1))) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_4_URL_6scheme(__pyx_self, __pyx_v_self, __pyx_v_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 135, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L4_unpacking_done; - __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 135, __pyx_L1_error) - __pyx_L4_unpacking_done:; } - __pyx_v_encode_output = __pyx_t_2; - __pyx_t_2 = 0; - __pyx_v__ = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":136 - * # instead of &#NNN; - * encode_output, _ = encoder(input, "xmlcharrefreplace") - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< - * byte = encode_output[i] - * if space_as_plus and byte == 0x20: +static PyObject *__pyx_pf_5w3lib_4_url_4_URL_6scheme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("scheme", 1); + + /* "w3lib/_url.pyx":556 + * @scheme.setter + * def scheme(self, value: str) -> None: + * self._scheme = value # <<<<<<<<<<<<<< + * self.is_special = value in _SPECIAL_SCHEMES + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scheme, __pyx_v_value) < 0) __PYX_ERR(0, 556, __pyx_L1_error) + + /* "w3lib/_url.pyx":557 + * def scheme(self, value: str) -> None: + * self._scheme = value + * self.is_special = value in _SPECIAL_SCHEMES # <<<<<<<<<<<<<< + * + * */ - __pyx_t_7 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 136, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, __pyx_t_1) < 0) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); - __pyx_t_7 = 0; - __pyx_t_8 = NULL; - } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 136, __pyx_L1_error) - #endif - if (__pyx_t_7 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 136, __pyx_L1_error) - #endif - if (__pyx_t_7 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } - } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 136, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":137 - * encode_output, _ = encoder(input, "xmlcharrefreplace") - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate - * byte = encode_output[i] # <<<<<<<<<<<<<< - * if space_as_plus and byte == 0x20: - * output += "+" - */ - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_byte, __pyx_t_3); - __pyx_t_3 = 0; - /* "w3lib/_url.pyx":138 - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate - * byte = encode_output[i] - * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< - * output += "+" - * continue + /* "w3lib/_url.pyx":554 + * return self._scheme + * + * @scheme.setter # <<<<<<<<<<<<<< + * def scheme(self, value: str) -> None: + * self._scheme = value */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_space_as_plus); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 138, __pyx_L1_error) - if (__pyx_t_10) { - } else { - __pyx_t_9 = __pyx_t_10; - goto __pyx_L8_bool_binop_done; - } - __pyx_t_10 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_byte, __pyx_int_32, 0x20, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 138, __pyx_L1_error) - __pyx_t_9 = __pyx_t_10; - __pyx_L8_bool_binop_done:; - if (__pyx_t_9) { - /* "w3lib/_url.pyx":139 - * byte = encode_output[i] - * if space_as_plus and byte == 0x20: - * output += "+" # <<<<<<<<<<<<<< - * continue - * isomorph = chr(byte) - */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); - __pyx_t_3 = 0; + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":140 - * if space_as_plus and byte == 0x20: - * output += "+" - * continue # <<<<<<<<<<<<<< - * isomorph = chr(byte) - * if isomorph not in percent_encode_set: +/* "w3lib/_url.pyx":564 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path + * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): */ - goto __pyx_L5_continue; - /* "w3lib/_url.pyx":138 - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate - * byte = encode_output[i] - * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< - * output += "+" - * continue - */ +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_7_shorten_path(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_7_shorten_path = {"_shorten_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_7_shorten_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_7_shorten_path(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_url = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_shorten_path (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 564, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_shorten_path") < 0)) __PYX_ERR(0, 564, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_url = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_shorten_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 564, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } + } + __Pyx_AddTraceback("w3lib._url._shorten_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5w3lib_4_url_6_shorten_path(__pyx_self, __pyx_v_url); - /* "w3lib/_url.pyx":141 - * output += "+" - * continue - * isomorph = chr(byte) # <<<<<<<<<<<<<< - * if isomorph not in percent_encode_set: - * output += isomorph - */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_isomorph, __pyx_t_3); - __pyx_t_3 = 0; + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":142 - * continue - * isomorph = chr(byte) - * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< - * output += isomorph - * elif isomorph == "%": - */ - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_isomorph, __pyx_v_percent_encode_set, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 142, __pyx_L1_error) - if (__pyx_t_9) { +static PyObject *__pyx_pf_5w3lib_4_url_6_shorten_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { + PyObject *__pyx_v_path = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_shorten_path", 1); - /* "w3lib/_url.pyx":143 - * isomorph = chr(byte) - * if isomorph not in percent_encode_set: - * output += isomorph # <<<<<<<<<<<<<< - * elif isomorph == "%": - * if ( + /* "w3lib/_url.pyx":565 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path + * def _shorten_path(url: _URL) -> None: + * path = url.path # <<<<<<<<<<<<<< + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + * return */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_v_isomorph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_path = __pyx_t_1; + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":142 - * continue - * isomorph = chr(byte) - * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< - * output += isomorph - * elif isomorph == "%": + /* "w3lib/_url.pyx":566 + * def _shorten_path(url: _URL) -> None: + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): # <<<<<<<<<<<<<< + * return + * url.path = path[:-1] */ - goto __pyx_L10; - } - - /* "w3lib/_url.pyx":144 - * if isomorph not in percent_encode_set: - * output += isomorph - * elif isomorph == "%": # <<<<<<<<<<<<<< - * if ( - * len(encode_output) <= i + 2 - */ - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_isomorph, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 144, __pyx_L1_error) - if (__pyx_t_9) { - - /* "w3lib/_url.pyx":146 - * elif isomorph == "%": - * if ( - * len(encode_output) <= i + 2 # <<<<<<<<<<<<<< - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT - * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT - */ - __pyx_t_11 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 146, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!__pyx_t_10) { - } else { - __pyx_t_9 = __pyx_t_10; - goto __pyx_L12_bool_binop_done; - } - - /* "w3lib/_url.pyx":147 - * if ( - * len(encode_output) <= i + 2 - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< - * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT - * ): - */ - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 147, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_10) { - } else { - __pyx_t_9 = __pyx_t_10; - goto __pyx_L12_bool_binop_done; - } - - /* "w3lib/_url.pyx":148 - * len(encode_output) <= i + 2 - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT - * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< - * ): - * output += "%25" - */ - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __pyx_t_10; - __pyx_L12_bool_binop_done:; - - /* "w3lib/_url.pyx":145 - * output += isomorph - * elif isomorph == "%": - * if ( # <<<<<<<<<<<<<< - * len(encode_output) <= i + 2 - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT - */ - if (__pyx_t_9) { - - /* "w3lib/_url.pyx":150 - * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT - * ): - * output += "%25" # <<<<<<<<<<<<<< - * else: - * output += "%" - */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u_25); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); - __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":145 - * output += isomorph - * elif isomorph == "%": - * if ( # <<<<<<<<<<<<<< - * len(encode_output) <= i + 2 - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT - */ - goto __pyx_L11; - } - - /* "w3lib/_url.pyx":152 - * output += "%25" - * else: - * output += "%" # <<<<<<<<<<<<<< - * else: - * output += f"%{byte:02X}" - */ - /*else*/ { - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); - __pyx_t_5 = 0; - } - __pyx_L11:; - - /* "w3lib/_url.pyx":144 - * if isomorph not in percent_encode_set: - * output += isomorph - * elif isomorph == "%": # <<<<<<<<<<<<<< - * if ( - * len(encode_output) <= i + 2 - */ - goto __pyx_L10; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = PyObject_Length(__pyx_v_path); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_4 == 1); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { - /* "w3lib/_url.pyx":154 - * output += "%" - * else: - * output += f"%{byte:02X}" # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":567 + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + * return # <<<<<<<<<<<<<< + * url.path = path[:-1] * - * return output */ - /*else*/ { - __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_byte, __pyx_kp_u_02X); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); - __pyx_t_5 = 0; - } - __pyx_L10:; + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; - /* "w3lib/_url.pyx":136 - * # instead of &#NNN; - * encode_output, _ = encoder(input, "xmlcharrefreplace") - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< - * byte = encode_output[i] - * if space_as_plus and byte == 0x20: + /* "w3lib/_url.pyx":566 + * def _shorten_path(url: _URL) -> None: + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): # <<<<<<<<<<<<<< + * return + * url.path = path[:-1] */ - __pyx_L5_continue:; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":156 - * output += f"%{byte:02X}" - * - * return output # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":568 + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + * return + * url.path = path[:-1] # <<<<<<<<<<<<<< * * */ - __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_INCREF(__pyx_v_output); - __pyx_r = ((PyObject*)__pyx_v_output); - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":124 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode - * # Extended to handled cases where % is to be percent-encoded. - * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input: str, - * *, + /* "w3lib/_url.pyx":564 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path + * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): */ /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("w3lib._url._percent_encode_after_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._shorten_path", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_encoder); - __Pyx_XDECREF(__pyx_v_output); - __Pyx_XDECREF(__pyx_v_encode_output); - __Pyx_XDECREF(__pyx_v__); - __Pyx_XDECREF(__pyx_v_i); - __Pyx_XDECREF(__pyx_v_byte); - __Pyx_XDECREF(__pyx_v_isomorph); + __Pyx_XDECREF(__pyx_v_path); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":174 - * - * - * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< - * address = [0] * 8 - * piece_index = 0 +/* "w3lib/_url.pyx":573 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode + * # Extended to handled cases where % is to be percent-encoded. + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input: str, + * *, */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_5_parse_ipv6(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_4_parse_ipv6, "_parse_ipv6(unicode input: str) -> List[int]"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_5_parse_ipv6 = {"_parse_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_5_parse_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_4_parse_ipv6}; -static PyObject *__pyx_pw_5w3lib_4_url_5_parse_ipv6(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_9_percent_encode_after_encoding = {"_percent_encode_after_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -6118,17 +7634,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_percent_encode_set = 0; + PyObject *__pyx_v_space_as_plus = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_parse_ipv6 (wrapper)", 0); + __Pyx_RefNannySetupContext("_percent_encode_after_encoding (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -6138,8 +7657,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; - if (__pyx_kwds) { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_encoding,&__pyx_n_s_percent_encode_set,&__pyx_n_s_space_as_plus,0}; + + /* "w3lib/_url.pyx":578 + * encoding: str, + * percent_encode_set: _PercentEncodeSet, + * space_as_plus: bool = False, # <<<<<<<<<<<<<< + * ) -> str: + * encoder = _get_encoder(encoding) + */ + values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + if (likely(__pyx_kwds)) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -6154,23 +7682,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L3_error) else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv6") < 0)) __PYX_ERR(0, 174, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 573, __pyx_L3_error) + } + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_percent_encode_set)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_percent_encode_set); __PYX_ERR(0, 573, __pyx_L3_error) + } + } + if (kw_args == 1) { + const Py_ssize_t index = 3; + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L3_error) + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_percent_encode_after_encoding") < 0)) __PYX_ERR(0, 573, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 573, __pyx_L3_error) } __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_encoding = ((PyObject*)values[1]); + __pyx_v_percent_encode_set = values[2]; + __pyx_v_space_as_plus = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 174, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_percent_encode_after_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 573, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6180,12 +7735,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._parse_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._percent_encode_after_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 174, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_4_parse_ipv6(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 574, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(__pyx_self, __pyx_v_input, __pyx_v_encoding, __pyx_v_percent_encode_set, __pyx_v_space_as_plus); + + /* "w3lib/_url.pyx":573 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode + * # Extended to handled cases where % is to be percent-encoded. + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input: str, + * *, + */ /* function exit code */ goto __pyx_L0; @@ -6202,1869 +7766,2048 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_4_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { - PyObject *__pyx_v_address = NULL; - PyObject *__pyx_v_piece_index = NULL; - PyObject *__pyx_v_compress = NULL; - PyObject *__pyx_v_pointer = NULL; - Py_ssize_t __pyx_v_input_lenght; - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_v_length = NULL; - PyObject *__pyx_v_numbers_seen = NULL; - PyObject *__pyx_v_ipv4_piece = NULL; - PyObject *__pyx_v_number = NULL; - PyObject *__pyx_v_swaps = NULL; +static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set, PyObject *__pyx_v_space_as_plus) { + PyObject *__pyx_v_encoder = NULL; + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_v_encode_output = NULL; + CYTHON_UNUSED PyObject *__pyx_v__ = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_byte = NULL; + PyObject *__pyx_v_isomorph = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *(*__pyx_t_6)(PyObject *); + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_ipv6", 1); + __Pyx_RefNannySetupContext("_percent_encode_after_encoding", 1); - /* "w3lib/_url.pyx":175 - * - * def _parse_ipv6(input: str) -> List[int]: - * address = [0] * 8 # <<<<<<<<<<<<<< - * piece_index = 0 - * compress = None + /* "w3lib/_url.pyx":580 + * space_as_plus: bool = False, + * ) -> str: + * encoder = _get_encoder(encoding) # <<<<<<<<<<<<<< + * output = "" + * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B */ - __pyx_t_1 = PyList_New(1 * 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - { Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < 8; __pyx_temp++) { - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0)) __PYX_ERR(0, 175, __pyx_L1_error); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } } - __pyx_v_address = ((PyObject*)__pyx_t_1); + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_v_encoder = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":176 - * def _parse_ipv6(input: str) -> List[int]: - * address = [0] * 8 - * piece_index = 0 # <<<<<<<<<<<<<< - * compress = None - * pointer = 0 - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_piece_index = __pyx_int_0; - - /* "w3lib/_url.pyx":177 - * address = [0] * 8 - * piece_index = 0 - * compress = None # <<<<<<<<<<<<<< - * pointer = 0 - * input_lenght = len(input) - */ - __Pyx_INCREF(Py_None); - __pyx_v_compress = Py_None; - - /* "w3lib/_url.pyx":178 - * piece_index = 0 - * compress = None - * pointer = 0 # <<<<<<<<<<<<<< - * input_lenght = len(input) - * if pointer < input_lenght and input[pointer] == ":": - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_pointer = __pyx_int_0; - - /* "w3lib/_url.pyx":179 - * compress = None - * pointer = 0 - * input_lenght = len(input) # <<<<<<<<<<<<<< - * if pointer < input_lenght and input[pointer] == ":": - * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + /* "w3lib/_url.pyx":581 + * ) -> str: + * encoder = _get_encoder(encoding) + * output = "" # <<<<<<<<<<<<<< + * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B + * # instead of &#NNN; */ - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 179, __pyx_L1_error) - __pyx_v_input_lenght = __pyx_t_2; + __Pyx_INCREF(__pyx_kp_u__2); + __pyx_v_output = __pyx_kp_u__2; - /* "w3lib/_url.pyx":180 - * pointer = 0 - * input_lenght = len(input) - * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< - * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": - * raise ValueError + /* "w3lib/_url.pyx":584 + * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B + * # instead of &#NNN; + * encode_output, _ = encoder(input, "xmlcharrefreplace") # <<<<<<<<<<<<<< + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + * byte = encode_output[i] */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L4_bool_binop_done; + __Pyx_INCREF(__pyx_v_encoder); + __pyx_t_2 = __pyx_v_encoder; __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L4_bool_binop_done:; - if (__pyx_t_3) { - - /* "w3lib/_url.pyx":181 - * input_lenght = len(input) - * if pointer < input_lenght and input[pointer] == ":": - * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": # <<<<<<<<<<<<<< - * raise ValueError - * pointer += 2 - */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_input, __pyx_n_u_xmlcharrefreplace}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!__pyx_t_5) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 584, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L7_bool_binop_done; + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L7_bool_binop_done:; - if (unlikely(__pyx_t_3)) { + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); + index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_6 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_L4_unpacking_done:; + } + __pyx_v_encode_output = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v__ = __pyx_t_3; + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":182 - * if pointer < input_lenght and input[pointer] == ":": - * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": - * raise ValueError # <<<<<<<<<<<<<< - * pointer += 2 - * piece_index += 1 - */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 182, __pyx_L1_error) - - /* "w3lib/_url.pyx":181 - * input_lenght = len(input) - * if pointer < input_lenght and input[pointer] == ":": - * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": # <<<<<<<<<<<<<< - * raise ValueError - * pointer += 2 - */ - } - - /* "w3lib/_url.pyx":183 - * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": - * raise ValueError - * pointer += 2 # <<<<<<<<<<<<<< - * piece_index += 1 - * compress = piece_index + /* "w3lib/_url.pyx":585 + * # instead of &#NNN; + * encode_output, _ = encoder(input, "xmlcharrefreplace") + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 585, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_8(__pyx_t_1); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 585, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":184 - * raise ValueError - * pointer += 2 - * piece_index += 1 # <<<<<<<<<<<<<< - * compress = piece_index - * while pointer < input_lenght: + /* "w3lib/_url.pyx":586 + * encode_output, _ = encoder(input, "xmlcharrefreplace") + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + * byte = encode_output[i] # <<<<<<<<<<<<<< + * if space_as_plus and byte == 0x20: + * output += "+" */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_byte, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":185 - * pointer += 2 - * piece_index += 1 - * compress = piece_index # <<<<<<<<<<<<<< - * while pointer < input_lenght: - * if piece_index == 8: + /* "w3lib/_url.pyx":587 + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< + * output += "+" + * continue */ - __Pyx_INCREF(__pyx_v_piece_index); - __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_space_as_plus); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) + if (__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_10 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_byte, __pyx_int_32, 0x20, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_9 = __pyx_t_10; + __pyx_L8_bool_binop_done:; + if (__pyx_t_9) { - /* "w3lib/_url.pyx":180 - * pointer = 0 - * input_lenght = len(input) - * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< - * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": - * raise ValueError + /* "w3lib/_url.pyx":588 + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: + * output += "+" # <<<<<<<<<<<<<< + * continue + * isomorph = chr(byte) */ - } + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":186 - * piece_index += 1 - * compress = piece_index - * while pointer < input_lenght: # <<<<<<<<<<<<<< - * if piece_index == 8: - * raise ValueError + /* "w3lib/_url.pyx":589 + * if space_as_plus and byte == 0x20: + * output += "+" + * continue # <<<<<<<<<<<<<< + * isomorph = chr(byte) + * if isomorph not in percent_encode_set: */ - while (1) { - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!__pyx_t_3) break; + goto __pyx_L5_continue; - /* "w3lib/_url.pyx":187 - * compress = piece_index - * while pointer < input_lenght: - * if piece_index == 8: # <<<<<<<<<<<<<< - * raise ValueError - * if input[pointer] == ":": + /* "w3lib/_url.pyx":587 + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< + * output += "+" + * continue */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) - if (unlikely(__pyx_t_3)) { + } - /* "w3lib/_url.pyx":188 - * while pointer < input_lenght: - * if piece_index == 8: - * raise ValueError # <<<<<<<<<<<<<< - * if input[pointer] == ":": - * if compress is not None: + /* "w3lib/_url.pyx":590 + * output += "+" + * continue + * isomorph = chr(byte) # <<<<<<<<<<<<<< + * if isomorph not in percent_encode_set: + * output += isomorph */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_isomorph, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":187 - * compress = piece_index - * while pointer < input_lenght: - * if piece_index == 8: # <<<<<<<<<<<<<< - * raise ValueError - * if input[pointer] == ":": + /* "w3lib/_url.pyx":591 + * continue + * isomorph = chr(byte) + * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< + * output += isomorph + * elif isomorph == "%": */ - } + __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_isomorph, __pyx_v_percent_encode_set, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 591, __pyx_L1_error) + if (__pyx_t_9) { - /* "w3lib/_url.pyx":189 - * if piece_index == 8: - * raise ValueError - * if input[pointer] == ":": # <<<<<<<<<<<<<< - * if compress is not None: - * raise ValueError + /* "w3lib/_url.pyx":592 + * isomorph = chr(byte) + * if isomorph not in percent_encode_set: + * output += isomorph # <<<<<<<<<<<<<< + * elif isomorph == "%": + * if ( */ - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 189, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_3) { + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_v_isomorph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":190 - * raise ValueError - * if input[pointer] == ":": - * if compress is not None: # <<<<<<<<<<<<<< - * raise ValueError - * pointer += 1 + /* "w3lib/_url.pyx":591 + * continue + * isomorph = chr(byte) + * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< + * output += isomorph + * elif isomorph == "%": */ - __pyx_t_3 = (__pyx_v_compress != Py_None); - if (unlikely(__pyx_t_3)) { + goto __pyx_L10; + } - /* "w3lib/_url.pyx":191 - * if input[pointer] == ":": - * if compress is not None: - * raise ValueError # <<<<<<<<<<<<<< - * pointer += 1 - * piece_index += 1 + /* "w3lib/_url.pyx":593 + * if isomorph not in percent_encode_set: + * output += isomorph + * elif isomorph == "%": # <<<<<<<<<<<<<< + * if ( + * len(encode_output) <= i + 2 */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_isomorph, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 593, __pyx_L1_error) + if (__pyx_t_9) { - /* "w3lib/_url.pyx":190 - * raise ValueError - * if input[pointer] == ":": - * if compress is not None: # <<<<<<<<<<<<<< - * raise ValueError - * pointer += 1 + /* "w3lib/_url.pyx":595 + * elif isomorph == "%": + * if ( + * len(encode_output) <= i + 2 # <<<<<<<<<<<<<< + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT + * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT */ + __pyx_t_11 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L12_bool_binop_done; } - /* "w3lib/_url.pyx":192 - * if compress is not None: - * raise ValueError - * pointer += 1 # <<<<<<<<<<<<<< - * piece_index += 1 - * compress = piece_index - */ - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_6); - __pyx_t_6 = 0; - - /* "w3lib/_url.pyx":193 - * raise ValueError - * pointer += 1 - * piece_index += 1 # <<<<<<<<<<<<<< - * compress = piece_index - * continue - */ - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_6); - __pyx_t_6 = 0; - - /* "w3lib/_url.pyx":194 - * pointer += 1 - * piece_index += 1 - * compress = piece_index # <<<<<<<<<<<<<< - * continue - * value = length = 0 - */ - __Pyx_INCREF(__pyx_v_piece_index); - __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); - - /* "w3lib/_url.pyx":195 - * piece_index += 1 - * compress = piece_index - * continue # <<<<<<<<<<<<<< - * value = length = 0 - * while ( + /* "w3lib/_url.pyx":596 + * if ( + * len(encode_output) <= i + 2 + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT + * ): */ - goto __pyx_L9_continue; + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L12_bool_binop_done; + } - /* "w3lib/_url.pyx":189 - * if piece_index == 8: - * raise ValueError - * if input[pointer] == ":": # <<<<<<<<<<<<<< - * if compress is not None: - * raise ValueError + /* "w3lib/_url.pyx":597 + * len(encode_output) <= i + 2 + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT + * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * ): + * output += "%25" */ - } + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = __pyx_t_10; + __pyx_L12_bool_binop_done:; - /* "w3lib/_url.pyx":196 - * compress = piece_index - * continue - * value = length = 0 # <<<<<<<<<<<<<< - * while ( - * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT + /* "w3lib/_url.pyx":594 + * output += isomorph + * elif isomorph == "%": + * if ( # <<<<<<<<<<<<<< + * len(encode_output) <= i + 2 + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT */ - __Pyx_INCREF(__pyx_int_0); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_int_0); - __Pyx_INCREF(__pyx_int_0); - __Pyx_XDECREF_SET(__pyx_v_length, __pyx_int_0); + if (__pyx_t_9) { - /* "w3lib/_url.pyx":197 - * continue - * value = length = 0 - * while ( # <<<<<<<<<<<<<< - * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT - * ): + /* "w3lib/_url.pyx":599 + * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT + * ): + * output += "%25" # <<<<<<<<<<<<<< + * else: + * output += "%" */ - while (1) { + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u_25); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":198 - * value = length = 0 - * while ( - * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< - * ): - * value = value * 0x10 + int(input[pointer], base=16) + /* "w3lib/_url.pyx":594 + * output += isomorph + * elif isomorph == "%": + * if ( # <<<<<<<<<<<<<< + * len(encode_output) <= i + 2 + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT */ - __pyx_t_6 = PyObject_RichCompare(__pyx_v_length, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L16_bool_binop_done; - } - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L16_bool_binop_done; + goto __pyx_L11; } - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L16_bool_binop_done:; - if (!__pyx_t_3) break; - - /* "w3lib/_url.pyx":200 - * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT - * ): - * value = value * 0x10 + int(input[pointer], base=16) # <<<<<<<<<<<<<< - * pointer += 1 - * length += 1 - */ - __pyx_t_6 = __Pyx_PyInt_MultiplyObjC(__pyx_v_value, __pyx_int_16, 0x10, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 200, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; - /* "w3lib/_url.pyx":201 - * ): - * value = value * 0x10 + int(input[pointer], base=16) - * pointer += 1 # <<<<<<<<<<<<<< - * length += 1 - * if pointer < input_lenght and input[pointer] == ".": + /* "w3lib/_url.pyx":601 + * output += "%25" + * else: + * output += "%" # <<<<<<<<<<<<<< + * else: + * output += f"%{byte:02X}" */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; + /*else*/ { + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; + } + __pyx_L11:; - /* "w3lib/_url.pyx":202 - * value = value * 0x10 + int(input[pointer], base=16) - * pointer += 1 - * length += 1 # <<<<<<<<<<<<<< - * if pointer < input_lenght and input[pointer] == ".": - * if length == 0: + /* "w3lib/_url.pyx":593 + * if isomorph not in percent_encode_set: + * output += isomorph + * elif isomorph == "%": # <<<<<<<<<<<<<< + * if ( + * len(encode_output) <= i + 2 */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_length, __pyx_t_1); - __pyx_t_1 = 0; + goto __pyx_L10; } - /* "w3lib/_url.pyx":203 - * pointer += 1 - * length += 1 - * if pointer < input_lenght and input[pointer] == ".": # <<<<<<<<<<<<<< - * if length == 0: - * raise ValueError + /* "w3lib/_url.pyx":603 + * output += "%" + * else: + * output += f"%{byte:02X}" # <<<<<<<<<<<<<< + * + * return output */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L20_bool_binop_done; + /*else*/ { + __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_byte, __pyx_kp_u_02X); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L20_bool_binop_done:; - if (__pyx_t_3) { + __pyx_L10:; - /* "w3lib/_url.pyx":204 - * length += 1 - * if pointer < input_lenght and input[pointer] == ".": - * if length == 0: # <<<<<<<<<<<<<< - * raise ValueError - * pointer -= length + /* "w3lib/_url.pyx":585 + * # instead of &#NNN; + * encode_output, _ = encoder(input, "xmlcharrefreplace") + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_length, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) - if (unlikely(__pyx_t_3)) { + __pyx_L5_continue:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":205 - * if pointer < input_lenght and input[pointer] == ".": - * if length == 0: - * raise ValueError # <<<<<<<<<<<<<< - * pointer -= length - * if piece_index > 6: + /* "w3lib/_url.pyx":605 + * output += f"%{byte:02X}" + * + * return output # <<<<<<<<<<<<<< + * + * */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_output); + __pyx_r = ((PyObject*)__pyx_v_output); + goto __pyx_L0; - /* "w3lib/_url.pyx":204 - * length += 1 - * if pointer < input_lenght and input[pointer] == ".": - * if length == 0: # <<<<<<<<<<<<<< - * raise ValueError - * pointer -= length + /* "w3lib/_url.pyx":573 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode + * # Extended to handled cases where % is to be percent-encoded. + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input: str, + * *, */ - } - - /* "w3lib/_url.pyx":206 - * if length == 0: - * raise ValueError - * pointer -= length # <<<<<<<<<<<<<< - * if piece_index > 6: - * raise ValueError - */ - __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_v_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_7); - __pyx_t_7 = 0; - /* "w3lib/_url.pyx":207 - * raise ValueError - * pointer -= length - * if piece_index > 6: # <<<<<<<<<<<<<< - * raise ValueError - * numbers_seen = 0 - */ - __pyx_t_7 = PyObject_RichCompare(__pyx_v_piece_index, __pyx_int_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 207, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(__pyx_t_3)) { + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("w3lib._url._percent_encode_after_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_encoder); + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XDECREF(__pyx_v_encode_output); + __Pyx_XDECREF(__pyx_v__); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_byte); + __Pyx_XDECREF(__pyx_v_isomorph); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":208 - * pointer -= length - * if piece_index > 6: - * raise ValueError # <<<<<<<<<<<<<< - * numbers_seen = 0 - * while pointer < input_lenght: +/* "w3lib/_url.pyx":623 + * + * + * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< + * address = [0] * 8 + * piece_index = 0 */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 208, __pyx_L1_error) - /* "w3lib/_url.pyx":207 - * raise ValueError - * pointer -= length - * if piece_index > 6: # <<<<<<<<<<<<<< - * raise ValueError - * numbers_seen = 0 - */ +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv6(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_11_parse_ipv6 = {"_parse_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_11_parse_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv6(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_parse_ipv6 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv6") < 0)) __PYX_ERR(0, 623, __pyx_L3_error) } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_parse_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 623, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._parse_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_10_parse_ipv6(__pyx_self, __pyx_v_input); - /* "w3lib/_url.pyx":209 - * if piece_index > 6: - * raise ValueError - * numbers_seen = 0 # <<<<<<<<<<<<<< - * while pointer < input_lenght: - * ipv4_piece = None + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + PyObject *__pyx_v_address = NULL; + PyObject *__pyx_v_piece_index = NULL; + PyObject *__pyx_v_compress = NULL; + PyObject *__pyx_v_pointer = NULL; + Py_ssize_t __pyx_v_input_lenght; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_v_numbers_seen = NULL; + PyObject *__pyx_v_ipv4_piece = NULL; + PyObject *__pyx_v_number = NULL; + PyObject *__pyx_v_swaps = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_ipv6", 1); + + /* "w3lib/_url.pyx":624 + * + * def _parse_ipv6(input: str) -> List[int]: + * address = [0] * 8 # <<<<<<<<<<<<<< + * piece_index = 0 + * compress = None */ + __pyx_t_1 = PyList_New(1 * 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < 8; __pyx_temp++) { __Pyx_INCREF(__pyx_int_0); - __pyx_v_numbers_seen = __pyx_int_0; + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0)) __PYX_ERR(0, 624, __pyx_L1_error); + } + } + __pyx_v_address = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":210 - * raise ValueError - * numbers_seen = 0 - * while pointer < input_lenght: # <<<<<<<<<<<<<< - * ipv4_piece = None - * if numbers_seen > 0: + /* "w3lib/_url.pyx":625 + * def _parse_ipv6(input: str) -> List[int]: + * address = [0] * 8 + * piece_index = 0 # <<<<<<<<<<<<<< + * compress = None + * pointer = 0 */ - while (1) { - __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!__pyx_t_3) break; + __Pyx_INCREF(__pyx_int_0); + __pyx_v_piece_index = __pyx_int_0; - /* "w3lib/_url.pyx":211 - * numbers_seen = 0 - * while pointer < input_lenght: - * ipv4_piece = None # <<<<<<<<<<<<<< - * if numbers_seen > 0: - * if input[pointer] == "." and numbers_seen < 4: + /* "w3lib/_url.pyx":626 + * address = [0] * 8 + * piece_index = 0 + * compress = None # <<<<<<<<<<<<<< + * pointer = 0 + * input_lenght = len(input) */ - __Pyx_INCREF(Py_None); - __Pyx_XDECREF_SET(__pyx_v_ipv4_piece, Py_None); + __Pyx_INCREF(Py_None); + __pyx_v_compress = Py_None; - /* "w3lib/_url.pyx":212 - * while pointer < input_lenght: - * ipv4_piece = None - * if numbers_seen > 0: # <<<<<<<<<<<<<< - * if input[pointer] == "." and numbers_seen < 4: - * pointer += 1 + /* "w3lib/_url.pyx":627 + * piece_index = 0 + * compress = None + * pointer = 0 # <<<<<<<<<<<<<< + * input_lenght = len(input) + * if pointer < input_lenght and input[pointer] == ":": */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_3) { + __Pyx_INCREF(__pyx_int_0); + __pyx_v_pointer = __pyx_int_0; - /* "w3lib/_url.pyx":213 - * ipv4_piece = None - * if numbers_seen > 0: - * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< - * pointer += 1 - * else: + /* "w3lib/_url.pyx":628 + * compress = None + * pointer = 0 + * input_lenght = len(input) # <<<<<<<<<<<<<< + * if pointer < input_lenght and input[pointer] == ":": + * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L28_bool_binop_done; - } - __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L28_bool_binop_done:; - if (likely(__pyx_t_3)) { + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_v_input_lenght = __pyx_t_2; - /* "w3lib/_url.pyx":214 - * if numbers_seen > 0: - * if input[pointer] == "." and numbers_seen < 4: - * pointer += 1 # <<<<<<<<<<<<<< - * else: - * raise ValueError + /* "w3lib/_url.pyx":629 + * pointer = 0 + * input_lenght = len(input) + * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< + * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + * raise ValueError */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L4_bool_binop_done:; + if (__pyx_t_3) { - /* "w3lib/_url.pyx":213 - * ipv4_piece = None - * if numbers_seen > 0: - * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< - * pointer += 1 - * else: + /* "w3lib/_url.pyx":630 + * input_lenght = len(input) + * if pointer < input_lenght and input[pointer] == ":": + * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 2 */ - goto __pyx_L27; - } + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 630, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 630, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 630, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L7_bool_binop_done:; + if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":216 - * pointer += 1 - * else: - * raise ValueError # <<<<<<<<<<<<<< - * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: - * raise ValueError + /* "w3lib/_url.pyx":631 + * if pointer < input_lenght and input[pointer] == ":": + * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + * raise ValueError # <<<<<<<<<<<<<< + * pointer += 2 + * piece_index += 1 */ - /*else*/ { - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 216, __pyx_L1_error) - } - __pyx_L27:; + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 631, __pyx_L1_error) - /* "w3lib/_url.pyx":212 - * while pointer < input_lenght: - * ipv4_piece = None - * if numbers_seen > 0: # <<<<<<<<<<<<<< - * if input[pointer] == "." and numbers_seen < 4: - * pointer += 1 + /* "w3lib/_url.pyx":630 + * input_lenght = len(input) + * if pointer < input_lenght and input[pointer] == ":": + * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 2 */ - } + } - /* "w3lib/_url.pyx":217 - * else: - * raise ValueError - * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< - * raise ValueError - * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + /* "w3lib/_url.pyx":632 + * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + * raise ValueError + * pointer += 2 # <<<<<<<<<<<<<< + * piece_index += 1 + * compress = piece_index */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L31_bool_binop_done; - } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L31_bool_binop_done:; - if (unlikely(__pyx_t_3)) { + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":218 - * raise ValueError - * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: - * raise ValueError # <<<<<<<<<<<<<< - * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: - * number = int(input[pointer]) + /* "w3lib/_url.pyx":633 + * raise ValueError + * pointer += 2 + * piece_index += 1 # <<<<<<<<<<<<<< + * compress = piece_index + * while pointer < input_lenght: */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":217 - * else: - * raise ValueError - * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< - * raise ValueError - * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + /* "w3lib/_url.pyx":634 + * pointer += 2 + * piece_index += 1 + * compress = piece_index # <<<<<<<<<<<<<< + * while pointer < input_lenght: + * if piece_index == 8: */ - } + __Pyx_INCREF(__pyx_v_piece_index); + __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); - /* "w3lib/_url.pyx":219 - * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: - * raise ValueError - * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: # <<<<<<<<<<<<<< - * number = int(input[pointer]) - * if ipv4_piece is None: + /* "w3lib/_url.pyx":629 + * pointer = 0 + * input_lenght = len(input) + * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< + * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + * raise ValueError */ - while (1) { - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L35_bool_binop_done; - } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L35_bool_binop_done:; - if (!__pyx_t_3) break; + } - /* "w3lib/_url.pyx":220 - * raise ValueError - * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: - * number = int(input[pointer]) # <<<<<<<<<<<<<< - * if ipv4_piece is None: - * ipv4_piece = number + /* "w3lib/_url.pyx":635 + * piece_index += 1 + * compress = piece_index + * while pointer < input_lenght: # <<<<<<<<<<<<<< + * if piece_index == 8: + * raise ValueError */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_number, __pyx_t_7); - __pyx_t_7 = 0; + while (1) { + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 635, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":221 - * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: - * number = int(input[pointer]) - * if ipv4_piece is None: # <<<<<<<<<<<<<< - * ipv4_piece = number - * elif ipv4_piece == 0: + /* "w3lib/_url.pyx":636 + * compress = piece_index + * while pointer < input_lenght: + * if piece_index == 8: # <<<<<<<<<<<<<< + * raise ValueError + * if input[pointer] == ":": */ - __pyx_t_3 = (__pyx_v_ipv4_piece == Py_None); - if (__pyx_t_3) { + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 636, __pyx_L1_error) + if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":222 - * number = int(input[pointer]) - * if ipv4_piece is None: - * ipv4_piece = number # <<<<<<<<<<<<<< - * elif ipv4_piece == 0: - * raise ValueError + /* "w3lib/_url.pyx":637 + * while pointer < input_lenght: + * if piece_index == 8: + * raise ValueError # <<<<<<<<<<<<<< + * if input[pointer] == ":": + * if compress is not None: */ - __Pyx_INCREF(__pyx_v_number); - __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_v_number); + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 637, __pyx_L1_error) - /* "w3lib/_url.pyx":221 - * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: - * number = int(input[pointer]) - * if ipv4_piece is None: # <<<<<<<<<<<<<< - * ipv4_piece = number - * elif ipv4_piece == 0: + /* "w3lib/_url.pyx":636 + * compress = piece_index + * while pointer < input_lenght: + * if piece_index == 8: # <<<<<<<<<<<<<< + * raise ValueError + * if input[pointer] == ":": */ - goto __pyx_L37; - } + } - /* "w3lib/_url.pyx":223 - * if ipv4_piece is None: - * ipv4_piece = number - * elif ipv4_piece == 0: # <<<<<<<<<<<<<< - * raise ValueError - * else: + /* "w3lib/_url.pyx":638 + * if piece_index == 8: + * raise ValueError + * if input[pointer] == ":": # <<<<<<<<<<<<<< + * if compress is not None: + * raise ValueError */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_ipv4_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 223, __pyx_L1_error) - if (unlikely(__pyx_t_3)) { + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_3) { - /* "w3lib/_url.pyx":224 - * ipv4_piece = number - * elif ipv4_piece == 0: - * raise ValueError # <<<<<<<<<<<<<< - * else: - * ipv4_piece = ipv4_piece * 10 + number + /* "w3lib/_url.pyx":639 + * raise ValueError + * if input[pointer] == ":": + * if compress is not None: # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 1 */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_3 = (__pyx_v_compress != Py_None); + if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":223 - * if ipv4_piece is None: - * ipv4_piece = number - * elif ipv4_piece == 0: # <<<<<<<<<<<<<< - * raise ValueError - * else: + /* "w3lib/_url.pyx":640 + * if input[pointer] == ":": + * if compress is not None: + * raise ValueError # <<<<<<<<<<<<<< + * pointer += 1 + * piece_index += 1 */ - } + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 640, __pyx_L1_error) - /* "w3lib/_url.pyx":226 - * raise ValueError - * else: - * ipv4_piece = ipv4_piece * 10 + number # <<<<<<<<<<<<<< - * if ipv4_piece > 255: - * raise ValueError + /* "w3lib/_url.pyx":639 + * raise ValueError + * if input[pointer] == ":": + * if compress is not None: # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 1 */ - /*else*/ { - __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ipv4_piece, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_t_1); - __pyx_t_1 = 0; - } - __pyx_L37:; + } - /* "w3lib/_url.pyx":227 - * else: - * ipv4_piece = ipv4_piece * 10 + number - * if ipv4_piece > 255: # <<<<<<<<<<<<<< - * raise ValueError - * pointer += 1 + /* "w3lib/_url.pyx":641 + * if compress is not None: + * raise ValueError + * pointer += 1 # <<<<<<<<<<<<<< + * piece_index += 1 + * compress = piece_index */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ipv4_piece, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 227, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__pyx_t_3)) { + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_6); + __pyx_t_6 = 0; - /* "w3lib/_url.pyx":228 - * ipv4_piece = ipv4_piece * 10 + number - * if ipv4_piece > 255: - * raise ValueError # <<<<<<<<<<<<<< - * pointer += 1 - * assert isinstance(ipv4_piece, int) + /* "w3lib/_url.pyx":642 + * raise ValueError + * pointer += 1 + * piece_index += 1 # <<<<<<<<<<<<<< + * compress = piece_index + * continue */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_6); + __pyx_t_6 = 0; - /* "w3lib/_url.pyx":227 - * else: - * ipv4_piece = ipv4_piece * 10 + number - * if ipv4_piece > 255: # <<<<<<<<<<<<<< - * raise ValueError - * pointer += 1 + /* "w3lib/_url.pyx":643 + * pointer += 1 + * piece_index += 1 + * compress = piece_index # <<<<<<<<<<<<<< + * continue + * value = length = 0 */ - } + __Pyx_INCREF(__pyx_v_piece_index); + __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); - /* "w3lib/_url.pyx":229 - * if ipv4_piece > 255: - * raise ValueError - * pointer += 1 # <<<<<<<<<<<<<< - * assert isinstance(ipv4_piece, int) - * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + /* "w3lib/_url.pyx":644 + * piece_index += 1 + * compress = piece_index + * continue # <<<<<<<<<<<<<< + * value = length = 0 + * while ( */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; - } + goto __pyx_L9_continue; - /* "w3lib/_url.pyx":230 - * raise ValueError - * pointer += 1 - * assert isinstance(ipv4_piece, int) # <<<<<<<<<<<<<< - * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece - * numbers_seen += 1 + /* "w3lib/_url.pyx":638 + * if piece_index == 8: + * raise ValueError + * if input[pointer] == ":": # <<<<<<<<<<<<<< + * if compress is not None: + * raise ValueError */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_3 = PyInt_Check(__pyx_v_ipv4_piece); - if (unlikely(!__pyx_t_3)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 230, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 230, __pyx_L1_error) - #endif + } - /* "w3lib/_url.pyx":231 - * pointer += 1 - * assert isinstance(ipv4_piece, int) - * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece # <<<<<<<<<<<<<< - * numbers_seen += 1 - * if numbers_seen in (2, 4): + /* "w3lib/_url.pyx":645 + * compress = piece_index + * continue + * value = length = 0 # <<<<<<<<<<<<<< + * while ( + * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_ipv4_piece); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_1) < 0))) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_int_0); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_int_0); + __Pyx_INCREF(__pyx_int_0); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_int_0); - /* "w3lib/_url.pyx":232 - * assert isinstance(ipv4_piece, int) - * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece - * numbers_seen += 1 # <<<<<<<<<<<<<< - * if numbers_seen in (2, 4): - * piece_index += 1 + /* "w3lib/_url.pyx":646 + * continue + * value = length = 0 + * while ( # <<<<<<<<<<<<<< + * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT + * ): */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_numbers_seen, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_numbers_seen, __pyx_t_1); - __pyx_t_1 = 0; + while (1) { - /* "w3lib/_url.pyx":233 - * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece - * numbers_seen += 1 - * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< - * piece_index += 1 - * if numbers_seen != 4: + /* "w3lib/_url.pyx":647 + * value = length = 0 + * while ( + * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * ): + * value = value * 0x10 + int(input[pointer], base=16) */ - __Pyx_INCREF(__pyx_v_numbers_seen); - __pyx_t_1 = __pyx_v_numbers_seen; - __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) - if (!__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L40_bool_binop_done; - } - __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_length, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_5) { + } else { __pyx_t_3 = __pyx_t_5; - __pyx_L40_bool_binop_done:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __pyx_t_3; - if (__pyx_t_5) { - - /* "w3lib/_url.pyx":234 - * numbers_seen += 1 - * if numbers_seen in (2, 4): - * piece_index += 1 # <<<<<<<<<<<<<< - * if numbers_seen != 4: - * raise ValueError - */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":233 - * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece - * numbers_seen += 1 - * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< - * piece_index += 1 - * if numbers_seen != 4: - */ - } + goto __pyx_L16_bool_binop_done; } - - /* "w3lib/_url.pyx":235 - * if numbers_seen in (2, 4): - * piece_index += 1 - * if numbers_seen != 4: # <<<<<<<<<<<<<< - * raise ValueError - * break - */ - __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_numbers_seen, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 235, __pyx_L1_error) - if (unlikely(__pyx_t_5)) { - - /* "w3lib/_url.pyx":236 - * piece_index += 1 - * if numbers_seen != 4: - * raise ValueError # <<<<<<<<<<<<<< - * break - * if pointer < input_lenght and input[pointer] == ":": - */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 236, __pyx_L1_error) - - /* "w3lib/_url.pyx":235 - * if numbers_seen in (2, 4): - * piece_index += 1 - * if numbers_seen != 4: # <<<<<<<<<<<<<< - * raise ValueError - * break - */ + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L16_bool_binop_done; } + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L16_bool_binop_done:; + if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":237 - * if numbers_seen != 4: - * raise ValueError - * break # <<<<<<<<<<<<<< - * if pointer < input_lenght and input[pointer] == ":": + /* "w3lib/_url.pyx":649 + * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT + * ): + * value = value * 0x10 + int(input[pointer], base=16) # <<<<<<<<<<<<<< * pointer += 1 + * length += 1 */ - goto __pyx_L10_break; + __pyx_t_6 = __Pyx_PyInt_MultiplyObjC(__pyx_v_value, __pyx_int_16, 0x10, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 649, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":203 - * pointer += 1 + /* "w3lib/_url.pyx":650 + * ): + * value = value * 0x10 + int(input[pointer], base=16) + * pointer += 1 # <<<<<<<<<<<<<< * length += 1 - * if pointer < input_lenght and input[pointer] == ".": # <<<<<<<<<<<<<< - * if length == 0: - * raise ValueError + * if pointer < input_lenght and input[pointer] == ".": */ - } + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":238 - * raise ValueError - * break - * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":651 + * value = value * 0x10 + int(input[pointer], base=16) * pointer += 1 - * if pointer >= input_lenght: + * length += 1 # <<<<<<<<<<<<<< + * if pointer < input_lenght and input[pointer] == ".": + * if length == 0: + */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_length, __pyx_t_1); + __pyx_t_1 = 0; + } + + /* "w3lib/_url.pyx":652 + * pointer += 1 + * length += 1 + * if pointer < input_lenght and input[pointer] == ".": # <<<<<<<<<<<<<< + * if length == 0: + * raise ValueError */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_3) { + if (__pyx_t_5) { } else { - __pyx_t_5 = __pyx_t_3; - goto __pyx_L44_bool_binop_done; + __pyx_t_3 = __pyx_t_5; + goto __pyx_L20_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __pyx_t_3; - __pyx_L44_bool_binop_done:; - if (__pyx_t_5) { + __pyx_t_3 = __pyx_t_5; + __pyx_L20_bool_binop_done:; + if (__pyx_t_3) { - /* "w3lib/_url.pyx":239 - * break - * if pointer < input_lenght and input[pointer] == ":": - * pointer += 1 # <<<<<<<<<<<<<< - * if pointer >= input_lenght: + /* "w3lib/_url.pyx":653 + * length += 1 + * if pointer < input_lenght and input[pointer] == ".": + * if length == 0: # <<<<<<<<<<<<<< + * raise ValueError + * pointer -= length + */ + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_length, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 653, __pyx_L1_error) + if (unlikely(__pyx_t_3)) { + + /* "w3lib/_url.pyx":654 + * if pointer < input_lenght and input[pointer] == ".": + * if length == 0: + * raise ValueError # <<<<<<<<<<<<<< + * pointer -= length + * if piece_index > 6: + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 654, __pyx_L1_error) + + /* "w3lib/_url.pyx":653 + * length += 1 + * if pointer < input_lenght and input[pointer] == ".": + * if length == 0: # <<<<<<<<<<<<<< + * raise ValueError + * pointer -= length + */ + } + + /* "w3lib/_url.pyx":655 + * if length == 0: + * raise ValueError + * pointer -= length # <<<<<<<<<<<<<< + * if piece_index > 6: * raise ValueError */ - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_v_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":240 - * if pointer < input_lenght and input[pointer] == ":": - * pointer += 1 - * if pointer >= input_lenght: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":656 * raise ValueError - * elif pointer < input_lenght: + * pointer -= length + * if piece_index > 6: # <<<<<<<<<<<<<< + * raise ValueError + * numbers_seen = 0 */ - __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_piece_index, __pyx_int_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__pyx_t_5)) { + if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":241 - * pointer += 1 - * if pointer >= input_lenght: + /* "w3lib/_url.pyx":657 + * pointer -= length + * if piece_index > 6: * raise ValueError # <<<<<<<<<<<<<< - * elif pointer < input_lenght: - * raise ValueError + * numbers_seen = 0 + * while pointer < input_lenght: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 241, __pyx_L1_error) + __PYX_ERR(0, 657, __pyx_L1_error) - /* "w3lib/_url.pyx":240 - * if pointer < input_lenght and input[pointer] == ":": - * pointer += 1 - * if pointer >= input_lenght: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":656 * raise ValueError - * elif pointer < input_lenght: + * pointer -= length + * if piece_index > 6: # <<<<<<<<<<<<<< + * raise ValueError + * numbers_seen = 0 */ } - /* "w3lib/_url.pyx":238 + /* "w3lib/_url.pyx":658 + * if piece_index > 6: * raise ValueError - * break - * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< - * pointer += 1 - * if pointer >= input_lenght: + * numbers_seen = 0 # <<<<<<<<<<<<<< + * while pointer < input_lenght: + * ipv4_piece = None */ - goto __pyx_L43; - } + __Pyx_INCREF(__pyx_int_0); + __pyx_v_numbers_seen = __pyx_int_0; - /* "w3lib/_url.pyx":242 - * if pointer >= input_lenght: + /* "w3lib/_url.pyx":659 * raise ValueError - * elif pointer < input_lenght: # <<<<<<<<<<<<<< - * raise ValueError - * address[piece_index] = value + * numbers_seen = 0 + * while pointer < input_lenght: # <<<<<<<<<<<<<< + * ipv4_piece = None + * if numbers_seen > 0: */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(__pyx_t_5)) { + while (1) { + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":243 - * raise ValueError - * elif pointer < input_lenght: - * raise ValueError # <<<<<<<<<<<<<< - * address[piece_index] = value - * piece_index += 1 + /* "w3lib/_url.pyx":660 + * numbers_seen = 0 + * while pointer < input_lenght: + * ipv4_piece = None # <<<<<<<<<<<<<< + * if numbers_seen > 0: + * if input[pointer] == "." and numbers_seen < 4: */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_ipv4_piece, Py_None); - /* "w3lib/_url.pyx":242 - * if pointer >= input_lenght: - * raise ValueError - * elif pointer < input_lenght: # <<<<<<<<<<<<<< - * raise ValueError - * address[piece_index] = value + /* "w3lib/_url.pyx":661 + * while pointer < input_lenght: + * ipv4_piece = None + * if numbers_seen > 0: # <<<<<<<<<<<<<< + * if input[pointer] == "." and numbers_seen < 4: + * pointer += 1 */ - } - __pyx_L43:; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { - /* "w3lib/_url.pyx":244 - * elif pointer < input_lenght: - * raise ValueError - * address[piece_index] = value # <<<<<<<<<<<<<< - * piece_index += 1 - * if compress is not None: + /* "w3lib/_url.pyx":662 + * ipv4_piece = None + * if numbers_seen > 0: + * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< + * pointer += 1 + * else: */ - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_v_value) < 0))) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L28_bool_binop_done; + } + __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L28_bool_binop_done:; + if (likely(__pyx_t_3)) { - /* "w3lib/_url.pyx":245 - * raise ValueError - * address[piece_index] = value - * piece_index += 1 # <<<<<<<<<<<<<< - * if compress is not None: - * swaps = piece_index - compress + /* "w3lib/_url.pyx":663 + * if numbers_seen > 0: + * if input[pointer] == "." and numbers_seen < 4: + * pointer += 1 # <<<<<<<<<<<<<< + * else: + * raise ValueError */ - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_L9_continue:; - } - __pyx_L10_break:; + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":246 - * address[piece_index] = value - * piece_index += 1 - * if compress is not None: # <<<<<<<<<<<<<< - * swaps = piece_index - compress - * piece_index = 7 + /* "w3lib/_url.pyx":662 + * ipv4_piece = None + * if numbers_seen > 0: + * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< + * pointer += 1 + * else: */ - __pyx_t_5 = (__pyx_v_compress != Py_None); - if (__pyx_t_5) { + goto __pyx_L27; + } - /* "w3lib/_url.pyx":247 - * piece_index += 1 - * if compress is not None: - * swaps = piece_index - compress # <<<<<<<<<<<<<< - * piece_index = 7 - * while piece_index != 0 and swaps > 0: + /* "w3lib/_url.pyx":665 + * pointer += 1 + * else: + * raise ValueError # <<<<<<<<<<<<<< + * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: + * raise ValueError */ - __pyx_t_7 = PyNumber_Subtract(__pyx_v_piece_index, __pyx_v_compress); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_v_swaps = __pyx_t_7; - __pyx_t_7 = 0; + /*else*/ { + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 665, __pyx_L1_error) + } + __pyx_L27:; - /* "w3lib/_url.pyx":248 - * if compress is not None: - * swaps = piece_index - compress - * piece_index = 7 # <<<<<<<<<<<<<< - * while piece_index != 0 and swaps > 0: - * address[piece_index], address[compress + swaps - 1] = ( + /* "w3lib/_url.pyx":661 + * while pointer < input_lenght: + * ipv4_piece = None + * if numbers_seen > 0: # <<<<<<<<<<<<<< + * if input[pointer] == "." and numbers_seen < 4: + * pointer += 1 */ - __Pyx_INCREF(__pyx_int_7); - __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_int_7); + } - /* "w3lib/_url.pyx":249 - * swaps = piece_index - compress - * piece_index = 7 - * while piece_index != 0 and swaps > 0: # <<<<<<<<<<<<<< - * address[piece_index], address[compress + swaps - 1] = ( - * address[compress + swaps - 1], + /* "w3lib/_url.pyx":666 + * else: + * raise ValueError + * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< + * raise ValueError + * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: */ - while (1) { - __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 249, __pyx_L1_error) - if (__pyx_t_3) { - } else { - __pyx_t_5 = __pyx_t_3; - goto __pyx_L50_bool_binop_done; - } - __pyx_t_7 = PyObject_RichCompare(__pyx_v_swaps, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 249, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 249, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __pyx_t_3; - __pyx_L50_bool_binop_done:; - if (!__pyx_t_5) break; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L31_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L31_bool_binop_done:; + if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":251 - * while piece_index != 0 and swaps > 0: - * address[piece_index], address[compress + swaps - 1] = ( - * address[compress + swaps - 1], # <<<<<<<<<<<<<< - * address[piece_index], - * ) + /* "w3lib/_url.pyx":667 + * raise ValueError + * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: + * raise ValueError # <<<<<<<<<<<<<< + * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + * number = int(input[pointer]) */ - __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 667, __pyx_L1_error) - /* "w3lib/_url.pyx":252 - * address[piece_index], address[compress + swaps - 1] = ( - * address[compress + swaps - 1], - * address[piece_index], # <<<<<<<<<<<<<< - * ) - * piece_index -= 1 + /* "w3lib/_url.pyx":666 + * else: + * raise ValueError + * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< + * raise ValueError + * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + } - /* "w3lib/_url.pyx":250 - * piece_index = 7 - * while piece_index != 0 and swaps > 0: - * address[piece_index], address[compress + swaps - 1] = ( # <<<<<<<<<<<<<< - * address[compress + swaps - 1], - * address[piece_index], + /* "w3lib/_url.pyx":668 + * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: + * raise ValueError + * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: # <<<<<<<<<<<<<< + * number = int(input[pointer]) + * if ipv4_piece is None: */ - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_7) < 0))) __PYX_ERR(0, 250, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_t_6, __pyx_t_1) < 0))) __PYX_ERR(0, 250, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + while (1) { + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L35_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L35_bool_binop_done:; + if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":254 - * address[piece_index], - * ) - * piece_index -= 1 # <<<<<<<<<<<<<< - * swaps -= 1 - * elif compress is None and piece_index != 8: + /* "w3lib/_url.pyx":669 + * raise ValueError + * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + * number = int(input[pointer]) # <<<<<<<<<<<<<< + * if ipv4_piece is None: + * ipv4_piece = number */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_number, __pyx_t_7); + __pyx_t_7 = 0; - /* "w3lib/_url.pyx":255 - * ) - * piece_index -= 1 - * swaps -= 1 # <<<<<<<<<<<<<< - * elif compress is None and piece_index != 8: - * raise ValueError + /* "w3lib/_url.pyx":670 + * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + * number = int(input[pointer]) + * if ipv4_piece is None: # <<<<<<<<<<<<<< + * ipv4_piece = number + * elif ipv4_piece == 0: */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_swaps, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_swaps, __pyx_t_1); - __pyx_t_1 = 0; - } + __pyx_t_3 = (__pyx_v_ipv4_piece == Py_None); + if (__pyx_t_3) { - /* "w3lib/_url.pyx":246 - * address[piece_index] = value - * piece_index += 1 - * if compress is not None: # <<<<<<<<<<<<<< - * swaps = piece_index - compress - * piece_index = 7 + /* "w3lib/_url.pyx":671 + * number = int(input[pointer]) + * if ipv4_piece is None: + * ipv4_piece = number # <<<<<<<<<<<<<< + * elif ipv4_piece == 0: + * raise ValueError */ - goto __pyx_L47; - } + __Pyx_INCREF(__pyx_v_number); + __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_v_number); - /* "w3lib/_url.pyx":256 - * piece_index -= 1 - * swaps -= 1 - * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< - * raise ValueError - * return address + /* "w3lib/_url.pyx":670 + * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + * number = int(input[pointer]) + * if ipv4_piece is None: # <<<<<<<<<<<<<< + * ipv4_piece = number + * elif ipv4_piece == 0: */ - __pyx_t_3 = (__pyx_v_compress == Py_None); - if (__pyx_t_3) { - } else { - __pyx_t_5 = __pyx_t_3; - goto __pyx_L52_bool_binop_done; - } - __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 256, __pyx_L1_error) - __pyx_t_5 = __pyx_t_3; - __pyx_L52_bool_binop_done:; - if (unlikely(__pyx_t_5)) { + goto __pyx_L37; + } - /* "w3lib/_url.pyx":257 - * swaps -= 1 - * elif compress is None and piece_index != 8: - * raise ValueError # <<<<<<<<<<<<<< - * return address - * + /* "w3lib/_url.pyx":672 + * if ipv4_piece is None: + * ipv4_piece = number + * elif ipv4_piece == 0: # <<<<<<<<<<<<<< + * raise ValueError + * else: */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_ipv4_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 672, __pyx_L1_error) + if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":256 - * piece_index -= 1 - * swaps -= 1 - * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< - * raise ValueError - * return address + /* "w3lib/_url.pyx":673 + * ipv4_piece = number + * elif ipv4_piece == 0: + * raise ValueError # <<<<<<<<<<<<<< + * else: + * ipv4_piece = ipv4_piece * 10 + number */ - } - __pyx_L47:; + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 673, __pyx_L1_error) - /* "w3lib/_url.pyx":258 - * elif compress is None and piece_index != 8: - * raise ValueError - * return address # <<<<<<<<<<<<<< - * - * + /* "w3lib/_url.pyx":672 + * if ipv4_piece is None: + * ipv4_piece = number + * elif ipv4_piece == 0: # <<<<<<<<<<<<<< + * raise ValueError + * else: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_address); - __pyx_r = __pyx_v_address; - goto __pyx_L0; + } - /* "w3lib/_url.pyx":174 - * - * - * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< - * address = [0] * 8 - * piece_index = 0 + /* "w3lib/_url.pyx":675 + * raise ValueError + * else: + * ipv4_piece = ipv4_piece * 10 + number # <<<<<<<<<<<<<< + * if ipv4_piece > 255: + * raise ValueError */ + /*else*/ { + __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ipv4_piece, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L37:; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("w3lib._url._parse_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_address); - __Pyx_XDECREF(__pyx_v_piece_index); - __Pyx_XDECREF(__pyx_v_compress); - __Pyx_XDECREF(__pyx_v_pointer); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_v_length); - __Pyx_XDECREF(__pyx_v_numbers_seen); - __Pyx_XDECREF(__pyx_v_ipv4_piece); - __Pyx_XDECREF(__pyx_v_number); - __Pyx_XDECREF(__pyx_v_swaps); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "w3lib/_url.pyx":261 - * - * - * def _utf_8_percent_encode( # <<<<<<<<<<<<<< - * input: str, - * percent_encode_set: _PercentEncodeSet, + /* "w3lib/_url.pyx":676 + * else: + * ipv4_piece = ipv4_piece * 10 + number + * if ipv4_piece > 255: # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 1 */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ipv4_piece, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 676, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_3)) { -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_7_utf_8_percent_encode(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_6_utf_8_percent_encode, "_utf_8_percent_encode(unicode input: str, percent_encode_set: _PercentEncodeSet) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_7_utf_8_percent_encode = {"_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_7_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_6_utf_8_percent_encode}; -static PyObject *__pyx_pw_5w3lib_4_url_7_utf_8_percent_encode(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_input = 0; - PyObject *__pyx_v_percent_encode_set = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_utf_8_percent_encode (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_percent_encode_set,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_percent_encode_set)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, 1); __PYX_ERR(0, 261, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_utf_8_percent_encode") < 0)) __PYX_ERR(0, 261, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - } - __pyx_v_input = ((PyObject*)values[0]); - __pyx_v_percent_encode_set = values[1]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 261, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("w3lib._url._utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 262, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_6_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_percent_encode_set); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5w3lib_4_url_6_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_utf_8_percent_encode", 1); - - /* "w3lib/_url.pyx":265 - * percent_encode_set: _PercentEncodeSet, - * ) -> str: - * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input, - * encoding="utf-8", + /* "w3lib/_url.pyx":677 + * ipv4_piece = ipv4_piece * 10 + number + * if ipv4_piece > 255: + * raise ValueError # <<<<<<<<<<<<<< + * pointer += 1 + * assert isinstance(ipv4_piece, int) */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 677, __pyx_L1_error) - /* "w3lib/_url.pyx":266 - * ) -> str: - * return _percent_encode_after_encoding( - * input, # <<<<<<<<<<<<<< - * encoding="utf-8", - * percent_encode_set=percent_encode_set, + /* "w3lib/_url.pyx":676 + * else: + * ipv4_piece = ipv4_piece * 10 + number + * if ipv4_piece > 255: # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 1 */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_input); - __Pyx_GIVEREF(__pyx_v_input); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input)) __PYX_ERR(0, 265, __pyx_L1_error); + } - /* "w3lib/_url.pyx":267 - * return _percent_encode_after_encoding( - * input, - * encoding="utf-8", # <<<<<<<<<<<<<< - * percent_encode_set=percent_encode_set, - * ) + /* "w3lib/_url.pyx":678 + * if ipv4_piece > 255: + * raise ValueError + * pointer += 1 # <<<<<<<<<<<<<< + * assert isinstance(ipv4_piece, int) + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; + } - /* "w3lib/_url.pyx":268 - * input, - * encoding="utf-8", - * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< - * ) - * + /* "w3lib/_url.pyx":679 + * raise ValueError + * pointer += 1 + * assert isinstance(ipv4_piece, int) # <<<<<<<<<<<<<< + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + * numbers_seen += 1 */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 267, __pyx_L1_error) + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_3 = PyInt_Check(__pyx_v_ipv4_piece); + if (unlikely(!__pyx_t_3)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 679, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 679, __pyx_L1_error) + #endif - /* "w3lib/_url.pyx":265 - * percent_encode_set: _PercentEncodeSet, - * ) -> str: - * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input, - * encoding="utf-8", + /* "w3lib/_url.pyx":680 + * pointer += 1 + * assert isinstance(ipv4_piece, int) + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece # <<<<<<<<<<<<<< + * numbers_seen += 1 + * if numbers_seen in (2, 4): */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 265, __pyx_L1_error) - __pyx_r = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_ipv4_piece); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_1) < 0))) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":261 - * - * - * def _utf_8_percent_encode( # <<<<<<<<<<<<<< - * input: str, - * percent_encode_set: _PercentEncodeSet, + /* "w3lib/_url.pyx":681 + * assert isinstance(ipv4_piece, int) + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + * numbers_seen += 1 # <<<<<<<<<<<<<< + * if numbers_seen in (2, 4): + * piece_index += 1 */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_numbers_seen, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_numbers_seen, __pyx_t_1); + __pyx_t_1 = 0; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("w3lib._url._utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "w3lib/_url.pyx":682 + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + * numbers_seen += 1 + * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< + * piece_index += 1 + * if numbers_seen != 4: + */ + __Pyx_INCREF(__pyx_v_numbers_seen); + __pyx_t_1 = __pyx_v_numbers_seen; + __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 682, __pyx_L1_error) + if (!__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L40_bool_binop_done; + } + __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_3 = __pyx_t_5; + __pyx_L40_bool_binop_done:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __pyx_t_3; + if (__pyx_t_5) { -/* "w3lib/_url.pyx":273 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser - * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< - * for code_point in input: - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + /* "w3lib/_url.pyx":683 + * numbers_seen += 1 + * if numbers_seen in (2, 4): + * piece_index += 1 # <<<<<<<<<<<<<< + * if numbers_seen != 4: + * raise ValueError */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); + __pyx_t_1 = 0; -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_9_parse_opaque_host(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_8_parse_opaque_host, "_parse_opaque_host(unicode input: str) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_9_parse_opaque_host = {"_parse_opaque_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_9_parse_opaque_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_8_parse_opaque_host}; -static PyObject *__pyx_pw_5w3lib_4_url_9_parse_opaque_host(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_input = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_parse_opaque_host (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; + /* "w3lib/_url.pyx":682 + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + * numbers_seen += 1 + * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< + * piece_index += 1 + * if numbers_seen != 4: + */ } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_opaque_host") < 0)) __PYX_ERR(0, 273, __pyx_L3_error) + + /* "w3lib/_url.pyx":684 + * if numbers_seen in (2, 4): + * piece_index += 1 + * if numbers_seen != 4: # <<<<<<<<<<<<<< + * raise ValueError + * break + */ + __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_numbers_seen, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 684, __pyx_L1_error) + if (unlikely(__pyx_t_5)) { + + /* "w3lib/_url.pyx":685 + * piece_index += 1 + * if numbers_seen != 4: + * raise ValueError # <<<<<<<<<<<<<< + * break + * if pointer < input_lenght and input[pointer] == ":": + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 685, __pyx_L1_error) + + /* "w3lib/_url.pyx":684 + * if numbers_seen in (2, 4): + * piece_index += 1 + * if numbers_seen != 4: # <<<<<<<<<<<<<< + * raise ValueError + * break + */ } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_input = ((PyObject*)values[0]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_opaque_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 273, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + + /* "w3lib/_url.pyx":686 + * if numbers_seen != 4: + * raise ValueError + * break # <<<<<<<<<<<<<< + * if pointer < input_lenght and input[pointer] == ":": + * pointer += 1 + */ + goto __pyx_L10_break; + + /* "w3lib/_url.pyx":652 + * pointer += 1 + * length += 1 + * if pointer < input_lenght and input[pointer] == ".": # <<<<<<<<<<<<<< + * if length == 0: + * raise ValueError + */ } - } - __Pyx_AddTraceback("w3lib._url._parse_opaque_host", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 273, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_8_parse_opaque_host(__pyx_self, __pyx_v_input); - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + /* "w3lib/_url.pyx":687 + * raise ValueError + * break + * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< + * pointer += 1 + * if pointer >= input_lenght: + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_3) { + } else { + __pyx_t_5 = __pyx_t_3; + goto __pyx_L44_bool_binop_done; } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __pyx_t_3; + __pyx_L44_bool_binop_done:; + if (__pyx_t_5) { -static PyObject *__pyx_pf_5w3lib_4_url_8_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { - Py_UCS4 __pyx_v_code_point; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - Py_ssize_t __pyx_t_3; - void *__pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - Py_ssize_t __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_opaque_host", 1); + /* "w3lib/_url.pyx":688 + * break + * if pointer < input_lenght and input[pointer] == ":": + * pointer += 1 # <<<<<<<<<<<<<< + * if pointer >= input_lenght: + * raise ValueError + */ + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_7); + __pyx_t_7 = 0; - /* "w3lib/_url.pyx":274 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser - * def _parse_opaque_host(input: str) -> str: - * for code_point in input: # <<<<<<<<<<<<<< - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + /* "w3lib/_url.pyx":689 + * if pointer < input_lenght and input[pointer] == ":": + * pointer += 1 + * if pointer >= input_lenght: # <<<<<<<<<<<<<< + * raise ValueError + * elif pointer < input_lenght: + */ + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_5)) { + + /* "w3lib/_url.pyx":690 + * pointer += 1 + * if pointer >= input_lenght: + * raise ValueError # <<<<<<<<<<<<<< + * elif pointer < input_lenght: * raise ValueError */ - __Pyx_INCREF(__pyx_v_input); - __pyx_t_1 = __pyx_v_input; - __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 274, __pyx_L1_error) - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) { - __pyx_t_2 = __pyx_t_7; - __pyx_v_code_point = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2); + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 690, __pyx_L1_error) - /* "w3lib/_url.pyx":275 - * def _parse_opaque_host(input: str) -> str: - * for code_point in input: - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":689 + * if pointer < input_lenght and input[pointer] == ":": + * pointer += 1 + * if pointer >= input_lenght: # <<<<<<<<<<<<<< + * raise ValueError + * elif pointer < input_lenght: + */ + } + + /* "w3lib/_url.pyx":687 + * raise ValueError + * break + * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< + * pointer += 1 + * if pointer >= input_lenght: + */ + goto __pyx_L43; + } + + /* "w3lib/_url.pyx":691 + * if pointer >= input_lenght: + * raise ValueError + * elif pointer < input_lenght: # <<<<<<<<<<<<<< * raise ValueError - * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) + * address[piece_index] = value */ - __pyx_t_8 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(__pyx_t_10)) { + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 691, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 691, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":276 - * for code_point in input: - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + /* "w3lib/_url.pyx":692 + * raise ValueError + * elif pointer < input_lenght: * raise ValueError # <<<<<<<<<<<<<< - * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) - * + * address[piece_index] = value + * piece_index += 1 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 276, __pyx_L1_error) + __PYX_ERR(0, 692, __pyx_L1_error) - /* "w3lib/_url.pyx":275 - * def _parse_opaque_host(input: str) -> str: - * for code_point in input: - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":691 + * if pointer >= input_lenght: + * raise ValueError + * elif pointer < input_lenght: # <<<<<<<<<<<<<< * raise ValueError - * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) + * address[piece_index] = value */ } - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_L43:; - /* "w3lib/_url.pyx":277 - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + /* "w3lib/_url.pyx":693 + * elif pointer < input_lenght: * raise ValueError - * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) # <<<<<<<<<<<<<< - * - * + * address[piece_index] = value # <<<<<<<<<<<<<< + * piece_index += 1 + * if compress is not None: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_5 = 1; + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_v_value) < 0))) __PYX_ERR(0, 693, __pyx_L1_error) + + /* "w3lib/_url.pyx":694 + * raise ValueError + * address[piece_index] = value + * piece_index += 1 # <<<<<<<<<<<<<< + * if compress is not None: + * swaps = piece_index - compress + */ + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_L9_continue:; + } + __pyx_L10_break:; + + /* "w3lib/_url.pyx":695 + * address[piece_index] = value + * piece_index += 1 + * if compress is not None: # <<<<<<<<<<<<<< + * swaps = piece_index - compress + * piece_index = 7 + */ + __pyx_t_5 = (__pyx_v_compress != Py_None); + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":696 + * piece_index += 1 + * if compress is not None: + * swaps = piece_index - compress # <<<<<<<<<<<<<< + * piece_index = 7 + * while piece_index != 0 and swaps > 0: + */ + __pyx_t_7 = PyNumber_Subtract(__pyx_v_piece_index, __pyx_v_compress); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_v_swaps = __pyx_t_7; + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":697 + * if compress is not None: + * swaps = piece_index - compress + * piece_index = 7 # <<<<<<<<<<<<<< + * while piece_index != 0 and swaps > 0: + * address[piece_index], address[compress + swaps - 1] = ( + */ + __Pyx_INCREF(__pyx_int_7); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_int_7); + + /* "w3lib/_url.pyx":698 + * swaps = piece_index - compress + * piece_index = 7 + * while piece_index != 0 and swaps > 0: # <<<<<<<<<<<<<< + * address[piece_index], address[compress + swaps - 1] = ( + * address[compress + swaps - 1], + */ + while (1) { + __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) + if (__pyx_t_3) { + } else { + __pyx_t_5 = __pyx_t_3; + goto __pyx_L50_bool_binop_done; + } + __pyx_t_7 = PyObject_RichCompare(__pyx_v_swaps, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __pyx_t_3; + __pyx_L50_bool_binop_done:; + if (!__pyx_t_5) break; + + /* "w3lib/_url.pyx":700 + * while piece_index != 0 and swaps > 0: + * address[piece_index], address[compress + swaps - 1] = ( + * address[compress + swaps - 1], # <<<<<<<<<<<<<< + * address[piece_index], + * ) + */ + __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":701 + * address[piece_index], address[compress + swaps - 1] = ( + * address[compress + swaps - 1], + * address[piece_index], # <<<<<<<<<<<<<< + * ) + * piece_index -= 1 + */ + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "w3lib/_url.pyx":699 + * piece_index = 7 + * while piece_index != 0 and swaps > 0: + * address[piece_index], address[compress + swaps - 1] = ( # <<<<<<<<<<<<<< + * address[compress + swaps - 1], + * address[piece_index], + */ + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_7) < 0))) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_t_6, __pyx_t_1) < 0))) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":703 + * address[piece_index], + * ) + * piece_index -= 1 # <<<<<<<<<<<<<< + * swaps -= 1 + * elif compress is None and piece_index != 8: + */ + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":704 + * ) + * piece_index -= 1 + * swaps -= 1 # <<<<<<<<<<<<<< + * elif compress is None and piece_index != 8: + * raise ValueError + */ + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_swaps, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_swaps, __pyx_t_1); + __pyx_t_1 = 0; } + + /* "w3lib/_url.pyx":695 + * address[piece_index] = value + * piece_index += 1 + * if compress is not None: # <<<<<<<<<<<<<< + * swaps = piece_index - compress + * piece_index = 7 + */ + goto __pyx_L47; } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_input, __pyx_t_11}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "w3lib/_url.pyx":705 + * piece_index -= 1 + * swaps -= 1 + * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< + * raise ValueError + * return address + */ + __pyx_t_3 = (__pyx_v_compress == Py_None); + if (__pyx_t_3) { + } else { + __pyx_t_5 = __pyx_t_3; + goto __pyx_L52_bool_binop_done; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_9))) __PYX_ERR(0, 277, __pyx_L1_error) - __pyx_r = ((PyObject*)__pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 705, __pyx_L1_error) + __pyx_t_5 = __pyx_t_3; + __pyx_L52_bool_binop_done:; + if (unlikely(__pyx_t_5)) { + + /* "w3lib/_url.pyx":706 + * swaps -= 1 + * elif compress is None and piece_index != 8: + * raise ValueError # <<<<<<<<<<<<<< + * return address + * + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 706, __pyx_L1_error) + + /* "w3lib/_url.pyx":705 + * piece_index -= 1 + * swaps -= 1 + * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< + * raise ValueError + * return address + */ + } + __pyx_L47:; + + /* "w3lib/_url.pyx":707 + * elif compress is None and piece_index != 8: + * raise ValueError + * return address # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_address); + __pyx_r = __pyx_v_address; goto __pyx_L0; - /* "w3lib/_url.pyx":273 + /* "w3lib/_url.pyx":623 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser - * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< - * for code_point in input: - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + * + * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< + * address = [0] * 8 + * piece_index = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_AddTraceback("w3lib._url._parse_opaque_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._parse_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_address); + __Pyx_XDECREF(__pyx_v_piece_index); + __Pyx_XDECREF(__pyx_v_compress); + __Pyx_XDECREF(__pyx_v_pointer); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XDECREF(__pyx_v_numbers_seen); + __Pyx_XDECREF(__pyx_v_ipv4_piece); + __Pyx_XDECREF(__pyx_v_number); + __Pyx_XDECREF(__pyx_v_swaps); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":281 +/* "w3lib/_url.pyx":710 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< - * if not input: - * raise ValueError + * + * def _utf_8_percent_encode( # <<<<<<<<<<<<<< + * input: str, + * percent_encode_set: _PercentEncodeSet, */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv4_number(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_10_parse_ipv4_number, "_parse_ipv4_number(unicode input: str) -> Tuple[int, bool]"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_11_parse_ipv4_number = {"_parse_ipv4_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_11_parse_ipv4_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_10_parse_ipv4_number}; -static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv4_number(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_13_utf_8_percent_encode = {"_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -8072,17 +9815,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_percent_encode_set = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_parse_ipv4_number (wrapper)", 0); + __Pyx_RefNannySetupContext("_utf_8_percent_encode (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -8092,10 +9836,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_percent_encode_set,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -8108,23 +9854,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 710, __pyx_L3_error) else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_percent_encode_set)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 710, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, 1); __PYX_ERR(0, 710, __pyx_L3_error) + } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4_number") < 0)) __PYX_ERR(0, 281, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_utf_8_percent_encode") < 0)) __PYX_ERR(0, 710, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 1)) { + } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_percent_encode_set = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv4_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 281, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 710, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8134,12 +9892,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._parse_ipv4_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 281, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_10_parse_ipv4_number(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_percent_encode_set); /* function exit code */ goto __pyx_L0; @@ -8156,315 +9914,119 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { - int __pyx_v_validation_error; - long __pyx_v_r; +static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - Py_UCS4 __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_ipv4_number", 0); - __Pyx_INCREF(__pyx_v_input); - - /* "w3lib/_url.pyx":282 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: - * if not input: # <<<<<<<<<<<<<< - * raise ValueError - * validation_error = False - */ - __pyx_t_1 = (__Pyx_PyUnicode_IS_TRUE(__pyx_v_input) != 0); - __pyx_t_2 = (!__pyx_t_1); - if (unlikely(__pyx_t_2)) { - - /* "w3lib/_url.pyx":283 - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: - * if not input: - * raise ValueError # <<<<<<<<<<<<<< - * validation_error = False - * r = 10 - */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 283, __pyx_L1_error) - - /* "w3lib/_url.pyx":282 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: - * if not input: # <<<<<<<<<<<<<< - * raise ValueError - * validation_error = False - */ - } - - /* "w3lib/_url.pyx":284 - * if not input: - * raise ValueError - * validation_error = False # <<<<<<<<<<<<<< - * r = 10 - * if len(input) >= 2: - */ - __pyx_v_validation_error = 0; - - /* "w3lib/_url.pyx":285 - * raise ValueError - * validation_error = False - * r = 10 # <<<<<<<<<<<<<< - * if len(input) >= 2: - * if input[:2] in ("0X", "0x"): - */ - __pyx_v_r = 10; - - /* "w3lib/_url.pyx":286 - * validation_error = False - * r = 10 - * if len(input) >= 2: # <<<<<<<<<<<<<< - * if input[:2] in ("0X", "0x"): - * validation_error = True - */ - __pyx_t_3 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 286, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_3 >= 2); - if (__pyx_t_2) { - - /* "w3lib/_url.pyx":287 - * r = 10 - * if len(input) >= 2: - * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< - * validation_error = True - * input = input[2:] - */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0X, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 287, __pyx_L1_error) - if (!__pyx_t_1) { - } else { - __pyx_t_2 = __pyx_t_1; - goto __pyx_L6_bool_binop_done; - } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0x, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 287, __pyx_L1_error) - __pyx_t_2 = __pyx_t_1; - __pyx_L6_bool_binop_done:; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __pyx_t_2; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":288 - * if len(input) >= 2: - * if input[:2] in ("0X", "0x"): - * validation_error = True # <<<<<<<<<<<<<< - * input = input[2:] - * r = 16 - */ - __pyx_v_validation_error = 1; - - /* "w3lib/_url.pyx":289 - * if input[:2] in ("0X", "0x"): - * validation_error = True - * input = input[2:] # <<<<<<<<<<<<<< - * r = 16 - * elif input[0] == "0": - */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); - __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":290 - * validation_error = True - * input = input[2:] - * r = 16 # <<<<<<<<<<<<<< - * elif input[0] == "0": - * validation_error = True - */ - __pyx_v_r = 16; - - /* "w3lib/_url.pyx":287 - * r = 10 - * if len(input) >= 2: - * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< - * validation_error = True - * input = input[2:] - */ - goto __pyx_L5; - } - - /* "w3lib/_url.pyx":291 - * input = input[2:] - * r = 16 - * elif input[0] == "0": # <<<<<<<<<<<<<< - * validation_error = True - * input = input[1:] - */ - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 291, __pyx_L1_error) - __pyx_t_1 = (__pyx_t_5 == 48); - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":292 - * r = 16 - * elif input[0] == "0": - * validation_error = True # <<<<<<<<<<<<<< - * input = input[1:] - * r = 8 - */ - __pyx_v_validation_error = 1; - - /* "w3lib/_url.pyx":293 - * elif input[0] == "0": - * validation_error = True - * input = input[1:] # <<<<<<<<<<<<<< - * r = 8 - * if not input: - */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); - __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":294 - * validation_error = True - * input = input[1:] - * r = 8 # <<<<<<<<<<<<<< - * if not input: - * return (0, True) - */ - __pyx_v_r = 8; + __Pyx_RefNannySetupContext("_utf_8_percent_encode", 1); - /* "w3lib/_url.pyx":291 - * input = input[2:] - * r = 16 - * elif input[0] == "0": # <<<<<<<<<<<<<< - * validation_error = True - * input = input[1:] + /* "w3lib/_url.pyx":714 + * percent_encode_set: _PercentEncodeSet, + * ) -> str: + * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input, + * encoding="utf-8", */ - } - __pyx_L5:; + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":286 - * validation_error = False - * r = 10 - * if len(input) >= 2: # <<<<<<<<<<<<<< - * if input[:2] in ("0X", "0x"): - * validation_error = True + /* "w3lib/_url.pyx":715 + * ) -> str: + * return _percent_encode_after_encoding( + * input, # <<<<<<<<<<<<<< + * encoding="utf-8", + * percent_encode_set=percent_encode_set, */ - } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_input); + __Pyx_GIVEREF(__pyx_v_input); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input)) __PYX_ERR(0, 714, __pyx_L1_error); - /* "w3lib/_url.pyx":295 - * input = input[1:] - * r = 8 - * if not input: # <<<<<<<<<<<<<< - * return (0, True) - * return (int(input, base=r), validation_error) + /* "w3lib/_url.pyx":716 + * return _percent_encode_after_encoding( + * input, + * encoding="utf-8", # <<<<<<<<<<<<<< + * percent_encode_set=percent_encode_set, + * ) */ - __pyx_t_1 = (__Pyx_PyUnicode_IS_TRUE(__pyx_v_input) != 0); - __pyx_t_2 = (!__pyx_t_1); - if (__pyx_t_2) { + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 716, __pyx_L1_error) - /* "w3lib/_url.pyx":296 - * r = 8 - * if not input: - * return (0, True) # <<<<<<<<<<<<<< - * return (int(input, base=r), validation_error) + /* "w3lib/_url.pyx":717 + * input, + * encoding="utf-8", + * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< + * ) * */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_tuple__7); - __pyx_r = __pyx_tuple__7; - goto __pyx_L0; - - /* "w3lib/_url.pyx":295 - * input = input[1:] - * r = 8 - * if not input: # <<<<<<<<<<<<<< - * return (0, True) - * return (int(input, base=r), validation_error) - */ - } + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 716, __pyx_L1_error) - /* "w3lib/_url.pyx":297 - * if not input: - * return (0, True) - * return (int(input, base=r), validation_error) # <<<<<<<<<<<<<< - * - * + /* "w3lib/_url.pyx":714 + * percent_encode_set: _PercentEncodeSet, + * ) -> str: + * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input, + * encoding="utf-8", */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_input); - __Pyx_GIVEREF(__pyx_v_input); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_input)) __PYX_ERR(0, 297, __pyx_L1_error); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base, __pyx_t_7) < 0) __PYX_ERR(0, 297, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_validation_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error); - __pyx_t_7 = 0; - __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 714, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":281 + /* "w3lib/_url.pyx":710 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< - * if not input: - * raise ValueError + * + * def _utf_8_percent_encode( # <<<<<<<<<<<<<< + * input: str, + * percent_encode_set: _PercentEncodeSet, */ /* function exit code */ __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("w3lib._url._parse_ipv4_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_input); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":301 +/* "w3lib/_url.pyx":722 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< - * parts = input.split(".") - * if parts and parts[-1] == "": + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser + * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_13_ends_in_number(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_15_parse_opaque_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_12_ends_in_number, "_ends_in_number(unicode input: str) -> bool"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_13_ends_in_number = {"_ends_in_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_13_ends_in_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_12_ends_in_number}; -static PyObject *__pyx_pw_5w3lib_4_url_13_ends_in_number(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_15_parse_opaque_host = {"_parse_opaque_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_15_parse_opaque_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_15_parse_opaque_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -8482,7 +10044,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_ends_in_number (wrapper)", 0); + __Pyx_RefNannySetupContext("_parse_opaque_host (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -8508,12 +10070,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 722, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ends_in_number") < 0)) __PYX_ERR(0, 301, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_opaque_host") < 0)) __PYX_ERR(0, 722, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -8524,7 +10086,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_ends_in_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 301, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_opaque_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 722, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8534,12 +10096,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._parse_opaque_host", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 301, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_12_ends_in_number(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_14_parse_opaque_host(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -8555,519 +10117,559 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "w3lib/_url.pyx":308 - * parts = parts[:-1] - * last = parts[-1] - * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< - * return True - * try: - */ -static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *__pyx_cur_scope; +static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + Py_UCS4 __pyx_v_code_point; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 308, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; - __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_15_ends_in_number_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ends_in_number_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("w3lib._url._ends_in_number.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_3; + void *__pyx_t_4; int __pyx_t_5; int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("genexpr", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 308, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 308, __pyx_L1_error) } - if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { - __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 308, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 308, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 308, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_code_point); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = (!__pyx_t_5); - if (__pyx_t_6) { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_RefNannySetupContext("_parse_opaque_host", 1); + + /* "w3lib/_url.pyx":723 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser + * def _parse_opaque_host(input: str) -> str: + * for code_point in input: # <<<<<<<<<<<<<< + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + * raise ValueError + */ + __Pyx_INCREF(__pyx_v_input); + __pyx_t_1 = __pyx_v_input; + __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 723, __pyx_L1_error) + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) { + __pyx_t_2 = __pyx_t_7; + __pyx_v_code_point = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2); + + /* "w3lib/_url.pyx":724 + * def _parse_opaque_host(input: str) -> str: + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< + * raise ValueError + * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) + */ + __pyx_t_8 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__pyx_t_10)) { + + /* "w3lib/_url.pyx":725 + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + * raise ValueError # <<<<<<<<<<<<<< + * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) + * + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 725, __pyx_L1_error) + + /* "w3lib/_url.pyx":724 + * def _parse_opaque_host(input: str) -> str: + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< + * raise ValueError + * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) + */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; + + /* "w3lib/_url.pyx":726 + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + * raise ValueError + * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_5 = 1; + } } - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_input, __pyx_t_11}; + __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_9))) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":722 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser + * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + */ /* function exit code */ - goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("w3lib._url._parse_opaque_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":301 +/* "w3lib/_url.pyx":730 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< - * parts = input.split(".") - * if parts and parts[-1] == "": + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< + * if not input: + * raise ValueError */ -static PyObject *__pyx_pf_5w3lib_4_url_12_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { - PyObject *__pyx_v_parts = NULL; - PyObject *__pyx_v_last = NULL; - PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_17_parse_ipv4_number(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_17_parse_ipv4_number = {"_parse_ipv4_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_17_parse_ipv4_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_17_parse_ipv4_number(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ends_in_number", 1); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_parse_ipv4_number (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 730, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4_number") < 0)) __PYX_ERR(0, 730, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_parse_ipv4_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 730, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._parse_ipv4_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_16_parse_ipv4_number(__pyx_self, __pyx_v_input); - /* "w3lib/_url.pyx":302 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: - * parts = input.split(".") # <<<<<<<<<<<<<< - * if parts and parts[-1] == "": - * if len(parts) == 1: + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + int __pyx_v_validation_error; + long __pyx_v_r; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_UCS4 __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_ipv4_number", 0); + __Pyx_INCREF(__pyx_v_input); + + /* "w3lib/_url.pyx":731 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: + * if not input: # <<<<<<<<<<<<<< + * raise ValueError + * validation_error = False */ - __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_parts = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_1 = (__Pyx_PyUnicode_IS_TRUE(__pyx_v_input) != 0); + __pyx_t_2 = (!__pyx_t_1); + if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":303 - * def _ends_in_number(input: str) -> bool: - * parts = input.split(".") - * if parts and parts[-1] == "": # <<<<<<<<<<<<<< - * if len(parts) == 1: - * return False + /* "w3lib/_url.pyx":732 + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: + * if not input: + * raise ValueError # <<<<<<<<<<<<<< + * validation_error = False + * r = 10 + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 732, __pyx_L1_error) + + /* "w3lib/_url.pyx":731 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: + * if not input: # <<<<<<<<<<<<<< + * raise ValueError + * validation_error = False */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 303, __pyx_L1_error) - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L4_bool_binop_done; } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __pyx_t_3; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - /* "w3lib/_url.pyx":304 - * parts = input.split(".") - * if parts and parts[-1] == "": - * if len(parts) == 1: # <<<<<<<<<<<<<< - * return False - * parts = parts[:-1] + /* "w3lib/_url.pyx":733 + * if not input: + * raise ValueError + * validation_error = False # <<<<<<<<<<<<<< + * r = 10 + * if len(input) >= 2: */ - __pyx_t_4 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 304, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_4 == 1); - if (__pyx_t_2) { + __pyx_v_validation_error = 0; - /* "w3lib/_url.pyx":305 - * if parts and parts[-1] == "": - * if len(parts) == 1: - * return False # <<<<<<<<<<<<<< - * parts = parts[:-1] - * last = parts[-1] + /* "w3lib/_url.pyx":734 + * raise ValueError + * validation_error = False + * r = 10 # <<<<<<<<<<<<<< + * if len(input) >= 2: + * if input[:2] in ("0X", "0x"): */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; + __pyx_v_r = 10; - /* "w3lib/_url.pyx":304 - * parts = input.split(".") - * if parts and parts[-1] == "": - * if len(parts) == 1: # <<<<<<<<<<<<<< - * return False - * parts = parts[:-1] + /* "w3lib/_url.pyx":735 + * validation_error = False + * r = 10 + * if len(input) >= 2: # <<<<<<<<<<<<<< + * if input[:2] in ("0X", "0x"): + * validation_error = True */ + __pyx_t_3 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_3 >= 2); + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":736 + * r = 10 + * if len(input) >= 2: + * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< + * validation_error = True + * input = input[2:] + */ + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0X, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 736, __pyx_L1_error) + if (!__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L6_bool_binop_done; } + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0x, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1; + __pyx_L6_bool_binop_done:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_2; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":306 - * if len(parts) == 1: - * return False - * parts = parts[:-1] # <<<<<<<<<<<<<< - * last = parts[-1] - * if last and all(code_point in _ASCII_DIGIT for code_point in last): + /* "w3lib/_url.pyx":737 + * if len(input) >= 2: + * if input[:2] in ("0X", "0x"): + * validation_error = True # <<<<<<<<<<<<<< + * input = input[2:] + * r = 16 */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_validation_error = 1; - /* "w3lib/_url.pyx":303 - * def _ends_in_number(input: str) -> bool: - * parts = input.split(".") - * if parts and parts[-1] == "": # <<<<<<<<<<<<<< - * if len(parts) == 1: - * return False + /* "w3lib/_url.pyx":738 + * if input[:2] in ("0X", "0x"): + * validation_error = True + * input = input[2:] # <<<<<<<<<<<<<< + * r = 16 + * elif input[0] == "0": */ - } + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":307 - * return False - * parts = parts[:-1] - * last = parts[-1] # <<<<<<<<<<<<<< - * if last and all(code_point in _ASCII_DIGIT for code_point in last): - * return True + /* "w3lib/_url.pyx":739 + * validation_error = True + * input = input[2:] + * r = 16 # <<<<<<<<<<<<<< + * elif input[0] == "0": + * validation_error = True */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_last = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_r = 16; - /* "w3lib/_url.pyx":308 - * parts = parts[:-1] - * last = parts[-1] - * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< - * return True - * try: + /* "w3lib/_url.pyx":736 + * r = 10 + * if len(input) >= 2: + * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< + * validation_error = True + * input = input[2:] */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_last); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L8_bool_binop_done; - } - __pyx_t_1 = __pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(NULL, __pyx_v_last); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __pyx_t_3; - __pyx_L8_bool_binop_done:; - if (__pyx_t_2) { + goto __pyx_L5; + } - /* "w3lib/_url.pyx":309 - * last = parts[-1] - * if last and all(code_point in _ASCII_DIGIT for code_point in last): - * return True # <<<<<<<<<<<<<< - * try: - * _parse_ipv4_number(last) + /* "w3lib/_url.pyx":740 + * input = input[2:] + * r = 16 + * elif input[0] == "0": # <<<<<<<<<<<<<< + * validation_error = True + * input = input[1:] */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_5 == 48); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":308 - * parts = parts[:-1] - * last = parts[-1] - * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< - * return True - * try: + /* "w3lib/_url.pyx":741 + * r = 16 + * elif input[0] == "0": + * validation_error = True # <<<<<<<<<<<<<< + * input = input[1:] + * r = 8 */ - } + __pyx_v_validation_error = 1; - /* "w3lib/_url.pyx":310 - * if last and all(code_point in _ASCII_DIGIT for code_point in last): - * return True - * try: # <<<<<<<<<<<<<< - * _parse_ipv4_number(last) - * except ValueError: + /* "w3lib/_url.pyx":742 + * elif input[0] == "0": + * validation_error = True + * input = input[1:] # <<<<<<<<<<<<<< + * r = 8 + * if not input: */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - __Pyx_XGOTREF(__pyx_t_8); - /*try:*/ { + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":311 - * return True - * try: - * _parse_ipv4_number(last) # <<<<<<<<<<<<<< - * except ValueError: - * return False + /* "w3lib/_url.pyx":743 + * validation_error = True + * input = input[1:] + * r = 8 # <<<<<<<<<<<<<< + * if not input: + * return (0, True) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_10 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_last}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_r = 8; - /* "w3lib/_url.pyx":310 - * if last and all(code_point in _ASCII_DIGIT for code_point in last): - * return True - * try: # <<<<<<<<<<<<<< - * _parse_ipv4_number(last) - * except ValueError: + /* "w3lib/_url.pyx":740 + * input = input[2:] + * r = 16 + * elif input[0] == "0": # <<<<<<<<<<<<<< + * validation_error = True + * input = input[1:] */ } - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L15_try_end; - __pyx_L10_error:; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_L5:; - /* "w3lib/_url.pyx":312 - * try: - * _parse_ipv4_number(last) - * except ValueError: # <<<<<<<<<<<<<< - * return False - * return True + /* "w3lib/_url.pyx":735 + * validation_error = False + * r = 10 + * if len(input) >= 2: # <<<<<<<<<<<<<< + * if input[:2] in ("0X", "0x"): + * validation_error = True */ - __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); - if (__pyx_t_10) { - __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(0, 312, __pyx_L12_except_error) - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_9); + } - /* "w3lib/_url.pyx":313 - * _parse_ipv4_number(last) - * except ValueError: - * return False # <<<<<<<<<<<<<< - * return True - * + /* "w3lib/_url.pyx":744 + * input = input[1:] + * r = 8 + * if not input: # <<<<<<<<<<<<<< + * return (0, True) + * return (int(input, base=r), validation_error) */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L13_except_return; - } - goto __pyx_L12_except_error; + __pyx_t_1 = (__Pyx_PyUnicode_IS_TRUE(__pyx_v_input) != 0); + __pyx_t_2 = (!__pyx_t_1); + if (__pyx_t_2) { - /* "w3lib/_url.pyx":310 - * if last and all(code_point in _ASCII_DIGIT for code_point in last): - * return True - * try: # <<<<<<<<<<<<<< - * _parse_ipv4_number(last) - * except ValueError: + /* "w3lib/_url.pyx":745 + * r = 8 + * if not input: + * return (0, True) # <<<<<<<<<<<<<< + * return (int(input, base=r), validation_error) + * */ - __pyx_L12_except_error:; - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); - goto __pyx_L1_error; - __pyx_L13_except_return:; - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__7); + __pyx_r = __pyx_tuple__7; goto __pyx_L0; - __pyx_L15_try_end:; + + /* "w3lib/_url.pyx":744 + * input = input[1:] + * r = 8 + * if not input: # <<<<<<<<<<<<<< + * return (0, True) + * return (int(input, base=r), validation_error) + */ } - /* "w3lib/_url.pyx":314 - * except ValueError: - * return False - * return True # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":746 + * if not input: + * return (0, True) + * return (int(input, base=r), validation_error) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_input); + __Pyx_GIVEREF(__pyx_v_input); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_input)) __PYX_ERR(0, 746, __pyx_L1_error); + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base, __pyx_t_7) < 0) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_validation_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 746, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 746, __pyx_L1_error); + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_r = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":301 + /* "w3lib/_url.pyx":730 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< - * parts = input.split(".") - * if parts and parts[-1] == "": + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< + * if not input: + * raise ValueError */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._parse_ipv4_number", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_parts); - __Pyx_XDECREF(__pyx_v_last); - __Pyx_XDECREF(__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator); + __Pyx_XDECREF(__pyx_v_input); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":318 +/* "w3lib/_url.pyx":750 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser - * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< * parts = input.split(".") - * if parts and not parts[-1]: + * if parts and parts[-1] == "": */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_15_parse_ipv4(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_19_ends_in_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_14_parse_ipv4, "_parse_ipv4(unicode input: str) -> int"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_15_parse_ipv4 = {"_parse_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_15_parse_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_14_parse_ipv4}; -static PyObject *__pyx_pw_5w3lib_4_url_15_parse_ipv4(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_19_ends_in_number = {"_ends_in_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_19_ends_in_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_19_ends_in_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -9085,7 +10687,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_parse_ipv4 (wrapper)", 0); + __Pyx_RefNannySetupContext("_ends_in_number (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -9111,12 +10713,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 750, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4") < 0)) __PYX_ERR(0, 318, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ends_in_number") < 0)) __PYX_ERR(0, 750, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -9127,7 +10729,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 318, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_ends_in_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 750, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9137,12 +10739,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._parse_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 318, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_14_parse_ipv4(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_18_ends_in_number(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -9158,29 +10760,29 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "w3lib/_url.pyx":328 - * result = _parse_ipv4_number(part) - * numbers.append(result[0]) - * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< - * raise ValueError - * if numbers[-1] >= 256 ** (5 - len(numbers)): +/* "w3lib/_url.pyx":757 + * parts = parts[:-1] + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< + * return True + * try: */ -static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *__pyx_cur_scope; +static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 328, __pyx_L1_error) + __PYX_ERR(0, 757, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -9188,7 +10790,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObj __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_ipv4_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_15_ends_in_number_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ends_in_number_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 757, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -9196,7 +10798,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObj /* function exit code */ __pyx_L1_error:; - __Pyx_AddTraceback("w3lib._url._parse_ipv4.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._ends_in_number.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -9204,14 +10806,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObj return __pyx_r; } -static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -9224,35 +10828,73 @@ static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_Coroutine return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 328, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 328, __pyx_L1_error) } - __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = 0; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 757, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 757, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error) + } for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 328, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 757, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 757, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 757, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_item, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_code_point); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } @@ -9260,8 +10902,8 @@ static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_Coroutine __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*else*/ { __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; goto __pyx_L0; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -9271,7 +10913,7 @@ static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_Coroutine __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -9284,507 +10926,370 @@ static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_Coroutine return __pyx_r; } -/* "w3lib/_url.pyx":318 +/* "w3lib/_url.pyx":750 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser - * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< * parts = input.split(".") - * if parts and not parts[-1]: + * if parts and parts[-1] == "": */ -static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_v_parts = NULL; - PyObject *__pyx_v_numbers = NULL; - PyObject *__pyx_v_part = NULL; - PyObject *__pyx_v_result = NULL; - PyObject *__pyx_v_ipv4 = NULL; - PyObject *__pyx_v_counter = NULL; - PyObject *__pyx_v_n = NULL; - PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1 = 0; + PyObject *__pyx_v_last = NULL; + PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; - int __pyx_t_4; - Py_ssize_t __pyx_t_5; - PyObject *(*__pyx_t_6)(PyObject *); + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; - int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_ipv4", 1); + __Pyx_RefNannySetupContext("_ends_in_number", 1); - /* "w3lib/_url.pyx":319 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser - * def _parse_ipv4(input: str) -> int: + /* "w3lib/_url.pyx":751 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: * parts = input.split(".") # <<<<<<<<<<<<<< - * if parts and not parts[-1]: - * parts = parts[:-1] + * if parts and parts[-1] == "": + * if len(parts) == 1: */ - __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parts = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":320 - * def _parse_ipv4(input: str) -> int: + /* "w3lib/_url.pyx":752 + * def _ends_in_number(input: str) -> bool: * parts = input.split(".") - * if parts and not parts[-1]: # <<<<<<<<<<<<<< - * parts = parts[:-1] - * if len(parts) > 4: + * if parts and parts[-1] == "": # <<<<<<<<<<<<<< + * if len(parts) == 1: + * return False */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 752, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = (!__pyx_t_3); - __pyx_t_2 = __pyx_t_4; + __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":321 + /* "w3lib/_url.pyx":753 * parts = input.split(".") - * if parts and not parts[-1]: - * parts = parts[:-1] # <<<<<<<<<<<<<< - * if len(parts) > 4: - * raise ValueError + * if parts and parts[-1] == "": + * if len(parts) == 1: # <<<<<<<<<<<<<< + * return False + * parts = parts[:-1] */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_4 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 753, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_4 == 1); + if (__pyx_t_2) { - /* "w3lib/_url.pyx":320 - * def _parse_ipv4(input: str) -> int: - * parts = input.split(".") - * if parts and not parts[-1]: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":754 + * if parts and parts[-1] == "": + * if len(parts) == 1: + * return False # <<<<<<<<<<<<<< * parts = parts[:-1] - * if len(parts) > 4: + * last = parts[-1] */ - } + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; - /* "w3lib/_url.pyx":322 - * if parts and not parts[-1]: + /* "w3lib/_url.pyx":753 + * parts = input.split(".") + * if parts and parts[-1] == "": + * if len(parts) == 1: # <<<<<<<<<<<<<< + * return False * parts = parts[:-1] - * if len(parts) > 4: # <<<<<<<<<<<<<< - * raise ValueError - * numbers = [] */ - __pyx_t_5 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 322, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_5 > 4); - if (unlikely(__pyx_t_2)) { + } - /* "w3lib/_url.pyx":323 - * parts = parts[:-1] - * if len(parts) > 4: - * raise ValueError # <<<<<<<<<<<<<< - * numbers = [] - * for part in parts: + /* "w3lib/_url.pyx":755 + * if len(parts) == 1: + * return False + * parts = parts[:-1] # <<<<<<<<<<<<<< + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":322 - * if parts and not parts[-1]: - * parts = parts[:-1] - * if len(parts) > 4: # <<<<<<<<<<<<<< - * raise ValueError - * numbers = [] + /* "w3lib/_url.pyx":752 + * def _ends_in_number(input: str) -> bool: + * parts = input.split(".") + * if parts and parts[-1] == "": # <<<<<<<<<<<<<< + * if len(parts) == 1: + * return False */ } - /* "w3lib/_url.pyx":324 - * if len(parts) > 4: - * raise ValueError - * numbers = [] # <<<<<<<<<<<<<< - * for part in parts: - * result = _parse_ipv4_number(part) + /* "w3lib/_url.pyx":756 + * return False + * parts = parts[:-1] + * last = parts[-1] # <<<<<<<<<<<<<< + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_numbers = ((PyObject*)__pyx_t_1); + __pyx_v_last = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":325 - * raise ValueError - * numbers = [] - * for part in parts: # <<<<<<<<<<<<<< - * result = _parse_ipv4_number(part) - * numbers.append(result[0]) + /* "w3lib/_url.pyx":757 + * parts = parts[:-1] + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< + * return True + * try: */ - if (likely(PyList_CheckExact(__pyx_v_parts)) || PyTuple_CheckExact(__pyx_v_parts)) { - __pyx_t_1 = __pyx_v_parts; __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; - __pyx_t_6 = NULL; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_last); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) + if (__pyx_t_3) { } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_2 = __pyx_t_3; + goto __pyx_L8_bool_binop_done; } - for (;;) { - if (likely(!__pyx_t_6)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 325, __pyx_L1_error) - #endif - if (__pyx_t_5 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) - #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 325, __pyx_L1_error) - #endif - if (__pyx_t_5 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) - #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - } - } else { - __pyx_t_7 = __pyx_t_6(__pyx_t_1); - if (unlikely(!__pyx_t_7)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 325, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_7); - } - __Pyx_XDECREF_SET(__pyx_v_part, __pyx_t_7); - __pyx_t_7 = 0; - - /* "w3lib/_url.pyx":326 - * numbers = [] - * for part in parts: - * result = _parse_ipv4_number(part) # <<<<<<<<<<<<<< - * numbers.append(result[0]) - * if any(item > 255 for item in numbers[:-1]): - */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_10 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_part}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_7); - __pyx_t_7 = 0; + __pyx_t_1 = __pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(NULL, __pyx_v_last); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 757, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __pyx_t_3; + __pyx_L8_bool_binop_done:; + if (__pyx_t_2) { - /* "w3lib/_url.pyx":327 - * for part in parts: - * result = _parse_ipv4_number(part) - * numbers.append(result[0]) # <<<<<<<<<<<<<< - * if any(item > 255 for item in numbers[:-1]): - * raise ValueError + /* "w3lib/_url.pyx":758 + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True # <<<<<<<<<<<<<< + * try: + * _parse_ipv4_number(last) */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_numbers, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 327, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; - /* "w3lib/_url.pyx":325 - * raise ValueError - * numbers = [] - * for part in parts: # <<<<<<<<<<<<<< - * result = _parse_ipv4_number(part) - * numbers.append(result[0]) + /* "w3lib/_url.pyx":757 + * parts = parts[:-1] + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< + * return True + * try: */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":328 - * result = _parse_ipv4_number(part) - * numbers.append(result[0]) - * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< - * raise ValueError - * if numbers[-1] >= 256 ** (5 - len(numbers)): + /* "w3lib/_url.pyx":759 + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True + * try: # <<<<<<<<<<<<<< + * _parse_ipv4_number(last) + * except ValueError: */ - __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__pyx_t_2)) { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { - /* "w3lib/_url.pyx":329 - * numbers.append(result[0]) - * if any(item > 255 for item in numbers[:-1]): - * raise ValueError # <<<<<<<<<<<<<< - * if numbers[-1] >= 256 ** (5 - len(numbers)): - * raise ValueError + /* "w3lib/_url.pyx":760 + * return True + * try: + * _parse_ipv4_number(last) # <<<<<<<<<<<<<< + * except ValueError: + * return False */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_last}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":328 - * result = _parse_ipv4_number(part) - * numbers.append(result[0]) - * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< - * raise ValueError - * if numbers[-1] >= 256 ** (5 - len(numbers)): + /* "w3lib/_url.pyx":759 + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True + * try: # <<<<<<<<<<<<<< + * _parse_ipv4_number(last) + * except ValueError: */ - } + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L15_try_end; + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":330 - * if any(item > 255 for item in numbers[:-1]): - * raise ValueError - * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< - * raise ValueError - * ipv4 = numbers[-1] + /* "w3lib/_url.pyx":761 + * try: + * _parse_ipv4_number(last) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * return True */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyList_GET_SIZE(__pyx_v_numbers); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 330, __pyx_L1_error) - __pyx_t_7 = PyFloat_FromDouble(pow(256.0, ((double)(5 - __pyx_t_5)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(__pyx_t_2)) { + __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_10) { + __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(0, 761, __pyx_L12_except_error) + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_9); - /* "w3lib/_url.pyx":331 - * raise ValueError - * if numbers[-1] >= 256 ** (5 - len(numbers)): - * raise ValueError # <<<<<<<<<<<<<< - * ipv4 = numbers[-1] - * counter = 0 + /* "w3lib/_url.pyx":762 + * _parse_ipv4_number(last) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * return True + * */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L13_except_return; + } + goto __pyx_L12_except_error; - /* "w3lib/_url.pyx":330 - * if any(item > 255 for item in numbers[:-1]): - * raise ValueError - * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< - * raise ValueError - * ipv4 = numbers[-1] + /* "w3lib/_url.pyx":759 + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True + * try: # <<<<<<<<<<<<<< + * _parse_ipv4_number(last) + * except ValueError: */ + __pyx_L12_except_error:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L13_except_return:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L0; + __pyx_L15_try_end:; } - /* "w3lib/_url.pyx":332 - * if numbers[-1] >= 256 ** (5 - len(numbers)): - * raise ValueError - * ipv4 = numbers[-1] # <<<<<<<<<<<<<< - * counter = 0 - * for n in numbers[:-1]: + /* "w3lib/_url.pyx":763 + * except ValueError: + * return False + * return True # <<<<<<<<<<<<<< + * + * */ - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_ipv4 = __pyx_t_8; - __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; - /* "w3lib/_url.pyx":333 - * raise ValueError - * ipv4 = numbers[-1] - * counter = 0 # <<<<<<<<<<<<<< - * for n in numbers[:-1]: - * ipv4 += n * 256 ** (3 - counter) - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_counter = __pyx_int_0; - - /* "w3lib/_url.pyx":334 - * ipv4 = numbers[-1] - * counter = 0 - * for n in numbers[:-1]: # <<<<<<<<<<<<<< - * ipv4 += n * 256 ** (3 - counter) - * counter += 1 - */ - __pyx_t_8 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); - __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 334, __pyx_L1_error) - #endif - if (__pyx_t_5 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 334, __pyx_L1_error) - #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - #endif - __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_8); - __pyx_t_8 = 0; - - /* "w3lib/_url.pyx":335 - * counter = 0 - * for n in numbers[:-1]: - * ipv4 += n * 256 ** (3 - counter) # <<<<<<<<<<<<<< - * counter += 1 - * return ipv4 - */ - __pyx_t_8 = __Pyx_PyInt_SubtractCObj(__pyx_int_3, __pyx_v_counter, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyNumber_Power(__pyx_int_256, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ipv4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF_SET(__pyx_v_ipv4, __pyx_t_1); - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":336 - * for n in numbers[:-1]: - * ipv4 += n * 256 ** (3 - counter) - * counter += 1 # <<<<<<<<<<<<<< - * return ipv4 - * - */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_counter, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_counter, __pyx_t_1); - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":334 - * ipv4 = numbers[-1] - * counter = 0 - * for n in numbers[:-1]: # <<<<<<<<<<<<<< - * ipv4 += n * 256 ** (3 - counter) - * counter += 1 - */ - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "w3lib/_url.pyx":337 - * ipv4 += n * 256 ** (3 - counter) - * counter += 1 - * return ipv4 # <<<<<<<<<<<<<< - * + /* "w3lib/_url.pyx":750 * - */ - __Pyx_XDECREF(__pyx_r); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_ipv4))||((__pyx_v_ipv4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_ipv4))) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_INCREF(__pyx_v_ipv4); - __pyx_r = ((PyObject*)__pyx_v_ipv4); - goto __pyx_L0; - - /* "w3lib/_url.pyx":318 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser - * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< * parts = input.split(".") - * if parts and not parts[-1]: + * if parts and parts[-1] == "": */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("w3lib._url._parse_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_parts); - __Pyx_XDECREF(__pyx_v_numbers); - __Pyx_XDECREF(__pyx_v_part); - __Pyx_XDECREF(__pyx_v_result); - __Pyx_XDECREF(__pyx_v_ipv4); - __Pyx_XDECREF(__pyx_v_counter); - __Pyx_XDECREF(__pyx_v_n); - __Pyx_XDECREF(__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1); + __Pyx_XDECREF(__pyx_v_last); + __Pyx_XDECREF(__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":341 +/* "w3lib/_url.pyx":767 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< - * result = _utr46._to_ascii( - * domain, + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and not parts[-1]: */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_17_domain_to_ascii(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_21_parse_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_16_domain_to_ascii, "_domain_to_ascii(unicode domain: str, *, be_strict: bool = False) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_17_domain_to_ascii = {"_domain_to_ascii", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_17_domain_to_ascii, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_16_domain_to_ascii}; -static PyObject *__pyx_pw_5w3lib_4_url_17_domain_to_ascii(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_21_parse_ipv4 = {"_parse_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_21_parse_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_21_parse_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_domain = 0; - PyObject *__pyx_v_be_strict = 0; + PyObject *__pyx_v_input = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_domain_to_ascii (wrapper)", 0); + __Pyx_RefNannySetupContext("_parse_ipv4 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -9794,8 +11299,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain,&__pyx_n_s_be_strict,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -9807,34 +11311,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domain)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 341, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 767, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } - if (kw_args == 1) { - const Py_ssize_t index = 1; - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); - if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 341, __pyx_L3_error) - } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_domain_to_ascii") < 0)) __PYX_ERR(0, 341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4") < 0)) __PYX_ERR(0, 767, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_domain = ((PyObject*)values[0]); - __pyx_v_be_strict = values[1]; + __pyx_v_input = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_domain_to_ascii", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 767, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9844,12 +11341,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._domain_to_ascii", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._parse_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain), (&PyUnicode_Type), 0, "domain", 1))) __PYX_ERR(0, 341, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_16_domain_to_ascii(__pyx_self, __pyx_v_domain, __pyx_v_be_strict); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_20_parse_ipv4(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -9865,248 +11362,621 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_16_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, PyObject *__pyx_v_be_strict) { - PyObject *__pyx_v_result = NULL; +/* "w3lib/_url.pyx":777 + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): + */ + +static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 777, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_ipv4_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("w3lib._url._parse_ipv4.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - Py_ssize_t __pyx_t_7; - Py_UCS4 __pyx_t_8; + int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_domain_to_ascii", 1); - - /* "w3lib/_url.pyx":342 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: - * result = _utr46._to_ascii( # <<<<<<<<<<<<<< - * domain, - * use_std3_ascii_rules=be_strict, - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utr46); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_ascii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 777, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 777, __pyx_L1_error) } + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 777, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_item, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "w3lib/_url.pyx":343 - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: - * result = _utr46._to_ascii( - * domain, # <<<<<<<<<<<<<< - * use_std3_ascii_rules=be_strict, - * check_hyphens=False, - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_domain); - __Pyx_GIVEREF(__pyx_v_domain); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domain)) __PYX_ERR(0, 342, __pyx_L1_error); - - /* "w3lib/_url.pyx":344 - * result = _utr46._to_ascii( - * domain, - * use_std3_ascii_rules=be_strict, # <<<<<<<<<<<<<< - * check_hyphens=False, - * check_bidi=True, - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_v_be_strict) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - - /* "w3lib/_url.pyx":345 - * domain, - * use_std3_ascii_rules=be_strict, - * check_hyphens=False, # <<<<<<<<<<<<<< - * check_bidi=True, - * check_joiners=True, - */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, Py_False) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":346 - * use_std3_ascii_rules=be_strict, - * check_hyphens=False, - * check_bidi=True, # <<<<<<<<<<<<<< - * check_joiners=True, - * transitional_processing=False, +/* "w3lib/_url.pyx":767 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and not parts[-1]: */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, Py_True) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - /* "w3lib/_url.pyx":347 - * check_hyphens=False, - * check_bidi=True, - * check_joiners=True, # <<<<<<<<<<<<<< - * transitional_processing=False, - * verify_dns_length=be_strict, - */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, Py_True) < 0) __PYX_ERR(0, 344, __pyx_L1_error) +static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + PyObject *__pyx_v_parts = NULL; + PyObject *__pyx_v_numbers = NULL; + PyObject *__pyx_v_part = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_ipv4 = NULL; + PyObject *__pyx_v_counter = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1 = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_ipv4", 1); - /* "w3lib/_url.pyx":348 - * check_bidi=True, - * check_joiners=True, - * transitional_processing=False, # <<<<<<<<<<<<<< - * verify_dns_length=be_strict, - * ) + /* "w3lib/_url.pyx":768 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: + * parts = input.split(".") # <<<<<<<<<<<<<< + * if parts and not parts[-1]: + * parts = parts[:-1] */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, Py_False) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_parts = __pyx_t_1; + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":349 - * check_joiners=True, - * transitional_processing=False, - * verify_dns_length=be_strict, # <<<<<<<<<<<<<< - * ) - * if not result: + /* "w3lib/_url.pyx":769 + * def _parse_ipv4(input: str) -> int: + * parts = input.split(".") + * if parts and not parts[-1]: # <<<<<<<<<<<<<< + * parts = parts[:-1] + * if len(parts) > 4: */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_v_be_strict) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 769, __pyx_L1_error) + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 769, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (!__pyx_t_3); + __pyx_t_2 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { - /* "w3lib/_url.pyx":342 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: - * result = _utr46._to_ascii( # <<<<<<<<<<<<<< - * domain, - * use_std3_ascii_rules=be_strict, + /* "w3lib/_url.pyx":770 + * parts = input.split(".") + * if parts and not parts[-1]: + * parts = parts[:-1] # <<<<<<<<<<<<<< + * if len(parts) > 4: + * raise ValueError */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_result = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":351 - * verify_dns_length=be_strict, - * ) - * if not result: # <<<<<<<<<<<<<< - * raise ValueError( - * f"Domain name {domain!r} is an empty string after conversion to " + /* "w3lib/_url.pyx":769 + * def _parse_ipv4(input: str) -> int: + * parts = input.split(".") + * if parts and not parts[-1]: # <<<<<<<<<<<<<< + * parts = parts[:-1] + * if len(parts) > 4: */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) - __pyx_t_6 = (!__pyx_t_5); - if (unlikely(__pyx_t_6)) { + } - /* "w3lib/_url.pyx":353 - * if not result: - * raise ValueError( - * f"Domain name {domain!r} is an empty string after conversion to " # <<<<<<<<<<<<<< - * f"ASCII, which makes for an invalid domain name." - * ) + /* "w3lib/_url.pyx":771 + * if parts and not parts[-1]: + * parts = parts[:-1] + * if len(parts) > 4: # <<<<<<<<<<<<<< + * raise ValueError + * numbers = [] */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = 0; - __pyx_t_8 = 127; - __Pyx_INCREF(__pyx_kp_u_Domain_name); - __pyx_t_7 += 12; - __Pyx_GIVEREF(__pyx_kp_u_Domain_name); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Domain_name); - __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8; - __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __pyx_t_3 = 0; - __Pyx_INCREF(__pyx_kp_u_is_an_empty_string_after_conver); - __pyx_t_7 += 86; - __Pyx_GIVEREF(__pyx_kp_u_is_an_empty_string_after_conver); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_is_an_empty_string_after_conver); - __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_5 > 4); + if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":352 - * ) - * if not result: - * raise ValueError( # <<<<<<<<<<<<<< - * f"Domain name {domain!r} is an empty string after conversion to " - * f"ASCII, which makes for an invalid domain name." + /* "w3lib/_url.pyx":772 + * parts = parts[:-1] + * if len(parts) > 4: + * raise ValueError # <<<<<<<<<<<<<< + * numbers = [] + * for part in parts: */ - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 772, __pyx_L1_error) - /* "w3lib/_url.pyx":351 - * verify_dns_length=be_strict, - * ) - * if not result: # <<<<<<<<<<<<<< - * raise ValueError( - * f"Domain name {domain!r} is an empty string after conversion to " + /* "w3lib/_url.pyx":771 + * if parts and not parts[-1]: + * parts = parts[:-1] + * if len(parts) > 4: # <<<<<<<<<<<<<< + * raise ValueError + * numbers = [] */ } - /* "w3lib/_url.pyx":356 - * f"ASCII, which makes for an invalid domain name." - * ) - * return result # <<<<<<<<<<<<<< - * - * + /* "w3lib/_url.pyx":773 + * if len(parts) > 4: + * raise ValueError + * numbers = [] # <<<<<<<<<<<<<< + * for part in parts: + * result = _parse_ipv4_number(part) */ - __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_result))) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_INCREF(__pyx_v_result); - __pyx_r = ((PyObject*)__pyx_v_result); - goto __pyx_L0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_numbers = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":341 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< - * result = _utr46._to_ascii( - * domain, + /* "w3lib/_url.pyx":774 + * raise ValueError + * numbers = [] + * for part in parts: # <<<<<<<<<<<<<< + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) + */ + if (likely(PyList_CheckExact(__pyx_v_parts)) || PyTuple_CheckExact(__pyx_v_parts)) { + __pyx_t_1 = __pyx_v_parts; __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 774, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 774, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 774, __pyx_L1_error) + #else + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 774, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 774, __pyx_L1_error) + #else + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_1); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 774, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_part, __pyx_t_7); + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":775 + * numbers = [] + * for part in parts: + * result = _parse_ipv4_number(part) # <<<<<<<<<<<<<< + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): + */ + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_part}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_7); + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":776 + * for part in parts: + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) # <<<<<<<<<<<<<< + * if any(item > 255 for item in numbers[:-1]): + * raise ValueError + */ + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_numbers, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":774 + * raise ValueError + * numbers = [] + * for part in parts: # <<<<<<<<<<<<<< + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":777 + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): + */ + __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_2)) { + + /* "w3lib/_url.pyx":778 + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): + * raise ValueError # <<<<<<<<<<<<<< + * if numbers[-1] >= 256 ** (5 - len(numbers)): + * raise ValueError + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 778, __pyx_L1_error) + + /* "w3lib/_url.pyx":777 + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): + */ + } + + /* "w3lib/_url.pyx":779 + * if any(item > 255 for item in numbers[:-1]): + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< + * raise ValueError + * ipv4 = numbers[-1] + */ + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyList_GET_SIZE(__pyx_v_numbers); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 779, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(pow(256.0, ((double)(5 - __pyx_t_5)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(__pyx_t_2)) { + + /* "w3lib/_url.pyx":780 + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): + * raise ValueError # <<<<<<<<<<<<<< + * ipv4 = numbers[-1] + * counter = 0 + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 780, __pyx_L1_error) + + /* "w3lib/_url.pyx":779 + * if any(item > 255 for item in numbers[:-1]): + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< + * raise ValueError + * ipv4 = numbers[-1] + */ + } + + /* "w3lib/_url.pyx":781 + * if numbers[-1] >= 256 ** (5 - len(numbers)): + * raise ValueError + * ipv4 = numbers[-1] # <<<<<<<<<<<<<< + * counter = 0 + * for n in numbers[:-1]: + */ + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_ipv4 = __pyx_t_8; + __pyx_t_8 = 0; + + /* "w3lib/_url.pyx":782 + * raise ValueError + * ipv4 = numbers[-1] + * counter = 0 # <<<<<<<<<<<<<< + * for n in numbers[:-1]: + * ipv4 += n * 256 ** (3 - counter) + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_counter = __pyx_int_0; + + /* "w3lib/_url.pyx":783 + * ipv4 = numbers[-1] + * counter = 0 + * for n in numbers[:-1]: # <<<<<<<<<<<<<< + * ipv4 += n * 256 ** (3 - counter) + * counter += 1 + */ + __pyx_t_8 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); + __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 783, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 783, __pyx_L1_error) + #else + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; + + /* "w3lib/_url.pyx":784 + * counter = 0 + * for n in numbers[:-1]: + * ipv4 += n * 256 ** (3 - counter) # <<<<<<<<<<<<<< + * counter += 1 + * return ipv4 + */ + __pyx_t_8 = __Pyx_PyInt_SubtractCObj(__pyx_int_3, __pyx_v_counter, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyNumber_Power(__pyx_int_256, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ipv4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_ipv4, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":785 + * for n in numbers[:-1]: + * ipv4 += n * 256 ** (3 - counter) + * counter += 1 # <<<<<<<<<<<<<< + * return ipv4 + * + */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_counter, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_counter, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":783 + * ipv4 = numbers[-1] + * counter = 0 + * for n in numbers[:-1]: # <<<<<<<<<<<<<< + * ipv4 += n * 256 ** (3 - counter) + * counter += 1 + */ + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":786 + * ipv4 += n * 256 ** (3 - counter) + * counter += 1 + * return ipv4 # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_ipv4))||((__pyx_v_ipv4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_ipv4))) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_ipv4); + __pyx_r = ((PyObject*)__pyx_v_ipv4); + goto __pyx_L0; + + /* "w3lib/_url.pyx":767 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and not parts[-1]: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("w3lib._url._domain_to_ascii", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("w3lib._url._parse_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_parts); + __Pyx_XDECREF(__pyx_v_numbers); + __Pyx_XDECREF(__pyx_v_part); __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_ipv4); + __Pyx_XDECREF(__pyx_v_counter); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":360 +/* "w3lib/_url.pyx":790 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser - * def _parse_host( # <<<<<<<<<<<<<< - * input: str, - * *, + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< + * result = _utr46._to_ascii( + * domain, */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_19_parse_host(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_23_domain_to_ascii(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_18_parse_host, "_parse_host(unicode input: str, *, is_special: bool = True) -> Union[str, int, List[int]]"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_19_parse_host = {"_parse_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_19_parse_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_18_parse_host}; -static PyObject *__pyx_pw_5w3lib_4_url_19_parse_host(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_23_domain_to_ascii = {"_domain_to_ascii", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_23_domain_to_ascii, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_23_domain_to_ascii(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_input = 0; - PyObject *__pyx_v_is_special = 0; + PyObject *__pyx_v_domain = 0; + PyObject *__pyx_v_be_strict = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -10117,7 +11987,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_parse_host (wrapper)", 0); + __Pyx_RefNannySetupContext("_domain_to_ascii (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -10127,16 +11997,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_is_special,0}; - - /* "w3lib/_url.pyx":363 - * input: str, - * *, - * is_special: bool = True, # <<<<<<<<<<<<<< - * ) -> Union[str, int, List[int]]: - * if input.startswith("["): - */ - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain,&__pyx_n_s_be_strict,0}; + values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -10148,34 +12010,34 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domain)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_host") < 0)) __PYX_ERR(0, 360, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_domain_to_ascii") < 0)) __PYX_ERR(0, 790, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_input = ((PyObject*)values[0]); - __pyx_v_is_special = values[1]; + __pyx_v_domain = ((PyObject*)values[0]); + __pyx_v_be_strict = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 360, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_domain_to_ascii", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 790, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10185,20 +12047,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._parse_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._domain_to_ascii", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 361, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_18_parse_host(__pyx_self, __pyx_v_input, __pyx_v_is_special); - - /* "w3lib/_url.pyx":360 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser - * def _parse_host( # <<<<<<<<<<<<<< - * input: str, - * *, - */ + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain), (&PyUnicode_Type), 0, "domain", 1))) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_22_domain_to_ascii(__pyx_self, __pyx_v_domain, __pyx_v_be_strict); /* function exit code */ goto __pyx_L0; @@ -10215,478 +12069,238 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_18_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_is_special) { - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_ascii_domain = NULL; - PyObject *__pyx_v_code_point = NULL; +static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, PyObject *__pyx_v_be_strict) { + PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - Py_ssize_t __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_UCS4 __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_host", 1); + __Pyx_RefNannySetupContext("_domain_to_ascii", 1); - /* "w3lib/_url.pyx":365 - * is_special: bool = True, - * ) -> Union[str, int, List[int]]: - * if input.startswith("["): # <<<<<<<<<<<<<< - * if not input.endswith("]"): - * raise ValueError + /* "w3lib/_url.pyx":791 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: + * result = _utr46._to_ascii( # <<<<<<<<<<<<<< + * domain, + * use_std3_ascii_rules=be_strict, */ - __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 365, __pyx_L1_error) - if (__pyx_t_1) { + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utr46); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_ascii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":366 - * ) -> Union[str, int, List[int]]: - * if input.startswith("["): - * if not input.endswith("]"): # <<<<<<<<<<<<<< - * raise ValueError - * return _parse_ipv6(input[1:-1]) + /* "w3lib/_url.pyx":792 + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: + * result = _utr46._to_ascii( + * domain, # <<<<<<<<<<<<<< + * use_std3_ascii_rules=be_strict, + * check_hyphens=False, */ - __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__9, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 366, __pyx_L1_error) - __pyx_t_2 = (!__pyx_t_1); - if (unlikely(__pyx_t_2)) { + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_domain); + __Pyx_GIVEREF(__pyx_v_domain); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domain)) __PYX_ERR(0, 791, __pyx_L1_error); - /* "w3lib/_url.pyx":367 - * if input.startswith("["): - * if not input.endswith("]"): - * raise ValueError # <<<<<<<<<<<<<< - * return _parse_ipv6(input[1:-1]) - * if not is_special: + /* "w3lib/_url.pyx":793 + * result = _utr46._to_ascii( + * domain, + * use_std3_ascii_rules=be_strict, # <<<<<<<<<<<<<< + * check_hyphens=False, + * check_bidi=True, */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_v_be_strict) < 0) __PYX_ERR(0, 793, __pyx_L1_error) - /* "w3lib/_url.pyx":366 - * ) -> Union[str, int, List[int]]: - * if input.startswith("["): - * if not input.endswith("]"): # <<<<<<<<<<<<<< - * raise ValueError - * return _parse_ipv6(input[1:-1]) + /* "w3lib/_url.pyx":794 + * domain, + * use_std3_ascii_rules=be_strict, + * check_hyphens=False, # <<<<<<<<<<<<<< + * check_bidi=True, + * check_joiners=True, */ - } + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, Py_False) < 0) __PYX_ERR(0, 793, __pyx_L1_error) - /* "w3lib/_url.pyx":368 - * if not input.endswith("]"): - * raise ValueError - * return _parse_ipv6(input[1:-1]) # <<<<<<<<<<<<<< - * if not is_special: - * return _parse_opaque_host(input) + /* "w3lib/_url.pyx":795 + * use_std3_ascii_rules=be_strict, + * check_hyphens=False, + * check_bidi=True, # <<<<<<<<<<<<<< + * check_joiners=True, + * transitional_processing=False, */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, Py_True) < 0) __PYX_ERR(0, 793, __pyx_L1_error) - /* "w3lib/_url.pyx":365 - * is_special: bool = True, - * ) -> Union[str, int, List[int]]: - * if input.startswith("["): # <<<<<<<<<<<<<< - * if not input.endswith("]"): - * raise ValueError + /* "w3lib/_url.pyx":796 + * check_hyphens=False, + * check_bidi=True, + * check_joiners=True, # <<<<<<<<<<<<<< + * transitional_processing=False, + * verify_dns_length=be_strict, */ - } + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, Py_True) < 0) __PYX_ERR(0, 793, __pyx_L1_error) - /* "w3lib/_url.pyx":369 - * raise ValueError - * return _parse_ipv6(input[1:-1]) - * if not is_special: # <<<<<<<<<<<<<< - * return _parse_opaque_host(input) - * domain = unquote(input) + /* "w3lib/_url.pyx":797 + * check_bidi=True, + * check_joiners=True, + * transitional_processing=False, # <<<<<<<<<<<<<< + * verify_dns_length=be_strict, + * ) */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_is_special); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 369, __pyx_L1_error) - __pyx_t_1 = (!__pyx_t_2); - if (__pyx_t_1) { + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, Py_False) < 0) __PYX_ERR(0, 793, __pyx_L1_error) - /* "w3lib/_url.pyx":370 - * return _parse_ipv6(input[1:-1]) - * if not is_special: - * return _parse_opaque_host(input) # <<<<<<<<<<<<<< - * domain = unquote(input) - * ascii_domain = _domain_to_ascii(domain) + /* "w3lib/_url.pyx":798 + * check_joiners=True, + * transitional_processing=False, + * verify_dns_length=be_strict, # <<<<<<<<<<<<<< + * ) + * if not result: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_opaque_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_v_be_strict) < 0) __PYX_ERR(0, 793, __pyx_L1_error) + + /* "w3lib/_url.pyx":791 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: + * result = _utr46._to_ascii( # <<<<<<<<<<<<<< + * domain, + * use_std3_ascii_rules=be_strict, + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":800 + * verify_dns_length=be_strict, + * ) + * if not result: # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name {domain!r} is an empty string after conversion to " + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 800, __pyx_L1_error) + __pyx_t_6 = (!__pyx_t_5); + if (unlikely(__pyx_t_6)) { + + /* "w3lib/_url.pyx":802 + * if not result: + * raise ValueError( + * f"Domain name {domain!r} is an empty string after conversion to " # <<<<<<<<<<<<<< + * f"ASCII, which makes for an invalid domain name." + * ) + */ + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_r = __pyx_t_3; + __pyx_t_8 = 127; + __Pyx_INCREF(__pyx_kp_u_Domain_name); + __pyx_t_7 += 12; + __Pyx_GIVEREF(__pyx_kp_u_Domain_name); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Domain_name); + __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8; + __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L0; + __Pyx_INCREF(__pyx_kp_u_is_an_empty_string_after_conver); + __pyx_t_7 += 86; + __Pyx_GIVEREF(__pyx_kp_u_is_an_empty_string_after_conver); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_is_an_empty_string_after_conver); + __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":369 - * raise ValueError - * return _parse_ipv6(input[1:-1]) - * if not is_special: # <<<<<<<<<<<<<< - * return _parse_opaque_host(input) - * domain = unquote(input) + /* "w3lib/_url.pyx":801 + * ) + * if not result: + * raise ValueError( # <<<<<<<<<<<<<< + * f"Domain name {domain!r} is an empty string after conversion to " + * f"ASCII, which makes for an invalid domain name." */ - } + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 801, __pyx_L1_error) - /* "w3lib/_url.pyx":371 - * if not is_special: - * return _parse_opaque_host(input) - * domain = unquote(input) # <<<<<<<<<<<<<< - * ascii_domain = _domain_to_ascii(domain) - * for code_point in ascii_domain: - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unquote); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_v_domain = __pyx_t_3; - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":372 - * return _parse_opaque_host(input) - * domain = unquote(input) - * ascii_domain = _domain_to_ascii(domain) # <<<<<<<<<<<<<< - * for code_point in ascii_domain: - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_domain_to_ascii); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_domain}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_v_ascii_domain = __pyx_t_3; - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":373 - * domain = unquote(input) - * ascii_domain = _domain_to_ascii(domain) - * for code_point in ascii_domain: # <<<<<<<<<<<<<< - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: - * raise ValueError - */ - if (likely(PyList_CheckExact(__pyx_v_ascii_domain)) || PyTuple_CheckExact(__pyx_v_ascii_domain)) { - __pyx_t_3 = __pyx_v_ascii_domain; __Pyx_INCREF(__pyx_t_3); - __pyx_t_8 = 0; - __pyx_t_9 = NULL; - } else { - __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ascii_domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 373, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 373, __pyx_L1_error) - #endif - if (__pyx_t_8 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 373, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 373, __pyx_L1_error) - #endif - if (__pyx_t_8 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 373, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_9(__pyx_t_3); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 373, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":374 - * ascii_domain = _domain_to_ascii(domain) - * for code_point in ascii_domain: - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< - * raise ValueError - * if _ends_in_number(ascii_domain): - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 374, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(__pyx_t_1)) { - - /* "w3lib/_url.pyx":375 - * for code_point in ascii_domain: - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: - * raise ValueError # <<<<<<<<<<<<<< - * if _ends_in_number(ascii_domain): - * return _parse_ipv4(ascii_domain) - */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 375, __pyx_L1_error) - - /* "w3lib/_url.pyx":374 - * ascii_domain = _domain_to_ascii(domain) - * for code_point in ascii_domain: - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< - * raise ValueError - * if _ends_in_number(ascii_domain): - */ - } - - /* "w3lib/_url.pyx":373 - * domain = unquote(input) - * ascii_domain = _domain_to_ascii(domain) - * for code_point in ascii_domain: # <<<<<<<<<<<<<< - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: - * raise ValueError - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":376 - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: - * raise ValueError - * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< - * return _parse_ipv4(ascii_domain) - * return ascii_domain - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ends_in_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":377 - * raise ValueError - * if _ends_in_number(ascii_domain): - * return _parse_ipv4(ascii_domain) # <<<<<<<<<<<<<< - * return ascii_domain - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "w3lib/_url.pyx":376 - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: - * raise ValueError - * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< - * return _parse_ipv4(ascii_domain) - * return ascii_domain + /* "w3lib/_url.pyx":800 + * verify_dns_length=be_strict, + * ) + * if not result: # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name {domain!r} is an empty string after conversion to " */ } - /* "w3lib/_url.pyx":378 - * if _ends_in_number(ascii_domain): - * return _parse_ipv4(ascii_domain) - * return ascii_domain # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":805 + * f"ASCII, which makes for an invalid domain name." + * ) + * return result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_ascii_domain); - __pyx_r = __pyx_v_ascii_domain; + if (!(likely(PyUnicode_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_result))) __PYX_ERR(0, 805, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_result); + __pyx_r = ((PyObject*)__pyx_v_result); goto __pyx_L0; - /* "w3lib/_url.pyx":360 + /* "w3lib/_url.pyx":790 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser - * def _parse_host( # <<<<<<<<<<<<<< - * input: str, - * *, + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< + * result = _utr46._to_ascii( + * domain, */ /* function exit code */ __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("w3lib._url._parse_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._domain_to_ascii", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_ascii_domain); - __Pyx_XDECREF(__pyx_v_code_point); + __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":382 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter - * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< - * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" +/* "w3lib/_url.pyx":809 * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser + * def _parse_host( # <<<<<<<<<<<<<< + * input: str, + * *, */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_21_is_windows_drive_letter(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_25_parse_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_20_is_windows_drive_letter, "_is_windows_drive_letter(unicode input: str) -> bool"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_21_is_windows_drive_letter = {"_is_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_21_is_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_20_is_windows_drive_letter}; -static PyObject *__pyx_pw_5w3lib_4_url_21_is_windows_drive_letter(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_25_parse_host = {"_parse_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_25_parse_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_25_parse_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10694,17 +12308,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_is_special = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_is_windows_drive_letter (wrapper)", 0); + __Pyx_RefNannySetupContext("_parse_host (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -10714,7 +12329,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_is_special,0}; + + /* "w3lib/_url.pyx":812 + * input: str, + * *, + * is_special: bool = True, # <<<<<<<<<<<<<< + * ) -> Union[str, int, List[int]]: + * if input.startswith("["): + */ + values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -10730,12 +12354,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L3_error) + } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_windows_drive_letter") < 0)) __PYX_ERR(0, 382, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_host") < 0)) __PYX_ERR(0, 809, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -10743,10 +12373,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_is_special = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 382, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 809, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10756,12 +12387,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._is_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._parse_host", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 382, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_20_is_windows_drive_letter(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 810, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_24_parse_host(__pyx_self, __pyx_v_input, __pyx_v_is_special); + + /* "w3lib/_url.pyx":809 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser + * def _parse_host( # <<<<<<<<<<<<<< + * input: str, + * *, + */ /* function exit code */ goto __pyx_L0; @@ -10778,385 +12417,477 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_20_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_is_special) { + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_ascii_domain = NULL; + PyObject *__pyx_v_code_point = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - Py_UCS4 __pyx_t_5; + PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_is_windows_drive_letter", 1); + __Pyx_RefNannySetupContext("_parse_host", 1); - /* "w3lib/_url.pyx":383 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter - * def _is_windows_drive_letter(input: str) -> bool: - * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" # <<<<<<<<<<<<<< - * - * + /* "w3lib/_url.pyx":814 + * is_special: bool = True, + * ) -> Union[str, int, List[int]]: + * if input.startswith("["): # <<<<<<<<<<<<<< + * if not input.endswith("]"): + * raise ValueError */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 383, __pyx_L1_error) - __pyx_t_3 = (__pyx_t_2 == 2); - if (__pyx_t_3) { - } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 383, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_3) { - } else { - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __pyx_t_6; - __pyx_t_6 = 0; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 383, __pyx_L1_error) - switch (__pyx_t_5) { - case 58: - case 0x7C: - __pyx_t_3 = 1; - break; - default: - __pyx_t_3 = 0; - break; - } - __pyx_t_7 = __pyx_t_3; - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __pyx_t_6; - __pyx_t_6 = 0; - __pyx_L3_bool_binop_done:; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 814, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":382 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter - * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< - * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" - * + /* "w3lib/_url.pyx":815 + * ) -> Union[str, int, List[int]]: + * if input.startswith("["): + * if not input.endswith("]"): # <<<<<<<<<<<<<< + * raise ValueError + * return _parse_ipv6(input[1:-1]) */ + __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__9, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 815, __pyx_L1_error) + __pyx_t_2 = (!__pyx_t_1); + if (unlikely(__pyx_t_2)) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("w3lib._url._is_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "w3lib/_url.pyx":816 + * if input.startswith("["): + * if not input.endswith("]"): + * raise ValueError # <<<<<<<<<<<<<< + * return _parse_ipv6(input[1:-1]) + * if not is_special: + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 816, __pyx_L1_error) -/* "w3lib/_url.pyx":387 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter - * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< - * input_length = len(input) - * return ( + /* "w3lib/_url.pyx":815 + * ) -> Union[str, int, List[int]]: + * if input.startswith("["): + * if not input.endswith("]"): # <<<<<<<<<<<<<< + * raise ValueError + * return _parse_ipv6(input[1:-1]) */ + } -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_23_starts_with_windows_drive_letter(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_22_starts_with_windows_drive_letter, "_starts_with_windows_drive_letter(unicode input: str) -> bool"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_23_starts_with_windows_drive_letter = {"_starts_with_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_23_starts_with_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_22_starts_with_windows_drive_letter}; -static PyObject *__pyx_pw_5w3lib_4_url_23_starts_with_windows_drive_letter(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_input = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_starts_with_windows_drive_letter (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_starts_with_windows_drive_letter") < 0)) __PYX_ERR(0, 387, __pyx_L3_error) + /* "w3lib/_url.pyx":817 + * if not input.endswith("]"): + * raise ValueError + * return _parse_ipv6(input[1:-1]) # <<<<<<<<<<<<<< + * if not is_special: + * return _parse_opaque_host(input) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_input = ((PyObject*)values[0]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_starts_with_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 387, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - } - __Pyx_AddTraceback("w3lib._url._starts_with_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 387, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(__pyx_self, __pyx_v_input); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + /* "w3lib/_url.pyx":814 + * is_special: bool = True, + * ) -> Union[str, int, List[int]]: + * if input.startswith("["): # <<<<<<<<<<<<<< + * if not input.endswith("]"): + * raise ValueError + */ } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_pf_5w3lib_4_url_22_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { - Py_ssize_t __pyx_v_input_length; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - Py_UCS4 __pyx_t_9; - int __pyx_t_10; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_starts_with_windows_drive_letter", 1); - - /* "w3lib/_url.pyx":388 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter - * def _starts_with_windows_drive_letter(input: str) -> bool: - * input_length = len(input) # <<<<<<<<<<<<<< - * return ( - * input_length >= 2 + /* "w3lib/_url.pyx":818 + * raise ValueError + * return _parse_ipv6(input[1:-1]) + * if not is_special: # <<<<<<<<<<<<<< + * return _parse_opaque_host(input) + * domain = unquote(input) */ - __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 388, __pyx_L1_error) - __pyx_v_input_length = __pyx_t_1; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_is_special); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_1 = (!__pyx_t_2); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":389 - * def _starts_with_windows_drive_letter(input: str) -> bool: - * input_length = len(input) - * return ( # <<<<<<<<<<<<<< - * input_length >= 2 - * and _is_windows_drive_letter(input[:2]) + /* "w3lib/_url.pyx":819 + * return _parse_ipv6(input[1:-1]) + * if not is_special: + * return _parse_opaque_host(input) # <<<<<<<<<<<<<< + * domain = unquote(input) + * ascii_domain = _domain_to_ascii(domain) */ - __Pyx_XDECREF(__pyx_r); + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_opaque_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "w3lib/_url.pyx":390 - * input_length = len(input) - * return ( - * input_length >= 2 # <<<<<<<<<<<<<< - * and _is_windows_drive_letter(input[:2]) - * and (input_length == 2 or input[2] in "/\\?#") + /* "w3lib/_url.pyx":818 + * raise ValueError + * return _parse_ipv6(input[1:-1]) + * if not is_special: # <<<<<<<<<<<<<< + * return _parse_opaque_host(input) + * domain = unquote(input) */ - __pyx_t_3 = (__pyx_v_input_length >= 2); - if (__pyx_t_3) { - } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 390, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L3_bool_binop_done; } - /* "w3lib/_url.pyx":391 - * return ( - * input_length >= 2 - * and _is_windows_drive_letter(input[:2]) # <<<<<<<<<<<<<< - * and (input_length == 2 or input[2] in "/\\?#") - * ) + /* "w3lib/_url.pyx":820 + * if not is_special: + * return _parse_opaque_host(input) + * domain = unquote(input) # <<<<<<<<<<<<<< + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unquote); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 820, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_8 = 1; + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 391, __pyx_L1_error) - if (__pyx_t_3) { - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __Pyx_INCREF(__pyx_t_4); - __pyx_t_2 = __pyx_t_4; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 820, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L3_bool_binop_done; } + __pyx_v_domain = __pyx_t_3; + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":392 - * input_length >= 2 - * and _is_windows_drive_letter(input[:2]) - * and (input_length == 2 or input[2] in "/\\?#") # <<<<<<<<<<<<<< - * ) - * + /* "w3lib/_url.pyx":821 + * return _parse_opaque_host(input) + * domain = unquote(input) + * ascii_domain = _domain_to_ascii(domain) # <<<<<<<<<<<<<< + * for code_point in ascii_domain: + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: */ - __pyx_t_3 = (__pyx_v_input_length == 2); - if (!__pyx_t_3) { - } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L3_bool_binop_done; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_domain_to_ascii); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } } - __pyx_t_9 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == (Py_UCS4)-1)) __PYX_ERR(0, 392, __pyx_L1_error) - switch (__pyx_t_9) { - case 35: - case 47: - case 63: - case 92: - __pyx_t_3 = 1; - break; - default: - __pyx_t_3 = 0; - break; + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_domain}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_10 = __pyx_t_3; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_t_4; - __pyx_t_4 = 0; - __pyx_L3_bool_binop_done:; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __pyx_v_ascii_domain = __pyx_t_3; + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":387 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter - * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< - * input_length = len(input) - * return ( + /* "w3lib/_url.pyx":822 + * domain = unquote(input) + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: # <<<<<<<<<<<<<< + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError */ + if (likely(PyList_CheckExact(__pyx_v_ascii_domain)) || PyTuple_CheckExact(__pyx_v_ascii_domain)) { + __pyx_t_3 = __pyx_v_ascii_domain; __Pyx_INCREF(__pyx_t_3); + __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ascii_domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 822, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 822, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 822, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 822, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_9(__pyx_t_3); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 822, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_4); + __pyx_t_4 = 0; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("w3lib._url._starts_with_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "w3lib/_url.pyx":397 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment - * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< - * return input in ( - * "..", + /* "w3lib/_url.pyx":823 + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< + * raise ValueError + * if _ends_in_number(ascii_domain): */ - + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 823, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__pyx_t_1)) { + + /* "w3lib/_url.pyx":824 + * for code_point in ascii_domain: + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError # <<<<<<<<<<<<<< + * if _ends_in_number(ascii_domain): + * return _parse_ipv4(ascii_domain) + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 824, __pyx_L1_error) + + /* "w3lib/_url.pyx":823 + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< + * raise ValueError + * if _ends_in_number(ascii_domain): + */ + } + + /* "w3lib/_url.pyx":822 + * domain = unquote(input) + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: # <<<<<<<<<<<<<< + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":825 + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError + * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< + * return _parse_ipv4(ascii_domain) + * return ascii_domain + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ends_in_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 825, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 825, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":826 + * raise ValueError + * if _ends_in_number(ascii_domain): + * return _parse_ipv4(ascii_domain) # <<<<<<<<<<<<<< + * return ascii_domain + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":825 + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError + * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< + * return _parse_ipv4(ascii_domain) + * return ascii_domain + */ + } + + /* "w3lib/_url.pyx":827 + * if _ends_in_number(ascii_domain): + * return _parse_ipv4(ascii_domain) + * return ascii_domain # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ascii_domain); + __pyx_r = __pyx_v_ascii_domain; + goto __pyx_L0; + + /* "w3lib/_url.pyx":809 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser + * def _parse_host( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("w3lib._url._parse_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_ascii_domain); + __Pyx_XDECREF(__pyx_v_code_point); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":831 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter + * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" + * + */ + /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_25_is_double_dot_path_segment(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_24_is_double_dot_path_segment, "_is_double_dot_path_segment(unicode input: str) -> bool"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_25_is_double_dot_path_segment = {"_is_double_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_25_is_double_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_24_is_double_dot_path_segment}; -static PyObject *__pyx_pw_5w3lib_4_url_25_is_double_dot_path_segment(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_27_is_windows_drive_letter = {"_is_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11174,7 +12905,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_is_double_dot_path_segment (wrapper)", 0); + __Pyx_RefNannySetupContext("_is_windows_drive_letter (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -11200,12 +12931,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 397, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 831, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_double_dot_path_segment") < 0)) __PYX_ERR(0, 397, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_windows_drive_letter") < 0)) __PYX_ERR(0, 831, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -11216,7 +12947,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_double_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 397, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_is_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 831, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11226,12 +12957,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._is_double_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._is_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 397, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_24_is_double_dot_path_segment(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -11248,99 +12979,89 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_24_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; + Py_UCS4 __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_is_double_dot_path_segment", 1); + __Pyx_RefNannySetupContext("_is_windows_drive_letter", 1); - /* "w3lib/_url.pyx":398 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment - * def _is_double_dot_path_segment(input: str) -> bool: - * return input in ( # <<<<<<<<<<<<<< - * "..", - * ".%2e", + /* "w3lib/_url.pyx":832 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter + * def _is_windows_drive_letter(input: str) -> bool: + * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" # <<<<<<<<<<<<<< + * + * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_input); - __pyx_t_1 = __pyx_v_input; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) - if (!__pyx_t_3) { + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 == 2); + if (__pyx_t_3) { } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) - if (!__pyx_t_3) { + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_3) { } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __pyx_t_6; + __pyx_t_6 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 832, __pyx_L1_error) + switch (__pyx_t_5) { + case 58: + case 0x7C: + __pyx_t_3 = 1; + break; + default: + __pyx_t_3 = 0; + break; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) - __pyx_t_2 = __pyx_t_3; + __pyx_t_7 = __pyx_t_3; + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __pyx_t_6; + __pyx_t_6 = 0; __pyx_L3_bool_binop_done:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":397 + /* "w3lib/_url.pyx":831 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter + * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment - * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< - * return input in ( - * "..", */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("w3lib._url._is_double_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("w3lib._url._is_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -11348,25 +13069,24 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_is_double_dot_path_segment(CYTHON_UNUS return __pyx_r; } -/* "w3lib/_url.pyx":412 +/* "w3lib/_url.pyx":836 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment - * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< - * return input in ( - * ".", + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter + * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * input_length = len(input) + * return ( */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_27_is_single_dot_path_segment(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_26_is_single_dot_path_segment, "_is_single_dot_path_segment(unicode input: str) -> bool"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_27_is_single_dot_path_segment = {"_is_single_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_27_is_single_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_26_is_single_dot_path_segment}; -static PyObject *__pyx_pw_5w3lib_4_url_27_is_single_dot_path_segment(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_29_starts_with_windows_drive_letter = {"_starts_with_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11384,7 +13104,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_is_single_dot_path_segment (wrapper)", 0); + __Pyx_RefNannySetupContext("_starts_with_windows_drive_letter (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -11410,12 +13130,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 836, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_single_dot_path_segment") < 0)) __PYX_ERR(0, 412, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_starts_with_windows_drive_letter") < 0)) __PYX_ERR(0, 836, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -11426,7 +13146,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_single_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 412, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_starts_with_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 836, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11436,12 +13156,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._is_single_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._starts_with_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 412, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_26_is_single_dot_path_segment(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -11458,63 +13178,159 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_26_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + Py_ssize_t __pyx_v_input_length; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + Py_UCS4 __pyx_t_9; + int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_is_single_dot_path_segment", 1); + __Pyx_RefNannySetupContext("_starts_with_windows_drive_letter", 1); - /* "w3lib/_url.pyx":413 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment - * def _is_single_dot_path_segment(input: str) -> bool: - * return input in ( # <<<<<<<<<<<<<< - * ".", - * "%2e", + /* "w3lib/_url.pyx":837 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter + * def _starts_with_windows_drive_letter(input: str) -> bool: + * input_length = len(input) # <<<<<<<<<<<<<< + * return ( + * input_length >= 2 + */ + __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_v_input_length = __pyx_t_1; + + /* "w3lib/_url.pyx":838 + * def _starts_with_windows_drive_letter(input: str) -> bool: + * input_length = len(input) + * return ( # <<<<<<<<<<<<<< + * input_length >= 2 + * and _is_windows_drive_letter(input[:2]) */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_input); - __pyx_t_1 = __pyx_v_input; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) - if (!__pyx_t_3) { + + /* "w3lib/_url.pyx":839 + * input_length = len(input) + * return ( + * input_length >= 2 # <<<<<<<<<<<<<< + * and _is_windows_drive_letter(input[:2]) + * and (input_length == 2 or input[2] in "/\\?#") + */ + __pyx_t_3 = (__pyx_v_input_length >= 2); + if (__pyx_t_3) { } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3_bool_binop_done; + } + + /* "w3lib/_url.pyx":840 + * return ( + * input_length >= 2 + * and _is_windows_drive_letter(input[:2]) # <<<<<<<<<<<<<< + * and (input_length == 2 or input[2] in "/\\?#") + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 840, __pyx_L1_error) + if (__pyx_t_3) { + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) + + /* "w3lib/_url.pyx":841 + * input_length >= 2 + * and _is_windows_drive_letter(input[:2]) + * and (input_length == 2 or input[2] in "/\\?#") # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_3 = (__pyx_v_input_length == 2); if (!__pyx_t_3) { } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) - __pyx_t_2 = __pyx_t_3; - __pyx_L3_bool_binop_done:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == (Py_UCS4)-1)) __PYX_ERR(0, 841, __pyx_L1_error) + switch (__pyx_t_9) { + case 35: + case 47: + case 63: + case 92: + __pyx_t_3 = 1; + break; + default: + __pyx_t_3 = 0; + break; + } + __pyx_t_10 = __pyx_t_3; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; + __pyx_t_2 = __pyx_t_4; __pyx_t_4 = 0; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":412 + /* "w3lib/_url.pyx":836 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment - * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< - * return input in ( - * ".", + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter + * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * input_length = len(input) + * return ( */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("w3lib._url._is_single_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._starts_with_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -11522,25 +13338,24 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_is_single_dot_path_segment(CYTHON_UNUS return __pyx_r; } -/* "w3lib/_url.pyx":423 - * # to be escaped, they are escaped in an idempotent way (i.e. if they are - * # already part of an escape sequence, they are not re-encoded). - * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< - * *, input: str, pointer: int, encode_set: _PercentEncodeSet - * ) -> str: +/* "w3lib/_url.pyx":846 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment + * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * "..", */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_29_idempotent_utf_8_percent_encode(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_28_idempotent_utf_8_percent_encode, "_idempotent_utf_8_percent_encode(*, unicode input: str, int pointer: int, encode_set: _PercentEncodeSet) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_29_idempotent_utf_8_percent_encode = {"_idempotent_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_29_idempotent_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_28_idempotent_utf_8_percent_encode}; -static PyObject *__pyx_pw_5w3lib_4_url_29_idempotent_utf_8_percent_encode(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_31_is_double_dot_path_segment = {"_is_double_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11548,19 +13363,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_input = 0; - PyObject *__pyx_v_pointer = 0; - PyObject *__pyx_v_encode_set = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_idempotent_utf_8_percent_encode (wrapper)", 0); + __Pyx_RefNannySetupContext("_is_double_dot_path_segment (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -11570,53 +13383,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_pointer,&__pyx_n_s_encode_set,0}; - if (likely(__pyx_kwds)) { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L3_error) - else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 423, __pyx_L3_error) - } - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pointer)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L3_error) - else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_pointer); __PYX_ERR(0, 423, __pyx_L3_error) - } - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encode_set)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L3_error) - else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_encode_set); __PYX_ERR(0, 423, __pyx_L3_error) + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 846, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "_idempotent_utf_8_percent_encode") < 0)) __PYX_ERR(0, 423, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_double_dot_path_segment") < 0)) __PYX_ERR(0, 846, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 0)) { + } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 423, __pyx_L3_error) + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_input = ((PyObject*)values[0]); - __pyx_v_pointer = ((PyObject*)values[1]); - __pyx_v_encode_set = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_idempotent_utf_8_percent_encode", 1, 0, 0, __pyx_nargs); __PYX_ERR(0, 423, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_is_double_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 846, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11626,13 +13425,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._idempotent_utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._is_double_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 424, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pointer), (&PyInt_Type), 0, "pointer", 1))) __PYX_ERR(0, 424, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_pointer, __pyx_v_encode_set); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -11649,307 +13447,124 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_28_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set) { - PyObject *__pyx_v_code_point = NULL; +static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; + PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_idempotent_utf_8_percent_encode", 1); - - /* "w3lib/_url.pyx":426 - * *, input: str, pointer: int, encode_set: _PercentEncodeSet - * ) -> str: - * code_point = input[pointer] # <<<<<<<<<<<<<< - * if code_point == "%" and "%" in encode_set: - * if ( - */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 426, __pyx_L1_error) - __pyx_v_code_point = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_RefNannySetupContext("_is_double_dot_path_segment", 1); - /* "w3lib/_url.pyx":427 - * ) -> str: - * code_point = input[pointer] - * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< - * if ( - * pointer + 2 >= len(input) + /* "w3lib/_url.pyx":847 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment + * def _is_double_dot_path_segment(input: str) -> bool: + * return input in ( # <<<<<<<<<<<<<< + * "..", + * ".%2e", */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 427, __pyx_L1_error) - if (__pyx_t_3) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_input); + __pyx_t_1 = __pyx_v_input; + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; - goto __pyx_L4_bool_binop_done; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__4, __pyx_v_encode_set, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "w3lib/_url.pyx":429 - * if code_point == "%" and "%" in encode_set: - * if ( - * pointer + 2 >= len(input) # <<<<<<<<<<<<<< - * or input[pointer + 1] not in _ASCII_HEX_DIGIT - * or input[pointer + 2] not in _ASCII_HEX_DIGIT - */ - __pyx_t_1 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 429, __pyx_L1_error) - __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L7_bool_binop_done; - } - - /* "w3lib/_url.pyx":430 - * if ( - * pointer + 2 >= len(input) - * or input[pointer + 1] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< - * or input[pointer + 2] not in _ASCII_HEX_DIGIT - * ): - */ - __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 430, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L7_bool_binop_done; - } - - /* "w3lib/_url.pyx":431 - * pointer + 2 >= len(input) - * or input[pointer + 1] not in _ASCII_HEX_DIGIT - * or input[pointer + 2] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< - * ): - * return "%25" - */ - __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 431, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_2 = __pyx_t_3; - __pyx_L7_bool_binop_done:; - - /* "w3lib/_url.pyx":428 - * code_point = input[pointer] - * if code_point == "%" and "%" in encode_set: - * if ( # <<<<<<<<<<<<<< - * pointer + 2 >= len(input) - * or input[pointer + 1] not in _ASCII_HEX_DIGIT - */ - if (__pyx_t_2) { - - /* "w3lib/_url.pyx":433 - * or input[pointer + 2] not in _ASCII_HEX_DIGIT - * ): - * return "%25" # <<<<<<<<<<<<<< - * return "%" - * return _utf_8_percent_encode(code_point, encode_set) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_kp_u_25); - __pyx_r = __pyx_kp_u_25; - goto __pyx_L0; - - /* "w3lib/_url.pyx":428 - * code_point = input[pointer] - * if code_point == "%" and "%" in encode_set: - * if ( # <<<<<<<<<<<<<< - * pointer + 2 >= len(input) - * or input[pointer + 1] not in _ASCII_HEX_DIGIT - */ - } - - /* "w3lib/_url.pyx":434 - * ): - * return "%25" - * return "%" # <<<<<<<<<<<<<< - * return _utf_8_percent_encode(code_point, encode_set) - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_kp_u__4); - __pyx_r = __pyx_kp_u__4; - goto __pyx_L0; - - /* "w3lib/_url.pyx":427 - * ) -> str: - * code_point = input[pointer] - * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< - * if ( - * pointer + 2 >= len(input) - */ - } - - /* "w3lib/_url.pyx":435 - * return "%25" - * return "%" - * return _utf_8_percent_encode(code_point, encode_set) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_code_point, __pyx_v_encode_set}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_6))) __PYX_ERR(0, 435, __pyx_L1_error) - __pyx_r = ((PyObject*)__pyx_t_6); - __pyx_t_6 = 0; + __pyx_L3_bool_binop_done:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":423 - * # to be escaped, they are escaped in an idempotent way (i.e. if they are - * # already part of an escape sequence, they are not re-encoded). - * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< - * *, input: str, pointer: int, encode_set: _PercentEncodeSet - * ) -> str: + /* "w3lib/_url.pyx":846 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment + * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * "..", */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("w3lib._url._idempotent_utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._url._is_double_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_code_point); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":438 - * - * - * def _parse_url( # <<<<<<<<<<<<<< - * input: str, - * *, - */ - -static PyObject *__pyx_pf_5w3lib_4_url_44__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - - /* "w3lib/_url.pyx":441 - * input: str, - * *, - * base_url: str = None, # <<<<<<<<<<<<<< - * encoding: str = "utf-8", - * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, - */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, Py_None) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, ((PyObject*)__pyx_kp_u_utf_8)) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - - /* "w3lib/_url.pyx":438 - * +/* "w3lib/_url.pyx":861 * - * def _parse_url( # <<<<<<<<<<<<<< - * input: str, - * *, + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment + * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * ".", */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_userinfo_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_path_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_path_percent_encode_set) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_query_percent_encode_set) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_special_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_special_query_percent_encode_set) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fragment_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_fragment_percent_encode_set) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 438, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("w3lib._url.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_31_parse_url(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_30_parse_url, "_parse_url(unicode input: str, *, unicode base_url: str = None, unicode encoding: str = u'utf-8', userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET) -> _URL\nReturn a :class:`_URL` object built from *url*, *base_url* and\n *encoding*, following the URL parsing algorithm defined in the `URL living\n standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *userinfo_percent_encode_set* allows customizing which characters found\n in the user authroization part of the input URL need to be\n percent-encoded.\n "); -static PyMethodDef __pyx_mdef_5w3lib_4_url_31_parse_url = {"_parse_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_31_parse_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_30_parse_url}; -static PyObject *__pyx_pw_5w3lib_4_url_31_parse_url(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_33_is_single_dot_path_segment = {"_is_single_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11957,24 +13572,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_input = 0; - PyObject *__pyx_v_base_url = 0; - PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_v_userinfo_percent_encode_set = 0; - PyObject *__pyx_v_path_percent_encode_set = 0; - PyObject *__pyx_v_query_percent_encode_set = 0; - PyObject *__pyx_v_special_query_percent_encode_set = 0; - PyObject *__pyx_v_fragment_percent_encode_set = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_parse_url (wrapper)", 0); + __Pyx_RefNannySetupContext("_is_single_dot_path_segment (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -11984,23 +13592,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_base_url,&__pyx_n_s_encoding,&__pyx_n_s_userinfo_percent_encode_set,&__pyx_n_s_path_percent_encode_set,&__pyx_n_s_query_percent_encode_set,&__pyx_n_s_special_query_percent_encode_set,&__pyx_n_s_fragment_percent_encode_set,0}; - __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); - - /* "w3lib/_url.pyx":441 - * input: str, - * *, - * base_url: str = None, # <<<<<<<<<<<<<< - * encoding: str = "utf-8", - * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, - */ - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None)); - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)((PyObject*)__pyx_kp_u_utf_8))); - values[3] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_userinfo_percent_encode_set); - values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_path_percent_encode_set); - values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_query_percent_encode_set); - values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_special_query_percent_encode_set); - values[7] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_fragment_percent_encode_set); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -12016,20 +13608,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } - if (kw_args > 0 && likely(kw_args <= 7)) { - Py_ssize_t index; - for (index = 1; index < 8 && kw_args > 0; index++) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); - if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L3_error) - } - } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_url") < 0)) __PYX_ERR(0, 438, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_single_dot_path_segment") < 0)) __PYX_ERR(0, 861, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -12037,17 +13621,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_input = ((PyObject*)values[0]); - __pyx_v_base_url = ((PyObject*)values[1]); - __pyx_v_encoding = ((PyObject*)values[2]); - __pyx_v_userinfo_percent_encode_set = values[3]; - __pyx_v_path_percent_encode_set = values[4]; - __pyx_v_query_percent_encode_set = values[5]; - __pyx_v_special_query_percent_encode_set = values[6]; - __pyx_v_fragment_percent_encode_set = values[7]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 438, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_is_single_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 861, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12057,22 +13634,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._is_single_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 439, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_base_url), (&PyUnicode_Type), 1, "base_url", 1))) __PYX_ERR(0, 441, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 442, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_30_parse_url(__pyx_self, __pyx_v_input, __pyx_v_base_url, __pyx_v_encoding, __pyx_v_userinfo_percent_encode_set, __pyx_v_path_percent_encode_set, __pyx_v_query_percent_encode_set, __pyx_v_special_query_percent_encode_set, __pyx_v_fragment_percent_encode_set); - - /* "w3lib/_url.pyx":438 - * - * - * def _parse_url( # <<<<<<<<<<<<<< - * input: str, - * *, - */ + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -12089,4043 +13656,3693 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_base_url, PyObject *__pyx_v_encoding, PyObject *__pyx_v_userinfo_percent_encode_set, PyObject *__pyx_v_path_percent_encode_set, PyObject *__pyx_v_query_percent_encode_set, PyObject *__pyx_v_special_query_percent_encode_set, PyObject *__pyx_v_fragment_percent_encode_set) { - PyObject *__pyx_v_base = NULL; - PyObject *__pyx_v_url = NULL; - PyObject *__pyx_v_state = NULL; - PyObject *__pyx_v_buffer = NULL; - int __pyx_v_at_sign_seen; - int __pyx_v_inside_brackets; - int __pyx_v_skip_authority_shortcut; - PyObject *__pyx_v_pointer = NULL; - Py_ssize_t __pyx_v_input_length; - PyObject *__pyx_v_c = 0; - PyObject *__pyx_v_at_sign_index = NULL; - PyObject *__pyx_v_i = NULL; - PyObject *__pyx_v_code_point = NULL; - PyObject *__pyx_v_encoded_code_points = NULL; - PyObject *__pyx_v_host = NULL; - PyObject *__pyx_v_port = NULL; - PyObject *__pyx_v_encoded = NULL; - PyObject *__pyx_v_percent_encode_set = NULL; +static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - Py_ssize_t __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; - Py_ssize_t __pyx_t_12; - PyObject *(*__pyx_t_13)(PyObject *); - int __pyx_t_14; - PyObject *__pyx_t_15 = NULL; - int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_url", 0); - __Pyx_INCREF(__pyx_v_input); - __Pyx_INCREF(__pyx_v_encoding); + __Pyx_RefNannySetupContext("_is_single_dot_path_segment", 1); - /* "w3lib/_url.pyx":474 - * # output can match the original parsed URL if desired. - * - * if base_url is not None: # <<<<<<<<<<<<<< - * base = _parse_url(base_url, encoding=encoding) - * else: + /* "w3lib/_url.pyx":862 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment + * def _is_single_dot_path_segment(input: str) -> bool: + * return input in ( # <<<<<<<<<<<<<< + * ".", + * "%2e", */ - __pyx_t_1 = (__pyx_v_base_url != ((PyObject*)Py_None)); - if (__pyx_t_1) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_input); + __pyx_t_1 = __pyx_v_input; + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 862, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 862, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 862, __pyx_L1_error) + __pyx_t_2 = __pyx_t_3; + __pyx_L3_bool_binop_done:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; - /* "w3lib/_url.pyx":475 + /* "w3lib/_url.pyx":861 * - * if base_url is not None: - * base = _parse_url(base_url, encoding=encoding) # <<<<<<<<<<<<<< - * else: - * base = None + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment + * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * ".", */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_base_url); - __Pyx_GIVEREF(__pyx_v_base_url); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_base_url)) __PYX_ERR(0, 475, __pyx_L1_error); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 475, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_base = __pyx_t_5; - __pyx_t_5 = 0; - /* "w3lib/_url.pyx":474 - * # output can match the original parsed URL if desired. - * - * if base_url is not None: # <<<<<<<<<<<<<< - * base = _parse_url(base_url, encoding=encoding) - * else: - */ - goto __pyx_L3; - } + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._url._is_single_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":477 - * base = _parse_url(base_url, encoding=encoding) - * else: - * base = None # <<<<<<<<<<<<<< - * encoding = _get_output_encoding(encoding) - * +/* "w3lib/_url.pyx":872 + * # to be escaped, they are escaped in an idempotent way (i.e. if they are + * # already part of an escape sequence, they are not re-encoded). + * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * *, input: str, pointer: int, encode_set: _PercentEncodeSet + * ) -> str: */ - /*else*/ { - __Pyx_INCREF(Py_None); - __pyx_v_base = Py_None; - } - __pyx_L3:; - /* "w3lib/_url.pyx":478 - * else: - * base = None - * encoding = _get_output_encoding(encoding) # <<<<<<<<<<<<<< - * - * url = _URL() - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_output_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_35_idempotent_utf_8_percent_encode = {"_idempotent_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_pointer = 0; + PyObject *__pyx_v_encode_set = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_idempotent_utf_8_percent_encode (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 478, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_encoding, ((PyObject*)__pyx_t_5)); - __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":480 - * encoding = _get_output_encoding(encoding) - * - * url = _URL() # <<<<<<<<<<<<<< - * state = SCHEME_START - * buffer = "" - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_URL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_pointer,&__pyx_n_s_encode_set,0}; + if (likely(__pyx_kwds)) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 872, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 872, __pyx_L3_error) + } + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pointer)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 872, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_pointer); __PYX_ERR(0, 872, __pyx_L3_error) + } + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encode_set)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 872, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_encode_set); __PYX_ERR(0, 872, __pyx_L3_error) + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "_idempotent_utf_8_percent_encode") < 0)) __PYX_ERR(0, 872, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 0)) { + goto __pyx_L5_argtuple_error; + } else { + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 872, __pyx_L3_error) } + __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_pointer = ((PyObject*)values[1]); + __pyx_v_encode_set = values[2]; } - #endif + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_idempotent_utf_8_percent_encode", 1, 0, 0, __pyx_nargs); __PYX_ERR(0, 872, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } } - __pyx_v_url = __pyx_t_5; - __pyx_t_5 = 0; + __Pyx_AddTraceback("w3lib._url._idempotent_utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 873, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pointer), (&PyInt_Type), 0, "pointer", 1))) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_pointer, __pyx_v_encode_set); - /* "w3lib/_url.pyx":481 - * - * url = _URL() - * state = SCHEME_START # <<<<<<<<<<<<<< - * buffer = "" - * at_sign_seen = inside_brackets = skip_authority_shortcut = False + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set) { + PyObject *__pyx_v_code_point = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_idempotent_utf_8_percent_encode", 1); + + /* "w3lib/_url.pyx":875 + * *, input: str, pointer: int, encode_set: _PercentEncodeSet + * ) -> str: + * code_point = input[pointer] # <<<<<<<<<<<<<< + * if code_point == "%" and "%" in encode_set: + * if ( */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SCHEME_START); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_v_state = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_v_code_point = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":482 - * url = _URL() - * state = SCHEME_START - * buffer = "" # <<<<<<<<<<<<<< - * at_sign_seen = inside_brackets = skip_authority_shortcut = False - * pointer = 0 + /* "w3lib/_url.pyx":876 + * ) -> str: + * code_point = input[pointer] + * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< + * if ( + * pointer + 2 >= len(input) */ - __Pyx_INCREF(__pyx_kp_u__2); - __pyx_v_buffer = __pyx_kp_u__2; + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 876, __pyx_L1_error) + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__4, __pyx_v_encode_set, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { - /* "w3lib/_url.pyx":483 - * state = SCHEME_START - * buffer = "" - * at_sign_seen = inside_brackets = skip_authority_shortcut = False # <<<<<<<<<<<<<< - * pointer = 0 - * + /* "w3lib/_url.pyx":878 + * if code_point == "%" and "%" in encode_set: + * if ( + * pointer + 2 >= len(input) # <<<<<<<<<<<<<< + * or input[pointer + 1] not in _ASCII_HEX_DIGIT + * or input[pointer + 2] not in _ASCII_HEX_DIGIT */ - __pyx_v_at_sign_seen = 0; - __pyx_v_inside_brackets = 0; - __pyx_v_skip_authority_shortcut = 0; + __pyx_t_1 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 878, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 878, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 878, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L7_bool_binop_done; + } - /* "w3lib/_url.pyx":484 - * buffer = "" - * at_sign_seen = inside_brackets = skip_authority_shortcut = False - * pointer = 0 # <<<<<<<<<<<<<< - * - * input = input.strip(_C0_CONTROL_OR_SPACE) + /* "w3lib/_url.pyx":879 + * if ( + * pointer + 2 >= len(input) + * or input[pointer + 1] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * or input[pointer + 2] not in _ASCII_HEX_DIGIT + * ): */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_pointer = __pyx_int_0; + __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L7_bool_binop_done; + } - /* "w3lib/_url.pyx":486 - * pointer = 0 - * - * input = input.strip(_C0_CONTROL_OR_SPACE) # <<<<<<<<<<<<<< - * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) - * input_length = len(input) + /* "w3lib/_url.pyx":880 + * pointer + 2 >= len(input) + * or input[pointer + 1] not in _ASCII_HEX_DIGIT + * or input[pointer + 2] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * ): + * return "%25" */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_input, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 486, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); - __pyx_t_4 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __pyx_t_3; + __pyx_L7_bool_binop_done:; - /* "w3lib/_url.pyx":487 - * - * input = input.strip(_C0_CONTROL_OR_SPACE) - * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) # <<<<<<<<<<<<<< - * input_length = len(input) - * + /* "w3lib/_url.pyx":877 + * code_point = input[pointer] + * if code_point == "%" and "%" in encode_set: + * if ( # <<<<<<<<<<<<<< + * pointer + 2 >= len(input) + * or input[pointer + 1] not in _ASCII_HEX_DIGIT */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_translate, __pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_5)); - __pyx_t_5 = 0; + if (__pyx_t_2) { - /* "w3lib/_url.pyx":488 - * input = input.strip(_C0_CONTROL_OR_SPACE) - * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) - * input_length = len(input) # <<<<<<<<<<<<<< - * - * while True: + /* "w3lib/_url.pyx":882 + * or input[pointer + 2] not in _ASCII_HEX_DIGIT + * ): + * return "%25" # <<<<<<<<<<<<<< + * return "%" + * return _utf_8_percent_encode(code_point, encode_set) */ - if (unlikely(__pyx_v_input == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 488, __pyx_L1_error) - } - __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 488, __pyx_L1_error) - __pyx_v_input_length = __pyx_t_7; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_u_25); + __pyx_r = __pyx_kp_u_25; + goto __pyx_L0; - /* "w3lib/_url.pyx":490 - * input_length = len(input) - * - * while True: # <<<<<<<<<<<<<< - * try: - * c: Optional[str] = input[pointer] + /* "w3lib/_url.pyx":877 + * code_point = input[pointer] + * if code_point == "%" and "%" in encode_set: + * if ( # <<<<<<<<<<<<<< + * pointer + 2 >= len(input) + * or input[pointer + 1] not in _ASCII_HEX_DIGIT */ - while (1) { + } - /* "w3lib/_url.pyx":491 + /* "w3lib/_url.pyx":883 + * ): + * return "%25" + * return "%" # <<<<<<<<<<<<<< + * return _utf_8_percent_encode(code_point, encode_set) * - * while True: - * try: # <<<<<<<<<<<<<< - * c: Optional[str] = input[pointer] - * except IndexError: */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); - __Pyx_XGOTREF(__pyx_t_8); - __Pyx_XGOTREF(__pyx_t_9); - __Pyx_XGOTREF(__pyx_t_10); - /*try:*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_u__4); + __pyx_r = __pyx_kp_u__4; + goto __pyx_L0; - /* "w3lib/_url.pyx":492 - * while True: - * try: - * c: Optional[str] = input[pointer] # <<<<<<<<<<<<<< - * except IndexError: - * c = None + /* "w3lib/_url.pyx":876 + * ) -> str: + * code_point = input[pointer] + * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< + * if ( + * pointer + 2 >= len(input) */ - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_5); - if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 492, __pyx_L6_error) - __Pyx_XDECREF_SET(__pyx_v_c, ((PyObject*)__pyx_t_5)); - __pyx_t_5 = 0; + } - /* "w3lib/_url.pyx":491 + /* "w3lib/_url.pyx":884 + * return "%25" + * return "%" + * return _utf_8_percent_encode(code_point, encode_set) # <<<<<<<<<<<<<< * - * while True: - * try: # <<<<<<<<<<<<<< - * c: Optional[str] = input[pointer] - * except IndexError: - */ - } - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L13_try_end; - __pyx_L6_error:; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":493 - * try: - * c: Optional[str] = input[pointer] - * except IndexError: # <<<<<<<<<<<<<< - * c = None * */ - __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); - if (__pyx_t_6) { - __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 493, __pyx_L8_except_error) - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_t_3); - - /* "w3lib/_url.pyx":494 - * c: Optional[str] = input[pointer] - * except IndexError: - * c = None # <<<<<<<<<<<<<< - * - * if state == SCHEME_START: - */ - __Pyx_INCREF(Py_None); - __Pyx_XDECREF_SET(__pyx_v_c, ((PyObject*)Py_None)); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L7_exception_handled; - } - goto __pyx_L8_except_error; - - /* "w3lib/_url.pyx":491 - * - * while True: - * try: # <<<<<<<<<<<<<< - * c: Optional[str] = input[pointer] - * except IndexError: - */ - __pyx_L8_except_error:; - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_XGIVEREF(__pyx_t_9); - __Pyx_XGIVEREF(__pyx_t_10); - __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); - goto __pyx_L1_error; - __pyx_L7_exception_handled:; - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_XGIVEREF(__pyx_t_9); - __Pyx_XGIVEREF(__pyx_t_10); - __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); - __pyx_L13_try_end:; + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_7 = 1; } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_code_point, __pyx_v_encode_set}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_6))) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L0; - /* "w3lib/_url.pyx":496 - * c = None - * - * if state == SCHEME_START: # <<<<<<<<<<<<<< - * if c is not None and c in _ASCII_ALPHA: - * assert isinstance(c, str) - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SCHEME_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 496, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":497 - * - * if state == SCHEME_START: - * if c is not None and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * buffer += c - */ - __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L18_bool_binop_done; - } - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 497, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __pyx_t_11; - __pyx_L18_bool_binop_done:; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":498 - * if state == SCHEME_START: - * if c is not None and c in _ASCII_ALPHA: - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * buffer += c - * state = SCHEME - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 498, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 498, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":499 - * if c is not None and c in _ASCII_ALPHA: - * assert isinstance(c, str) - * buffer += c # <<<<<<<<<<<<<< - * state = SCHEME - * else: + /* "w3lib/_url.pyx":872 + * # to be escaped, they are escaped in an idempotent way (i.e. if they are + * # already part of an escape sequence, they are not re-encoded). + * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * *, input: str, pointer: int, encode_set: _PercentEncodeSet + * ) -> str: */ - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); - __pyx_t_4 = 0; - /* "w3lib/_url.pyx":500 - * assert isinstance(c, str) - * buffer += c - * state = SCHEME # <<<<<<<<<<<<<< - * else: - * state = NO_SCHEME - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); - __pyx_t_4 = 0; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("w3lib._url._idempotent_utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_code_point); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":497 +/* "w3lib/_url.pyx":887 * - * if state == SCHEME_START: - * if c is not None and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * buffer += c - */ - goto __pyx_L17; - } - - /* "w3lib/_url.pyx":502 - * state = SCHEME - * else: - * state = NO_SCHEME # <<<<<<<<<<<<<< - * pointer -= 1 * + * def _parse_url( # <<<<<<<<<<<<<< + * input: str, + * *, */ - /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NO_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); - __pyx_t_4 = 0; - /* "w3lib/_url.pyx":503 - * else: - * state = NO_SCHEME - * pointer -= 1 # <<<<<<<<<<<<<< - * - * elif state == SCHEME: - */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; - } - __pyx_L17:; +static PyObject *__pyx_pf_5w3lib_4_url_50__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":496 - * c = None - * - * if state == SCHEME_START: # <<<<<<<<<<<<<< - * if c is not None and c in _ASCII_ALPHA: - * assert isinstance(c, str) + /* "w3lib/_url.pyx":890 + * input: str, + * *, + * base_url: str = None, # <<<<<<<<<<<<<< + * encoding: str = "utf-8", + * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, */ - goto __pyx_L16; - } + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, Py_None) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, ((PyObject*)__pyx_kp_u_utf_8)) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - /* "w3lib/_url.pyx":505 - * pointer -= 1 + /* "w3lib/_url.pyx":887 * - * elif state == SCHEME: # <<<<<<<<<<<<<< - * if c is not None and c in _SCHEME_CHARS: - * assert isinstance(c, str) - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":506 * - * elif state == SCHEME: - * if c is not None and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * buffer += c + * def _parse_url( # <<<<<<<<<<<<<< + * input: str, + * *, */ - __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L21_bool_binop_done; - } - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SCHEME_CHARS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 506, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_11; - __pyx_L21_bool_binop_done:; - if (__pyx_t_1) { + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_userinfo_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_path_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_path_percent_encode_set) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_query_percent_encode_set) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_special_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_special_query_percent_encode_set) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fragment_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_fragment_percent_encode_set) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 887, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "w3lib/_url.pyx":507 - * elif state == SCHEME: - * if c is not None and c in _SCHEME_CHARS: - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * buffer += c - * elif c == ":": - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 507, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 507, __pyx_L1_error) - #endif + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("w3lib._url.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":508 - * if c is not None and c in _SCHEME_CHARS: - * assert isinstance(c, str) - * buffer += c # <<<<<<<<<<<<<< - * elif c == ":": - * url.scheme = buffer.lower() - */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); - __pyx_t_3 = 0; +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_37_parse_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_36_parse_url, "Return a :class:`_URL` object built from *url*, *base_url* and\n *encoding*, following the URL parsing algorithm defined in the `URL living\n standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *userinfo_percent_encode_set* allows customizing which characters found\n in the user authroization part of the input URL need to be\n percent-encoded.\n "); +static PyMethodDef __pyx_mdef_5w3lib_4_url_37_parse_url = {"_parse_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_37_parse_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_36_parse_url}; +static PyObject *__pyx_pw_5w3lib_4_url_37_parse_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_base_url = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_userinfo_percent_encode_set = 0; + PyObject *__pyx_v_path_percent_encode_set = 0; + PyObject *__pyx_v_query_percent_encode_set = 0; + PyObject *__pyx_v_special_query_percent_encode_set = 0; + PyObject *__pyx_v_fragment_percent_encode_set = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[8] = {0,0,0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_parse_url (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_base_url,&__pyx_n_s_encoding,&__pyx_n_s_userinfo_percent_encode_set,&__pyx_n_s_path_percent_encode_set,&__pyx_n_s_query_percent_encode_set,&__pyx_n_s_special_query_percent_encode_set,&__pyx_n_s_fragment_percent_encode_set,0}; + __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); - /* "w3lib/_url.pyx":506 - * - * elif state == SCHEME: - * if c is not None and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * buffer += c + /* "w3lib/_url.pyx":890 + * input: str, + * *, + * base_url: str = None, # <<<<<<<<<<<<<< + * encoding: str = "utf-8", + * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, */ - goto __pyx_L20; + values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None)); + values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)((PyObject*)__pyx_kp_u_utf_8))); + values[3] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_userinfo_percent_encode_set); + values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_path_percent_encode_set); + values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_query_percent_encode_set); + values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_special_query_percent_encode_set); + values[7] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_fragment_percent_encode_set); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; } - - /* "w3lib/_url.pyx":509 - * assert isinstance(c, str) - * buffer += c - * elif c == ":": # <<<<<<<<<<<<<< - * url.scheme = buffer.lower() - * buffer = "" - */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 509, __pyx_L1_error) - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":510 - * buffer += c - * elif c == ":": - * url.scheme = buffer.lower() # <<<<<<<<<<<<<< - * buffer = "" - * if url.scheme == "file": - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_buffer, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (kw_args > 0 && likely(kw_args <= 7)) { + Py_ssize_t index; + for (index = 1; index < 8 && kw_args > 0; index++) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L3_error) } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 510, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_url") < 0)) __PYX_ERR(0, 887, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_base_url = ((PyObject*)values[1]); + __pyx_v_encoding = ((PyObject*)values[2]); + __pyx_v_userinfo_percent_encode_set = values[3]; + __pyx_v_path_percent_encode_set = values[4]; + __pyx_v_query_percent_encode_set = values[5]; + __pyx_v_special_query_percent_encode_set = values[6]; + __pyx_v_fragment_percent_encode_set = values[7]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_parse_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 887, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 888, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_base_url), (&PyUnicode_Type), 1, "base_url", 1))) __PYX_ERR(0, 890, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_36_parse_url(__pyx_self, __pyx_v_input, __pyx_v_base_url, __pyx_v_encoding, __pyx_v_userinfo_percent_encode_set, __pyx_v_path_percent_encode_set, __pyx_v_query_percent_encode_set, __pyx_v_special_query_percent_encode_set, __pyx_v_fragment_percent_encode_set); - /* "w3lib/_url.pyx":511 - * elif c == ":": - * url.scheme = buffer.lower() - * buffer = "" # <<<<<<<<<<<<<< - * if url.scheme == "file": - * state = FILE + /* "w3lib/_url.pyx":887 + * + * + * def _parse_url( # <<<<<<<<<<<<<< + * input: str, + * *, */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":512 - * url.scheme = buffer.lower() - * buffer = "" - * if url.scheme == "file": # <<<<<<<<<<<<<< - * state = FILE - * elif url.is_special: - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 512, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":513 - * buffer = "" - * if url.scheme == "file": - * state = FILE # <<<<<<<<<<<<<< - * elif url.is_special: - * if base is not None and base.scheme == url.scheme: - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FILE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; +static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_base_url, PyObject *__pyx_v_encoding, PyObject *__pyx_v_userinfo_percent_encode_set, PyObject *__pyx_v_path_percent_encode_set, PyObject *__pyx_v_query_percent_encode_set, PyObject *__pyx_v_special_query_percent_encode_set, PyObject *__pyx_v_fragment_percent_encode_set) { + PyObject *__pyx_v_base = NULL; + PyObject *__pyx_v_url = NULL; + unsigned char __pyx_v_state; + PyObject *__pyx_v_buffer = NULL; + int __pyx_v_at_sign_seen; + int __pyx_v_inside_brackets; + int __pyx_v_skip_authority_shortcut; + PyObject *__pyx_v_pointer = NULL; + Py_ssize_t __pyx_v_input_length; + PyObject *__pyx_v_c = 0; + PyObject *__pyx_v_at_sign_index = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_code_point = NULL; + PyObject *__pyx_v_encoded_code_points = NULL; + PyObject *__pyx_v_host = NULL; + PyObject *__pyx_v_port = NULL; + PyObject *__pyx_v_encoded = NULL; + PyObject *__pyx_v_percent_encode_set = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + PyObject *(*__pyx_t_13)(PyObject *); + int __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_url", 0); + __Pyx_INCREF(__pyx_v_input); + __Pyx_INCREF(__pyx_v_encoding); - /* "w3lib/_url.pyx":512 - * url.scheme = buffer.lower() - * buffer = "" - * if url.scheme == "file": # <<<<<<<<<<<<<< - * state = FILE - * elif url.is_special: + /* "w3lib/_url.pyx":923 + * # output can match the original parsed URL if desired. + * + * if base_url is not None: # <<<<<<<<<<<<<< + * base = _parse_url(base_url, encoding=encoding) + * else: */ - goto __pyx_L23; - } - - /* "w3lib/_url.pyx":514 - * if url.scheme == "file": - * state = FILE - * elif url.is_special: # <<<<<<<<<<<<<< - * if base is not None and base.scheme == url.scheme: - * state = SPECIAL_RELATIVE_OR_AUTHORITY - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 514, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_base_url != ((PyObject*)Py_None)); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":515 - * state = FILE - * elif url.is_special: - * if base is not None and base.scheme == url.scheme: # <<<<<<<<<<<<<< - * state = SPECIAL_RELATIVE_OR_AUTHORITY - * else: + /* "w3lib/_url.pyx":924 + * + * if base_url is not None: + * base = _parse_url(base_url, encoding=encoding) # <<<<<<<<<<<<<< + * else: + * base = None */ - __pyx_t_11 = (__pyx_v_base != Py_None); - if (__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L25_bool_binop_done; - } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 515, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = __pyx_t_11; - __pyx_L25_bool_binop_done:; - if (__pyx_t_1) { + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_base_url); + __Pyx_GIVEREF(__pyx_v_base_url); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_base_url)) __PYX_ERR(0, 924, __pyx_L1_error); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 924, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_base = __pyx_t_5; + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":516 - * elif url.is_special: - * if base is not None and base.scheme == url.scheme: - * state = SPECIAL_RELATIVE_OR_AUTHORITY # <<<<<<<<<<<<<< - * else: - * state = SPECIAL_AUTHORITY_SLASHES + /* "w3lib/_url.pyx":923 + * # output can match the original parsed URL if desired. + * + * if base_url is not None: # <<<<<<<<<<<<<< + * base = _parse_url(base_url, encoding=encoding) + * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_5); - __pyx_t_5 = 0; + goto __pyx_L3; + } - /* "w3lib/_url.pyx":515 - * state = FILE - * elif url.is_special: - * if base is not None and base.scheme == url.scheme: # <<<<<<<<<<<<<< - * state = SPECIAL_RELATIVE_OR_AUTHORITY - * else: + /* "w3lib/_url.pyx":926 + * base = _parse_url(base_url, encoding=encoding) + * else: + * base = None # <<<<<<<<<<<<<< + * encoding = _get_output_encoding(encoding) + * */ - goto __pyx_L24; - } + /*else*/ { + __Pyx_INCREF(Py_None); + __pyx_v_base = Py_None; + } + __pyx_L3:; - /* "w3lib/_url.pyx":518 - * state = SPECIAL_RELATIVE_OR_AUTHORITY - * else: - * state = SPECIAL_AUTHORITY_SLASHES # <<<<<<<<<<<<<< - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": - * state = PATH_OR_AUTHORITY + /* "w3lib/_url.pyx":927 + * else: + * base = None + * encoding = _get_output_encoding(encoding) # <<<<<<<<<<<<<< + * + * url = _URL() */ - /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SPECIAL_AUTHORITY_SLASHES); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_5); - __pyx_t_5 = 0; - } - __pyx_L24:; + __pyx_t_5 = __pyx_f_5w3lib_4_url__get_output_encoding(__pyx_v_encoding); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 927, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_encoding, ((PyObject*)__pyx_t_5)); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":514 - * if url.scheme == "file": - * state = FILE - * elif url.is_special: # <<<<<<<<<<<<<< - * if base is not None and base.scheme == url.scheme: - * state = SPECIAL_RELATIVE_OR_AUTHORITY + /* "w3lib/_url.pyx":929 + * encoding = _get_output_encoding(encoding) + * + * url = _URL() # <<<<<<<<<<<<<< + * state = SCHEME_START + * buffer = "" */ - goto __pyx_L23; - } + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_URL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 929, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_v_url = __pyx_t_5; + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":519 - * else: - * state = SPECIAL_AUTHORITY_SLASHES - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< - * state = PATH_OR_AUTHORITY - * pointer += 1 + /* "w3lib/_url.pyx":930 + * + * url = _URL() + * state = SCHEME_START # <<<<<<<<<<<<<< + * buffer = "" + * at_sign_seen = inside_brackets = skip_authority_shortcut = False */ - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__pyx_v_input == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 519, __pyx_L1_error) - } - __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 519, __pyx_L1_error) - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 519, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L27_bool_binop_done; - } - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 519, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __pyx_t_11; - __pyx_L27_bool_binop_done:; - if (__pyx_t_1) { + __pyx_v_state = __pyx_v_5w3lib_4_url_SCHEME_START; - /* "w3lib/_url.pyx":520 - * state = SPECIAL_AUTHORITY_SLASHES - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": - * state = PATH_OR_AUTHORITY # <<<<<<<<<<<<<< - * pointer += 1 - * else: + /* "w3lib/_url.pyx":931 + * url = _URL() + * state = SCHEME_START + * buffer = "" # <<<<<<<<<<<<<< + * at_sign_seen = inside_brackets = skip_authority_shortcut = False + * pointer = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH_OR_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_u__2); + __pyx_v_buffer = __pyx_kp_u__2; - /* "w3lib/_url.pyx":521 - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": - * state = PATH_OR_AUTHORITY - * pointer += 1 # <<<<<<<<<<<<<< - * else: - * url.path = "" + /* "w3lib/_url.pyx":932 + * state = SCHEME_START + * buffer = "" + * at_sign_seen = inside_brackets = skip_authority_shortcut = False # <<<<<<<<<<<<<< + * pointer = 0 + * */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_at_sign_seen = 0; + __pyx_v_inside_brackets = 0; + __pyx_v_skip_authority_shortcut = 0; - /* "w3lib/_url.pyx":519 - * else: - * state = SPECIAL_AUTHORITY_SLASHES - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< - * state = PATH_OR_AUTHORITY - * pointer += 1 + /* "w3lib/_url.pyx":933 + * buffer = "" + * at_sign_seen = inside_brackets = skip_authority_shortcut = False + * pointer = 0 # <<<<<<<<<<<<<< + * + * input = input.strip(_C0_CONTROL_OR_SPACE) */ - goto __pyx_L23; - } + __Pyx_INCREF(__pyx_int_0); + __pyx_v_pointer = __pyx_int_0; - /* "w3lib/_url.pyx":523 - * pointer += 1 - * else: - * url.path = "" # <<<<<<<<<<<<<< - * state = OPAQUE_PATH - * else: + /* "w3lib/_url.pyx":935 + * pointer = 0 + * + * input = input.strip(_C0_CONTROL_OR_SPACE) # <<<<<<<<<<<<<< + * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) + * input_length = len(input) */ - /*else*/ { - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_kp_u__2) < 0) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 935, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_input, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 935, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 935, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":524 - * else: - * url.path = "" - * state = OPAQUE_PATH # <<<<<<<<<<<<<< - * else: - * buffer = "" + /* "w3lib/_url.pyx":936 + * + * input = input.strip(_C0_CONTROL_OR_SPACE) + * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) # <<<<<<<<<<<<<< + * input_length = len(input) + * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OPAQUE_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); - __pyx_t_4 = 0; - } - __pyx_L23:; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 936, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_translate, __pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 936, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 936, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_5)); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":509 - * assert isinstance(c, str) - * buffer += c - * elif c == ":": # <<<<<<<<<<<<<< - * url.scheme = buffer.lower() - * buffer = "" + /* "w3lib/_url.pyx":937 + * input = input.strip(_C0_CONTROL_OR_SPACE) + * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) + * input_length = len(input) # <<<<<<<<<<<<<< + * + * while True: */ - goto __pyx_L20; - } + if (unlikely(__pyx_v_input == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 937, __pyx_L1_error) + } + __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_v_input_length = __pyx_t_7; - /* "w3lib/_url.pyx":526 - * state = OPAQUE_PATH - * else: - * buffer = "" # <<<<<<<<<<<<<< - * state = NO_SCHEME - * pointer = -1 + /* "w3lib/_url.pyx":939 + * input_length = len(input) + * + * while True: # <<<<<<<<<<<<<< + * try: + * c: Optional[str] = input[pointer] */ - /*else*/ { - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + while (1) { - /* "w3lib/_url.pyx":527 - * else: - * buffer = "" - * state = NO_SCHEME # <<<<<<<<<<<<<< - * pointer = -1 + /* "w3lib/_url.pyx":940 * + * while True: + * try: # <<<<<<<<<<<<<< + * c: Optional[str] = input[pointer] + * except IndexError: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NO_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); - __pyx_t_4 = 0; + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { - /* "w3lib/_url.pyx":528 - * buffer = "" - * state = NO_SCHEME - * pointer = -1 # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":941 + * while True: + * try: + * c: Optional[str] = input[pointer] # <<<<<<<<<<<<<< + * except IndexError: + * c = None + */ + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 941, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 941, __pyx_L6_error) + __Pyx_XDECREF_SET(__pyx_v_c, ((PyObject*)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":940 * - * elif state == NO_SCHEME: + * while True: + * try: # <<<<<<<<<<<<<< + * c: Optional[str] = input[pointer] + * except IndexError: */ - __Pyx_INCREF(__pyx_int_neg_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_int_neg_1); } - __pyx_L20:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":505 - * pointer -= 1 + /* "w3lib/_url.pyx":942 + * try: + * c: Optional[str] = input[pointer] + * except IndexError: # <<<<<<<<<<<<<< + * c = None * - * elif state == SCHEME: # <<<<<<<<<<<<<< - * if c is not None and c in _SCHEME_CHARS: - * assert isinstance(c, str) */ - goto __pyx_L16; - } + __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); + if (__pyx_t_6) { + __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 942, __pyx_L8_except_error) + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":530 - * pointer = -1 + /* "w3lib/_url.pyx":943 + * c: Optional[str] = input[pointer] + * except IndexError: + * c = None # <<<<<<<<<<<<<< * - * elif state == NO_SCHEME: # <<<<<<<<<<<<<< - * if base is None: - * raise ValueError + * if state == SCHEME_START: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NO_SCHEME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 530, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_c, ((PyObject*)Py_None)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; - /* "w3lib/_url.pyx":531 + /* "w3lib/_url.pyx":940 * - * elif state == NO_SCHEME: - * if base is None: # <<<<<<<<<<<<<< - * raise ValueError - * if base.has_opaque_path(): + * while True: + * try: # <<<<<<<<<<<<<< + * c: Optional[str] = input[pointer] + * except IndexError: */ - __pyx_t_1 = (__pyx_v_base == Py_None); - if (unlikely(__pyx_t_1)) { + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L13_try_end:; + } - /* "w3lib/_url.pyx":532 - * elif state == NO_SCHEME: - * if base is None: - * raise ValueError # <<<<<<<<<<<<<< - * if base.has_opaque_path(): - * if c != "#": + /* "w3lib/_url.pyx":945 + * c = None + * + * if state == SCHEME_START: # <<<<<<<<<<<<<< + * if c is not None and c in _ASCII_ALPHA: + * assert isinstance(c, str) */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SCHEME_START); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":531 + /* "w3lib/_url.pyx":946 * - * elif state == NO_SCHEME: - * if base is None: # <<<<<<<<<<<<<< - * raise ValueError - * if base.has_opaque_path(): + * if state == SCHEME_START: + * if c is not None and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * buffer += c */ + __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L18_bool_binop_done; } + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 946, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_11; + __pyx_L18_bool_binop_done:; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":533 - * if base is None: - * raise ValueError - * if base.has_opaque_path(): # <<<<<<<<<<<<<< - * if c != "#": - * raise ValueError + /* "w3lib/_url.pyx":947 + * if state == SCHEME_START: + * if c is not None and c in _ASCII_ALPHA: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * buffer += c + * state = SCHEME */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 947, __pyx_L1_error) + } } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 533, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { + #else + if ((1)); else __PYX_ERR(0, 947, __pyx_L1_error) + #endif - /* "w3lib/_url.pyx":534 - * raise ValueError - * if base.has_opaque_path(): - * if c != "#": # <<<<<<<<<<<<<< - * raise ValueError - * url.scheme = base.scheme + /* "w3lib/_url.pyx":948 + * if c is not None and c in _ASCII_ALPHA: + * assert isinstance(c, str) + * buffer += c # <<<<<<<<<<<<<< + * state = SCHEME + * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 534, __pyx_L1_error) - if (unlikely(__pyx_t_1)) { + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 948, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":535 - * if base.has_opaque_path(): - * if c != "#": - * raise ValueError # <<<<<<<<<<<<<< - * url.scheme = base.scheme - * url.path = base.path + /* "w3lib/_url.pyx":949 + * assert isinstance(c, str) + * buffer += c + * state = SCHEME # <<<<<<<<<<<<<< + * else: + * state = NO_SCHEME */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_v_state = __pyx_v_5w3lib_4_url_SCHEME; - /* "w3lib/_url.pyx":534 - * raise ValueError - * if base.has_opaque_path(): - * if c != "#": # <<<<<<<<<<<<<< - * raise ValueError - * url.scheme = base.scheme + /* "w3lib/_url.pyx":946 + * + * if state == SCHEME_START: + * if c is not None and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * buffer += c */ - } + goto __pyx_L17; + } - /* "w3lib/_url.pyx":536 - * if c != "#": - * raise ValueError - * url.scheme = base.scheme # <<<<<<<<<<<<<< - * url.path = base.path - * url.query = base.query + /* "w3lib/_url.pyx":951 + * state = SCHEME + * else: + * state = NO_SCHEME # <<<<<<<<<<<<<< + * pointer -= 1 + * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 536, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /*else*/ { + __pyx_v_state = __pyx_v_5w3lib_4_url_NO_SCHEME; - /* "w3lib/_url.pyx":537 - * raise ValueError - * url.scheme = base.scheme - * url.path = base.path # <<<<<<<<<<<<<< - * url.query = base.query - * url.fragment = "" + /* "w3lib/_url.pyx":952 + * else: + * state = NO_SCHEME + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == SCHEME: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_3) < 0) __PYX_ERR(0, 537, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":538 - * url.scheme = base.scheme - * url.path = base.path - * url.query = base.query # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_3) < 0) __PYX_ERR(0, 538, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":539 - * url.path = base.path - * url.query = base.query - * url.fragment = "" # <<<<<<<<<<<<<< - * state = FRAGMENT - * else: - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 539, __pyx_L1_error) - - /* "w3lib/_url.pyx":540 - * url.query = base.query - * url.fragment = "" - * state = FRAGMENT # <<<<<<<<<<<<<< - * else: - * if base.scheme != "file": - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":533 - * if base is None: - * raise ValueError - * if base.has_opaque_path(): # <<<<<<<<<<<<<< - * if c != "#": - * raise ValueError - */ - goto __pyx_L30; - } - - /* "w3lib/_url.pyx":542 - * state = FRAGMENT - * else: - * if base.scheme != "file": # <<<<<<<<<<<<<< - * state = RELATIVE - * else: - */ - /*else*/ { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":543 - * else: - * if base.scheme != "file": - * state = RELATIVE # <<<<<<<<<<<<<< - * else: - * state = FILE - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RELATIVE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":542 - * state = FRAGMENT - * else: - * if base.scheme != "file": # <<<<<<<<<<<<<< - * state = RELATIVE - * else: - */ - goto __pyx_L32; - } - - /* "w3lib/_url.pyx":545 - * state = RELATIVE - * else: - * state = FILE # <<<<<<<<<<<<<< - * pointer -= 1 - * - */ - /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FILE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; - } - __pyx_L32:; - - /* "w3lib/_url.pyx":546 - * else: - * state = FILE - * pointer -= 1 # <<<<<<<<<<<<<< - * - * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: - */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; } - __pyx_L30:; + __pyx_L17:; - /* "w3lib/_url.pyx":530 - * pointer = -1 + /* "w3lib/_url.pyx":945 + * c = None * - * elif state == NO_SCHEME: # <<<<<<<<<<<<<< - * if base is None: - * raise ValueError + * if state == SCHEME_START: # <<<<<<<<<<<<<< + * if c is not None and c in _ASCII_ALPHA: + * assert isinstance(c, str) */ goto __pyx_L16; } - /* "w3lib/_url.pyx":548 + /* "w3lib/_url.pyx":954 * pointer -= 1 * - * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< - * if c == "/" and input[pointer + 1] == "/": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * elif state == SCHEME: # <<<<<<<<<<<<<< + * if c is not None and c in _SCHEME_CHARS: + * assert isinstance(c, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 548, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SCHEME); if (__pyx_t_1) { - /* "w3lib/_url.pyx":549 + /* "w3lib/_url.pyx":955 * - * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: - * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * pointer += 1 + * elif state == SCHEME: + * if c is not None and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * buffer += c */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); if (__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; - goto __pyx_L34_bool_binop_done; + goto __pyx_L21_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SCHEME_CHARS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_11; - __pyx_L34_bool_binop_done:; + __pyx_L21_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":550 - * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: - * if c == "/" and input[pointer + 1] == "/": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< - * pointer += 1 - * else: + /* "w3lib/_url.pyx":956 + * elif state == SCHEME: + * if c is not None and c in _SCHEME_CHARS: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * buffer += c + * elif c == ":": */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 956, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 956, __pyx_L1_error) + #endif - /* "w3lib/_url.pyx":551 - * if c == "/" and input[pointer + 1] == "/": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * pointer += 1 # <<<<<<<<<<<<<< - * else: - * state = RELATIVE + /* "w3lib/_url.pyx":957 + * if c is not None and c in _SCHEME_CHARS: + * assert isinstance(c, str) + * buffer += c # <<<<<<<<<<<<<< + * elif c == ":": + * url.scheme = buffer.lower() */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":549 + /* "w3lib/_url.pyx":955 * - * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: - * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * pointer += 1 + * elif state == SCHEME: + * if c is not None and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * buffer += c */ - goto __pyx_L33; + goto __pyx_L20; } - /* "w3lib/_url.pyx":553 - * pointer += 1 - * else: - * state = RELATIVE # <<<<<<<<<<<<<< - * pointer -= 1 - * + /* "w3lib/_url.pyx":958 + * assert isinstance(c, str) + * buffer += c + * elif c == ":": # <<<<<<<<<<<<<< + * url.scheme = buffer.lower() + * buffer = "" */ - /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RELATIVE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 958, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":554 - * else: - * state = RELATIVE - * pointer -= 1 # <<<<<<<<<<<<<< - * - * elif state == PATH_OR_AUTHORITY: + /* "w3lib/_url.pyx":959 + * buffer += c + * elif c == ":": + * url.scheme = buffer.lower() # <<<<<<<<<<<<<< + * buffer = "" + * if url.scheme == "file": */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; - } - __pyx_L33:; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_buffer, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 959, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 959, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":548 - * pointer -= 1 - * - * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< - * if c == "/" and input[pointer + 1] == "/": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + /* "w3lib/_url.pyx":960 + * elif c == ":": + * url.scheme = buffer.lower() + * buffer = "" # <<<<<<<<<<<<<< + * if url.scheme == "file": + * state = FILE */ - goto __pyx_L16; - } + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":556 - * pointer -= 1 - * - * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< - * if c == "/": - * state = AUTHORITY + /* "w3lib/_url.pyx":961 + * url.scheme = buffer.lower() + * buffer = "" + * if url.scheme == "file": # <<<<<<<<<<<<<< + * state = FILE + * elif url.is_special: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_OR_AUTHORITY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 556, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 961, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":557 - * - * elif state == PATH_OR_AUTHORITY: - * if c == "/": # <<<<<<<<<<<<<< - * state = AUTHORITY - * else: + /* "w3lib/_url.pyx":962 + * buffer = "" + * if url.scheme == "file": + * state = FILE # <<<<<<<<<<<<<< + * elif url.is_special: + * if base is not None and base.scheme == url.scheme: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 557, __pyx_L1_error) - if (__pyx_t_1) { + __pyx_v_state = __pyx_v_5w3lib_4_url_FILE; - /* "w3lib/_url.pyx":558 - * elif state == PATH_OR_AUTHORITY: - * if c == "/": - * state = AUTHORITY # <<<<<<<<<<<<<< - * else: - * state = PATH + /* "w3lib/_url.pyx":961 + * url.scheme = buffer.lower() + * buffer = "" + * if url.scheme == "file": # <<<<<<<<<<<<<< + * state = FILE + * elif url.is_special: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); - __pyx_t_4 = 0; + goto __pyx_L23; + } - /* "w3lib/_url.pyx":557 - * - * elif state == PATH_OR_AUTHORITY: - * if c == "/": # <<<<<<<<<<<<<< - * state = AUTHORITY - * else: + /* "w3lib/_url.pyx":963 + * if url.scheme == "file": + * state = FILE + * elif url.is_special: # <<<<<<<<<<<<<< + * if base is not None and base.scheme == url.scheme: + * state = SPECIAL_RELATIVE_OR_AUTHORITY */ - goto __pyx_L36; - } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 963, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 963, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":560 - * state = AUTHORITY - * else: - * state = PATH # <<<<<<<<<<<<<< - * pointer -= 1 - * + /* "w3lib/_url.pyx":964 + * state = FILE + * elif url.is_special: + * if base is not None and base.scheme == url.scheme: # <<<<<<<<<<<<<< + * state = SPECIAL_RELATIVE_OR_AUTHORITY + * else: */ - /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_11 = (__pyx_v_base != Py_None); + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L25_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 964, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 964, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 964, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 964, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __pyx_t_11; + __pyx_L25_bool_binop_done:; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":561 - * else: - * state = PATH - * pointer -= 1 # <<<<<<<<<<<<<< - * - * elif state == RELATIVE: + /* "w3lib/_url.pyx":965 + * elif url.is_special: + * if base is not None and base.scheme == url.scheme: + * state = SPECIAL_RELATIVE_OR_AUTHORITY # <<<<<<<<<<<<<< + * else: + * state = SPECIAL_AUTHORITY_SLASHES */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; - } - __pyx_L36:; + __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_RELATIVE_OR_AUTHORITY; - /* "w3lib/_url.pyx":556 - * pointer -= 1 - * - * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< - * if c == "/": - * state = AUTHORITY + /* "w3lib/_url.pyx":964 + * state = FILE + * elif url.is_special: + * if base is not None and base.scheme == url.scheme: # <<<<<<<<<<<<<< + * state = SPECIAL_RELATIVE_OR_AUTHORITY + * else: */ - goto __pyx_L16; - } + goto __pyx_L24; + } - /* "w3lib/_url.pyx":563 - * pointer -= 1 - * - * elif state == RELATIVE: # <<<<<<<<<<<<<< - * assert isinstance(base, _URL) - * url.scheme = base.scheme + /* "w3lib/_url.pyx":967 + * state = SPECIAL_RELATIVE_OR_AUTHORITY + * else: + * state = SPECIAL_AUTHORITY_SLASHES # <<<<<<<<<<<<<< + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": + * state = PATH_OR_AUTHORITY */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RELATIVE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 563, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { + /*else*/ { + __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES; + } + __pyx_L24:; - /* "w3lib/_url.pyx":564 - * - * elif state == RELATIVE: - * assert isinstance(base, _URL) # <<<<<<<<<<<<<< - * url.scheme = base.scheme - * if c == "/" or url.is_special and c == "\\": + /* "w3lib/_url.pyx":963 + * if url.scheme == "file": + * state = FILE + * elif url.is_special: # <<<<<<<<<<<<<< + * if base is not None and base.scheme == url.scheme: + * state = SPECIAL_RELATIVE_OR_AUTHORITY */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_URL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_IsInstance(__pyx_v_base, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 564, __pyx_L1_error) + goto __pyx_L23; + } + + /* "w3lib/_url.pyx":968 + * else: + * state = SPECIAL_AUTHORITY_SLASHES + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * state = PATH_OR_AUTHORITY + * pointer += 1 + */ + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__pyx_v_input == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 968, __pyx_L1_error) + } + __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 968, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 564, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L27_bool_binop_done; } - } - #else - if ((1)); else __PYX_ERR(0, 564, __pyx_L1_error) - #endif + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 968, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_11; + __pyx_L27_bool_binop_done:; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":565 - * elif state == RELATIVE: - * assert isinstance(base, _URL) - * url.scheme = base.scheme # <<<<<<<<<<<<<< - * if c == "/" or url.is_special and c == "\\": - * state = RELATIVE_SLASH + /* "w3lib/_url.pyx":969 + * state = SPECIAL_AUTHORITY_SLASHES + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": + * state = PATH_OR_AUTHORITY # <<<<<<<<<<<<<< + * pointer += 1 + * else: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 565, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY; - /* "w3lib/_url.pyx":566 - * assert isinstance(base, _URL) - * url.scheme = base.scheme - * if c == "/" or url.is_special and c == "\\": # <<<<<<<<<<<<<< - * state = RELATIVE_SLASH - * else: + /* "w3lib/_url.pyx":970 + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": + * state = PATH_OR_AUTHORITY + * pointer += 1 # <<<<<<<<<<<<<< + * else: + * url.path = "" */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 566, __pyx_L1_error) - if (!__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L38_bool_binop_done; - } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L38_bool_binop_done; - } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 566, __pyx_L1_error) - __pyx_t_1 = __pyx_t_11; - __pyx_L38_bool_binop_done:; - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 970, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":567 - * url.scheme = base.scheme - * if c == "/" or url.is_special and c == "\\": - * state = RELATIVE_SLASH # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":968 + * else: + * state = SPECIAL_AUTHORITY_SLASHES + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * state = PATH_OR_AUTHORITY + * pointer += 1 + */ + goto __pyx_L23; + } + + /* "w3lib/_url.pyx":972 + * pointer += 1 + * else: + * url.path = "" # <<<<<<<<<<<<<< + * state = OPAQUE_PATH * else: - * url.username = base.username */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RELATIVE_SLASH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; + /*else*/ { + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_kp_u__2) < 0) __PYX_ERR(0, 972, __pyx_L1_error) - /* "w3lib/_url.pyx":566 - * assert isinstance(base, _URL) - * url.scheme = base.scheme - * if c == "/" or url.is_special and c == "\\": # <<<<<<<<<<<<<< - * state = RELATIVE_SLASH + /* "w3lib/_url.pyx":973 + * else: + * url.path = "" + * state = OPAQUE_PATH # <<<<<<<<<<<<<< * else: + * buffer = "" */ - goto __pyx_L37; + __pyx_v_state = __pyx_v_5w3lib_4_url_OPAQUE_PATH; + } + __pyx_L23:; + + /* "w3lib/_url.pyx":958 + * assert isinstance(c, str) + * buffer += c + * elif c == ":": # <<<<<<<<<<<<<< + * url.scheme = buffer.lower() + * buffer = "" + */ + goto __pyx_L20; } - /* "w3lib/_url.pyx":569 - * state = RELATIVE_SLASH + /* "w3lib/_url.pyx":975 + * state = OPAQUE_PATH * else: - * url.username = base.username # <<<<<<<<<<<<<< - * url.password = base.password - * url.hostname = base.hostname + * buffer = "" # <<<<<<<<<<<<<< + * state = NO_SCHEME + * pointer = -1 */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_3) < 0) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":570 + /* "w3lib/_url.pyx":976 * else: - * url.username = base.username - * url.password = base.password # <<<<<<<<<<<<<< - * url.hostname = base.hostname - * url.port = base.port + * buffer = "" + * state = NO_SCHEME # <<<<<<<<<<<<<< + * pointer = -1 + * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_3) < 0) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_NO_SCHEME; - /* "w3lib/_url.pyx":571 - * url.username = base.username - * url.password = base.password - * url.hostname = base.hostname # <<<<<<<<<<<<<< - * url.port = base.port - * url.path = base.path + /* "w3lib/_url.pyx":977 + * buffer = "" + * state = NO_SCHEME + * pointer = -1 # <<<<<<<<<<<<<< + * + * elif state == NO_SCHEME: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_3) < 0) __PYX_ERR(0, 571, __pyx_L1_error) + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_int_neg_1); + } + __pyx_L20:; + + /* "w3lib/_url.pyx":954 + * pointer -= 1 + * + * elif state == SCHEME: # <<<<<<<<<<<<<< + * if c is not None and c in _SCHEME_CHARS: + * assert isinstance(c, str) + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":979 + * pointer = -1 + * + * elif state == NO_SCHEME: # <<<<<<<<<<<<<< + * if base is None: + * raise ValueError + */ + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_NO_SCHEME); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":980 + * + * elif state == NO_SCHEME: + * if base is None: # <<<<<<<<<<<<<< + * raise ValueError + * if base.has_opaque_path(): + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + if (unlikely(__pyx_t_1)) { + + /* "w3lib/_url.pyx":981 + * elif state == NO_SCHEME: + * if base is None: + * raise ValueError # <<<<<<<<<<<<<< + * if base.has_opaque_path(): + * if c != "#": + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 981, __pyx_L1_error) + + /* "w3lib/_url.pyx":980 + * + * elif state == NO_SCHEME: + * if base is None: # <<<<<<<<<<<<<< + * raise ValueError + * if base.has_opaque_path(): + */ + } + + /* "w3lib/_url.pyx":982 + * if base is None: + * raise ValueError + * if base.has_opaque_path(): # <<<<<<<<<<<<<< + * if c != "#": + * raise ValueError + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 982, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":572 - * url.password = base.password - * url.hostname = base.hostname - * url.port = base.port # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":983 + * raise ValueError + * if base.has_opaque_path(): + * if c != "#": # <<<<<<<<<<<<<< + * raise ValueError + * url.scheme = base.scheme + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 983, __pyx_L1_error) + if (unlikely(__pyx_t_1)) { + + /* "w3lib/_url.pyx":984 + * if base.has_opaque_path(): + * if c != "#": + * raise ValueError # <<<<<<<<<<<<<< + * url.scheme = base.scheme + * url.path = base.path + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 984, __pyx_L1_error) + + /* "w3lib/_url.pyx":983 + * raise ValueError + * if base.has_opaque_path(): + * if c != "#": # <<<<<<<<<<<<<< + * raise ValueError + * url.scheme = base.scheme + */ + } + + /* "w3lib/_url.pyx":985 + * if c != "#": + * raise ValueError + * url.scheme = base.scheme # <<<<<<<<<<<<<< * url.path = base.path * url.query = base.query */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_3) < 0) __PYX_ERR(0, 572, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_4) < 0) __PYX_ERR(0, 985, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":573 - * url.hostname = base.hostname - * url.port = base.port + /* "w3lib/_url.pyx":986 + * raise ValueError + * url.scheme = base.scheme * url.path = base.path # <<<<<<<<<<<<<< * url.query = base.query - * if c == "?": + * url.fragment = "" */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_3) < 0) __PYX_ERR(0, 573, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_4) < 0) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":574 - * url.port = base.port + /* "w3lib/_url.pyx":987 + * url.scheme = base.scheme * url.path = base.path * url.query = base.query # <<<<<<<<<<<<<< - * if c == "?": - * url.query = "" + * url.fragment = "" + * state = FRAGMENT */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_3) < 0) __PYX_ERR(0, 574, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_4) < 0) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":575 + /* "w3lib/_url.pyx":988 * url.path = base.path * url.query = base.query - * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 575, __pyx_L1_error) - if (__pyx_t_1) { + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 988, __pyx_L1_error) - /* "w3lib/_url.pyx":576 + /* "w3lib/_url.pyx":989 * url.query = base.query - * if c == "?": - * url.query = "" # <<<<<<<<<<<<<< - * state = QUERY - * elif c == "#": - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 576, __pyx_L1_error) - - /* "w3lib/_url.pyx":577 - * if c == "?": - * url.query = "" - * state = QUERY # <<<<<<<<<<<<<< - * elif c == "#": - * url.fragment = "" + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * else: + * if base.scheme != "file": */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":575 - * url.path = base.path - * url.query = base.query - * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY + /* "w3lib/_url.pyx":982 + * if base is None: + * raise ValueError + * if base.has_opaque_path(): # <<<<<<<<<<<<<< + * if c != "#": + * raise ValueError */ - goto __pyx_L41; - } + goto __pyx_L30; + } - /* "w3lib/_url.pyx":578 - * url.query = "" - * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":991 + * state = FRAGMENT + * else: + * if base.scheme != "file": # <<<<<<<<<<<<<< + * state = RELATIVE + * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 578, __pyx_L1_error) + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 991, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_file, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 991, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":579 - * state = QUERY - * elif c == "#": - * url.fragment = "" # <<<<<<<<<<<<<< - * state = FRAGMENT - * elif pointer < input_length: + /* "w3lib/_url.pyx":992 + * else: + * if base.scheme != "file": + * state = RELATIVE # <<<<<<<<<<<<<< + * else: + * state = FILE */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_v_state = __pyx_v_5w3lib_4_url_RELATIVE; - /* "w3lib/_url.pyx":580 - * elif c == "#": - * url.fragment = "" - * state = FRAGMENT # <<<<<<<<<<<<<< - * elif pointer < input_length: - * url.query = None + /* "w3lib/_url.pyx":991 + * state = FRAGMENT + * else: + * if base.scheme != "file": # <<<<<<<<<<<<<< + * state = RELATIVE + * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; + goto __pyx_L32; + } - /* "w3lib/_url.pyx":578 - * url.query = "" - * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":994 + * state = RELATIVE + * else: + * state = FILE # <<<<<<<<<<<<<< + * pointer -= 1 + * */ - goto __pyx_L41; + /*else*/ { + __pyx_v_state = __pyx_v_5w3lib_4_url_FILE; } + __pyx_L32:; - /* "w3lib/_url.pyx":581 - * url.fragment = "" - * state = FRAGMENT - * elif pointer < input_length: # <<<<<<<<<<<<<< - * url.query = None - * _shorten_path(url) + /* "w3lib/_url.pyx":995 + * else: + * state = FILE + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L30:; - /* "w3lib/_url.pyx":582 - * state = FRAGMENT - * elif pointer < input_length: - * url.query = None # <<<<<<<<<<<<<< - * _shorten_path(url) - * state = PATH + /* "w3lib/_url.pyx":979 + * pointer = -1 + * + * elif state == NO_SCHEME: # <<<<<<<<<<<<<< + * if base is None: + * raise ValueError */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 582, __pyx_L1_error) + goto __pyx_L16; + } - /* "w3lib/_url.pyx":583 - * elif pointer < input_length: - * url.query = None - * _shorten_path(url) # <<<<<<<<<<<<<< - * state = PATH - * pointer -= 1 - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_url}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":584 - * url.query = None - * _shorten_path(url) - * state = PATH # <<<<<<<<<<<<<< - * pointer -= 1 - * - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":585 - * _shorten_path(url) - * state = PATH - * pointer -= 1 # <<<<<<<<<<<<<< - * - * elif state == RELATIVE_SLASH: - */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":581 - * url.fragment = "" - * state = FRAGMENT - * elif pointer < input_length: # <<<<<<<<<<<<<< - * url.query = None - * _shorten_path(url) - */ - } - __pyx_L41:; - } - __pyx_L37:; - - /* "w3lib/_url.pyx":563 + /* "w3lib/_url.pyx":997 * pointer -= 1 * - * elif state == RELATIVE: # <<<<<<<<<<<<<< - * assert isinstance(base, _URL) - * url.scheme = base.scheme - */ - goto __pyx_L16; - } - - /* "w3lib/_url.pyx":587 - * pointer -= 1 - * - * elif state == RELATIVE_SLASH: # <<<<<<<<<<<<<< - * assert isinstance(base, _URL) - * if url.is_special and c is not None and c in "/\\": + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RELATIVE_SLASH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_RELATIVE_OR_AUTHORITY); if (__pyx_t_1) { - /* "w3lib/_url.pyx":588 + /* "w3lib/_url.pyx":998 * - * elif state == RELATIVE_SLASH: - * assert isinstance(base, _URL) # <<<<<<<<<<<<<< - * if url.is_special and c is not None and c in "/\\": - * assert isinstance(c, str) - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_URL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_IsInstance(__pyx_v_base, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 588, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 588, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":589 - * elif state == RELATIVE_SLASH: - * assert isinstance(base, _URL) - * if url.is_special and c is not None and c in "/\\": # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: + * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer += 1 */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L43_bool_binop_done; - } - __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 998, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; - goto __pyx_L43_bool_binop_done; + goto __pyx_L34_bool_binop_done; } - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_11; - __pyx_L43_bool_binop_done:; + __pyx_L34_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":590 - * assert isinstance(base, _URL) - * if url.is_special and c is not None and c in "/\\": - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * elif c == "/": + /* "w3lib/_url.pyx":999 + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< + * pointer += 1 + * else: */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 590, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 590, __pyx_L1_error) - #endif + __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":591 - * if url.is_special and c is not None and c in "/\\": - * assert isinstance(c, str) - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< - * elif c == "/": - * state = AUTHORITY + /* "w3lib/_url.pyx":1000 + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer += 1 # <<<<<<<<<<<<<< + * else: + * state = RELATIVE */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":589 - * elif state == RELATIVE_SLASH: - * assert isinstance(base, _URL) - * if url.is_special and c is not None and c in "/\\": # <<<<<<<<<<<<<< - * assert isinstance(c, str) + /* "w3lib/_url.pyx":998 + * + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: + * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer += 1 */ - goto __pyx_L42; + goto __pyx_L33; } - /* "w3lib/_url.pyx":592 - * assert isinstance(c, str) - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * elif c == "/": # <<<<<<<<<<<<<< - * state = AUTHORITY + /* "w3lib/_url.pyx":1002 + * pointer += 1 * else: + * state = RELATIVE # <<<<<<<<<<<<<< + * pointer -= 1 + * */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 592, __pyx_L1_error) - if (__pyx_t_1) { + /*else*/ { + __pyx_v_state = __pyx_v_5w3lib_4_url_RELATIVE; - /* "w3lib/_url.pyx":593 - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * elif c == "/": - * state = AUTHORITY # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1003 * else: - * url.username = base.username + * state = RELATIVE + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == PATH_OR_AUTHORITY: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L33:; - /* "w3lib/_url.pyx":592 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":997 + * pointer -= 1 + * + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< + * if c == "/" and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * elif c == "/": # <<<<<<<<<<<<<< - * state = AUTHORITY - * else: */ - goto __pyx_L42; - } + goto __pyx_L16; + } - /* "w3lib/_url.pyx":595 + /* "w3lib/_url.pyx":1005 + * pointer -= 1 + * + * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< + * if c == "/": * state = AUTHORITY - * else: - * url.username = base.username # <<<<<<<<<<<<<< - * url.password = base.password - * url.hostname = base.hostname */ - /*else*/ { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_3) < 0) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":596 + /* "w3lib/_url.pyx":1006 + * + * elif state == PATH_OR_AUTHORITY: + * if c == "/": # <<<<<<<<<<<<<< + * state = AUTHORITY * else: - * url.username = base.username - * url.password = base.password # <<<<<<<<<<<<<< - * url.hostname = base.hostname - * url.port = base.port */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_3) < 0) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1006, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":597 - * url.username = base.username - * url.password = base.password - * url.hostname = base.hostname # <<<<<<<<<<<<<< - * url.port = base.port + /* "w3lib/_url.pyx":1007 + * elif state == PATH_OR_AUTHORITY: + * if c == "/": + * state = AUTHORITY # <<<<<<<<<<<<<< + * else: * state = PATH */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_3) < 0) __PYX_ERR(0, 597, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_AUTHORITY; - /* "w3lib/_url.pyx":598 - * url.password = base.password - * url.hostname = base.hostname - * url.port = base.port # <<<<<<<<<<<<<< - * state = PATH - * pointer -= 1 + /* "w3lib/_url.pyx":1006 + * + * elif state == PATH_OR_AUTHORITY: + * if c == "/": # <<<<<<<<<<<<<< + * state = AUTHORITY + * else: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_3) < 0) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L36; + } - /* "w3lib/_url.pyx":599 - * url.hostname = base.hostname - * url.port = base.port + /* "w3lib/_url.pyx":1009 + * state = AUTHORITY + * else: * state = PATH # <<<<<<<<<<<<<< * pointer -= 1 * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; + /*else*/ { + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":600 - * url.port = base.port + /* "w3lib/_url.pyx":1010 + * else: * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * - * elif state == SPECIAL_AUTHORITY_SLASHES: + * elif state == RELATIVE: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; } - __pyx_L42:; + __pyx_L36:; - /* "w3lib/_url.pyx":587 - * pointer -= 1 + /* "w3lib/_url.pyx":1005 + * pointer -= 1 * - * elif state == RELATIVE_SLASH: # <<<<<<<<<<<<<< - * assert isinstance(base, _URL) - * if url.is_special and c is not None and c in "/\\": + * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< + * if c == "/": + * state = AUTHORITY */ goto __pyx_L16; } - /* "w3lib/_url.pyx":602 + /* "w3lib/_url.pyx":1012 * pointer -= 1 * - * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< - * if c == "/" and input[pointer + 1] == "/": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * elif state == RELATIVE: # <<<<<<<<<<<<<< + * assert isinstance(base, _URL) + * url.scheme = base.scheme */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_RELATIVE); if (__pyx_t_1) { - /* "w3lib/_url.pyx":603 + /* "w3lib/_url.pyx":1013 * - * elif state == SPECIAL_AUTHORITY_SLASHES: - * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * pointer += 1 + * elif state == RELATIVE: + * assert isinstance(base, _URL) # <<<<<<<<<<<<<< + * url.scheme = base.scheme + * if c == "/" or url.is_special and c == "\\": */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) - if (__pyx_t_11) { + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_URL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_IsInstance(__pyx_v_base, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1013, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 1013, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 1013, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":1014 + * elif state == RELATIVE: + * assert isinstance(base, _URL) + * url.scheme = base.scheme # <<<<<<<<<<<<<< + * if c == "/" or url.is_special and c == "\\": + * state = RELATIVE_SLASH + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 1014, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":1015 + * assert isinstance(base, _URL) + * url.scheme = base.scheme + * if c == "/" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * state = RELATIVE_SLASH + * else: + */ + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1015, __pyx_L1_error) + if (!__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; - goto __pyx_L47_bool_binop_done; + goto __pyx_L38_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1015, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L38_bool_binop_done; + } + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1015, __pyx_L1_error) __pyx_t_1 = __pyx_t_11; - __pyx_L47_bool_binop_done:; + __pyx_L38_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":604 - * elif state == SPECIAL_AUTHORITY_SLASHES: - * if c == "/" and input[pointer + 1] == "/": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< - * pointer += 1 + /* "w3lib/_url.pyx":1016 + * url.scheme = base.scheme + * if c == "/" or url.is_special and c == "\\": + * state = RELATIVE_SLASH # <<<<<<<<<<<<<< * else: + * url.username = base.username */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_RELATIVE_SLASH; - /* "w3lib/_url.pyx":605 - * if c == "/" and input[pointer + 1] == "/": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * pointer += 1 # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1015 + * assert isinstance(base, _URL) + * url.scheme = base.scheme + * if c == "/" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * state = RELATIVE_SLASH * else: - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":603 - * - * elif state == SPECIAL_AUTHORITY_SLASHES: - * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * pointer += 1 */ - goto __pyx_L46; + goto __pyx_L37; } - /* "w3lib/_url.pyx":607 - * pointer += 1 + /* "w3lib/_url.pyx":1018 + * state = RELATIVE_SLASH * else: - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< - * pointer -= 1 - * + * url.username = base.username # <<<<<<<<<<<<<< + * url.password = base.password + * url.hostname = base.hostname */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_3) < 0) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":608 + /* "w3lib/_url.pyx":1019 * else: - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * pointer -= 1 # <<<<<<<<<<<<<< - * - * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: + * url.username = base.username + * url.password = base.password # <<<<<<<<<<<<<< + * url.hostname = base.hostname + * url.port = base.port */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; - } - __pyx_L46:; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_3) < 0) __PYX_ERR(0, 1019, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":602 - * pointer -= 1 - * - * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< - * if c == "/" and input[pointer + 1] == "/": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + /* "w3lib/_url.pyx":1020 + * url.username = base.username + * url.password = base.password + * url.hostname = base.hostname # <<<<<<<<<<<<<< + * url.port = base.port + * url.path = base.path */ - goto __pyx_L16; - } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_3) < 0) __PYX_ERR(0, 1020, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":610 - * pointer -= 1 - * - * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< - * if c is None or c not in "/\\": - * state = AUTHORITY + /* "w3lib/_url.pyx":1021 + * url.password = base.password + * url.hostname = base.hostname + * url.port = base.port # <<<<<<<<<<<<<< + * url.path = base.path + * url.query = base.query */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_3) < 0) __PYX_ERR(0, 1021, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":611 - * - * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: - * if c is None or c not in "/\\": # <<<<<<<<<<<<<< - * state = AUTHORITY - * pointer -= 1 + /* "w3lib/_url.pyx":1022 + * url.hostname = base.hostname + * url.port = base.port + * url.path = base.path # <<<<<<<<<<<<<< + * url.query = base.query + * if c == "?": */ - __pyx_t_11 = (__pyx_v_c == ((PyObject*)Py_None)); - if (!__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L50_bool_binop_done; - } - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 611, __pyx_L1_error) - __pyx_t_1 = __pyx_t_11; - __pyx_L50_bool_binop_done:; - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1022, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_3) < 0) __PYX_ERR(0, 1022, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":612 - * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: - * if c is None or c not in "/\\": - * state = AUTHORITY # <<<<<<<<<<<<<< - * pointer -= 1 - * + /* "w3lib/_url.pyx":1023 + * url.port = base.port + * url.path = base.path + * url.query = base.query # <<<<<<<<<<<<<< + * if c == "?": + * url.query = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1023, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_3) < 0) __PYX_ERR(0, 1023, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":613 - * if c is None or c not in "/\\": - * state = AUTHORITY - * pointer -= 1 # <<<<<<<<<<<<<< - * - * elif state == AUTHORITY: + /* "w3lib/_url.pyx":1024 + * url.path = base.path + * url.query = base.query + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1024, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":611 - * - * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: - * if c is None or c not in "/\\": # <<<<<<<<<<<<<< - * state = AUTHORITY - * pointer -= 1 + /* "w3lib/_url.pyx":1025 + * url.query = base.query + * if c == "?": + * url.query = "" # <<<<<<<<<<<<<< + * state = QUERY + * elif c == "#": */ - } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1025, __pyx_L1_error) - /* "w3lib/_url.pyx":610 - * pointer -= 1 - * - * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< - * if c is None or c not in "/\\": - * state = AUTHORITY + /* "w3lib/_url.pyx":1026 + * if c == "?": + * url.query = "" + * state = QUERY # <<<<<<<<<<<<<< + * elif c == "#": + * url.fragment = "" */ - goto __pyx_L16; - } + __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":615 - * pointer -= 1 - * - * elif state == AUTHORITY: # <<<<<<<<<<<<<< - * if not skip_authority_shortcut: - * at_sign_index = input.find("@", pointer) + /* "w3lib/_url.pyx":1024 + * url.path = base.path + * url.query = base.query + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AUTHORITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { + goto __pyx_L41; + } - /* "w3lib/_url.pyx":616 - * - * elif state == AUTHORITY: - * if not skip_authority_shortcut: # <<<<<<<<<<<<<< - * at_sign_index = input.find("@", pointer) - * if at_sign_index == -1: + /* "w3lib/_url.pyx":1027 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT */ - __pyx_t_1 = (!__pyx_v_skip_authority_shortcut); - if (__pyx_t_1) { + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1027, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":617 - * elif state == AUTHORITY: - * if not skip_authority_shortcut: - * at_sign_index = input.find("@", pointer) # <<<<<<<<<<<<<< - * if at_sign_index == -1: - * state = HOST + /* "w3lib/_url.pyx":1028 + * state = QUERY + * elif c == "#": + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * elif pointer < input_length: */ - if (unlikely(__pyx_v_input == Py_None)) { - PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "find"); - __PYX_ERR(0, 617, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1028, __pyx_L1_error) + + /* "w3lib/_url.pyx":1029 + * elif c == "#": + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * elif pointer < input_length: + * url.query = None + */ + __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; + + /* "w3lib/_url.pyx":1027 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + goto __pyx_L41; } - __pyx_t_7 = (__Pyx_Py_IsNone(__pyx_v_pointer) ? (0) : (__Pyx_PyIndex_AsSsize_t(__pyx_v_pointer))); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 617, __pyx_L1_error) - __pyx_t_12 = PyUnicode_Find(__pyx_v_input, __pyx_kp_u__16, __pyx_t_7, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-2))) __PYX_ERR(0, 617, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_at_sign_index, __pyx_t_3); - __pyx_t_3 = 0; - /* "w3lib/_url.pyx":618 - * if not skip_authority_shortcut: - * at_sign_index = input.find("@", pointer) - * if at_sign_index == -1: # <<<<<<<<<<<<<< - * state = HOST - * else: + /* "w3lib/_url.pyx":1030 + * url.fragment = "" + * state = FRAGMENT + * elif pointer < input_length: # <<<<<<<<<<<<<< + * url.query = None + * _shorten_path(url) */ - __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_at_sign_index, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 618, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1030, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1030, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1030, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":619 - * at_sign_index = input.find("@", pointer) - * if at_sign_index == -1: - * state = HOST # <<<<<<<<<<<<<< - * else: - * skip_authority_shortcut = True + /* "w3lib/_url.pyx":1031 + * state = FRAGMENT + * elif pointer < input_length: + * url.query = None # <<<<<<<<<<<<<< + * _shorten_path(url) + * state = PATH + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 1031, __pyx_L1_error) + + /* "w3lib/_url.pyx":1032 + * elif pointer < input_length: + * url.query = None + * _shorten_path(url) # <<<<<<<<<<<<<< + * state = PATH + * pointer -= 1 */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_HOST); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_url}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":618 - * if not skip_authority_shortcut: - * at_sign_index = input.find("@", pointer) - * if at_sign_index == -1: # <<<<<<<<<<<<<< - * state = HOST - * else: + /* "w3lib/_url.pyx":1033 + * url.query = None + * _shorten_path(url) + * state = PATH # <<<<<<<<<<<<<< + * pointer -= 1 + * + */ + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; + + /* "w3lib/_url.pyx":1034 + * _shorten_path(url) + * state = PATH + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == RELATIVE_SLASH: + */ + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1034, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":1030 + * url.fragment = "" + * state = FRAGMENT + * elif pointer < input_length: # <<<<<<<<<<<<<< + * url.query = None + * _shorten_path(url) */ - goto __pyx_L53; } + __pyx_L41:; + } + __pyx_L37:; - /* "w3lib/_url.pyx":621 - * state = HOST - * else: - * skip_authority_shortcut = True # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1012 * pointer -= 1 - * elif c == "@": + * + * elif state == RELATIVE: # <<<<<<<<<<<<<< + * assert isinstance(base, _URL) + * url.scheme = base.scheme */ - /*else*/ { - __pyx_v_skip_authority_shortcut = 1; - } - __pyx_L53:; + goto __pyx_L16; + } - /* "w3lib/_url.pyx":622 - * else: - * skip_authority_shortcut = True - * pointer -= 1 # <<<<<<<<<<<<<< - * elif c == "@": - * if at_sign_seen: + /* "w3lib/_url.pyx":1036 + * pointer -= 1 + * + * elif state == RELATIVE_SLASH: # <<<<<<<<<<<<<< + * assert isinstance(base, _URL) + * if url.is_special and c is not None and c in "/\\": */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_RELATIVE_SLASH); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":616 + /* "w3lib/_url.pyx":1037 * - * elif state == AUTHORITY: - * if not skip_authority_shortcut: # <<<<<<<<<<<<<< - * at_sign_index = input.find("@", pointer) - * if at_sign_index == -1: + * elif state == RELATIVE_SLASH: + * assert isinstance(base, _URL) # <<<<<<<<<<<<<< + * if url.is_special and c is not None and c in "/\\": + * assert isinstance(c, str) */ - goto __pyx_L52; + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_URL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_IsInstance(__pyx_v_base, __pyx_t_4); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1037, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 1037, __pyx_L1_error) + } } + #else + if ((1)); else __PYX_ERR(0, 1037, __pyx_L1_error) + #endif - /* "w3lib/_url.pyx":623 - * skip_authority_shortcut = True - * pointer -= 1 - * elif c == "@": # <<<<<<<<<<<<<< - * if at_sign_seen: - * buffer = "%40" + buffer + /* "w3lib/_url.pyx":1038 + * elif state == RELATIVE_SLASH: + * assert isinstance(base, _URL) + * if url.is_special and c is not None and c in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1038, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L43_bool_binop_done; + } + __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L43_bool_binop_done; + } + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1038, __pyx_L1_error) + __pyx_t_1 = __pyx_t_11; + __pyx_L43_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":624 - * pointer -= 1 - * elif c == "@": - * if at_sign_seen: # <<<<<<<<<<<<<< - * buffer = "%40" + buffer - * at_sign_seen = True + /* "w3lib/_url.pyx":1039 + * assert isinstance(base, _URL) + * if url.is_special and c is not None and c in "/\\": + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * elif c == "/": */ - if (__pyx_v_at_sign_seen) { + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 1039, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 1039, __pyx_L1_error) + #endif - /* "w3lib/_url.pyx":625 - * elif c == "@": - * if at_sign_seen: - * buffer = "%40" + buffer # <<<<<<<<<<<<<< - * at_sign_seen = True - * for i, code_point in enumerate(buffer): + /* "w3lib/_url.pyx":1040 + * if url.is_special and c is not None and c in "/\\": + * assert isinstance(c, str) + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< + * elif c == "/": + * state = AUTHORITY */ - __pyx_t_3 = PyNumber_Add(__pyx_kp_u_40, __pyx_v_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":624 - * pointer -= 1 - * elif c == "@": - * if at_sign_seen: # <<<<<<<<<<<<<< - * buffer = "%40" + buffer - * at_sign_seen = True + /* "w3lib/_url.pyx":1038 + * elif state == RELATIVE_SLASH: + * assert isinstance(base, _URL) + * if url.is_special and c is not None and c in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - } + goto __pyx_L42; + } - /* "w3lib/_url.pyx":626 - * if at_sign_seen: - * buffer = "%40" + buffer - * at_sign_seen = True # <<<<<<<<<<<<<< - * for i, code_point in enumerate(buffer): - * if code_point == ":" and not url._password_token_seen: + /* "w3lib/_url.pyx":1041 + * assert isinstance(c, str) + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * elif c == "/": # <<<<<<<<<<<<<< + * state = AUTHORITY + * else: */ - __pyx_v_at_sign_seen = 1; + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1041, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":627 - * buffer = "%40" + buffer - * at_sign_seen = True - * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< - * if code_point == ":" and not url._password_token_seen: - * url._password_token_seen = True + /* "w3lib/_url.pyx":1042 + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * elif c == "/": + * state = AUTHORITY # <<<<<<<<<<<<<< + * else: + * url.username = base.username */ - __Pyx_INCREF(__pyx_int_0); - __pyx_t_3 = __pyx_int_0; - if (likely(PyList_CheckExact(__pyx_v_buffer)) || PyTuple_CheckExact(__pyx_v_buffer)) { - __pyx_t_4 = __pyx_v_buffer; __Pyx_INCREF(__pyx_t_4); - __pyx_t_12 = 0; - __pyx_t_13 = NULL; - } else { - __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 627, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 627, __pyx_L1_error) - #endif - if (__pyx_t_12 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 627, __pyx_L1_error) - #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 627, __pyx_L1_error) - #endif - if (__pyx_t_12 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 627, __pyx_L1_error) - #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - #endif - } - } else { - __pyx_t_5 = __pyx_t_13(__pyx_t_4); - if (unlikely(!__pyx_t_5)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 627, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_5); - } - __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); - __pyx_t_3 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_AUTHORITY; - /* "w3lib/_url.pyx":628 - * at_sign_seen = True - * for i, code_point in enumerate(buffer): - * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< - * url._password_token_seen = True - * continue + /* "w3lib/_url.pyx":1041 + * assert isinstance(c, str) + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * elif c == "/": # <<<<<<<<<<<<<< + * state = AUTHORITY + * else: */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 628, __pyx_L1_error) - if (__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L58_bool_binop_done; - } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 628, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_14 = (!__pyx_t_11); - __pyx_t_1 = __pyx_t_14; - __pyx_L58_bool_binop_done:; - if (__pyx_t_1) { + goto __pyx_L42; + } - /* "w3lib/_url.pyx":629 - * for i, code_point in enumerate(buffer): - * if code_point == ":" and not url._password_token_seen: - * url._password_token_seen = True # <<<<<<<<<<<<<< - * continue - * encoded_code_points = _idempotent_utf_8_percent_encode( + /* "w3lib/_url.pyx":1044 + * state = AUTHORITY + * else: + * url.username = base.username # <<<<<<<<<<<<<< + * url.password = base.password + * url.hostname = base.hostname */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen, Py_True) < 0) __PYX_ERR(0, 629, __pyx_L1_error) + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_4) < 0) __PYX_ERR(0, 1044, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":630 - * if code_point == ":" and not url._password_token_seen: - * url._password_token_seen = True - * continue # <<<<<<<<<<<<<< - * encoded_code_points = _idempotent_utf_8_percent_encode( - * input=buffer, + /* "w3lib/_url.pyx":1045 + * else: + * url.username = base.username + * url.password = base.password # <<<<<<<<<<<<<< + * url.hostname = base.hostname + * url.port = base.port */ - goto __pyx_L55_continue; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1045, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_4) < 0) __PYX_ERR(0, 1045, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":628 - * at_sign_seen = True - * for i, code_point in enumerate(buffer): - * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< - * url._password_token_seen = True - * continue + /* "w3lib/_url.pyx":1046 + * url.username = base.username + * url.password = base.password + * url.hostname = base.hostname # <<<<<<<<<<<<<< + * url.port = base.port + * state = PATH */ - } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1046, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 1046, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":631 - * url._password_token_seen = True - * continue - * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< - * input=buffer, - * pointer=i, + /* "w3lib/_url.pyx":1047 + * url.password = base.password + * url.hostname = base.hostname + * url.port = base.port # <<<<<<<<<<<<<< + * state = PATH + * pointer -= 1 */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_4) < 0) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":632 - * continue - * encoded_code_points = _idempotent_utf_8_percent_encode( - * input=buffer, # <<<<<<<<<<<<<< - * pointer=i, - * encode_set=userinfo_percent_encode_set, + /* "w3lib/_url.pyx":1048 + * url.hostname = base.hostname + * url.port = base.port + * state = PATH # <<<<<<<<<<<<<< + * pointer -= 1 + * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_buffer) < 0) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":633 - * encoded_code_points = _idempotent_utf_8_percent_encode( - * input=buffer, - * pointer=i, # <<<<<<<<<<<<<< - * encode_set=userinfo_percent_encode_set, - * ) + /* "w3lib/_url.pyx":1049 + * url.port = base.port + * state = PATH + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == SPECIAL_AUTHORITY_SLASHES: */ - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_i) < 0) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L42:; - /* "w3lib/_url.pyx":634 - * input=buffer, - * pointer=i, - * encode_set=userinfo_percent_encode_set, # <<<<<<<<<<<<<< - * ) - * if url._password_token_seen: + /* "w3lib/_url.pyx":1036 + * pointer -= 1 + * + * elif state == RELATIVE_SLASH: # <<<<<<<<<<<<<< + * assert isinstance(base, _URL) + * if url.is_special and c is not None and c in "/\\": */ - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 632, __pyx_L1_error) + goto __pyx_L16; + } - /* "w3lib/_url.pyx":631 - * url._password_token_seen = True - * continue - * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< - * input=buffer, - * pointer=i, + /* "w3lib/_url.pyx":1051 + * pointer -= 1 + * + * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_encoded_code_points, __pyx_t_15); - __pyx_t_15 = 0; + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":636 - * encode_set=userinfo_percent_encode_set, - * ) - * if url._password_token_seen: # <<<<<<<<<<<<<< - * url.password += encoded_code_points - * else: + /* "w3lib/_url.pyx":1052 + * + * elif state == SPECIAL_AUTHORITY_SLASHES: + * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer += 1 */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 636, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (__pyx_t_1) { + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1052, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L47_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_11; + __pyx_L47_bool_binop_done:; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":637 - * ) - * if url._password_token_seen: - * url.password += encoded_code_points # <<<<<<<<<<<<<< - * else: - * url.username += encoded_code_points + /* "w3lib/_url.pyx":1053 + * elif state == SPECIAL_AUTHORITY_SLASHES: + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< + * pointer += 1 + * else: */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_15, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_2) < 0) __PYX_ERR(0, 637, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":636 - * encode_set=userinfo_percent_encode_set, - * ) - * if url._password_token_seen: # <<<<<<<<<<<<<< - * url.password += encoded_code_points - * else: + /* "w3lib/_url.pyx":1054 + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer += 1 # <<<<<<<<<<<<<< + * else: + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - goto __pyx_L60; - } + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1054, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":639 - * url.password += encoded_code_points - * else: - * url.username += encoded_code_points # <<<<<<<<<<<<<< - * buffer = "" - * elif c is None or c in "/?#" or url.is_special and c == "\\": + /* "w3lib/_url.pyx":1052 + * + * elif state == SPECIAL_AUTHORITY_SLASHES: + * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer += 1 */ - /*else*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_15) < 0) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } - __pyx_L60:; + goto __pyx_L46; + } - /* "w3lib/_url.pyx":627 - * buffer = "%40" + buffer - * at_sign_seen = True - * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< - * if code_point == ":" and not url._password_token_seen: - * url._password_token_seen = True + /* "w3lib/_url.pyx":1056 + * pointer += 1 + * else: + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< + * pointer -= 1 + * */ - __pyx_L55_continue:; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /*else*/ { + __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":640 - * else: - * url.username += encoded_code_points - * buffer = "" # <<<<<<<<<<<<<< - * elif c is None or c in "/?#" or url.is_special and c == "\\": - * if at_sign_seen and not buffer: + /* "w3lib/_url.pyx":1057 + * else: + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L46:; - /* "w3lib/_url.pyx":623 - * skip_authority_shortcut = True + /* "w3lib/_url.pyx":1051 * pointer -= 1 - * elif c == "@": # <<<<<<<<<<<<<< - * if at_sign_seen: - * buffer = "%40" + buffer + * + * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< + * if c == "/" and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - goto __pyx_L52; - } + goto __pyx_L16; + } - /* "w3lib/_url.pyx":641 - * url.username += encoded_code_points - * buffer = "" - * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< - * if at_sign_seen and not buffer: - * raise ValueError + /* "w3lib/_url.pyx":1059 + * pointer -= 1 + * + * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< + * if c is None or c not in "/\\": + * state = AUTHORITY */ - __pyx_t_14 = (__pyx_v_c == ((PyObject*)Py_None)); - if (!__pyx_t_14) { - } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L62_bool_binop_done; - } - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 641, __pyx_L1_error) - if (!__pyx_t_14) { - } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L62_bool_binop_done; - } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 641, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_14) { - } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L62_bool_binop_done; - } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 641, __pyx_L1_error) - __pyx_t_1 = __pyx_t_14; - __pyx_L62_bool_binop_done:; - if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":642 - * buffer = "" - * elif c is None or c in "/?#" or url.is_special and c == "\\": - * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< - * raise ValueError - * pointer -= len(buffer) + 1 + /* "w3lib/_url.pyx":1060 + * + * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: + * if c is None or c not in "/\\": # <<<<<<<<<<<<<< + * state = AUTHORITY + * pointer -= 1 */ - if (__pyx_v_at_sign_seen) { - } else { - __pyx_t_1 = __pyx_v_at_sign_seen; - goto __pyx_L67_bool_binop_done; - } - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 642, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_14); + __pyx_t_11 = (__pyx_v_c == ((PyObject*)Py_None)); + if (!__pyx_t_11) { + } else { __pyx_t_1 = __pyx_t_11; - __pyx_L67_bool_binop_done:; - if (unlikely(__pyx_t_1)) { - - /* "w3lib/_url.pyx":643 - * elif c is None or c in "/?#" or url.is_special and c == "\\": - * if at_sign_seen and not buffer: - * raise ValueError # <<<<<<<<<<<<<< - * pointer -= len(buffer) + 1 - * buffer = "" - */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 643, __pyx_L1_error) + goto __pyx_L50_bool_binop_done; + } + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1060, __pyx_L1_error) + __pyx_t_1 = __pyx_t_11; + __pyx_L50_bool_binop_done:; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":642 - * buffer = "" - * elif c is None or c in "/?#" or url.is_special and c == "\\": - * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< - * raise ValueError - * pointer -= len(buffer) + 1 + /* "w3lib/_url.pyx":1061 + * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: + * if c is None or c not in "/\\": + * state = AUTHORITY # <<<<<<<<<<<<<< + * pointer -= 1 + * */ - } + __pyx_v_state = __pyx_v_5w3lib_4_url_AUTHORITY; - /* "w3lib/_url.pyx":644 - * if at_sign_seen and not buffer: - * raise ValueError - * pointer -= len(buffer) + 1 # <<<<<<<<<<<<<< - * buffer = "" - * state = HOST + /* "w3lib/_url.pyx":1062 + * if c is None or c not in "/\\": + * state = AUTHORITY + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == AUTHORITY: */ - __pyx_t_12 = PyObject_Length(__pyx_v_buffer); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 644, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_12 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":645 - * raise ValueError - * pointer -= len(buffer) + 1 - * buffer = "" # <<<<<<<<<<<<<< - * state = HOST - * else: - */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - - /* "w3lib/_url.pyx":646 - * pointer -= len(buffer) + 1 - * buffer = "" - * state = HOST # <<<<<<<<<<<<<< - * else: - * buffer += c - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_HOST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":641 - * url.username += encoded_code_points - * buffer = "" - * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< - * if at_sign_seen and not buffer: - * raise ValueError - */ - goto __pyx_L52; - } + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":648 - * state = HOST - * else: - * buffer += c # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1060 * - * elif state == HOST: + * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: + * if c is None or c not in "/\\": # <<<<<<<<<<<<<< + * state = AUTHORITY + * pointer -= 1 */ - /*else*/ { - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); - __pyx_t_4 = 0; } - __pyx_L52:; - /* "w3lib/_url.pyx":615 + /* "w3lib/_url.pyx":1059 * pointer -= 1 * - * elif state == AUTHORITY: # <<<<<<<<<<<<<< - * if not skip_authority_shortcut: - * at_sign_index = input.find("@", pointer) + * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< + * if c is None or c not in "/\\": + * state = AUTHORITY */ goto __pyx_L16; } - /* "w3lib/_url.pyx":650 - * buffer += c + /* "w3lib/_url.pyx":1064 + * pointer -= 1 * - * elif state == HOST: # <<<<<<<<<<<<<< - * if c == ":" and not inside_brackets: - * if not buffer: + * elif state == AUTHORITY: # <<<<<<<<<<<<<< + * if not skip_authority_shortcut: + * at_sign_index = input.find("@", pointer) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_HOST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 650, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 650, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_AUTHORITY); if (__pyx_t_1) { - /* "w3lib/_url.pyx":651 + /* "w3lib/_url.pyx":1065 * - * elif state == HOST: - * if c == ":" and not inside_brackets: # <<<<<<<<<<<<<< - * if not buffer: - * raise ValueError + * elif state == AUTHORITY: + * if not skip_authority_shortcut: # <<<<<<<<<<<<<< + * at_sign_index = input.find("@", pointer) + * if at_sign_index == -1: */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 651, __pyx_L1_error) - if (__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L70_bool_binop_done; - } - __pyx_t_11 = (!__pyx_v_inside_brackets); - __pyx_t_1 = __pyx_t_11; - __pyx_L70_bool_binop_done:; + __pyx_t_1 = (!__pyx_v_skip_authority_shortcut); if (__pyx_t_1) { - /* "w3lib/_url.pyx":652 - * elif state == HOST: - * if c == ":" and not inside_brackets: - * if not buffer: # <<<<<<<<<<<<<< - * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) + /* "w3lib/_url.pyx":1066 + * elif state == AUTHORITY: + * if not skip_authority_shortcut: + * at_sign_index = input.find("@", pointer) # <<<<<<<<<<<<<< + * if at_sign_index == -1: + * state = HOST */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 652, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_1); - if (unlikely(__pyx_t_11)) { + if (unlikely(__pyx_v_input == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "find"); + __PYX_ERR(0, 1066, __pyx_L1_error) + } + __pyx_t_7 = (__Pyx_Py_IsNone(__pyx_v_pointer) ? (0) : (__Pyx_PyIndex_AsSsize_t(__pyx_v_pointer))); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_12 = PyUnicode_Find(__pyx_v_input, __pyx_kp_u__16, __pyx_t_7, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-2))) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_at_sign_index, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":653 - * if c == ":" and not inside_brackets: - * if not buffer: - * raise ValueError # <<<<<<<<<<<<<< - * host = _parse_host(buffer, is_special=url.is_special) - * url.hostname = host + /* "w3lib/_url.pyx":1067 + * if not skip_authority_shortcut: + * at_sign_index = input.find("@", pointer) + * if at_sign_index == -1: # <<<<<<<<<<<<<< + * state = HOST + * else: */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 653, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_at_sign_index, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":652 - * elif state == HOST: - * if c == ":" and not inside_brackets: - * if not buffer: # <<<<<<<<<<<<<< - * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) + /* "w3lib/_url.pyx":1068 + * at_sign_index = input.find("@", pointer) + * if at_sign_index == -1: + * state = HOST # <<<<<<<<<<<<<< + * else: + * skip_authority_shortcut = True */ - } + __pyx_v_state = __pyx_v_5w3lib_4_url_HOST; - /* "w3lib/_url.pyx":654 - * if not buffer: - * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< - * url.hostname = host - * buffer = "" + /* "w3lib/_url.pyx":1067 + * if not skip_authority_shortcut: + * at_sign_index = input.find("@", pointer) + * if at_sign_index == -1: # <<<<<<<<<<<<<< + * state = HOST + * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_buffer); - __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_buffer)) __PYX_ERR(0, 654, __pyx_L1_error); - __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_is_special, __pyx_t_2) < 0) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_2); - __pyx_t_2 = 0; - - /* "w3lib/_url.pyx":655 - * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) - * url.hostname = host # <<<<<<<<<<<<<< - * buffer = "" - * state = PORT - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 655, __pyx_L1_error) - - /* "w3lib/_url.pyx":656 - * host = _parse_host(buffer, is_special=url.is_special) - * url.hostname = host - * buffer = "" # <<<<<<<<<<<<<< - * state = PORT - * url._port_token_seen = True - */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + goto __pyx_L53; + } - /* "w3lib/_url.pyx":657 - * url.hostname = host - * buffer = "" - * state = PORT # <<<<<<<<<<<<<< - * url._port_token_seen = True - * elif c is None or c in "/?#" or url.is_special and c == "\\": + /* "w3lib/_url.pyx":1070 + * state = HOST + * else: + * skip_authority_shortcut = True # <<<<<<<<<<<<<< + * pointer -= 1 + * elif c == "@": */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); - __pyx_t_2 = 0; + /*else*/ { + __pyx_v_skip_authority_shortcut = 1; + } + __pyx_L53:; - /* "w3lib/_url.pyx":658 - * buffer = "" - * state = PORT - * url._port_token_seen = True # <<<<<<<<<<<<<< - * elif c is None or c in "/?#" or url.is_special and c == "\\": - * pointer -= 1 + /* "w3lib/_url.pyx":1071 + * else: + * skip_authority_shortcut = True + * pointer -= 1 # <<<<<<<<<<<<<< + * elif c == "@": + * if at_sign_seen: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen, Py_True) < 0) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":651 + /* "w3lib/_url.pyx":1065 * - * elif state == HOST: - * if c == ":" and not inside_brackets: # <<<<<<<<<<<<<< - * if not buffer: - * raise ValueError + * elif state == AUTHORITY: + * if not skip_authority_shortcut: # <<<<<<<<<<<<<< + * at_sign_index = input.find("@", pointer) + * if at_sign_index == -1: */ - goto __pyx_L69; + goto __pyx_L52; } - /* "w3lib/_url.pyx":659 - * state = PORT - * url._port_token_seen = True - * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1072 + * skip_authority_shortcut = True * pointer -= 1 - * if url.is_special and not buffer: + * elif c == "@": # <<<<<<<<<<<<<< + * if at_sign_seen: + * buffer = "%40" + buffer */ - __pyx_t_1 = (__pyx_v_c == ((PyObject*)Py_None)); - if (!__pyx_t_1) { - } else { - __pyx_t_11 = __pyx_t_1; - goto __pyx_L73_bool_binop_done; - } - __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 659, __pyx_L1_error) - if (!__pyx_t_1) { - } else { - __pyx_t_11 = __pyx_t_1; - goto __pyx_L73_bool_binop_done; - } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 659, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1072, __pyx_L1_error) if (__pyx_t_1) { - } else { - __pyx_t_11 = __pyx_t_1; - goto __pyx_L73_bool_binop_done; - } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 659, __pyx_L1_error) - __pyx_t_11 = __pyx_t_1; - __pyx_L73_bool_binop_done:; - if (__pyx_t_11) { - - /* "w3lib/_url.pyx":660 - * url._port_token_seen = True - * elif c is None or c in "/?#" or url.is_special and c == "\\": - * pointer -= 1 # <<<<<<<<<<<<<< - * if url.is_special and not buffer: - * raise ValueError - */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); - __pyx_t_2 = 0; - /* "w3lib/_url.pyx":661 - * elif c is None or c in "/?#" or url.is_special and c == "\\": + /* "w3lib/_url.pyx":1073 * pointer -= 1 - * if url.is_special and not buffer: # <<<<<<<<<<<<<< - * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) + * elif c == "@": + * if at_sign_seen: # <<<<<<<<<<<<<< + * buffer = "%40" + buffer + * at_sign_seen = True */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 661, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_1) { - } else { - __pyx_t_11 = __pyx_t_1; - goto __pyx_L78_bool_binop_done; - } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 661, __pyx_L1_error) - __pyx_t_14 = (!__pyx_t_1); - __pyx_t_11 = __pyx_t_14; - __pyx_L78_bool_binop_done:; - if (unlikely(__pyx_t_11)) { + if (__pyx_v_at_sign_seen) { - /* "w3lib/_url.pyx":662 - * pointer -= 1 - * if url.is_special and not buffer: - * raise ValueError # <<<<<<<<<<<<<< - * host = _parse_host(buffer, is_special=url.is_special) - * url.hostname = host + /* "w3lib/_url.pyx":1074 + * elif c == "@": + * if at_sign_seen: + * buffer = "%40" + buffer # <<<<<<<<<<<<<< + * at_sign_seen = True + * for i, code_point in enumerate(buffer): */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_kp_u_40, __pyx_v_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":661 - * elif c is None or c in "/?#" or url.is_special and c == "\\": + /* "w3lib/_url.pyx":1073 * pointer -= 1 - * if url.is_special and not buffer: # <<<<<<<<<<<<<< - * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) + * elif c == "@": + * if at_sign_seen: # <<<<<<<<<<<<<< + * buffer = "%40" + buffer + * at_sign_seen = True */ } - /* "w3lib/_url.pyx":663 - * if url.is_special and not buffer: - * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< - * url.hostname = host - * buffer = "" + /* "w3lib/_url.pyx":1075 + * if at_sign_seen: + * buffer = "%40" + buffer + * at_sign_seen = True # <<<<<<<<<<<<<< + * for i, code_point in enumerate(buffer): + * if code_point == ":" and not url._password_token_seen: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_INCREF(__pyx_v_buffer); - __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_buffer)) __PYX_ERR(0, 663, __pyx_L1_error); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_is_special, __pyx_t_3) < 0) __PYX_ERR(0, 663, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_15, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_v_at_sign_seen = 1; - /* "w3lib/_url.pyx":664 - * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) - * url.hostname = host # <<<<<<<<<<<<<< - * buffer = "" - * state = PATH_START + /* "w3lib/_url.pyx":1076 + * buffer = "%40" + buffer + * at_sign_seen = True + * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< + * if code_point == ":" and not url._password_token_seen: + * url._password_token_seen = True */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; + if (likely(PyList_CheckExact(__pyx_v_buffer)) || PyTuple_CheckExact(__pyx_v_buffer)) { + __pyx_t_4 = __pyx_v_buffer; __Pyx_INCREF(__pyx_t_4); + __pyx_t_12 = 0; + __pyx_t_13 = NULL; + } else { + __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1076, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_13)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1076, __pyx_L1_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1076, __pyx_L1_error) + #else + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1076, __pyx_L1_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1076, __pyx_L1_error) + #else + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_13(__pyx_t_4); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1076, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_5; + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":665 - * host = _parse_host(buffer, is_special=url.is_special) - * url.hostname = host - * buffer = "" # <<<<<<<<<<<<<< - * state = PATH_START - * else: + /* "w3lib/_url.pyx":1077 + * at_sign_seen = True + * for i, code_point in enumerate(buffer): + * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< + * url._password_token_seen = True + * continue */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - - /* "w3lib/_url.pyx":666 - * url.hostname = host - * buffer = "" - * state = PATH_START # <<<<<<<<<<<<<< - * else: - * if c == "[": - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1077, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L58_bool_binop_done; + } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1077, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_14 = (!__pyx_t_11); + __pyx_t_1 = __pyx_t_14; + __pyx_L58_bool_binop_done:; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":659 - * state = PORT - * url._port_token_seen = True - * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< - * pointer -= 1 - * if url.is_special and not buffer: + /* "w3lib/_url.pyx":1078 + * for i, code_point in enumerate(buffer): + * if code_point == ":" and not url._password_token_seen: + * url._password_token_seen = True # <<<<<<<<<<<<<< + * continue + * encoded_code_points = _idempotent_utf_8_percent_encode( */ - goto __pyx_L69; - } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen, Py_True) < 0) __PYX_ERR(0, 1078, __pyx_L1_error) - /* "w3lib/_url.pyx":668 - * state = PATH_START - * else: - * if c == "[": # <<<<<<<<<<<<<< - * inside_brackets = True - * elif c == "]": + /* "w3lib/_url.pyx":1079 + * if code_point == ":" and not url._password_token_seen: + * url._password_token_seen = True + * continue # <<<<<<<<<<<<<< + * encoded_code_points = _idempotent_utf_8_percent_encode( + * input=buffer, */ - /*else*/ { - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) - if (__pyx_t_11) { + goto __pyx_L55_continue; - /* "w3lib/_url.pyx":669 - * else: - * if c == "[": - * inside_brackets = True # <<<<<<<<<<<<<< - * elif c == "]": - * inside_brackets = False + /* "w3lib/_url.pyx":1077 + * at_sign_seen = True + * for i, code_point in enumerate(buffer): + * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< + * url._password_token_seen = True + * continue */ - __pyx_v_inside_brackets = 1; + } - /* "w3lib/_url.pyx":668 - * state = PATH_START - * else: - * if c == "[": # <<<<<<<<<<<<<< - * inside_brackets = True - * elif c == "]": + /* "w3lib/_url.pyx":1080 + * url._password_token_seen = True + * continue + * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * input=buffer, + * pointer=i, */ - goto __pyx_L80; - } + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); - /* "w3lib/_url.pyx":670 - * if c == "[": - * inside_brackets = True - * elif c == "]": # <<<<<<<<<<<<<< - * inside_brackets = False - * buffer += c + /* "w3lib/_url.pyx":1081 + * continue + * encoded_code_points = _idempotent_utf_8_percent_encode( + * input=buffer, # <<<<<<<<<<<<<< + * pointer=i, + * encode_set=userinfo_percent_encode_set, */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 670, __pyx_L1_error) - if (__pyx_t_11) { + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_buffer) < 0) __PYX_ERR(0, 1081, __pyx_L1_error) - /* "w3lib/_url.pyx":671 - * inside_brackets = True - * elif c == "]": - * inside_brackets = False # <<<<<<<<<<<<<< - * buffer += c - * + /* "w3lib/_url.pyx":1082 + * encoded_code_points = _idempotent_utf_8_percent_encode( + * input=buffer, + * pointer=i, # <<<<<<<<<<<<<< + * encode_set=userinfo_percent_encode_set, + * ) */ - __pyx_v_inside_brackets = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_i) < 0) __PYX_ERR(0, 1081, __pyx_L1_error) - /* "w3lib/_url.pyx":670 - * if c == "[": - * inside_brackets = True - * elif c == "]": # <<<<<<<<<<<<<< - * inside_brackets = False - * buffer += c + /* "w3lib/_url.pyx":1083 + * input=buffer, + * pointer=i, + * encode_set=userinfo_percent_encode_set, # <<<<<<<<<<<<<< + * ) + * if url._password_token_seen: */ - } - __pyx_L80:; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 1081, __pyx_L1_error) - /* "w3lib/_url.pyx":672 - * elif c == "]": - * inside_brackets = False - * buffer += c # <<<<<<<<<<<<<< - * - * elif state == PORT: + /* "w3lib/_url.pyx":1080 + * url._password_token_seen = True + * continue + * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * input=buffer, + * pointer=i, */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); - __pyx_t_3 = 0; - } - __pyx_L69:; + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_encoded_code_points, __pyx_t_15); + __pyx_t_15 = 0; - /* "w3lib/_url.pyx":650 - * buffer += c - * - * elif state == HOST: # <<<<<<<<<<<<<< - * if c == ":" and not inside_brackets: - * if not buffer: + /* "w3lib/_url.pyx":1085 + * encode_set=userinfo_percent_encode_set, + * ) + * if url._password_token_seen: # <<<<<<<<<<<<<< + * url.password += encoded_code_points + * else: */ - goto __pyx_L16; - } + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1085, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1085, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":674 - * buffer += c - * - * elif state == PORT: # <<<<<<<<<<<<<< - * if c is not None and c in _ASCII_DIGIT: - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1086 + * ) + * if url._password_token_seen: + * url.password += encoded_code_points # <<<<<<<<<<<<<< + * else: + * url.username += encoded_code_points */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 674, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_11) { + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_15, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_2) < 0) __PYX_ERR(0, 1086, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":675 - * - * elif state == PORT: - * if c is not None and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * buffer += c + /* "w3lib/_url.pyx":1085 + * encode_set=userinfo_percent_encode_set, + * ) + * if url._password_token_seen: # <<<<<<<<<<<<<< + * url.password += encoded_code_points + * else: */ - __pyx_t_14 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_14) { - } else { - __pyx_t_11 = __pyx_t_14; - goto __pyx_L82_bool_binop_done; - } - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __pyx_t_14; - __pyx_L82_bool_binop_done:; - if (__pyx_t_11) { + goto __pyx_L60; + } - /* "w3lib/_url.pyx":676 - * elif state == PORT: - * if c is not None and c in _ASCII_DIGIT: - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * buffer += c + /* "w3lib/_url.pyx":1088 + * url.password += encoded_code_points + * else: + * url.username += encoded_code_points # <<<<<<<<<<<<<< + * buffer = "" * elif c is None or c in "/?#" or url.is_special and c == "\\": */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_11 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_11)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 676, __pyx_L1_error) + /*else*/ { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_15) < 0) __PYX_ERR(0, 1088, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } + __pyx_L60:; + + /* "w3lib/_url.pyx":1076 + * buffer = "%40" + buffer + * at_sign_seen = True + * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< + * if code_point == ":" and not url._password_token_seen: + * url._password_token_seen = True + */ + __pyx_L55_continue:; } - #else - if ((1)); else __PYX_ERR(0, 676, __pyx_L1_error) - #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":677 - * if c is not None and c in _ASCII_DIGIT: - * assert isinstance(c, str) - * buffer += c # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1089 + * else: + * url.username += encoded_code_points + * buffer = "" # <<<<<<<<<<<<<< * elif c is None or c in "/?#" or url.is_special and c == "\\": - * if buffer: + * if at_sign_seen and not buffer: */ - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":675 - * - * elif state == PORT: - * if c is not None and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * buffer += c + /* "w3lib/_url.pyx":1072 + * skip_authority_shortcut = True + * pointer -= 1 + * elif c == "@": # <<<<<<<<<<<<<< + * if at_sign_seen: + * buffer = "%40" + buffer */ - goto __pyx_L81; + goto __pyx_L52; } - /* "w3lib/_url.pyx":678 - * assert isinstance(c, str) - * buffer += c + /* "w3lib/_url.pyx":1090 + * url.username += encoded_code_points + * buffer = "" * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< - * if buffer: - * port = int(buffer) + * if at_sign_seen and not buffer: + * raise ValueError */ __pyx_t_14 = (__pyx_v_c == ((PyObject*)Py_None)); if (!__pyx_t_14) { } else { - __pyx_t_11 = __pyx_t_14; - goto __pyx_L84_bool_binop_done; + __pyx_t_1 = __pyx_t_14; + goto __pyx_L62_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 678, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1090, __pyx_L1_error) if (!__pyx_t_14) { } else { - __pyx_t_11 = __pyx_t_14; - goto __pyx_L84_bool_binop_done; + __pyx_t_1 = __pyx_t_14; + goto __pyx_L62_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 678, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1090, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_14) { } else { - __pyx_t_11 = __pyx_t_14; - goto __pyx_L84_bool_binop_done; + __pyx_t_1 = __pyx_t_14; + goto __pyx_L62_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 678, __pyx_L1_error) - __pyx_t_11 = __pyx_t_14; - __pyx_L84_bool_binop_done:; - if (likely(__pyx_t_11)) { + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1090, __pyx_L1_error) + __pyx_t_1 = __pyx_t_14; + __pyx_L62_bool_binop_done:; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":679 - * buffer += c + /* "w3lib/_url.pyx":1091 + * buffer = "" * elif c is None or c in "/?#" or url.is_special and c == "\\": - * if buffer: # <<<<<<<<<<<<<< - * port = int(buffer) - * if port > 2**16 - 1: + * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< + * raise ValueError + * pointer -= len(buffer) + 1 */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) - if (__pyx_t_11) { + if (__pyx_v_at_sign_seen) { + } else { + __pyx_t_1 = __pyx_v_at_sign_seen; + goto __pyx_L67_bool_binop_done; + } + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1091, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_14); + __pyx_t_1 = __pyx_t_11; + __pyx_L67_bool_binop_done:; + if (unlikely(__pyx_t_1)) { - /* "w3lib/_url.pyx":680 + /* "w3lib/_url.pyx":1092 * elif c is None or c in "/?#" or url.is_special and c == "\\": - * if buffer: - * port = int(buffer) # <<<<<<<<<<<<<< - * if port > 2**16 - 1: - * raise ValueError - */ - __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_port, __pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":681 - * if buffer: - * port = int(buffer) - * if port > 2**16 - 1: # <<<<<<<<<<<<<< - * raise ValueError - * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port - */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_port, __pyx_int_65535, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 681, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(__pyx_t_11)) { - - /* "w3lib/_url.pyx":682 - * port = int(buffer) - * if port > 2**16 - 1: - * raise ValueError # <<<<<<<<<<<<<< - * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port - * url._default_port_seen = url.port is None - */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 682, __pyx_L1_error) - - /* "w3lib/_url.pyx":681 - * if buffer: - * port = int(buffer) - * if port > 2**16 - 1: # <<<<<<<<<<<<<< - * raise ValueError - * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port - */ - } - - /* "w3lib/_url.pyx":683 - * if port > 2**16 - 1: - * raise ValueError - * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port # <<<<<<<<<<<<<< - * url._default_port_seen = url.port is None - * buffer = "" - */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_15}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_port, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_11) { - __Pyx_INCREF(Py_None); - __pyx_t_4 = Py_None; - } else { - __Pyx_INCREF(__pyx_v_port); - __pyx_t_4 = __pyx_v_port; - } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_4) < 0) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":684 - * raise ValueError - * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port - * url._default_port_seen = url.port is None # <<<<<<<<<<<<<< - * buffer = "" - * state = PATH_START - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = (__pyx_t_4 == Py_None); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen, __pyx_t_4) < 0) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":685 - * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port - * url._default_port_seen = url.port is None - * buffer = "" # <<<<<<<<<<<<<< - * state = PATH_START - * pointer -= 1 + * if at_sign_seen and not buffer: + * raise ValueError # <<<<<<<<<<<<<< + * pointer -= len(buffer) + 1 + * buffer = "" */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 1092, __pyx_L1_error) - /* "w3lib/_url.pyx":679 - * buffer += c + /* "w3lib/_url.pyx":1091 + * buffer = "" * elif c is None or c in "/?#" or url.is_special and c == "\\": - * if buffer: # <<<<<<<<<<<<<< - * port = int(buffer) - * if port > 2**16 - 1: + * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< + * raise ValueError + * pointer -= len(buffer) + 1 */ } - /* "w3lib/_url.pyx":686 - * url._default_port_seen = url.port is None - * buffer = "" - * state = PATH_START # <<<<<<<<<<<<<< - * pointer -= 1 - * else: + /* "w3lib/_url.pyx":1093 + * if at_sign_seen and not buffer: + * raise ValueError + * pointer -= len(buffer) + 1 # <<<<<<<<<<<<<< + * buffer = "" + * state = HOST */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error) + __pyx_t_12 = PyObject_Length(__pyx_v_buffer); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1093, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_12 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1093, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":687 - * buffer = "" - * state = PATH_START - * pointer -= 1 # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1094 + * raise ValueError + * pointer -= len(buffer) + 1 + * buffer = "" # <<<<<<<<<<<<<< + * state = HOST * else: - * raise ValueError */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":678 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1095 + * pointer -= len(buffer) + 1 + * buffer = "" + * state = HOST # <<<<<<<<<<<<<< + * else: * buffer += c + */ + __pyx_v_state = __pyx_v_5w3lib_4_url_HOST; + + /* "w3lib/_url.pyx":1090 + * url.username += encoded_code_points + * buffer = "" * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< - * if buffer: - * port = int(buffer) + * if at_sign_seen and not buffer: + * raise ValueError */ - goto __pyx_L81; + goto __pyx_L52; } - /* "w3lib/_url.pyx":689 - * pointer -= 1 + /* "w3lib/_url.pyx":1097 + * state = HOST * else: - * raise ValueError # <<<<<<<<<<<<<< + * buffer += c # <<<<<<<<<<<<<< * - * elif state == FILE: + * elif state == HOST: */ /*else*/ { - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1097, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); + __pyx_t_4 = 0; } - __pyx_L81:; + __pyx_L52:; - /* "w3lib/_url.pyx":674 - * buffer += c + /* "w3lib/_url.pyx":1064 + * pointer -= 1 * - * elif state == PORT: # <<<<<<<<<<<<<< - * if c is not None and c in _ASCII_DIGIT: - * assert isinstance(c, str) + * elif state == AUTHORITY: # <<<<<<<<<<<<<< + * if not skip_authority_shortcut: + * at_sign_index = input.find("@", pointer) */ goto __pyx_L16; } - /* "w3lib/_url.pyx":691 - * raise ValueError + /* "w3lib/_url.pyx":1099 + * buffer += c * - * elif state == FILE: # <<<<<<<<<<<<<< - * url.scheme = "file" - * url.hostname = "" + * elif state == HOST: # <<<<<<<<<<<<<< + * if c == ":" and not inside_brackets: + * if not buffer: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FILE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_11) { + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_HOST); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":692 + /* "w3lib/_url.pyx":1100 * - * elif state == FILE: - * url.scheme = "file" # <<<<<<<<<<<<<< - * url.hostname = "" - * if c is not None and c in "/\\": + * elif state == HOST: + * if c == ":" and not inside_brackets: # <<<<<<<<<<<<<< + * if not buffer: + * raise ValueError */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_n_u_file) < 0) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1100, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L70_bool_binop_done; + } + __pyx_t_11 = (!__pyx_v_inside_brackets); + __pyx_t_1 = __pyx_t_11; + __pyx_L70_bool_binop_done:; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":693 - * elif state == FILE: - * url.scheme = "file" - * url.hostname = "" # <<<<<<<<<<<<<< - * if c is not None and c in "/\\": - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1101 + * elif state == HOST: + * if c == ":" and not inside_brackets: + * if not buffer: # <<<<<<<<<<<<<< + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1101, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_1); + if (unlikely(__pyx_t_11)) { - /* "w3lib/_url.pyx":694 - * url.scheme = "file" - * url.hostname = "" - * if c is not None and c in "/\\": # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * state = FILE_SLASH + /* "w3lib/_url.pyx":1102 + * if c == ":" and not inside_brackets: + * if not buffer: + * raise ValueError # <<<<<<<<<<<<<< + * host = _parse_host(buffer, is_special=url.is_special) + * url.hostname = host */ - __pyx_t_14 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_14) { - } else { - __pyx_t_11 = __pyx_t_14; - goto __pyx_L91_bool_binop_done; - } - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 694, __pyx_L1_error) - __pyx_t_11 = __pyx_t_14; - __pyx_L91_bool_binop_done:; - if (__pyx_t_11) { + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 1102, __pyx_L1_error) - /* "w3lib/_url.pyx":695 - * url.hostname = "" - * if c is not None and c in "/\\": - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * state = FILE_SLASH - * elif base is not None and base.scheme == "file": + /* "w3lib/_url.pyx":1101 + * elif state == HOST: + * if c == ":" and not inside_brackets: + * if not buffer: # <<<<<<<<<<<<<< + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_11 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_11)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 695, __pyx_L1_error) - } } - #else - if ((1)); else __PYX_ERR(0, 695, __pyx_L1_error) - #endif - /* "w3lib/_url.pyx":696 - * if c is not None and c in "/\\": - * assert isinstance(c, str) - * state = FILE_SLASH # <<<<<<<<<<<<<< - * elif base is not None and base.scheme == "file": - * url.hostname = base.hostname + /* "w3lib/_url.pyx":1103 + * if not buffer: + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< + * url.hostname = host + * buffer = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FILE_SLASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_buffer); + __Pyx_GIVEREF(__pyx_v_buffer); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buffer)) __PYX_ERR(0, 1103, __pyx_L1_error); + __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_is_special, __pyx_t_2) < 0) __PYX_ERR(0, 1103, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":694 - * url.scheme = "file" - * url.hostname = "" - * if c is not None and c in "/\\": # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * state = FILE_SLASH + /* "w3lib/_url.pyx":1104 + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) + * url.hostname = host # <<<<<<<<<<<<<< + * buffer = "" + * state = PORT */ - goto __pyx_L90; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 1104, __pyx_L1_error) + + /* "w3lib/_url.pyx":1105 + * host = _parse_host(buffer, is_special=url.is_special) + * url.hostname = host + * buffer = "" # <<<<<<<<<<<<<< + * state = PORT + * url._port_token_seen = True + */ + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + + /* "w3lib/_url.pyx":1106 + * url.hostname = host + * buffer = "" + * state = PORT # <<<<<<<<<<<<<< + * url._port_token_seen = True + * elif c is None or c in "/?#" or url.is_special and c == "\\": + */ + __pyx_v_state = __pyx_v_5w3lib_4_url_PORT; + + /* "w3lib/_url.pyx":1107 + * buffer = "" + * state = PORT + * url._port_token_seen = True # <<<<<<<<<<<<<< + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * pointer -= 1 + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen, Py_True) < 0) __PYX_ERR(0, 1107, __pyx_L1_error) + + /* "w3lib/_url.pyx":1100 + * + * elif state == HOST: + * if c == ":" and not inside_brackets: # <<<<<<<<<<<<<< + * if not buffer: + * raise ValueError + */ + goto __pyx_L69; } - /* "w3lib/_url.pyx":697 - * assert isinstance(c, str) - * state = FILE_SLASH - * elif base is not None and base.scheme == "file": # <<<<<<<<<<<<<< - * url.hostname = base.hostname - * url.path = base.path + /* "w3lib/_url.pyx":1108 + * state = PORT + * url._port_token_seen = True + * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * pointer -= 1 + * if url.is_special and not buffer: */ - __pyx_t_14 = (__pyx_v_base != Py_None); - if (__pyx_t_14) { + __pyx_t_1 = (__pyx_v_c == ((PyObject*)Py_None)); + if (!__pyx_t_1) { } else { - __pyx_t_11 = __pyx_t_14; - goto __pyx_L93_bool_binop_done; + __pyx_t_11 = __pyx_t_1; + goto __pyx_L73_bool_binop_done; + } + __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) + if (!__pyx_t_1) { + } else { + __pyx_t_11 = __pyx_t_1; + goto __pyx_L73_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = __pyx_t_14; - __pyx_L93_bool_binop_done:; + if (__pyx_t_1) { + } else { + __pyx_t_11 = __pyx_t_1; + goto __pyx_L73_bool_binop_done; + } + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) + __pyx_t_11 = __pyx_t_1; + __pyx_L73_bool_binop_done:; if (__pyx_t_11) { - /* "w3lib/_url.pyx":698 - * state = FILE_SLASH - * elif base is not None and base.scheme == "file": - * url.hostname = base.hostname # <<<<<<<<<<<<<< - * url.path = base.path - * url.query = base.query + /* "w3lib/_url.pyx":1109 + * url._port_token_seen = True + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * pointer -= 1 # <<<<<<<<<<<<<< + * if url.is_special and not buffer: + * raise ValueError */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_2) < 0) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); + __pyx_t_2 = 0; - /* "w3lib/_url.pyx":699 - * elif base is not None and base.scheme == "file": - * url.hostname = base.hostname - * url.path = base.path # <<<<<<<<<<<<<< - * url.query = base.query - * if c == "?": + /* "w3lib/_url.pyx":1110 + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * pointer -= 1 + * if url.is_special and not buffer: # <<<<<<<<<<<<<< + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_2) < 0) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + } else { + __pyx_t_11 = __pyx_t_1; + goto __pyx_L78_bool_binop_done; + } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1110, __pyx_L1_error) + __pyx_t_14 = (!__pyx_t_1); + __pyx_t_11 = __pyx_t_14; + __pyx_L78_bool_binop_done:; + if (unlikely(__pyx_t_11)) { - /* "w3lib/_url.pyx":700 - * url.hostname = base.hostname - * url.path = base.path - * url.query = base.query # <<<<<<<<<<<<<< - * if c == "?": - * url.query = "" + /* "w3lib/_url.pyx":1111 + * pointer -= 1 + * if url.is_special and not buffer: + * raise ValueError # <<<<<<<<<<<<<< + * host = _parse_host(buffer, is_special=url.is_special) + * url.hostname = host + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 1111, __pyx_L1_error) + + /* "w3lib/_url.pyx":1110 + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * pointer -= 1 + * if url.is_special and not buffer: # <<<<<<<<<<<<<< + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) + */ + } + + /* "w3lib/_url.pyx":1112 + * if url.is_special and not buffer: + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< + * url.hostname = host + * buffer = "" */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_2) < 0) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_INCREF(__pyx_v_buffer); + __Pyx_GIVEREF(__pyx_v_buffer); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_buffer)) __PYX_ERR(0, 1112, __pyx_L1_error); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_special, __pyx_t_4) < 0) __PYX_ERR(0, 1112, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_15, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":701 - * url.path = base.path - * url.query = base.query - * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY + /* "w3lib/_url.pyx":1113 + * raise ValueError + * host = _parse_host(buffer, is_special=url.is_special) + * url.hostname = host # <<<<<<<<<<<<<< + * buffer = "" + * state = PATH_START */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 701, __pyx_L1_error) - if (__pyx_t_11) { + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 1113, __pyx_L1_error) - /* "w3lib/_url.pyx":702 - * url.query = base.query - * if c == "?": - * url.query = "" # <<<<<<<<<<<<<< - * state = QUERY - * elif c == "#": + /* "w3lib/_url.pyx":1114 + * host = _parse_host(buffer, is_special=url.is_special) + * url.hostname = host + * buffer = "" # <<<<<<<<<<<<<< + * state = PATH_START + * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 702, __pyx_L1_error) + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":703 - * if c == "?": - * url.query = "" - * state = QUERY # <<<<<<<<<<<<<< - * elif c == "#": - * url.fragment = "" + /* "w3lib/_url.pyx":1115 + * url.hostname = host + * buffer = "" + * state = PATH_START # <<<<<<<<<<<<<< + * else: + * if c == "[": */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":701 - * url.path = base.path - * url.query = base.query - * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY + /* "w3lib/_url.pyx":1108 + * state = PORT + * url._port_token_seen = True + * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * pointer -= 1 + * if url.is_special and not buffer: */ - goto __pyx_L95; - } + goto __pyx_L69; + } - /* "w3lib/_url.pyx":704 - * url.query = "" - * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":1117 + * state = PATH_START + * else: + * if c == "[": # <<<<<<<<<<<<<< + * inside_brackets = True + * elif c == "]": */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 704, __pyx_L1_error) + /*else*/ { + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1117, __pyx_L1_error) if (__pyx_t_11) { - /* "w3lib/_url.pyx":705 - * state = QUERY - * elif c == "#": - * url.fragment = "" # <<<<<<<<<<<<<< - * state = FRAGMENT - * elif c is not None: - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 705, __pyx_L1_error) - - /* "w3lib/_url.pyx":706 - * elif c == "#": - * url.fragment = "" - * state = FRAGMENT # <<<<<<<<<<<<<< - * elif c is not None: - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1118 + * else: + * if c == "[": + * inside_brackets = True # <<<<<<<<<<<<<< + * elif c == "]": + * inside_brackets = False */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_inside_brackets = 1; - /* "w3lib/_url.pyx":704 - * url.query = "" - * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":1117 + * state = PATH_START + * else: + * if c == "[": # <<<<<<<<<<<<<< + * inside_brackets = True + * elif c == "]": */ - goto __pyx_L95; + goto __pyx_L80; } - /* "w3lib/_url.pyx":707 - * url.fragment = "" - * state = FRAGMENT - * elif c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * url.query = None + /* "w3lib/_url.pyx":1119 + * if c == "[": + * inside_brackets = True + * elif c == "]": # <<<<<<<<<<<<<< + * inside_brackets = False + * buffer += c */ - __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1119, __pyx_L1_error) if (__pyx_t_11) { - /* "w3lib/_url.pyx":708 - * state = FRAGMENT - * elif c is not None: - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * url.query = None - * if not _starts_with_windows_drive_letter(input[pointer:]): - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_11 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_11)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 708, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 708, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":709 - * elif c is not None: - * assert isinstance(c, str) - * url.query = None # <<<<<<<<<<<<<< - * if not _starts_with_windows_drive_letter(input[pointer:]): - * _shorten_path(url) - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 709, __pyx_L1_error) - - /* "w3lib/_url.pyx":710 - * assert isinstance(c, str) - * url.query = None - * if not _starts_with_windows_drive_letter(input[pointer:]): # <<<<<<<<<<<<<< - * _shorten_path(url) - * else: - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (unlikely(__pyx_v_input == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 710, __pyx_L1_error) - } - __Pyx_INCREF(__pyx_v_pointer); - __pyx_t_3 = __pyx_v_pointer; - __pyx_t_11 = (__pyx_t_3 == Py_None); - if (__pyx_t_11) { - __pyx_t_12 = 0; - } else { - __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 710, __pyx_L1_error) - __pyx_t_12 = __pyx_t_7; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_12, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_15)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_15); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 710, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_14 = (!__pyx_t_11); - if (__pyx_t_14) { - - /* "w3lib/_url.pyx":711 - * url.query = None - * if not _starts_with_windows_drive_letter(input[pointer:]): - * _shorten_path(url) # <<<<<<<<<<<<<< - * else: - * url.path = [] - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_url}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "w3lib/_url.pyx":710 - * assert isinstance(c, str) - * url.query = None - * if not _starts_with_windows_drive_letter(input[pointer:]): # <<<<<<<<<<<<<< - * _shorten_path(url) - * else: - */ - goto __pyx_L96; - } - - /* "w3lib/_url.pyx":713 - * _shorten_path(url) - * else: - * url.path = [] # <<<<<<<<<<<<<< - * state = PATH - * pointer -= 1 - */ - /*else*/ { - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_2) < 0) __PYX_ERR(0, 713, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_L96:; - - /* "w3lib/_url.pyx":714 - * else: - * url.path = [] - * state = PATH # <<<<<<<<<<<<<< - * pointer -= 1 - * else: - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); - __pyx_t_2 = 0; - - /* "w3lib/_url.pyx":715 - * url.path = [] - * state = PATH - * pointer -= 1 # <<<<<<<<<<<<<< - * else: - * state = PATH + /* "w3lib/_url.pyx":1120 + * inside_brackets = True + * elif c == "]": + * inside_brackets = False # <<<<<<<<<<<<<< + * buffer += c + * */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_inside_brackets = 0; - /* "w3lib/_url.pyx":707 - * url.fragment = "" - * state = FRAGMENT - * elif c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * url.query = None + /* "w3lib/_url.pyx":1119 + * if c == "[": + * inside_brackets = True + * elif c == "]": # <<<<<<<<<<<<<< + * inside_brackets = False + * buffer += c */ } - __pyx_L95:; - - /* "w3lib/_url.pyx":697 - * assert isinstance(c, str) - * state = FILE_SLASH - * elif base is not None and base.scheme == "file": # <<<<<<<<<<<<<< - * url.hostname = base.hostname - * url.path = base.path - */ - goto __pyx_L90; - } - - /* "w3lib/_url.pyx":717 - * pointer -= 1 - * else: - * state = PATH # <<<<<<<<<<<<<< - * pointer -= 1 - * - */ - /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_L80:; - /* "w3lib/_url.pyx":718 - * else: - * state = PATH - * pointer -= 1 # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1121 + * elif c == "]": + * inside_brackets = False + * buffer += c # <<<<<<<<<<<<<< * - * elif state == FILE_SLASH: + * elif state == PORT: */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); + __pyx_t_4 = 0; } - __pyx_L90:; + __pyx_L69:; - /* "w3lib/_url.pyx":691 - * raise ValueError + /* "w3lib/_url.pyx":1099 + * buffer += c * - * elif state == FILE: # <<<<<<<<<<<<<< - * url.scheme = "file" - * url.hostname = "" + * elif state == HOST: # <<<<<<<<<<<<<< + * if c == ":" and not inside_brackets: + * if not buffer: */ goto __pyx_L16; } - /* "w3lib/_url.pyx":720 - * pointer -= 1 + /* "w3lib/_url.pyx":1123 + * buffer += c * - * elif state == FILE_SLASH: # <<<<<<<<<<<<<< - * assert isinstance(url.path, list) - * if c is not None and c in "/\\": + * elif state == PORT: # <<<<<<<<<<<<<< + * if c is not None and c in _ASCII_DIGIT: + * assert isinstance(c, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FILE_SLASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 720, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_14) { + __pyx_t_11 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PORT); + if (__pyx_t_11) { - /* "w3lib/_url.pyx":721 + /* "w3lib/_url.pyx":1124 * - * elif state == FILE_SLASH: - * assert isinstance(url.path, list) # <<<<<<<<<<<<<< - * if c is not None and c in "/\\": + * elif state == PORT: + * if c is not None and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< * assert isinstance(c, str) + * buffer += c */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = PyList_Check(__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_14)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 721, __pyx_L1_error) - } + __pyx_t_14 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_14) { + } else { + __pyx_t_11 = __pyx_t_14; + goto __pyx_L82_bool_binop_done; } - #else - if ((1)); else __PYX_ERR(0, 721, __pyx_L1_error) - #endif + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __pyx_t_14; + __pyx_L82_bool_binop_done:; + if (__pyx_t_11) { - /* "w3lib/_url.pyx":722 - * elif state == FILE_SLASH: - * assert isinstance(url.path, list) - * if c is not None and c in "/\\": # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * state = FILE_HOST - */ - __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_11) { - } else { - __pyx_t_14 = __pyx_t_11; - goto __pyx_L98_bool_binop_done; - } - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 722, __pyx_L1_error) - __pyx_t_14 = __pyx_t_11; - __pyx_L98_bool_binop_done:; - if (__pyx_t_14) { - - /* "w3lib/_url.pyx":723 - * assert isinstance(url.path, list) - * if c is not None and c in "/\\": + /* "w3lib/_url.pyx":1125 + * elif state == PORT: + * if c is not None and c in _ASCII_DIGIT: * assert isinstance(c, str) # <<<<<<<<<<<<<< - * state = FILE_HOST - * else: + * buffer += c + * elif c is None or c in "/?#" or url.is_special and c == "\\": */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_14 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_14)) { + __pyx_t_11 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_11)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 723, __pyx_L1_error) + __PYX_ERR(0, 1125, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 723, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 1125, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":724 - * if c is not None and c in "/\\": + /* "w3lib/_url.pyx":1126 + * if c is not None and c in _ASCII_DIGIT: * assert isinstance(c, str) - * state = FILE_HOST # <<<<<<<<<<<<<< - * else: - * if base is not None and base.scheme == "file": + * buffer += c # <<<<<<<<<<<<<< + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * if buffer: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FILE_HOST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":722 - * elif state == FILE_SLASH: - * assert isinstance(url.path, list) - * if c is not None and c in "/\\": # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1124 + * + * elif state == PORT: + * if c is not None and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< * assert isinstance(c, str) - * state = FILE_HOST + * buffer += c */ - goto __pyx_L97; + goto __pyx_L81; } - /* "w3lib/_url.pyx":726 - * state = FILE_HOST - * else: - * if base is not None and base.scheme == "file": # <<<<<<<<<<<<<< - * url.hostname = base.hostname - * if not _starts_with_windows_drive_letter( + /* "w3lib/_url.pyx":1127 + * assert isinstance(c, str) + * buffer += c + * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * if buffer: + * port = int(buffer) */ - /*else*/ { - __pyx_t_11 = (__pyx_v_base != Py_None); + __pyx_t_14 = (__pyx_v_c == ((PyObject*)Py_None)); + if (!__pyx_t_14) { + } else { + __pyx_t_11 = __pyx_t_14; + goto __pyx_L84_bool_binop_done; + } + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1127, __pyx_L1_error) + if (!__pyx_t_14) { + } else { + __pyx_t_11 = __pyx_t_14; + goto __pyx_L84_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1127, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_14) { + } else { + __pyx_t_11 = __pyx_t_14; + goto __pyx_L84_bool_binop_done; + } + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1127, __pyx_L1_error) + __pyx_t_11 = __pyx_t_14; + __pyx_L84_bool_binop_done:; + if (likely(__pyx_t_11)) { + + /* "w3lib/_url.pyx":1128 + * buffer += c + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * if buffer: # <<<<<<<<<<<<<< + * port = int(buffer) + * if port > 2**16 - 1: + */ + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1128, __pyx_L1_error) if (__pyx_t_11) { - } else { - __pyx_t_14 = __pyx_t_11; - goto __pyx_L101_bool_binop_done; - } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_14 = __pyx_t_11; - __pyx_L101_bool_binop_done:; - if (__pyx_t_14) { - /* "w3lib/_url.pyx":727 - * else: - * if base is not None and base.scheme == "file": - * url.hostname = base.hostname # <<<<<<<<<<<<<< - * if not _starts_with_windows_drive_letter( - * input[pointer:] + /* "w3lib/_url.pyx":1129 + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * if buffer: + * port = int(buffer) # <<<<<<<<<<<<<< + * if port > 2**16 - 1: + * raise ValueError */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 727, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_port, __pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":728 - * if base is not None and base.scheme == "file": - * url.hostname = base.hostname - * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< - * input[pointer:] - * ) and _is_windows_drive_letter(base.path[0]): + /* "w3lib/_url.pyx":1130 + * if buffer: + * port = int(buffer) + * if port > 2**16 - 1: # <<<<<<<<<<<<<< + * raise ValueError + * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_port, __pyx_int_65535, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1130, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__pyx_t_11)) { - /* "w3lib/_url.pyx":729 - * url.hostname = base.hostname - * if not _starts_with_windows_drive_letter( - * input[pointer:] # <<<<<<<<<<<<<< - * ) and _is_windows_drive_letter(base.path[0]): - * url.path.append(base.path[0]) + /* "w3lib/_url.pyx":1131 + * port = int(buffer) + * if port > 2**16 - 1: + * raise ValueError # <<<<<<<<<<<<<< + * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port + * url._default_port_seen = url.port is None */ - if (unlikely(__pyx_v_input == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 729, __pyx_L1_error) - } - __Pyx_INCREF(__pyx_v_pointer); - __pyx_t_3 = __pyx_v_pointer; - __pyx_t_11 = (__pyx_t_3 == Py_None); - if (__pyx_t_11) { - __pyx_t_12 = 0; - } else { - __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 729, __pyx_L1_error) - __pyx_t_12 = __pyx_t_7; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_12, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 729, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_15)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_15); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 1131, __pyx_L1_error) - /* "w3lib/_url.pyx":728 - * if base is not None and base.scheme == "file": - * url.hostname = base.hostname - * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< - * input[pointer:] - * ) and _is_windows_drive_letter(base.path[0]): + /* "w3lib/_url.pyx":1130 + * if buffer: + * port = int(buffer) + * if port > 2**16 - 1: # <<<<<<<<<<<<<< + * raise ValueError + * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 728, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = (!__pyx_t_11); - if (__pyx_t_1) { - } else { - __pyx_t_14 = __pyx_t_1; - goto __pyx_L104_bool_binop_done; } - /* "w3lib/_url.pyx":730 - * if not _starts_with_windows_drive_letter( - * input[pointer:] - * ) and _is_windows_drive_letter(base.path[0]): # <<<<<<<<<<<<<< - * url.path.append(base.path[0]) - * state = PATH + /* "w3lib/_url.pyx":1132 + * if port > 2**16 - 1: + * raise ValueError + * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port # <<<<<<<<<<<<<< + * url._default_port_seen = url.port is None + * buffer = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 730, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; + __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; @@ -16133,791 +17350,713 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_15}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_15}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_port, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1132, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_11) { + __Pyx_INCREF(Py_None); + __pyx_t_4 = Py_None; + } else { + __Pyx_INCREF(__pyx_v_port); + __pyx_t_4 = __pyx_v_port; + } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_4) < 0) __PYX_ERR(0, 1132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_14 = __pyx_t_1; - __pyx_L104_bool_binop_done:; - /* "w3lib/_url.pyx":728 - * if base is not None and base.scheme == "file": - * url.hostname = base.hostname - * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< - * input[pointer:] - * ) and _is_windows_drive_letter(base.path[0]): + /* "w3lib/_url.pyx":1133 + * raise ValueError + * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port + * url._default_port_seen = url.port is None # <<<<<<<<<<<<<< + * buffer = "" + * state = PATH_START */ - if (__pyx_t_14) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = (__pyx_t_4 == Py_None); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen, __pyx_t_4) < 0) __PYX_ERR(0, 1133, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":731 - * input[pointer:] - * ) and _is_windows_drive_letter(base.path[0]): - * url.path.append(base.path[0]) # <<<<<<<<<<<<<< - * state = PATH + /* "w3lib/_url.pyx":1134 + * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port + * url._default_port_seen = url.port is None + * buffer = "" # <<<<<<<<<<<<<< + * state = PATH_START * pointer -= 1 */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_15); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - - /* "w3lib/_url.pyx":728 - * if base is not None and base.scheme == "file": - * url.hostname = base.hostname - * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< - * input[pointer:] - * ) and _is_windows_drive_letter(base.path[0]): - */ - } + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":726 - * state = FILE_HOST - * else: - * if base is not None and base.scheme == "file": # <<<<<<<<<<<<<< - * url.hostname = base.hostname - * if not _starts_with_windows_drive_letter( + /* "w3lib/_url.pyx":1128 + * buffer += c + * elif c is None or c in "/?#" or url.is_special and c == "\\": + * if buffer: # <<<<<<<<<<<<<< + * port = int(buffer) + * if port > 2**16 - 1: */ } - /* "w3lib/_url.pyx":732 - * ) and _is_windows_drive_letter(base.path[0]): - * url.path.append(base.path[0]) - * state = PATH # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1135 + * url._default_port_seen = url.port is None + * buffer = "" + * state = PATH_START # <<<<<<<<<<<<<< * pointer -= 1 - * + * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_PATH); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_15); - __pyx_t_15 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":733 - * url.path.append(base.path[0]) - * state = PATH + /* "w3lib/_url.pyx":1136 + * buffer = "" + * state = PATH_START * pointer -= 1 # <<<<<<<<<<<<<< - * - * elif state == FILE_HOST: + * else: + * raise ValueError */ - __pyx_t_15 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_15); - __pyx_t_15 = 0; + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":1127 + * assert isinstance(c, str) + * buffer += c + * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * if buffer: + * port = int(buffer) + */ + goto __pyx_L81; } - __pyx_L97:; - /* "w3lib/_url.pyx":720 + /* "w3lib/_url.pyx":1138 * pointer -= 1 + * else: + * raise ValueError # <<<<<<<<<<<<<< * - * elif state == FILE_SLASH: # <<<<<<<<<<<<<< - * assert isinstance(url.path, list) - * if c is not None and c in "/\\": + * elif state == FILE: + */ + /*else*/ { + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 1138, __pyx_L1_error) + } + __pyx_L81:; + + /* "w3lib/_url.pyx":1123 + * buffer += c + * + * elif state == PORT: # <<<<<<<<<<<<<< + * if c is not None and c in _ASCII_DIGIT: + * assert isinstance(c, str) */ goto __pyx_L16; } - /* "w3lib/_url.pyx":735 - * pointer -= 1 + /* "w3lib/_url.pyx":1140 + * raise ValueError * - * elif state == FILE_HOST: # <<<<<<<<<<<<<< - * if c is None or c in "/\\?#": - * pointer -= 1 + * elif state == FILE: # <<<<<<<<<<<<<< + * url.scheme = "file" + * url.hostname = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_FILE_HOST); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_15, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 735, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_14) { + __pyx_t_11 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE); + if (__pyx_t_11) { - /* "w3lib/_url.pyx":736 + /* "w3lib/_url.pyx":1141 * - * elif state == FILE_HOST: - * if c is None or c in "/\\?#": # <<<<<<<<<<<<<< - * pointer -= 1 - * if _is_windows_drive_letter(buffer): + * elif state == FILE: + * url.scheme = "file" # <<<<<<<<<<<<<< + * url.hostname = "" + * if c is not None and c in "/\\": */ - __pyx_t_1 = (__pyx_v_c == ((PyObject*)Py_None)); - if (!__pyx_t_1) { - } else { - __pyx_t_14 = __pyx_t_1; - goto __pyx_L107_bool_binop_done; - } - __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 736, __pyx_L1_error) - __pyx_t_14 = __pyx_t_1; - __pyx_L107_bool_binop_done:; - if (__pyx_t_14) { + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_n_u_file) < 0) __PYX_ERR(0, 1141, __pyx_L1_error) - /* "w3lib/_url.pyx":737 - * elif state == FILE_HOST: - * if c is None or c in "/\\?#": - * pointer -= 1 # <<<<<<<<<<<<<< - * if _is_windows_drive_letter(buffer): - * state = PATH + /* "w3lib/_url.pyx":1142 + * elif state == FILE: + * url.scheme = "file" + * url.hostname = "" # <<<<<<<<<<<<<< + * if c is not None and c in "/\\": + * assert isinstance(c, str) */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1142, __pyx_L1_error) - /* "w3lib/_url.pyx":738 - * if c is None or c in "/\\?#": - * pointer -= 1 - * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< - * state = PATH - * elif not buffer: + /* "w3lib/_url.pyx":1143 + * url.scheme = "file" + * url.hostname = "" + * if c is not None and c in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * state = FILE_SLASH */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 738, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_15))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_15); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_15, function); - __pyx_t_6 = 1; + __pyx_t_14 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_14) { + } else { + __pyx_t_11 = __pyx_t_14; + goto __pyx_L91_bool_binop_done; + } + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_11 = __pyx_t_14; + __pyx_L91_bool_binop_done:; + if (__pyx_t_11) { + + /* "w3lib/_url.pyx":1144 + * url.hostname = "" + * if c is not None and c in "/\\": + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * state = FILE_SLASH + * elif base is not None and base.scheme == "file": + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_11 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_11)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 1144, __pyx_L1_error) } } + #else + if ((1)); else __PYX_ERR(0, 1144, __pyx_L1_error) #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_buffer}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 738, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_14) { - /* "w3lib/_url.pyx":739 - * pointer -= 1 - * if _is_windows_drive_letter(buffer): - * state = PATH # <<<<<<<<<<<<<< - * elif not buffer: - * url.hostname = "" + /* "w3lib/_url.pyx":1145 + * if c is not None and c in "/\\": + * assert isinstance(c, str) + * state = FILE_SLASH # <<<<<<<<<<<<<< + * elif base is not None and base.scheme == "file": + * url.hostname = base.hostname */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_FILE_SLASH; - /* "w3lib/_url.pyx":738 - * if c is None or c in "/\\?#": - * pointer -= 1 - * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< - * state = PATH - * elif not buffer: + /* "w3lib/_url.pyx":1143 + * url.scheme = "file" + * url.hostname = "" + * if c is not None and c in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * state = FILE_SLASH */ - goto __pyx_L109; - } + goto __pyx_L90; + } - /* "w3lib/_url.pyx":740 - * if _is_windows_drive_letter(buffer): - * state = PATH - * elif not buffer: # <<<<<<<<<<<<<< - * url.hostname = "" - * state = PATH_START + /* "w3lib/_url.pyx":1146 + * assert isinstance(c, str) + * state = FILE_SLASH + * elif base is not None and base.scheme == "file": # <<<<<<<<<<<<<< + * url.hostname = base.hostname + * url.path = base.path */ - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 740, __pyx_L1_error) - __pyx_t_1 = (!__pyx_t_14); - if (__pyx_t_1) { + __pyx_t_14 = (__pyx_v_base != Py_None); + if (__pyx_t_14) { + } else { + __pyx_t_11 = __pyx_t_14; + goto __pyx_L93_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __pyx_t_14; + __pyx_L93_bool_binop_done:; + if (__pyx_t_11) { - /* "w3lib/_url.pyx":741 - * state = PATH - * elif not buffer: - * url.hostname = "" # <<<<<<<<<<<<<< - * state = PATH_START - * else: + /* "w3lib/_url.pyx":1147 + * state = FILE_SLASH + * elif base is not None and base.scheme == "file": + * url.hostname = base.hostname # <<<<<<<<<<<<<< + * url.path = base.path + * url.query = base.query */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 741, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 1147, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":742 - * elif not buffer: - * url.hostname = "" - * state = PATH_START # <<<<<<<<<<<<<< - * else: - * host = _parse_host(buffer, is_special=url.is_special) + /* "w3lib/_url.pyx":1148 + * elif base is not None and base.scheme == "file": + * url.hostname = base.hostname + * url.path = base.path # <<<<<<<<<<<<<< + * url.query = base.query + * if c == "?": */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_4) < 0) __PYX_ERR(0, 1148, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":740 - * if _is_windows_drive_letter(buffer): - * state = PATH - * elif not buffer: # <<<<<<<<<<<<<< - * url.hostname = "" - * state = PATH_START + /* "w3lib/_url.pyx":1149 + * url.hostname = base.hostname + * url.path = base.path + * url.query = base.query # <<<<<<<<<<<<<< + * if c == "?": + * url.query = "" */ - goto __pyx_L109; - } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_4) < 0) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":744 - * state = PATH_START - * else: - * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< - * if host == "localhost": - * host = "" - */ - /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_INCREF(__pyx_v_buffer); - __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_buffer)) __PYX_ERR(0, 744, __pyx_L1_error); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_special, __pyx_t_3) < 0) __PYX_ERR(0, 744, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_3); - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":745 - * else: - * host = _parse_host(buffer, is_special=url.is_special) - * if host == "localhost": # <<<<<<<<<<<<<< - * host = "" - * url.hostname = host - */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_host, __pyx_n_u_localhost, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 745, __pyx_L1_error) - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":746 - * host = _parse_host(buffer, is_special=url.is_special) - * if host == "localhost": - * host = "" # <<<<<<<<<<<<<< - * url.hostname = host - * buffer = "" - */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_host, __pyx_kp_u__2); - - /* "w3lib/_url.pyx":745 - * else: - * host = _parse_host(buffer, is_special=url.is_special) - * if host == "localhost": # <<<<<<<<<<<<<< - * host = "" - * url.hostname = host - */ - } - - /* "w3lib/_url.pyx":747 - * if host == "localhost": - * host = "" - * url.hostname = host # <<<<<<<<<<<<<< - * buffer = "" - * state = PATH_START - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 747, __pyx_L1_error) - - /* "w3lib/_url.pyx":748 - * host = "" - * url.hostname = host - * buffer = "" # <<<<<<<<<<<<<< - * state = PATH_START - * else: + /* "w3lib/_url.pyx":1150 + * url.path = base.path + * url.query = base.query + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1150, __pyx_L1_error) + if (__pyx_t_11) { - /* "w3lib/_url.pyx":749 - * url.hostname = host - * buffer = "" - * state = PATH_START # <<<<<<<<<<<<<< - * else: - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1151 + * url.query = base.query + * if c == "?": + * url.query = "" # <<<<<<<<<<<<<< + * state = QUERY + * elif c == "#": */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; - } - __pyx_L109:; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1151, __pyx_L1_error) - /* "w3lib/_url.pyx":736 - * - * elif state == FILE_HOST: - * if c is None or c in "/\\?#": # <<<<<<<<<<<<<< - * pointer -= 1 - * if _is_windows_drive_letter(buffer): + /* "w3lib/_url.pyx":1152 + * if c == "?": + * url.query = "" + * state = QUERY # <<<<<<<<<<<<<< + * elif c == "#": + * url.fragment = "" */ - goto __pyx_L106; - } + __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":751 - * state = PATH_START - * else: - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * buffer += c - * + /* "w3lib/_url.pyx":1150 + * url.path = base.path + * url.query = base.query + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY */ - /*else*/ { - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 751, __pyx_L1_error) - } + goto __pyx_L95; } - #else - if ((1)); else __PYX_ERR(0, 751, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":752 - * else: - * assert isinstance(c, str) - * buffer += c # <<<<<<<<<<<<<< - * - * elif state == PATH_START: - */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 752, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); - __pyx_t_3 = 0; - } - __pyx_L106:; - /* "w3lib/_url.pyx":735 - * pointer -= 1 - * - * elif state == FILE_HOST: # <<<<<<<<<<<<<< - * if c is None or c in "/\\?#": - * pointer -= 1 + /* "w3lib/_url.pyx":1153 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT */ - goto __pyx_L16; - } + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1153, __pyx_L1_error) + if (__pyx_t_11) { - /* "w3lib/_url.pyx":754 - * buffer += c - * - * elif state == PATH_START: # <<<<<<<<<<<<<< - * if url.is_special: - * state = PATH + /* "w3lib/_url.pyx":1154 + * state = QUERY + * elif c == "#": + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * elif c is not None: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 754, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_1) { + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1154, __pyx_L1_error) - /* "w3lib/_url.pyx":755 - * - * elif state == PATH_START: - * if url.is_special: # <<<<<<<<<<<<<< - * state = PATH - * if c is not None and c not in "/\\": + /* "w3lib/_url.pyx":1155 + * elif c == "#": + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * elif c is not None: + * assert isinstance(c, str) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_1) { + __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":756 - * elif state == PATH_START: - * if url.is_special: - * state = PATH # <<<<<<<<<<<<<< - * if c is not None and c not in "/\\": - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1153 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); - __pyx_t_2 = 0; + goto __pyx_L95; + } - /* "w3lib/_url.pyx":757 - * if url.is_special: - * state = PATH - * if c is not None and c not in "/\\": # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1156 + * url.fragment = "" + * state = FRAGMENT + * elif c is not None: # <<<<<<<<<<<<<< * assert isinstance(c, str) - * pointer -= 1 + * url.query = None */ - __pyx_t_14 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_14) { - } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L113_bool_binop_done; - } - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) - __pyx_t_1 = __pyx_t_14; - __pyx_L113_bool_binop_done:; - if (__pyx_t_1) { + __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_11) { - /* "w3lib/_url.pyx":758 - * state = PATH - * if c is not None and c not in "/\\": + /* "w3lib/_url.pyx":1157 + * state = FRAGMENT + * elif c is not None: * assert isinstance(c, str) # <<<<<<<<<<<<<< - * pointer -= 1 - * elif c == "?": + * url.query = None + * if not _starts_with_windows_drive_letter(input[pointer:]): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { + __pyx_t_11 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_11)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 758, __pyx_L1_error) + __PYX_ERR(0, 1157, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 758, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 1157, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":759 - * if c is not None and c not in "/\\": - * assert isinstance(c, str) - * pointer -= 1 # <<<<<<<<<<<<<< - * elif c == "?": - * url.query = "" - */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); - __pyx_t_2 = 0; - - /* "w3lib/_url.pyx":757 - * if url.is_special: - * state = PATH - * if c is not None and c not in "/\\": # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1158 + * elif c is not None: * assert isinstance(c, str) - * pointer -= 1 - */ - } - - /* "w3lib/_url.pyx":755 - * - * elif state == PATH_START: - * if url.is_special: # <<<<<<<<<<<<<< - * state = PATH - * if c is not None and c not in "/\\": + * url.query = None # <<<<<<<<<<<<<< + * if not _starts_with_windows_drive_letter(input[pointer:]): + * _shorten_path(url) */ - goto __pyx_L111; - } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 1158, __pyx_L1_error) - /* "w3lib/_url.pyx":760 + /* "w3lib/_url.pyx":1159 * assert isinstance(c, str) - * pointer -= 1 - * elif c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY - */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 760, __pyx_L1_error) - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":761 - * pointer -= 1 - * elif c == "?": - * url.query = "" # <<<<<<<<<<<<<< - * state = QUERY - * elif c == "#": - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 761, __pyx_L1_error) - - /* "w3lib/_url.pyx":762 - * elif c == "?": - * url.query = "" - * state = QUERY # <<<<<<<<<<<<<< - * elif c == "#": - * url.fragment = "" + * url.query = None + * if not _starts_with_windows_drive_letter(input[pointer:]): # <<<<<<<<<<<<<< + * _shorten_path(url) + * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 762, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); - __pyx_t_2 = 0; - - /* "w3lib/_url.pyx":760 - * assert isinstance(c, str) - * pointer -= 1 - * elif c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY - */ - goto __pyx_L111; - } + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__pyx_v_input == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 1159, __pyx_L1_error) + } + __Pyx_INCREF(__pyx_v_pointer); + __pyx_t_3 = __pyx_v_pointer; + __pyx_t_11 = (__pyx_t_3 == Py_None); + if (__pyx_t_11) { + __pyx_t_12 = 0; + } else { + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) + __pyx_t_12 = __pyx_t_7; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_12, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_3}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1159, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_14 = (!__pyx_t_11); + if (__pyx_t_14) { - /* "w3lib/_url.pyx":763 - * url.query = "" - * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":1160 + * url.query = None + * if not _starts_with_windows_drive_letter(input[pointer:]): + * _shorten_path(url) # <<<<<<<<<<<<<< + * else: + * url.path = [] */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 763, __pyx_L1_error) - if (__pyx_t_1) { + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_url}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":764 - * state = QUERY - * elif c == "#": - * url.fragment = "" # <<<<<<<<<<<<<< - * state = FRAGMENT - * elif c is not None: + /* "w3lib/_url.pyx":1159 + * assert isinstance(c, str) + * url.query = None + * if not _starts_with_windows_drive_letter(input[pointer:]): # <<<<<<<<<<<<<< + * _shorten_path(url) + * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 764, __pyx_L1_error) + goto __pyx_L96; + } - /* "w3lib/_url.pyx":765 - * elif c == "#": - * url.fragment = "" - * state = FRAGMENT # <<<<<<<<<<<<<< - * elif c is not None: - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1162 + * _shorten_path(url) + * else: + * url.path = [] # <<<<<<<<<<<<<< + * state = PATH + * pointer -= 1 */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); - __pyx_t_2 = 0; + /*else*/ { + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_4) < 0) __PYX_ERR(0, 1162, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_L96:; - /* "w3lib/_url.pyx":763 - * url.query = "" - * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":1163 + * else: + * url.path = [] + * state = PATH # <<<<<<<<<<<<<< + * pointer -= 1 + * else: */ - goto __pyx_L111; - } + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":766 - * url.fragment = "" - * state = FRAGMENT - * elif c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1164 + * url.path = [] + * state = PATH + * pointer -= 1 # <<<<<<<<<<<<<< + * else: * state = PATH */ - __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":767 - * state = FRAGMENT - * elif c is not None: - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * state = PATH - * if c != "/": + /* "w3lib/_url.pyx":1156 + * url.fragment = "" + * state = FRAGMENT + * elif c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * url.query = None */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 767, __pyx_L1_error) - } } - #else - if ((1)); else __PYX_ERR(0, 767, __pyx_L1_error) - #endif + __pyx_L95:; - /* "w3lib/_url.pyx":768 - * elif c is not None: + /* "w3lib/_url.pyx":1146 * assert isinstance(c, str) - * state = PATH # <<<<<<<<<<<<<< - * if c != "/": - * pointer -= 1 + * state = FILE_SLASH + * elif base is not None and base.scheme == "file": # <<<<<<<<<<<<<< + * url.hostname = base.hostname + * url.path = base.path */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); - __pyx_t_2 = 0; + goto __pyx_L90; + } - /* "w3lib/_url.pyx":769 - * assert isinstance(c, str) - * state = PATH - * if c != "/": # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1166 * pointer -= 1 + * else: + * state = PATH # <<<<<<<<<<<<<< + * pointer -= 1 * */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 769, __pyx_L1_error) - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":770 - * state = PATH - * if c != "/": - * pointer -= 1 # <<<<<<<<<<<<<< - * - * elif state == PATH: - */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); - __pyx_t_2 = 0; + /*else*/ { + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":769 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1167 + * else: * state = PATH - * if c != "/": # <<<<<<<<<<<<<< - * pointer -= 1 + * pointer -= 1 # <<<<<<<<<<<<<< * + * elif state == FILE_SLASH: */ - } - - /* "w3lib/_url.pyx":766 - * url.fragment = "" - * state = FRAGMENT - * elif c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * state = PATH - */ + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; } - __pyx_L111:; + __pyx_L90:; - /* "w3lib/_url.pyx":754 - * buffer += c + /* "w3lib/_url.pyx":1140 + * raise ValueError * - * elif state == PATH_START: # <<<<<<<<<<<<<< - * if url.is_special: - * state = PATH + * elif state == FILE: # <<<<<<<<<<<<<< + * url.scheme = "file" + * url.hostname = "" */ goto __pyx_L16; } - /* "w3lib/_url.pyx":772 - * pointer -= 1 + /* "w3lib/_url.pyx":1169 + * pointer -= 1 * - * elif state == PATH: # <<<<<<<<<<<<<< + * elif state == FILE_SLASH: # <<<<<<<<<<<<<< * assert isinstance(url.path, list) - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if c is not None and c in "/\\": */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_state, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 772, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 772, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { + __pyx_t_14 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_SLASH); + if (__pyx_t_14) { - /* "w3lib/_url.pyx":773 + /* "w3lib/_url.pyx":1170 * - * elif state == PATH: + * elif state == FILE_SLASH: * assert isinstance(url.path, list) # <<<<<<<<<<<<<< - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": - * if _is_double_dot_path_segment(buffer): + * if c is not None and c in "/\\": + * assert isinstance(c, str) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyList_Check(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = PyList_Check(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_14)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 773, __pyx_L1_error) + __PYX_ERR(0, 1170, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 773, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 1170, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":774 - * elif state == PATH: + /* "w3lib/_url.pyx":1171 + * elif state == FILE_SLASH: * assert isinstance(url.path, list) - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": # <<<<<<<<<<<<<< - * if _is_double_dot_path_segment(buffer): - * _shorten_path(url) + * if c is not None and c in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * state = FILE_HOST */ - __pyx_t_14 = (__pyx_v_c == ((PyObject*)Py_None)); - if (!__pyx_t_14) { - } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L117_bool_binop_done; - } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 774, __pyx_L1_error) - if (!__pyx_t_14) { - } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L117_bool_binop_done; - } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!__pyx_t_14) { - goto __pyx_L120_next_or; + __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_11) { } else { + __pyx_t_14 = __pyx_t_11; + goto __pyx_L98_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 774, __pyx_L1_error) - if (!__pyx_t_14) { - } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L117_bool_binop_done; - } - __pyx_L120_next_or:; - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 774, __pyx_L1_error) - __pyx_t_1 = __pyx_t_14; - __pyx_L117_bool_binop_done:; - if (__pyx_t_1) { + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1171, __pyx_L1_error) + __pyx_t_14 = __pyx_t_11; + __pyx_L98_bool_binop_done:; + if (__pyx_t_14) { - /* "w3lib/_url.pyx":775 + /* "w3lib/_url.pyx":1172 * assert isinstance(url.path, list) - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": - * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< - * _shorten_path(url) - * if c != "/" and not (url.is_special and c == "\\"): + * if c is not None and c in "/\\": + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * state = FILE_HOST + * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_double_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_15)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_15); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_14 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_14)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 1172, __pyx_L1_error) } } + #else + if ((1)); else __PYX_ERR(0, 1172, __pyx_L1_error) #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_buffer}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1173 + * if c is not None and c in "/\\": + * assert isinstance(c, str) + * state = FILE_HOST # <<<<<<<<<<<<<< + * else: + * if base is not None and base.scheme == "file": + */ + __pyx_v_state = __pyx_v_5w3lib_4_url_FILE_HOST; + + /* "w3lib/_url.pyx":1171 + * elif state == FILE_SLASH: + * assert isinstance(url.path, list) + * if c is not None and c in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * state = FILE_HOST + */ + goto __pyx_L97; + } + + /* "w3lib/_url.pyx":1175 + * state = FILE_HOST + * else: + * if base is not None and base.scheme == "file": # <<<<<<<<<<<<<< + * url.hostname = base.hostname + * if not _starts_with_windows_drive_letter( + */ + /*else*/ { + __pyx_t_11 = (__pyx_v_base != Py_None); + if (__pyx_t_11) { + } else { + __pyx_t_14 = __pyx_t_11; + goto __pyx_L101_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 775, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_14 = __pyx_t_11; + __pyx_L101_bool_binop_done:; + if (__pyx_t_14) { - /* "w3lib/_url.pyx":776 - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": - * if _is_double_dot_path_segment(buffer): - * _shorten_path(url) # <<<<<<<<<<<<<< - * if c != "/" and not (url.is_special and c == "\\"): - * url.path.append("") + /* "w3lib/_url.pyx":1176 + * else: + * if base is not None and base.scheme == "file": + * url.hostname = base.hostname # <<<<<<<<<<<<<< + * if not _starts_with_windows_drive_letter( + * input[pointer:] + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 1176, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":1177 + * if base is not None and base.scheme == "file": + * url.hostname = base.hostname + * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< + * input[pointer:] + * ) and _is_windows_drive_letter(base.path[0]): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_url.pyx":1178 + * url.hostname = base.hostname + * if not _starts_with_windows_drive_letter( + * input[pointer:] # <<<<<<<<<<<<<< + * ) and _is_windows_drive_letter(base.path[0]): + * url.path.append(base.path[0]) + */ + if (unlikely(__pyx_v_input == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 1178, __pyx_L1_error) + } + __Pyx_INCREF(__pyx_v_pointer); + __pyx_t_3 = __pyx_v_pointer; + __pyx_t_11 = (__pyx_t_3 == Py_None); + if (__pyx_t_11) { + __pyx_t_12 = 0; + } else { + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1178, __pyx_L1_error) + __pyx_t_12 = __pyx_t_7; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_12, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_15 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS @@ -16933,518 +18072,388 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_url}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_3}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":777 - * if _is_double_dot_path_segment(buffer): - * _shorten_path(url) - * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< - * url.path.append("") - * elif _is_single_dot_path_segment(buffer): + /* "w3lib/_url.pyx":1177 + * if base is not None and base.scheme == "file": + * url.hostname = base.hostname + * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< + * input[pointer:] + * ) and _is_windows_drive_letter(base.path[0]): */ - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) - if (__pyx_t_14) { + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1177, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (!__pyx_t_11); + if (__pyx_t_1) { } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L124_bool_binop_done; + __pyx_t_14 = __pyx_t_1; + goto __pyx_L104_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error) + + /* "w3lib/_url.pyx":1179 + * if not _starts_with_windows_drive_letter( + * input[pointer:] + * ) and _is_windows_drive_letter(base.path[0]): # <<<<<<<<<<<<<< + * url.path.append(base.path[0]) + * state = PATH + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_11) { - } else { - __pyx_t_14 = __pyx_t_11; - goto __pyx_L126_bool_binop_done; + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) - __pyx_t_14 = __pyx_t_11; - __pyx_L126_bool_binop_done:; - __pyx_t_11 = (!__pyx_t_14); - __pyx_t_1 = __pyx_t_11; - __pyx_L124_bool_binop_done:; - if (__pyx_t_1) { + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_15}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1179, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_14 = __pyx_t_1; + __pyx_L104_bool_binop_done:; - /* "w3lib/_url.pyx":778 - * _shorten_path(url) - * if c != "/" and not (url.is_special and c == "\\"): - * url.path.append("") # <<<<<<<<<<<<<< - * elif _is_single_dot_path_segment(buffer): - * if c != "/" and not (url.is_special and c == "\\"): + /* "w3lib/_url.pyx":1177 + * if base is not None and base.scheme == "file": + * url.hostname = base.hostname + * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< + * input[pointer:] + * ) and _is_windows_drive_letter(base.path[0]): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 778, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_14) { - /* "w3lib/_url.pyx":777 - * if _is_double_dot_path_segment(buffer): - * _shorten_path(url) - * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< - * url.path.append("") - * elif _is_single_dot_path_segment(buffer): + /* "w3lib/_url.pyx":1180 + * input[pointer:] + * ) and _is_windows_drive_letter(base.path[0]): + * url.path.append(base.path[0]) # <<<<<<<<<<<<<< + * state = PATH + * pointer -= 1 + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_15); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1180, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + + /* "w3lib/_url.pyx":1177 + * if base is not None and base.scheme == "file": + * url.hostname = base.hostname + * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< + * input[pointer:] + * ) and _is_windows_drive_letter(base.path[0]): */ } - /* "w3lib/_url.pyx":775 - * assert isinstance(url.path, list) - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": - * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< - * _shorten_path(url) - * if c != "/" and not (url.is_special and c == "\\"): + /* "w3lib/_url.pyx":1175 + * state = FILE_HOST + * else: + * if base is not None and base.scheme == "file": # <<<<<<<<<<<<<< + * url.hostname = base.hostname + * if not _starts_with_windows_drive_letter( */ - goto __pyx_L122; } - /* "w3lib/_url.pyx":779 - * if c != "/" and not (url.is_special and c == "\\"): - * url.path.append("") - * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< - * if c != "/" and not (url.is_special and c == "\\"): - * url.path.append("") + /* "w3lib/_url.pyx":1181 + * ) and _is_windows_drive_letter(base.path[0]): + * url.path.append(base.path[0]) + * state = PATH # <<<<<<<<<<<<<< + * pointer -= 1 + * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_single_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_15)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_15); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_buffer}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 779, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":780 - * url.path.append("") - * elif _is_single_dot_path_segment(buffer): - * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< - * url.path.append("") - * else: + /* "w3lib/_url.pyx":1182 + * url.path.append(base.path[0]) + * state = PATH + * pointer -= 1 # <<<<<<<<<<<<<< + * + * elif state == FILE_HOST: */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 780, __pyx_L1_error) - if (__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L129_bool_binop_done; - } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 780, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_14) { - } else { - __pyx_t_11 = __pyx_t_14; - goto __pyx_L131_bool_binop_done; - } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 780, __pyx_L1_error) - __pyx_t_11 = __pyx_t_14; - __pyx_L131_bool_binop_done:; - __pyx_t_14 = (!__pyx_t_11); - __pyx_t_1 = __pyx_t_14; - __pyx_L129_bool_binop_done:; - if (__pyx_t_1) { + __pyx_t_15 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_15); + __pyx_t_15 = 0; + } + __pyx_L97:; - /* "w3lib/_url.pyx":781 - * elif _is_single_dot_path_segment(buffer): - * if c != "/" and not (url.is_special and c == "\\"): - * url.path.append("") # <<<<<<<<<<<<<< - * else: - * if ( + /* "w3lib/_url.pyx":1169 + * pointer -= 1 + * + * elif state == FILE_SLASH: # <<<<<<<<<<<<<< + * assert isinstance(url.path, list) + * if c is not None and c in "/\\": */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 781, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L16; + } - /* "w3lib/_url.pyx":780 - * url.path.append("") - * elif _is_single_dot_path_segment(buffer): - * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< - * url.path.append("") - * else: + /* "w3lib/_url.pyx":1184 + * pointer -= 1 + * + * elif state == FILE_HOST: # <<<<<<<<<<<<<< + * if c is None or c in "/\\?#": + * pointer -= 1 + */ + __pyx_t_14 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_HOST); + if (__pyx_t_14) { + + /* "w3lib/_url.pyx":1185 + * + * elif state == FILE_HOST: + * if c is None or c in "/\\?#": # <<<<<<<<<<<<<< + * pointer -= 1 + * if _is_windows_drive_letter(buffer): + */ + __pyx_t_1 = (__pyx_v_c == ((PyObject*)Py_None)); + if (!__pyx_t_1) { + } else { + __pyx_t_14 = __pyx_t_1; + goto __pyx_L107_bool_binop_done; + } + __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1185, __pyx_L1_error) + __pyx_t_14 = __pyx_t_1; + __pyx_L107_bool_binop_done:; + if (__pyx_t_14) { + + /* "w3lib/_url.pyx":1186 + * elif state == FILE_HOST: + * if c is None or c in "/\\?#": + * pointer -= 1 # <<<<<<<<<<<<<< + * if _is_windows_drive_letter(buffer): + * state = PATH + */ + __pyx_t_15 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_15); + __pyx_t_15 = 0; + + /* "w3lib/_url.pyx":1187 + * if c is None or c in "/\\?#": + * pointer -= 1 + * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< + * state = PATH + * elif not buffer: */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_buffer}; + __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1187, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__pyx_t_14) { - /* "w3lib/_url.pyx":779 - * if c != "/" and not (url.is_special and c == "\\"): - * url.path.append("") - * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< - * if c != "/" and not (url.is_special and c == "\\"): - * url.path.append("") + /* "w3lib/_url.pyx":1188 + * pointer -= 1 + * if _is_windows_drive_letter(buffer): + * state = PATH # <<<<<<<<<<<<<< + * elif not buffer: + * url.hostname = "" */ - goto __pyx_L122; + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; + + /* "w3lib/_url.pyx":1187 + * if c is None or c in "/\\?#": + * pointer -= 1 + * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< + * state = PATH + * elif not buffer: + */ + goto __pyx_L109; } - /* "w3lib/_url.pyx":783 - * url.path.append("") + /* "w3lib/_url.pyx":1189 + * if _is_windows_drive_letter(buffer): + * state = PATH + * elif not buffer: # <<<<<<<<<<<<<< + * url.hostname = "" + * state = PATH_START + */ + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1189, __pyx_L1_error) + __pyx_t_1 = (!__pyx_t_14); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":1190 + * state = PATH + * elif not buffer: + * url.hostname = "" # <<<<<<<<<<<<<< + * state = PATH_START * else: - * if ( # <<<<<<<<<<<<<< - * url.scheme == "file" - * and not url.path */ - /*else*/ { + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) - /* "w3lib/_url.pyx":784 + /* "w3lib/_url.pyx":1191 + * elif not buffer: + * url.hostname = "" + * state = PATH_START # <<<<<<<<<<<<<< * else: - * if ( - * url.scheme == "file" # <<<<<<<<<<<<<< - * and not url.path - * and _is_windows_drive_letter(buffer) + * host = _parse_host(buffer, is_special=url.is_special) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 784, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 784, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_14) { - } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L134_bool_binop_done; - } + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":785 - * if ( - * url.scheme == "file" - * and not url.path # <<<<<<<<<<<<<< - * and _is_windows_drive_letter(buffer) - * ): + /* "w3lib/_url.pyx":1189 + * if _is_windows_drive_letter(buffer): + * state = PATH + * elif not buffer: # <<<<<<<<<<<<<< + * url.hostname = "" + * state = PATH_START */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 785, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 785, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = (!__pyx_t_14); - if (__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L134_bool_binop_done; - } + goto __pyx_L109; + } - /* "w3lib/_url.pyx":786 - * url.scheme == "file" - * and not url.path - * and _is_windows_drive_letter(buffer) # <<<<<<<<<<<<<< - * ): - * buffer = buffer[0] + ":" + buffer[2:] + /* "w3lib/_url.pyx":1193 + * state = PATH_START + * else: + * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< + * if host == "localhost": + * host = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error) + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_buffer); + __Pyx_GIVEREF(__pyx_v_buffer); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_buffer)) __PYX_ERR(0, 1193, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_15)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_15); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_buffer}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 786, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_special, __pyx_t_3) < 0) __PYX_ERR(0, 1193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_11; - __pyx_L134_bool_binop_done:; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":783 - * url.path.append("") + /* "w3lib/_url.pyx":1194 * else: - * if ( # <<<<<<<<<<<<<< - * url.scheme == "file" - * and not url.path + * host = _parse_host(buffer, is_special=url.is_special) + * if host == "localhost": # <<<<<<<<<<<<<< + * host = "" + * url.hostname = host */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_host, __pyx_n_u_localhost, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":788 - * and _is_windows_drive_letter(buffer) - * ): - * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< - * if ( - * not url.path + /* "w3lib/_url.pyx":1195 + * host = _parse_host(buffer, is_special=url.is_special) + * if host == "localhost": + * host = "" # <<<<<<<<<<<<<< + * url.hostname = host + * buffer = "" */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_buffer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_buffer, 2, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_15); - __pyx_t_15 = 0; + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_host, __pyx_kp_u__2); - /* "w3lib/_url.pyx":783 - * url.path.append("") + /* "w3lib/_url.pyx":1194 * else: - * if ( # <<<<<<<<<<<<<< - * url.scheme == "file" - * and not url.path - */ - } - - /* "w3lib/_url.pyx":790 - * buffer = buffer[0] + ":" + buffer[2:] - * if ( - * not url.path # <<<<<<<<<<<<<< - * and not buffer - * and c is not None - */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 790, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 790, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_14 = (!__pyx_t_11); - if (__pyx_t_14) { - } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L138_bool_binop_done; - } - - /* "w3lib/_url.pyx":791 - * if ( - * not url.path - * and not buffer # <<<<<<<<<<<<<< - * and c is not None - * and c in "?#" - */ - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 791, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_14); - if (__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L138_bool_binop_done; - } - - /* "w3lib/_url.pyx":792 - * not url.path - * and not buffer - * and c is not None # <<<<<<<<<<<<<< - * and c in "?#" - * and input[pointer - 1] not in "/\\" - */ - __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L138_bool_binop_done; - } - - /* "w3lib/_url.pyx":793 - * and not buffer - * and c is not None - * and c in "?#" # <<<<<<<<<<<<<< - * and input[pointer - 1] not in "/\\" - * ): - */ - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 793, __pyx_L1_error) - if (__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L138_bool_binop_done; - } - - /* "w3lib/_url.pyx":794 - * and c is not None - * and c in "?#" - * and input[pointer - 1] not in "/\\" # <<<<<<<<<<<<<< - * ): - * url._path_token_seen = True - */ - __pyx_t_15 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_t_3, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 794, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_11; - __pyx_L138_bool_binop_done:; - - /* "w3lib/_url.pyx":789 - * ): - * buffer = buffer[0] + ":" + buffer[2:] - * if ( # <<<<<<<<<<<<<< - * not url.path - * and not buffer - */ - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":796 - * and input[pointer - 1] not in "/\\" - * ): - * url._path_token_seen = True # <<<<<<<<<<<<<< - * url.path.append(buffer) - * buffer = "" - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen, Py_True) < 0) __PYX_ERR(0, 796, __pyx_L1_error) - - /* "w3lib/_url.pyx":789 - * ): - * buffer = buffer[0] + ":" + buffer[2:] - * if ( # <<<<<<<<<<<<<< - * not url.path - * and not buffer + * host = _parse_host(buffer, is_special=url.is_special) + * if host == "localhost": # <<<<<<<<<<<<<< + * host = "" + * url.hostname = host */ } - /* "w3lib/_url.pyx":797 - * ): - * url._path_token_seen = True - * url.path.append(buffer) # <<<<<<<<<<<<<< - * buffer = "" - * if c == "?": - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 797, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_buffer); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 797, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_L122:; - - /* "w3lib/_url.pyx":798 - * url._path_token_seen = True - * url.path.append(buffer) - * buffer = "" # <<<<<<<<<<<<<< - * if c == "?": - * url.query = "" - */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - - /* "w3lib/_url.pyx":799 - * url.path.append(buffer) - * buffer = "" - * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY - */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 799, __pyx_L1_error) - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":800 - * buffer = "" - * if c == "?": - * url.query = "" # <<<<<<<<<<<<<< - * state = QUERY - * elif c == "#": - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 800, __pyx_L1_error) - - /* "w3lib/_url.pyx":801 - * if c == "?": - * url.query = "" - * state = QUERY # <<<<<<<<<<<<<< - * elif c == "#": - * url.fragment = "" - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":799 - * url.path.append(buffer) - * buffer = "" - * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY - */ - goto __pyx_L143; - } - - /* "w3lib/_url.pyx":802 - * url.query = "" - * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":1196 + * if host == "localhost": + * host = "" + * url.hostname = host # <<<<<<<<<<<<<< + * buffer = "" + * state = PATH_START */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 802, __pyx_L1_error) - if (__pyx_t_1) { + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 1196, __pyx_L1_error) - /* "w3lib/_url.pyx":803 - * state = QUERY - * elif c == "#": - * url.fragment = "" # <<<<<<<<<<<<<< - * state = FRAGMENT + /* "w3lib/_url.pyx":1197 + * host = "" + * url.hostname = host + * buffer = "" # <<<<<<<<<<<<<< + * state = PATH_START * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 803, __pyx_L1_error) + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":804 - * elif c == "#": - * url.fragment = "" - * state = FRAGMENT # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1198 + * url.hostname = host + * buffer = "" + * state = PATH_START # <<<<<<<<<<<<<< * else: * assert isinstance(c, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3); - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":802 - * url.query = "" - * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT - */ + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; } - __pyx_L143:; + __pyx_L109:; - /* "w3lib/_url.pyx":774 - * elif state == PATH: - * assert isinstance(url.path, list) - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": # <<<<<<<<<<<<<< - * if _is_double_dot_path_segment(buffer): - * _shorten_path(url) + /* "w3lib/_url.pyx":1185 + * + * elif state == FILE_HOST: + * if c is None or c in "/\\?#": # <<<<<<<<<<<<<< + * pointer -= 1 + * if _is_windows_drive_letter(buffer): */ - goto __pyx_L116; + goto __pyx_L106; } - /* "w3lib/_url.pyx":806 - * state = FRAGMENT + /* "w3lib/_url.pyx":1200 + * state = PATH_START * else: * assert isinstance(c, str) # <<<<<<<<<<<<<< - * buffer += _idempotent_utf_8_percent_encode( - * input=input, + * buffer += c + * */ /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS @@ -17452,1589 +18461,1819 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 806, __pyx_L1_error) + __PYX_ERR(0, 1200, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 806, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 1200, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":807 + /* "w3lib/_url.pyx":1201 * else: * assert isinstance(c, str) - * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< - * input=input, - * pointer=pointer, + * buffer += c # <<<<<<<<<<<<<< + * + * elif state == PATH_START: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L106:; - /* "w3lib/_url.pyx":808 - * assert isinstance(c, str) - * buffer += _idempotent_utf_8_percent_encode( - * input=input, # <<<<<<<<<<<<<< - * pointer=pointer, - * encode_set=path_percent_encode_set, + /* "w3lib/_url.pyx":1184 + * pointer -= 1 + * + * elif state == FILE_HOST: # <<<<<<<<<<<<<< + * if c is None or c in "/\\?#": + * pointer -= 1 */ - __pyx_t_15 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 808, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 808, __pyx_L1_error) + goto __pyx_L16; + } - /* "w3lib/_url.pyx":809 - * buffer += _idempotent_utf_8_percent_encode( - * input=input, - * pointer=pointer, # <<<<<<<<<<<<<< - * encode_set=path_percent_encode_set, - * ) + /* "w3lib/_url.pyx":1203 + * buffer += c + * + * elif state == PATH_START: # <<<<<<<<<<<<<< + * if url.is_special: + * state = PATH */ - if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 808, __pyx_L1_error) + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH_START); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":810 - * input=input, - * pointer=pointer, - * encode_set=path_percent_encode_set, # <<<<<<<<<<<<<< - * ) + /* "w3lib/_url.pyx":1204 * + * elif state == PATH_START: + * if url.is_special: # <<<<<<<<<<<<<< + * state = PATH + * if c is not None and c not in "/\\": */ - if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_encode_set, __pyx_v_path_percent_encode_set) < 0) __PYX_ERR(0, 808, __pyx_L1_error) - - /* "w3lib/_url.pyx":807 - * else: - * assert isinstance(c, str) - * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< - * input=input, - * pointer=pointer, + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1204, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":1205 + * elif state == PATH_START: + * if url.is_special: + * state = PATH # <<<<<<<<<<<<<< + * if c is not None and c not in "/\\": + * assert isinstance(c, str) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_15); - __pyx_t_15 = 0; - } - __pyx_L116:; + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":772 + /* "w3lib/_url.pyx":1206 + * if url.is_special: + * state = PATH + * if c is not None and c not in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) * pointer -= 1 - * - * elif state == PATH: # <<<<<<<<<<<<<< - * assert isinstance(url.path, list) - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": */ - goto __pyx_L16; - } + __pyx_t_14 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L113_bool_binop_done; + } + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1206, __pyx_L1_error) + __pyx_t_1 = __pyx_t_14; + __pyx_L113_bool_binop_done:; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":813 - * ) - * - * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< - * assert isinstance(url.path, str) - * if c == "?": + /* "w3lib/_url.pyx":1207 + * state = PATH + * if c is not None and c not in "/\\": + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * pointer -= 1 + * elif c == "?": */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_OPAQUE_PATH); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_15, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_1) { + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 1207, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 1207, __pyx_L1_error) + #endif - /* "w3lib/_url.pyx":814 - * - * elif state == OPAQUE_PATH: - * assert isinstance(url.path, str) # <<<<<<<<<<<<<< - * if c == "?": + /* "w3lib/_url.pyx":1208 + * if c is not None and c not in "/\\": + * assert isinstance(c, str) + * pointer -= 1 # <<<<<<<<<<<<<< + * elif c == "?": * url.query = "" */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyUnicode_Check(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":1206 + * if url.is_special: + * state = PATH + * if c is not None and c not in "/\\": # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * pointer -= 1 + */ } + + /* "w3lib/_url.pyx":1204 + * + * elif state == PATH_START: + * if url.is_special: # <<<<<<<<<<<<<< + * state = PATH + * if c is not None and c not in "/\\": + */ + goto __pyx_L111; } - #else - if ((1)); else __PYX_ERR(0, 814, __pyx_L1_error) - #endif - /* "w3lib/_url.pyx":815 - * elif state == OPAQUE_PATH: - * assert isinstance(url.path, str) - * if c == "?": # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1209 + * assert isinstance(c, str) + * pointer -= 1 + * elif c == "?": # <<<<<<<<<<<<<< * url.query = "" * state = QUERY */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 815, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1209, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":816 - * assert isinstance(url.path, str) - * if c == "?": + /* "w3lib/_url.pyx":1210 + * pointer -= 1 + * elif c == "?": * url.query = "" # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 816, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) - /* "w3lib/_url.pyx":817 - * if c == "?": + /* "w3lib/_url.pyx":1211 + * elif c == "?": * url.query = "" * state = QUERY # <<<<<<<<<<<<<< * elif c == "#": * url.fragment = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":815 - * elif state == OPAQUE_PATH: - * assert isinstance(url.path, str) - * if c == "?": # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1209 + * assert isinstance(c, str) + * pointer -= 1 + * elif c == "?": # <<<<<<<<<<<<<< * url.query = "" * state = QUERY */ - goto __pyx_L144; + goto __pyx_L111; } - /* "w3lib/_url.pyx":818 + /* "w3lib/_url.pyx":1212 * url.query = "" * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1212, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":819 + /* "w3lib/_url.pyx":1213 * state = QUERY * elif c == "#": * url.fragment = "" # <<<<<<<<<<<<<< * state = FRAGMENT * elif c is not None: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 819, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1213, __pyx_L1_error) - /* "w3lib/_url.pyx":820 + /* "w3lib/_url.pyx":1214 * elif c == "#": * url.fragment = "" * state = FRAGMENT # <<<<<<<<<<<<<< * elif c is not None: * assert isinstance(c, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 820, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":818 + /* "w3lib/_url.pyx":1212 * url.query = "" * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ - goto __pyx_L144; + goto __pyx_L111; } - /* "w3lib/_url.pyx":821 + /* "w3lib/_url.pyx":1215 * url.fragment = "" * state = FRAGMENT * elif c is not None: # <<<<<<<<<<<<<< * assert isinstance(c, str) - * encoded = _utf_8_percent_encode( + * state = PATH */ __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "w3lib/_url.pyx":822 + /* "w3lib/_url.pyx":1216 * state = FRAGMENT * elif c is not None: * assert isinstance(c, str) # <<<<<<<<<<<<<< - * encoded = _utf_8_percent_encode( - * c, + * state = PATH + * if c != "/": */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 822, __pyx_L1_error) + __PYX_ERR(0, 1216, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 822, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 1216, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":823 + /* "w3lib/_url.pyx":1217 * elif c is not None: * assert isinstance(c, str) - * encoded = _utf_8_percent_encode( # <<<<<<<<<<<<<< - * c, - * _C0_CONTROL_PERCENT_ENCODE_SET, + * state = PATH # <<<<<<<<<<<<<< + * if c != "/": + * pointer -= 1 */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":825 - * encoded = _utf_8_percent_encode( - * c, - * _C0_CONTROL_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< - * ) - * url.path += encoded + /* "w3lib/_url.pyx":1218 + * assert isinstance(c, str) + * state = PATH + * if c != "/": # <<<<<<<<<<<<<< + * pointer -= 1 + * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_15))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_15, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_c, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } - __Pyx_XDECREF_SET(__pyx_v_encoded, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1218, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":827 - * _C0_CONTROL_PERCENT_ENCODE_SET, - * ) - * url.path += encoded # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1219 + * state = PATH + * if c != "/": + * pointer -= 1 # <<<<<<<<<<<<<< * - * elif state == QUERY: + * elif state == PATH: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_15) < 0) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":1218 + * assert isinstance(c, str) + * state = PATH + * if c != "/": # <<<<<<<<<<<<<< + * pointer -= 1 + * + */ + } - /* "w3lib/_url.pyx":821 + /* "w3lib/_url.pyx":1215 * url.fragment = "" * state = FRAGMENT * elif c is not None: # <<<<<<<<<<<<<< * assert isinstance(c, str) - * encoded = _utf_8_percent_encode( + * state = PATH */ } - __pyx_L144:; + __pyx_L111:; - /* "w3lib/_url.pyx":813 - * ) + /* "w3lib/_url.pyx":1203 + * buffer += c * - * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< - * assert isinstance(url.path, str) - * if c == "?": + * elif state == PATH_START: # <<<<<<<<<<<<<< + * if url.is_special: + * state = PATH */ goto __pyx_L16; } - /* "w3lib/_url.pyx":829 - * url.path += encoded + /* "w3lib/_url.pyx":1221 + * pointer -= 1 * - * elif state == QUERY: # <<<<<<<<<<<<<< - * assert isinstance(url.query, str) - * if encoding != "utf-8" and ( + * elif state == PATH: # <<<<<<<<<<<<<< + * assert isinstance(url.path, list) + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_QUERY); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_15, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH); if (__pyx_t_1) { - /* "w3lib/_url.pyx":830 + /* "w3lib/_url.pyx":1222 * - * elif state == QUERY: - * assert isinstance(url.query, str) # <<<<<<<<<<<<<< - * if encoding != "utf-8" and ( - * not url.is_special or url.scheme in ("ws", "wss") + * elif state == PATH: + * assert isinstance(url.path, list) # <<<<<<<<<<<<<< + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if _is_double_dot_path_segment(buffer): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyUnicode_Check(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyList_Check(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 830, __pyx_L1_error) + __PYX_ERR(0, 1222, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 830, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 1222, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":831 - * elif state == QUERY: - * assert isinstance(url.query, str) - * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< - * not url.is_special or url.scheme in ("ws", "wss") - * ): + /* "w3lib/_url.pyx":1223 + * elif state == PATH: + * assert isinstance(url.path, list) + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": # <<<<<<<<<<<<<< + * if _is_double_dot_path_segment(buffer): + * _shorten_path(url) */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_kp_u_utf_8, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 831, __pyx_L1_error) - if (__pyx_t_11) { + __pyx_t_14 = (__pyx_v_c == ((PyObject*)Py_None)); + if (!__pyx_t_14) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L146_bool_binop_done; + __pyx_t_1 = __pyx_t_14; + goto __pyx_L117_bool_binop_done; } - - /* "w3lib/_url.pyx":832 - * assert isinstance(url.query, str) - * if encoding != "utf-8" and ( - * not url.is_special or url.scheme in ("ws", "wss") # <<<<<<<<<<<<<< - * ): - * encoding = "utf-8" - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_14 = (!__pyx_t_11); + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1223, __pyx_L1_error) if (!__pyx_t_14) { } else { __pyx_t_1 = __pyx_t_14; - goto __pyx_L146_bool_binop_done; + goto __pyx_L117_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_ws, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 832, __pyx_L1_error) - if (!__pyx_t_11) { - } else { - __pyx_t_14 = __pyx_t_11; - goto __pyx_L149_bool_binop_done; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1223, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_14) { + goto __pyx_L120_next_or; + } else { } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_wss, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 832, __pyx_L1_error) - __pyx_t_14 = __pyx_t_11; - __pyx_L149_bool_binop_done:; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = __pyx_t_14; - __pyx_t_1 = __pyx_t_11; - __pyx_L146_bool_binop_done:; - - /* "w3lib/_url.pyx":831 - * elif state == QUERY: - * assert isinstance(url.query, str) - * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< - * not url.is_special or url.scheme in ("ws", "wss") - * ): - */ + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1223, __pyx_L1_error) + if (!__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L117_bool_binop_done; + } + __pyx_L120_next_or:; + __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1223, __pyx_L1_error) + __pyx_t_1 = __pyx_t_14; + __pyx_L117_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":834 - * not url.is_special or url.scheme in ("ws", "wss") - * ): - * encoding = "utf-8" # <<<<<<<<<<<<<< - * if c == "#" or c is None: - * percent_encode_set = ( + /* "w3lib/_url.pyx":1224 + * assert isinstance(url.path, list) + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< + * _shorten_path(url) + * if c != "/" and not (url.is_special and c == "\\"): */ - __Pyx_INCREF(__pyx_kp_u_utf_8); - __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_kp_u_utf_8); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_double_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_buffer}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1224, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":831 - * elif state == QUERY: - * assert isinstance(url.query, str) - * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< - * not url.is_special or url.scheme in ("ws", "wss") - * ): + /* "w3lib/_url.pyx":1225 + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if _is_double_dot_path_segment(buffer): + * _shorten_path(url) # <<<<<<<<<<<<<< + * if c != "/" and not (url.is_special and c == "\\"): + * url.path.append("") */ - } + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_url}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":835 - * ): - * encoding = "utf-8" - * if c == "#" or c is None: # <<<<<<<<<<<<<< - * percent_encode_set = ( - * special_query_percent_encode_set + /* "w3lib/_url.pyx":1226 + * if _is_double_dot_path_segment(buffer): + * _shorten_path(url) + * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< + * url.path.append("") + * elif _is_single_dot_path_segment(buffer): */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 835, __pyx_L1_error) - if (!__pyx_t_11) { - } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L152_bool_binop_done; - } - __pyx_t_11 = (__pyx_v_c == ((PyObject*)Py_None)); - __pyx_t_1 = __pyx_t_11; - __pyx_L152_bool_binop_done:; - if (__pyx_t_1) { + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1226, __pyx_L1_error) + if (__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L124_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1226, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_11) { + } else { + __pyx_t_14 = __pyx_t_11; + goto __pyx_L126_bool_binop_done; + } + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1226, __pyx_L1_error) + __pyx_t_14 = __pyx_t_11; + __pyx_L126_bool_binop_done:; + __pyx_t_11 = (!__pyx_t_14); + __pyx_t_1 = __pyx_t_11; + __pyx_L124_bool_binop_done:; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":838 - * percent_encode_set = ( - * special_query_percent_encode_set - * if url.is_special # <<<<<<<<<<<<<< - * else query_percent_encode_set - * ) + /* "w3lib/_url.pyx":1227 + * _shorten_path(url) + * if c != "/" and not (url.is_special and c == "\\"): + * url.path.append("") # <<<<<<<<<<<<<< + * elif _is_single_dot_path_segment(buffer): + * if c != "/" and not (url.is_special and c == "\\"): */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1227, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":837 - * if c == "#" or c is None: - * percent_encode_set = ( - * special_query_percent_encode_set # <<<<<<<<<<<<<< - * if url.is_special - * else query_percent_encode_set + /* "w3lib/_url.pyx":1226 + * if _is_double_dot_path_segment(buffer): + * _shorten_path(url) + * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< + * url.path.append("") + * elif _is_single_dot_path_segment(buffer): */ - __Pyx_INCREF(__pyx_v_special_query_percent_encode_set); - __pyx_t_2 = __pyx_v_special_query_percent_encode_set; - } else { + } - /* "w3lib/_url.pyx":839 - * special_query_percent_encode_set - * if url.is_special - * else query_percent_encode_set # <<<<<<<<<<<<<< - * ) - * url.query += _percent_encode_after_encoding( + /* "w3lib/_url.pyx":1224 + * assert isinstance(url.path, list) + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< + * _shorten_path(url) + * if c != "/" and not (url.is_special and c == "\\"): */ - __Pyx_INCREF(__pyx_v_query_percent_encode_set); - __pyx_t_2 = __pyx_v_query_percent_encode_set; + goto __pyx_L122; } - __Pyx_XDECREF_SET(__pyx_v_percent_encode_set, __pyx_t_2); - __pyx_t_2 = 0; - /* "w3lib/_url.pyx":841 - * else query_percent_encode_set - * ) - * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * buffer, - * encoding=encoding, + /* "w3lib/_url.pyx":1228 + * if c != "/" and not (url.is_special and c == "\\"): + * url.path.append("") + * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< + * if c != "/" and not (url.is_special and c == "\\"): + * url.path.append("") */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 841, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_single_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_buffer}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1228, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":842 - * ) - * url.query += _percent_encode_after_encoding( - * buffer, # <<<<<<<<<<<<<< - * encoding=encoding, - * percent_encode_set=percent_encode_set, + /* "w3lib/_url.pyx":1229 + * url.path.append("") + * elif _is_single_dot_path_segment(buffer): + * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< + * url.path.append("") + * else: */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_buffer); - __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buffer)) __PYX_ERR(0, 841, __pyx_L1_error); + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L129_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_14) { + } else { + __pyx_t_11 = __pyx_t_14; + goto __pyx_L131_bool_binop_done; + } + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_11 = __pyx_t_14; + __pyx_L131_bool_binop_done:; + __pyx_t_14 = (!__pyx_t_11); + __pyx_t_1 = __pyx_t_14; + __pyx_L129_bool_binop_done:; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":843 - * url.query += _percent_encode_after_encoding( - * buffer, - * encoding=encoding, # <<<<<<<<<<<<<< - * percent_encode_set=percent_encode_set, - * ) + /* "w3lib/_url.pyx":1230 + * elif _is_single_dot_path_segment(buffer): + * if c != "/" and not (url.is_special and c == "\\"): + * url.path.append("") # <<<<<<<<<<<<<< + * else: + * if ( */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 843, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1230, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":844 - * buffer, - * encoding=encoding, - * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< - * ) - * buffer = "" + /* "w3lib/_url.pyx":1229 + * url.path.append("") + * elif _is_single_dot_path_segment(buffer): + * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< + * url.path.append("") + * else: */ - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 843, __pyx_L1_error) + } - /* "w3lib/_url.pyx":841 - * else query_percent_encode_set - * ) - * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * buffer, - * encoding=encoding, + /* "w3lib/_url.pyx":1228 + * if c != "/" and not (url.is_special and c == "\\"): + * url.path.append("") + * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< + * if c != "/" and not (url.is_special and c == "\\"): + * url.path.append("") */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_4) < 0) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L122; + } - /* "w3lib/_url.pyx":846 - * percent_encode_set=percent_encode_set, - * ) - * buffer = "" # <<<<<<<<<<<<<< - * if c == "#": - * url.fragment = "" + /* "w3lib/_url.pyx":1232 + * url.path.append("") + * else: + * if ( # <<<<<<<<<<<<<< + * url.scheme == "file" + * and not url.path */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + /*else*/ { - /* "w3lib/_url.pyx":847 - * ) - * buffer = "" - * if c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":1233 + * else: + * if ( + * url.scheme == "file" # <<<<<<<<<<<<<< + * and not url.path + * and _is_windows_drive_letter(buffer) */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L134_bool_binop_done; + } - /* "w3lib/_url.pyx":848 - * buffer = "" - * if c == "#": - * url.fragment = "" # <<<<<<<<<<<<<< - * state = FRAGMENT - * elif c is not None: + /* "w3lib/_url.pyx":1234 + * if ( + * url.scheme == "file" + * and not url.path # <<<<<<<<<<<<<< + * and _is_windows_drive_letter(buffer) + * ): */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = (!__pyx_t_14); + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L134_bool_binop_done; + } - /* "w3lib/_url.pyx":849 - * if c == "#": - * url.fragment = "" - * state = FRAGMENT # <<<<<<<<<<<<<< - * elif c is not None: - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1235 + * url.scheme == "file" + * and not url.path + * and _is_windows_drive_letter(buffer) # <<<<<<<<<<<<<< + * ): + * buffer = buffer[0] + ":" + buffer[2:] */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_buffer}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_11; + __pyx_L134_bool_binop_done:; - /* "w3lib/_url.pyx":847 - * ) - * buffer = "" - * if c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":1232 + * url.path.append("") + * else: + * if ( # <<<<<<<<<<<<<< + * url.scheme == "file" + * and not url.path */ - } + if (__pyx_t_1) { - /* "w3lib/_url.pyx":835 - * ): - * encoding = "utf-8" - * if c == "#" or c is None: # <<<<<<<<<<<<<< - * percent_encode_set = ( - * special_query_percent_encode_set + /* "w3lib/_url.pyx":1237 + * and _is_windows_drive_letter(buffer) + * ): + * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< + * if ( + * not url.path */ - goto __pyx_L151; - } + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_buffer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_buffer, 2, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":850 - * url.fragment = "" - * state = FRAGMENT - * elif c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * buffer += c + /* "w3lib/_url.pyx":1232 + * url.path.append("") + * else: + * if ( # <<<<<<<<<<<<<< + * url.scheme == "file" + * and not url.path */ - __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_1) { + } - /* "w3lib/_url.pyx":851 - * state = FRAGMENT - * elif c is not None: - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * buffer += c - * + /* "w3lib/_url.pyx":1239 + * buffer = buffer[0] + ":" + buffer[2:] + * if ( + * not url.path # <<<<<<<<<<<<<< + * and not buffer + * and c is not None */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1239, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_14 = (!__pyx_t_11); + if (__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L138_bool_binop_done; } - } - #else - if ((1)); else __PYX_ERR(0, 851, __pyx_L1_error) - #endif - /* "w3lib/_url.pyx":852 - * elif c is not None: - * assert isinstance(c, str) - * buffer += c # <<<<<<<<<<<<<< - * - * elif state == FRAGMENT: + /* "w3lib/_url.pyx":1240 + * if ( + * not url.path + * and not buffer # <<<<<<<<<<<<<< + * and c is not None + * and c in "?#" */ - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1240, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_14); + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L138_bool_binop_done; + } - /* "w3lib/_url.pyx":850 - * url.fragment = "" - * state = FRAGMENT - * elif c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * buffer += c + /* "w3lib/_url.pyx":1241 + * not url.path + * and not buffer + * and c is not None # <<<<<<<<<<<<<< + * and c in "?#" + * and input[pointer - 1] not in "/\\" */ - } - __pyx_L151:; + __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L138_bool_binop_done; + } - /* "w3lib/_url.pyx":829 - * url.path += encoded - * - * elif state == QUERY: # <<<<<<<<<<<<<< - * assert isinstance(url.query, str) - * if encoding != "utf-8" and ( + /* "w3lib/_url.pyx":1242 + * and not buffer + * and c is not None + * and c in "?#" # <<<<<<<<<<<<<< + * and input[pointer - 1] not in "/\\" + * ): */ - goto __pyx_L16; - } + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1242, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L138_bool_binop_done; + } - /* "w3lib/_url.pyx":854 - * buffer += c - * - * elif state == FRAGMENT: # <<<<<<<<<<<<<< - * assert isinstance(url.fragment, str) - * if c is not None: + /* "w3lib/_url.pyx":1243 + * and c is not None + * and c in "?#" + * and input[pointer - 1] not in "/\\" # <<<<<<<<<<<<<< + * ): + * url._path_token_seen = True */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FRAGMENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 854, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 854, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_1) { + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_t_3, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_11; + __pyx_L138_bool_binop_done:; - /* "w3lib/_url.pyx":855 - * - * elif state == FRAGMENT: - * assert isinstance(url.fragment, str) # <<<<<<<<<<<<<< - * if c is not None: - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1238 + * ): + * buffer = buffer[0] + ":" + buffer[2:] + * if ( # <<<<<<<<<<<<<< + * not url.path + * and not buffer */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyUnicode_Check(__pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 855, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":1245 + * and input[pointer - 1] not in "/\\" + * ): + * url._path_token_seen = True # <<<<<<<<<<<<<< + * url.path.append(buffer) + * buffer = "" + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen, Py_True) < 0) __PYX_ERR(0, 1245, __pyx_L1_error) + + /* "w3lib/_url.pyx":1238 + * ): + * buffer = buffer[0] + ":" + buffer[2:] + * if ( # <<<<<<<<<<<<<< + * not url.path + * and not buffer + */ + } + + /* "w3lib/_url.pyx":1246 + * ): + * url._path_token_seen = True + * url.path.append(buffer) # <<<<<<<<<<<<<< + * buffer = "" + * if c == "?": + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_buffer); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1246, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - } - #else - if ((1)); else __PYX_ERR(0, 855, __pyx_L1_error) - #endif + __pyx_L122:; - /* "w3lib/_url.pyx":856 - * elif state == FRAGMENT: - * assert isinstance(url.fragment, str) - * if c is not None: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1247 + * url._path_token_seen = True + * url.path.append(buffer) + * buffer = "" # <<<<<<<<<<<<<< + * if c == "?": + * url.query = "" + */ + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + + /* "w3lib/_url.pyx":1248 + * url.path.append(buffer) + * buffer = "" + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1248, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":1249 + * buffer = "" + * if c == "?": + * url.query = "" # <<<<<<<<<<<<<< + * state = QUERY + * elif c == "#": + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1249, __pyx_L1_error) + + /* "w3lib/_url.pyx":1250 + * if c == "?": + * url.query = "" + * state = QUERY # <<<<<<<<<<<<<< + * elif c == "#": + * url.fragment = "" + */ + __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; + + /* "w3lib/_url.pyx":1248 + * url.path.append(buffer) + * buffer = "" + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY + */ + goto __pyx_L143; + } + + /* "w3lib/_url.pyx":1251 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1251, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":1252 + * state = QUERY + * elif c == "#": + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * else: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1252, __pyx_L1_error) + + /* "w3lib/_url.pyx":1253 + * elif c == "#": + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * else: * assert isinstance(c, str) - * url.fragment += _idempotent_utf_8_percent_encode( */ - __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_1) { + __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":857 - * assert isinstance(url.fragment, str) - * if c is not None: + /* "w3lib/_url.pyx":1251 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + } + __pyx_L143:; + + /* "w3lib/_url.pyx":1223 + * elif state == PATH: + * assert isinstance(url.path, list) + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": # <<<<<<<<<<<<<< + * if _is_double_dot_path_segment(buffer): + * _shorten_path(url) + */ + goto __pyx_L116; + } + + /* "w3lib/_url.pyx":1255 + * state = FRAGMENT + * else: * assert isinstance(c, str) # <<<<<<<<<<<<<< - * url.fragment += _idempotent_utf_8_percent_encode( - * input=input, pointer=pointer, encode_set=fragment_percent_encode_set + * buffer += _idempotent_utf_8_percent_encode( + * input=input, */ + /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyUnicode_Check(__pyx_v_c); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 857, __pyx_L1_error) + __PYX_ERR(0, 1255, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 857, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 1255, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":858 - * if c is not None: + /* "w3lib/_url.pyx":1256 + * else: * assert isinstance(c, str) - * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< - * input=input, pointer=pointer, encode_set=fragment_percent_encode_set - * ) + * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * input=input, + * pointer=pointer, */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":859 + /* "w3lib/_url.pyx":1257 * assert isinstance(c, str) - * url.fragment += _idempotent_utf_8_percent_encode( - * input=input, pointer=pointer, encode_set=fragment_percent_encode_set # <<<<<<<<<<<<<< + * buffer += _idempotent_utf_8_percent_encode( + * input=input, # <<<<<<<<<<<<<< + * pointer=pointer, + * encode_set=path_percent_encode_set, + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) + + /* "w3lib/_url.pyx":1258 + * buffer += _idempotent_utf_8_percent_encode( + * input=input, + * pointer=pointer, # <<<<<<<<<<<<<< + * encode_set=path_percent_encode_set, + * ) + */ + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) + + /* "w3lib/_url.pyx":1259 + * input=input, + * pointer=pointer, + * encode_set=path_percent_encode_set, # <<<<<<<<<<<<<< * ) * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 859, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 859, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_fragment_percent_encode_set) < 0) __PYX_ERR(0, 859, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encode_set, __pyx_v_path_percent_encode_set) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) - /* "w3lib/_url.pyx":858 - * if c is not None: + /* "w3lib/_url.pyx":1256 + * else: * assert isinstance(c, str) - * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< - * input=input, pointer=pointer, encode_set=fragment_percent_encode_set - * ) + * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * input=input, + * pointer=pointer, */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_t_2) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "w3lib/_url.pyx":856 - * elif state == FRAGMENT: - * assert isinstance(url.fragment, str) - * if c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * url.fragment += _idempotent_utf_8_percent_encode( - */ + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); + __pyx_t_4 = 0; } + __pyx_L116:; - /* "w3lib/_url.pyx":854 - * buffer += c + /* "w3lib/_url.pyx":1221 + * pointer -= 1 * - * elif state == FRAGMENT: # <<<<<<<<<<<<<< - * assert isinstance(url.fragment, str) - * if c is not None: + * elif state == PATH: # <<<<<<<<<<<<<< + * assert isinstance(url.path, list) + * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": */ + goto __pyx_L16; } - __pyx_L16:; - /* "w3lib/_url.pyx":862 + /* "w3lib/_url.pyx":1262 * ) * - * if pointer >= input_length: # <<<<<<<<<<<<<< - * break - * pointer += 1 + * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< + * assert isinstance(url.path, str) + * if c == "?": */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 862, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 862, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_OPAQUE_PATH); if (__pyx_t_1) { - /* "w3lib/_url.pyx":863 - * - * if pointer >= input_length: - * break # <<<<<<<<<<<<<< - * pointer += 1 + /* "w3lib/_url.pyx":1263 * + * elif state == OPAQUE_PATH: + * assert isinstance(url.path, str) # <<<<<<<<<<<<<< + * if c == "?": + * url.query = "" */ - goto __pyx_L5_break; + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyUnicode_Check(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 1263, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 1263, __pyx_L1_error) + #endif - /* "w3lib/_url.pyx":862 - * ) - * - * if pointer >= input_length: # <<<<<<<<<<<<<< - * break - * pointer += 1 + /* "w3lib/_url.pyx":1264 + * elif state == OPAQUE_PATH: + * assert isinstance(url.path, str) + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY */ - } + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1264, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":864 - * if pointer >= input_length: - * break - * pointer += 1 # <<<<<<<<<<<<<< - * - * return url + /* "w3lib/_url.pyx":1265 + * assert isinstance(url.path, str) + * if c == "?": + * url.query = "" # <<<<<<<<<<<<<< + * state = QUERY + * elif c == "#": */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; - } - __pyx_L5_break:; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1265, __pyx_L1_error) - /* "w3lib/_url.pyx":866 - * pointer += 1 - * - * return url # <<<<<<<<<<<<<< - * - * + /* "w3lib/_url.pyx":1266 + * if c == "?": + * url.query = "" + * state = QUERY # <<<<<<<<<<<<<< + * elif c == "#": + * url.fragment = "" */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_url); - __pyx_r = __pyx_v_url; - goto __pyx_L0; - - /* "w3lib/_url.pyx":438 - * - * - * def _parse_url( # <<<<<<<<<<<<<< - * input: str, - * *, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_15); - __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_base); - __Pyx_XDECREF(__pyx_v_url); - __Pyx_XDECREF(__pyx_v_state); - __Pyx_XDECREF(__pyx_v_buffer); - __Pyx_XDECREF(__pyx_v_pointer); - __Pyx_XDECREF(__pyx_v_c); - __Pyx_XDECREF(__pyx_v_at_sign_index); - __Pyx_XDECREF(__pyx_v_i); - __Pyx_XDECREF(__pyx_v_code_point); - __Pyx_XDECREF(__pyx_v_encoded_code_points); - __Pyx_XDECREF(__pyx_v_host); - __Pyx_XDECREF(__pyx_v_port); - __Pyx_XDECREF(__pyx_v_encoded); - __Pyx_XDECREF(__pyx_v_percent_encode_set); - __Pyx_XDECREF(__pyx_v_input); - __Pyx_XDECREF(__pyx_v_encoding); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; -/* "w3lib/_url.pyx":870 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 - * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< - * output = "" - * n = address + /* "w3lib/_url.pyx":1264 + * elif state == OPAQUE_PATH: + * assert isinstance(url.path, str) + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_33_serialize_ipv4(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_32_serialize_ipv4, "_serialize_ipv4(int address: int) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_33_serialize_ipv4 = {"_serialize_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_33_serialize_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_32_serialize_ipv4}; -static PyObject *__pyx_pw_5w3lib_4_url_33_serialize_ipv4(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_address = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_serialize_ipv4 (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_address,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_address)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 870, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv4") < 0)) __PYX_ERR(0, 870, __pyx_L3_error) + goto __pyx_L144; } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_address = ((PyObject*)values[0]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 870, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("w3lib._url._serialize_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyInt_Type), 0, "address", 1))) __PYX_ERR(0, 870, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_32_serialize_ipv4(__pyx_self, __pyx_v_address); - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5w3lib_4_url_32_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { - PyObject *__pyx_v_output = NULL; - PyObject *__pyx_v_n = NULL; - long __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - long __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_serialize_ipv4", 1); - - /* "w3lib/_url.pyx":871 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 - * def _serialize_ipv4(address: int) -> str: - * output = "" # <<<<<<<<<<<<<< - * n = address - * for i in range(1, 5): + /* "w3lib/_url.pyx":1267 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT */ - __Pyx_INCREF(__pyx_kp_u__2); - __pyx_v_output = __pyx_kp_u__2; + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1267, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":872 - * def _serialize_ipv4(address: int) -> str: - * output = "" - * n = address # <<<<<<<<<<<<<< - * for i in range(1, 5): - * output = str(n % 256) + output + /* "w3lib/_url.pyx":1268 + * state = QUERY + * elif c == "#": + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * elif c is not None: */ - __Pyx_INCREF(__pyx_v_address); - __pyx_v_n = __pyx_v_address; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1268, __pyx_L1_error) - /* "w3lib/_url.pyx":873 - * output = "" - * n = address - * for i in range(1, 5): # <<<<<<<<<<<<<< - * output = str(n % 256) + output - * if i != 4: + /* "w3lib/_url.pyx":1269 + * elif c == "#": + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * elif c is not None: + * assert isinstance(c, str) */ - for (__pyx_t_1 = 1; __pyx_t_1 < 5; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; + __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":874 - * n = address - * for i in range(1, 5): - * output = str(n % 256) + output # <<<<<<<<<<<<<< - * if i != 4: - * output = "." + output + /* "w3lib/_url.pyx":1267 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT */ - __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; + goto __pyx_L144; + } - /* "w3lib/_url.pyx":875 - * for i in range(1, 5): - * output = str(n % 256) + output - * if i != 4: # <<<<<<<<<<<<<< - * output = "." + output - * n = floor(n / 256) + /* "w3lib/_url.pyx":1270 + * url.fragment = "" + * state = FRAGMENT + * elif c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * encoded = _utf_8_percent_encode( */ - __pyx_t_4 = (__pyx_v_i != 4); - if (__pyx_t_4) { + __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":876 - * output = str(n % 256) + output - * if i != 4: - * output = "." + output # <<<<<<<<<<<<<< - * n = floor(n / 256) - * return output + /* "w3lib/_url.pyx":1271 + * state = FRAGMENT + * elif c is not None: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * encoded = _utf_8_percent_encode( + * c, */ - __pyx_t_2 = PyNumber_Add(__pyx_kp_u__6, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 1271, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 1271, __pyx_L1_error) + #endif - /* "w3lib/_url.pyx":875 - * for i in range(1, 5): - * output = str(n % 256) + output - * if i != 4: # <<<<<<<<<<<<<< - * output = "." + output - * n = floor(n / 256) + /* "w3lib/_url.pyx":1272 + * elif c is not None: + * assert isinstance(c, str) + * encoded = _utf_8_percent_encode( # <<<<<<<<<<<<<< + * c, + * _C0_CONTROL_PERCENT_ENCODE_SET, */ - } + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":877 - * if i != 4: - * output = "." + output - * n = floor(n / 256) # <<<<<<<<<<<<<< - * return output + /* "w3lib/_url.pyx":1274 + * encoded = _utf_8_percent_encode( + * c, + * _C0_CONTROL_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * ) + * url.path += encoded + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_v_c, __pyx_t_3}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_encoded, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":1276 + * _C0_CONTROL_PERCENT_ENCODE_SET, + * ) + * url.path += encoded # <<<<<<<<<<<<<< * + * elif state == QUERY: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_v_encoded); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_2) < 0) __PYX_ERR(0, 1276, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1270 + * url.fragment = "" + * state = FRAGMENT + * elif c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * encoded = _utf_8_percent_encode( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_7 = 1; } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); - __pyx_t_2 = 0; - } + __pyx_L144:; - /* "w3lib/_url.pyx":878 - * output = "." + output - * n = floor(n / 256) - * return output # <<<<<<<<<<<<<< - * + /* "w3lib/_url.pyx":1262 + * ) * + * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< + * assert isinstance(url.path, str) + * if c == "?": */ - __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 878, __pyx_L1_error) - __Pyx_INCREF(__pyx_v_output); - __pyx_r = ((PyObject*)__pyx_v_output); - goto __pyx_L0; + goto __pyx_L16; + } - /* "w3lib/_url.pyx":870 + /* "w3lib/_url.pyx":1278 + * url.path += encoded * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 - * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< - * output = "" - * n = address + * elif state == QUERY: # <<<<<<<<<<<<<< + * assert isinstance(url.query, str) + * if encoding != "utf-8" and ( */ + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_QUERY); + if (__pyx_t_1) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("w3lib._url._serialize_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_output); - __Pyx_XDECREF(__pyx_v_n); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "w3lib/_url.pyx":881 + /* "w3lib/_url.pyx":1279 * - * - * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< - * address: List[int], *, min_length: int = 2 - * ) -> Optional[int]: + * elif state == QUERY: + * assert isinstance(url.query, str) # <<<<<<<<<<<<<< + * if encoding != "utf-8" and ( + * not url.is_special or url.scheme in ("ws", "wss") */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyUnicode_Check(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 1279, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 1279, __pyx_L1_error) + #endif -static PyObject *__pyx_pf_5w3lib_4_url_46__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_length, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_min_length) < 0) __PYX_ERR(0, 881, __pyx_L1_error) - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 881, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("w3lib._url.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "w3lib/_url.pyx":1280 + * elif state == QUERY: + * assert isinstance(url.query, str) + * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< + * not url.is_special or url.scheme in ("ws", "wss") + * ): + */ + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_kp_u_utf_8, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1280, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L146_bool_binop_done; + } -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index, "_get_ipv6_first_longest_0_piece_index(list address: List[int], *, int min_length: int = 2) -> Optional[int]"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index = {"_get_ipv6_first_longest_0_piece_index", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index}; -static PyObject *__pyx_pw_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_address = 0; - PyObject *__pyx_v_min_length = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_get_ipv6_first_longest_0_piece_index (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_address,&__pyx_n_s_min_length,0}; - __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self); - values[1] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_min_length); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; + /* "w3lib/_url.pyx":1281 + * assert isinstance(url.query, str) + * if encoding != "utf-8" and ( + * not url.is_special or url.scheme in ("ws", "wss") # <<<<<<<<<<<<<< + * ): + * encoding = "utf-8" + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1281, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = (!__pyx_t_11); + if (!__pyx_t_14) { + } else { + __pyx_t_1 = __pyx_t_14; + goto __pyx_L146_bool_binop_done; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_address)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_ws, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1281, __pyx_L1_error) + if (!__pyx_t_11) { + } else { + __pyx_t_14 = __pyx_t_11; + goto __pyx_L149_bool_binop_done; } - if (kw_args == 1) { - const Py_ssize_t index = 1; - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); - if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L3_error) - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_ipv6_first_longest_0_piece_index") < 0)) __PYX_ERR(0, 881, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_address = ((PyObject*)values[0]); - __pyx_v_min_length = ((PyObject*)values[1]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_ipv6_first_longest_0_piece_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 881, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("w3lib._url._get_ipv6_first_longest_0_piece_index", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 882, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_min_length), (&PyInt_Type), 0, "min_length", 1))) __PYX_ERR(0, 882, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(__pyx_self, __pyx_v_address, __pyx_v_min_length); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_wss, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1281, __pyx_L1_error) + __pyx_t_14 = __pyx_t_11; + __pyx_L149_bool_binop_done:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_11 = __pyx_t_14; + __pyx_t_1 = __pyx_t_11; + __pyx_L146_bool_binop_done:; -static PyObject *__pyx_pf_5w3lib_4_url_34_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length) { - PyObject *__pyx_v_index = NULL; - PyObject *__pyx_v_index_length = NULL; - PyObject *__pyx_v_current_length = NULL; - PyObject *__pyx_v_current_index = NULL; - PyObject *__pyx_v_piece = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_get_ipv6_first_longest_0_piece_index", 1); + /* "w3lib/_url.pyx":1280 + * elif state == QUERY: + * assert isinstance(url.query, str) + * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< + * not url.is_special or url.scheme in ("ws", "wss") + * ): + */ + if (__pyx_t_1) { - /* "w3lib/_url.pyx":884 - * address: List[int], *, min_length: int = 2 - * ) -> Optional[int]: - * index = None # <<<<<<<<<<<<<< - * index_length = 0 - * current_length = 0 + /* "w3lib/_url.pyx":1283 + * not url.is_special or url.scheme in ("ws", "wss") + * ): + * encoding = "utf-8" # <<<<<<<<<<<<<< + * if c == "#" or c is None: + * percent_encode_set = ( */ - __Pyx_INCREF(Py_None); - __pyx_v_index = Py_None; + __Pyx_INCREF(__pyx_kp_u_utf_8); + __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_kp_u_utf_8); - /* "w3lib/_url.pyx":885 - * ) -> Optional[int]: - * index = None - * index_length = 0 # <<<<<<<<<<<<<< - * current_length = 0 - * for current_index, piece in enumerate(address): + /* "w3lib/_url.pyx":1280 + * elif state == QUERY: + * assert isinstance(url.query, str) + * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< + * not url.is_special or url.scheme in ("ws", "wss") + * ): */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_index_length = __pyx_int_0; + } - /* "w3lib/_url.pyx":886 - * index = None - * index_length = 0 - * current_length = 0 # <<<<<<<<<<<<<< - * for current_index, piece in enumerate(address): - * if piece != 0: + /* "w3lib/_url.pyx":1284 + * ): + * encoding = "utf-8" + * if c == "#" or c is None: # <<<<<<<<<<<<<< + * percent_encode_set = ( + * special_query_percent_encode_set */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_current_length = __pyx_int_0; + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1284, __pyx_L1_error) + if (!__pyx_t_11) { + } else { + __pyx_t_1 = __pyx_t_11; + goto __pyx_L152_bool_binop_done; + } + __pyx_t_11 = (__pyx_v_c == ((PyObject*)Py_None)); + __pyx_t_1 = __pyx_t_11; + __pyx_L152_bool_binop_done:; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":887 - * index_length = 0 - * current_length = 0 - * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< - * if piece != 0: - * current_length = 0 + /* "w3lib/_url.pyx":1287 + * percent_encode_set = ( + * special_query_percent_encode_set + * if url.is_special # <<<<<<<<<<<<<< + * else query_percent_encode_set + * ) */ - __Pyx_INCREF(__pyx_int_0); - __pyx_t_1 = __pyx_int_0; - __pyx_t_2 = __pyx_v_address; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 887, __pyx_L1_error) - #endif - if (__pyx_t_3 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 887, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XDECREF_SET(__pyx_v_piece, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_current_index, __pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1287, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":888 - * current_length = 0 - * for current_index, piece in enumerate(address): - * if piece != 0: # <<<<<<<<<<<<<< - * current_length = 0 - * continue + /* "w3lib/_url.pyx":1286 + * if c == "#" or c is None: + * percent_encode_set = ( + * special_query_percent_encode_set # <<<<<<<<<<<<<< + * if url.is_special + * else query_percent_encode_set */ - __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 888, __pyx_L1_error) - if (__pyx_t_5) { + __Pyx_INCREF(__pyx_v_special_query_percent_encode_set); + __pyx_t_2 = __pyx_v_special_query_percent_encode_set; + } else { - /* "w3lib/_url.pyx":889 - * for current_index, piece in enumerate(address): - * if piece != 0: - * current_length = 0 # <<<<<<<<<<<<<< - * continue - * current_length += 1 + /* "w3lib/_url.pyx":1288 + * special_query_percent_encode_set + * if url.is_special + * else query_percent_encode_set # <<<<<<<<<<<<<< + * ) + * url.query += _percent_encode_after_encoding( */ - __Pyx_INCREF(__pyx_int_0); - __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_int_0); + __Pyx_INCREF(__pyx_v_query_percent_encode_set); + __pyx_t_2 = __pyx_v_query_percent_encode_set; + } + __Pyx_XDECREF_SET(__pyx_v_percent_encode_set, __pyx_t_2); + __pyx_t_2 = 0; - /* "w3lib/_url.pyx":890 - * if piece != 0: - * current_length = 0 - * continue # <<<<<<<<<<<<<< - * current_length += 1 - * if current_length > index_length and current_length >= min_length: + /* "w3lib/_url.pyx":1290 + * else query_percent_encode_set + * ) + * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * buffer, + * encoding=encoding, */ - goto __pyx_L3_continue; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); - /* "w3lib/_url.pyx":888 - * current_length = 0 - * for current_index, piece in enumerate(address): - * if piece != 0: # <<<<<<<<<<<<<< - * current_length = 0 - * continue + /* "w3lib/_url.pyx":1291 + * ) + * url.query += _percent_encode_after_encoding( + * buffer, # <<<<<<<<<<<<<< + * encoding=encoding, + * percent_encode_set=percent_encode_set, */ - } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_buffer); + __Pyx_GIVEREF(__pyx_v_buffer); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buffer)) __PYX_ERR(0, 1290, __pyx_L1_error); - /* "w3lib/_url.pyx":891 - * current_length = 0 - * continue - * current_length += 1 # <<<<<<<<<<<<<< - * if current_length > index_length and current_length >= min_length: - * index = current_index + 1 - current_length + /* "w3lib/_url.pyx":1292 + * url.query += _percent_encode_after_encoding( + * buffer, + * encoding=encoding, # <<<<<<<<<<<<<< + * percent_encode_set=percent_encode_set, + * ) */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_15 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 1292, __pyx_L1_error) - /* "w3lib/_url.pyx":892 - * continue - * current_length += 1 - * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< - * index = current_index + 1 - current_length - * index_length = current_length + /* "w3lib/_url.pyx":1293 + * buffer, + * encoding=encoding, + * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< + * ) + * buffer = "" */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_index_length, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 892, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - } else { - __pyx_t_5 = __pyx_t_6; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_min_length, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 892, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __pyx_t_6; - __pyx_L7_bool_binop_done:; - if (__pyx_t_5) { + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 1292, __pyx_L1_error) - /* "w3lib/_url.pyx":893 - * current_length += 1 - * if current_length > index_length and current_length >= min_length: - * index = current_index + 1 - current_length # <<<<<<<<<<<<<< - * index_length = current_length - * return index + /* "w3lib/_url.pyx":1290 + * else query_percent_encode_set + * ) + * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * buffer, + * encoding=encoding, */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_v_current_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 893, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_7); - __pyx_t_7 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_15); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_15) < 0) __PYX_ERR(0, 1290, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "w3lib/_url.pyx":894 - * if current_length > index_length and current_length >= min_length: - * index = current_index + 1 - current_length - * index_length = current_length # <<<<<<<<<<<<<< - * return index + /* "w3lib/_url.pyx":1295 + * percent_encode_set=percent_encode_set, + * ) + * buffer = "" # <<<<<<<<<<<<<< + * if c == "#": + * url.fragment = "" + */ + __Pyx_INCREF(__pyx_kp_u__2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + + /* "w3lib/_url.pyx":1296 + * ) + * buffer = "" + * if c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1296, __pyx_L1_error) + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":1297 + * buffer = "" + * if c == "#": + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * elif c is not None: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1297, __pyx_L1_error) + + /* "w3lib/_url.pyx":1298 + * if c == "#": + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * elif c is not None: + * assert isinstance(c, str) + */ + __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; + + /* "w3lib/_url.pyx":1296 + * ) + * buffer = "" + * if c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ + } + + /* "w3lib/_url.pyx":1284 + * ): + * encoding = "utf-8" + * if c == "#" or c is None: # <<<<<<<<<<<<<< + * percent_encode_set = ( + * special_query_percent_encode_set + */ + goto __pyx_L151; + } + + /* "w3lib/_url.pyx":1299 + * url.fragment = "" + * state = FRAGMENT + * elif c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * buffer += c + */ + __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":1300 + * state = FRAGMENT + * elif c is not None: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * buffer += c * */ - __Pyx_INCREF(__pyx_v_current_length); - __Pyx_DECREF_SET(__pyx_v_index_length, __pyx_v_current_length); + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 1300, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 1300, __pyx_L1_error) + #endif - /* "w3lib/_url.pyx":892 - * continue - * current_length += 1 - * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< - * index = current_index + 1 - current_length - * index_length = current_length + /* "w3lib/_url.pyx":1301 + * elif c is not None: + * assert isinstance(c, str) + * buffer += c # <<<<<<<<<<<<<< + * + * elif state == FRAGMENT: */ - } + __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_15); + __pyx_t_15 = 0; - /* "w3lib/_url.pyx":887 - * index_length = 0 - * current_length = 0 - * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< - * if piece != 0: - * current_length = 0 + /* "w3lib/_url.pyx":1299 + * url.fragment = "" + * state = FRAGMENT + * elif c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * buffer += c */ - __pyx_L3_continue:; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L151:; - /* "w3lib/_url.pyx":895 - * index = current_index + 1 - current_length - * index_length = current_length - * return index # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1278 + * url.path += encoded * + * elif state == QUERY: # <<<<<<<<<<<<<< + * assert isinstance(url.query, str) + * if encoding != "utf-8" and ( + */ + goto __pyx_L16; + } + + /* "w3lib/_url.pyx":1303 + * buffer += c * + * elif state == FRAGMENT: # <<<<<<<<<<<<<< + * assert isinstance(url.fragment, str) + * if c is not None: */ - __Pyx_XDECREF(__pyx_r); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_index))||((__pyx_v_index) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_index))) __PYX_ERR(0, 895, __pyx_L1_error) - __Pyx_INCREF(__pyx_v_index); - __pyx_r = ((PyObject*)__pyx_v_index); - goto __pyx_L0; + __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FRAGMENT); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":881 + /* "w3lib/_url.pyx":1304 * + * elif state == FRAGMENT: + * assert isinstance(url.fragment, str) # <<<<<<<<<<<<<< + * if c is not None: + * assert isinstance(c, str) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_1 = PyUnicode_Check(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 1304, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 1304, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":1305 + * elif state == FRAGMENT: + * assert isinstance(url.fragment, str) + * if c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * url.fragment += _idempotent_utf_8_percent_encode( + */ + __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":1306 + * assert isinstance(url.fragment, str) + * if c is not None: + * assert isinstance(c, str) # <<<<<<<<<<<<<< + * url.fragment += _idempotent_utf_8_percent_encode( + * input=input, pointer=pointer, encode_set=fragment_percent_encode_set + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = PyUnicode_Check(__pyx_v_c); + if (unlikely(!__pyx_t_1)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 1306, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 1306, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":1307 + * if c is not None: + * assert isinstance(c, str) + * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * input=input, pointer=pointer, encode_set=fragment_percent_encode_set + * ) + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + + /* "w3lib/_url.pyx":1308 + * assert isinstance(c, str) + * url.fragment += _idempotent_utf_8_percent_encode( + * input=input, pointer=pointer, encode_set=fragment_percent_encode_set # <<<<<<<<<<<<<< + * ) * - * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< - * address: List[int], *, min_length: int = 2 - * ) -> Optional[int]: */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1308, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 1308, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_fragment_percent_encode_set) < 0) __PYX_ERR(0, 1308, __pyx_L1_error) - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("w3lib._url._get_ipv6_first_longest_0_piece_index", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_index); - __Pyx_XDECREF(__pyx_v_index_length); - __Pyx_XDECREF(__pyx_v_current_length); - __Pyx_XDECREF(__pyx_v_current_index); - __Pyx_XDECREF(__pyx_v_piece); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "w3lib/_url.pyx":1307 + * if c is not None: + * assert isinstance(c, str) + * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * input=input, pointer=pointer, encode_set=fragment_percent_encode_set + * ) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_15, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_t_2) < 0) __PYX_ERR(0, 1307, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1305 + * elif state == FRAGMENT: + * assert isinstance(url.fragment, str) + * if c is not None: # <<<<<<<<<<<<<< + * assert isinstance(c, str) + * url.fragment += _idempotent_utf_8_percent_encode( + */ + } -/* "w3lib/_url.pyx":899 + /* "w3lib/_url.pyx":1303 + * buffer += c * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer - * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< - * output = "" - * compress = _get_ipv6_first_longest_0_piece_index(address) + * elif state == FRAGMENT: # <<<<<<<<<<<<<< + * assert isinstance(url.fragment, str) + * if c is not None: */ + } + __pyx_L16:; -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_37_serialize_ipv6(PyObject *__pyx_self, + /* "w3lib/_url.pyx":1311 + * ) + * + * if pointer >= input_length: # <<<<<<<<<<<<<< + * break + * pointer += 1 + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1311, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1311, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "w3lib/_url.pyx":1312 + * + * if pointer >= input_length: + * break # <<<<<<<<<<<<<< + * pointer += 1 + * + */ + goto __pyx_L5_break; + + /* "w3lib/_url.pyx":1311 + * ) + * + * if pointer >= input_length: # <<<<<<<<<<<<<< + * break + * pointer += 1 + */ + } + + /* "w3lib/_url.pyx":1313 + * if pointer >= input_length: + * break + * pointer += 1 # <<<<<<<<<<<<<< + * + * return url + */ + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L5_break:; + + /* "w3lib/_url.pyx":1315 + * pointer += 1 + * + * return url # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_url); + __pyx_r = __pyx_v_url; + goto __pyx_L0; + + /* "w3lib/_url.pyx":887 + * + * + * def _parse_url( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_base); + __Pyx_XDECREF(__pyx_v_url); + __Pyx_XDECREF(__pyx_v_buffer); + __Pyx_XDECREF(__pyx_v_pointer); + __Pyx_XDECREF(__pyx_v_c); + __Pyx_XDECREF(__pyx_v_at_sign_index); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_code_point); + __Pyx_XDECREF(__pyx_v_encoded_code_points); + __Pyx_XDECREF(__pyx_v_host); + __Pyx_XDECREF(__pyx_v_port); + __Pyx_XDECREF(__pyx_v_encoded); + __Pyx_XDECREF(__pyx_v_percent_encode_set); + __Pyx_XDECREF(__pyx_v_input); + __Pyx_XDECREF(__pyx_v_encoding); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":1319 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 + * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< + * output = "" + * n = address + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_39_serialize_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_36_serialize_ipv6, "_serialize_ipv6(list address: List[int]) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_37_serialize_ipv6 = {"_serialize_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_37_serialize_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_36_serialize_ipv6}; -static PyObject *__pyx_pw_5w3lib_4_url_37_serialize_ipv6(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_39_serialize_ipv4 = {"_serialize_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_39_serialize_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_39_serialize_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19052,7 +20291,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_serialize_ipv6 (wrapper)", 0); + __Pyx_RefNannySetupContext("_serialize_ipv4 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -19078,12 +20317,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 899, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1319, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv6") < 0)) __PYX_ERR(0, 899, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv4") < 0)) __PYX_ERR(0, 1319, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19094,7 +20333,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 899, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1319, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19104,12 +20343,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._serialize_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._serialize_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 899, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_36_serialize_ipv6(__pyx_self, __pyx_v_address); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyInt_Type), 0, "address", 1))) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_38_serialize_ipv4(__pyx_self, __pyx_v_address); /* function exit code */ goto __pyx_L0; @@ -19126,344 +20365,252 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_36_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { +static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { PyObject *__pyx_v_output = NULL; - PyObject *__pyx_v_compress = NULL; - int __pyx_v_ignore0; - long __pyx_v_piece_index; - PyObject *__pyx_v_separator = NULL; + PyObject *__pyx_v_n = NULL; + long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + long __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; - long __pyx_t_5; - int __pyx_t_6; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_serialize_ipv6", 1); + __Pyx_RefNannySetupContext("_serialize_ipv4", 1); - /* "w3lib/_url.pyx":900 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer - * def _serialize_ipv6(address: List[int]) -> str: + /* "w3lib/_url.pyx":1320 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 + * def _serialize_ipv4(address: int) -> str: * output = "" # <<<<<<<<<<<<<< - * compress = _get_ipv6_first_longest_0_piece_index(address) - * ignore0 = False + * n = address + * for i in range(1, 5): */ __Pyx_INCREF(__pyx_kp_u__2); __pyx_v_output = __pyx_kp_u__2; - /* "w3lib/_url.pyx":901 - * def _serialize_ipv6(address: List[int]) -> str: + /* "w3lib/_url.pyx":1321 + * def _serialize_ipv4(address: int) -> str: * output = "" - * compress = _get_ipv6_first_longest_0_piece_index(address) # <<<<<<<<<<<<<< - * ignore0 = False - * for piece_index in range(8): + * n = address # <<<<<<<<<<<<<< + * for i in range(1, 5): + * output = str(n % 256) + output */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_ipv6_first_longest_0_piece); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_address}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_v_compress = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_address); + __pyx_v_n = __pyx_v_address; - /* "w3lib/_url.pyx":902 + /* "w3lib/_url.pyx":1322 * output = "" - * compress = _get_ipv6_first_longest_0_piece_index(address) - * ignore0 = False # <<<<<<<<<<<<<< - * for piece_index in range(8): - * if ignore0: + * n = address + * for i in range(1, 5): # <<<<<<<<<<<<<< + * output = str(n % 256) + output + * if i != 4: */ - __pyx_v_ignore0 = 0; + for (__pyx_t_1 = 1; __pyx_t_1 < 5; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; - /* "w3lib/_url.pyx":903 - * compress = _get_ipv6_first_longest_0_piece_index(address) - * ignore0 = False - * for piece_index in range(8): # <<<<<<<<<<<<<< - * if ignore0: - * if not address[piece_index]: + /* "w3lib/_url.pyx":1323 + * n = address + * for i in range(1, 5): + * output = str(n % 256) + output # <<<<<<<<<<<<<< + * if i != 4: + * output = "." + output */ - for (__pyx_t_5 = 0; __pyx_t_5 < 8; __pyx_t_5+=1) { - __pyx_v_piece_index = __pyx_t_5; + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; - /* "w3lib/_url.pyx":904 - * ignore0 = False - * for piece_index in range(8): - * if ignore0: # <<<<<<<<<<<<<< - * if not address[piece_index]: - * continue + /* "w3lib/_url.pyx":1324 + * for i in range(1, 5): + * output = str(n % 256) + output + * if i != 4: # <<<<<<<<<<<<<< + * output = "." + output + * n = floor(n / 256) */ - if (__pyx_v_ignore0) { + __pyx_t_4 = (__pyx_v_i != 4); + if (__pyx_t_4) { - /* "w3lib/_url.pyx":905 - * for piece_index in range(8): - * if ignore0: - * if not address[piece_index]: # <<<<<<<<<<<<<< - * continue - * ignore0 = False + /* "w3lib/_url.pyx":1325 + * output = str(n % 256) + output + * if i != 4: + * output = "." + output # <<<<<<<<<<<<<< + * n = floor(n / 256) + * return output */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 905, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = (!__pyx_t_6); - if (__pyx_t_7) { + __pyx_t_2 = PyNumber_Add(__pyx_kp_u__6, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; - /* "w3lib/_url.pyx":906 - * if ignore0: - * if not address[piece_index]: - * continue # <<<<<<<<<<<<<< - * ignore0 = False - * if compress == piece_index: + /* "w3lib/_url.pyx":1324 + * for i in range(1, 5): + * output = str(n % 256) + output + * if i != 4: # <<<<<<<<<<<<<< + * output = "." + output + * n = floor(n / 256) */ - goto __pyx_L3_continue; + } - /* "w3lib/_url.pyx":905 - * for piece_index in range(8): - * if ignore0: - * if not address[piece_index]: # <<<<<<<<<<<<<< - * continue - * ignore0 = False + /* "w3lib/_url.pyx":1326 + * if i != 4: + * output = "." + output + * n = floor(n / 256) # <<<<<<<<<<<<<< + * return output + * */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; } - - /* "w3lib/_url.pyx":907 - * if not address[piece_index]: - * continue - * ignore0 = False # <<<<<<<<<<<<<< - * if compress == piece_index: - * separator = "::" if piece_index == 0 else ":" - */ - __pyx_v_ignore0 = 0; - - /* "w3lib/_url.pyx":904 - * ignore0 = False - * for piece_index in range(8): - * if ignore0: # <<<<<<<<<<<<<< - * if not address[piece_index]: - * continue - */ } - - /* "w3lib/_url.pyx":908 - * continue - * ignore0 = False - * if compress == piece_index: # <<<<<<<<<<<<<< - * separator = "::" if piece_index == 0 else ":" - * output += separator - */ - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_compress, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_7) { - - /* "w3lib/_url.pyx":909 - * ignore0 = False - * if compress == piece_index: - * separator = "::" if piece_index == 0 else ":" # <<<<<<<<<<<<<< - * output += separator - * ignore0 = True - */ - __pyx_t_7 = (__pyx_v_piece_index == 0); - if (__pyx_t_7) { - __Pyx_INCREF(__pyx_kp_u__21); - __pyx_t_2 = __pyx_kp_u__21; - } else { - __Pyx_INCREF(__pyx_kp_u__5); - __pyx_t_2 = __pyx_kp_u__5; - } - __Pyx_XDECREF_SET(__pyx_v_separator, ((PyObject*)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "w3lib/_url.pyx":910 - * if compress == piece_index: - * separator = "::" if piece_index == 0 else ":" - * output += separator # <<<<<<<<<<<<<< - * ignore0 = True - * continue - */ - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_output, __pyx_v_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 910, __pyx_L1_error) + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "w3lib/_url.pyx":911 - * separator = "::" if piece_index == 0 else ":" - * output += separator - * ignore0 = True # <<<<<<<<<<<<<< - * continue - * output += f"{address[piece_index]:x}" - */ - __pyx_v_ignore0 = 1; - - /* "w3lib/_url.pyx":912 - * output += separator - * ignore0 = True - * continue # <<<<<<<<<<<<<< - * output += f"{address[piece_index]:x}" - * if piece_index != 7: - */ - goto __pyx_L3_continue; - - /* "w3lib/_url.pyx":908 - * continue - * ignore0 = False - * if compress == piece_index: # <<<<<<<<<<<<<< - * separator = "::" if piece_index == 0 else ":" - * output += separator - */ + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - - /* "w3lib/_url.pyx":913 - * ignore0 = True - * continue - * output += f"{address[piece_index]:x}" # <<<<<<<<<<<<<< - * if piece_index != 7: - * output += ":" - */ - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); + __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; - - /* "w3lib/_url.pyx":914 - * continue - * output += f"{address[piece_index]:x}" - * if piece_index != 7: # <<<<<<<<<<<<<< - * output += ":" - * return output - */ - __pyx_t_7 = (__pyx_v_piece_index != 7); - if (__pyx_t_7) { - - /* "w3lib/_url.pyx":915 - * output += f"{address[piece_index]:x}" - * if piece_index != 7: - * output += ":" # <<<<<<<<<<<<<< - * return output - * - */ - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "w3lib/_url.pyx":914 - * continue - * output += f"{address[piece_index]:x}" - * if piece_index != 7: # <<<<<<<<<<<<<< - * output += ":" - * return output - */ - } - __pyx_L3_continue:; } - /* "w3lib/_url.pyx":916 - * if piece_index != 7: - * output += ":" + /* "w3lib/_url.pyx":1327 + * output = "." + output + * n = floor(n / 256) * return output # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_INCREF(__pyx_v_output); - __pyx_r = __pyx_v_output; + __pyx_r = ((PyObject*)__pyx_v_output); goto __pyx_L0; - /* "w3lib/_url.pyx":899 + /* "w3lib/_url.pyx":1319 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer - * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 + * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< * output = "" - * compress = _get_ipv6_first_longest_0_piece_index(address) + * n = address */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("w3lib._url._serialize_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("w3lib._url._serialize_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_output); - __Pyx_XDECREF(__pyx_v_compress); - __Pyx_XDECREF(__pyx_v_separator); + __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":920 +/* "w3lib/_url.pyx":1330 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer - * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< - * if isinstance(host, int): - * return _serialize_ipv4(host) + * + * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< + * address: List[int], *, min_length: int = 2 + * ) -> Optional[int]: */ +static PyObject *__pyx_pf_5w3lib_4_url_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_length, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_min_length) < 0) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 1330, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("w3lib._url.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_39_serialize_host(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_38_serialize_host, "_serialize_host(host: Union[str, int, List[int]]) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_39_serialize_host = {"_serialize_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_39_serialize_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_38_serialize_host}; -static PyObject *__pyx_pw_5w3lib_4_url_39_serialize_host(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index = {"_get_ipv6_first_longest_0_piece_index", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_host = 0; + PyObject *__pyx_v_address = 0; + PyObject *__pyx_v_min_length = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_serialize_host (wrapper)", 0); + __Pyx_RefNannySetupContext("_get_ipv6_first_longest_0_piece_index (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -19473,7 +20620,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_address,&__pyx_n_s_min_length,0}; + __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self); + values[1] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_min_length); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -19485,27 +20634,34 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_host)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_address)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1330, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1330, __pyx_L3_error) + } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_host") < 0)) __PYX_ERR(0, 920, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_ipv6_first_longest_0_piece_index") < 0)) __PYX_ERR(0, 1330, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_host = values[0]; + __pyx_v_address = ((PyObject*)values[0]); + __pyx_v_min_length = ((PyObject*)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 920, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_ipv6_first_longest_0_piece_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1330, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19515,13 +20671,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._serialize_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._get_ipv6_first_longest_0_piece_index", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_38_serialize_host(__pyx_self, __pyx_v_host); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1331, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_min_length), (&PyInt_Type), 0, "min_length", 1))) __PYX_ERR(0, 1331, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(__pyx_self, __pyx_v_address, __pyx_v_min_length); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -19532,229 +20694,285 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host) { +static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length) { + PyObject *__pyx_v_index = NULL; + PyObject *__pyx_v_index_length = NULL; + PyObject *__pyx_v_current_length = NULL; + PyObject *__pyx_v_current_index = NULL; + PyObject *__pyx_v_piece = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; - Py_ssize_t __pyx_t_6; - Py_UCS4 __pyx_t_7; - PyObject *__pyx_t_8 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_serialize_host", 1); + __Pyx_RefNannySetupContext("_get_ipv6_first_longest_0_piece_index", 1); - /* "w3lib/_url.pyx":921 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer - * def _serialize_host(host: Union[str, int, List[int]]) -> str: - * if isinstance(host, int): # <<<<<<<<<<<<<< - * return _serialize_ipv4(host) - * if isinstance(host, list): + /* "w3lib/_url.pyx":1333 + * address: List[int], *, min_length: int = 2 + * ) -> Optional[int]: + * index = None # <<<<<<<<<<<<<< + * index_length = 0 + * current_length = 0 */ - __pyx_t_1 = PyInt_Check(__pyx_v_host); - if (__pyx_t_1) { + __Pyx_INCREF(Py_None); + __pyx_v_index = Py_None; - /* "w3lib/_url.pyx":922 - * def _serialize_host(host: Union[str, int, List[int]]) -> str: - * if isinstance(host, int): - * return _serialize_ipv4(host) # <<<<<<<<<<<<<< - * if isinstance(host, list): - * return f"[{_serialize_ipv6(host)}]" + /* "w3lib/_url.pyx":1334 + * ) -> Optional[int]: + * index = None + * index_length = 0 # <<<<<<<<<<<<<< + * current_length = 0 + * for current_index, piece in enumerate(address): */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_serialize_ipv4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 922, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif + __Pyx_INCREF(__pyx_int_0); + __pyx_v_index_length = __pyx_int_0; + + /* "w3lib/_url.pyx":1335 + * index = None + * index_length = 0 + * current_length = 0 # <<<<<<<<<<<<<< + * for current_index, piece in enumerate(address): + * if piece != 0: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_current_length = __pyx_int_0; + + /* "w3lib/_url.pyx":1336 + * index_length = 0 + * current_length = 0 + * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< + * if piece != 0: + * current_length = 0 + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + __pyx_t_2 = __pyx_v_address; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; + for (;;) { { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_host}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1336, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 922, __pyx_L1_error) - __pyx_r = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - goto __pyx_L0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1336, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XDECREF_SET(__pyx_v_piece, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_current_index, __pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":921 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer - * def _serialize_host(host: Union[str, int, List[int]]) -> str: - * if isinstance(host, int): # <<<<<<<<<<<<<< - * return _serialize_ipv4(host) - * if isinstance(host, list): + /* "w3lib/_url.pyx":1337 + * current_length = 0 + * for current_index, piece in enumerate(address): + * if piece != 0: # <<<<<<<<<<<<<< + * current_length = 0 + * continue */ - } + __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1337, __pyx_L1_error) + if (__pyx_t_5) { - /* "w3lib/_url.pyx":923 - * if isinstance(host, int): - * return _serialize_ipv4(host) - * if isinstance(host, list): # <<<<<<<<<<<<<< - * return f"[{_serialize_ipv6(host)}]" - * return host + /* "w3lib/_url.pyx":1338 + * for current_index, piece in enumerate(address): + * if piece != 0: + * current_length = 0 # <<<<<<<<<<<<<< + * continue + * current_length += 1 */ - __pyx_t_1 = PyList_Check(__pyx_v_host); - if (__pyx_t_1) { + __Pyx_INCREF(__pyx_int_0); + __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_int_0); - /* "w3lib/_url.pyx":924 - * return _serialize_ipv4(host) - * if isinstance(host, list): - * return f"[{_serialize_ipv6(host)}]" # <<<<<<<<<<<<<< - * return host - * + /* "w3lib/_url.pyx":1339 + * if piece != 0: + * current_length = 0 + * continue # <<<<<<<<<<<<<< + * current_length += 1 + * if current_length > index_length and current_length >= min_length: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = 0; - __pyx_t_7 = 127; - __Pyx_INCREF(__pyx_kp_u__8); - __pyx_t_6 += 1; - __Pyx_GIVEREF(__pyx_kp_u__8); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__8); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_serialize_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error) + goto __pyx_L3_continue; + + /* "w3lib/_url.pyx":1337 + * current_length = 0 + * for current_index, piece in enumerate(address): + * if piece != 0: # <<<<<<<<<<<<<< + * current_length = 0 + * continue + */ + } + + /* "w3lib/_url.pyx":1340 + * current_length = 0 + * continue + * current_length += 1 # <<<<<<<<<<<<<< + * if current_length > index_length and current_length >= min_length: + * index = current_index + 1 - current_length + */ + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":1341 + * continue + * current_length += 1 + * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< + * index = current_index + 1 - current_length + * index_length = current_length + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_index_length, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1341, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1341, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L7_bool_binop_done; } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_host}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_min_length, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1341, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1341, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __pyx_t_6; + __pyx_L7_bool_binop_done:; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":1342 + * current_length += 1 + * if current_length > index_length and current_length >= min_length: + * index = current_index + 1 - current_length # <<<<<<<<<<<<<< + * index_length = current_length + * return index + */ + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_v_current_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_7); + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":1343 + * if current_length > index_length and current_length >= min_length: + * index = current_index + 1 - current_length + * index_length = current_length # <<<<<<<<<<<<<< + * return index + * + */ + __Pyx_INCREF(__pyx_v_current_length); + __Pyx_DECREF_SET(__pyx_v_index_length, __pyx_v_current_length); + + /* "w3lib/_url.pyx":1341 + * continue + * current_length += 1 + * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< + * index = current_index + 1 - current_length + * index_length = current_length + */ } - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7; - __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u__9); - __pyx_t_6 += 1; - __Pyx_GIVEREF(__pyx_kp_u__9); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__9); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; - goto __pyx_L0; - /* "w3lib/_url.pyx":923 - * if isinstance(host, int): - * return _serialize_ipv4(host) - * if isinstance(host, list): # <<<<<<<<<<<<<< - * return f"[{_serialize_ipv6(host)}]" - * return host + /* "w3lib/_url.pyx":1336 + * index_length = 0 + * current_length = 0 + * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< + * if piece != 0: + * current_length = 0 */ + __pyx_L3_continue:; } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":925 - * if isinstance(host, list): - * return f"[{_serialize_ipv6(host)}]" - * return host # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1344 + * index = current_index + 1 - current_length + * index_length = current_length + * return index # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_host))||((__pyx_v_host) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_host))) __PYX_ERR(0, 925, __pyx_L1_error) - __Pyx_INCREF(__pyx_v_host); - __pyx_r = ((PyObject*)__pyx_v_host); + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_index))||((__pyx_v_index) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_index))) __PYX_ERR(0, 1344, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_index); + __pyx_r = ((PyObject*)__pyx_v_index); goto __pyx_L0; - /* "w3lib/_url.pyx":920 + /* "w3lib/_url.pyx":1330 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer - * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< - * if isinstance(host, int): - * return _serialize_ipv4(host) + * + * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< + * address: List[int], *, min_length: int = 2 + * ) -> Optional[int]: */ /* function exit code */ __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("w3lib._url._serialize_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._get_ipv6_first_longest_0_piece_index", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XDECREF(__pyx_v_index_length); + __Pyx_XDECREF(__pyx_v_current_length); + __Pyx_XDECREF(__pyx_v_current_index); + __Pyx_XDECREF(__pyx_v_piece); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":929 +/* "w3lib/_url.pyx":1348 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer - * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< - * if url.has_opaque_path(): - * assert isinstance(url.path, str) + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer + * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< + * output = "" + * compress = _get_ipv6_first_longest_0_piece_index(address) */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_41_serialize_url_path(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_43_serialize_ipv6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_40_serialize_url_path, "_serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_4_url_41_serialize_url_path = {"_serialize_url_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_41_serialize_url_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_40_serialize_url_path}; -static PyObject *__pyx_pw_5w3lib_4_url_41_serialize_url_path(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_43_serialize_ipv6 = {"_serialize_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_43_serialize_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_43_serialize_ipv6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_url = 0; - PyObject *__pyx_v_canonicalize = 0; + PyObject *__pyx_v_address = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_serialize_url_path (wrapper)", 0); + __Pyx_RefNannySetupContext("_serialize_ipv6 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -19764,8 +20982,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,&__pyx_n_s_canonicalize,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_address,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -19777,34 +20994,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_address)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 929, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1348, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } - if (kw_args == 1) { - const Py_ssize_t index = 1; - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); - if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 929, __pyx_L3_error) - } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url_path") < 0)) __PYX_ERR(0, 929, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv6") < 0)) __PYX_ERR(0, 1348, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_url = values[0]; - __pyx_v_canonicalize = values[1]; + __pyx_v_address = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_url_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 929, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1348, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19814,13 +21024,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._serialize_url_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._serialize_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_40_serialize_url_path(__pyx_self, __pyx_v_url, __pyx_v_canonicalize); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_42_serialize_ipv6(__pyx_self, __pyx_v_address); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -19831,38 +21046,49 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_canonicalize) { +static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { PyObject *__pyx_v_output = NULL; - PyObject *__pyx_v_segment = NULL; + PyObject *__pyx_v_compress = NULL; + int __pyx_v_ignore0; + long __pyx_v_piece_index; + PyObject *__pyx_v_separator = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; + long __pyx_t_5; + int __pyx_t_6; int __pyx_t_7; - int __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_serialize_url_path", 1); + __Pyx_RefNannySetupContext("_serialize_ipv6", 1); - /* "w3lib/_url.pyx":930 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer - * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: - * if url.has_opaque_path(): # <<<<<<<<<<<<<< - * assert isinstance(url.path, str) - * return url.path + /* "w3lib/_url.pyx":1349 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer + * def _serialize_ipv6(address: List[int]) -> str: + * output = "" # <<<<<<<<<<<<<< + * compress = _get_ipv6_first_longest_0_piece_index(address) + * ignore0 = False + */ + __Pyx_INCREF(__pyx_kp_u__2); + __pyx_v_output = __pyx_kp_u__2; + + /* "w3lib/_url.pyx":1350 + * def _serialize_ipv6(address: List[int]) -> str: + * output = "" + * compress = _get_ipv6_first_longest_0_piece_index(address) # <<<<<<<<<<<<<< + * ignore0 = False + * for piece_index in range(8): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_ipv6_first_longest_0_piece); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { + if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); @@ -19874,222 +21100,220 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_address}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 930, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { + __pyx_v_compress = __pyx_t_1; + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":931 - * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: - * if url.has_opaque_path(): - * assert isinstance(url.path, str) # <<<<<<<<<<<<<< - * return url.path - * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: + /* "w3lib/_url.pyx":1351 + * output = "" + * compress = _get_ipv6_first_longest_0_piece_index(address) + * ignore0 = False # <<<<<<<<<<<<<< + * for piece_index in range(8): + * if ignore0: */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyUnicode_Check(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_5)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 931, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 931, __pyx_L1_error) - #endif + __pyx_v_ignore0 = 0; - /* "w3lib/_url.pyx":932 - * if url.has_opaque_path(): - * assert isinstance(url.path, str) - * return url.path # <<<<<<<<<<<<<< - * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: - * return "" + /* "w3lib/_url.pyx":1352 + * compress = _get_ipv6_first_longest_0_piece_index(address) + * ignore0 = False + * for piece_index in range(8): # <<<<<<<<<<<<<< + * if ignore0: + * if not address[piece_index]: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 932, __pyx_L1_error) - __pyx_r = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; + for (__pyx_t_5 = 0; __pyx_t_5 < 8; __pyx_t_5+=1) { + __pyx_v_piece_index = __pyx_t_5; - /* "w3lib/_url.pyx":930 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer - * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: - * if url.has_opaque_path(): # <<<<<<<<<<<<<< - * assert isinstance(url.path, str) - * return url.path + /* "w3lib/_url.pyx":1353 + * ignore0 = False + * for piece_index in range(8): + * if ignore0: # <<<<<<<<<<<<<< + * if not address[piece_index]: + * continue */ - } + if (__pyx_v_ignore0) { - /* "w3lib/_url.pyx":933 - * assert isinstance(url.path, str) - * return url.path - * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: # <<<<<<<<<<<<<< - * return "" - * output = "" + /* "w3lib/_url.pyx":1354 + * for piece_index in range(8): + * if ignore0: + * if not address[piece_index]: # <<<<<<<<<<<<<< + * continue + * ignore0 = False */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 933, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = (__pyx_t_6 <= 1); - if (__pyx_t_7) { - } else { - __pyx_t_5 = __pyx_t_7; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 933, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_7) { - } else { - __pyx_t_5 = __pyx_t_7; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 933, __pyx_L1_error) - __pyx_t_8 = (!__pyx_t_7); - __pyx_t_5 = __pyx_t_8; - __pyx_L5_bool_binop_done:; - if (__pyx_t_5) { + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1354, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = (!__pyx_t_6); + if (__pyx_t_7) { - /* "w3lib/_url.pyx":934 - * return url.path - * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: - * return "" # <<<<<<<<<<<<<< - * output = "" - * for segment in url.path: + /* "w3lib/_url.pyx":1355 + * if ignore0: + * if not address[piece_index]: + * continue # <<<<<<<<<<<<<< + * ignore0 = False + * if compress == piece_index: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_kp_u__2); - __pyx_r = __pyx_kp_u__2; - goto __pyx_L0; + goto __pyx_L3_continue; - /* "w3lib/_url.pyx":933 - * assert isinstance(url.path, str) - * return url.path - * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: # <<<<<<<<<<<<<< - * return "" - * output = "" + /* "w3lib/_url.pyx":1354 + * for piece_index in range(8): + * if ignore0: + * if not address[piece_index]: # <<<<<<<<<<<<<< + * continue + * ignore0 = False */ - } + } - /* "w3lib/_url.pyx":935 - * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: - * return "" - * output = "" # <<<<<<<<<<<<<< - * for segment in url.path: - * output += f"/{segment}" + /* "w3lib/_url.pyx":1356 + * if not address[piece_index]: + * continue + * ignore0 = False # <<<<<<<<<<<<<< + * if compress == piece_index: + * separator = "::" if piece_index == 0 else ":" */ - __Pyx_INCREF(__pyx_kp_u__2); - __pyx_v_output = __pyx_kp_u__2; + __pyx_v_ignore0 = 0; - /* "w3lib/_url.pyx":936 - * return "" - * output = "" - * for segment in url.path: # <<<<<<<<<<<<<< - * output += f"/{segment}" - * return output + /* "w3lib/_url.pyx":1353 + * ignore0 = False + * for piece_index in range(8): + * if ignore0: # <<<<<<<<<<<<<< + * if not address[piece_index]: + * continue */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = 0; - __pyx_t_9 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 936, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 936, __pyx_L1_error) - #endif - if (__pyx_t_6 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 936, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 936, __pyx_L1_error) - #endif - if (__pyx_t_6 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 936, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_9(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 936, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); } - __Pyx_XDECREF_SET(__pyx_v_segment, __pyx_t_1); - __pyx_t_1 = 0; - /* "w3lib/_url.pyx":937 - * output = "" - * for segment in url.path: - * output += f"/{segment}" # <<<<<<<<<<<<<< - * return output - * + /* "w3lib/_url.pyx":1357 + * continue + * ignore0 = False + * if compress == piece_index: # <<<<<<<<<<<<<< + * separator = "::" if piece_index == 0 else ":" + * output += separator */ - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_segment, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_compress, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":936 - * return "" - * output = "" - * for segment in url.path: # <<<<<<<<<<<<<< - * output += f"/{segment}" + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1357, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_7) { + + /* "w3lib/_url.pyx":1358 + * ignore0 = False + * if compress == piece_index: + * separator = "::" if piece_index == 0 else ":" # <<<<<<<<<<<<<< + * output += separator + * ignore0 = True + */ + __pyx_t_7 = (__pyx_v_piece_index == 0); + if (__pyx_t_7) { + __Pyx_INCREF(__pyx_kp_u__21); + __pyx_t_2 = __pyx_kp_u__21; + } else { + __Pyx_INCREF(__pyx_kp_u__5); + __pyx_t_2 = __pyx_kp_u__5; + } + __Pyx_XDECREF_SET(__pyx_v_separator, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1359 + * if compress == piece_index: + * separator = "::" if piece_index == 0 else ":" + * output += separator # <<<<<<<<<<<<<< + * ignore0 = True + * continue + */ + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_output, __pyx_v_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1360 + * separator = "::" if piece_index == 0 else ":" + * output += separator + * ignore0 = True # <<<<<<<<<<<<<< + * continue + * output += f"{address[piece_index]:x}" + */ + __pyx_v_ignore0 = 1; + + /* "w3lib/_url.pyx":1361 + * output += separator + * ignore0 = True + * continue # <<<<<<<<<<<<<< + * output += f"{address[piece_index]:x}" + * if piece_index != 7: + */ + goto __pyx_L3_continue; + + /* "w3lib/_url.pyx":1357 + * continue + * ignore0 = False + * if compress == piece_index: # <<<<<<<<<<<<<< + * separator = "::" if piece_index == 0 else ":" + * output += separator + */ + } + + /* "w3lib/_url.pyx":1362 + * ignore0 = True + * continue + * output += f"{address[piece_index]:x}" # <<<<<<<<<<<<<< + * if piece_index != 7: + * output += ":" + */ + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1363 + * continue + * output += f"{address[piece_index]:x}" + * if piece_index != 7: # <<<<<<<<<<<<<< + * output += ":" + * return output + */ + __pyx_t_7 = (__pyx_v_piece_index != 7); + if (__pyx_t_7) { + + /* "w3lib/_url.pyx":1364 + * output += f"{address[piece_index]:x}" + * if piece_index != 7: + * output += ":" # <<<<<<<<<<<<<< + * return output + * + */ + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1363 + * continue + * output += f"{address[piece_index]:x}" + * if piece_index != 7: # <<<<<<<<<<<<<< + * output += ":" * return output */ + } + __pyx_L3_continue:; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":938 - * for segment in url.path: - * output += f"/{segment}" + /* "w3lib/_url.pyx":1365 + * if piece_index != 7: + * output += ":" * return output # <<<<<<<<<<<<<< * * @@ -20099,12 +21323,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "w3lib/_url.pyx":929 + /* "w3lib/_url.pyx":1348 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer - * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< - * if url.has_opaque_path(): - * assert isinstance(url.path, str) + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer + * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< + * output = "" + * compress = _get_ipv6_first_longest_0_piece_index(address) */ /* function exit code */ @@ -20112,55 +21336,53 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_url_path(CYTHON_UNUSED PyObj __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("w3lib._url._serialize_url_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._serialize_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_output); - __Pyx_XDECREF(__pyx_v_segment); + __Pyx_XDECREF(__pyx_v_compress); + __Pyx_XDECREF(__pyx_v_separator); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":942 +/* "w3lib/_url.pyx":1369 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing - * def _serialize_url( # <<<<<<<<<<<<<< - * url: _URL, - * *, + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer + * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< + * if isinstance(host, int): + * return _serialize_ipv4(host) */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_43_serialize_url(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_45_serialize_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_42_serialize_url, "_serialize_url(url: _URL, *, exclude_fragment: bool = False, canonicalize: Optional[bool] = None) -> str\nReturn a string representation of *url* following the URL serialization\n algorithm defined in the `URL living standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer\n\n If *exclude_fragment* is ``True``, the returned URL does not include\n :attr:`_URL.fragment`.\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *canonicalize*:\n\n - ``None``: Do not deviate from the standard algorithm to apply or\n prevent URL canonicalization.\n\n - ``True``: Deviate from the standard as needed to make sure that\n functionally-equivalent URLs are always rendered the same way.\n\n This value has no effect at the moment, i.e. it applies the same\n level of canonicalization as the standard algorithm.\n\n - ``False``: Deviate from the standard as needed to make sure that\n the returned URL string is as close as possible to the original URL\n string that was parsed into *url*, as long as the returned URL\n string is still a valid URL.\n\n At the moment, this ensures that the password separator (:) is\n included into the returned URL string as long as it was present on\n the original URL string, even if :attr:`_URL.password` is an empty\n string.\n "); -static PyMethodDef __pyx_mdef_5w3lib_4_url_43_serialize_url = {"_serialize_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_43_serialize_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_42_serialize_url}; -static PyObject *__pyx_pw_5w3lib_4_url_43_serialize_url(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_45_serialize_host = {"_serialize_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_45_serialize_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_45_serialize_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_url = 0; - PyObject *__pyx_v_exclude_fragment = 0; - PyObject *__pyx_v_canonicalize = 0; + PyObject *__pyx_v_host = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_serialize_url (wrapper)", 0); + __Pyx_RefNannySetupContext("_serialize_host (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -20170,25 +21392,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,&__pyx_n_s_exclude_fragment,&__pyx_n_s_canonicalize,0}; - - /* "w3lib/_url.pyx":945 - * url: _URL, - * *, - * exclude_fragment: bool = False, # <<<<<<<<<<<<<< - * canonicalize: Optional[bool] = None, - * ) -> str: - */ - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - - /* "w3lib/_url.pyx":946 - * *, - * exclude_fragment: bool = False, - * canonicalize: Optional[bool] = None, # <<<<<<<<<<<<<< - * ) -> str: - * """Return a string representation of *url* following the URL serialization - */ - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -20200,37 +21404,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_host)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 942, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1369, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } - if (kw_args > 0 && likely(kw_args <= 2)) { - Py_ssize_t index; - for (index = 1; index < 3 && kw_args > 0; index++) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); - if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 942, __pyx_L3_error) - } - } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url") < 0)) __PYX_ERR(0, 942, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_host") < 0)) __PYX_ERR(0, 1369, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_url = values[0]; - __pyx_v_exclude_fragment = values[1]; - __pyx_v_canonicalize = values[2]; + __pyx_v_host = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 942, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1369, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20240,19 +21434,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._serialize_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._serialize_host", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_42_serialize_url(__pyx_self, __pyx_v_url, __pyx_v_exclude_fragment, __pyx_v_canonicalize); - - /* "w3lib/_url.pyx":942 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing - * def _serialize_url( # <<<<<<<<<<<<<< - * url: _URL, - * *, - */ + __pyx_r = __pyx_pf_5w3lib_4_url_44_serialize_host(__pyx_self, __pyx_v_host); /* function exit code */ { @@ -20265,1269 +21451,2202 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_exclude_fragment, PyObject *__pyx_v_canonicalize) { - PyObject *__pyx_v_output = NULL; +static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_6; + Py_UCS4 __pyx_t_7; + PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_serialize_url", 1); - - /* "w3lib/_url.pyx":980 - * string. - * """ - * output = url.scheme + ":" # <<<<<<<<<<<<<< - * if url.hostname is not None: - * output += "//" - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_output = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_RefNannySetupContext("_serialize_host", 1); - /* "w3lib/_url.pyx":981 - * """ - * output = url.scheme + ":" - * if url.hostname is not None: # <<<<<<<<<<<<<< - * output += "//" - * if url.username or url.password: + /* "w3lib/_url.pyx":1370 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer + * def _serialize_host(host: Union[str, int, List[int]]) -> str: + * if isinstance(host, int): # <<<<<<<<<<<<<< + * return _serialize_ipv4(host) + * if isinstance(host, list): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = (__pyx_t_2 != Py_None); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { + __pyx_t_1 = PyInt_Check(__pyx_v_host); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":982 - * output = url.scheme + ":" - * if url.hostname is not None: - * output += "//" # <<<<<<<<<<<<<< - * if url.username or url.password: - * output += url.username + /* "w3lib/_url.pyx":1371 + * def _serialize_host(host: Union[str, int, List[int]]) -> str: + * if isinstance(host, int): + * return _serialize_ipv4(host) # <<<<<<<<<<<<<< + * if isinstance(host, list): + * return f"[{_serialize_ipv6(host)}]" */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_serialize_ipv4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_host}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 1371, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; - /* "w3lib/_url.pyx":983 - * if url.hostname is not None: - * output += "//" - * if url.username or url.password: # <<<<<<<<<<<<<< - * output += url.username - * if url.password: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 983, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_4) { - } else { - __pyx_t_3 = __pyx_t_4; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 983, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __pyx_t_4; - __pyx_L5_bool_binop_done:; - if (__pyx_t_3) { - - /* "w3lib/_url.pyx":984 - * output += "//" - * if url.username or url.password: - * output += url.username # <<<<<<<<<<<<<< - * if url.password: - * output += f":{url.password}" - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":985 - * if url.username or url.password: - * output += url.username - * if url.password: # <<<<<<<<<<<<<< - * output += f":{url.password}" - * elif not canonicalize and url._password_token_seen: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_3) { - - /* "w3lib/_url.pyx":986 - * output += url.username - * if url.password: - * output += f":{url.password}" # <<<<<<<<<<<<<< - * elif not canonicalize and url._password_token_seen: - * output += ":" - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; - - /* "w3lib/_url.pyx":985 - * if url.username or url.password: - * output += url.username - * if url.password: # <<<<<<<<<<<<<< - * output += f":{url.password}" - * elif not canonicalize and url._password_token_seen: - */ - goto __pyx_L7; - } - - /* "w3lib/_url.pyx":987 - * if url.password: - * output += f":{url.password}" - * elif not canonicalize and url._password_token_seen: # <<<<<<<<<<<<<< - * output += ":" - * output += "@" - */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 987, __pyx_L1_error) - __pyx_t_5 = (!__pyx_t_4); - if (__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L8_bool_binop_done; - } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 987, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L8_bool_binop_done:; - if (__pyx_t_3) { - - /* "w3lib/_url.pyx":988 - * output += f":{url.password}" - * elif not canonicalize and url._password_token_seen: - * output += ":" # <<<<<<<<<<<<<< - * output += "@" - * output += _serialize_host(url.hostname) - */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 988, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; - - /* "w3lib/_url.pyx":987 - * if url.password: - * output += f":{url.password}" - * elif not canonicalize and url._password_token_seen: # <<<<<<<<<<<<<< - * output += ":" - * output += "@" - */ - } - __pyx_L7:; - - /* "w3lib/_url.pyx":989 - * elif not canonicalize and url._password_token_seen: - * output += ":" - * output += "@" # <<<<<<<<<<<<<< - * output += _serialize_host(url.hostname) - * if url.port is not None: + /* "w3lib/_url.pyx":1370 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer + * def _serialize_host(host: Union[str, int, List[int]]) -> str: + * if isinstance(host, int): # <<<<<<<<<<<<<< + * return _serialize_ipv4(host) + * if isinstance(host, list): */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; + } - /* "w3lib/_url.pyx":983 - * if url.hostname is not None: - * output += "//" - * if url.username or url.password: # <<<<<<<<<<<<<< - * output += url.username - * if url.password: + /* "w3lib/_url.pyx":1372 + * if isinstance(host, int): + * return _serialize_ipv4(host) + * if isinstance(host, list): # <<<<<<<<<<<<<< + * return f"[{_serialize_ipv6(host)}]" + * return host */ - } + __pyx_t_1 = PyList_Check(__pyx_v_host); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":990 - * output += ":" - * output += "@" - * output += _serialize_host(url.hostname) # <<<<<<<<<<<<<< - * if url.port is not None: - * output += f":{url.port}" + /* "w3lib/_url.pyx":1373 + * return _serialize_ipv4(host) + * if isinstance(host, list): + * return f"[{_serialize_ipv6(host)}]" # <<<<<<<<<<<<<< + * return host + * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 990, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = 0; + __pyx_t_7 = 127; + __Pyx_INCREF(__pyx_kp_u__8); + __pyx_t_6 += 1; + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__8); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_serialize_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = NULL; + __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_7); + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_8 = 1; + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_host}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7; + __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_u__9); + __pyx_t_6 += 1; + __Pyx_GIVEREF(__pyx_kp_u__9); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__9); + __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_r = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L0; - /* "w3lib/_url.pyx":991 - * output += "@" - * output += _serialize_host(url.hostname) - * if url.port is not None: # <<<<<<<<<<<<<< - * output += f":{url.port}" - * elif not canonicalize: + /* "w3lib/_url.pyx":1372 + * if isinstance(host, int): + * return _serialize_ipv4(host) + * if isinstance(host, list): # <<<<<<<<<<<<<< + * return f"[{_serialize_ipv6(host)}]" + * return host */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__pyx_t_1 != Py_None); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_3) { + } - /* "w3lib/_url.pyx":992 - * output += _serialize_host(url.hostname) - * if url.port is not None: - * output += f":{url.port}" # <<<<<<<<<<<<<< - * elif not canonicalize: - * if url._default_port_seen: + /* "w3lib/_url.pyx":1374 + * if isinstance(host, list): + * return f"[{_serialize_ipv6(host)}]" + * return host # <<<<<<<<<<<<<< + * + * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyUnicode_CheckExact(__pyx_v_host))||((__pyx_v_host) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_host))) __PYX_ERR(0, 1374, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_host); + __pyx_r = ((PyObject*)__pyx_v_host); + goto __pyx_L0; - /* "w3lib/_url.pyx":991 - * output += "@" - * output += _serialize_host(url.hostname) - * if url.port is not None: # <<<<<<<<<<<<<< - * output += f":{url.port}" - * elif not canonicalize: + /* "w3lib/_url.pyx":1369 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer + * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< + * if isinstance(host, int): + * return _serialize_ipv4(host) */ - goto __pyx_L10; - } - /* "w3lib/_url.pyx":993 - * if url.port is not None: - * output += f":{url.port}" - * elif not canonicalize: # <<<<<<<<<<<<<< - * if url._default_port_seen: - * output += f":{_DEFAULT_PORTS[url.scheme]}" - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 993, __pyx_L1_error) - __pyx_t_5 = (!__pyx_t_3); - if (__pyx_t_5) { - - /* "w3lib/_url.pyx":994 - * output += f":{url.port}" - * elif not canonicalize: - * if url._default_port_seen: # <<<<<<<<<<<<<< - * output += f":{_DEFAULT_PORTS[url.scheme]}" - * elif url._port_token_seen: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 994, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_5) { + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("w3lib._url._serialize_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":995 - * elif not canonicalize: - * if url._default_port_seen: - * output += f":{_DEFAULT_PORTS[url.scheme]}" # <<<<<<<<<<<<<< - * elif url._port_token_seen: - * output += ":" +/* "w3lib/_url.pyx":1378 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer + * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< + * if url.has_opaque_path(): + * assert isinstance(url.path, str) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); - __pyx_t_1 = 0; - /* "w3lib/_url.pyx":994 - * output += f":{url.port}" - * elif not canonicalize: - * if url._default_port_seen: # <<<<<<<<<<<<<< - * output += f":{_DEFAULT_PORTS[url.scheme]}" - * elif url._port_token_seen: - */ - goto __pyx_L11; +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_47_serialize_url_path(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_47_serialize_url_path = {"_serialize_url_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_47_serialize_url_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_47_serialize_url_path(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_url = 0; + PyObject *__pyx_v_canonicalize = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_serialize_url_path (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,&__pyx_n_s_canonicalize,0}; + values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; } - - /* "w3lib/_url.pyx":996 - * if url._default_port_seen: - * output += f":{_DEFAULT_PORTS[url.scheme]}" - * elif url._port_token_seen: # <<<<<<<<<<<<<< - * output += ":" - * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 996, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "w3lib/_url.pyx":997 - * output += f":{_DEFAULT_PORTS[url.scheme]}" - * elif url._port_token_seen: - * output += ":" # <<<<<<<<<<<<<< - * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: - * output += "/." - */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":996 - * if url._default_port_seen: - * output += f":{_DEFAULT_PORTS[url.scheme]}" - * elif url._port_token_seen: # <<<<<<<<<<<<<< - * output += ":" - * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: - */ + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1378, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; } - __pyx_L11:; - - /* "w3lib/_url.pyx":993 - * if url.port is not None: - * output += f":{url.port}" - * elif not canonicalize: # <<<<<<<<<<<<<< - * if url._default_port_seen: - * output += f":{_DEFAULT_PORTS[url.scheme]}" - */ + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1378, __pyx_L3_error) + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url_path") < 0)) __PYX_ERR(0, 1378, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_L10:; + __pyx_v_url = values[0]; + __pyx_v_canonicalize = values[1]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_serialize_url_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1378, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._serialize_url_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5w3lib_4_url_46_serialize_url_path(__pyx_self, __pyx_v_url, __pyx_v_canonicalize); - /* "w3lib/_url.pyx":981 - * """ - * output = url.scheme + ":" - * if url.hostname is not None: # <<<<<<<<<<<<<< - * output += "//" - * if url.username or url.password: - */ - goto __pyx_L3; + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":998 - * elif url._port_token_seen: - * output += ":" - * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< - * output += "/." - * output += _serialize_url_path(url, canonicalize=canonicalize) +static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_canonicalize) { + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_v_segment = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_serialize_url_path", 1); + + /* "w3lib/_url.pyx":1379 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer + * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: + * if url.has_opaque_path(): # <<<<<<<<<<<<<< + * assert isinstance(url.path, str) + * return url.path */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 998, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = NULL; - __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_2); + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 998, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = (!__pyx_t_3); - if (__pyx_t_4) { - } else { - __pyx_t_5 = __pyx_t_4; - goto __pyx_L12_bool_binop_done; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 998, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = (__pyx_t_9 > 1); - if (__pyx_t_4) { - } else { - __pyx_t_5 = __pyx_t_4; - goto __pyx_L12_bool_binop_done; - } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 998, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 998, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = (!__pyx_t_4); - __pyx_t_5 = __pyx_t_3; - __pyx_L12_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":999 - * output += ":" - * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: - * output += "/." # <<<<<<<<<<<<<< - * output += _serialize_url_path(url, canonicalize=canonicalize) - * if url.query is not None: + /* "w3lib/_url.pyx":1380 + * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: + * if url.has_opaque_path(): + * assert isinstance(url.path, str) # <<<<<<<<<<<<<< + * return url.path + * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: */ - __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__23); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_6); - __pyx_t_6 = 0; + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyUnicode_Check(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_5)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 1380, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 1380, __pyx_L1_error) + #endif - /* "w3lib/_url.pyx":998 - * elif url._port_token_seen: - * output += ":" - * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< - * output += "/." - * output += _serialize_url_path(url, canonicalize=canonicalize) + /* "w3lib/_url.pyx":1381 + * if url.has_opaque_path(): + * assert isinstance(url.path, str) + * return url.path # <<<<<<<<<<<<<< + * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: + * return "" + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1381, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":1379 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer + * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: + * if url.has_opaque_path(): # <<<<<<<<<<<<<< + * assert isinstance(url.path, str) + * return url.path */ } - __pyx_L3:; - /* "w3lib/_url.pyx":1000 - * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: - * output += "/." - * output += _serialize_url_path(url, canonicalize=canonicalize) # <<<<<<<<<<<<<< - * if url.query is not None: - * output += f"?{url.query}" + /* "w3lib/_url.pyx":1382 + * assert isinstance(url.path, str) + * return url.path + * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: # <<<<<<<<<<<<<< + * return "" + * output = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_serialize_url_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1000, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_url); - __Pyx_GIVEREF(__pyx_v_url); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_url)) __PYX_ERR(0, 1000, __pyx_L1_error); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_canonicalize, __pyx_v_canonicalize) < 0) __PYX_ERR(0, 1000, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1000, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1382, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; - - /* "w3lib/_url.pyx":1001 - * output += "/." - * output += _serialize_url_path(url, canonicalize=canonicalize) - * if url.query is not None: # <<<<<<<<<<<<<< - * output += f"?{url.query}" - * if not exclude_fragment and url.fragment is not None: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = (__pyx_t_2 != Py_None); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (__pyx_t_6 <= 1); + if (__pyx_t_7) { + } else { + __pyx_t_5 = __pyx_t_7; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1382, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_7) { + } else { + __pyx_t_5 = __pyx_t_7; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1382, __pyx_L1_error) + __pyx_t_8 = (!__pyx_t_7); + __pyx_t_5 = __pyx_t_8; + __pyx_L5_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":1002 - * output += _serialize_url_path(url, canonicalize=canonicalize) - * if url.query is not None: - * output += f"?{url.query}" # <<<<<<<<<<<<<< - * if not exclude_fragment and url.fragment is not None: - * output += f"#{url.fragment}" + /* "w3lib/_url.pyx":1383 + * return url.path + * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: + * return "" # <<<<<<<<<<<<<< + * output = "" + * for segment in url.path: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1002, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__14, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1002, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_7); - __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_u__2); + __pyx_r = __pyx_kp_u__2; + goto __pyx_L0; - /* "w3lib/_url.pyx":1001 - * output += "/." - * output += _serialize_url_path(url, canonicalize=canonicalize) - * if url.query is not None: # <<<<<<<<<<<<<< - * output += f"?{url.query}" - * if not exclude_fragment and url.fragment is not None: + /* "w3lib/_url.pyx":1382 + * assert isinstance(url.path, str) + * return url.path + * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: # <<<<<<<<<<<<<< + * return "" + * output = "" */ } - /* "w3lib/_url.pyx":1003 - * if url.query is not None: - * output += f"?{url.query}" - * if not exclude_fragment and url.fragment is not None: # <<<<<<<<<<<<<< - * output += f"#{url.fragment}" + /* "w3lib/_url.pyx":1384 + * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: + * return "" + * output = "" # <<<<<<<<<<<<<< + * for segment in url.path: + * output += f"/{segment}" + */ + __Pyx_INCREF(__pyx_kp_u__2); + __pyx_v_output = __pyx_kp_u__2; + + /* "w3lib/_url.pyx":1385 + * return "" + * output = "" + * for segment in url.path: # <<<<<<<<<<<<<< + * output += f"/{segment}" * return output */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_exclude_fragment); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1003, __pyx_L1_error) - __pyx_t_4 = (!__pyx_t_3); - if (__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_6 = 0; + __pyx_t_9 = NULL; } else { - __pyx_t_5 = __pyx_t_4; - goto __pyx_L17_bool_binop_done; + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1385, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = (__pyx_t_7 != Py_None); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __pyx_t_4; - __pyx_L17_bool_binop_done:; - if (__pyx_t_5) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1385, __pyx_L1_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1385, __pyx_L1_error) + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1385, __pyx_L1_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1385, __pyx_L1_error) + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_9(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1385, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_segment, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1004 - * output += f"?{url.query}" - * if not exclude_fragment and url.fragment is not None: - * output += f"#{url.fragment}" # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1386 + * output = "" + * for segment in url.path: + * output += f"/{segment}" # <<<<<<<<<<<<<< * return output + * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__12, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_segment, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1003 - * if url.query is not None: - * output += f"?{url.query}" - * if not exclude_fragment and url.fragment is not None: # <<<<<<<<<<<<<< - * output += f"#{url.fragment}" + /* "w3lib/_url.pyx":1385 + * return "" + * output = "" + * for segment in url.path: # <<<<<<<<<<<<<< + * output += f"/{segment}" * return output */ } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1005 - * if not exclude_fragment and url.fragment is not None: - * output += f"#{url.fragment}" + /* "w3lib/_url.pyx":1387 + * for segment in url.path: + * output += f"/{segment}" * return output # <<<<<<<<<<<<<< + * + * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_INCREF(__pyx_v_output); - __pyx_r = ((PyObject*)__pyx_v_output); + __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "w3lib/_url.pyx":942 + /* "w3lib/_url.pyx":1378 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing - * def _serialize_url( # <<<<<<<<<<<<<< - * url: _URL, - * *, + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer + * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< + * if url.has_opaque_path(): + * assert isinstance(url.path, str) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("w3lib._url._serialize_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("w3lib._url._serialize_url_path", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_output); + __Pyx_XDECREF(__pyx_v_segment); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *__pyx_freelist_5w3lib_4_url___pyx_scope_struct__genexpr[8]; -static int __pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr = 0; +/* "w3lib/_url.pyx":1391 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing + * def _serialize_url( # <<<<<<<<<<<<<< + * url: _URL, + * *, + */ -static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_49_serialize_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_48_serialize_url, "Return a string representation of *url* following the URL serialization\n algorithm defined in the `URL living standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer\n\n If *exclude_fragment* is ``True``, the returned URL does not include\n :attr:`_URL.fragment`.\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *canonicalize*:\n\n - ``None``: Do not deviate from the standard algorithm to apply or\n prevent URL canonicalization.\n\n - ``True``: Deviate from the standard as needed to make sure that\n functionally-equivalent URLs are always rendered the same way.\n\n This value has no effect at the moment, i.e. it applies the same\n level of canonicalization as the standard algorithm.\n\n - ``False``: Deviate from the standard as needed to make sure that\n the returned URL string is as close as possible to the original URL\n string that was parsed into *url*, as long as the returned URL\n string is still a valid URL.\n\n At the moment, this ensures that the password separator (:) is\n included into the returned URL string as long as it was present on\n the original URL string, even if :attr:`_URL.password` is an empty\n string.\n "); +static PyMethodDef __pyx_mdef_5w3lib_4_url_49_serialize_url = {"_serialize_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_49_serialize_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_48_serialize_url}; +static PyObject *__pyx_pw_5w3lib_4_url_49_serialize_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_url = 0; + PyObject *__pyx_v_exclude_fragment = 0; + PyObject *__pyx_v_canonicalize = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_serialize_url (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - #if CYTHON_COMPILING_IN_CPYTHON - if (likely((int)(__pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr)))) { - o = (PyObject*)__pyx_freelist_5w3lib_4_url___pyx_scope_struct__genexpr[--__pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif - { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } #endif - return o; -} + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,&__pyx_n_s_exclude_fragment,&__pyx_n_s_canonicalize,0}; -static void __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct__genexpr(PyObject *o) { - struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *p = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)o; - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct__genexpr) { - if (PyObject_CallFinalizerFromDealloc(o)) return; + /* "w3lib/_url.pyx":1394 + * url: _URL, + * *, + * exclude_fragment: bool = False, # <<<<<<<<<<<<<< + * canonicalize: Optional[bool] = None, + * ) -> str: + */ + values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + + /* "w3lib/_url.pyx":1395 + * *, + * exclude_fragment: bool = False, + * canonicalize: Optional[bool] = None, # <<<<<<<<<<<<<< + * ) -> str: + * """Return a string representation of *url* following the URL serialization + */ + values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1391, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (kw_args > 0 && likely(kw_args <= 2)) { + Py_ssize_t index; + for (index = 1; index < 3 && kw_args > 0; index++) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1391, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url") < 0)) __PYX_ERR(0, 1391, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } + __pyx_v_url = values[0]; + __pyx_v_exclude_fragment = values[1]; + __pyx_v_canonicalize = values[2]; } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_code_point); - #if CYTHON_COMPILING_IN_CPYTHON - if (((int)(__pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr)))) { - __pyx_freelist_5w3lib_4_url___pyx_scope_struct__genexpr[__pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)o); - } else - #endif + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_serialize_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1391, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY - (*Py_TYPE(o)->tp_free)(o); - #else - { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); - if (tp_free) tp_free(o); + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } - #endif } -} + __Pyx_AddTraceback("w3lib._url._serialize_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_5w3lib_4_url_48_serialize_url(__pyx_self, __pyx_v_url, __pyx_v_exclude_fragment, __pyx_v_canonicalize); -static int __pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *p = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)o; - if (p->__pyx_genexpr_arg_0) { - e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; - } - if (p->__pyx_v_code_point) { - e = (*v)(p->__pyx_v_code_point, a); if (e) return e; + /* "w3lib/_url.pyx":1391 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing + * def _serialize_url( # <<<<<<<<<<<<<< + * url: _URL, + * *, + */ + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } } - return 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct__genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct__genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr}, - {0, 0}, -}; -static PyType_Spec __pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec = { - "w3lib._url.__pyx_scope_struct__genexpr", - sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_slots, -}; -#else -static PyTypeObject __pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr = { - PyVarObject_HEAD_INIT(0, 0) - "w3lib._url.""__pyx_scope_struct__genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct__genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct__genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - #if !CYTHON_USE_TYPE_SPECS - 0, /*tp_dictoffset*/ - #endif - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, /*tp_vectorcall*/ - #endif - #if __PYX_NEED_TP_PRINT_SLOT == 1 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030C0000 - 0, /*tp_watched*/ - #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, /*tp_pypy_flags*/ - #endif -}; -#endif +static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_exclude_fragment, PyObject *__pyx_v_canonicalize) { + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_serialize_url", 1); -static struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *__pyx_freelist_5w3lib_4_url___pyx_scope_struct_1_genexpr[8]; -static int __pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr = 0; + /* "w3lib/_url.pyx":1429 + * string. + * """ + * output = url.scheme + ":" # <<<<<<<<<<<<<< + * if url.hostname is not None: + * output += "//" + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_output = __pyx_t_2; + __pyx_t_2 = 0; -static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - #if CYTHON_COMPILING_IN_CPYTHON - if (likely((int)(__pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr)))) { - o = (PyObject*)__pyx_freelist_5w3lib_4_url___pyx_scope_struct_1_genexpr[--__pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else - #endif - { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - #endif - return o; -} + /* "w3lib/_url.pyx":1430 + * """ + * output = url.scheme + ":" + * if url.hostname is not None: # <<<<<<<<<<<<<< + * output += "//" + * if url.username or url.password: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { -static void __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyObject *o) { - struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)o; - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct_1_genexpr) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_item); - #if CYTHON_COMPILING_IN_CPYTHON - if (((int)(__pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr)))) { - __pyx_freelist_5w3lib_4_url___pyx_scope_struct_1_genexpr[__pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)o); - } else - #endif - { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY - (*Py_TYPE(o)->tp_free)(o); - #else - { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); - if (tp_free) tp_free(o); - } - #endif - } -} + /* "w3lib/_url.pyx":1431 + * output = url.scheme + ":" + * if url.hostname is not None: + * output += "//" # <<<<<<<<<<<<<< + * if url.username or url.password: + * output += url.username + */ + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; -static int __pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)o; - if (p->__pyx_genexpr_arg_0) { - e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; - } - if (p->__pyx_v_item) { - e = (*v)(p->__pyx_v_item, a); if (e) return e; - } - return 0; -} -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct_1_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct_1_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr}, - {0, 0}, -}; -static PyType_Spec __pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec = { - "w3lib._url.__pyx_scope_struct_1_genexpr", - sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_slots, -}; -#else + /* "w3lib/_url.pyx":1432 + * if url.hostname is not None: + * output += "//" + * if url.username or url.password: # <<<<<<<<<<<<<< + * output += url.username + * if url.password: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1432, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1432, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __pyx_t_4; + __pyx_L5_bool_binop_done:; + if (__pyx_t_3) { -static PyTypeObject __pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr = { - PyVarObject_HEAD_INIT(0, 0) - "w3lib._url.""__pyx_scope_struct_1_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct_1_genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - #if !CYTHON_USE_TYPE_SPECS - 0, /*tp_dictoffset*/ - #endif - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, /*tp_vectorcall*/ - #endif - #if __PYX_NEED_TP_PRINT_SLOT == 1 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030C0000 - 0, /*tp_watched*/ - #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, /*tp_pypy_flags*/ - #endif -}; -#endif + /* "w3lib/_url.pyx":1433 + * output += "//" + * if url.username or url.password: + * output += url.username # <<<<<<<<<<<<<< + * if url.password: + * output += f":{url.password}" + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ + /* "w3lib/_url.pyx":1434 + * if url.username or url.password: + * output += url.username + * if url.password: # <<<<<<<<<<<<<< + * output += f":{url.password}" + * elif not canonicalize and url._password_token_seen: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1434, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_02X, __pyx_k_02X, sizeof(__pyx_k_02X), 0, 1, 0, 0}, - {&__pyx_kp_u_0X, __pyx_k_0X, sizeof(__pyx_k_0X), 0, 1, 0, 0}, - {&__pyx_kp_u_0x, __pyx_k_0x, sizeof(__pyx_k_0x), 0, 1, 0, 0}, - {&__pyx_kp_u_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 1, 0, 0}, - {&__pyx_kp_u_2E, __pyx_k_2E, sizeof(__pyx_k_2E), 0, 1, 0, 0}, - {&__pyx_kp_u_2E_2, __pyx_k_2E_2, sizeof(__pyx_k_2E_2), 0, 1, 0, 0}, - {&__pyx_kp_u_2E_2E, __pyx_k_2E_2E, sizeof(__pyx_k_2E_2E), 0, 1, 0, 0}, - {&__pyx_kp_u_2E_2e, __pyx_k_2E_2e, sizeof(__pyx_k_2E_2e), 0, 1, 0, 0}, - {&__pyx_kp_u_2E_3, __pyx_k_2E_3, sizeof(__pyx_k_2E_3), 0, 1, 0, 0}, - {&__pyx_kp_u_2e, __pyx_k_2e, sizeof(__pyx_k_2e), 0, 1, 0, 0}, - {&__pyx_kp_u_2e_2, __pyx_k_2e_2, sizeof(__pyx_k_2e_2), 0, 1, 0, 0}, - {&__pyx_kp_u_2e_2E, __pyx_k_2e_2E, sizeof(__pyx_k_2e_2E), 0, 1, 0, 0}, - {&__pyx_kp_u_2e_2e, __pyx_k_2e_2e, sizeof(__pyx_k_2e_2e), 0, 1, 0, 0}, - {&__pyx_kp_u_2e_3, __pyx_k_2e_3, sizeof(__pyx_k_2e_3), 0, 1, 0, 0}, - {&__pyx_kp_u_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 1, 0, 0}, - {&__pyx_n_s_ASCII_ALPHA, __pyx_k_ASCII_ALPHA, sizeof(__pyx_k_ASCII_ALPHA), 0, 0, 1, 1}, - {&__pyx_n_s_ASCII_ALPHANUMERIC, __pyx_k_ASCII_ALPHANUMERIC, sizeof(__pyx_k_ASCII_ALPHANUMERIC), 0, 0, 1, 1}, - {&__pyx_n_s_ASCII_DIGIT, __pyx_k_ASCII_DIGIT, sizeof(__pyx_k_ASCII_DIGIT), 0, 0, 1, 1}, - {&__pyx_n_s_ASCII_HEX_DIGIT, __pyx_k_ASCII_HEX_DIGIT, sizeof(__pyx_k_ASCII_HEX_DIGIT), 0, 0, 1, 1}, - {&__pyx_n_s_ASCII_TAB_OR_NEWLINE, __pyx_k_ASCII_TAB_OR_NEWLINE, sizeof(__pyx_k_ASCII_TAB_OR_NEWLINE), 0, 0, 1, 1}, - {&__pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO, __pyx_k_ASCII_TAB_OR_NEWLINE_TRANSLATIO, sizeof(__pyx_k_ASCII_TAB_OR_NEWLINE_TRANSLATIO), 0, 0, 1, 1}, - {&__pyx_n_s_AUTHORITY, __pyx_k_AUTHORITY, sizeof(__pyx_k_AUTHORITY), 0, 0, 1, 1}, - {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, - {&__pyx_n_s_C0_CONTROL, __pyx_k_C0_CONTROL, sizeof(__pyx_k_C0_CONTROL), 0, 0, 1, 1}, - {&__pyx_n_s_C0_CONTROL_OR_SPACE, __pyx_k_C0_CONTROL_OR_SPACE, sizeof(__pyx_k_C0_CONTROL_OR_SPACE), 0, 0, 1, 1}, - {&__pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_k_C0_CONTROL_PERCENT_ENCODE_SET, sizeof(__pyx_k_C0_CONTROL_PERCENT_ENCODE_SET), 0, 0, 1, 1}, - {&__pyx_n_s_DEFAULT_PORTS, __pyx_k_DEFAULT_PORTS, sizeof(__pyx_k_DEFAULT_PORTS), 0, 0, 1, 1}, - {&__pyx_kp_u_Domain_name, __pyx_k_Domain_name, sizeof(__pyx_k_Domain_name), 0, 1, 0, 0}, - {&__pyx_n_s_FILE, __pyx_k_FILE, sizeof(__pyx_k_FILE), 0, 0, 1, 1}, - {&__pyx_n_s_FILE_HOST, __pyx_k_FILE_HOST, sizeof(__pyx_k_FILE_HOST), 0, 0, 1, 1}, - {&__pyx_n_s_FILE_SLASH, __pyx_k_FILE_SLASH, sizeof(__pyx_k_FILE_SLASH), 0, 0, 1, 1}, - {&__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_k_FORBIDDEN_DOMAIN_CODE_POINTS, sizeof(__pyx_k_FORBIDDEN_DOMAIN_CODE_POINTS), 0, 0, 1, 1}, - {&__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_k_FORBIDDEN_HOST_CODE_POINTS, sizeof(__pyx_k_FORBIDDEN_HOST_CODE_POINTS), 0, 0, 1, 1}, - {&__pyx_n_s_FRAGMENT, __pyx_k_FRAGMENT, sizeof(__pyx_k_FRAGMENT), 0, 0, 1, 1}, - {&__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_k_FRAGMENT_PERCENT_ENCODE_SET, sizeof(__pyx_k_FRAGMENT_PERCENT_ENCODE_SET), 0, 0, 1, 1}, - {&__pyx_n_s_HOST, __pyx_k_HOST, sizeof(__pyx_k_HOST), 0, 0, 1, 1}, - {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, - {&__pyx_n_s_List, __pyx_k_List, sizeof(__pyx_k_List), 0, 0, 1, 1}, - {&__pyx_kp_s_List_int, __pyx_k_List_int, sizeof(__pyx_k_List_int), 0, 0, 1, 0}, - {&__pyx_n_s_NO_SCHEME, __pyx_k_NO_SCHEME, sizeof(__pyx_k_NO_SCHEME), 0, 0, 1, 1}, - {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1}, - {&__pyx_n_s_OPAQUE_PATH, __pyx_k_OPAQUE_PATH, sizeof(__pyx_k_OPAQUE_PATH), 0, 0, 1, 1}, - {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1}, - {&__pyx_kp_s_Optional_bool, __pyx_k_Optional_bool, sizeof(__pyx_k_Optional_bool), 0, 0, 1, 0}, - {&__pyx_kp_s_Optional_int, __pyx_k_Optional_int, sizeof(__pyx_k_Optional_int), 0, 0, 1, 0}, - {&__pyx_kp_s_Optional_str, __pyx_k_Optional_str, sizeof(__pyx_k_Optional_str), 0, 0, 1, 0}, - {&__pyx_n_s_PATH, __pyx_k_PATH, sizeof(__pyx_k_PATH), 0, 0, 1, 1}, - {&__pyx_n_s_PATH_OR_AUTHORITY, __pyx_k_PATH_OR_AUTHORITY, sizeof(__pyx_k_PATH_OR_AUTHORITY), 0, 0, 1, 1}, - {&__pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_k_PATH_PERCENT_ENCODE_SET, sizeof(__pyx_k_PATH_PERCENT_ENCODE_SET), 0, 0, 1, 1}, - {&__pyx_n_s_PATH_START, __pyx_k_PATH_START, sizeof(__pyx_k_PATH_START), 0, 0, 1, 1}, - {&__pyx_n_s_PORT, __pyx_k_PORT, sizeof(__pyx_k_PORT), 0, 0, 1, 1}, - {&__pyx_n_s_PercentEncodeSet, __pyx_k_PercentEncodeSet, sizeof(__pyx_k_PercentEncodeSet), 0, 0, 1, 1}, - {&__pyx_n_s_QUERY, __pyx_k_QUERY, sizeof(__pyx_k_QUERY), 0, 0, 1, 1}, - {&__pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_k_QUERY_PERCENT_ENCODE_SET, sizeof(__pyx_k_QUERY_PERCENT_ENCODE_SET), 0, 0, 1, 1}, - {&__pyx_n_s_RELATIVE, __pyx_k_RELATIVE, sizeof(__pyx_k_RELATIVE), 0, 0, 1, 1}, - {&__pyx_n_s_RELATIVE_SLASH, __pyx_k_RELATIVE_SLASH, sizeof(__pyx_k_RELATIVE_SLASH), 0, 0, 1, 1}, - {&__pyx_n_s_SCHEME, __pyx_k_SCHEME, sizeof(__pyx_k_SCHEME), 0, 0, 1, 1}, - {&__pyx_n_s_SCHEME_CHARS, __pyx_k_SCHEME_CHARS, sizeof(__pyx_k_SCHEME_CHARS), 0, 0, 1, 1}, - {&__pyx_n_s_SCHEME_START, __pyx_k_SCHEME_START, sizeof(__pyx_k_SCHEME_START), 0, 0, 1, 1}, - {&__pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES, __pyx_k_SPECIAL_AUTHORITY_IGNORE_SLASHES, sizeof(__pyx_k_SPECIAL_AUTHORITY_IGNORE_SLASHES), 0, 0, 1, 1}, - {&__pyx_n_s_SPECIAL_AUTHORITY_SLASHES, __pyx_k_SPECIAL_AUTHORITY_SLASHES, sizeof(__pyx_k_SPECIAL_AUTHORITY_SLASHES), 0, 0, 1, 1}, - {&__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_k_SPECIAL_QUERY_PERCENT_ENCODE_SE, sizeof(__pyx_k_SPECIAL_QUERY_PERCENT_ENCODE_SE), 0, 0, 1, 1}, - {&__pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY, __pyx_k_SPECIAL_RELATIVE_OR_AUTHORITY, sizeof(__pyx_k_SPECIAL_RELATIVE_OR_AUTHORITY), 0, 0, 1, 1}, - {&__pyx_n_s_SPECIAL_SCHEMES, __pyx_k_SPECIAL_SCHEMES, sizeof(__pyx_k_SPECIAL_SCHEMES), 0, 0, 1, 1}, - {&__pyx_n_s_Tuple, __pyx_k_Tuple, sizeof(__pyx_k_Tuple), 0, 0, 1, 1}, - {&__pyx_kp_s_Tuple_int_bool, __pyx_k_Tuple_int_bool, sizeof(__pyx_k_Tuple_int_bool), 0, 0, 1, 0}, - {&__pyx_n_s_URL, __pyx_k_URL, sizeof(__pyx_k_URL), 0, 0, 1, 1}, - {&__pyx_n_s_URL___init, __pyx_k_URL___init, sizeof(__pyx_k_URL___init), 0, 0, 1, 1}, - {&__pyx_n_s_URL_has_opaque_path, __pyx_k_URL_has_opaque_path, sizeof(__pyx_k_URL_has_opaque_path), 0, 0, 1, 1}, - {&__pyx_n_s_URL_scheme, __pyx_k_URL_scheme, sizeof(__pyx_k_URL_scheme), 0, 0, 1, 1}, - {&__pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_k_USERINFO_PERCENT_ENCODE_SET, sizeof(__pyx_k_USERINFO_PERCENT_ENCODE_SET), 0, 0, 1, 1}, - {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, - {&__pyx_kp_s_Union_int_List_int_str, __pyx_k_Union_int_List_int_str, sizeof(__pyx_k_Union_int_List_int_str), 0, 0, 1, 0}, - {&__pyx_kp_s_Union_str_List_str, __pyx_k_Union_str_List_str, sizeof(__pyx_k_Union_str_List_str), 0, 0, 1, 0}, - {&__pyx_kp_s_Union_str_int_List_int, __pyx_k_Union_str_int_List_int, sizeof(__pyx_k_Union_str_int_List_int), 0, 0, 1, 0}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0}, - {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, - {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0}, - {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0}, - {&__pyx_n_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 1}, - {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0}, - {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0}, - {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0}, - {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0}, - {&__pyx_kp_u__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0}, - {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0}, - {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, - {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, - {&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0}, - {&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0}, - {&__pyx_kp_u__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0, 0}, - {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, - {&__pyx_kp_u__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 1, 0, 0}, - {&__pyx_n_s__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 1, 1}, - {&__pyx_kp_u__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 1, 0, 0}, - {&__pyx_kp_u__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 1, 0, 0}, - {&__pyx_kp_u__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 1, 0, 0}, - {&__pyx_kp_u__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 1, 0, 0}, - {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, - {&__pyx_kp_u__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 1, 0, 0}, - {&__pyx_kp_u__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 1, 0, 0}, - {&__pyx_kp_u__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 1, 0, 0}, - {&__pyx_kp_u__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 1, 0, 0}, - {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, - {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, - {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, - {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, - {&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1}, - {&__pyx_n_s_annotations, __pyx_k_annotations, sizeof(__pyx_k_annotations), 0, 0, 1, 1}, - {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, - {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, - {&__pyx_n_s_ascii_domain, __pyx_k_ascii_domain, sizeof(__pyx_k_ascii_domain), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_n_s_at_sign_index, __pyx_k_at_sign_index, sizeof(__pyx_k_at_sign_index), 0, 0, 1, 1}, - {&__pyx_n_s_at_sign_seen, __pyx_k_at_sign_seen, sizeof(__pyx_k_at_sign_seen), 0, 0, 1, 1}, - {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, - {&__pyx_n_s_base_url, __pyx_k_base_url, sizeof(__pyx_k_base_url), 0, 0, 1, 1}, - {&__pyx_n_s_be_strict, __pyx_k_be_strict, sizeof(__pyx_k_be_strict), 0, 0, 1, 1}, - {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, - {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, - {&__pyx_n_s_byte, __pyx_k_byte, sizeof(__pyx_k_byte), 0, 0, 1, 1}, - {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, - {&__pyx_n_s_canonicalize, __pyx_k_canonicalize, sizeof(__pyx_k_canonicalize), 0, 0, 1, 1}, - {&__pyx_n_s_check_bidi, __pyx_k_check_bidi, sizeof(__pyx_k_check_bidi), 0, 0, 1, 1}, - {&__pyx_n_s_check_hyphens, __pyx_k_check_hyphens, sizeof(__pyx_k_check_hyphens), 0, 0, 1, 1}, - {&__pyx_n_s_check_joiners, __pyx_k_check_joiners, sizeof(__pyx_k_check_joiners), 0, 0, 1, 1}, - {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, - {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_code_point, __pyx_k_code_point, sizeof(__pyx_k_code_point), 0, 0, 1, 1}, - {&__pyx_n_s_compress, __pyx_k_compress, sizeof(__pyx_k_compress), 0, 0, 1, 1}, - {&__pyx_n_s_counter, __pyx_k_counter, sizeof(__pyx_k_counter), 0, 0, 1, 1}, - {&__pyx_n_s_current_index, __pyx_k_current_index, sizeof(__pyx_k_current_index), 0, 0, 1, 1}, - {&__pyx_n_s_current_length, __pyx_k_current_length, sizeof(__pyx_k_current_length), 0, 0, 1, 1}, - {&__pyx_n_s_default_port_seen, __pyx_k_default_port_seen, sizeof(__pyx_k_default_port_seen), 0, 0, 1, 1}, - {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, - {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, - {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, - {&__pyx_n_s_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 0, 0, 1, 1}, - {&__pyx_n_s_domain_to_ascii, __pyx_k_domain_to_ascii, sizeof(__pyx_k_domain_to_ascii), 0, 0, 1, 1}, - {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, - {&__pyx_n_s_encode_output, __pyx_k_encode_output, sizeof(__pyx_k_encode_output), 0, 0, 1, 1}, - {&__pyx_n_s_encode_set, __pyx_k_encode_set, sizeof(__pyx_k_encode_set), 0, 0, 1, 1}, - {&__pyx_n_s_encoded, __pyx_k_encoded, sizeof(__pyx_k_encoded), 0, 0, 1, 1}, - {&__pyx_n_s_encoded_code_points, __pyx_k_encoded_code_points, sizeof(__pyx_k_encoded_code_points), 0, 0, 1, 1}, - {&__pyx_n_s_encoder, __pyx_k_encoder, sizeof(__pyx_k_encoder), 0, 0, 1, 1}, - {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, - {&__pyx_n_s_encoding_2, __pyx_k_encoding_2, sizeof(__pyx_k_encoding_2), 0, 0, 1, 1}, - {&__pyx_n_s_ends_in_number, __pyx_k_ends_in_number, sizeof(__pyx_k_ends_in_number), 0, 0, 1, 1}, - {&__pyx_n_s_ends_in_number_locals_genexpr, __pyx_k_ends_in_number_locals_genexpr, sizeof(__pyx_k_ends_in_number_locals_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, - {&__pyx_n_s_exclude_fragment, __pyx_k_exclude_fragment, sizeof(__pyx_k_exclude_fragment), 0, 0, 1, 1}, - {&__pyx_n_u_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 1, 0, 1}, - {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1}, - {&__pyx_n_s_fragment, __pyx_k_fragment, sizeof(__pyx_k_fragment), 0, 0, 1, 1}, - {&__pyx_n_s_fragment_percent_encode_set, __pyx_k_fragment_percent_encode_set, sizeof(__pyx_k_fragment_percent_encode_set), 0, 0, 1, 1}, - {&__pyx_n_u_ftp, __pyx_k_ftp, sizeof(__pyx_k_ftp), 0, 1, 0, 1}, - {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, - {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, - {&__pyx_n_s_get_encoder, __pyx_k_get_encoder, sizeof(__pyx_k_get_encoder), 0, 0, 1, 1}, - {&__pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_k_get_ipv6_first_longest_0_piece, sizeof(__pyx_k_get_ipv6_first_longest_0_piece), 0, 0, 1, 1}, - {&__pyx_n_s_get_output_encoding, __pyx_k_get_output_encoding, sizeof(__pyx_k_get_output_encoding), 0, 0, 1, 1}, - {&__pyx_n_s_greater_than, __pyx_k_greater_than, sizeof(__pyx_k_greater_than), 0, 0, 1, 1}, - {&__pyx_n_s_has_opaque_path, __pyx_k_has_opaque_path, sizeof(__pyx_k_has_opaque_path), 0, 0, 1, 1}, - {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1}, - {&__pyx_n_s_hostname, __pyx_k_hostname, sizeof(__pyx_k_hostname), 0, 0, 1, 1}, - {&__pyx_n_u_http, __pyx_k_http, sizeof(__pyx_k_http), 0, 1, 0, 1}, - {&__pyx_n_u_https, __pyx_k_https, sizeof(__pyx_k_https), 0, 1, 0, 1}, - {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, - {&__pyx_n_s_idempotent_utf_8_percent_encode, __pyx_k_idempotent_utf_8_percent_encode, sizeof(__pyx_k_idempotent_utf_8_percent_encode), 0, 0, 1, 1}, - {&__pyx_n_s_ignore0, __pyx_k_ignore0, sizeof(__pyx_k_ignore0), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, - {&__pyx_n_s_index_length, __pyx_k_index_length, sizeof(__pyx_k_index_length), 0, 0, 1, 1}, - {&__pyx_n_s_infra, __pyx_k_infra, sizeof(__pyx_k_infra), 0, 0, 1, 1}, - {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, - {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, - {&__pyx_n_s_input, __pyx_k_input, sizeof(__pyx_k_input), 0, 0, 1, 1}, - {&__pyx_n_s_input_lenght, __pyx_k_input_lenght, sizeof(__pyx_k_input_lenght), 0, 0, 1, 1}, - {&__pyx_n_s_input_length, __pyx_k_input_length, sizeof(__pyx_k_input_length), 0, 0, 1, 1}, - {&__pyx_n_s_inside_brackets, __pyx_k_inside_brackets, sizeof(__pyx_k_inside_brackets), 0, 0, 1, 1}, - {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, - {&__pyx_n_s_ipv4, __pyx_k_ipv4, sizeof(__pyx_k_ipv4), 0, 0, 1, 1}, - {&__pyx_n_s_ipv4_piece, __pyx_k_ipv4_piece, sizeof(__pyx_k_ipv4_piece), 0, 0, 1, 1}, - {&__pyx_kp_u_is_an_empty_string_after_conver, __pyx_k_is_an_empty_string_after_conver, sizeof(__pyx_k_is_an_empty_string_after_conver), 0, 1, 0, 0}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_n_s_is_double_dot_path_segment, __pyx_k_is_double_dot_path_segment, sizeof(__pyx_k_is_double_dot_path_segment), 0, 0, 1, 1}, - {&__pyx_n_s_is_single_dot_path_segment, __pyx_k_is_single_dot_path_segment, sizeof(__pyx_k_is_single_dot_path_segment), 0, 0, 1, 1}, - {&__pyx_n_s_is_special, __pyx_k_is_special, sizeof(__pyx_k_is_special), 0, 0, 1, 1}, - {&__pyx_n_s_is_windows_drive_letter, __pyx_k_is_windows_drive_letter, sizeof(__pyx_k_is_windows_drive_letter), 0, 0, 1, 1}, - {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, - {&__pyx_n_s_isomorph, __pyx_k_isomorph, sizeof(__pyx_k_isomorph), 0, 0, 1, 1}, - {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, - {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1}, - {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, - {&__pyx_n_u_localhost, __pyx_k_localhost, sizeof(__pyx_k_localhost), 0, 1, 0, 1}, - {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1}, - {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, - {&__pyx_n_s_min_length, __pyx_k_min_length, sizeof(__pyx_k_min_length), 0, 0, 1, 1}, - {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, - {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_number, __pyx_k_number, sizeof(__pyx_k_number), 0, 0, 1, 1}, - {&__pyx_n_s_numbers, __pyx_k_numbers, sizeof(__pyx_k_numbers), 0, 0, 1, 1}, - {&__pyx_n_s_numbers_seen, __pyx_k_numbers_seen, sizeof(__pyx_k_numbers_seen), 0, 0, 1, 1}, - {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, - {&__pyx_n_s_parse_host, __pyx_k_parse_host, sizeof(__pyx_k_parse_host), 0, 0, 1, 1}, - {&__pyx_n_s_parse_ipv4, __pyx_k_parse_ipv4, sizeof(__pyx_k_parse_ipv4), 0, 0, 1, 1}, - {&__pyx_n_s_parse_ipv4_locals_genexpr, __pyx_k_parse_ipv4_locals_genexpr, sizeof(__pyx_k_parse_ipv4_locals_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_parse_ipv4_number, __pyx_k_parse_ipv4_number, sizeof(__pyx_k_parse_ipv4_number), 0, 0, 1, 1}, - {&__pyx_n_s_parse_ipv6, __pyx_k_parse_ipv6, sizeof(__pyx_k_parse_ipv6), 0, 0, 1, 1}, - {&__pyx_n_s_parse_opaque_host, __pyx_k_parse_opaque_host, sizeof(__pyx_k_parse_opaque_host), 0, 0, 1, 1}, - {&__pyx_n_s_parse_url, __pyx_k_parse_url, sizeof(__pyx_k_parse_url), 0, 0, 1, 1}, - {&__pyx_n_s_part, __pyx_k_part, sizeof(__pyx_k_part), 0, 0, 1, 1}, - {&__pyx_n_s_parts, __pyx_k_parts, sizeof(__pyx_k_parts), 0, 0, 1, 1}, - {&__pyx_n_s_password, __pyx_k_password, sizeof(__pyx_k_password), 0, 0, 1, 1}, - {&__pyx_n_s_password_token_seen, __pyx_k_password_token_seen, sizeof(__pyx_k_password_token_seen), 0, 0, 1, 1}, - {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, - {&__pyx_n_s_path_percent_encode_set, __pyx_k_path_percent_encode_set, sizeof(__pyx_k_path_percent_encode_set), 0, 0, 1, 1}, - {&__pyx_n_s_path_token_seen, __pyx_k_path_token_seen, sizeof(__pyx_k_path_token_seen), 0, 0, 1, 1}, - {&__pyx_n_s_percent_encode_after_encoding, __pyx_k_percent_encode_after_encoding, sizeof(__pyx_k_percent_encode_after_encoding), 0, 0, 1, 1}, - {&__pyx_n_s_percent_encode_set, __pyx_k_percent_encode_set, sizeof(__pyx_k_percent_encode_set), 0, 0, 1, 1}, - {&__pyx_n_s_piece, __pyx_k_piece, sizeof(__pyx_k_piece), 0, 0, 1, 1}, - {&__pyx_n_s_piece_index, __pyx_k_piece_index, sizeof(__pyx_k_piece_index), 0, 0, 1, 1}, - {&__pyx_n_s_pointer, __pyx_k_pointer, sizeof(__pyx_k_pointer), 0, 0, 1, 1}, - {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1}, - {&__pyx_n_s_port_token_seen, __pyx_k_port_token_seen, sizeof(__pyx_k_port_token_seen), 0, 0, 1, 1}, - {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, - {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, - {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, - {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1}, - {&__pyx_n_s_query_percent_encode_set, __pyx_k_query_percent_encode_set, sizeof(__pyx_k_query_percent_encode_set), 0, 0, 1, 1}, - {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, - {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, - {&__pyx_n_s_scheme, __pyx_k_scheme, sizeof(__pyx_k_scheme), 0, 0, 1, 1}, - {&__pyx_n_s_scheme_2, __pyx_k_scheme_2, sizeof(__pyx_k_scheme_2), 0, 0, 1, 1}, - {&__pyx_n_s_segment, __pyx_k_segment, sizeof(__pyx_k_segment), 0, 0, 1, 1}, - {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, - {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, - {&__pyx_n_s_separator, __pyx_k_separator, sizeof(__pyx_k_separator), 0, 0, 1, 1}, - {&__pyx_n_s_serialize_host, __pyx_k_serialize_host, sizeof(__pyx_k_serialize_host), 0, 0, 1, 1}, - {&__pyx_n_s_serialize_ipv4, __pyx_k_serialize_ipv4, sizeof(__pyx_k_serialize_ipv4), 0, 0, 1, 1}, - {&__pyx_n_s_serialize_ipv6, __pyx_k_serialize_ipv6, sizeof(__pyx_k_serialize_ipv6), 0, 0, 1, 1}, - {&__pyx_n_s_serialize_url, __pyx_k_serialize_url, sizeof(__pyx_k_serialize_url), 0, 0, 1, 1}, - {&__pyx_n_s_serialize_url_path, __pyx_k_serialize_url_path, sizeof(__pyx_k_serialize_url_path), 0, 0, 1, 1}, - {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, - {&__pyx_n_s_setter, __pyx_k_setter, sizeof(__pyx_k_setter), 0, 0, 1, 1}, - {&__pyx_n_s_shorten_path, __pyx_k_shorten_path, sizeof(__pyx_k_shorten_path), 0, 0, 1, 1}, - {&__pyx_n_s_skip_authority_shortcut, __pyx_k_skip_authority_shortcut, sizeof(__pyx_k_skip_authority_shortcut), 0, 0, 1, 1}, - {&__pyx_n_s_space_as_plus, __pyx_k_space_as_plus, sizeof(__pyx_k_space_as_plus), 0, 0, 1, 1}, - {&__pyx_n_s_special_query_percent_encode_set, __pyx_k_special_query_percent_encode_set, sizeof(__pyx_k_special_query_percent_encode_set), 0, 0, 1, 1}, - {&__pyx_n_s_starts_with_windows_drive_lette, __pyx_k_starts_with_windows_drive_lette, sizeof(__pyx_k_starts_with_windows_drive_lette), 0, 0, 1, 1}, - {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, - {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, - {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, - {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, - {&__pyx_n_s_swaps, __pyx_k_swaps, sizeof(__pyx_k_swaps), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, - {&__pyx_n_s_to_ascii, __pyx_k_to_ascii, sizeof(__pyx_k_to_ascii), 0, 0, 1, 1}, - {&__pyx_n_s_transitional_processing, __pyx_k_transitional_processing, sizeof(__pyx_k_transitional_processing), 0, 0, 1, 1}, - {&__pyx_n_s_translate, __pyx_k_translate, sizeof(__pyx_k_translate), 0, 0, 1, 1}, + /* "w3lib/_url.pyx":1435 + * output += url.username + * if url.password: + * output += f":{url.password}" # <<<<<<<<<<<<<< + * elif not canonicalize and url._password_token_seen: + * output += ":" + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1434 + * if url.username or url.password: + * output += url.username + * if url.password: # <<<<<<<<<<<<<< + * output += f":{url.password}" + * elif not canonicalize and url._password_token_seen: + */ + goto __pyx_L7; + } + + /* "w3lib/_url.pyx":1436 + * if url.password: + * output += f":{url.password}" + * elif not canonicalize and url._password_token_seen: # <<<<<<<<<<<<<< + * output += ":" + * output += "@" + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1436, __pyx_L1_error) + __pyx_t_5 = (!__pyx_t_4); + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L8_bool_binop_done:; + if (__pyx_t_3) { + + /* "w3lib/_url.pyx":1437 + * output += f":{url.password}" + * elif not canonicalize and url._password_token_seen: + * output += ":" # <<<<<<<<<<<<<< + * output += "@" + * output += _serialize_host(url.hostname) + */ + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1436 + * if url.password: + * output += f":{url.password}" + * elif not canonicalize and url._password_token_seen: # <<<<<<<<<<<<<< + * output += ":" + * output += "@" + */ + } + __pyx_L7:; + + /* "w3lib/_url.pyx":1438 + * elif not canonicalize and url._password_token_seen: + * output += ":" + * output += "@" # <<<<<<<<<<<<<< + * output += _serialize_host(url.hostname) + * if url.port is not None: + */ + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1432 + * if url.hostname is not None: + * output += "//" + * if url.username or url.password: # <<<<<<<<<<<<<< + * output += url.username + * if url.password: + */ + } + + /* "w3lib/_url.pyx":1439 + * output += ":" + * output += "@" + * output += _serialize_host(url.hostname) # <<<<<<<<<<<<<< + * if url.port is not None: + * output += f":{url.port}" + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":1440 + * output += "@" + * output += _serialize_host(url.hostname) + * if url.port is not None: # <<<<<<<<<<<<<< + * output += f":{url.port}" + * elif not canonicalize: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "w3lib/_url.pyx":1441 + * output += _serialize_host(url.hostname) + * if url.port is not None: + * output += f":{url.port}" # <<<<<<<<<<<<<< + * elif not canonicalize: + * if url._default_port_seen: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1440 + * output += "@" + * output += _serialize_host(url.hostname) + * if url.port is not None: # <<<<<<<<<<<<<< + * output += f":{url.port}" + * elif not canonicalize: + */ + goto __pyx_L10; + } + + /* "w3lib/_url.pyx":1442 + * if url.port is not None: + * output += f":{url.port}" + * elif not canonicalize: # <<<<<<<<<<<<<< + * if url._default_port_seen: + * output += f":{_DEFAULT_PORTS[url.scheme]}" + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1442, __pyx_L1_error) + __pyx_t_5 = (!__pyx_t_3); + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":1443 + * output += f":{url.port}" + * elif not canonicalize: + * if url._default_port_seen: # <<<<<<<<<<<<<< + * output += f":{_DEFAULT_PORTS[url.scheme]}" + * elif url._port_token_seen: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1443, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":1444 + * elif not canonicalize: + * if url._default_port_seen: + * output += f":{_DEFAULT_PORTS[url.scheme]}" # <<<<<<<<<<<<<< + * elif url._port_token_seen: + * output += ":" + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":1443 + * output += f":{url.port}" + * elif not canonicalize: + * if url._default_port_seen: # <<<<<<<<<<<<<< + * output += f":{_DEFAULT_PORTS[url.scheme]}" + * elif url._port_token_seen: + */ + goto __pyx_L11; + } + + /* "w3lib/_url.pyx":1445 + * if url._default_port_seen: + * output += f":{_DEFAULT_PORTS[url.scheme]}" + * elif url._port_token_seen: # <<<<<<<<<<<<<< + * output += ":" + * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1445, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":1446 + * output += f":{_DEFAULT_PORTS[url.scheme]}" + * elif url._port_token_seen: + * output += ":" # <<<<<<<<<<<<<< + * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + * output += "/." + */ + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":1445 + * if url._default_port_seen: + * output += f":{_DEFAULT_PORTS[url.scheme]}" + * elif url._port_token_seen: # <<<<<<<<<<<<<< + * output += ":" + * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + */ + } + __pyx_L11:; + + /* "w3lib/_url.pyx":1442 + * if url.port is not None: + * output += f":{url.port}" + * elif not canonicalize: # <<<<<<<<<<<<<< + * if url._default_port_seen: + * output += f":{_DEFAULT_PORTS[url.scheme]}" + */ + } + __pyx_L10:; + + /* "w3lib/_url.pyx":1430 + * """ + * output = url.scheme + ":" + * if url.hostname is not None: # <<<<<<<<<<<<<< + * output += "//" + * if url.username or url.password: + */ + goto __pyx_L3; + } + + /* "w3lib/_url.pyx":1447 + * elif url._port_token_seen: + * output += ":" + * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< + * output += "/." + * output += _serialize_url_path(url, canonicalize=canonicalize) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1447, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (!__pyx_t_3); + if (__pyx_t_4) { + } else { + __pyx_t_5 = __pyx_t_4; + goto __pyx_L12_bool_binop_done; + } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1447, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (__pyx_t_9 > 1); + if (__pyx_t_4) { + } else { + __pyx_t_5 = __pyx_t_4; + goto __pyx_L12_bool_binop_done; + } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1447, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = (!__pyx_t_4); + __pyx_t_5 = __pyx_t_3; + __pyx_L12_bool_binop_done:; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":1448 + * output += ":" + * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + * output += "/." # <<<<<<<<<<<<<< + * output += _serialize_url_path(url, canonicalize=canonicalize) + * if url.query is not None: + */ + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__23); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_6); + __pyx_t_6 = 0; + + /* "w3lib/_url.pyx":1447 + * elif url._port_token_seen: + * output += ":" + * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< + * output += "/." + * output += _serialize_url_path(url, canonicalize=canonicalize) + */ + } + __pyx_L3:; + + /* "w3lib/_url.pyx":1449 + * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + * output += "/." + * output += _serialize_url_path(url, canonicalize=canonicalize) # <<<<<<<<<<<<<< + * if url.query is not None: + * output += f"?{url.query}" + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_serialize_url_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_url); + __Pyx_GIVEREF(__pyx_v_url); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_url)) __PYX_ERR(0, 1449, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_canonicalize, __pyx_v_canonicalize) < 0) __PYX_ERR(0, 1449, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1450 + * output += "/." + * output += _serialize_url_path(url, canonicalize=canonicalize) + * if url.query is not None: # <<<<<<<<<<<<<< + * output += f"?{url.query}" + * if not exclude_fragment and url.fragment is not None: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":1451 + * output += _serialize_url_path(url, canonicalize=canonicalize) + * if url.query is not None: + * output += f"?{url.query}" # <<<<<<<<<<<<<< + * if not exclude_fragment and url.fragment is not None: + * output += f"#{url.fragment}" + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__14, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_7); + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":1450 + * output += "/." + * output += _serialize_url_path(url, canonicalize=canonicalize) + * if url.query is not None: # <<<<<<<<<<<<<< + * output += f"?{url.query}" + * if not exclude_fragment and url.fragment is not None: + */ + } + + /* "w3lib/_url.pyx":1452 + * if url.query is not None: + * output += f"?{url.query}" + * if not exclude_fragment and url.fragment is not None: # <<<<<<<<<<<<<< + * output += f"#{url.fragment}" + * return output + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_exclude_fragment); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1452, __pyx_L1_error) + __pyx_t_4 = (!__pyx_t_3); + if (__pyx_t_4) { + } else { + __pyx_t_5 = __pyx_t_4; + goto __pyx_L17_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = (__pyx_t_7 != Py_None); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __pyx_t_4; + __pyx_L17_bool_binop_done:; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":1453 + * output += f"?{url.query}" + * if not exclude_fragment and url.fragment is not None: + * output += f"#{url.fragment}" # <<<<<<<<<<<<<< + * return output + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__12, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1452 + * if url.query is not None: + * output += f"?{url.query}" + * if not exclude_fragment and url.fragment is not None: # <<<<<<<<<<<<<< + * output += f"#{url.fragment}" + * return output + */ + } + + /* "w3lib/_url.pyx":1454 + * if not exclude_fragment and url.fragment is not None: + * output += f"#{url.fragment}" + * return output # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1454, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_output); + __pyx_r = ((PyObject*)__pyx_v_output); + goto __pyx_L0; + + /* "w3lib/_url.pyx":1391 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing + * def _serialize_url( # <<<<<<<<<<<<<< + * url: _URL, + * *, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._serialize_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *__pyx_freelist_5w3lib_4_url___pyx_scope_struct__genexpr[8]; +static int __pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr = 0; + +static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + #if CYTHON_COMPILING_IN_CPYTHON + if (likely((int)(__pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr)))) { + o = (PyObject*)__pyx_freelist_5w3lib_4_url___pyx_scope_struct__genexpr[--__pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else + #endif + { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct__genexpr(PyObject *o) { + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *p = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct__genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_code_point); + #if CYTHON_COMPILING_IN_CPYTHON + if (((int)(__pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr)))) { + __pyx_freelist_5w3lib_4_url___pyx_scope_struct__genexpr[__pyx_freecount_5w3lib_4_url___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)o); + } else + #endif + { + #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + (*Py_TYPE(o)->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + if (tp_free) tp_free(o); + } + #endif + } +} + +static int __pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *p = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)o; + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + } + if (p->__pyx_v_code_point) { + e = (*v)(p->__pyx_v_code_point, a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct__genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct__genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec = { + "w3lib._url.__pyx_scope_struct__genexpr", + sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "w3lib._url.""__pyx_scope_struct__genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct__genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct__genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *__pyx_freelist_5w3lib_4_url___pyx_scope_struct_1_genexpr[8]; +static int __pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr = 0; + +static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + #if CYTHON_COMPILING_IN_CPYTHON + if (likely((int)(__pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr)))) { + o = (PyObject*)__pyx_freelist_5w3lib_4_url___pyx_scope_struct_1_genexpr[--__pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else + #endif + { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyObject *o) { + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct_1_genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_item); + #if CYTHON_COMPILING_IN_CPYTHON + if (((int)(__pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr)))) { + __pyx_freelist_5w3lib_4_url___pyx_scope_struct_1_genexpr[__pyx_freecount_5w3lib_4_url___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)o); + } else + #endif + { + #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + (*Py_TYPE(o)->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + if (tp_free) tp_free(o); + } + #endif + } +} + +static int __pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)o; + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + } + if (p->__pyx_v_item) { + e = (*v)(p->__pyx_v_item, a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct_1_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct_1_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec = { + "w3lib._url.__pyx_scope_struct_1_genexpr", + sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "w3lib._url.""__pyx_scope_struct_1_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_5w3lib_4_url___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_5w3lib_4_url___pyx_scope_struct_1_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_02X, __pyx_k_02X, sizeof(__pyx_k_02X), 0, 1, 0, 0}, + {&__pyx_kp_u_0X, __pyx_k_0X, sizeof(__pyx_k_0X), 0, 1, 0, 0}, + {&__pyx_kp_u_0x, __pyx_k_0x, sizeof(__pyx_k_0x), 0, 1, 0, 0}, + {&__pyx_kp_u_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 1, 0, 0}, + {&__pyx_kp_u_2E, __pyx_k_2E, sizeof(__pyx_k_2E), 0, 1, 0, 0}, + {&__pyx_kp_u_2E_2, __pyx_k_2E_2, sizeof(__pyx_k_2E_2), 0, 1, 0, 0}, + {&__pyx_kp_u_2E_2E, __pyx_k_2E_2E, sizeof(__pyx_k_2E_2E), 0, 1, 0, 0}, + {&__pyx_kp_u_2E_2e, __pyx_k_2E_2e, sizeof(__pyx_k_2E_2e), 0, 1, 0, 0}, + {&__pyx_kp_u_2E_3, __pyx_k_2E_3, sizeof(__pyx_k_2E_3), 0, 1, 0, 0}, + {&__pyx_kp_u_2e, __pyx_k_2e, sizeof(__pyx_k_2e), 0, 1, 0, 0}, + {&__pyx_kp_u_2e_2, __pyx_k_2e_2, sizeof(__pyx_k_2e_2), 0, 1, 0, 0}, + {&__pyx_kp_u_2e_2E, __pyx_k_2e_2E, sizeof(__pyx_k_2e_2E), 0, 1, 0, 0}, + {&__pyx_kp_u_2e_2e, __pyx_k_2e_2e, sizeof(__pyx_k_2e_2e), 0, 1, 0, 0}, + {&__pyx_kp_u_2e_3, __pyx_k_2e_3, sizeof(__pyx_k_2e_3), 0, 1, 0, 0}, + {&__pyx_kp_u_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 1, 0, 0}, + {&__pyx_kp_u_866, __pyx_k_866, sizeof(__pyx_k_866), 0, 1, 0, 0}, + {&__pyx_n_s_ASCII_ALPHA, __pyx_k_ASCII_ALPHA, sizeof(__pyx_k_ASCII_ALPHA), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_ALPHANUMERIC, __pyx_k_ASCII_ALPHANUMERIC, sizeof(__pyx_k_ASCII_ALPHANUMERIC), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_DIGIT, __pyx_k_ASCII_DIGIT, sizeof(__pyx_k_ASCII_DIGIT), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_HEX_DIGIT, __pyx_k_ASCII_HEX_DIGIT, sizeof(__pyx_k_ASCII_HEX_DIGIT), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_TAB_OR_NEWLINE, __pyx_k_ASCII_TAB_OR_NEWLINE, sizeof(__pyx_k_ASCII_TAB_OR_NEWLINE), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO, __pyx_k_ASCII_TAB_OR_NEWLINE_TRANSLATIO, sizeof(__pyx_k_ASCII_TAB_OR_NEWLINE_TRANSLATIO), 0, 0, 1, 1}, + {&__pyx_n_s_ASCII_WHITESPACE, __pyx_k_ASCII_WHITESPACE, sizeof(__pyx_k_ASCII_WHITESPACE), 0, 0, 1, 1}, + {&__pyx_n_s_AnyStr, __pyx_k_AnyStr, sizeof(__pyx_k_AnyStr), 0, 0, 1, 1}, + {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, + {&__pyx_n_s_C0_CONTROL, __pyx_k_C0_CONTROL, sizeof(__pyx_k_C0_CONTROL), 0, 0, 1, 1}, + {&__pyx_n_s_C0_CONTROL_OR_SPACE, __pyx_k_C0_CONTROL_OR_SPACE, sizeof(__pyx_k_C0_CONTROL_OR_SPACE), 0, 0, 1, 1}, + {&__pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_k_C0_CONTROL_PERCENT_ENCODE_SET, sizeof(__pyx_k_C0_CONTROL_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_Callable, __pyx_k_Callable, sizeof(__pyx_k_Callable), 0, 0, 1, 1}, + {&__pyx_n_s_CodecFunction, __pyx_k_CodecFunction, sizeof(__pyx_k_CodecFunction), 0, 0, 1, 1}, + {&__pyx_n_s_DEFAULT_PORTS, __pyx_k_DEFAULT_PORTS, sizeof(__pyx_k_DEFAULT_PORTS), 0, 0, 1, 1}, + {&__pyx_n_s_DecodeFunction, __pyx_k_DecodeFunction, sizeof(__pyx_k_DecodeFunction), 0, 0, 1, 1}, + {&__pyx_n_s_Dict, __pyx_k_Dict, sizeof(__pyx_k_Dict), 0, 0, 1, 1}, + {&__pyx_kp_s_Dict_str_str, __pyx_k_Dict_str_str, sizeof(__pyx_k_Dict_str_str), 0, 0, 1, 0}, + {&__pyx_kp_u_Domain_name, __pyx_k_Domain_name, sizeof(__pyx_k_Domain_name), 0, 1, 0, 0}, + {&__pyx_n_s_EncodeFunction, __pyx_k_EncodeFunction, sizeof(__pyx_k_EncodeFunction), 0, 0, 1, 1}, + {&__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_k_FORBIDDEN_DOMAIN_CODE_POINTS, sizeof(__pyx_k_FORBIDDEN_DOMAIN_CODE_POINTS), 0, 0, 1, 1}, + {&__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_k_FORBIDDEN_HOST_CODE_POINTS, sizeof(__pyx_k_FORBIDDEN_HOST_CODE_POINTS), 0, 0, 1, 1}, + {&__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_k_FRAGMENT_PERCENT_ENCODE_SET, sizeof(__pyx_k_FRAGMENT_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_LABEL_ENCODINGS, __pyx_k_LABEL_ENCODINGS, sizeof(__pyx_k_LABEL_ENCODINGS), 0, 0, 1, 1}, + {&__pyx_n_s_List, __pyx_k_List, sizeof(__pyx_k_List), 0, 0, 1, 1}, + {&__pyx_kp_s_List_int, __pyx_k_List_int, sizeof(__pyx_k_List_int), 0, 0, 1, 0}, + {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1}, + {&__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS, __pyx_k_OUTPUT_ENCODING_UTF8_ENCODINGS, sizeof(__pyx_k_OUTPUT_ENCODING_UTF8_ENCODINGS), 0, 0, 1, 1}, + {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1}, + {&__pyx_kp_s_Optional_bool, __pyx_k_Optional_bool, sizeof(__pyx_k_Optional_bool), 0, 0, 1, 0}, + {&__pyx_kp_s_Optional_int, __pyx_k_Optional_int, sizeof(__pyx_k_Optional_int), 0, 0, 1, 0}, + {&__pyx_kp_s_Optional_str, __pyx_k_Optional_str, sizeof(__pyx_k_Optional_str), 0, 0, 1, 0}, + {&__pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_k_PATH_PERCENT_ENCODE_SET, sizeof(__pyx_k_PATH_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_PercentEncodeSet, __pyx_k_PercentEncodeSet, sizeof(__pyx_k_PercentEncodeSet), 0, 0, 1, 1}, + {&__pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_k_QUERY_PERCENT_ENCODE_SET, sizeof(__pyx_k_QUERY_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_REPLACEMENT_ENCODING, __pyx_k_REPLACEMENT_ENCODING, sizeof(__pyx_k_REPLACEMENT_ENCODING), 0, 0, 1, 1}, + {&__pyx_n_s_SCHEME_CHARS, __pyx_k_SCHEME_CHARS, sizeof(__pyx_k_SCHEME_CHARS), 0, 0, 1, 1}, + {&__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_k_SPECIAL_QUERY_PERCENT_ENCODE_SE, sizeof(__pyx_k_SPECIAL_QUERY_PERCENT_ENCODE_SE), 0, 0, 1, 1}, + {&__pyx_n_s_SPECIAL_SCHEMES, __pyx_k_SPECIAL_SCHEMES, sizeof(__pyx_k_SPECIAL_SCHEMES), 0, 0, 1, 1}, + {&__pyx_n_s_Tuple, __pyx_k_Tuple, sizeof(__pyx_k_Tuple), 0, 0, 1, 1}, + {&__pyx_kp_s_Tuple_int_bool, __pyx_k_Tuple_int_bool, sizeof(__pyx_k_Tuple_int_bool), 0, 0, 1, 0}, + {&__pyx_n_s_URL, __pyx_k_URL, sizeof(__pyx_k_URL), 0, 0, 1, 1}, + {&__pyx_n_s_URL___init, __pyx_k_URL___init, sizeof(__pyx_k_URL___init), 0, 0, 1, 1}, + {&__pyx_n_s_URL_has_opaque_path, __pyx_k_URL_has_opaque_path, sizeof(__pyx_k_URL_has_opaque_path), 0, 0, 1, 1}, + {&__pyx_n_s_URL_scheme, __pyx_k_URL_scheme, sizeof(__pyx_k_URL_scheme), 0, 0, 1, 1}, + {&__pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_k_USERINFO_PERCENT_ENCODE_SET, sizeof(__pyx_k_USERINFO_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_UTF_16BE_ENCODING, __pyx_k_UTF_16BE_ENCODING, sizeof(__pyx_k_UTF_16BE_ENCODING), 0, 0, 1, 1}, + {&__pyx_n_s_UTF_16LE_ENCODING, __pyx_k_UTF_16LE_ENCODING, sizeof(__pyx_k_UTF_16LE_ENCODING), 0, 0, 1, 1}, + {&__pyx_n_s_UTF_8_ENCODER, __pyx_k_UTF_8_ENCODER, sizeof(__pyx_k_UTF_8_ENCODER), 0, 0, 1, 1}, + {&__pyx_n_s_UTF_8_ENCODING, __pyx_k_UTF_8_ENCODING, sizeof(__pyx_k_UTF_8_ENCODING), 0, 0, 1, 1}, + {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, + {&__pyx_kp_s_Union_int_List_int_str, __pyx_k_Union_int_List_int_str, sizeof(__pyx_k_Union_int_List_int_str), 0, 0, 1, 0}, + {&__pyx_kp_s_Union_str_List_str, __pyx_k_Union_str_List_str, sizeof(__pyx_k_Union_str_List_str), 0, 0, 1, 0}, + {&__pyx_kp_s_Union_str_int_List_int, __pyx_k_Union_str_int_List_int, sizeof(__pyx_k_Union_str_int_List_int), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0}, + {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, + {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0}, + {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0}, + {&__pyx_n_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 1}, + {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0}, + {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0}, + {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0}, + {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0}, + {&__pyx_kp_u__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0}, + {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0}, + {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, + {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, + {&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0}, + {&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0}, + {&__pyx_kp_u__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0, 0}, + {&__pyx_n_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 1}, + {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, + {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, + {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, + {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, + {&__pyx_kp_u__75, __pyx_k__75, sizeof(__pyx_k__75), 0, 1, 0, 0}, + {&__pyx_n_s__78, __pyx_k__78, sizeof(__pyx_k__78), 0, 0, 1, 1}, + {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, + {&__pyx_kp_u__81, __pyx_k__81, sizeof(__pyx_k__81), 0, 1, 0, 0}, + {&__pyx_kp_u__82, __pyx_k__82, sizeof(__pyx_k__82), 0, 1, 0, 0}, + {&__pyx_kp_u__83, __pyx_k__83, sizeof(__pyx_k__83), 0, 1, 0, 0}, + {&__pyx_kp_u__84, __pyx_k__84, sizeof(__pyx_k__84), 0, 1, 0, 0}, + {&__pyx_kp_u__85, __pyx_k__85, sizeof(__pyx_k__85), 0, 1, 0, 0}, + {&__pyx_kp_u__86, __pyx_k__86, sizeof(__pyx_k__86), 0, 1, 0, 0}, + {&__pyx_kp_u__87, __pyx_k__87, sizeof(__pyx_k__87), 0, 1, 0, 0}, + {&__pyx_kp_u__88, __pyx_k__88, sizeof(__pyx_k__88), 0, 1, 0, 0}, + {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, + {&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1}, + {&__pyx_n_s_annotations, __pyx_k_annotations, sizeof(__pyx_k_annotations), 0, 0, 1, 1}, + {&__pyx_kp_u_ansi_x3_4_1968, __pyx_k_ansi_x3_4_1968, sizeof(__pyx_k_ansi_x3_4_1968), 0, 1, 0, 0}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_u_arabic, __pyx_k_arabic, sizeof(__pyx_k_arabic), 0, 1, 0, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1}, + {&__pyx_n_s_ascii_domain, __pyx_k_ascii_domain, sizeof(__pyx_k_ascii_domain), 0, 0, 1, 1}, + {&__pyx_kp_u_asmo_708, __pyx_k_asmo_708, sizeof(__pyx_k_asmo_708), 0, 1, 0, 0}, + {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, + {&__pyx_n_s_at_sign_index, __pyx_k_at_sign_index, sizeof(__pyx_k_at_sign_index), 0, 0, 1, 1}, + {&__pyx_n_s_at_sign_seen, __pyx_k_at_sign_seen, sizeof(__pyx_k_at_sign_seen), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_base_url, __pyx_k_base_url, sizeof(__pyx_k_base_url), 0, 0, 1, 1}, + {&__pyx_n_s_be_strict, __pyx_k_be_strict, sizeof(__pyx_k_be_strict), 0, 0, 1, 1}, + {&__pyx_n_u_big5, __pyx_k_big5, sizeof(__pyx_k_big5), 0, 1, 0, 1}, + {&__pyx_kp_u_big5_hkscs, __pyx_k_big5_hkscs, sizeof(__pyx_k_big5_hkscs), 0, 1, 0, 0}, + {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_byte, __pyx_k_byte, sizeof(__pyx_k_byte), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_s_canonicalize, __pyx_k_canonicalize, sizeof(__pyx_k_canonicalize), 0, 0, 1, 1}, + {&__pyx_n_s_check_bidi, __pyx_k_check_bidi, sizeof(__pyx_k_check_bidi), 0, 0, 1, 1}, + {&__pyx_n_s_check_hyphens, __pyx_k_check_hyphens, sizeof(__pyx_k_check_hyphens), 0, 0, 1, 1}, + {&__pyx_n_s_check_joiners, __pyx_k_check_joiners, sizeof(__pyx_k_check_joiners), 0, 0, 1, 1}, + {&__pyx_n_u_chinese, __pyx_k_chinese, sizeof(__pyx_k_chinese), 0, 1, 0, 1}, + {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, + {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_kp_u_cn_big5, __pyx_k_cn_big5, sizeof(__pyx_k_cn_big5), 0, 1, 0, 0}, + {&__pyx_n_s_code_point, __pyx_k_code_point, sizeof(__pyx_k_code_point), 0, 0, 1, 1}, + {&__pyx_n_s_codec_info, __pyx_k_codec_info, sizeof(__pyx_k_codec_info), 0, 0, 1, 1}, + {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1}, + {&__pyx_n_s_compress, __pyx_k_compress, sizeof(__pyx_k_compress), 0, 0, 1, 1}, + {&__pyx_n_s_counter, __pyx_k_counter, sizeof(__pyx_k_counter), 0, 0, 1, 1}, + {&__pyx_n_u_cp125, __pyx_k_cp125, sizeof(__pyx_k_cp125), 0, 1, 0, 1}, + {&__pyx_n_u_cp1252, __pyx_k_cp1252, sizeof(__pyx_k_cp1252), 0, 1, 0, 1}, + {&__pyx_n_u_cp1254, __pyx_k_cp1254, sizeof(__pyx_k_cp1254), 0, 1, 0, 1}, + {&__pyx_n_u_cp819, __pyx_k_cp819, sizeof(__pyx_k_cp819), 0, 1, 0, 1}, + {&__pyx_n_u_cp866, __pyx_k_cp866, sizeof(__pyx_k_cp866), 0, 1, 0, 1}, + {&__pyx_n_u_cp874, __pyx_k_cp874, sizeof(__pyx_k_cp874), 0, 1, 0, 1}, + {&__pyx_n_u_csbig5, __pyx_k_csbig5, sizeof(__pyx_k_csbig5), 0, 1, 0, 1}, + {&__pyx_n_u_cseuckr, __pyx_k_cseuckr, sizeof(__pyx_k_cseuckr), 0, 1, 0, 1}, + {&__pyx_n_u_cseucpkdfmtjapanese, __pyx_k_cseucpkdfmtjapanese, sizeof(__pyx_k_cseucpkdfmtjapanese), 0, 1, 0, 1}, + {&__pyx_n_u_csgb2312, __pyx_k_csgb2312, sizeof(__pyx_k_csgb2312), 0, 1, 0, 1}, + {&__pyx_n_u_csibm866, __pyx_k_csibm866, sizeof(__pyx_k_csibm866), 0, 1, 0, 1}, + {&__pyx_n_u_csiso2022jp, __pyx_k_csiso2022jp, sizeof(__pyx_k_csiso2022jp), 0, 1, 0, 1}, + {&__pyx_n_u_csiso2022kr, __pyx_k_csiso2022kr, sizeof(__pyx_k_csiso2022kr), 0, 1, 0, 1}, + {&__pyx_n_u_csiso58gb231280, __pyx_k_csiso58gb231280, sizeof(__pyx_k_csiso58gb231280), 0, 1, 0, 1}, + {&__pyx_n_u_csiso88596e, __pyx_k_csiso88596e, sizeof(__pyx_k_csiso88596e), 0, 1, 0, 1}, + {&__pyx_n_u_csiso88596i, __pyx_k_csiso88596i, sizeof(__pyx_k_csiso88596i), 0, 1, 0, 1}, + {&__pyx_n_u_csiso88598e, __pyx_k_csiso88598e, sizeof(__pyx_k_csiso88598e), 0, 1, 0, 1}, + {&__pyx_n_u_csiso88598i, __pyx_k_csiso88598i, sizeof(__pyx_k_csiso88598i), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatin1, __pyx_k_csisolatin1, sizeof(__pyx_k_csisolatin1), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatin2, __pyx_k_csisolatin2, sizeof(__pyx_k_csisolatin2), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatin3, __pyx_k_csisolatin3, sizeof(__pyx_k_csisolatin3), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatin4, __pyx_k_csisolatin4, sizeof(__pyx_k_csisolatin4), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatin5, __pyx_k_csisolatin5, sizeof(__pyx_k_csisolatin5), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatin6, __pyx_k_csisolatin6, sizeof(__pyx_k_csisolatin6), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatin9, __pyx_k_csisolatin9, sizeof(__pyx_k_csisolatin9), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatinarabic, __pyx_k_csisolatinarabic, sizeof(__pyx_k_csisolatinarabic), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatincyrillic, __pyx_k_csisolatincyrillic, sizeof(__pyx_k_csisolatincyrillic), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatingreek, __pyx_k_csisolatingreek, sizeof(__pyx_k_csisolatingreek), 0, 1, 0, 1}, + {&__pyx_n_u_csisolatinhebrew, __pyx_k_csisolatinhebrew, sizeof(__pyx_k_csisolatinhebrew), 0, 1, 0, 1}, + {&__pyx_n_u_cskoi8r, __pyx_k_cskoi8r, sizeof(__pyx_k_cskoi8r), 0, 1, 0, 1}, + {&__pyx_n_u_csksc56011987, __pyx_k_csksc56011987, sizeof(__pyx_k_csksc56011987), 0, 1, 0, 1}, + {&__pyx_n_u_csmacintosh, __pyx_k_csmacintosh, sizeof(__pyx_k_csmacintosh), 0, 1, 0, 1}, + {&__pyx_n_u_csshiftjis, __pyx_k_csshiftjis, sizeof(__pyx_k_csshiftjis), 0, 1, 0, 1}, + {&__pyx_n_u_csunicode, __pyx_k_csunicode, sizeof(__pyx_k_csunicode), 0, 1, 0, 1}, + {&__pyx_n_s_current_index, __pyx_k_current_index, sizeof(__pyx_k_current_index), 0, 0, 1, 1}, + {&__pyx_n_s_current_length, __pyx_k_current_length, sizeof(__pyx_k_current_length), 0, 0, 1, 1}, + {&__pyx_n_u_cyrillic, __pyx_k_cyrillic, sizeof(__pyx_k_cyrillic), 0, 1, 0, 1}, + {&__pyx_n_s_default_port_seen, __pyx_k_default_port_seen, sizeof(__pyx_k_default_port_seen), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_kp_u_does_not_match_any_encoding_lab, __pyx_k_does_not_match_any_encoding_lab, sizeof(__pyx_k_does_not_match_any_encoding_lab), 0, 1, 0, 0}, + {&__pyx_n_s_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 0, 0, 1, 1}, + {&__pyx_n_s_domain_to_ascii, __pyx_k_domain_to_ascii, sizeof(__pyx_k_domain_to_ascii), 0, 0, 1, 1}, + {&__pyx_kp_u_dos_874, __pyx_k_dos_874, sizeof(__pyx_k_dos_874), 0, 1, 0, 0}, + {&__pyx_kp_u_ecma_114, __pyx_k_ecma_114, sizeof(__pyx_k_ecma_114), 0, 1, 0, 0}, + {&__pyx_kp_u_ecma_118, __pyx_k_ecma_118, sizeof(__pyx_k_ecma_118), 0, 1, 0, 0}, + {&__pyx_n_u_elot_928, __pyx_k_elot_928, sizeof(__pyx_k_elot_928), 0, 1, 0, 1}, + {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_encode_output, __pyx_k_encode_output, sizeof(__pyx_k_encode_output), 0, 0, 1, 1}, + {&__pyx_n_s_encode_set, __pyx_k_encode_set, sizeof(__pyx_k_encode_set), 0, 0, 1, 1}, + {&__pyx_n_s_encoded, __pyx_k_encoded, sizeof(__pyx_k_encoded), 0, 0, 1, 1}, + {&__pyx_n_s_encoded_code_points, __pyx_k_encoded_code_points, sizeof(__pyx_k_encoded_code_points), 0, 0, 1, 1}, + {&__pyx_n_s_encoder, __pyx_k_encoder, sizeof(__pyx_k_encoder), 0, 0, 1, 1}, + {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_ends_in_number, __pyx_k_ends_in_number, sizeof(__pyx_k_ends_in_number), 0, 0, 1, 1}, + {&__pyx_n_s_ends_in_number_locals_genexpr, __pyx_k_ends_in_number_locals_genexpr, sizeof(__pyx_k_ends_in_number_locals_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_kp_u_euc_jp, __pyx_k_euc_jp, sizeof(__pyx_k_euc_jp), 0, 1, 0, 0}, + {&__pyx_kp_u_euc_kr, __pyx_k_euc_kr, sizeof(__pyx_k_euc_kr), 0, 1, 0, 0}, + {&__pyx_n_s_exclude_fragment, __pyx_k_exclude_fragment, sizeof(__pyx_k_exclude_fragment), 0, 0, 1, 1}, + {&__pyx_n_u_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 1, 0, 1}, + {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1}, + {&__pyx_n_s_fragment, __pyx_k_fragment, sizeof(__pyx_k_fragment), 0, 0, 1, 1}, + {&__pyx_n_s_fragment_percent_encode_set, __pyx_k_fragment_percent_encode_set, sizeof(__pyx_k_fragment_percent_encode_set), 0, 0, 1, 1}, + {&__pyx_n_u_ftp, __pyx_k_ftp, sizeof(__pyx_k_ftp), 0, 1, 0, 1}, + {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, + {&__pyx_n_u_gb18030, __pyx_k_gb18030, sizeof(__pyx_k_gb18030), 0, 1, 0, 1}, + {&__pyx_n_u_gb2312, __pyx_k_gb2312, sizeof(__pyx_k_gb2312), 0, 1, 0, 1}, + {&__pyx_n_u_gb_2312, __pyx_k_gb_2312, sizeof(__pyx_k_gb_2312), 0, 1, 0, 1}, + {&__pyx_kp_u_gb_2312_80, __pyx_k_gb_2312_80, sizeof(__pyx_k_gb_2312_80), 0, 1, 0, 0}, + {&__pyx_n_u_gbk, __pyx_k_gbk, sizeof(__pyx_k_gbk), 0, 1, 0, 1}, + {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, + {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_encoder, __pyx_k_get_encoder, sizeof(__pyx_k_get_encoder), 0, 0, 1, 1}, + {&__pyx_n_s_get_encoding, __pyx_k_get_encoding, sizeof(__pyx_k_get_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_k_get_ipv6_first_longest_0_piece, sizeof(__pyx_k_get_ipv6_first_longest_0_piece), 0, 0, 1, 1}, + {&__pyx_n_s_greater_than, __pyx_k_greater_than, sizeof(__pyx_k_greater_than), 0, 0, 1, 1}, + {&__pyx_n_u_greek, __pyx_k_greek, sizeof(__pyx_k_greek), 0, 1, 0, 1}, + {&__pyx_n_u_greek8, __pyx_k_greek8, sizeof(__pyx_k_greek8), 0, 1, 0, 1}, + {&__pyx_n_s_has_opaque_path, __pyx_k_has_opaque_path, sizeof(__pyx_k_has_opaque_path), 0, 0, 1, 1}, + {&__pyx_n_u_hebrew, __pyx_k_hebrew, sizeof(__pyx_k_hebrew), 0, 1, 0, 1}, + {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1}, + {&__pyx_n_s_hostname, __pyx_k_hostname, sizeof(__pyx_k_hostname), 0, 0, 1, 1}, + {&__pyx_n_u_http, __pyx_k_http, sizeof(__pyx_k_http), 0, 1, 0, 1}, + {&__pyx_n_u_https, __pyx_k_https, sizeof(__pyx_k_https), 0, 1, 0, 1}, + {&__pyx_kp_u_hz_gb_2312, __pyx_k_hz_gb_2312, sizeof(__pyx_k_hz_gb_2312), 0, 1, 0, 0}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_u_ibm819, __pyx_k_ibm819, sizeof(__pyx_k_ibm819), 0, 1, 0, 1}, + {&__pyx_n_u_ibm866, __pyx_k_ibm866, sizeof(__pyx_k_ibm866), 0, 1, 0, 1}, + {&__pyx_n_s_idempotent_utf_8_percent_encode, __pyx_k_idempotent_utf_8_percent_encode, sizeof(__pyx_k_idempotent_utf_8_percent_encode), 0, 0, 1, 1}, + {&__pyx_n_s_ignore0, __pyx_k_ignore0, sizeof(__pyx_k_ignore0), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, + {&__pyx_n_s_index_length, __pyx_k_index_length, sizeof(__pyx_k_index_length), 0, 0, 1, 1}, + {&__pyx_n_s_infra, __pyx_k_infra, sizeof(__pyx_k_infra), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, + {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, + {&__pyx_n_s_input, __pyx_k_input, sizeof(__pyx_k_input), 0, 0, 1, 1}, + {&__pyx_n_s_input_lenght, __pyx_k_input_lenght, sizeof(__pyx_k_input_lenght), 0, 0, 1, 1}, + {&__pyx_n_s_input_length, __pyx_k_input_length, sizeof(__pyx_k_input_length), 0, 0, 1, 1}, + {&__pyx_n_s_inside_brackets, __pyx_k_inside_brackets, sizeof(__pyx_k_inside_brackets), 0, 0, 1, 1}, + {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, + {&__pyx_n_s_ipv4, __pyx_k_ipv4, sizeof(__pyx_k_ipv4), 0, 0, 1, 1}, + {&__pyx_n_s_ipv4_piece, __pyx_k_ipv4_piece, sizeof(__pyx_k_ipv4_piece), 0, 0, 1, 1}, + {&__pyx_kp_u_is_an_empty_string_after_conver, __pyx_k_is_an_empty_string_after_conver, sizeof(__pyx_k_is_an_empty_string_after_conver), 0, 1, 0, 0}, + {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, + {&__pyx_n_s_is_double_dot_path_segment, __pyx_k_is_double_dot_path_segment, sizeof(__pyx_k_is_double_dot_path_segment), 0, 0, 1, 1}, + {&__pyx_n_s_is_single_dot_path_segment, __pyx_k_is_single_dot_path_segment, sizeof(__pyx_k_is_single_dot_path_segment), 0, 0, 1, 1}, + {&__pyx_n_s_is_special, __pyx_k_is_special, sizeof(__pyx_k_is_special), 0, 0, 1, 1}, + {&__pyx_n_s_is_windows_drive_letter, __pyx_k_is_windows_drive_letter, sizeof(__pyx_k_is_windows_drive_letter), 0, 0, 1, 1}, + {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, + {&__pyx_n_u_iso88591, __pyx_k_iso88591, sizeof(__pyx_k_iso88591), 0, 1, 0, 1}, + {&__pyx_n_u_iso885910, __pyx_k_iso885910, sizeof(__pyx_k_iso885910), 0, 1, 0, 1}, + {&__pyx_n_u_iso885911, __pyx_k_iso885911, sizeof(__pyx_k_iso885911), 0, 1, 0, 1}, + {&__pyx_n_u_iso885913, __pyx_k_iso885913, sizeof(__pyx_k_iso885913), 0, 1, 0, 1}, + {&__pyx_n_u_iso885914, __pyx_k_iso885914, sizeof(__pyx_k_iso885914), 0, 1, 0, 1}, + {&__pyx_n_u_iso885915, __pyx_k_iso885915, sizeof(__pyx_k_iso885915), 0, 1, 0, 1}, + {&__pyx_n_u_iso88592, __pyx_k_iso88592, sizeof(__pyx_k_iso88592), 0, 1, 0, 1}, + {&__pyx_n_u_iso88593, __pyx_k_iso88593, sizeof(__pyx_k_iso88593), 0, 1, 0, 1}, + {&__pyx_n_u_iso88594, __pyx_k_iso88594, sizeof(__pyx_k_iso88594), 0, 1, 0, 1}, + {&__pyx_n_u_iso88595, __pyx_k_iso88595, sizeof(__pyx_k_iso88595), 0, 1, 0, 1}, + {&__pyx_n_u_iso88596, __pyx_k_iso88596, sizeof(__pyx_k_iso88596), 0, 1, 0, 1}, + {&__pyx_n_u_iso88597, __pyx_k_iso88597, sizeof(__pyx_k_iso88597), 0, 1, 0, 1}, + {&__pyx_n_u_iso88598, __pyx_k_iso88598, sizeof(__pyx_k_iso88598), 0, 1, 0, 1}, + {&__pyx_n_u_iso88599, __pyx_k_iso88599, sizeof(__pyx_k_iso88599), 0, 1, 0, 1}, + {&__pyx_kp_u_iso8859_1, __pyx_k_iso8859_1, sizeof(__pyx_k_iso8859_1), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_10, __pyx_k_iso8859_10, sizeof(__pyx_k_iso8859_10), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_11, __pyx_k_iso8859_11, sizeof(__pyx_k_iso8859_11), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_13, __pyx_k_iso8859_13, sizeof(__pyx_k_iso8859_13), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_14, __pyx_k_iso8859_14, sizeof(__pyx_k_iso8859_14), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_15, __pyx_k_iso8859_15, sizeof(__pyx_k_iso8859_15), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_2, __pyx_k_iso8859_2, sizeof(__pyx_k_iso8859_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_3, __pyx_k_iso8859_3, sizeof(__pyx_k_iso8859_3), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_4, __pyx_k_iso8859_4, sizeof(__pyx_k_iso8859_4), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_5, __pyx_k_iso8859_5, sizeof(__pyx_k_iso8859_5), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_6, __pyx_k_iso8859_6, sizeof(__pyx_k_iso8859_6), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_7, __pyx_k_iso8859_7, sizeof(__pyx_k_iso8859_7), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_8, __pyx_k_iso8859_8, sizeof(__pyx_k_iso8859_8), 0, 1, 0, 0}, + {&__pyx_kp_u_iso8859_9, __pyx_k_iso8859_9, sizeof(__pyx_k_iso8859_9), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_10646_ucs_2, __pyx_k_iso_10646_ucs_2, sizeof(__pyx_k_iso_10646_ucs_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_2022_cn, __pyx_k_iso_2022_cn, sizeof(__pyx_k_iso_2022_cn), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_2022_cn_ext, __pyx_k_iso_2022_cn_ext, sizeof(__pyx_k_iso_2022_cn_ext), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_2022_jp, __pyx_k_iso_2022_jp, sizeof(__pyx_k_iso_2022_jp), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_2022_kr, __pyx_k_iso_2022_kr, sizeof(__pyx_k_iso_2022_kr), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_1, __pyx_k_iso_8859_1, sizeof(__pyx_k_iso_8859_1), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_10, __pyx_k_iso_8859_10, sizeof(__pyx_k_iso_8859_10), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_11, __pyx_k_iso_8859_11, sizeof(__pyx_k_iso_8859_11), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_13, __pyx_k_iso_8859_13, sizeof(__pyx_k_iso_8859_13), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_14, __pyx_k_iso_8859_14, sizeof(__pyx_k_iso_8859_14), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_15, __pyx_k_iso_8859_15, sizeof(__pyx_k_iso_8859_15), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_15_2, __pyx_k_iso_8859_15_2, sizeof(__pyx_k_iso_8859_15_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_16, __pyx_k_iso_8859_16, sizeof(__pyx_k_iso_8859_16), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_1_1987, __pyx_k_iso_8859_1_1987, sizeof(__pyx_k_iso_8859_1_1987), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_1_2, __pyx_k_iso_8859_1_2, sizeof(__pyx_k_iso_8859_1_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_2, __pyx_k_iso_8859_2, sizeof(__pyx_k_iso_8859_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_2_1987, __pyx_k_iso_8859_2_1987, sizeof(__pyx_k_iso_8859_2_1987), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_2_2, __pyx_k_iso_8859_2_2, sizeof(__pyx_k_iso_8859_2_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_3, __pyx_k_iso_8859_3, sizeof(__pyx_k_iso_8859_3), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_3_1988, __pyx_k_iso_8859_3_1988, sizeof(__pyx_k_iso_8859_3_1988), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_3_2, __pyx_k_iso_8859_3_2, sizeof(__pyx_k_iso_8859_3_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_4, __pyx_k_iso_8859_4, sizeof(__pyx_k_iso_8859_4), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_4_1988, __pyx_k_iso_8859_4_1988, sizeof(__pyx_k_iso_8859_4_1988), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_4_2, __pyx_k_iso_8859_4_2, sizeof(__pyx_k_iso_8859_4_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_5, __pyx_k_iso_8859_5, sizeof(__pyx_k_iso_8859_5), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_5_1988, __pyx_k_iso_8859_5_1988, sizeof(__pyx_k_iso_8859_5_1988), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_5_2, __pyx_k_iso_8859_5_2, sizeof(__pyx_k_iso_8859_5_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_6, __pyx_k_iso_8859_6, sizeof(__pyx_k_iso_8859_6), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_6_1987, __pyx_k_iso_8859_6_1987, sizeof(__pyx_k_iso_8859_6_1987), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_6_2, __pyx_k_iso_8859_6_2, sizeof(__pyx_k_iso_8859_6_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_6_e, __pyx_k_iso_8859_6_e, sizeof(__pyx_k_iso_8859_6_e), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_6_i, __pyx_k_iso_8859_6_i, sizeof(__pyx_k_iso_8859_6_i), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_7, __pyx_k_iso_8859_7, sizeof(__pyx_k_iso_8859_7), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_7_1987, __pyx_k_iso_8859_7_1987, sizeof(__pyx_k_iso_8859_7_1987), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_7_2, __pyx_k_iso_8859_7_2, sizeof(__pyx_k_iso_8859_7_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_8, __pyx_k_iso_8859_8, sizeof(__pyx_k_iso_8859_8), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_8_1988, __pyx_k_iso_8859_8_1988, sizeof(__pyx_k_iso_8859_8_1988), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_8_2, __pyx_k_iso_8859_8_2, sizeof(__pyx_k_iso_8859_8_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_8_e, __pyx_k_iso_8859_8_e, sizeof(__pyx_k_iso_8859_8_e), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_8_i, __pyx_k_iso_8859_8_i, sizeof(__pyx_k_iso_8859_8_i), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_9, __pyx_k_iso_8859_9, sizeof(__pyx_k_iso_8859_9), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_9_1989, __pyx_k_iso_8859_9_1989, sizeof(__pyx_k_iso_8859_9_1989), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_8859_9_2, __pyx_k_iso_8859_9_2, sizeof(__pyx_k_iso_8859_9_2), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_100, __pyx_k_iso_ir_100, sizeof(__pyx_k_iso_ir_100), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_101, __pyx_k_iso_ir_101, sizeof(__pyx_k_iso_ir_101), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_109, __pyx_k_iso_ir_109, sizeof(__pyx_k_iso_ir_109), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_110, __pyx_k_iso_ir_110, sizeof(__pyx_k_iso_ir_110), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_126, __pyx_k_iso_ir_126, sizeof(__pyx_k_iso_ir_126), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_127, __pyx_k_iso_ir_127, sizeof(__pyx_k_iso_ir_127), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_138, __pyx_k_iso_ir_138, sizeof(__pyx_k_iso_ir_138), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_144, __pyx_k_iso_ir_144, sizeof(__pyx_k_iso_ir_144), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_148, __pyx_k_iso_ir_148, sizeof(__pyx_k_iso_ir_148), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_149, __pyx_k_iso_ir_149, sizeof(__pyx_k_iso_ir_149), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_157, __pyx_k_iso_ir_157, sizeof(__pyx_k_iso_ir_157), 0, 1, 0, 0}, + {&__pyx_kp_u_iso_ir_58, __pyx_k_iso_ir_58, sizeof(__pyx_k_iso_ir_58), 0, 1, 0, 0}, + {&__pyx_n_s_isomorph, __pyx_k_isomorph, sizeof(__pyx_k_isomorph), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_u_koi, __pyx_k_koi, sizeof(__pyx_k_koi), 0, 1, 0, 1}, + {&__pyx_n_u_koi8, __pyx_k_koi8, sizeof(__pyx_k_koi8), 0, 1, 0, 1}, + {&__pyx_kp_u_koi8_r, __pyx_k_koi8_r, sizeof(__pyx_k_koi8_r), 0, 1, 0, 0}, + {&__pyx_n_u_koi8_r_2, __pyx_k_koi8_r_2, sizeof(__pyx_k_koi8_r_2), 0, 1, 0, 1}, + {&__pyx_kp_u_koi8_ru, __pyx_k_koi8_ru, sizeof(__pyx_k_koi8_ru), 0, 1, 0, 0}, + {&__pyx_kp_u_koi8_u, __pyx_k_koi8_u, sizeof(__pyx_k_koi8_u), 0, 1, 0, 0}, + {&__pyx_n_u_korean, __pyx_k_korean, sizeof(__pyx_k_korean), 0, 1, 0, 1}, + {&__pyx_kp_u_ks_c_5601_1987, __pyx_k_ks_c_5601_1987, sizeof(__pyx_k_ks_c_5601_1987), 0, 1, 0, 0}, + {&__pyx_kp_u_ks_c_5601_1989, __pyx_k_ks_c_5601_1989, sizeof(__pyx_k_ks_c_5601_1989), 0, 1, 0, 0}, + {&__pyx_n_u_ksc5601, __pyx_k_ksc5601, sizeof(__pyx_k_ksc5601), 0, 1, 0, 1}, + {&__pyx_n_u_ksc_5601, __pyx_k_ksc_5601, sizeof(__pyx_k_ksc_5601), 0, 1, 0, 1}, + {&__pyx_n_u_l1, __pyx_k_l1, sizeof(__pyx_k_l1), 0, 1, 0, 1}, + {&__pyx_n_u_l2, __pyx_k_l2, sizeof(__pyx_k_l2), 0, 1, 0, 1}, + {&__pyx_n_u_l3, __pyx_k_l3, sizeof(__pyx_k_l3), 0, 1, 0, 1}, + {&__pyx_n_u_l4, __pyx_k_l4, sizeof(__pyx_k_l4), 0, 1, 0, 1}, + {&__pyx_n_u_l5, __pyx_k_l5, sizeof(__pyx_k_l5), 0, 1, 0, 1}, + {&__pyx_n_u_l6, __pyx_k_l6, sizeof(__pyx_k_l6), 0, 1, 0, 1}, + {&__pyx_n_u_l9, __pyx_k_l9, sizeof(__pyx_k_l9), 0, 1, 0, 1}, + {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1}, + {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1}, + {&__pyx_n_s_last_digit, __pyx_k_last_digit, sizeof(__pyx_k_last_digit), 0, 0, 1, 1}, + {&__pyx_n_u_latin1, __pyx_k_latin1, sizeof(__pyx_k_latin1), 0, 1, 0, 1}, + {&__pyx_n_u_latin2, __pyx_k_latin2, sizeof(__pyx_k_latin2), 0, 1, 0, 1}, + {&__pyx_n_u_latin3, __pyx_k_latin3, sizeof(__pyx_k_latin3), 0, 1, 0, 1}, + {&__pyx_n_u_latin4, __pyx_k_latin4, sizeof(__pyx_k_latin4), 0, 1, 0, 1}, + {&__pyx_n_u_latin5, __pyx_k_latin5, sizeof(__pyx_k_latin5), 0, 1, 0, 1}, + {&__pyx_n_u_latin6, __pyx_k_latin6, sizeof(__pyx_k_latin6), 0, 1, 0, 1}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_u_localhost, __pyx_k_localhost, sizeof(__pyx_k_localhost), 0, 1, 0, 1}, + {&__pyx_n_u_logical, __pyx_k_logical, sizeof(__pyx_k_logical), 0, 1, 0, 1}, + {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1}, + {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, + {&__pyx_n_s_lru_cache, __pyx_k_lru_cache, sizeof(__pyx_k_lru_cache), 0, 0, 1, 1}, + {&__pyx_n_u_mac, __pyx_k_mac, sizeof(__pyx_k_mac), 0, 1, 0, 1}, + {&__pyx_kp_u_mac_cyrillic, __pyx_k_mac_cyrillic, sizeof(__pyx_k_mac_cyrillic), 0, 1, 0, 0}, + {&__pyx_n_u_macintosh, __pyx_k_macintosh, sizeof(__pyx_k_macintosh), 0, 1, 0, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1}, + {&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_min_length, __pyx_k_min_length, sizeof(__pyx_k_min_length), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_u_ms932, __pyx_k_ms932, sizeof(__pyx_k_ms932), 0, 1, 0, 1}, + {&__pyx_n_u_ms_kanji, __pyx_k_ms_kanji, sizeof(__pyx_k_ms_kanji), 0, 1, 0, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_number, __pyx_k_number, sizeof(__pyx_k_number), 0, 0, 1, 1}, + {&__pyx_n_s_numbers, __pyx_k_numbers, sizeof(__pyx_k_numbers), 0, 0, 1, 1}, + {&__pyx_n_s_numbers_seen, __pyx_k_numbers_seen, sizeof(__pyx_k_numbers_seen), 0, 0, 1, 1}, + {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, + {&__pyx_n_s_parse_host, __pyx_k_parse_host, sizeof(__pyx_k_parse_host), 0, 0, 1, 1}, + {&__pyx_n_s_parse_ipv4, __pyx_k_parse_ipv4, sizeof(__pyx_k_parse_ipv4), 0, 0, 1, 1}, + {&__pyx_n_s_parse_ipv4_locals_genexpr, __pyx_k_parse_ipv4_locals_genexpr, sizeof(__pyx_k_parse_ipv4_locals_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_parse_ipv4_number, __pyx_k_parse_ipv4_number, sizeof(__pyx_k_parse_ipv4_number), 0, 0, 1, 1}, + {&__pyx_n_s_parse_ipv6, __pyx_k_parse_ipv6, sizeof(__pyx_k_parse_ipv6), 0, 0, 1, 1}, + {&__pyx_n_s_parse_opaque_host, __pyx_k_parse_opaque_host, sizeof(__pyx_k_parse_opaque_host), 0, 0, 1, 1}, + {&__pyx_n_s_parse_url, __pyx_k_parse_url, sizeof(__pyx_k_parse_url), 0, 0, 1, 1}, + {&__pyx_n_s_part, __pyx_k_part, sizeof(__pyx_k_part), 0, 0, 1, 1}, + {&__pyx_n_s_parts, __pyx_k_parts, sizeof(__pyx_k_parts), 0, 0, 1, 1}, + {&__pyx_n_s_password, __pyx_k_password, sizeof(__pyx_k_password), 0, 0, 1, 1}, + {&__pyx_n_s_password_token_seen, __pyx_k_password_token_seen, sizeof(__pyx_k_password_token_seen), 0, 0, 1, 1}, + {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, + {&__pyx_n_s_path_percent_encode_set, __pyx_k_path_percent_encode_set, sizeof(__pyx_k_path_percent_encode_set), 0, 0, 1, 1}, + {&__pyx_n_s_path_token_seen, __pyx_k_path_token_seen, sizeof(__pyx_k_path_token_seen), 0, 0, 1, 1}, + {&__pyx_n_s_percent_encode_after_encoding, __pyx_k_percent_encode_after_encoding, sizeof(__pyx_k_percent_encode_after_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_percent_encode_set, __pyx_k_percent_encode_set, sizeof(__pyx_k_percent_encode_set), 0, 0, 1, 1}, + {&__pyx_n_s_piece, __pyx_k_piece, sizeof(__pyx_k_piece), 0, 0, 1, 1}, + {&__pyx_n_s_piece_index, __pyx_k_piece_index, sizeof(__pyx_k_piece_index), 0, 0, 1, 1}, + {&__pyx_n_s_pointer, __pyx_k_pointer, sizeof(__pyx_k_pointer), 0, 0, 1, 1}, + {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1}, + {&__pyx_n_s_port_token_seen, __pyx_k_port_token_seen, sizeof(__pyx_k_port_token_seen), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1}, + {&__pyx_n_s_query_percent_encode_set, __pyx_k_query_percent_encode_set, sizeof(__pyx_k_query_percent_encode_set), 0, 0, 1, 1}, + {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_u_replacement, __pyx_k_replacement, sizeof(__pyx_k_replacement), 0, 1, 0, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, + {&__pyx_n_s_scheme, __pyx_k_scheme, sizeof(__pyx_k_scheme), 0, 0, 1, 1}, + {&__pyx_n_s_scheme_2, __pyx_k_scheme_2, sizeof(__pyx_k_scheme_2), 0, 0, 1, 1}, + {&__pyx_n_s_segment, __pyx_k_segment, sizeof(__pyx_k_segment), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_separator, __pyx_k_separator, sizeof(__pyx_k_separator), 0, 0, 1, 1}, + {&__pyx_n_s_serialize_host, __pyx_k_serialize_host, sizeof(__pyx_k_serialize_host), 0, 0, 1, 1}, + {&__pyx_n_s_serialize_ipv4, __pyx_k_serialize_ipv4, sizeof(__pyx_k_serialize_ipv4), 0, 0, 1, 1}, + {&__pyx_n_s_serialize_ipv6, __pyx_k_serialize_ipv6, sizeof(__pyx_k_serialize_ipv6), 0, 0, 1, 1}, + {&__pyx_n_s_serialize_url, __pyx_k_serialize_url, sizeof(__pyx_k_serialize_url), 0, 0, 1, 1}, + {&__pyx_n_s_serialize_url_path, __pyx_k_serialize_url_path, sizeof(__pyx_k_serialize_url_path), 0, 0, 1, 1}, + {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, + {&__pyx_n_s_setter, __pyx_k_setter, sizeof(__pyx_k_setter), 0, 0, 1, 1}, + {&__pyx_kp_u_shift_jis, __pyx_k_shift_jis, sizeof(__pyx_k_shift_jis), 0, 1, 0, 0}, + {&__pyx_n_u_shift_jis_2, __pyx_k_shift_jis_2, sizeof(__pyx_k_shift_jis_2), 0, 1, 0, 1}, + {&__pyx_n_s_short_windows_125, __pyx_k_short_windows_125, sizeof(__pyx_k_short_windows_125), 0, 0, 1, 1}, + {&__pyx_n_s_shorten_path, __pyx_k_shorten_path, sizeof(__pyx_k_shorten_path), 0, 0, 1, 1}, + {&__pyx_n_u_sjis, __pyx_k_sjis, sizeof(__pyx_k_sjis), 0, 1, 0, 1}, + {&__pyx_n_s_skip_authority_shortcut, __pyx_k_skip_authority_shortcut, sizeof(__pyx_k_skip_authority_shortcut), 0, 0, 1, 1}, + {&__pyx_n_s_space_as_plus, __pyx_k_space_as_plus, sizeof(__pyx_k_space_as_plus), 0, 0, 1, 1}, + {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, + {&__pyx_n_s_special_query_percent_encode_set, __pyx_k_special_query_percent_encode_set, sizeof(__pyx_k_special_query_percent_encode_set), 0, 0, 1, 1}, + {&__pyx_n_s_starts_with_windows_drive_lette, __pyx_k_starts_with_windows_drive_lette, sizeof(__pyx_k_starts_with_windows_drive_lette), 0, 0, 1, 1}, + {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, + {&__pyx_n_u_sun_eu_greek, __pyx_k_sun_eu_greek, sizeof(__pyx_k_sun_eu_greek), 0, 1, 0, 1}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_swaps, __pyx_k_swaps, sizeof(__pyx_k_swaps), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_kp_u_tis_620, __pyx_k_tis_620, sizeof(__pyx_k_tis_620), 0, 1, 0, 0}, + {&__pyx_n_s_to_ascii, __pyx_k_to_ascii, sizeof(__pyx_k_to_ascii), 0, 0, 1, 1}, + {&__pyx_n_s_transitional_processing, __pyx_k_transitional_processing, sizeof(__pyx_k_transitional_processing), 0, 0, 1, 1}, + {&__pyx_n_s_translate, __pyx_k_translate, sizeof(__pyx_k_translate), 0, 0, 1, 1}, {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, + {&__pyx_kp_u_ucs_2, __pyx_k_ucs_2, sizeof(__pyx_k_ucs_2), 0, 1, 0, 0}, + {&__pyx_n_u_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 1, 0, 1}, + {&__pyx_n_u_unicode11utf8, __pyx_k_unicode11utf8, sizeof(__pyx_k_unicode11utf8), 0, 1, 0, 1}, + {&__pyx_n_u_unicode20utf8, __pyx_k_unicode20utf8, sizeof(__pyx_k_unicode20utf8), 0, 1, 0, 1}, + {&__pyx_kp_u_unicode_1_1_utf_8, __pyx_k_unicode_1_1_utf_8, sizeof(__pyx_k_unicode_1_1_utf_8), 0, 1, 0, 0}, + {&__pyx_n_u_unicodefeff, __pyx_k_unicodefeff, sizeof(__pyx_k_unicodefeff), 0, 1, 0, 1}, + {&__pyx_n_u_unicodefffe, __pyx_k_unicodefffe, sizeof(__pyx_k_unicodefffe), 0, 1, 0, 1}, {&__pyx_n_s_unquote, __pyx_k_unquote, sizeof(__pyx_k_unquote), 0, 0, 1, 1}, {&__pyx_n_s_url, __pyx_k_url, sizeof(__pyx_k_url), 0, 0, 1, 1}, {&__pyx_n_s_urllib_parse, __pyx_k_urllib_parse, sizeof(__pyx_k_urllib_parse), 0, 0, 1, 1}, + {&__pyx_kp_u_us_ascii, __pyx_k_us_ascii, sizeof(__pyx_k_us_ascii), 0, 1, 0, 0}, {&__pyx_n_s_use_std3_ascii_rules, __pyx_k_use_std3_ascii_rules, sizeof(__pyx_k_use_std3_ascii_rules), 0, 0, 1, 1}, {&__pyx_n_s_userinfo_percent_encode_set, __pyx_k_userinfo_percent_encode_set, sizeof(__pyx_k_userinfo_percent_encode_set), 0, 0, 1, 1}, {&__pyx_n_s_username, __pyx_k_username, sizeof(__pyx_k_username), 0, 0, 1, 1}, + {&__pyx_n_u_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 1, 0, 1}, + {&__pyx_kp_u_utf_16, __pyx_k_utf_16, sizeof(__pyx_k_utf_16), 0, 1, 0, 0}, + {&__pyx_kp_u_utf_16be, __pyx_k_utf_16be, sizeof(__pyx_k_utf_16be), 0, 1, 0, 0}, + {&__pyx_kp_u_utf_16le, __pyx_k_utf_16le, sizeof(__pyx_k_utf_16le), 0, 1, 0, 0}, {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, {&__pyx_n_s_utf_8_percent_encode, __pyx_k_utf_8_percent_encode, sizeof(__pyx_k_utf_8_percent_encode), 0, 0, 1, 1}, {&__pyx_n_s_util, __pyx_k_util, sizeof(__pyx_k_util), 0, 0, 1, 1}, @@ -21535,3016 +23654,6525 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_validation_error, __pyx_k_validation_error, sizeof(__pyx_k_validation_error), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_verify_dns_length, __pyx_k_verify_dns_length, sizeof(__pyx_k_verify_dns_length), 0, 0, 1, 1}, + {&__pyx_n_u_visual, __pyx_k_visual, sizeof(__pyx_k_visual), 0, 1, 0, 1}, {&__pyx_n_s_w3lib__url, __pyx_k_w3lib__url, sizeof(__pyx_k_w3lib__url), 0, 0, 1, 1}, {&__pyx_kp_s_w3lib__url_pyx, __pyx_k_w3lib__url_pyx, sizeof(__pyx_k_w3lib__url_pyx), 0, 0, 1, 0}, + {&__pyx_kp_u_windows_125, __pyx_k_windows_125, sizeof(__pyx_k_windows_125), 0, 1, 0, 0}, + {&__pyx_kp_u_windows_1252, __pyx_k_windows_1252, sizeof(__pyx_k_windows_1252), 0, 1, 0, 0}, + {&__pyx_kp_u_windows_1254, __pyx_k_windows_1254, sizeof(__pyx_k_windows_1254), 0, 1, 0, 0}, + {&__pyx_kp_u_windows_31j, __pyx_k_windows_31j, sizeof(__pyx_k_windows_31j), 0, 1, 0, 0}, + {&__pyx_kp_u_windows_874, __pyx_k_windows_874, sizeof(__pyx_k_windows_874), 0, 1, 0, 0}, + {&__pyx_kp_u_windows_949, __pyx_k_windows_949, sizeof(__pyx_k_windows_949), 0, 1, 0, 0}, {&__pyx_n_u_ws, __pyx_k_ws, sizeof(__pyx_k_ws), 0, 1, 0, 1}, {&__pyx_n_u_wss, __pyx_k_wss, sizeof(__pyx_k_wss), 0, 1, 0, 1}, {&__pyx_n_u_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 1, 0, 1}, + {&__pyx_kp_u_x_cp125, __pyx_k_x_cp125, sizeof(__pyx_k_x_cp125), 0, 1, 0, 0}, + {&__pyx_kp_u_x_cp1252, __pyx_k_x_cp1252, sizeof(__pyx_k_x_cp1252), 0, 1, 0, 0}, + {&__pyx_kp_u_x_cp1254, __pyx_k_x_cp1254, sizeof(__pyx_k_x_cp1254), 0, 1, 0, 0}, + {&__pyx_kp_u_x_euc_jp, __pyx_k_x_euc_jp, sizeof(__pyx_k_x_euc_jp), 0, 1, 0, 0}, + {&__pyx_kp_u_x_gbk, __pyx_k_x_gbk, sizeof(__pyx_k_x_gbk), 0, 1, 0, 0}, + {&__pyx_kp_u_x_mac_cyrillic, __pyx_k_x_mac_cyrillic, sizeof(__pyx_k_x_mac_cyrillic), 0, 1, 0, 0}, + {&__pyx_kp_u_x_mac_roman, __pyx_k_x_mac_roman, sizeof(__pyx_k_x_mac_roman), 0, 1, 0, 0}, + {&__pyx_kp_u_x_mac_ukrainian, __pyx_k_x_mac_ukrainian, sizeof(__pyx_k_x_mac_ukrainian), 0, 1, 0, 0}, + {&__pyx_kp_u_x_sjis, __pyx_k_x_sjis, sizeof(__pyx_k_x_sjis), 0, 1, 0, 0}, + {&__pyx_kp_u_x_unicode20utf8, __pyx_k_x_unicode20utf8, sizeof(__pyx_k_x_unicode20utf8), 0, 1, 0, 0}, + {&__pyx_kp_u_x_user_defined, __pyx_k_x_user_defined, sizeof(__pyx_k_x_user_defined), 0, 1, 0, 0}, + {&__pyx_kp_u_x_x_big5, __pyx_k_x_x_big5, sizeof(__pyx_k_x_x_big5), 0, 1, 0, 0}, {&__pyx_n_u_xmlcharrefreplace, __pyx_k_xmlcharrefreplace, sizeof(__pyx_k_xmlcharrefreplace), 0, 1, 0, 1}, {0, 0, 0, 0, 0, 0, 0} }; - return __Pyx_InitStrings(__pyx_string_tab); + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1076, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "w3lib/_url.pyx":568 + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + * return + * url.path = path[:-1] # <<<<<<<<<<<<<< + * + * + */ + __pyx_slice_ = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice_); + __Pyx_GIVEREF(__pyx_slice_); + + /* "w3lib/_url.pyx":745 + * r = 8 + * if not input: + * return (0, True) # <<<<<<<<<<<<<< + * return (int(input, base=r), validation_error) + * + */ + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, Py_True); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "w3lib/_url.pyx":1237 + * and _is_windows_drive_letter(buffer) + * ): + * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< + * if ( + * not url.path + */ + __pyx_slice__20 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__20); + __Pyx_GIVEREF(__pyx_slice__20); + + /* "w3lib/_url.pyx":32 + * + * + * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< + * return { + * label: f"windows-125{last_digit}" + */ + __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_last_digit, __pyx_n_s_label); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_short_windows_125, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 32, __pyx_L1_error) + + /* "w3lib/_url.pyx":56 + * label: _UTF_8_ENCODING + * for label in ( + * "unicode-1-1-utf-8", # <<<<<<<<<<<<<< + * "unicode11utf8", + * "unicode20utf8", + */ + __pyx_tuple__27 = PyTuple_Pack(6, __pyx_kp_u_unicode_1_1_utf_8, __pyx_n_u_unicode11utf8, __pyx_n_u_unicode20utf8, __pyx_kp_u_utf_8, __pyx_n_u_utf8, __pyx_kp_u_x_unicode20utf8); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "w3lib/_url.pyx":67 + * label: "ibm866" + * for label in ( + * "866", # <<<<<<<<<<<<<< + * "cp866", + * "csibm866", + */ + __pyx_tuple__28 = PyTuple_Pack(4, __pyx_kp_u_866, __pyx_n_u_cp866, __pyx_n_u_csibm866, __pyx_n_u_ibm866); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "w3lib/_url.pyx":76 + * label: "iso-8859-2" + * for label in ( + * "csisolatin2", # <<<<<<<<<<<<<< + * "iso-8859-2", + * "iso-ir-101", + */ + __pyx_tuple__29 = PyTuple_Pack(9, __pyx_n_u_csisolatin2, __pyx_kp_u_iso_8859_2, __pyx_kp_u_iso_ir_101, __pyx_kp_u_iso8859_2, __pyx_n_u_iso88592, __pyx_kp_u_iso_8859_2_2, __pyx_kp_u_iso_8859_2_1987, __pyx_n_u_l2, __pyx_n_u_latin2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "w3lib/_url.pyx":90 + * label: "iso-8859-3" + * for label in ( + * "csisolatin3", # <<<<<<<<<<<<<< + * "iso-8859-3", + * "iso-ir-109", + */ + __pyx_tuple__30 = PyTuple_Pack(9, __pyx_n_u_csisolatin3, __pyx_kp_u_iso_8859_3, __pyx_kp_u_iso_ir_109, __pyx_kp_u_iso8859_3, __pyx_n_u_iso88593, __pyx_kp_u_iso_8859_3_2, __pyx_kp_u_iso_8859_3_1988, __pyx_n_u_l3, __pyx_n_u_latin3); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "w3lib/_url.pyx":104 + * label: "iso-8859-4" + * for label in ( + * "csisolatin4", # <<<<<<<<<<<<<< + * "iso-8859-4", + * "iso-ir-110", + */ + __pyx_tuple__31 = PyTuple_Pack(9, __pyx_n_u_csisolatin4, __pyx_kp_u_iso_8859_4, __pyx_kp_u_iso_ir_110, __pyx_kp_u_iso8859_4, __pyx_n_u_iso88594, __pyx_kp_u_iso_8859_4_2, __pyx_kp_u_iso_8859_4_1988, __pyx_n_u_l4, __pyx_n_u_latin4); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "w3lib/_url.pyx":118 + * label: "iso-8859-5" + * for label in ( + * "csisolatincyrillic", # <<<<<<<<<<<<<< + * "cyrillic", + * "iso-8859-5", + */ + __pyx_tuple__32 = PyTuple_Pack(8, __pyx_n_u_csisolatincyrillic, __pyx_n_u_cyrillic, __pyx_kp_u_iso_8859_5, __pyx_kp_u_iso_ir_144, __pyx_kp_u_iso8859_5, __pyx_n_u_iso88595, __pyx_kp_u_iso_8859_5_2, __pyx_kp_u_iso_8859_5_1988); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "w3lib/_url.pyx":131 + * label: "iso-8859-6" + * for label in ( + * "arabic", # <<<<<<<<<<<<<< + * "asmo-708", + * "csiso88596e", + */ + __pyx_tuple__33 = PyTuple_Pack(14, __pyx_n_u_arabic, __pyx_kp_u_asmo_708, __pyx_n_u_csiso88596e, __pyx_n_u_csiso88596i, __pyx_n_u_csisolatinarabic, __pyx_kp_u_ecma_114, __pyx_kp_u_iso_8859_6, __pyx_kp_u_iso_8859_6_e, __pyx_kp_u_iso_8859_6_i, __pyx_kp_u_iso_ir_127, __pyx_kp_u_iso8859_6, __pyx_n_u_iso88596, __pyx_kp_u_iso_8859_6_2, __pyx_kp_u_iso_8859_6_1987); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "w3lib/_url.pyx":150 + * label: "iso-8859-7" + * for label in ( + * "csisolatingreek", # <<<<<<<<<<<<<< + * "ecma-118", + * "elot_928", + */ + __pyx_tuple__34 = PyTuple_Pack(12, __pyx_n_u_csisolatingreek, __pyx_kp_u_ecma_118, __pyx_n_u_elot_928, __pyx_n_u_greek, __pyx_n_u_greek8, __pyx_kp_u_iso_8859_7, __pyx_kp_u_iso_ir_126, __pyx_kp_u_iso8859_7, __pyx_n_u_iso88597, __pyx_kp_u_iso_8859_7_2, __pyx_kp_u_iso_8859_7_1987, __pyx_n_u_sun_eu_greek); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "w3lib/_url.pyx":167 + * label: "iso-8859-8" + * for label in ( + * "csiso88598e", # <<<<<<<<<<<<<< + * "csisolatinhebrew", + * "hebrew", + */ + __pyx_tuple__35 = PyTuple_Pack(11, __pyx_n_u_csiso88598e, __pyx_n_u_csisolatinhebrew, __pyx_n_u_hebrew, __pyx_kp_u_iso_8859_8, __pyx_kp_u_iso_8859_8_e, __pyx_kp_u_iso_ir_138, __pyx_kp_u_iso8859_8, __pyx_n_u_iso88598, __pyx_kp_u_iso_8859_8_2, __pyx_kp_u_iso_8859_8_1988, __pyx_n_u_visual); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "w3lib/_url.pyx":183 + * label: "iso-8859-8-i" + * for label in ( + * "csiso88598i", # <<<<<<<<<<<<<< + * "iso-8859-8-i", + * "logical", + */ + __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_u_csiso88598i, __pyx_kp_u_iso_8859_8_i, __pyx_n_u_logical); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "w3lib/_url.pyx":191 + * label: "iso-8859-10" + * for label in ( + * "csisolatin6", # <<<<<<<<<<<<<< + * "iso-8859-10", + * "iso-ir-157", + */ + __pyx_tuple__37 = PyTuple_Pack(7, __pyx_n_u_csisolatin6, __pyx_kp_u_iso_8859_10, __pyx_kp_u_iso_ir_157, __pyx_kp_u_iso8859_10, __pyx_n_u_iso885910, __pyx_n_u_l6, __pyx_n_u_latin6); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "w3lib/_url.pyx":215 + * label: "iso-8859-13" + * for label in ( + * "iso-8859-13", # <<<<<<<<<<<<<< + * "iso8859-13", + * "iso885913", + */ + __pyx_tuple__38 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_13, __pyx_kp_u_iso8859_13, __pyx_n_u_iso885913); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "w3lib/_url.pyx":223 + * label: "iso-8859-14" + * for label in ( + * "iso-8859-14", # <<<<<<<<<<<<<< + * "iso8859-14", + * "iso885914", + */ + __pyx_tuple__39 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_14, __pyx_kp_u_iso8859_14, __pyx_n_u_iso885914); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "w3lib/_url.pyx":231 + * label: "iso-8859-15" + * for label in ( + * "csisolatin9", # <<<<<<<<<<<<<< + * "iso-8859-15", + * "iso8859-15", + */ + __pyx_tuple__40 = PyTuple_Pack(6, __pyx_n_u_csisolatin9, __pyx_kp_u_iso_8859_15, __pyx_kp_u_iso8859_15, __pyx_n_u_iso885915, __pyx_kp_u_iso_8859_15_2, __pyx_n_u_l9); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "w3lib/_url.pyx":243 + * label: "koi8-r" + * for label in ( + * "cskoi8r", # <<<<<<<<<<<<<< + * "koi", + * "koi8", + */ + __pyx_tuple__41 = PyTuple_Pack(5, __pyx_n_u_cskoi8r, __pyx_n_u_koi, __pyx_n_u_koi8, __pyx_kp_u_koi8_r, __pyx_n_u_koi8_r_2); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "w3lib/_url.pyx":253 + * label: "koi8-u" + * for label in ( + * "koi8-ru", # <<<<<<<<<<<<<< + * "koi8-u", + * ) + */ + __pyx_tuple__42 = PyTuple_Pack(2, __pyx_kp_u_koi8_ru, __pyx_kp_u_koi8_u); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "w3lib/_url.pyx":260 + * label: "macintosh" + * for label in ( + * "csmacintosh", # <<<<<<<<<<<<<< + * "mac", + * "macintosh", + */ + __pyx_tuple__43 = PyTuple_Pack(4, __pyx_n_u_csmacintosh, __pyx_n_u_mac, __pyx_n_u_macintosh, __pyx_kp_u_x_mac_roman); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "w3lib/_url.pyx":269 + * label: "cp874" + * for label in ( + * "dos-874", # <<<<<<<<<<<<<< + * "iso-8859-11", + * "iso8859-11", + */ + __pyx_tuple__44 = PyTuple_Pack(6, __pyx_kp_u_dos_874, __pyx_kp_u_iso_8859_11, __pyx_kp_u_iso8859_11, __pyx_n_u_iso885911, __pyx_kp_u_tis_620, __pyx_kp_u_windows_874); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "w3lib/_url.pyx":277 + * ) + * }, + * **_short_windows_125(0), # <<<<<<<<<<<<<< + * **_short_windows_125(1), + * **{ + */ + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "w3lib/_url.pyx":278 + * }, + * **_short_windows_125(0), + * **_short_windows_125(1), # <<<<<<<<<<<<<< + * **{ + * label: "windows-1252" + */ + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + + /* "w3lib/_url.pyx":282 + * label: "windows-1252" + * for label in ( + * "ansi_x3.4-1968", # <<<<<<<<<<<<<< + * "ascii", + * "cp1252", + */ + __pyx_tuple__47 = PyTuple_Pack(17, __pyx_kp_u_ansi_x3_4_1968, __pyx_n_u_ascii, __pyx_n_u_cp1252, __pyx_n_u_cp819, __pyx_n_u_csisolatin1, __pyx_n_u_ibm819, __pyx_kp_u_iso_8859_1, __pyx_kp_u_iso_ir_100, __pyx_kp_u_iso8859_1, __pyx_n_u_iso88591, __pyx_kp_u_iso_8859_1_2, __pyx_kp_u_iso_8859_1_1987, __pyx_n_u_l1, __pyx_n_u_latin1, __pyx_kp_u_us_ascii, __pyx_kp_u_windows_1252, __pyx_kp_u_x_cp1252); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + + /* "w3lib/_url.pyx":301 + * ) + * }, + * **_short_windows_125(3), # <<<<<<<<<<<<<< + * **{ + * label: "windows-1254" + */ + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + + /* "w3lib/_url.pyx":305 + * label: "windows-1254" + * for label in ( + * "cp1254", # <<<<<<<<<<<<<< + * "csisolatin5", + * "iso-8859-9", + */ + __pyx_tuple__49 = PyTuple_Pack(12, __pyx_n_u_cp1254, __pyx_n_u_csisolatin5, __pyx_kp_u_iso_8859_9, __pyx_kp_u_iso_ir_148, __pyx_kp_u_iso8859_9, __pyx_n_u_iso88599, __pyx_kp_u_iso_8859_9_2, __pyx_kp_u_iso_8859_9_1989, __pyx_n_u_l5, __pyx_n_u_latin5, __pyx_kp_u_windows_1254, __pyx_kp_u_x_cp1254); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + + /* "w3lib/_url.pyx":319 + * ) + * }, + * **_short_windows_125(5), # <<<<<<<<<<<<<< + * **_short_windows_125(6), + * **_short_windows_125(7), + */ + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + + /* "w3lib/_url.pyx":320 + * }, + * **_short_windows_125(5), + * **_short_windows_125(6), # <<<<<<<<<<<<<< + * **_short_windows_125(7), + * **_short_windows_125(8), + */ + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_int_6); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + + /* "w3lib/_url.pyx":321 + * **_short_windows_125(5), + * **_short_windows_125(6), + * **_short_windows_125(7), # <<<<<<<<<<<<<< + * **_short_windows_125(8), + * **{ + */ + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_int_7); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + + /* "w3lib/_url.pyx":322 + * **_short_windows_125(6), + * **_short_windows_125(7), + * **_short_windows_125(8), # <<<<<<<<<<<<<< + * **{ + * label: "mac-cyrillic" + */ + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_int_8); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + + /* "w3lib/_url.pyx":326 + * label: "mac-cyrillic" + * for label in ( + * "x-mac-cyrillic", # <<<<<<<<<<<<<< + * "x-mac-ukrainian", + * ) + */ + __pyx_tuple__54 = PyTuple_Pack(2, __pyx_kp_u_x_mac_cyrillic, __pyx_kp_u_x_mac_ukrainian); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + + /* "w3lib/_url.pyx":333 + * label: "gbk" + * for label in ( + * "chinese", # <<<<<<<<<<<<<< + * "csgb2312", + * "csiso58gb231280", + */ + __pyx_tuple__55 = PyTuple_Pack(9, __pyx_n_u_chinese, __pyx_n_u_csgb2312, __pyx_n_u_csiso58gb231280, __pyx_n_u_gb2312, __pyx_n_u_gb_2312, __pyx_kp_u_gb_2312_80, __pyx_n_u_gbk, __pyx_kp_u_iso_ir_58, __pyx_kp_u_x_gbk); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + + /* "w3lib/_url.pyx":348 + * label: "big5" + * for label in ( + * "big5", # <<<<<<<<<<<<<< + * "big5-hkscs", + * "cn-big5", + */ + __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_u_big5, __pyx_kp_u_big5_hkscs, __pyx_kp_u_cn_big5, __pyx_n_u_csbig5, __pyx_kp_u_x_x_big5); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + + /* "w3lib/_url.pyx":358 + * label: "euc-jp" + * for label in ( + * "cseucpkdfmtjapanese", # <<<<<<<<<<<<<< + * "euc-jp", + * "x-euc-jp", + */ + __pyx_tuple__57 = PyTuple_Pack(3, __pyx_n_u_cseucpkdfmtjapanese, __pyx_kp_u_euc_jp, __pyx_kp_u_x_euc_jp); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 358, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + + /* "w3lib/_url.pyx":366 + * label: "iso-2022-jp" + * for label in ( + * "csiso2022jp", # <<<<<<<<<<<<<< + * "iso-2022-jp", + * ) + */ + __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_u_csiso2022jp, __pyx_kp_u_iso_2022_jp); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + + /* "w3lib/_url.pyx":373 + * label: "shift_jis" + * for label in ( + * "csshiftjis", # <<<<<<<<<<<<<< + * "ms932", + * "ms_kanji", + */ + __pyx_tuple__59 = PyTuple_Pack(8, __pyx_n_u_csshiftjis, __pyx_n_u_ms932, __pyx_n_u_ms_kanji, __pyx_kp_u_shift_jis, __pyx_n_u_shift_jis_2, __pyx_n_u_sjis, __pyx_kp_u_windows_31j, __pyx_kp_u_x_sjis); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + + /* "w3lib/_url.pyx":386 + * label: "euc-kr" + * for label in ( + * "cseuckr", # <<<<<<<<<<<<<< + * "csksc56011987", + * "euc-kr", + */ + __pyx_tuple__60 = PyTuple_Pack(10, __pyx_n_u_cseuckr, __pyx_n_u_csksc56011987, __pyx_kp_u_euc_kr, __pyx_kp_u_iso_ir_149, __pyx_n_u_korean, __pyx_kp_u_ks_c_5601_1987, __pyx_kp_u_ks_c_5601_1989, __pyx_n_u_ksc5601, __pyx_n_u_ksc_5601, __pyx_kp_u_windows_949); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + + /* "w3lib/_url.pyx":401 + * label: _REPLACEMENT_ENCODING + * for label in ( + * "csiso2022kr", # <<<<<<<<<<<<<< + * "hz-gb-2312", + * "iso-2022-cn", + */ + __pyx_tuple__61 = PyTuple_Pack(6, __pyx_n_u_csiso2022kr, __pyx_kp_u_hz_gb_2312, __pyx_kp_u_iso_2022_cn, __pyx_kp_u_iso_2022_cn_ext, __pyx_kp_u_iso_2022_kr, __pyx_n_u_replacement); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + + /* "w3lib/_url.pyx":412 + * label: _UTF_16BE_ENCODING + * for label in ( + * "unicodefffe", # <<<<<<<<<<<<<< + * "utf-16be", + * ) + */ + __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_u_unicodefffe, __pyx_kp_u_utf_16be); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + + /* "w3lib/_url.pyx":419 + * label: _UTF_16LE_ENCODING + * for label in ( + * "csunicode", # <<<<<<<<<<<<<< + * "iso-10646-ucs-2", + * "ucs-2", + */ + __pyx_tuple__63 = PyTuple_Pack(7, __pyx_n_u_csunicode, __pyx_kp_u_iso_10646_ucs_2, __pyx_kp_u_ucs_2, __pyx_n_u_unicode, __pyx_n_u_unicodefeff, __pyx_kp_u_utf_16, __pyx_kp_u_utf_16le); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + + /* "w3lib/_url.pyx":433 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoder(encoding: str) -> EncodeFunction: + * codec_info = codecs.lookup(encoding) + */ + __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_encoding, __pyx_n_s_codec_info); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_encoder, 433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 433, __pyx_L1_error) + + /* "w3lib/_url.pyx":439 + * + * + * _UTF_8_ENCODER = _get_encoder("utf-8") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + + /* "w3lib/_url.pyx":443 + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() + */ + __pyx_tuple__67 = PyTuple_Pack(2, __pyx_n_s_label, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_encoding, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 443, __pyx_L1_error) + + /* "w3lib/_url.pyx":543 + * _path_token_seen: bool = False + * + * def __init__(self) -> None: # <<<<<<<<<<<<<< + * self.path = [] + * self.is_special = False + */ + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_init, 543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 543, __pyx_L1_error) + + /* "w3lib/_url.pyx":547 + * self.is_special = False + * + * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< + * return isinstance(self.path, str) + * + */ + __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_has_opaque_path, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 547, __pyx_L1_error) + + /* "w3lib/_url.pyx":550 + * return isinstance(self.path, str) + * + * @property # <<<<<<<<<<<<<< + * def scheme(self) -> str: + * return self._scheme + */ + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 550, __pyx_L1_error) + + /* "w3lib/_url.pyx":554 + * return self._scheme + * + * @scheme.setter # <<<<<<<<<<<<<< + * def scheme(self, value: str) -> None: + * self._scheme = value + */ + __pyx_tuple__73 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 554, __pyx_L1_error) + + /* "w3lib/_url.pyx":564 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path + * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + */ + __pyx_tuple__76 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_path); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_shorten_path, 564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 564, __pyx_L1_error) + + /* "w3lib/_url.pyx":573 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode + * # Extended to handled cases where % is to be percent-encoded. + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + __pyx_tuple__79 = PyTuple_Pack(11, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_percent_encode_set, __pyx_n_s_space_as_plus, __pyx_n_s_encoder, __pyx_n_s_output, __pyx_n_s_encode_output, __pyx_n_s__78, __pyx_n_s_i, __pyx_n_s_byte, __pyx_n_s_isomorph); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_percent_encode_after_encoding, 573, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 573, __pyx_L1_error) + + /* "w3lib/_url.pyx":623 + * + * + * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< + * address = [0] * 8 + * piece_index = 0 + */ + __pyx_tuple__89 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_address, __pyx_n_s_piece_index, __pyx_n_s_compress, __pyx_n_s_pointer, __pyx_n_s_input_lenght, __pyx_n_s_value, __pyx_n_s_length, __pyx_n_s_numbers_seen, __pyx_n_s_ipv4_piece, __pyx_n_s_number, __pyx_n_s_swaps); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__89); + __Pyx_GIVEREF(__pyx_tuple__89); + __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv6, 623, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 623, __pyx_L1_error) + + /* "w3lib/_url.pyx":710 + * + * + * def _utf_8_percent_encode( # <<<<<<<<<<<<<< + * input: str, + * percent_encode_set: _PercentEncodeSet, + */ + __pyx_tuple__91 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); + __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_utf_8_percent_encode, 710, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 710, __pyx_L1_error) + + /* "w3lib/_url.pyx":722 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser + * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + */ + __pyx_tuple__93 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); + __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_opaque_host, 722, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 722, __pyx_L1_error) + + /* "w3lib/_url.pyx":730 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< + * if not input: + * raise ValueError + */ + __pyx_tuple__95 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_validation_error, __pyx_n_s_r); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 730, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4_number, 730, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 730, __pyx_L1_error) + + /* "w3lib/_url.pyx":750 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and parts[-1] == "": + */ + __pyx_tuple__97 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_last, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_ends_in_number, 750, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 750, __pyx_L1_error) + + /* "w3lib/_url.pyx":767 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and not parts[-1]: + */ + __pyx_tuple__99 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_numbers, __pyx_n_s_part, __pyx_n_s_result, __pyx_n_s_ipv4, __pyx_n_s_counter, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 767, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); + __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4, 767, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 767, __pyx_L1_error) + + /* "w3lib/_url.pyx":790 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< + * result = _utr46._to_ascii( + * domain, + */ + __pyx_tuple__101 = PyTuple_Pack(3, __pyx_n_s_domain, __pyx_n_s_be_strict, __pyx_n_s_result); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__101); + __Pyx_GIVEREF(__pyx_tuple__101); + __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_domain_to_ascii, 790, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 790, __pyx_L1_error) + + /* "w3lib/_url.pyx":809 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser + * def _parse_host( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + __pyx_tuple__103 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_is_special, __pyx_n_s_domain, __pyx_n_s_ascii_domain, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__103); + __Pyx_GIVEREF(__pyx_tuple__103); + __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_host, 809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 809, __pyx_L1_error) + + /* "w3lib/_url.pyx":831 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter + * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" + * + */ + __pyx_tuple__105 = PyTuple_Pack(1, __pyx_n_s_input); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__105); + __Pyx_GIVEREF(__pyx_tuple__105); + __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_windows_drive_letter, 831, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 831, __pyx_L1_error) + + /* "w3lib/_url.pyx":836 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter + * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * input_length = len(input) + * return ( + */ + __pyx_tuple__107 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_input_length); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__107); + __Pyx_GIVEREF(__pyx_tuple__107); + __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_starts_with_windows_drive_lette, 836, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 836, __pyx_L1_error) + + /* "w3lib/_url.pyx":846 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment + * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * "..", + */ + __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_double_dot_path_segment, 846, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 846, __pyx_L1_error) + + /* "w3lib/_url.pyx":861 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment + * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * ".", + */ + __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_single_dot_path_segment, 861, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 861, __pyx_L1_error) + + /* "w3lib/_url.pyx":872 + * # to be escaped, they are escaped in an idempotent way (i.e. if they are + * # already part of an escape sequence, they are not re-encoded). + * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * *, input: str, pointer: int, encode_set: _PercentEncodeSet + * ) -> str: + */ + __pyx_tuple__111 = PyTuple_Pack(4, __pyx_n_s_input, __pyx_n_s_pointer, __pyx_n_s_encode_set, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__111); + __Pyx_GIVEREF(__pyx_tuple__111); + __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_idempotent_utf_8_percent_encode, 872, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 872, __pyx_L1_error) + + /* "w3lib/_url.pyx":887 + * + * + * def _parse_url( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + __pyx_tuple__113 = PyTuple_Pack(26, __pyx_n_s_input, __pyx_n_s_base_url, __pyx_n_s_encoding, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_path_percent_encode_set, __pyx_n_s_query_percent_encode_set, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_base, __pyx_n_s_url, __pyx_n_s_state, __pyx_n_s_buffer, __pyx_n_s_at_sign_seen, __pyx_n_s_inside_brackets, __pyx_n_s_skip_authority_shortcut, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_c, __pyx_n_s_at_sign_index, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_encoded_code_points, __pyx_n_s_host, __pyx_n_s_port, __pyx_n_s_encoded, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 887, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__113); + __Pyx_GIVEREF(__pyx_tuple__113); + __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_url, 887, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 887, __pyx_L1_error) + + /* "w3lib/_url.pyx":1319 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 + * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< + * output = "" + * n = address + */ + __pyx_tuple__115 = PyTuple_Pack(4, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 1319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__115); + __Pyx_GIVEREF(__pyx_tuple__115); + __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv4, 1319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 1319, __pyx_L1_error) + + /* "w3lib/_url.pyx":1330 + * + * + * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< + * address: List[int], *, min_length: int = 2 + * ) -> Optional[int]: + */ + __pyx_tuple__117 = PyTuple_Pack(7, __pyx_n_s_address, __pyx_n_s_min_length, __pyx_n_s_index, __pyx_n_s_index_length, __pyx_n_s_current_length, __pyx_n_s_current_index, __pyx_n_s_piece); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 1330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__117); + __Pyx_GIVEREF(__pyx_tuple__117); + __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_ipv6_first_longest_0_piece, 1330, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 1330, __pyx_L1_error) + + /* "w3lib/_url.pyx":1348 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer + * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< + * output = "" + * compress = _get_ipv6_first_longest_0_piece_index(address) + */ + __pyx_tuple__119 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_compress, __pyx_n_s_ignore0, __pyx_n_s_piece_index, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 1348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__119); + __Pyx_GIVEREF(__pyx_tuple__119); + __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv6, 1348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 1348, __pyx_L1_error) + + /* "w3lib/_url.pyx":1369 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer + * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< + * if isinstance(host, int): + * return _serialize_ipv4(host) + */ + __pyx_tuple__121 = PyTuple_Pack(1, __pyx_n_s_host); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 1369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__121); + __Pyx_GIVEREF(__pyx_tuple__121); + __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_host, 1369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 1369, __pyx_L1_error) + + /* "w3lib/_url.pyx":1378 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer + * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< + * if url.has_opaque_path(): + * assert isinstance(url.path, str) + */ + __pyx_tuple__123 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_canonicalize, __pyx_n_s_output, __pyx_n_s_segment); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 1378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__123); + __Pyx_GIVEREF(__pyx_tuple__123); + __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url_path, 1378, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 1378, __pyx_L1_error) + + /* "w3lib/_url.pyx":1391 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing + * def _serialize_url( # <<<<<<<<<<<<<< + * url: _URL, + * *, + */ + __pyx_tuple__125 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_exclude_fragment, __pyx_n_s_canonicalize, __pyx_n_s_output); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 1391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__125); + __Pyx_GIVEREF(__pyx_tuple__125); + __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url, 1391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 1391, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + __pyx_umethod_PyUnicode_Type_strip.type = (PyObject*)&PyUnicode_Type; + __pyx_umethod_PyUnicode_Type_strip.method_name = &__pyx_n_s_strip; + __pyx_umethod_PyUnicode_Type_translate.type = (PyObject*)&PyUnicode_Type; + __pyx_umethod_PyUnicode_Type_translate.method_name = &__pyx_n_s_translate; + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_80 = PyInt_FromLong(80); if (unlikely(!__pyx_int_80)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_443 = PyInt_FromLong(443); if (unlikely(!__pyx_int_443)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_65535 = PyInt_FromLong(65535L); if (unlikely(!__pyx_int_65535)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + /* AssertionsEnabled.init */ + if (likely(__Pyx_init_assertions_enabled() == 0)); else + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_8genexpr1__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr2__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr3__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr4__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr5__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr6__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr7__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr8__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_8genexpr9__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr10__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr11__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr12__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr13__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr14__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr15__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr16__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr17__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr18__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr19__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr20__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr21__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr22__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr23__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr24__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr25__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr26__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr27__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr28__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr29__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr30__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr31__pyx_v_5w3lib_4_url_label = Py_None; Py_INCREF(Py_None); + __pyx_9genexpr32__pyx_v_5w3lib_4_url_char = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr)) __PYX_ERR(0, 757, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 757, __pyx_L1_error) + #else + __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 757, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 777, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 777, __pyx_L1_error) + #else + __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 777, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__url(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__url}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "_url", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_url(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_url(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__url(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__url(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); } -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 101, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 136, __pyx_L1_error) - __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 141, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 182, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 230, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 493, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 627, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; } -/* #### Code section: cached_constants ### */ +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__url(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + long __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_url' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_url", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_url" pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__url(void)", 0); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_w3lib___url) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "w3lib._url")) { + if (unlikely((PyDict_SetItemString(modules, "w3lib._url", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "w3lib/_url.pyx":5 + * from cython import cfunc, declare, uchar + * + * import codecs # <<<<<<<<<<<<<< + * from functools import lru_cache + * from math import floor + */ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_codecs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_codecs, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":6 + * + * import codecs + * from functools import lru_cache # <<<<<<<<<<<<<< + * from math import floor + * from typing import AnyStr, Callable, Dict, List, Optional, Tuple, Union + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_lru_cache); + __Pyx_GIVEREF(__pyx_n_s_lru_cache); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_lru_cache)) __PYX_ERR(0, 6, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lru_cache, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":7 + * import codecs + * from functools import lru_cache + * from math import floor # <<<<<<<<<<<<<< + * from typing import AnyStr, Callable, Dict, List, Optional, Tuple, Union + * from urllib.parse import unquote + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_floor); + __Pyx_GIVEREF(__pyx_n_s_floor); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_floor)) __PYX_ERR(0, 7, __pyx_L1_error); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_math, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_floor, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":8 + * from functools import lru_cache + * from math import floor + * from typing import AnyStr, Callable, Dict, List, Optional, Tuple, Union # <<<<<<<<<<<<<< + * from urllib.parse import unquote + * + */ + __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_AnyStr); + __Pyx_GIVEREF(__pyx_n_s_AnyStr); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_AnyStr)) __PYX_ERR(0, 8, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Callable); + __Pyx_GIVEREF(__pyx_n_s_Callable); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_Callable)) __PYX_ERR(0, 8, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Dict); + __Pyx_GIVEREF(__pyx_n_s_Dict); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_Dict)) __PYX_ERR(0, 8, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_List); + __Pyx_GIVEREF(__pyx_n_s_List); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_List)) __PYX_ERR(0, 8, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Optional); + __Pyx_GIVEREF(__pyx_n_s_Optional); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_Optional)) __PYX_ERR(0, 8, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Tuple); + __Pyx_GIVEREF(__pyx_n_s_Tuple); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_Tuple)) __PYX_ERR(0, 8, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_Union); + __Pyx_GIVEREF(__pyx_n_s_Union); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_Union)) __PYX_ERR(0, 8, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_AnyStr, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Callable, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Dict, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_List); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_List, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Optional); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tuple, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":9 + * from math import floor + * from typing import AnyStr, Callable, Dict, List, Optional, Tuple, Union + * from urllib.parse import unquote # <<<<<<<<<<<<<< + * + * from . import _utr46 + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_unquote); + __Pyx_GIVEREF(__pyx_n_s_unquote); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_unquote)) __PYX_ERR(0, 9, __pyx_L1_error); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_urllib_parse, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_unquote); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":11 + * from urllib.parse import unquote + * + * from . import _utr46 # <<<<<<<<<<<<<< + * from ._infra import ( + * _ASCII_ALPHA, + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_utr46); + __Pyx_GIVEREF(__pyx_n_s_utr46); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_utr46)) __PYX_ERR(0, 11, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s__2, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_utr46); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utr46, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":13 + * from . import _utr46 + * from ._infra import ( + * _ASCII_ALPHA, # <<<<<<<<<<<<<< + * _ASCII_ALPHANUMERIC, + * _ASCII_DIGIT, + */ + __pyx_t_3 = PyList_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_ASCII_ALPHA); + __Pyx_GIVEREF(__pyx_n_s_ASCII_ALPHA); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ASCII_ALPHA)) __PYX_ERR(0, 13, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_ASCII_ALPHANUMERIC); + __Pyx_GIVEREF(__pyx_n_s_ASCII_ALPHANUMERIC); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_ASCII_ALPHANUMERIC)) __PYX_ERR(0, 13, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_ASCII_DIGIT); + __Pyx_GIVEREF(__pyx_n_s_ASCII_DIGIT); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ASCII_DIGIT)) __PYX_ERR(0, 13, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_ASCII_HEX_DIGIT); + __Pyx_GIVEREF(__pyx_n_s_ASCII_HEX_DIGIT); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_ASCII_HEX_DIGIT)) __PYX_ERR(0, 13, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_ASCII_TAB_OR_NEWLINE); + __Pyx_GIVEREF(__pyx_n_s_ASCII_TAB_OR_NEWLINE); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_ASCII_TAB_OR_NEWLINE)) __PYX_ERR(0, 13, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_ASCII_WHITESPACE); + __Pyx_GIVEREF(__pyx_n_s_ASCII_WHITESPACE); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_ASCII_WHITESPACE)) __PYX_ERR(0, 13, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_C0_CONTROL); + __Pyx_GIVEREF(__pyx_n_s_C0_CONTROL); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_C0_CONTROL)) __PYX_ERR(0, 13, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_C0_CONTROL_OR_SPACE); + __Pyx_GIVEREF(__pyx_n_s_C0_CONTROL_OR_SPACE); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 7, __pyx_n_s_C0_CONTROL_OR_SPACE)) __PYX_ERR(0, 13, __pyx_L1_error); + + /* "w3lib/_url.pyx":12 + * + * from . import _utr46 + * from ._infra import ( # <<<<<<<<<<<<<< + * _ASCII_ALPHA, + * _ASCII_ALPHANUMERIC, + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_infra, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHA, __pyx_t_3) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHANUMERIC, __pyx_t_3) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_HEX_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE, __pyx_t_3) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_WHITESPACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_WHITESPACE, __pyx_t_3) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_OR_SPACE, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":22 + * _C0_CONTROL_OR_SPACE, + * ) + * from ._util import _PercentEncodeSet # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PercentEncodeSet); + __Pyx_GIVEREF(__pyx_n_s_PercentEncodeSet); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PercentEncodeSet)) __PYX_ERR(0, 22, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_util, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PercentEncodeSet, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":27 + * # https://encoding.spec.whatwg.org/ + * + * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] # <<<<<<<<<<<<<< + * DecodeFunction = Callable[[bytes], Tuple[str, int]] + * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error); + __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error); + __Pyx_INCREF((PyObject *)(&PyInt_Type)); + __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 27, __pyx_L1_error); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CodecFunction, __pyx_t_5) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":28 + * + * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] + * DecodeFunction = Callable[[bytes], Tuple[str, int]] # <<<<<<<<<<<<<< + * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Callable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF((PyObject *)(&PyBytes_Type)); + __Pyx_GIVEREF((PyObject *)(&PyBytes_Type)); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 28, __pyx_L1_error); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); + __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 28, __pyx_L1_error); + __Pyx_INCREF((PyObject *)(&PyInt_Type)); + __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 28, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(0, 28, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error); + __pyx_t_6 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DecodeFunction, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":29 + * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] + * DecodeFunction = Callable[[bytes], Tuple[str, int]] + * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); + __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 29, __pyx_L1_error); + __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); + __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 29, __pyx_L1_error); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF((PyObject *)(&PyBytes_Type)); + __Pyx_GIVEREF((PyObject *)(&PyBytes_Type)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 29, __pyx_L1_error); + __Pyx_INCREF((PyObject *)(&PyInt_Type)); + __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 29, __pyx_L1_error); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EncodeFunction, __pyx_t_3) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":32 + * + * + * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< + * return { + * label: f"windows-125{last_digit}" + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_last_digit, __pyx_n_s_int) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Dict_str_str) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_1_short_windows_125, 0, __pyx_n_s_short_windows_125, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_short_windows_125, __pyx_t_6) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_url.pyx":43 + * + * + * _REPLACEMENT_ENCODING = "replacement" # <<<<<<<<<<<<<< + * _UTF_8_ENCODING = "utf-8" + * _UTF_16BE_ENCODING = "utf-16be" + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_REPLACEMENT_ENCODING, __pyx_n_u_replacement) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + + /* "w3lib/_url.pyx":44 + * + * _REPLACEMENT_ENCODING = "replacement" + * _UTF_8_ENCODING = "utf-8" # <<<<<<<<<<<<<< + * _UTF_16BE_ENCODING = "utf-16be" + * _UTF_16LE_ENCODING = "utf-16le" + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODING, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + + /* "w3lib/_url.pyx":45 + * _REPLACEMENT_ENCODING = "replacement" + * _UTF_8_ENCODING = "utf-8" + * _UTF_16BE_ENCODING = "utf-16be" # <<<<<<<<<<<<<< + * _UTF_16LE_ENCODING = "utf-16le" + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_16BE_ENCODING, __pyx_kp_u_utf_16be) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + + /* "w3lib/_url.pyx":46 + * _UTF_8_ENCODING = "utf-8" + * _UTF_16BE_ENCODING = "utf-16be" + * _UTF_16LE_ENCODING = "utf-16le" # <<<<<<<<<<<<<< + * + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_16LE_ENCODING, __pyx_kp_u_utf_16le) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + + /* "w3lib/_url.pyx":52 + * # Maps the labels defined in the standard to an encoding label that Python + * # understands. + * _LABEL_ENCODINGS = { # <<<<<<<<<<<<<< + * **{ + * label: _UTF_8_ENCODING + */ + { /* enter inner scope */ + + /* "w3lib/_url.pyx":53 + * # understands. + * _LABEL_ENCODINGS = { + * **{ # <<<<<<<<<<<<<< + * label: _UTF_8_ENCODING + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":55 + * **{ + * label: _UTF_8_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "unicode-1-1-utf-8", + * "unicode11utf8", + */ + __pyx_t_2 = __pyx_tuple__27; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 6) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 55, __pyx_L4_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":54 + * _LABEL_ENCODINGS = { + * **{ + * label: _UTF_8_ENCODING # <<<<<<<<<<<<<< + * for label in ( + * "unicode-1-1-utf-8", + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_8_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr1__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 54, __pyx_L4_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":55 + * **{ + * label: _UTF_8_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "unicode-1-1-utf-8", + * "unicode11utf8", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L8_exit_scope; + __pyx_L4_error:; + __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L8_exit_scope:; + } /* exit inner scope */ + __pyx_t_6 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":64 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "ibm866" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":66 + * **{ + * label: "ibm866" + * for label in ( # <<<<<<<<<<<<<< + * "866", + * "cp866", + */ + __pyx_t_2 = __pyx_tuple__28; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 4) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 66, __pyx_L11_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr2__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr2__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":65 + * }, + * **{ + * label: "ibm866" # <<<<<<<<<<<<<< + * for label in ( + * "866", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr2__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_ibm866))) __PYX_ERR(0, 65, __pyx_L11_error) + + /* "w3lib/_url.pyx":66 + * **{ + * label: "ibm866" + * for label in ( # <<<<<<<<<<<<<< + * "866", + * "cp866", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr2__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr2__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L15_exit_scope; + __pyx_L11_error:; + __Pyx_GOTREF(__pyx_8genexpr2__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr2__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L15_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 64, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":73 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-2" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":75 + * **{ + * label: "iso-8859-2" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin2", + * "iso-8859-2", + */ + __pyx_t_2 = __pyx_tuple__29; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 9) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 75, __pyx_L18_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr3__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr3__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":74 + * }, + * **{ + * label: "iso-8859-2" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatin2", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr3__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_2))) __PYX_ERR(0, 74, __pyx_L18_error) + + /* "w3lib/_url.pyx":75 + * **{ + * label: "iso-8859-2" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin2", + * "iso-8859-2", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr3__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr3__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L22_exit_scope; + __pyx_L18_error:; + __Pyx_GOTREF(__pyx_8genexpr3__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr3__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L22_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 73, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":87 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-3" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L25_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":89 + * **{ + * label: "iso-8859-3" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin3", + * "iso-8859-3", + */ + __pyx_t_2 = __pyx_tuple__30; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 9) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 89, __pyx_L25_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L25_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr4__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr4__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":88 + * }, + * **{ + * label: "iso-8859-3" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatin3", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr4__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_3))) __PYX_ERR(0, 88, __pyx_L25_error) + + /* "w3lib/_url.pyx":89 + * **{ + * label: "iso-8859-3" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin3", + * "iso-8859-3", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr4__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr4__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L29_exit_scope; + __pyx_L25_error:; + __Pyx_GOTREF(__pyx_8genexpr4__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr4__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L29_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 87, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":101 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-4" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L32_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":103 + * **{ + * label: "iso-8859-4" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin4", + * "iso-8859-4", + */ + __pyx_t_2 = __pyx_tuple__31; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 9) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 103, __pyx_L32_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L32_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr5__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr5__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":102 + * }, + * **{ + * label: "iso-8859-4" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatin4", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr5__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_4))) __PYX_ERR(0, 102, __pyx_L32_error) + + /* "w3lib/_url.pyx":103 + * **{ + * label: "iso-8859-4" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin4", + * "iso-8859-4", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr5__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr5__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L36_exit_scope; + __pyx_L32_error:; + __Pyx_GOTREF(__pyx_8genexpr5__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr5__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L36_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 101, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":115 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-5" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L39_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":117 + * **{ + * label: "iso-8859-5" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatincyrillic", + * "cyrillic", + */ + __pyx_t_2 = __pyx_tuple__32; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 8) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 117, __pyx_L39_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L39_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr6__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr6__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":116 + * }, + * **{ + * label: "iso-8859-5" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatincyrillic", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr6__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_5))) __PYX_ERR(0, 116, __pyx_L39_error) + + /* "w3lib/_url.pyx":117 + * **{ + * label: "iso-8859-5" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatincyrillic", + * "cyrillic", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr6__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr6__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L43_exit_scope; + __pyx_L39_error:; + __Pyx_GOTREF(__pyx_8genexpr6__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr6__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L43_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 115, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":128 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-6" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L46_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":130 + * **{ + * label: "iso-8859-6" + * for label in ( # <<<<<<<<<<<<<< + * "arabic", + * "asmo-708", + */ + __pyx_t_2 = __pyx_tuple__33; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 14) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 130, __pyx_L46_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L46_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr7__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr7__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":129 + * }, + * **{ + * label: "iso-8859-6" # <<<<<<<<<<<<<< + * for label in ( + * "arabic", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr7__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_6))) __PYX_ERR(0, 129, __pyx_L46_error) + + /* "w3lib/_url.pyx":130 + * **{ + * label: "iso-8859-6" + * for label in ( # <<<<<<<<<<<<<< + * "arabic", + * "asmo-708", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr7__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr7__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L50_exit_scope; + __pyx_L46_error:; + __Pyx_GOTREF(__pyx_8genexpr7__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr7__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L50_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 128, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":147 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-7" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L53_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":149 + * **{ + * label: "iso-8859-7" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatingreek", + * "ecma-118", + */ + __pyx_t_2 = __pyx_tuple__34; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 12) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 149, __pyx_L53_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L53_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr8__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr8__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":148 + * }, + * **{ + * label: "iso-8859-7" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatingreek", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr8__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_7))) __PYX_ERR(0, 148, __pyx_L53_error) + + /* "w3lib/_url.pyx":149 + * **{ + * label: "iso-8859-7" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatingreek", + * "ecma-118", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr8__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr8__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L57_exit_scope; + __pyx_L53_error:; + __Pyx_GOTREF(__pyx_8genexpr8__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr8__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L57_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 147, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":164 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-8" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L60_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":166 + * **{ + * label: "iso-8859-8" + * for label in ( # <<<<<<<<<<<<<< + * "csiso88598e", + * "csisolatinhebrew", + */ + __pyx_t_2 = __pyx_tuple__35; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 11) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 166, __pyx_L60_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L60_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_8genexpr9__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr9__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":165 + * }, + * **{ + * label: "iso-8859-8" # <<<<<<<<<<<<<< + * for label in ( + * "csiso88598e", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr9__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_8))) __PYX_ERR(0, 165, __pyx_L60_error) + + /* "w3lib/_url.pyx":166 + * **{ + * label: "iso-8859-8" + * for label in ( # <<<<<<<<<<<<<< + * "csiso88598e", + * "csisolatinhebrew", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_8genexpr9__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr9__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L64_exit_scope; + __pyx_L60_error:; + __Pyx_GOTREF(__pyx_8genexpr9__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_8genexpr9__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L64_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 164, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":180 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-8-i" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L67_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":182 + * **{ + * label: "iso-8859-8-i" + * for label in ( # <<<<<<<<<<<<<< + * "csiso88598i", + * "iso-8859-8-i", + */ + __pyx_t_2 = __pyx_tuple__36; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 3) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 182, __pyx_L67_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L67_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr10__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr10__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":181 + * }, + * **{ + * label: "iso-8859-8-i" # <<<<<<<<<<<<<< + * for label in ( + * "csiso88598i", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr10__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_8_i))) __PYX_ERR(0, 181, __pyx_L67_error) + + /* "w3lib/_url.pyx":182 + * **{ + * label: "iso-8859-8-i" + * for label in ( # <<<<<<<<<<<<<< + * "csiso88598i", + * "iso-8859-8-i", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr10__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr10__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L71_exit_scope; + __pyx_L67_error:; + __Pyx_GOTREF(__pyx_9genexpr10__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr10__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L71_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 180, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + /* "w3lib/_url.pyx":188 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-10" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L74_error) + __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":119 - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): - * return - * url.path = path[:-1] # <<<<<<<<<<<<<< - * - * + /* "w3lib/_url.pyx":190 + * **{ + * label: "iso-8859-10" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin6", + * "iso-8859-10", */ - __pyx_slice_ = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice_); - __Pyx_GIVEREF(__pyx_slice_); + __pyx_t_2 = __pyx_tuple__37; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 7) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 190, __pyx_L74_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L74_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr11__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr11__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":296 - * r = 8 - * if not input: - * return (0, True) # <<<<<<<<<<<<<< - * return (int(input, base=r), validation_error) - * + /* "w3lib/_url.pyx":189 + * }, + * **{ + * label: "iso-8859-10" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatin6", */ - __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, Py_True); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr11__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_10))) __PYX_ERR(0, 189, __pyx_L74_error) - /* "w3lib/_url.pyx":788 - * and _is_windows_drive_letter(buffer) - * ): - * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< - * if ( - * not url.path + /* "w3lib/_url.pyx":190 + * **{ + * label: "iso-8859-10" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin6", + * "iso-8859-10", */ - __pyx_slice__20 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__20); - __Pyx_GIVEREF(__pyx_slice__20); + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr11__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr11__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L78_exit_scope; + __pyx_L74_error:; + __Pyx_GOTREF(__pyx_9genexpr11__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr11__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L78_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 188, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ - /* "w3lib/_url.pyx":94 - * _path_token_seen: bool = False - * - * def __init__(self) -> None: # <<<<<<<<<<<<<< - * self.path = [] - * self.is_special = False + /* "w3lib/_url.pyx":200 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-10" + * for label in ( */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_init, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L81_error) + __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":98 - * self.is_special = False - * - * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< - * return isinstance(self.path, str) - * + /* "w3lib/_url.pyx":202 + * **{ + * label: "iso-8859-10" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin6", + * "iso-8859-10", */ - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_has_opaque_path, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = __pyx_tuple__37; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 7) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 202, __pyx_L81_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L81_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr12__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr12__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":101 - * return isinstance(self.path, str) - * - * @property # <<<<<<<<<<<<<< - * def scheme(self) -> str: - * return self._scheme + /* "w3lib/_url.pyx":201 + * }, + * **{ + * label: "iso-8859-10" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatin6", */ - __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 101, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr12__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_10))) __PYX_ERR(0, 201, __pyx_L81_error) - /* "w3lib/_url.pyx":105 - * return self._scheme - * - * @scheme.setter # <<<<<<<<<<<<<< - * def scheme(self, value: str) -> None: - * self._scheme = value + /* "w3lib/_url.pyx":202 + * **{ + * label: "iso-8859-10" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin6", + * "iso-8859-10", */ - __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 105, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr12__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr12__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L85_exit_scope; + __pyx_L81_error:; + __Pyx_GOTREF(__pyx_9genexpr12__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr12__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L85_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 200, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ - /* "w3lib/_url.pyx":115 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path - * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< - * path = url.path - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + /* "w3lib/_url.pyx":212 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-13" + * for label in ( */ - __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_path); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_shorten_path, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L88_error) + __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":124 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode - * # Extended to handled cases where % is to be percent-encoded. - * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input: str, - * *, + /* "w3lib/_url.pyx":214 + * **{ + * label: "iso-8859-13" + * for label in ( # <<<<<<<<<<<<<< + * "iso-8859-13", + * "iso8859-13", */ - __pyx_tuple__34 = PyTuple_Pack(11, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_percent_encode_set, __pyx_n_s_space_as_plus, __pyx_n_s_encoder, __pyx_n_s_output, __pyx_n_s_encode_output, __pyx_n_s__33, __pyx_n_s_i, __pyx_n_s_byte, __pyx_n_s_isomorph); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_percent_encode_after_encoding, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_2 = __pyx_tuple__38; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 3) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 214, __pyx_L88_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L88_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr13__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr13__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":174 - * - * - * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< - * address = [0] * 8 - * piece_index = 0 + /* "w3lib/_url.pyx":213 + * }, + * **{ + * label: "iso-8859-13" # <<<<<<<<<<<<<< + * for label in ( + * "iso-8859-13", */ - __pyx_tuple__44 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_address, __pyx_n_s_piece_index, __pyx_n_s_compress, __pyx_n_s_pointer, __pyx_n_s_input_lenght, __pyx_n_s_value, __pyx_n_s_length, __pyx_n_s_numbers_seen, __pyx_n_s_ipv4_piece, __pyx_n_s_number, __pyx_n_s_swaps); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); - __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv6, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 174, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr13__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_13))) __PYX_ERR(0, 213, __pyx_L88_error) - /* "w3lib/_url.pyx":261 - * - * - * def _utf_8_percent_encode( # <<<<<<<<<<<<<< - * input: str, - * percent_encode_set: _PercentEncodeSet, + /* "w3lib/_url.pyx":214 + * **{ + * label: "iso-8859-13" + * for label in ( # <<<<<<<<<<<<<< + * "iso-8859-13", + * "iso8859-13", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr13__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr13__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L92_exit_scope; + __pyx_L88_error:; + __Pyx_GOTREF(__pyx_9genexpr13__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr13__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L92_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 212, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":220 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-14" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L95_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":222 + * **{ + * label: "iso-8859-14" + * for label in ( # <<<<<<<<<<<<<< + * "iso-8859-14", + * "iso8859-14", + */ + __pyx_t_2 = __pyx_tuple__39; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 3) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 222, __pyx_L95_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L95_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr14__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr14__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":221 + * }, + * **{ + * label: "iso-8859-14" # <<<<<<<<<<<<<< + * for label in ( + * "iso-8859-14", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr14__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_14))) __PYX_ERR(0, 221, __pyx_L95_error) + + /* "w3lib/_url.pyx":222 + * **{ + * label: "iso-8859-14" + * for label in ( # <<<<<<<<<<<<<< + * "iso-8859-14", + * "iso8859-14", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr14__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr14__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L99_exit_scope; + __pyx_L95_error:; + __Pyx_GOTREF(__pyx_9genexpr14__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr14__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L99_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 220, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":228 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-8859-15" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L102_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":230 + * **{ + * label: "iso-8859-15" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin9", + * "iso-8859-15", + */ + __pyx_t_2 = __pyx_tuple__40; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 6) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 230, __pyx_L102_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L102_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr15__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr15__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":229 + * }, + * **{ + * label: "iso-8859-15" # <<<<<<<<<<<<<< + * for label in ( + * "csisolatin9", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr15__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_15))) __PYX_ERR(0, 229, __pyx_L102_error) + + /* "w3lib/_url.pyx":230 + * **{ + * label: "iso-8859-15" + * for label in ( # <<<<<<<<<<<<<< + * "csisolatin9", + * "iso-8859-15", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr15__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr15__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L106_exit_scope; + __pyx_L102_error:; + __Pyx_GOTREF(__pyx_9genexpr15__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr15__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L106_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 228, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_kp_u_iso_8859_16, __pyx_kp_u_iso_8859_16) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + { /* enter inner scope */ + + /* "w3lib/_url.pyx":240 + * }, + * "iso-8859-16": "iso-8859-16", + * **{ # <<<<<<<<<<<<<< + * label: "koi8-r" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L109_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":242 + * **{ + * label: "koi8-r" + * for label in ( # <<<<<<<<<<<<<< + * "cskoi8r", + * "koi", + */ + __pyx_t_2 = __pyx_tuple__41; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 5) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 242, __pyx_L109_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L109_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr16__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr16__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":241 + * "iso-8859-16": "iso-8859-16", + * **{ + * label: "koi8-r" # <<<<<<<<<<<<<< + * for label in ( + * "cskoi8r", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr16__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_koi8_r))) __PYX_ERR(0, 241, __pyx_L109_error) + + /* "w3lib/_url.pyx":242 + * **{ + * label: "koi8-r" + * for label in ( # <<<<<<<<<<<<<< + * "cskoi8r", + * "koi", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr16__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr16__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L113_exit_scope; + __pyx_L109_error:; + __Pyx_GOTREF(__pyx_9genexpr16__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr16__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L113_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 240, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":250 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "koi8-u" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L116_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":252 + * **{ + * label: "koi8-u" + * for label in ( # <<<<<<<<<<<<<< + * "koi8-ru", + * "koi8-u", + */ + __pyx_t_2 = __pyx_tuple__42; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 2) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 252, __pyx_L116_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L116_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr17__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr17__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":251 + * }, + * **{ + * label: "koi8-u" # <<<<<<<<<<<<<< + * for label in ( + * "koi8-ru", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr17__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_koi8_u))) __PYX_ERR(0, 251, __pyx_L116_error) + + /* "w3lib/_url.pyx":252 + * **{ + * label: "koi8-u" + * for label in ( # <<<<<<<<<<<<<< + * "koi8-ru", + * "koi8-u", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr17__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr17__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L120_exit_scope; + __pyx_L116_error:; + __Pyx_GOTREF(__pyx_9genexpr17__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr17__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L120_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 250, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":257 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "macintosh" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L123_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":259 + * **{ + * label: "macintosh" + * for label in ( # <<<<<<<<<<<<<< + * "csmacintosh", + * "mac", + */ + __pyx_t_2 = __pyx_tuple__43; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 4) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 259, __pyx_L123_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L123_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr18__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr18__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":258 + * }, + * **{ + * label: "macintosh" # <<<<<<<<<<<<<< + * for label in ( + * "csmacintosh", + */ + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr18__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_macintosh))) __PYX_ERR(0, 258, __pyx_L123_error) + + /* "w3lib/_url.pyx":259 + * **{ + * label: "macintosh" + * for label in ( # <<<<<<<<<<<<<< + * "csmacintosh", + * "mac", + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr18__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr18__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L127_exit_scope; + __pyx_L123_error:; + __Pyx_GOTREF(__pyx_9genexpr18__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr18__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L127_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 257, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":266 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "cp874" + * for label in ( + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L130_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "w3lib/_url.pyx":268 + * **{ + * label: "cp874" + * for label in ( # <<<<<<<<<<<<<< + * "dos-874", + * "iso-8859-11", + */ + __pyx_t_2 = __pyx_tuple__44; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 6) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 268, __pyx_L130_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L130_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr19__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr19__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":267 + * }, + * **{ + * label: "cp874" # <<<<<<<<<<<<<< + * for label in ( + * "dos-874", */ - __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 261, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); - __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_utf_8_percent_encode, 261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 261, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr19__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_cp874))) __PYX_ERR(0, 267, __pyx_L130_error) - /* "w3lib/_url.pyx":273 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser - * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< - * for code_point in input: - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + /* "w3lib/_url.pyx":268 + * **{ + * label: "cp874" + * for label in ( # <<<<<<<<<<<<<< + * "dos-874", + * "iso-8859-11", */ - __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); - __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_opaque_host, 273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 273, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr19__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr19__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L134_exit_scope; + __pyx_L130_error:; + __Pyx_GOTREF(__pyx_9genexpr19__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr19__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L134_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 266, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":281 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< - * if not input: - * raise ValueError + /* "w3lib/_url.pyx":277 + * ) + * }, + * **_short_windows_125(0), # <<<<<<<<<<<<<< + * **_short_windows_125(1), + * **{ */ - __pyx_tuple__50 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_validation_error, __pyx_n_s_r); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__50); - __Pyx_GIVEREF(__pyx_tuple__50); - __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4_number, 281, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_t_2 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 277, __pyx_L1_error) + } + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 277, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":301 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< - * parts = input.split(".") - * if parts and parts[-1] == "": + /* "w3lib/_url.pyx":278 + * }, + * **_short_windows_125(0), + * **_short_windows_125(1), # <<<<<<<<<<<<<< + * **{ + * label: "windows-1252" */ - __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_last, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__52); - __Pyx_GIVEREF(__pyx_tuple__52); - __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_ends_in_number, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 278, __pyx_L1_error) + } + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 278, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { /* enter inner scope */ - /* "w3lib/_url.pyx":318 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser - * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< - * parts = input.split(".") - * if parts and not parts[-1]: + /* "w3lib/_url.pyx":279 + * **_short_windows_125(0), + * **_short_windows_125(1), + * **{ # <<<<<<<<<<<<<< + * label: "windows-1252" + * for label in ( */ - __pyx_tuple__54 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_numbers, __pyx_n_s_part, __pyx_n_s_result, __pyx_n_s_ipv4, __pyx_n_s_counter, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__54); - __Pyx_GIVEREF(__pyx_tuple__54); - __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4, 318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L137_error) + __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":341 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< - * result = _utr46._to_ascii( - * domain, + /* "w3lib/_url.pyx":281 + * **{ + * label: "windows-1252" + * for label in ( # <<<<<<<<<<<<<< + * "ansi_x3.4-1968", + * "ascii", */ - __pyx_tuple__56 = PyTuple_Pack(3, __pyx_n_s_domain, __pyx_n_s_be_strict, __pyx_n_s_result); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); - __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_domain_to_ascii, 341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_2 = __pyx_tuple__47; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 17) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 281, __pyx_L137_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L137_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr20__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr20__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":360 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser - * def _parse_host( # <<<<<<<<<<<<<< - * input: str, - * *, + /* "w3lib/_url.pyx":280 + * **_short_windows_125(1), + * **{ + * label: "windows-1252" # <<<<<<<<<<<<<< + * for label in ( + * "ansi_x3.4-1968", */ - __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_is_special, __pyx_n_s_domain, __pyx_n_s_ascii_domain, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__58); - __Pyx_GIVEREF(__pyx_tuple__58); - __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_host, 360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 360, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr20__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_windows_1252))) __PYX_ERR(0, 280, __pyx_L137_error) - /* "w3lib/_url.pyx":382 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter - * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< - * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" - * + /* "w3lib/_url.pyx":281 + * **{ + * label: "windows-1252" + * for label in ( # <<<<<<<<<<<<<< + * "ansi_x3.4-1968", + * "ascii", */ - __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_input); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__60); - __Pyx_GIVEREF(__pyx_tuple__60); - __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_windows_drive_letter, 382, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 382, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_9genexpr20__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr20__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L141_exit_scope; + __pyx_L137_error:; + __Pyx_GOTREF(__pyx_9genexpr20__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr20__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L141_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 279, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":387 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter - * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< - * input_length = len(input) - * return ( + /* "w3lib/_url.pyx":301 + * ) + * }, + * **_short_windows_125(3), # <<<<<<<<<<<<<< + * **{ + * label: "windows-1254" */ - __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_input_length); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__62); - __Pyx_GIVEREF(__pyx_tuple__62); - __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_starts_with_windows_drive_lette, 387, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_t_2 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 301, __pyx_L1_error) + } + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 301, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ - /* "w3lib/_url.pyx":397 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment - * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< - * return input in ( - * "..", + /* "w3lib/_url.pyx":302 + * }, + * **_short_windows_125(3), + * **{ # <<<<<<<<<<<<<< + * label: "windows-1254" + * for label in ( */ - __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_double_dot_path_segment, 397, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L144_error) + __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":412 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment - * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< - * return input in ( - * ".", + /* "w3lib/_url.pyx":304 + * **{ + * label: "windows-1254" + * for label in ( # <<<<<<<<<<<<<< + * "cp1254", + * "csisolatin5", */ - __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_single_dot_path_segment, 412, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_3 = __pyx_tuple__49; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 12) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 304, __pyx_L144_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L144_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr21__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr21__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":423 - * # to be escaped, they are escaped in an idempotent way (i.e. if they are - * # already part of an escape sequence, they are not re-encoded). - * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< - * *, input: str, pointer: int, encode_set: _PercentEncodeSet - * ) -> str: + /* "w3lib/_url.pyx":303 + * **_short_windows_125(3), + * **{ + * label: "windows-1254" # <<<<<<<<<<<<<< + * for label in ( + * "cp1254", */ - __pyx_tuple__66 = PyTuple_Pack(4, __pyx_n_s_input, __pyx_n_s_pointer, __pyx_n_s_encode_set, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__66); - __Pyx_GIVEREF(__pyx_tuple__66); - __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_idempotent_utf_8_percent_encode, 423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 423, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr21__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_windows_1254))) __PYX_ERR(0, 303, __pyx_L144_error) - /* "w3lib/_url.pyx":438 - * - * - * def _parse_url( # <<<<<<<<<<<<<< - * input: str, - * *, + /* "w3lib/_url.pyx":304 + * **{ + * label: "windows-1254" + * for label in ( # <<<<<<<<<<<<<< + * "cp1254", + * "csisolatin5", */ - __pyx_tuple__68 = PyTuple_Pack(26, __pyx_n_s_input, __pyx_n_s_base_url, __pyx_n_s_encoding, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_path_percent_encode_set, __pyx_n_s_query_percent_encode_set, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_base, __pyx_n_s_url, __pyx_n_s_state, __pyx_n_s_buffer, __pyx_n_s_at_sign_seen, __pyx_n_s_inside_brackets, __pyx_n_s_skip_authority_shortcut, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_c, __pyx_n_s_at_sign_index, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_encoded_code_points, __pyx_n_s_host, __pyx_n_s_port, __pyx_n_s_encoded, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__68); - __Pyx_GIVEREF(__pyx_tuple__68); - __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_url, 438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 438, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr21__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr21__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L148_exit_scope; + __pyx_L144_error:; + __Pyx_GOTREF(__pyx_9genexpr21__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr21__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L148_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 302, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":870 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 - * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< - * output = "" - * n = address + /* "w3lib/_url.pyx":319 + * ) + * }, + * **_short_windows_125(5), # <<<<<<<<<<<<<< + * **_short_windows_125(6), + * **_short_windows_125(7), */ - __pyx_tuple__70 = PyTuple_Pack(4, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 870, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__70); - __Pyx_GIVEREF(__pyx_tuple__70); - __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv4, 870, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 870, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 319, __pyx_L1_error) + } + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 319, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":881 - * - * - * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< - * address: List[int], *, min_length: int = 2 - * ) -> Optional[int]: + /* "w3lib/_url.pyx":320 + * }, + * **_short_windows_125(5), + * **_short_windows_125(6), # <<<<<<<<<<<<<< + * **_short_windows_125(7), + * **_short_windows_125(8), */ - __pyx_tuple__72 = PyTuple_Pack(7, __pyx_n_s_address, __pyx_n_s_min_length, __pyx_n_s_index, __pyx_n_s_index_length, __pyx_n_s_current_length, __pyx_n_s_current_index, __pyx_n_s_piece); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__72); - __Pyx_GIVEREF(__pyx_tuple__72); - __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_ipv6_first_longest_0_piece, 881, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 881, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_t_2 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 320, __pyx_L1_error) + } + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 320, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":899 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer - * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< - * output = "" - * compress = _get_ipv6_first_longest_0_piece_index(address) + /* "w3lib/_url.pyx":321 + * **_short_windows_125(5), + * **_short_windows_125(6), + * **_short_windows_125(7), # <<<<<<<<<<<<<< + * **_short_windows_125(8), + * **{ */ - __pyx_tuple__74 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_compress, __pyx_n_s_ignore0, __pyx_n_s_piece_index, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 899, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__74); - __Pyx_GIVEREF(__pyx_tuple__74); - __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv6, 899, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 321, __pyx_L1_error) + } + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); + __PYX_ERR(0, 321, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":920 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer - * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< - * if isinstance(host, int): - * return _serialize_ipv4(host) + /* "w3lib/_url.pyx":322 + * **_short_windows_125(6), + * **_short_windows_125(7), + * **_short_windows_125(8), # <<<<<<<<<<<<<< + * **{ + * label: "mac-cyrillic" */ - __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_s_host); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 920, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__76); - __Pyx_GIVEREF(__pyx_tuple__76); - __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_host, 920, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 920, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_t_2 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 322, __pyx_L1_error) + } + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 322, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ - /* "w3lib/_url.pyx":929 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer - * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< - * if url.has_opaque_path(): - * assert isinstance(url.path, str) + /* "w3lib/_url.pyx":323 + * **_short_windows_125(7), + * **_short_windows_125(8), + * **{ # <<<<<<<<<<<<<< + * label: "mac-cyrillic" + * for label in ( */ - __pyx_tuple__78 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_canonicalize, __pyx_n_s_output, __pyx_n_s_segment); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 929, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__78); - __Pyx_GIVEREF(__pyx_tuple__78); - __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url_path, 929, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L151_error) + __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":942 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing - * def _serialize_url( # <<<<<<<<<<<<<< - * url: _URL, - * *, + /* "w3lib/_url.pyx":325 + * **{ + * label: "mac-cyrillic" + * for label in ( # <<<<<<<<<<<<<< + * "x-mac-cyrillic", + * "x-mac-ukrainian", */ - __pyx_tuple__80 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_exclude_fragment, __pyx_n_s_canonicalize, __pyx_n_s_output); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 942, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__80); - __Pyx_GIVEREF(__pyx_tuple__80); - __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url, 942, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 942, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ + __pyx_t_3 = __pyx_tuple__54; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 2) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 325, __pyx_L151_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L151_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr22__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr22__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - __pyx_umethod_PyUnicode_Type_strip.type = (PyObject*)&PyUnicode_Type; - __pyx_umethod_PyUnicode_Type_strip.method_name = &__pyx_n_s_strip; - __pyx_umethod_PyUnicode_Type_translate.type = (PyObject*)&PyUnicode_Type; - __pyx_umethod_PyUnicode_Type_translate.method_name = &__pyx_n_s_translate; - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_80 = PyInt_FromLong(80); if (unlikely(!__pyx_int_80)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_443 = PyInt_FromLong(443); if (unlikely(!__pyx_int_443)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_65535 = PyInt_FromLong(65535L); if (unlikely(!__pyx_int_65535)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ + /* "w3lib/_url.pyx":324 + * **_short_windows_125(8), + * **{ + * label: "mac-cyrillic" # <<<<<<<<<<<<<< + * for label in ( + * "x-mac-cyrillic", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr22__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_mac_cyrillic))) __PYX_ERR(0, 324, __pyx_L151_error) + + /* "w3lib/_url.pyx":325 + * **{ + * label: "mac-cyrillic" + * for label in ( # <<<<<<<<<<<<<< + * "x-mac-cyrillic", + * "x-mac-ukrainian", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr22__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr22__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L155_exit_scope; + __pyx_L151_error:; + __Pyx_GOTREF(__pyx_9genexpr22__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr22__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L155_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 323, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - /* AssertionsEnabled.init */ - if (likely(__Pyx_init_assertions_enabled() == 0)); else + /* "w3lib/_url.pyx":330 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "gbk" + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L158_error) + __Pyx_GOTREF(__pyx_t_2); -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + /* "w3lib/_url.pyx":332 + * **{ + * label: "gbk" + * for label in ( # <<<<<<<<<<<<<< + * "chinese", + * "csgb2312", + */ + __pyx_t_3 = __pyx_tuple__55; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 9) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 332, __pyx_L158_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L158_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr23__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr23__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_module ### */ + /* "w3lib/_url.pyx":331 + * }, + * **{ + * label: "gbk" # <<<<<<<<<<<<<< + * for label in ( + * "chinese", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr23__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_gbk))) __PYX_ERR(0, 331, __pyx_L158_error) -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + /* "w3lib/_url.pyx":332 + * **{ + * label: "gbk" + * for label in ( # <<<<<<<<<<<<<< + * "chinese", + * "csgb2312", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr23__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr23__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L162_exit_scope; + __pyx_L158_error:; + __Pyx_GOTREF(__pyx_9genexpr23__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr23__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L162_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 330, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_gb18030, __pyx_n_u_gb18030) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + { /* enter inner scope */ -static int __Pyx_modinit_global_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); - /*--- Global init code ---*/ - __pyx_7genexpr__pyx_v_5w3lib_4_url_char = Py_None; Py_INCREF(Py_None); - __Pyx_RefNannyFinishContext(); - return 0; -} + /* "w3lib/_url.pyx":345 + * }, + * "gb18030": "gb18030", + * **{ # <<<<<<<<<<<<<< + * label: "big5" + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L165_error) + __Pyx_GOTREF(__pyx_t_2); -static int __Pyx_modinit_variable_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); - /*--- Variable export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} + /* "w3lib/_url.pyx":347 + * **{ + * label: "big5" + * for label in ( # <<<<<<<<<<<<<< + * "big5", + * "big5-hkscs", + */ + __pyx_t_3 = __pyx_tuple__56; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 5) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 347, __pyx_L165_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L165_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr24__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr24__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; -static int __Pyx_modinit_function_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); - /*--- Function export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} + /* "w3lib/_url.pyx":346 + * "gb18030": "gb18030", + * **{ + * label: "big5" # <<<<<<<<<<<<<< + * for label in ( + * "big5", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr24__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_big5))) __PYX_ERR(0, 346, __pyx_L165_error) -static int __Pyx_modinit_type_init_code(void) { - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); - /*--- Type init code ---*/ - #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr)) __PYX_ERR(0, 308, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 308, __pyx_L1_error) - #else - __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - #endif - #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 308, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_print = 0; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; - } - #endif - #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 328, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 328, __pyx_L1_error) - #else - __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - #endif - #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 328, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_print = 0; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + /* "w3lib/_url.pyx":347 + * **{ + * label: "big5" + * for label in ( # <<<<<<<<<<<<<< + * "big5", + * "big5-hkscs", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr24__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr24__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L169_exit_scope; + __pyx_L165_error:; + __Pyx_GOTREF(__pyx_9genexpr24__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr24__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L169_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 345, __pyx_L1_error) } - #endif - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ -static int __Pyx_modinit_type_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); - /*--- Type import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} + /* "w3lib/_url.pyx":355 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "euc-jp" + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L172_error) + __Pyx_GOTREF(__pyx_t_2); -static int __Pyx_modinit_variable_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); - /*--- Variable import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} + /* "w3lib/_url.pyx":357 + * **{ + * label: "euc-jp" + * for label in ( # <<<<<<<<<<<<<< + * "cseucpkdfmtjapanese", + * "euc-jp", + */ + __pyx_t_3 = __pyx_tuple__57; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 3) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 357, __pyx_L172_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L172_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr25__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr25__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; -static int __Pyx_modinit_function_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); - /*--- Function import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} + /* "w3lib/_url.pyx":356 + * }, + * **{ + * label: "euc-jp" # <<<<<<<<<<<<<< + * for label in ( + * "cseucpkdfmtjapanese", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr25__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_euc_jp))) __PYX_ERR(0, 356, __pyx_L172_error) + /* "w3lib/_url.pyx":357 + * **{ + * label: "euc-jp" + * for label in ( # <<<<<<<<<<<<<< + * "cseucpkdfmtjapanese", + * "euc-jp", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr25__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr25__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L176_exit_scope; + __pyx_L172_error:; + __Pyx_GOTREF(__pyx_9genexpr25__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr25__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L176_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 355, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ -#if PY_MAJOR_VERSION >= 3 -#if CYTHON_PEP489_MULTI_PHASE_INIT -static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ -static int __pyx_pymod_exec__url(PyObject* module); /*proto*/ -static PyModuleDef_Slot __pyx_moduledef_slots[] = { - {Py_mod_create, (void*)__pyx_pymod_create}, - {Py_mod_exec, (void*)__pyx_pymod_exec__url}, - {0, NULL} -}; -#endif + /* "w3lib/_url.pyx":363 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "iso-2022-jp" + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L179_error) + __Pyx_GOTREF(__pyx_t_2); -#ifdef __cplusplus -namespace { - struct PyModuleDef __pyx_moduledef = - #else - static struct PyModuleDef __pyx_moduledef = - #endif - { - PyModuleDef_HEAD_INIT, - "_url", - 0, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ - #else - -1, /* m_size */ - #endif - __pyx_methods /* m_methods */, - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_moduledef_slots, /* m_slots */ - #else - NULL, /* m_reload */ - #endif - #if CYTHON_USE_MODULE_STATE - __pyx_m_traverse, /* m_traverse */ - __pyx_m_clear, /* m_clear */ - NULL /* m_free */ - #else - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ - #endif - }; - #ifdef __cplusplus -} /* anonymous namespace */ -#endif -#endif + /* "w3lib/_url.pyx":365 + * **{ + * label: "iso-2022-jp" + * for label in ( # <<<<<<<<<<<<<< + * "csiso2022jp", + * "iso-2022-jp", + */ + __pyx_t_3 = __pyx_tuple__58; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 2) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 365, __pyx_L179_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L179_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr26__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr26__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; -#ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * -#else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif -#endif + /* "w3lib/_url.pyx":364 + * }, + * **{ + * label: "iso-2022-jp" # <<<<<<<<<<<<<< + * for label in ( + * "csiso2022jp", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr26__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_2022_jp))) __PYX_ERR(0, 364, __pyx_L179_error) + + /* "w3lib/_url.pyx":365 + * **{ + * label: "iso-2022-jp" + * for label in ( # <<<<<<<<<<<<<< + * "csiso2022jp", + * "iso-2022-jp", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr26__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr26__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L183_exit_scope; + __pyx_L179_error:; + __Pyx_GOTREF(__pyx_9genexpr26__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr26__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L183_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 363, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":370 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "shift_jis" + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L186_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_url.pyx":372 + * **{ + * label: "shift_jis" + * for label in ( # <<<<<<<<<<<<<< + * "csshiftjis", + * "ms932", + */ + __pyx_t_3 = __pyx_tuple__59; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 8) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 372, __pyx_L186_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L186_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr27__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr27__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* "w3lib/_url.pyx":371 + * }, + * **{ + * label: "shift_jis" # <<<<<<<<<<<<<< + * for label in ( + * "csshiftjis", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr27__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_shift_jis_2))) __PYX_ERR(0, 371, __pyx_L186_error) -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC init_url(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC init_url(void) -#else -__Pyx_PyMODINIT_FUNC PyInit__url(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC PyInit__url(void) -#if CYTHON_PEP489_MULTI_PHASE_INIT -{ - return PyModuleDef_Init(&__pyx_moduledef); -} -static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 - static PY_INT64_T main_interpreter_id = -1; - PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); - if (main_interpreter_id == -1) { - main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { - PyErr_SetString( - PyExc_ImportError, - "Interpreter change detected - this module can only be loaded into one interpreter per process."); - return -1; - } - return 0; -} -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) -#endif -{ - PyObject *value = PyObject_GetAttrString(spec, from_name); - int result = 0; - if (likely(value)) { - if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else - result = PyDict_SetItemString(moddict, to_name, value); -#endif - } - Py_DECREF(value); - } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - } else { - result = -1; + /* "w3lib/_url.pyx":372 + * **{ + * label: "shift_jis" + * for label in ( # <<<<<<<<<<<<<< + * "csshiftjis", + * "ms932", + */ } - return result; -} -static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { - PyObject *module = NULL, *moddict, *modname; - CYTHON_UNUSED_VAR(def); - if (__Pyx_check_single_interpreter()) - return NULL; - if (__pyx_m) - return __Pyx_NewRef(__pyx_m); - modname = PyObject_GetAttrString(spec, "name"); - if (unlikely(!modname)) goto bad; - module = PyModule_NewObject(modname); - Py_DECREF(modname); - if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else - moddict = PyModule_GetDict(module); - if (unlikely(!moddict)) goto bad; -#endif - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; - return module; -bad: - Py_XDECREF(module); - return NULL; -} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr27__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr27__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L190_exit_scope; + __pyx_L186_error:; + __Pyx_GOTREF(__pyx_9genexpr27__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr27__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L190_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 370, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + /* "w3lib/_url.pyx":383 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: "euc-kr" + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L193_error) + __Pyx_GOTREF(__pyx_t_2); -static CYTHON_SMALL_CODE int __pyx_pymod_exec__url(PyObject *__pyx_pyinit_module) -#endif -#endif -{ - int stringtab_initialized = 0; - #if CYTHON_USE_MODULE_STATE - int pystate_addmodule_run = 0; - #endif - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *(*__pyx_t_6)(PyObject *); - long __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_PEP489_MULTI_PHASE_INIT - if (__pyx_m) { - if (__pyx_m == __pyx_pyinit_module) return 0; - PyErr_SetString(PyExc_RuntimeError, "Module '_url' has already been imported. Re-initialisation is not supported."); - return -1; + /* "w3lib/_url.pyx":385 + * **{ + * label: "euc-kr" + * for label in ( # <<<<<<<<<<<<<< + * "cseuckr", + * "csksc56011987", + */ + __pyx_t_3 = __pyx_tuple__60; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 10) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 385, __pyx_L193_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L193_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr28__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr28__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":384 + * }, + * **{ + * label: "euc-kr" # <<<<<<<<<<<<<< + * for label in ( + * "cseuckr", + */ + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr28__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_euc_kr))) __PYX_ERR(0, 384, __pyx_L193_error) + + /* "w3lib/_url.pyx":385 + * **{ + * label: "euc-kr" + * for label in ( # <<<<<<<<<<<<<< + * "cseuckr", + * "csksc56011987", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr28__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr28__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L197_exit_scope; + __pyx_L193_error:; + __Pyx_GOTREF(__pyx_9genexpr28__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr28__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L197_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 383, __pyx_L1_error) } - #elif PY_MAJOR_VERSION >= 3 - if (__pyx_m) return __Pyx_NewRef(__pyx_m); - #endif - /*--- Module creation code ---*/ - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); - #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("_url", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE - __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_url" pseudovariable */ - if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - pystate_addmodule_run = 1; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":398 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: _REPLACEMENT_ENCODING + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L200_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_url.pyx":400 + * **{ + * label: _REPLACEMENT_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "csiso2022kr", + * "hz-gb-2312", + */ + __pyx_t_3 = __pyx_tuple__61; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 6) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 400, __pyx_L200_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L200_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr29__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr29__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":399 + * }, + * **{ + * label: _REPLACEMENT_ENCODING # <<<<<<<<<<<<<< + * for label in ( + * "csiso2022kr", + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_REPLACEMENT_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L200_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr29__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 399, __pyx_L200_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":400 + * **{ + * label: _REPLACEMENT_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "csiso2022kr", + * "hz-gb-2312", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr29__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr29__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L204_exit_scope; + __pyx_L200_error:; + __Pyx_GOTREF(__pyx_9genexpr29__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr29__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L204_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 398, __pyx_L1_error) } - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #endif - CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__url(void)", 0); - if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); - #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main_w3lib___url) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":409 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: _UTF_16BE_ENCODING + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L207_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_url.pyx":411 + * **{ + * label: _UTF_16BE_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "unicodefffe", + * "utf-16be", + */ + __pyx_t_3 = __pyx_tuple__62; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 2) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 411, __pyx_L207_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 411, __pyx_L207_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr30__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr30__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":410 + * }, + * **{ + * label: _UTF_16BE_ENCODING # <<<<<<<<<<<<<< + * for label in ( + * "unicodefffe", + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_16BE_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __pyx_L207_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr30__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 410, __pyx_L207_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":411 + * **{ + * label: _UTF_16BE_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "unicodefffe", + * "utf-16be", + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr30__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr30__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L211_exit_scope; + __pyx_L207_error:; + __Pyx_GOTREF(__pyx_9genexpr30__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr30__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L211_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 409, __pyx_L1_error) } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "w3lib._url")) { - if (unlikely((PyDict_SetItemString(modules, "w3lib._url", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "w3lib/_url.pyx":416 + * ) + * }, + * **{ # <<<<<<<<<<<<<< + * label: _UTF_16LE_ENCODING + * for label in ( + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L214_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "w3lib/_url.pyx":418 + * **{ + * label: _UTF_16LE_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "csunicode", + * "iso-10646-ucs-2", + */ + __pyx_t_3 = __pyx_tuple__63; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 7) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 418, __pyx_L214_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 418, __pyx_L214_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XGOTREF(__pyx_9genexpr31__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr31__pyx_v_5w3lib_4_url_label, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":417 + * }, + * **{ + * label: _UTF_16LE_ENCODING # <<<<<<<<<<<<<< + * for label in ( + * "csunicode", + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_16LE_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L214_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr31__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 417, __pyx_L214_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":418 + * **{ + * label: _UTF_16LE_ENCODING + * for label in ( # <<<<<<<<<<<<<< + * "csunicode", + * "iso-10646-ucs-2", + */ } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_9genexpr31__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr31__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L218_exit_scope; + __pyx_L214_error:; + __Pyx_GOTREF(__pyx_9genexpr31__pyx_v_5w3lib_4_url_label); + __Pyx_DECREF_SET(__pyx_9genexpr31__pyx_v_5w3lib_4_url_label, Py_None); + goto __pyx_L1_error; + __pyx_L218_exit_scope:; + } /* exit inner scope */ + if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); + __PYX_ERR(0, 416, __pyx_L1_error) } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_kp_u_x_user_defined, __pyx_kp_u_x_user_defined) < 0) __PYX_ERR(0, 428, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LABEL_ENCODINGS, __pyx_t_6) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":5 - * # https://url.spec.whatwg.org/ + /* "w3lib/_url.pyx":433 * - * from math import floor # <<<<<<<<<<<<<< - * from typing import List, Optional, Tuple, Union - * from urllib.parse import unquote + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoder(encoding: str) -> EncodeFunction: + * codec_info = codecs.lookup(encoding) */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_floor); - __Pyx_GIVEREF(__pyx_n_s_floor); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_floor)) __PYX_ERR(0, 5, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_math, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_floor, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 433, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_EncodeFunction) < 0) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_3_get_encoder, 0, __pyx_n_s_get_encoder, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoder, __pyx_t_2) < 0) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":6 + /* "w3lib/_url.pyx":439 + * + * + * _UTF_8_ENCODER = _get_encoder("utf-8") # <<<<<<<<<<<<<< * - * from math import floor - * from typing import List, Optional, Tuple, Union # <<<<<<<<<<<<<< - * from urllib.parse import unquote * */ - __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_List); - __Pyx_GIVEREF(__pyx_n_s_List); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_List)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Optional); - __Pyx_GIVEREF(__pyx_n_s_Optional); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Optional)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Tuple); - __Pyx_GIVEREF(__pyx_n_s_Tuple); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_Tuple)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Union); - __Pyx_GIVEREF(__pyx_n_s_Union); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_Union)) __PYX_ERR(0, 6, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_List); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_List, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tuple, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODER, __pyx_t_6) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":7 - * from math import floor - * from typing import List, Optional, Tuple, Union - * from urllib.parse import unquote # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":443 * - * from . import _utr46 + * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get + * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< + * def _get_encoding(label: str) -> str: + * label = label.strip(_ASCII_WHITESPACE).lower() */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_unquote); - __Pyx_GIVEREF(__pyx_n_s_unquote); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_unquote)) __PYX_ERR(0, 7, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_urllib_parse, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_unquote); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 443, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_5_get_encoding, 0, __pyx_n_s_get_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":9 - * from urllib.parse import unquote - * - * from . import _utr46 # <<<<<<<<<<<<<< - * from ._encoding import ( - * _get_encoder, - */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_utr46); - __Pyx_GIVEREF(__pyx_n_s_utr46); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_utr46)) __PYX_ERR(0, 9, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s__2, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_utr46); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_utr46, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":11 - * from . import _utr46 - * from ._encoding import ( - * _get_encoder, # <<<<<<<<<<<<<< - * _get_output_encoding, - * ) - */ - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_get_encoder); - __Pyx_GIVEREF(__pyx_n_s_get_encoder); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_encoder)) __PYX_ERR(0, 11, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_get_output_encoding); - __Pyx_GIVEREF(__pyx_n_s_get_output_encoding); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_get_output_encoding)) __PYX_ERR(0, 11, __pyx_L1_error); - - /* "w3lib/_url.pyx":10 + /* "w3lib/_url.pyx":458 * - * from . import _utr46 - * from ._encoding import ( # <<<<<<<<<<<<<< - * _get_encoder, - * _get_output_encoding, + * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( + * _REPLACEMENT_ENCODING, # <<<<<<<<<<<<<< + * _UTF_16BE_ENCODING, + * _UTF_16LE_ENCODING, */ - __pyx_t_3 = __Pyx_Import(__pyx_n_s_encoding_2, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoder, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_get_output_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_REPLACEMENT_ENCODING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_output_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":15 + /* "w3lib/_url.pyx":459 + * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( + * _REPLACEMENT_ENCODING, + * _UTF_16BE_ENCODING, # <<<<<<<<<<<<<< + * _UTF_16LE_ENCODING, * ) - * from ._infra import ( - * _ASCII_ALPHA, # <<<<<<<<<<<<<< - * _ASCII_ALPHANUMERIC, - * _ASCII_DIGIT, */ - __pyx_t_3 = PyList_New(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_ASCII_ALPHA); - __Pyx_GIVEREF(__pyx_n_s_ASCII_ALPHA); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ASCII_ALPHA)) __PYX_ERR(0, 15, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_ASCII_ALPHANUMERIC); - __Pyx_GIVEREF(__pyx_n_s_ASCII_ALPHANUMERIC); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_ASCII_ALPHANUMERIC)) __PYX_ERR(0, 15, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_ASCII_DIGIT); - __Pyx_GIVEREF(__pyx_n_s_ASCII_DIGIT); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ASCII_DIGIT)) __PYX_ERR(0, 15, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_ASCII_HEX_DIGIT); - __Pyx_GIVEREF(__pyx_n_s_ASCII_HEX_DIGIT); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_ASCII_HEX_DIGIT)) __PYX_ERR(0, 15, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_ASCII_TAB_OR_NEWLINE); - __Pyx_GIVEREF(__pyx_n_s_ASCII_TAB_OR_NEWLINE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_ASCII_TAB_OR_NEWLINE)) __PYX_ERR(0, 15, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_C0_CONTROL); - __Pyx_GIVEREF(__pyx_n_s_C0_CONTROL); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_C0_CONTROL)) __PYX_ERR(0, 15, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_C0_CONTROL_OR_SPACE); - __Pyx_GIVEREF(__pyx_n_s_C0_CONTROL_OR_SPACE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_C0_CONTROL_OR_SPACE)) __PYX_ERR(0, 15, __pyx_L1_error); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_UTF_16BE_ENCODING); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); - /* "w3lib/_url.pyx":14 - * _get_output_encoding, + /* "w3lib/_url.pyx":460 + * _REPLACEMENT_ENCODING, + * _UTF_16BE_ENCODING, + * _UTF_16LE_ENCODING, # <<<<<<<<<<<<<< * ) - * from ._infra import ( # <<<<<<<<<<<<<< - * _ASCII_ALPHA, - * _ASCII_ALPHANUMERIC, + * */ - __pyx_t_2 = __Pyx_Import(__pyx_n_s_infra, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHA, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHANUMERIC, __pyx_t_3) < 0) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_HEX_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_UTF_16LE_ENCODING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_OR_SPACE, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":23 - * _C0_CONTROL_OR_SPACE, - * ) - * from ._util import _PercentEncodeSet # <<<<<<<<<<<<<< - * + /* "w3lib/_url.pyx":458 * + * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( + * _REPLACEMENT_ENCODING, # <<<<<<<<<<<<<< + * _UTF_16BE_ENCODING, + * _UTF_16LE_ENCODING, */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_PercentEncodeSet); - __Pyx_GIVEREF(__pyx_n_s_PercentEncodeSet); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PercentEncodeSet)) __PYX_ERR(0, 23, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_util, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PercentEncodeSet, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS, __pyx_t_4) < 0) __PYX_ERR(0, 457, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":26 - * + /* "w3lib/_url.pyx":475 + * # https://url.spec.whatwg.org/ * * _ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { # <<<<<<<<<<<<<< * ord(char): None for char in _ASCII_TAB_OR_NEWLINE * } */ { /* enter inner scope */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L221_error) + __Pyx_GOTREF(__pyx_t_4); - /* "w3lib/_url.pyx":27 + /* "w3lib/_url.pyx":476 * * _ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { * ord(char): None for char in _ASCII_TAB_OR_NEWLINE # <<<<<<<<<<<<<< * } * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); - __pyx_t_5 = 0; - __pyx_t_6 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L221_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 27, __pyx_L4_error) + __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 476, __pyx_L221_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 476, __pyx_L221_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (likely(!__pyx_t_6)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_6))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 27, __pyx_L4_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 476, __pyx_L221_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 27, __pyx_L4_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 476, __pyx_L221_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L221_error) + __Pyx_GOTREF(__pyx_t_3); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 27, __pyx_L4_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 476, __pyx_L221_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 27, __pyx_L4_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 476, __pyx_L221_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L221_error) + __Pyx_GOTREF(__pyx_t_3); #endif } } else { - __pyx_t_2 = __pyx_t_6(__pyx_t_4); - if (unlikely(!__pyx_t_2)) { + __pyx_t_3 = __pyx_t_8(__pyx_t_6); + if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 27, __pyx_L4_error) + else __PYX_ERR(0, 476, __pyx_L221_error) } break; } - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XGOTREF(__pyx_7genexpr__pyx_v_5w3lib_4_url_char); - __Pyx_DECREF_SET(__pyx_7genexpr__pyx_v_5w3lib_4_url_char, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __pyx_7genexpr__pyx_v_5w3lib_4_url_char; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_2); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 27, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_t_2, (PyObject*)Py_None))) __PYX_ERR(0, 27, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XGOTREF(__pyx_9genexpr32__pyx_v_5w3lib_4_url_char); + __Pyx_DECREF_SET(__pyx_9genexpr32__pyx_v_5w3lib_4_url_char, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __pyx_9genexpr32__pyx_v_5w3lib_4_url_char; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyObject_Ord(__pyx_t_3); if (unlikely(__pyx_t_9 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 476, __pyx_L221_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L221_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_t_3, (PyObject*)Py_None))) __PYX_ERR(0, 476, __pyx_L221_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_7genexpr__pyx_v_5w3lib_4_url_char); - __Pyx_DECREF_SET(__pyx_7genexpr__pyx_v_5w3lib_4_url_char, Py_None); - goto __pyx_L8_exit_scope; - __pyx_L4_error:; - __Pyx_GOTREF(__pyx_7genexpr__pyx_v_5w3lib_4_url_char); - __Pyx_DECREF_SET(__pyx_7genexpr__pyx_v_5w3lib_4_url_char, Py_None); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_9genexpr32__pyx_v_5w3lib_4_url_char); + __Pyx_DECREF_SET(__pyx_9genexpr32__pyx_v_5w3lib_4_url_char, Py_None); + goto __pyx_L225_exit_scope; + __pyx_L221_error:; + __Pyx_GOTREF(__pyx_9genexpr32__pyx_v_5w3lib_4_url_char); + __Pyx_DECREF_SET(__pyx_9genexpr32__pyx_v_5w3lib_4_url_char, Py_None); goto __pyx_L1_error; - __pyx_L8_exit_scope:; + __pyx_L225_exit_scope:; } /* exit inner scope */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO, __pyx_t_4) < 0) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":30 + /* "w3lib/_url.pyx":479 * } * - * SCHEME_START = 0 # <<<<<<<<<<<<<< - * SCHEME = 1 - * NO_SCHEME = 2 + * SCHEME_START = declare(uchar, 0) # <<<<<<<<<<<<<< + * SCHEME = declare(uchar, 1) + * NO_SCHEME = declare(uchar, 2) */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME_START, __pyx_int_0) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_v_5w3lib_4_url_SCHEME_START = 0; - /* "w3lib/_url.pyx":31 + /* "w3lib/_url.pyx":480 * - * SCHEME_START = 0 - * SCHEME = 1 # <<<<<<<<<<<<<< - * NO_SCHEME = 2 - * SPECIAL_RELATIVE_OR_AUTHORITY = 3 + * SCHEME_START = declare(uchar, 0) + * SCHEME = declare(uchar, 1) # <<<<<<<<<<<<<< + * NO_SCHEME = declare(uchar, 2) + * SPECIAL_RELATIVE_OR_AUTHORITY = declare(uchar, 3) */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME, __pyx_int_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_v_5w3lib_4_url_SCHEME = 1; - /* "w3lib/_url.pyx":32 - * SCHEME_START = 0 - * SCHEME = 1 - * NO_SCHEME = 2 # <<<<<<<<<<<<<< - * SPECIAL_RELATIVE_OR_AUTHORITY = 3 - * PATH_OR_AUTHORITY = 4 + /* "w3lib/_url.pyx":481 + * SCHEME_START = declare(uchar, 0) + * SCHEME = declare(uchar, 1) + * NO_SCHEME = declare(uchar, 2) # <<<<<<<<<<<<<< + * SPECIAL_RELATIVE_OR_AUTHORITY = declare(uchar, 3) + * PATH_OR_AUTHORITY = declare(uchar, 4) */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_SCHEME, __pyx_int_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_v_5w3lib_4_url_NO_SCHEME = 2; - /* "w3lib/_url.pyx":33 - * SCHEME = 1 - * NO_SCHEME = 2 - * SPECIAL_RELATIVE_OR_AUTHORITY = 3 # <<<<<<<<<<<<<< - * PATH_OR_AUTHORITY = 4 - * RELATIVE = 5 - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_RELATIVE_OR_AUTHORITY, __pyx_int_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) - - /* "w3lib/_url.pyx":34 - * NO_SCHEME = 2 - * SPECIAL_RELATIVE_OR_AUTHORITY = 3 - * PATH_OR_AUTHORITY = 4 # <<<<<<<<<<<<<< - * RELATIVE = 5 - * RELATIVE_SLASH = 6 - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_OR_AUTHORITY, __pyx_int_4) < 0) __PYX_ERR(0, 34, __pyx_L1_error) - - /* "w3lib/_url.pyx":35 - * SPECIAL_RELATIVE_OR_AUTHORITY = 3 - * PATH_OR_AUTHORITY = 4 - * RELATIVE = 5 # <<<<<<<<<<<<<< - * RELATIVE_SLASH = 6 - * SPECIAL_AUTHORITY_SLASHES = 7 - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RELATIVE, __pyx_int_5) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - - /* "w3lib/_url.pyx":36 - * PATH_OR_AUTHORITY = 4 - * RELATIVE = 5 - * RELATIVE_SLASH = 6 # <<<<<<<<<<<<<< - * SPECIAL_AUTHORITY_SLASHES = 7 - * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RELATIVE_SLASH, __pyx_int_6) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - - /* "w3lib/_url.pyx":37 - * RELATIVE = 5 - * RELATIVE_SLASH = 6 - * SPECIAL_AUTHORITY_SLASHES = 7 # <<<<<<<<<<<<<< - * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 - * AUTHORITY = 9 - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_AUTHORITY_SLASHES, __pyx_int_7) < 0) __PYX_ERR(0, 37, __pyx_L1_error) - - /* "w3lib/_url.pyx":38 - * RELATIVE_SLASH = 6 - * SPECIAL_AUTHORITY_SLASHES = 7 - * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 # <<<<<<<<<<<<<< - * AUTHORITY = 9 - * HOST = 10 - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_AUTHORITY_IGNORE_SLASHES, __pyx_int_8) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - - /* "w3lib/_url.pyx":39 - * SPECIAL_AUTHORITY_SLASHES = 7 - * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 - * AUTHORITY = 9 # <<<<<<<<<<<<<< - * HOST = 10 - * PORT = 11 - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AUTHORITY, __pyx_int_9) < 0) __PYX_ERR(0, 39, __pyx_L1_error) - - /* "w3lib/_url.pyx":40 - * SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 - * AUTHORITY = 9 - * HOST = 10 # <<<<<<<<<<<<<< - * PORT = 11 - * FILE = 12 - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_HOST, __pyx_int_10) < 0) __PYX_ERR(0, 40, __pyx_L1_error) - - /* "w3lib/_url.pyx":41 - * AUTHORITY = 9 - * HOST = 10 - * PORT = 11 # <<<<<<<<<<<<<< - * FILE = 12 - * FILE_SLASH = 13 - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PORT, __pyx_int_11) < 0) __PYX_ERR(0, 41, __pyx_L1_error) - - /* "w3lib/_url.pyx":42 - * HOST = 10 - * PORT = 11 - * FILE = 12 # <<<<<<<<<<<<<< - * FILE_SLASH = 13 - * FILE_HOST = 14 - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FILE, __pyx_int_12) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + /* "w3lib/_url.pyx":482 + * SCHEME = declare(uchar, 1) + * NO_SCHEME = declare(uchar, 2) + * SPECIAL_RELATIVE_OR_AUTHORITY = declare(uchar, 3) # <<<<<<<<<<<<<< + * PATH_OR_AUTHORITY = declare(uchar, 4) + * RELATIVE = declare(uchar, 5) + */ + __pyx_v_5w3lib_4_url_SPECIAL_RELATIVE_OR_AUTHORITY = 3; - /* "w3lib/_url.pyx":43 - * PORT = 11 - * FILE = 12 - * FILE_SLASH = 13 # <<<<<<<<<<<<<< - * FILE_HOST = 14 - * PATH_START = 15 + /* "w3lib/_url.pyx":483 + * NO_SCHEME = declare(uchar, 2) + * SPECIAL_RELATIVE_OR_AUTHORITY = declare(uchar, 3) + * PATH_OR_AUTHORITY = declare(uchar, 4) # <<<<<<<<<<<<<< + * RELATIVE = declare(uchar, 5) + * RELATIVE_SLASH = declare(uchar, 6) */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FILE_SLASH, __pyx_int_13) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY = 4; - /* "w3lib/_url.pyx":44 - * FILE = 12 - * FILE_SLASH = 13 - * FILE_HOST = 14 # <<<<<<<<<<<<<< - * PATH_START = 15 - * PATH = 16 + /* "w3lib/_url.pyx":484 + * SPECIAL_RELATIVE_OR_AUTHORITY = declare(uchar, 3) + * PATH_OR_AUTHORITY = declare(uchar, 4) + * RELATIVE = declare(uchar, 5) # <<<<<<<<<<<<<< + * RELATIVE_SLASH = declare(uchar, 6) + * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FILE_HOST, __pyx_int_14) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_v_5w3lib_4_url_RELATIVE = 5; - /* "w3lib/_url.pyx":45 - * FILE_SLASH = 13 - * FILE_HOST = 14 - * PATH_START = 15 # <<<<<<<<<<<<<< - * PATH = 16 - * OPAQUE_PATH = 17 + /* "w3lib/_url.pyx":485 + * PATH_OR_AUTHORITY = declare(uchar, 4) + * RELATIVE = declare(uchar, 5) + * RELATIVE_SLASH = declare(uchar, 6) # <<<<<<<<<<<<<< + * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) + * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) + */ + __pyx_v_5w3lib_4_url_RELATIVE_SLASH = 6; + + /* "w3lib/_url.pyx":486 + * RELATIVE = declare(uchar, 5) + * RELATIVE_SLASH = declare(uchar, 6) + * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) # <<<<<<<<<<<<<< + * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) + * AUTHORITY = declare(uchar, 9) + */ + __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES = 7; + + /* "w3lib/_url.pyx":487 + * RELATIVE_SLASH = declare(uchar, 6) + * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) + * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) # <<<<<<<<<<<<<< + * AUTHORITY = declare(uchar, 9) + * HOST = declare(uchar, 10) + */ + __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES = 8; + + /* "w3lib/_url.pyx":488 + * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) + * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) + * AUTHORITY = declare(uchar, 9) # <<<<<<<<<<<<<< + * HOST = declare(uchar, 10) + * PORT = declare(uchar, 11) + */ + __pyx_v_5w3lib_4_url_AUTHORITY = 9; + + /* "w3lib/_url.pyx":489 + * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) + * AUTHORITY = declare(uchar, 9) + * HOST = declare(uchar, 10) # <<<<<<<<<<<<<< + * PORT = declare(uchar, 11) + * FILE = declare(uchar, 12) + */ + __pyx_v_5w3lib_4_url_HOST = 10; + + /* "w3lib/_url.pyx":490 + * AUTHORITY = declare(uchar, 9) + * HOST = declare(uchar, 10) + * PORT = declare(uchar, 11) # <<<<<<<<<<<<<< + * FILE = declare(uchar, 12) + * FILE_SLASH = declare(uchar, 13) + */ + __pyx_v_5w3lib_4_url_PORT = 11; + + /* "w3lib/_url.pyx":491 + * HOST = declare(uchar, 10) + * PORT = declare(uchar, 11) + * FILE = declare(uchar, 12) # <<<<<<<<<<<<<< + * FILE_SLASH = declare(uchar, 13) + * FILE_HOST = declare(uchar, 14) + */ + __pyx_v_5w3lib_4_url_FILE = 12; + + /* "w3lib/_url.pyx":492 + * PORT = declare(uchar, 11) + * FILE = declare(uchar, 12) + * FILE_SLASH = declare(uchar, 13) # <<<<<<<<<<<<<< + * FILE_HOST = declare(uchar, 14) + * PATH_START = declare(uchar, 15) + */ + __pyx_v_5w3lib_4_url_FILE_SLASH = 13; + + /* "w3lib/_url.pyx":493 + * FILE = declare(uchar, 12) + * FILE_SLASH = declare(uchar, 13) + * FILE_HOST = declare(uchar, 14) # <<<<<<<<<<<<<< + * PATH_START = declare(uchar, 15) + * PATH = declare(uchar, 16) + */ + __pyx_v_5w3lib_4_url_FILE_HOST = 14; + + /* "w3lib/_url.pyx":494 + * FILE_SLASH = declare(uchar, 13) + * FILE_HOST = declare(uchar, 14) + * PATH_START = declare(uchar, 15) # <<<<<<<<<<<<<< + * PATH = declare(uchar, 16) + * OPAQUE_PATH = declare(uchar, 17) */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_START, __pyx_int_15) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_v_5w3lib_4_url_PATH_START = 15; - /* "w3lib/_url.pyx":46 - * FILE_HOST = 14 - * PATH_START = 15 - * PATH = 16 # <<<<<<<<<<<<<< - * OPAQUE_PATH = 17 - * QUERY = 18 + /* "w3lib/_url.pyx":495 + * FILE_HOST = declare(uchar, 14) + * PATH_START = declare(uchar, 15) + * PATH = declare(uchar, 16) # <<<<<<<<<<<<<< + * OPAQUE_PATH = declare(uchar, 17) + * QUERY = declare(uchar, 18) */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH, __pyx_int_16) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_v_5w3lib_4_url_PATH = 16; - /* "w3lib/_url.pyx":47 - * PATH_START = 15 - * PATH = 16 - * OPAQUE_PATH = 17 # <<<<<<<<<<<<<< - * QUERY = 18 - * FRAGMENT = 19 + /* "w3lib/_url.pyx":496 + * PATH_START = declare(uchar, 15) + * PATH = declare(uchar, 16) + * OPAQUE_PATH = declare(uchar, 17) # <<<<<<<<<<<<<< + * QUERY = declare(uchar, 18) + * FRAGMENT = declare(uchar, 19) */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_OPAQUE_PATH, __pyx_int_17) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_v_5w3lib_4_url_OPAQUE_PATH = 17; - /* "w3lib/_url.pyx":48 - * PATH = 16 - * OPAQUE_PATH = 17 - * QUERY = 18 # <<<<<<<<<<<<<< - * FRAGMENT = 19 + /* "w3lib/_url.pyx":497 + * PATH = declare(uchar, 16) + * OPAQUE_PATH = declare(uchar, 17) + * QUERY = declare(uchar, 18) # <<<<<<<<<<<<<< + * FRAGMENT = declare(uchar, 19) * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY, __pyx_int_18) < 0) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_v_5w3lib_4_url_QUERY = 18; - /* "w3lib/_url.pyx":49 - * OPAQUE_PATH = 17 - * QUERY = 18 - * FRAGMENT = 19 # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":498 + * OPAQUE_PATH = declare(uchar, 17) + * QUERY = declare(uchar, 18) + * FRAGMENT = declare(uchar, 19) # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT, __pyx_int_19) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_v_5w3lib_4_url_FRAGMENT = 19; - /* "w3lib/_url.pyx":54 + /* "w3lib/_url.pyx":503 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#default-port * _DEFAULT_PORTS = { * "ftp": 21, # <<<<<<<<<<<<<< * "file": None, * "http": 80, */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_ftp, __pyx_int_21) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_ftp, __pyx_int_21) < 0) __PYX_ERR(0, 503, __pyx_L1_error) - /* "w3lib/_url.pyx":55 + /* "w3lib/_url.pyx":504 * _DEFAULT_PORTS = { * "ftp": 21, * "file": None, # <<<<<<<<<<<<<< * "http": 80, * "https": 443, */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_file, Py_None) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_http, __pyx_int_80) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_https, __pyx_int_443) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_ws, __pyx_int_80) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_wss, __pyx_int_443) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_PORTS, __pyx_t_3) < 0) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_file, Py_None) < 0) __PYX_ERR(0, 503, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_http, __pyx_int_80) < 0) __PYX_ERR(0, 503, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_https, __pyx_int_443) < 0) __PYX_ERR(0, 503, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_ws, __pyx_int_80) < 0) __PYX_ERR(0, 503, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_wss, __pyx_int_443) < 0) __PYX_ERR(0, 503, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_PORTS, __pyx_t_4) < 0) __PYX_ERR(0, 502, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":61 + /* "w3lib/_url.pyx":510 * "wss": 443, * } * _SPECIAL_SCHEMES = set(_DEFAULT_PORTS.keys()) # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_keys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySet_New(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_SCHEMES, __pyx_t_4) < 0) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_SCHEMES, __pyx_t_6) < 0) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":64 + /* "w3lib/_url.pyx":513 * * * class _URL: # <<<<<<<<<<<<<< * _scheme: str = "" * username: str = "" */ - __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_URL, __pyx_n_s_URL, (PyObject *) NULL, __pyx_n_s_w3lib__url, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_URL, __pyx_n_s_URL, (PyObject *) NULL, __pyx_n_s_w3lib__url, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_scheme, __pyx_n_s_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_username, __pyx_n_s_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_password, __pyx_n_s_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hostname, __pyx_kp_s_Union_int_List_int_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_port, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_path, __pyx_kp_s_Union_str_List_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_query, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fragment, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_password_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_port_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_default_port_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_path_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_annotations, __pyx_t_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_scheme, __pyx_n_s_str) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_username, __pyx_n_s_str) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_password, __pyx_n_s_str) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hostname, __pyx_kp_s_Union_int_List_int_str) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_port, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path, __pyx_kp_s_Union_str_List_str) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fragment, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_password_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_port_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_default_port_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_annotations, __pyx_t_4) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":65 + /* "w3lib/_url.pyx":514 * * class _URL: * _scheme: str = "" # <<<<<<<<<<<<<< * username: str = "" * password: str = "" */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_scheme, __pyx_kp_u__2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_scheme, __pyx_kp_u__2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) - /* "w3lib/_url.pyx":66 + /* "w3lib/_url.pyx":515 * class _URL: * _scheme: str = "" * username: str = "" # <<<<<<<<<<<<<< * password: str = "" * hostname: Union[int, List[int], str] = "" */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_username, __pyx_kp_u__2) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_username, __pyx_kp_u__2) < 0) __PYX_ERR(0, 515, __pyx_L1_error) - /* "w3lib/_url.pyx":67 + /* "w3lib/_url.pyx":516 * _scheme: str = "" * username: str = "" * password: str = "" # <<<<<<<<<<<<<< * hostname: Union[int, List[int], str] = "" * port: Optional[int] = None */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_password, __pyx_kp_u__2) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_password, __pyx_kp_u__2) < 0) __PYX_ERR(0, 516, __pyx_L1_error) - /* "w3lib/_url.pyx":68 + /* "w3lib/_url.pyx":517 * username: str = "" * password: str = "" * hostname: Union[int, List[int], str] = "" # <<<<<<<<<<<<<< * port: Optional[int] = None * path: Union[str, List[str]] */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 517, __pyx_L1_error) - /* "w3lib/_url.pyx":69 + /* "w3lib/_url.pyx":518 * password: str = "" * hostname: Union[int, List[int], str] = "" * port: Optional[int] = None # <<<<<<<<<<<<<< * path: Union[str, List[str]] * query: Optional[str] = None */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_port, Py_None) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_port, Py_None) < 0) __PYX_ERR(0, 518, __pyx_L1_error) - /* "w3lib/_url.pyx":71 + /* "w3lib/_url.pyx":520 * port: Optional[int] = None * path: Union[str, List[str]] * query: Optional[str] = None # <<<<<<<<<<<<<< * fragment: Optional[str] = None * */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 520, __pyx_L1_error) - /* "w3lib/_url.pyx":72 + /* "w3lib/_url.pyx":521 * path: Union[str, List[str]] * query: Optional[str] = None * fragment: Optional[str] = None # <<<<<<<<<<<<<< * * # Indicates whether a color (:) separating a username from a password */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_fragment, Py_None) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fragment, Py_None) < 0) __PYX_ERR(0, 521, __pyx_L1_error) - /* "w3lib/_url.pyx":77 + /* "w3lib/_url.pyx":526 * # existed in the parsed URL. This enables :func:`_serialize_url` to * # generate a URL that matches the input URL, if desired. * _password_token_seen: bool = False # <<<<<<<<<<<<<< * * # Indicates, for an empty port component, whether or not a colon (:) */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_password_token_seen, Py_False) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_password_token_seen, Py_False) < 0) __PYX_ERR(0, 526, __pyx_L1_error) - /* "w3lib/_url.pyx":82 + /* "w3lib/_url.pyx":531 * # character was used. This enables :func:`_serialize_url` to * # generate a URL that matches the input URL, if desired. * _port_token_seen: bool = False # <<<<<<<<<<<<<< * * # Indicates whether or not a default port was specified in the input URL. */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_port_token_seen, Py_False) < 0) __PYX_ERR(0, 82, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_port_token_seen, Py_False) < 0) __PYX_ERR(0, 531, __pyx_L1_error) - /* "w3lib/_url.pyx":87 + /* "w3lib/_url.pyx":536 * # This enables :func:`_serialize_url` to generate a URL that matches the * # input URL, if desired. * _default_port_seen: bool = False # <<<<<<<<<<<<<< * * # Indicates, for an empty path component, whether or not a slash (/) */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_default_port_seen, Py_False) < 0) __PYX_ERR(0, 87, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_default_port_seen, Py_False) < 0) __PYX_ERR(0, 536, __pyx_L1_error) - /* "w3lib/_url.pyx":92 + /* "w3lib/_url.pyx":541 * # character was used. This enables :func:`_serialize_url` to * # generate a URL that matches the input URL, if desired. * _path_token_seen: bool = False # <<<<<<<<<<<<<< * * def __init__(self) -> None: */ - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_path_token_seen, Py_False) < 0) __PYX_ERR(0, 92, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_path_token_seen, Py_False) < 0) __PYX_ERR(0, 541, __pyx_L1_error) - /* "w3lib/_url.pyx":94 + /* "w3lib/_url.pyx":543 * _path_token_seen: bool = False * * def __init__(self) -> None: # <<<<<<<<<<<<<< * self.path = [] * self.is_special = False */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_1__init__, 0, __pyx_n_s_URL___init, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 94, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_1__init__, 0, __pyx_n_s_URL___init, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":98 + /* "w3lib/_url.pyx":547 * self.is_special = False * * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< * return isinstance(self.path, str) * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 98, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_3has_opaque_path, 0, __pyx_n_s_URL_has_opaque_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_has_opaque_path, __pyx_t_3) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_3has_opaque_path, 0, __pyx_n_s_URL_has_opaque_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_has_opaque_path, __pyx_t_4) < 0) __PYX_ERR(0, 547, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":101 + /* "w3lib/_url.pyx":550 * return isinstance(self.path, str) * * @property # <<<<<<<<<<<<<< * def scheme(self) -> str: * return self._scheme */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 101, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_5scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_5scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_scheme_2, __pyx_t_4) < 0) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":105 + /* "w3lib/_url.pyx":554 * return self._scheme * * @scheme.setter # <<<<<<<<<<<<<< * def scheme(self, value: str) -> None: * self._scheme = value */ - __pyx_t_2 = PyObject_GetItem(__pyx_t_4, __pyx_n_s_scheme_2); - if (unlikely(!__pyx_t_2)) { + __pyx_t_3 = PyObject_GetItem(__pyx_t_6, __pyx_n_s_scheme_2); + if (unlikely(!__pyx_t_3)) { PyErr_Clear(); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_scheme_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_scheme_2); } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_setter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_setter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_value, __pyx_n_s_str) < 0) __PYX_ERR(0, 105, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 105, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_7scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_value, __pyx_n_s_str) < 0) __PYX_ERR(0, 554, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_7scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_10 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_9}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_scheme_2, __pyx_t_4) < 0) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":64 + /* "w3lib/_url.pyx":513 * * * class _URL: # <<<<<<<<<<<<<< * _scheme: str = "" * username: str = "" */ - __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_URL, __pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_URL, __pyx_t_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_URL, __pyx_empty_tuple, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_URL, __pyx_t_4) < 0) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":111 + /* "w3lib/_url.pyx":560 * * * _SCHEME_CHARS = _ASCII_ALPHANUMERIC + "+-." # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__75); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__30); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME_CHARS, __pyx_t_4) < 0) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME_CHARS, __pyx_t_3) < 0) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":115 + /* "w3lib/_url.pyx":564 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< * path = url.path * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 115, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 115, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_1_shorten_path, 0, __pyx_n_s_shorten_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_shorten_path, __pyx_t_4) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 564, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_7_shorten_path, 0, __pyx_n_s_shorten_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_shorten_path, __pyx_t_6) < 0) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":124 + /* "w3lib/_url.pyx":573 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_space_as_plus, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_space_as_plus, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 124, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 124, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 124, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 124, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_space_as_plus, __pyx_n_s_bool) < 0) __PYX_ERR(0, 124, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 124, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_3_percent_encode_after_encoding, 0, __pyx_n_s_percent_encode_after_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 573, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 573, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 573, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_space_as_plus, __pyx_n_s_bool) < 0) __PYX_ERR(0, 573, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_9_percent_encode_after_encoding, 0, __pyx_n_s_percent_encode_after_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_percent_encode_after_encoding, __pyx_t_8) < 0) __PYX_ERR(0, 124, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_percent_encode_after_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":159 + /* "w3lib/_url.pyx":608 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":160 + /* "w3lib/_url.pyx":609 * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( * _C0_CONTROL, # <<<<<<<<<<<<<< * greater_than="~", * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); - /* "w3lib/_url.pyx":159 + /* "w3lib/_url.pyx":608 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error); - __pyx_t_3 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 608, __pyx_L1_error); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":161 + /* "w3lib/_url.pyx":610 * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( * _C0_CONTROL, * greater_than="~", # <<<<<<<<<<<<<< * ) * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_greater_than, __pyx_kp_u__36) < 0) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_greater_than, __pyx_kp_u__81) < 0) __PYX_ERR(0, 610, __pyx_L1_error) - /* "w3lib/_url.pyx":159 + /* "w3lib/_url.pyx":608 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_t_9) < 0) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":163 + /* "w3lib/_url.pyx":612 * greater_than="~", * ) * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' # <<<<<<<<<<<<<< * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_kp_u__37); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_t_3) < 0) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_u__82); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":164 + /* "w3lib/_url.pyx":613 * ) * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' # <<<<<<<<<<<<<< * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__38); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_t_9) < 0) __PYX_ERR(0, 164, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__83); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":165 + /* "w3lib/_url.pyx":614 * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" # <<<<<<<<<<<<<< * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_kp_u__39); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_t_3) < 0) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_u__84); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_t_4) < 0) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":166 + /* "w3lib/_url.pyx":615 * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" # <<<<<<<<<<<<<< * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__40); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_t_9) < 0) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__85); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":167 + /* "w3lib/_url.pyx":616 * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" # <<<<<<<<<<<<<< * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_kp_u__41); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_t_3) < 0) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_u__86); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":170 + /* "w3lib/_url.pyx":619 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point * _FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" # <<<<<<<<<<<<<< * _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_kp_u__42) < 0) __PYX_ERR(0, 170, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_kp_u__87) < 0) __PYX_ERR(0, 619, __pyx_L1_error) - /* "w3lib/_url.pyx":171 + /* "w3lib/_url.pyx":620 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point * _FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" * _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__43); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_t_9) < 0) __PYX_ERR(0, 171, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__88); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_t_5) < 0) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":174 + /* "w3lib/_url.pyx":623 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< * address = [0] * 8 * piece_index = 0 */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 174, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 174, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_5_parse_ipv6, 0, __pyx_n_s_parse_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 623, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_11_parse_ipv6, 0, __pyx_n_s_parse_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv6, __pyx_t_6) < 0) __PYX_ERR(0, 623, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":261 + /* "w3lib/_url.pyx":710 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< * input: str, * percent_encode_set: _PercentEncodeSet, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 261, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 261, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 261, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_7_utf_8_percent_encode, 0, __pyx_n_s_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf_8_percent_encode, __pyx_t_9) < 0) __PYX_ERR(0, 261, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 710, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 710, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_13_utf_8_percent_encode, 0, __pyx_n_s_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf_8_percent_encode, __pyx_t_5) < 0) __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":273 + /* "w3lib/_url.pyx":722 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 273, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 273, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_9_parse_opaque_host, 0, __pyx_n_s_parse_opaque_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_opaque_host, __pyx_t_4) < 0) __PYX_ERR(0, 273, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 722, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_15_parse_opaque_host, 0, __pyx_n_s_parse_opaque_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_opaque_host, __pyx_t_6) < 0) __PYX_ERR(0, 722, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":281 + /* "w3lib/_url.pyx":730 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< * if not input: * raise ValueError */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 281, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Tuple_int_bool) < 0) __PYX_ERR(0, 281, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_11_parse_ipv4_number, 0, __pyx_n_s_parse_ipv4_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4_number, __pyx_t_9) < 0) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 730, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 730, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_Tuple_int_bool) < 0) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_17_parse_ipv4_number, 0, __pyx_n_s_parse_ipv4_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 730, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4_number, __pyx_t_5) < 0) __PYX_ERR(0, 730, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":301 + /* "w3lib/_url.pyx":750 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and parts[-1] == "": */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 301, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 301, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_13_ends_in_number, 0, __pyx_n_s_ends_in_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ends_in_number, __pyx_t_4) < 0) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 750, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_19_ends_in_number, 0, __pyx_n_s_ends_in_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ends_in_number, __pyx_t_6) < 0) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":318 + /* "w3lib/_url.pyx":767 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and not parts[-1]: */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 318, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 318, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_15_parse_ipv4, 0, __pyx_n_s_parse_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4, __pyx_t_9) < 0) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 767, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 767, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_21_parse_ipv4, 0, __pyx_n_s_parse_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4, __pyx_t_5) < 0) __PYX_ERR(0, 767, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":341 + /* "w3lib/_url.pyx":790 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< * result = _utr46._to_ascii( * domain, */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_be_strict, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_be_strict, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domain, __pyx_n_s_str) < 0) __PYX_ERR(0, 790, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_be_strict, __pyx_n_s_bool) < 0) __PYX_ERR(0, 790, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_23_domain_to_ascii, 0, __pyx_n_s_domain_to_ascii, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domain, __pyx_n_s_str) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_be_strict, __pyx_n_s_bool) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_17_domain_to_ascii, 0, __pyx_n_s_domain_to_ascii, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_3, __pyx_t_9); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_4, __pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_domain_to_ascii, __pyx_t_4) < 0) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_domain_to_ascii, __pyx_t_3) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":360 + /* "w3lib/_url.pyx":809 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_special, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 360, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 360, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_is_special, __pyx_n_s_bool) < 0) __PYX_ERR(0, 360, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 360, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_19_parse_host, 0, __pyx_n_s_parse_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_9, __pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_is_special, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_is_special, __pyx_n_s_bool) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_25_parse_host, 0, __pyx_n_s_parse_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_5, __pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_host, __pyx_t_9) < 0) __PYX_ERR(0, 360, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_host, __pyx_t_5) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":382 + /* "w3lib/_url.pyx":831 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 382, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 382, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_21_is_windows_drive_letter, 0, __pyx_n_s_is_windows_drive_letter, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_windows_drive_letter, __pyx_t_4) < 0) __PYX_ERR(0, 382, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 831, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_27_is_windows_drive_letter, 0, __pyx_n_s_is_windows_drive_letter, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 831, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_windows_drive_letter, __pyx_t_6) < 0) __PYX_ERR(0, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":387 + /* "w3lib/_url.pyx":836 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< * input_length = len(input) * return ( */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 387, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 387, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_23_starts_with_windows_drive_letter, 0, __pyx_n_s_starts_with_windows_drive_lette, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_starts_with_windows_drive_lette, __pyx_t_9) < 0) __PYX_ERR(0, 387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 836, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_29_starts_with_windows_drive_letter, 0, __pyx_n_s_starts_with_windows_drive_lette, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_starts_with_windows_drive_lette, __pyx_t_5) < 0) __PYX_ERR(0, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":397 + /* "w3lib/_url.pyx":846 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< * return input in ( * "..", */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 397, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 397, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_25_is_double_dot_path_segment, 0, __pyx_n_s_is_double_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_double_dot_path_segment, __pyx_t_4) < 0) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 846, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_31_is_double_dot_path_segment, 0, __pyx_n_s_is_double_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_double_dot_path_segment, __pyx_t_6) < 0) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":412 + /* "w3lib/_url.pyx":861 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< * return input in ( * ".", */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 412, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 412, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_27_is_single_dot_path_segment, 0, __pyx_n_s_is_single_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_single_dot_path_segment, __pyx_t_9) < 0) __PYX_ERR(0, 412, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 861, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_33_is_single_dot_path_segment, 0, __pyx_n_s_is_single_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_single_dot_path_segment, __pyx_t_5) < 0) __PYX_ERR(0, 861, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":423 + /* "w3lib/_url.pyx":872 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * *, input: str, pointer: int, encode_set: _PercentEncodeSet * ) -> str: */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 423, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_pointer, __pyx_n_s_int) < 0) __PYX_ERR(0, 423, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 423, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 423, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_29_idempotent_utf_8_percent_encode, 0, __pyx_n_s_idempotent_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_idempotent_utf_8_percent_encode, __pyx_t_4) < 0) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 872, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_pointer, __pyx_n_s_int) < 0) __PYX_ERR(0, 872, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 872, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 872, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_35_idempotent_utf_8_percent_encode, 0, __pyx_n_s_idempotent_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_idempotent_utf_8_percent_encode, __pyx_t_6) < 0) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":438 + /* "w3lib/_url.pyx":887 * * * def _parse_url( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, __pyx_n_s_str) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_31_parse_url, 0, __pyx_n_s_parse_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_9, sizeof(__pyx_defaults), 5)) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 887, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base_url, __pyx_n_s_str) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_path_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_37_parse_url, 0, __pyx_n_s_parse_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 887, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, sizeof(__pyx_defaults), 5)) __PYX_ERR(0, 887, __pyx_L1_error) - /* "w3lib/_url.pyx":443 + /* "w3lib/_url.pyx":892 * base_url: str = None, * encoding: str = "utf-8", * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_userinfo_percent_encode_set = __pyx_t_3; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_userinfo_percent_encode_set = __pyx_t_4; + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":444 + /* "w3lib/_url.pyx":893 * encoding: str = "utf-8", * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_path_percent_encode_set = __pyx_t_3; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_path_percent_encode_set = __pyx_t_4; + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":445 + /* "w3lib/_url.pyx":894 * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_query_percent_encode_set = __pyx_t_3; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_query_percent_encode_set = __pyx_t_4; + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":446 + /* "w3lib/_url.pyx":895 * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, - * ) -> _URL: - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_special_query_percent_encode_set = __pyx_t_3; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + * ) -> _URL: + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 895, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_special_query_percent_encode_set = __pyx_t_4; + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":447 + /* "w3lib/_url.pyx":896 * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * ) -> _URL: * """Return a :class:`_URL` object built from *url*, *base_url* and */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_fragment_percent_encode_set = __pyx_t_3; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_9, __pyx_pf_5w3lib_4_url_44__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_url, __pyx_t_9) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_fragment_percent_encode_set = __pyx_t_4; + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_5w3lib_4_url_50__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_url, __pyx_t_5) < 0) __PYX_ERR(0, 887, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":870 + /* "w3lib/_url.pyx":1319 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< * output = "" * n = address */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 870, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_address, __pyx_n_s_int) < 0) __PYX_ERR(0, 870, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 870, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_33_serialize_ipv4, 0, __pyx_n_s_serialize_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv4, __pyx_t_4) < 0) __PYX_ERR(0, 870, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_address, __pyx_n_s_int) < 0) __PYX_ERR(0, 1319, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_39_serialize_ipv4, 0, __pyx_n_s_serialize_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv4, __pyx_t_6) < 0) __PYX_ERR(0, 1319, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":881 + /* "w3lib/_url.pyx":1330 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 881, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_min_length, __pyx_n_s_int) < 0) __PYX_ERR(0, 881, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 881, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_35_get_ipv6_first_longest_0_piece_index, 0, __pyx_n_s_get_ipv6_first_longest_0_piece, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_9, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1330, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_min_length, __pyx_n_s_int) < 0) __PYX_ERR(0, 1330, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index, 0, __pyx_n_s_get_ipv6_first_longest_0_piece, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 1330, __pyx_L1_error) - /* "w3lib/_url.pyx":882 + /* "w3lib/_url.pyx":1331 * * def _get_ipv6_first_longest_0_piece_index( * address: List[int], *, min_length: int = 2 # <<<<<<<<<<<<<< * ) -> Optional[int]: * index = None */ - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_2))) __PYX_ERR(0, 882, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_2))) __PYX_ERR(0, 1331, __pyx_L1_error) __Pyx_INCREF(__pyx_int_2); - __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_9)->__pyx_arg_min_length = ((PyObject*)__pyx_int_2); + __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_5)->__pyx_arg_min_length = ((PyObject*)__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_9, __pyx_pf_5w3lib_4_url_46__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_t_9) < 0) __PYX_ERR(0, 881, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_5w3lib_4_url_52__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_t_5) < 0) __PYX_ERR(0, 1330, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":899 + /* "w3lib/_url.pyx":1348 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 899, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 899, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 899, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_37_serialize_ipv6, 0, __pyx_n_s_serialize_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 899, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_9); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 899, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1348, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_43_serialize_ipv6, 0, __pyx_n_s_serialize_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv6, __pyx_t_6) < 0) __PYX_ERR(0, 1348, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":920 + /* "w3lib/_url.pyx":1369 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< * if isinstance(host, int): * return _serialize_ipv4(host) */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 920, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_host, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 920, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 920, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_39_serialize_host, 0, __pyx_n_s_serialize_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 920, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_host, __pyx_t_9) < 0) __PYX_ERR(0, 920, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_host, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 1369, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1369, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_45_serialize_host, 0, __pyx_n_s_serialize_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_host, __pyx_t_5) < 0) __PYX_ERR(0, 1369, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":929 + /* "w3lib/_url.pyx":1378 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< * if url.has_opaque_path(): * assert isinstance(url.path, str) */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 929, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 929, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_canonicalize, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_47_serialize_url_path, 0, __pyx_n_s_serialize_url_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 929, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_canonicalize, __pyx_n_s_bool) < 0) __PYX_ERR(0, 929, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 929, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_41_serialize_url_path, 0, __pyx_n_s_serialize_url_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 929, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_3, __pyx_t_9); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_4, __pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url_path, __pyx_t_4) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url_path, __pyx_t_3) < 0) __PYX_ERR(0, 929, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":942 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing - * def _serialize_url( # <<<<<<<<<<<<<< - * url: _URL, - * *, - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 942, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_exclude_fragment, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 942, __pyx_L1_error) + /* "w3lib/_url.pyx":1391 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing + * def _serialize_url( # <<<<<<<<<<<<<< + * url: _URL, + * *, + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_exclude_fragment, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) + + /* "w3lib/_url.pyx":1395 + * *, + * exclude_fragment: bool = False, + * canonicalize: Optional[bool] = None, # <<<<<<<<<<<<<< + * ) -> str: + * """Return a string representation of *url* following the URL serialization + */ + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) + + /* "w3lib/_url.pyx":1391 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing + * def _serialize_url( # <<<<<<<<<<<<<< + * url: _URL, + * *, + */ + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_exclude_fragment, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_canonicalize, __pyx_kp_s_Optional_bool) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_49_serialize_url, 0, __pyx_n_s_serialize_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_5, __pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url, __pyx_t_5) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":1 + * # pylint: disable=protected-access,too-many-instance-attributes,too-many-locals,too-many-nested-blocks,too-many-statements # <<<<<<<<<<<<<< + * + * from cython import cfunc, declare, uchar + */ + __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init w3lib._url", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init w3lib._url"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +#endif +} - /* "w3lib/_url.pyx":946 - * *, - * exclude_fragment: bool = False, - * canonicalize: Optional[bool] = None, # <<<<<<<<<<<<<< - * ) -> str: - * """Return a string representation of *url* following the URL serialization - */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 942, __pyx_L1_error) +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} - /* "w3lib/_url.pyx":942 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing - * def _serialize_url( # <<<<<<<<<<<<<< - * url: _URL, - * *, - */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 942, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 942, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_exclude_fragment, __pyx_n_s_bool) < 0) __PYX_ERR(0, 942, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_canonicalize, __pyx_kp_s_Optional_bool) < 0) __PYX_ERR(0, 942, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 942, __pyx_L1_error) - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_43_serialize_url, 0, __pyx_n_s_serialize_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 942, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_9, __pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_9, __pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url, __pyx_t_9) < 0) __PYX_ERR(0, 942, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; +/* TupleAndListFromArray */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + Py_INCREF(__pyx_empty_tuple); + return __pyx_empty_tuple; + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} +static CYTHON_INLINE PyObject * +__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return PyList_New(0); + } + res = PyList_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); + return res; +} +#endif - /* "w3lib/_url.pyx":1 - * # pylint: disable=protected-access,too-many-instance-attributes,too-many-locals,too-many-nested-blocks,too-many-statements # <<<<<<<<<<<<<< - * - * # https://url.spec.whatwg.org/ - */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_9) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} - /*--- Wrapped vars code ---*/ +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { - __Pyx_AddTraceback("init w3lib._url", __pyx_clineno, __pyx_lineno, __pyx_filename); +/* fastcall */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) +{ + Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + for (i = 0; i < n; i++) + { + if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } - #if !CYTHON_USE_MODULE_STATE - Py_CLEAR(__pyx_m); - #else - Py_DECREF(__pyx_m); - if (pystate_addmodule_run) { - PyObject *tp, *value, *tb; - PyErr_Fetch(&tp, &value, &tb); - PyState_RemoveModule(&__pyx_moduledef); - PyErr_Restore(tp, value, tb); + for (i = 0; i < n; i++) + { + int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + if (unlikely(eq != 0)) { + if (unlikely(eq < 0)) return NULL; + return kwvalues[i]; + } } - #endif - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init w3lib._url"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if CYTHON_PEP489_MULTI_PHASE_INIT - return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; - #else - return; - #endif + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { + Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + PyObject *dict; + dict = PyDict_New(); + if (unlikely(!dict)) + return NULL; + for (i=0; i= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif } -#endif -/* PyErrExceptionMatches */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; i= size) break; +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); + if (!key) goto bad; +#elif CYTHON_ASSUME_SAFE_MACROS + key = PyTuple_GET_ITEM(kwds, pos); +#else + key = PyTuple_GetItem(kwds, pos); + if (!key) goto bad; +#endif + value = kwvalues[pos]; + pos++; + } + else + { + if (!PyDict_Next(kwds, &pos, &key, &value)) break; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + } + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(value); + Py_DECREF(key); +#endif + key = NULL; + value = NULL; + continue; + } +#if !CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + Py_INCREF(value); + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = ( + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key) + ); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } } + Py_XDECREF(key); + Py_XDECREF(value); return 0; -} -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { - int result; - PyObject *exc_type; -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *current_exception = tstate->current_exception; - if (unlikely(!current_exception)) return 0; - exc_type = (PyObject*) Py_TYPE(current_exception); - if (exc_type == err) return 1; -#else - exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; -#endif - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(exc_type); +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + #if PY_MAJOR_VERSION < 3 + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); #endif - if (unlikely(PyTuple_Check(err))) { - result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); +bad: + Py_XDECREF(key); + Py_XDECREF(value); + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; } else { - result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + num_expected = num_max; + more_or_less = "at most"; } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(exc_type); - #endif - return result; + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); } -#endif -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *tmp_value; - assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); - if (value) { - #if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) - #endif - PyException_SetTraceback(value, tb); +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; } - tmp_value = tstate->current_exception; - tstate->current_exception = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject* exc_value; - exc_value = tstate->current_exception; - tstate->current_exception = 0; - *value = exc_value; - *type = NULL; - *tb = NULL; - if (exc_value) { - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - #if CYTHON_COMPILING_IN_CPYTHON - *tb = ((PyBaseExceptionObject*) exc_value)->traceback; - Py_XINCREF(*tb); - #else - *tb = PyException_GetTraceback(exc_value); + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } -#else - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#endif -} -#endif - -/* PyObjectGetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + type_name = __Pyx_PyType_GetName(type); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; } -#endif -/* PyObjectGetAttrStrNoError */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 -static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) - __Pyx_PyErr_Clear(); +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } -#endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { - PyObject *result; -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 - (void) PyObject_GetOptionalAttr(obj, attr_name, &result); - return result; +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { - return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); - } + dictptr = _PyObject_GetDictPtr(obj); #endif - result = __Pyx_PyObject_GetAttrStr(obj, attr_name); - if (unlikely(!result)) { - __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } - return result; -#endif + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); } +#endif -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); - if (unlikely(!result) && !PyErr_Occurred()) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else - "name '%.200s' is not defined", PyString_AS_STRING(name)); +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif - } - return result; -} - -/* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { - PyObject *v; - Py_ssize_t i; - for (i = 0; i < length; i++) { - v = dest[i] = src[i]; - Py_INCREF(v); - } -} -static CYTHON_INLINE PyObject * -__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { - PyObject *res; - if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; } - res = PyTuple_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); - return res; -} -static CYTHON_INLINE PyObject * -__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - return PyList_New(0); +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; } - res = PyList_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); - return res; -} -#endif - -/* BytesEquals */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API - return PyObject_RichCompareBool(s1, s2, equals); #else - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { - const char *ps1, *ps2; - Py_ssize_t length = PyBytes_GET_SIZE(s1); - if (length != PyBytes_GET_SIZE(s2)) - return (equals == Py_NE); - ps1 = PyBytes_AS_STRING(s1); - ps2 = PyBytes_AS_STRING(s2); - if (ps1[0] != ps2[0]) { - return (equals == Py_NE); - } else if (length == 1) { - return (equals == Py_EQ); - } else { - int result; -#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) - Py_hash_t hash1, hash2; - hash1 = ((PyBytesObject*)s1)->ob_shash; - hash2 = ((PyBytesObject*)s2)->ob_shash; - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - return (equals == Py_NE); - } + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } #endif - result = memcmp(ps1, ps2, (size_t)length); - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { - return (equals == Py_NE); - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); } + PyErr_Clear(); #endif + return __Pyx_GetBuiltinName(name); } -/* UnicodeEquals */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API - return PyObject_RichCompareBool(s1, s2, equals); -#else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; #endif - int s1_is_unicode, s2_is_unicode; - if (s1 == s2) { - goto return_eq; + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { + return NULL; } - s1_is_unicode = PyUnicode_CheckExact(s1); - s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { + return NULL; } + #endif + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && #endif - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; } -#if CYTHON_USE_UNICODE_INTERNALS - { - Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED - hash1 = ((PyASCIIObject*)s1)->hash; - hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - goto return_ne; - } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; } -#endif - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; + nk = i / 2; } -return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ); -return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_NE); + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); #endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; } +#endif -/* fastcall */ -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) -{ - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); - for (i = 0; i < n; i++) - { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; - } - for (i = 0; i < n; i++) - { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); - if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; - return kwvalues[i]; - } +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); } - return NULL; + return result; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 -CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { - Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); - PyObject *dict; - dict = PyDict_New(); - if (unlikely(!dict)) +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; - for (i=0; i= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif +/* PyObjectFastCall */ +#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result = 0; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: + Py_DECREF(argstuple); + return result; } - -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); - while (1) { - Py_XDECREF(key); key = NULL; - Py_XDECREF(value); value = NULL; - if (kwds_is_tuple) { - Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(kwds); -#else - size = PyTuple_Size(kwds); - if (size < 0) goto bad; #endif - if (pos >= size) break; -#if CYTHON_AVOID_BORROWED_REFS - key = __Pyx_PySequence_ITEM(kwds, pos); - if (!key) goto bad; -#elif CYTHON_ASSUME_SAFE_MACROS - key = PyTuple_GET_ITEM(kwds, pos); -#else - key = PyTuple_GetItem(kwds, pos); - if (!key) goto bad; +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); + } + else if (nargs == 1 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); + } #endif - value = kwvalues[pos]; - pos++; + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } - else - { - if (!PyDict_Next(kwds, &pos, &key, &value)) break; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); -#endif + } + #if PY_VERSION_HEX >= 0x030700A1 + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + if (kwargs == NULL) { + #if CYTHON_VECTORCALL + #if PY_VERSION_HEX < 0x03090000 + vectorcallfunc f = _PyVectorcall_Function(func); + #else + vectorcallfunc f = PyVectorcall_Function(func); + #endif + if (f) { + return f(func, args, (size_t)nargs, NULL); } - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); - Py_DECREF(key); -#endif - key = NULL; - value = NULL; - continue; + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, NULL); } -#if !CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); + #endif + } + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + } + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif +} + +/* UnpackUnboundCMethod */ +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), + METH_VARARGS | METH_KEYWORDS, + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #else + if (likely(!__Pyx_CyOrPyCFunction_Check(method))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else #endif - Py_INCREF(value); - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; +#if CYTHON_COMPILING_IN_PYPY +#else + if (PyCFunction_Check(method)) #endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key) - ); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); + } +#else + self = PyCFunction_GET_SELF(method); #endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + target->method = unbound_method; } } - Py_XDECREF(key); - Py_XDECREF(value); return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - Py_XDECREF(key); - Py_XDECREF(value); - return -1; } -/* RaiseArgTupleInvalid */ -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + if (likely(cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return (*(cfunc->func))(self, arg); + } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { + #if PY_VERSION_HEX >= 0x030700A0 + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + #else + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + #endif + } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); + return __Pyx__CallUnboundCMethod1(cfunc, self, arg); } - -/* PyObjectSetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_setattro)) - return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif - return PyObject_SetAttr(obj, attr_name, value); -} +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(2, self, arg); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif +bad: + Py_XDECREF(args); + return result; +} /* RaiseUnexpectedTypeError */ static int @@ -24557,446 +30185,566 @@ __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) return 0; } -/* ArgTypeTest */ -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) -{ - __Pyx_TypeName type_name; - __Pyx_TypeName obj_type_name; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(__Pyx_TypeCheck(obj, type))) return 1; +/* DictGetItem */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); + } + } else { + PyErr_SetObject(PyExc_KeyError, key); + } + } + return NULL; } - type_name = __Pyx_PyType_GetName(type); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); - __Pyx_DECREF_TypeName(type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; + Py_INCREF(value); + return value; } +#endif -/* PyDictVersioning */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; } -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); -#else - dictptr = _PyObject_GetDictPtr(obj); #endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + PyObject *exc_value = exc_info->exc_value; + if (exc_value == NULL || exc_value == Py_None) { + *value = NULL; + *type = NULL; + *tb = NULL; + } else { + *value = exc_value; + Py_INCREF(*value); + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + *tb = PyException_GetTraceback(exc_value); } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #endif } -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + PyObject *tmp_value = exc_info->exc_value; + exc_info->exc_value = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); + #else + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); + #endif } #endif -/* GetModuleGlobalName */ -#if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(!__pyx_m)) { - return NULL; - } - result = PyObject_GetAttr(__pyx_m, name); - if (likely(result)) { - return result; + PyObject *local_type = NULL, *local_value, *local_tb = NULL; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030C00A6 + local_value = tstate->current_exception; + tstate->current_exception = 0; + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); } + #else + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + #endif #else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } + PyErr_Fetch(&local_type, &local_value, &local_tb); #endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 + if (unlikely(tstate->current_exception)) +#elif CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) #else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } - PyErr_Clear(); + if (unlikely(PyErr_Occurred())) #endif - return __Pyx_GetBuiltinName(name); -} - -/* GetItemInt */ -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (unlikely(!j)) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyList_GET_SIZE(o); + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + #if PY_VERSION_HEX >= 0x030B00a4 + tmp_value = exc_info->exc_value; + exc_info->exc_value = local_value; + tmp_type = NULL; + tmp_tb = NULL; + Py_XDECREF(local_type); + Py_XDECREF(local_tb); + #else + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + #endif } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); #else - return PySequence_GetItem(o, i); + PyErr_SetExcInfo(local_type, local_value, local_tb); #endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; } -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyTuple_GET_SIZE(o); + +/* PyObjectFormatAndDecref */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { + if (unlikely(!s)) return NULL; + if (likely(PyUnicode_CheckExact(s))) return s; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(s))) { + PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); + Py_DECREF(s); + return result; + } + #endif + return __Pyx_PyObject_FormatAndDecref(s, f); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { + PyObject *result; + if (unlikely(!s)) return NULL; + result = PyObject_Format(s, f); + Py_DECREF(s); + return result; +} + +/* UnicodeConcatInPlace */ +# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +static int +__Pyx_unicode_modifiable(PyObject *unicode) +{ + if (Py_REFCNT(unicode) != 1) + return 0; + if (!PyUnicode_CheckExact(unicode)) + return 0; + if (PyUnicode_CHECK_INTERNED(unicode)) + return 0; + return 1; +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right + #if CYTHON_REFNANNY + , void* __pyx_refnanny + #endif + ) { + PyObject *left = *p_left; + Py_ssize_t left_len, right_len, new_len; + if (unlikely(__Pyx_PyUnicode_READY(left) == -1)) + return NULL; + if (unlikely(__Pyx_PyUnicode_READY(right) == -1)) + return NULL; + left_len = PyUnicode_GET_LENGTH(left); + if (left_len == 0) { + Py_INCREF(right); + return right; } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; + right_len = PyUnicode_GET_LENGTH(right); + if (right_len == 0) { + Py_INCREF(left); + return left; } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); + if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) { + PyErr_SetString(PyExc_OverflowError, + "strings are too large to concat"); + return NULL; + } + new_len = left_len + right_len; + if (__Pyx_unicode_modifiable(left) + && PyUnicode_CheckExact(right) + && PyUnicode_KIND(right) <= PyUnicode_KIND(left) + && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) { + int ret; + __Pyx_GIVEREF(*p_left); + ret = PyUnicode_Resize(p_left, new_len); + __Pyx_GOTREF(*p_left); + if (unlikely(ret != 0)) + return NULL; + #if PY_VERSION_HEX >= 0x030d0000 + if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL; + #else + _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len); + #endif + __Pyx_INCREF(*p_left); + __Pyx_GIVEREF(*p_left); + return *p_left; + } else { + return __Pyx_PyUnicode_Concat(left, right); + } + } #endif + +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + __Pyx_PyThreadState_declare + CYTHON_UNUSED_VAR(cause); + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; } } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; } +#endif + PyErr_NormalizeException(&type, &value, &tb); } else { - PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; - PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_subscript) { - PyObject *r, *key = PyInt_FromSsize_t(i); - if (unlikely(!key)) return NULL; - r = mm->mp_subscript(o, key); - Py_DECREF(key); - return r; + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; } - if (likely(sm && sm->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { - Py_ssize_t l = sm->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } - } - return sm->sq_item(o, i); + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; } } -#else - if (is_list || !PyMapping_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -/* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; - } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; } -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; -#if PY_MAJOR_VERSION >= 3 - PyObject *kwdefs; -#endif - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - #else - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { - return NULL; +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; } - #endif - if ( -#if PY_MAJOR_VERSION >= 3 - co->co_kwonlyargcount == 0 && -#endif - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 - kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; + PyException_SetCause(value, fixed_cause); } -#if PY_MAJOR_VERSION >= 3 - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); + PyErr_SetObject(type, value); + if (tb) { + #if PY_VERSION_HEX >= 0x030C00A6 + PyException_SetTraceback(value, tb); + #elif CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } #else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = Py_TYPE(func)->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) - return NULL; - #endif - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); } - return result; +bad: + Py_XDECREF(owned_instance); + return; } #endif -/* PyObjectCallMethO */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); - self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) - return NULL; - #endif - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); } #endif -/* PyObjectFastCall */ -#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API -static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { - PyObject *argstuple; - PyObject *result = 0; - size_t i; - argstuple = PyTuple_New((Py_ssize_t)nargs); - if (unlikely(!argstuple)) return NULL; - for (i = 0; i < nargs; i++) { - Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; - } - result = __Pyx_PyObject_Call(func, argstuple, kwargs); - bad: - Py_DECREF(argstuple); - return result; +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (unlikely(!j)) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; } -#endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { - Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); -#if CYTHON_COMPILING_IN_CPYTHON - if (nargs == 0 && kwargs == NULL) { - if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) - return __Pyx_PyObject_CallMethO(func, NULL); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); } - else if (nargs == 1 && kwargs == NULL) { - if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) - return __Pyx_PyObject_CallMethO(func, args[0]); + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); #endif - #if PY_VERSION_HEX < 0x030800B1 - #if CYTHON_FAST_PYCCALL - if (PyCFunction_Check(func)) { - if (kwargs) { - return _PyCFunction_FastCallDict(func, args, nargs, kwargs); - } else { - return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); - } +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); } - #if PY_VERSION_HEX >= 0x030700A1 - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; } - #endif - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } } - #endif - #endif - if (kwargs == NULL) { - #if CYTHON_VECTORCALL - #if PY_VERSION_HEX < 0x03090000 - vectorcallfunc f = _PyVectorcall_Function(func); - #else - vectorcallfunc f = PyVectorcall_Function(func); - #endif - if (f) { - return f(func, args, (size_t)nargs, NULL); + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (mm && mm->mp_subscript) { + PyObject *r, *key = PyInt_FromSsize_t(i); + if (unlikely(!key)) return NULL; + r = mm->mp_subscript(o, key); + Py_DECREF(key); + return r; } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, (size_t)nargs, NULL); + if (likely(sm && sm->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return sm->sq_item(o, i); } - #endif } - if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); +#else + if (is_list || !PyMapping_Check(o)) { + return PySequence_GetItem(o, i); } - #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API - return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); - #else - return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); - #endif +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* SliceObject */ @@ -25152,12 +30900,6 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { return __Pyx_IterFinish(); } -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { @@ -25342,271 +31084,110 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case 3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case 4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_add(op1, op2); - } - } - x = a + b; - return PyLong_FromLong(x); -#ifdef HAVE_LONG_LONG - long_long: - llx = lla + llb; - return PyLong_FromLongLong(llx); -#endif - - - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif - double result; - - PyFPE_START_PROTECT("add", return NULL) - result = ((double)a) + (double)b; - PyFPE_END_PROTECT(result) - return PyFloat_FromDouble(result); - } - return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); -} -#endif - -/* PyObjectFormat */ -#if CYTHON_USE_UNICODE_WRITER -static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) { - int ret; - _PyUnicodeWriter writer; - if (likely(PyFloat_CheckExact(obj))) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000 - _PyUnicodeWriter_Init(&writer, 0); -#else - _PyUnicodeWriter_Init(&writer); -#endif - ret = _PyFloat_FormatAdvancedWriter( - &writer, - obj, - format_spec, 0, PyUnicode_GET_LENGTH(format_spec)); - } else if (likely(PyLong_CheckExact(obj))) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000 - _PyUnicodeWriter_Init(&writer, 0); -#else - _PyUnicodeWriter_Init(&writer); -#endif - ret = _PyLong_FormatAdvancedWriter( - &writer, - obj, - format_spec, 0, PyUnicode_GET_LENGTH(format_spec)); - } else { - return PyObject_Format(obj, format_spec); - } - if (unlikely(ret == -1)) { - _PyUnicodeWriter_Dealloc(&writer); - return NULL; - } - return _PyUnicodeWriter_Finish(&writer); -} -#endif - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + } - if (cause) { - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + double result; + + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); } - PyErr_SetObject(type, value); - if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 - PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* PyObjectFormat */ +#if CYTHON_USE_UNICODE_WRITER +static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) { + int ret; + _PyUnicodeWriter writer; + if (likely(PyFloat_CheckExact(obj))) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000 + _PyUnicodeWriter_Init(&writer, 0); #else - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); + _PyUnicodeWriter_Init(&writer); +#endif + ret = _PyFloat_FormatAdvancedWriter( + &writer, + obj, + format_spec, 0, PyUnicode_GET_LENGTH(format_spec)); + } else if (likely(PyLong_CheckExact(obj))) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000 + _PyUnicodeWriter_Init(&writer, 0); +#else + _PyUnicodeWriter_Init(&writer); #endif + ret = _PyLong_FormatAdvancedWriter( + &writer, + obj, + format_spec, 0, PyUnicode_GET_LENGTH(format_spec)); + } else { + return PyObject_Format(obj, format_spec); } -bad: - Py_XDECREF(owned_instance); - return; + if (unlikely(ret == -1)) { + _PyUnicodeWriter_Dealloc(&writer); + return NULL; + } + return _PyUnicodeWriter_Finish(&writer); } #endif @@ -25997,135 +31578,40 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring( stop += length; else if (stop > length) stop = length; - if (stop <= start) - return __Pyx_NewRef(__pyx_empty_unicode); - if (start == 0 && stop == length) - return __Pyx_NewRef(text); -#if CYTHON_PEP393_ENABLED - return PyUnicode_FromKindAndData(PyUnicode_KIND(text), - PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start); -#else - return PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(text)+start, stop-start); -#endif -} - -/* GetItemIntUnicode */ -static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i, - int wraparound, int boundscheck) { - Py_ssize_t length; - if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return (Py_UCS4)-1; - if (wraparound | boundscheck) { - length = __Pyx_PyUnicode_GET_LENGTH(ustring); - if (wraparound & unlikely(i < 0)) i += length; - if ((!boundscheck) || likely(__Pyx_is_valid_index(i, length))) { - return __Pyx_PyUnicode_READ_CHAR(ustring, i); - } else { - PyErr_SetString(PyExc_IndexError, "string index out of range"); - return (Py_UCS4)-1; - } - } else { - return __Pyx_PyUnicode_READ_CHAR(ustring, i); - } -} - -/* RaiseUnboundLocalError */ -static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { - PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); -} - -/* GetException */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) -#endif -{ - PyObject *local_type = NULL, *local_value, *local_tb = NULL; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030C00A6 - local_value = tstate->current_exception; - tstate->current_exception = 0; - if (likely(local_value)) { - local_type = (PyObject*) Py_TYPE(local_value); - Py_INCREF(local_type); - local_tb = PyException_GetTraceback(local_value); - } - #else - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - #endif -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 - if (unlikely(tstate->current_exception)) -#elif CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - #if CYTHON_USE_EXC_INFO_STACK - { - _PyErr_StackItem *exc_info = tstate->exc_info; - #if PY_VERSION_HEX >= 0x030B00a4 - tmp_value = exc_info->exc_value; - exc_info->exc_value = local_value; - tmp_type = NULL; - tmp_tb = NULL; - Py_XDECREF(local_type); - Py_XDECREF(local_tb); - #else - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = local_type; - exc_info->exc_value = local_value; - exc_info->exc_traceback = local_tb; - #endif - } - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); + if (stop <= start) + return __Pyx_NewRef(__pyx_empty_unicode); + if (start == 0 && stop == length) + return __Pyx_NewRef(text); +#if CYTHON_PEP393_ENABLED + return PyUnicode_FromKindAndData(PyUnicode_KIND(text), + PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start); #else - PyErr_SetExcInfo(local_type, local_value, local_tb); + return PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(text)+start, stop-start); #endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; +} + +/* GetItemIntUnicode */ +static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i, + int wraparound, int boundscheck) { + Py_ssize_t length; + if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return (Py_UCS4)-1; + if (wraparound | boundscheck) { + length = __Pyx_PyUnicode_GET_LENGTH(ustring); + if (wraparound & unlikely(i < 0)) i += length; + if ((!boundscheck) || likely(__Pyx_is_valid_index(i, length))) { + return __Pyx_PyUnicode_READ_CHAR(ustring, i); + } else { + PyErr_SetString(PyExc_IndexError, "string index out of range"); + return (Py_UCS4)-1; + } + } else { + return __Pyx_PyUnicode_READ_CHAR(ustring, i); + } +} + +/* RaiseUnboundLocalError */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* pep479 */ @@ -26158,88 +31644,6 @@ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { "generator raised StopIteration"); } -/* GetTopmostException */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * -__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) -{ - _PyErr_StackItem *exc_info = tstate->exc_info; - while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && - exc_info->previous_item != NULL) - { - exc_info = exc_info->previous_item; - } - return exc_info; -} -#endif - -/* SaveResetException */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - PyObject *exc_value = exc_info->exc_value; - if (exc_value == NULL || exc_value == Py_None) { - *value = NULL; - *type = NULL; - *tb = NULL; - } else { - *value = exc_value; - Py_INCREF(*value); - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - *tb = PyException_GetTraceback(exc_value); - } - #elif CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - *type = exc_info->exc_type; - *value = exc_info->exc_value; - *tb = exc_info->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #else - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #endif -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = tstate->exc_info; - PyObject *tmp_value = exc_info->exc_value; - exc_info->exc_value = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); - #else - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = type; - exc_info->exc_value = value; - exc_info->exc_traceback = tb; - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - #endif -} -#endif - /* SliceTupleAndList */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) { @@ -26407,27 +31811,6 @@ static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long int } #endif -/* PyObjectFormatAndDecref */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { - if (unlikely(!s)) return NULL; - if (likely(PyUnicode_CheckExact(s))) return s; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(s))) { - PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); - Py_DECREF(s); - return result; - } - #endif - return __Pyx_PyObject_FormatAndDecref(s, f); -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { - PyObject *result; - if (unlikely(!s)) return NULL; - result = PyObject_Format(s, f); - Py_DECREF(s); - return result; -} - /* JoinPyUnicode */ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char) { @@ -26518,126 +31901,12 @@ static int __Pyx_PyUnicode_TailmatchTuple(PyObject* s, PyObject* substrings, } return 0; } -static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr, - Py_ssize_t start, Py_ssize_t end, int direction) { - if (unlikely(PyTuple_Check(substr))) { - return __Pyx_PyUnicode_TailmatchTuple(s, substr, start, end, direction); - } - return (int) PyUnicode_Tailmatch(s, substr, start, end, direction); -} - -/* UnpackUnboundCMethod */ -static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { - PyObject *result; - PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); - if (unlikely(!selfless_args)) return NULL; - result = PyObject_Call(method, selfless_args, kwargs); - Py_DECREF(selfless_args); - return result; -} -static PyMethodDef __Pyx_UnboundCMethod_Def = { - "CythonUnboundCMethod", - __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), - METH_VARARGS | METH_KEYWORDS, - NULL -}; -static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { - PyObject *method; - method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); - if (unlikely(!method)) - return -1; - target->method = method; -#if CYTHON_COMPILING_IN_CPYTHON - #if PY_MAJOR_VERSION >= 3 - if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) - #else - if (likely(!__Pyx_CyOrPyCFunction_Check(method))) - #endif - { - PyMethodDescrObject *descr = (PyMethodDescrObject*) method; - target->func = descr->d_method->ml_meth; - target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); - } else -#endif -#if CYTHON_COMPILING_IN_PYPY -#else - if (PyCFunction_Check(method)) -#endif - { - PyObject *self; - int self_found; -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - self = PyObject_GetAttrString(method, "__self__"); - if (!self) { - PyErr_Clear(); - } -#else - self = PyCFunction_GET_SELF(method); -#endif - self_found = (self && self != Py_None); -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - Py_XDECREF(self); -#endif - if (self_found) { - PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); - if (unlikely(!unbound_method)) return -1; - Py_DECREF(method); - target->method = unbound_method; - } - } - return 0; -} - -/* CallUnboundCMethod1 */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { - if (likely(cfunc->func)) { - int flag = cfunc->flag; - if (flag == METH_O) { - return (*(cfunc->func))(self, arg); - } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { - #if PY_VERSION_HEX >= 0x030700A0 - return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); - #else - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); - #endif - } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); - } - } - return __Pyx__CallUnboundCMethod1(cfunc, self, arg); -} -#endif -static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ - PyObject *args, *result = NULL; - if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_COMPILING_IN_CPYTHON - if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - args = PyTuple_New(1); - if (unlikely(!args)) goto bad; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - if (cfunc->flag & METH_KEYWORDS) - result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); - else - result = (*cfunc->func)(self, args); - } else { - args = PyTuple_New(2); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 1, arg); - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr, + Py_ssize_t start, Py_ssize_t end, int direction) { + if (unlikely(PyTuple_Check(substr))) { + return __Pyx_PyUnicode_TailmatchTuple(s, substr, start, end, direction); } -#else - args = PyTuple_Pack(2, self, arg); - if (unlikely(!args)) goto bad; - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); -#endif -bad: - Py_XDECREF(args); - return result; + return (int) PyUnicode_Tailmatch(s, substr, start, end, direction); } /* PyObjectCall2Args */ @@ -27003,70 +32272,6 @@ static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long i } #endif -/* UnicodeConcatInPlace */ -# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -static int -__Pyx_unicode_modifiable(PyObject *unicode) -{ - if (Py_REFCNT(unicode) != 1) - return 0; - if (!PyUnicode_CheckExact(unicode)) - return 0; - if (PyUnicode_CHECK_INTERNED(unicode)) - return 0; - return 1; -} -static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right - #if CYTHON_REFNANNY - , void* __pyx_refnanny - #endif - ) { - PyObject *left = *p_left; - Py_ssize_t left_len, right_len, new_len; - if (unlikely(__Pyx_PyUnicode_READY(left) == -1)) - return NULL; - if (unlikely(__Pyx_PyUnicode_READY(right) == -1)) - return NULL; - left_len = PyUnicode_GET_LENGTH(left); - if (left_len == 0) { - Py_INCREF(right); - return right; - } - right_len = PyUnicode_GET_LENGTH(right); - if (right_len == 0) { - Py_INCREF(left); - return left; - } - if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) { - PyErr_SetString(PyExc_OverflowError, - "strings are too large to concat"); - return NULL; - } - new_len = left_len + right_len; - if (__Pyx_unicode_modifiable(left) - && PyUnicode_CheckExact(right) - && PyUnicode_KIND(right) <= PyUnicode_KIND(left) - && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) { - int ret; - __Pyx_GIVEREF(*p_left); - ret = PyUnicode_Resize(p_left, new_len); - __Pyx_GOTREF(*p_left); - if (unlikely(ret != 0)) - return NULL; - #if PY_VERSION_HEX >= 0x030d0000 - if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL; - #else - _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len); - #endif - __Pyx_INCREF(*p_left); - __Pyx_GIVEREF(*p_left); - return *p_left; - } else { - return __Pyx_PyUnicode_Concat(left, right); - } - } -#endif - /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { @@ -27429,6 +32634,134 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { return module; } +/* ImportDottedModule */ +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { + PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + if (unlikely(PyErr_Occurred())) { + PyErr_Clear(); + } + if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { + partial_name = name; + } else { + slice = PySequence_GetSlice(parts_tuple, 0, count); + if (unlikely(!slice)) + goto bad; + sep = PyUnicode_FromStringAndSize(".", 1); + if (unlikely(!sep)) + goto bad; + partial_name = PyUnicode_Join(sep, slice); + } + PyErr_Format( +#if PY_MAJOR_VERSION < 3 + PyExc_ImportError, + "No module named '%s'", PyString_AS_STRING(partial_name)); +#else +#if PY_VERSION_HEX >= 0x030600B1 + PyExc_ModuleNotFoundError, +#else + PyExc_ImportError, +#endif + "No module named '%U'", partial_name); +#endif +bad: + Py_XDECREF(sep); + Py_XDECREF(slice); + Py_XDECREF(partial_name); + return NULL; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { + PyObject *imported_module; +#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + return NULL; + imported_module = __Pyx_PyDict_GetItemStr(modules, name); + Py_XINCREF(imported_module); +#else + imported_module = PyImport_GetModule(name); +#endif + return imported_module; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { + Py_ssize_t i, nparts; + nparts = PyTuple_GET_SIZE(parts_tuple); + for (i=1; i < nparts && module; i++) { + PyObject *part, *submodule; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + part = PyTuple_GET_ITEM(parts_tuple, i); +#else + part = PySequence_ITEM(parts_tuple, i); +#endif + submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); +#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(part); +#endif + Py_DECREF(module); + module = submodule; + } + if (unlikely(!module)) { + return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); + } + return module; +} +#endif +static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if PY_MAJOR_VERSION < 3 + PyObject *module, *from_list, *star = __pyx_n_s__24; + CYTHON_UNUSED_VAR(parts_tuple); + from_list = PyList_New(1); + if (unlikely(!from_list)) + return NULL; + Py_INCREF(star); + PyList_SET_ITEM(from_list, 0, star); + module = __Pyx_Import(name, from_list, 0); + Py_DECREF(from_list); + return module; +#else + PyObject *imported_module; + PyObject *module = __Pyx_Import(name, NULL, 0); + if (!parts_tuple || unlikely(!module)) + return module; + imported_module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(imported_module)) { + Py_DECREF(module); + return imported_module; + } + PyErr_Clear(); + return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); +#endif +} +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 + PyObject *module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(module)) { + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + if (likely(spec)) { + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { + Py_DECREF(spec); + spec = NULL; + } + Py_XDECREF(unsafe); + } + if (likely(!spec)) { + PyErr_Clear(); + return module; + } + Py_DECREF(spec); + Py_DECREF(module); + } else if (PyErr_Occurred()) { + PyErr_Clear(); + } +#endif + return __Pyx__ImportDottedModule(name, parts_tuple); +} + /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); @@ -27472,69 +32805,6 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { return value; } -/* UnicodeAsUCS4 */ -static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { - Py_ssize_t length; - #if CYTHON_PEP393_ENABLED - length = PyUnicode_GET_LENGTH(x); - if (likely(length == 1)) { - return PyUnicode_READ_CHAR(x, 0); - } - #else - length = PyUnicode_GET_SIZE(x); - if (likely(length == 1)) { - return PyUnicode_AS_UNICODE(x)[0]; - } - #if Py_UNICODE_SIZE == 2 - else if (PyUnicode_GET_SIZE(x) == 2) { - Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0]; - if (high_val >= 0xD800 && high_val <= 0xDBFF) { - Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1]; - if (low_val >= 0xDC00 && low_val <= 0xDFFF) { - return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1))); - } - } - } - #endif - #endif - PyErr_Format(PyExc_ValueError, - "only single character unicode strings can be converted to Py_UCS4, " - "got length %" CYTHON_FORMAT_SSIZE_T "d", length); - return (Py_UCS4)-1; -} - -/* object_ord */ -static long __Pyx__PyObject_Ord(PyObject* c) { - Py_ssize_t size; - if (PyBytes_Check(c)) { - size = PyBytes_GET_SIZE(c); - if (likely(size == 1)) { - return (unsigned char) PyBytes_AS_STRING(c)[0]; - } -#if PY_MAJOR_VERSION < 3 - } else if (PyUnicode_Check(c)) { - return (long)__Pyx_PyUnicode_AsPy_UCS4(c); -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - } else if (PyByteArray_Check(c)) { - size = PyByteArray_GET_SIZE(c); - if (likely(size == 1)) { - return (unsigned char) PyByteArray_AS_STRING(c)[0]; - } -#endif - } else { - __Pyx_TypeName c_type_name = __Pyx_PyType_GetName(Py_TYPE(c)); - PyErr_Format(PyExc_TypeError, - "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found", - c_type_name); - __Pyx_DECREF_TypeName(c_type_name); - return (long)(Py_UCS4)-1; - } - PyErr_Format(PyExc_TypeError, - "ord() expected a character, but string of length %zd found", size); - return (long)(Py_UCS4)-1; -} - /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); @@ -28712,6 +33982,77 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual return op; } +/* RaiseMappingExpected */ +static void __Pyx_RaiseMappingExpectedError(PyObject* arg) { + __Pyx_TypeName arg_type_name = __Pyx_PyType_GetName(Py_TYPE(arg)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' object is not a mapping", arg_type_name); + __Pyx_DECREF_TypeName(arg_type_name); +} + +/* UnicodeAsUCS4 */ +static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { + Py_ssize_t length; + #if CYTHON_PEP393_ENABLED + length = PyUnicode_GET_LENGTH(x); + if (likely(length == 1)) { + return PyUnicode_READ_CHAR(x, 0); + } + #else + length = PyUnicode_GET_SIZE(x); + if (likely(length == 1)) { + return PyUnicode_AS_UNICODE(x)[0]; + } + #if Py_UNICODE_SIZE == 2 + else if (PyUnicode_GET_SIZE(x) == 2) { + Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0]; + if (high_val >= 0xD800 && high_val <= 0xDBFF) { + Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1]; + if (low_val >= 0xDC00 && low_val <= 0xDFFF) { + return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1))); + } + } + } + #endif + #endif + PyErr_Format(PyExc_ValueError, + "only single character unicode strings can be converted to Py_UCS4, " + "got length %" CYTHON_FORMAT_SSIZE_T "d", length); + return (Py_UCS4)-1; +} + +/* object_ord */ +static long __Pyx__PyObject_Ord(PyObject* c) { + Py_ssize_t size; + if (PyBytes_Check(c)) { + size = PyBytes_GET_SIZE(c); + if (likely(size == 1)) { + return (unsigned char) PyBytes_AS_STRING(c)[0]; + } +#if PY_MAJOR_VERSION < 3 + } else if (PyUnicode_Check(c)) { + return (long)__Pyx_PyUnicode_AsPy_UCS4(c); +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + } else if (PyByteArray_Check(c)) { + size = PyByteArray_GET_SIZE(c); + if (likely(size == 1)) { + return (unsigned char) PyByteArray_AS_STRING(c)[0]; + } +#endif + } else { + __Pyx_TypeName c_type_name = __Pyx_PyType_GetName(Py_TYPE(c)); + PyErr_Format(PyExc_TypeError, + "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found", + c_type_name); + __Pyx_DECREF_TypeName(c_type_name); + return (long)(Py_UCS4)-1; + } + PyErr_Format(PyExc_TypeError, + "ord() expected a character, but string of length %zd found", size); + return (long)(Py_UCS4)-1; +} + /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; diff --git a/w3lib/_url.pyx b/w3lib/_url.pyx index f1fe7a81..44df98cf 100644 --- a/w3lib/_url.pyx +++ b/w3lib/_url.pyx @@ -1,52 +1,501 @@ # pylint: disable=protected-access,too-many-instance-attributes,too-many-locals,too-many-nested-blocks,too-many-statements -# https://url.spec.whatwg.org/ +from cython import cfunc, declare, uchar +import codecs +from functools import lru_cache from math import floor -from typing import List, Optional, Tuple, Union +from typing import AnyStr, Callable, Dict, List, Optional, Tuple, Union from urllib.parse import unquote from . import _utr46 -from ._encoding import ( - _get_encoder, - _get_output_encoding, -) from ._infra import ( _ASCII_ALPHA, _ASCII_ALPHANUMERIC, _ASCII_DIGIT, _ASCII_HEX_DIGIT, _ASCII_TAB_OR_NEWLINE, + _ASCII_WHITESPACE, _C0_CONTROL, _C0_CONTROL_OR_SPACE, ) from ._util import _PercentEncodeSet +# https://encoding.spec.whatwg.org/ + +CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] +DecodeFunction = Callable[[bytes], Tuple[str, int]] +EncodeFunction = Callable[[str, str], Tuple[bytes, int]] + + +def _short_windows_125(last_digit: int) -> Dict[str, str]: + return { + label: f"windows-125{last_digit}" + for label in ( + f"cp125{last_digit}", + f"windows-125{last_digit}", + f"x-cp125{last_digit}", + ) + } + + +_REPLACEMENT_ENCODING = "replacement" +_UTF_8_ENCODING = "utf-8" +_UTF_16BE_ENCODING = "utf-16be" +_UTF_16LE_ENCODING = "utf-16le" + +# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get +# +# Maps the labels defined in the standard to an encoding label that Python +# understands. +_LABEL_ENCODINGS = { + **{ + label: _UTF_8_ENCODING + for label in ( + "unicode-1-1-utf-8", + "unicode11utf8", + "unicode20utf8", + "utf-8", + "utf8", + "x-unicode20utf8", + ) + }, + **{ + label: "ibm866" + for label in ( + "866", + "cp866", + "csibm866", + "ibm866", + ) + }, + **{ + label: "iso-8859-2" + for label in ( + "csisolatin2", + "iso-8859-2", + "iso-ir-101", + "iso8859-2", + "iso88592", + "iso_8859-2", + "iso_8859-2:1987", + "l2", + "latin2", + ) + }, + **{ + label: "iso-8859-3" + for label in ( + "csisolatin3", + "iso-8859-3", + "iso-ir-109", + "iso8859-3", + "iso88593", + "iso_8859-3", + "iso_8859-3:1988", + "l3", + "latin3", + ) + }, + **{ + label: "iso-8859-4" + for label in ( + "csisolatin4", + "iso-8859-4", + "iso-ir-110", + "iso8859-4", + "iso88594", + "iso_8859-4", + "iso_8859-4:1988", + "l4", + "latin4", + ) + }, + **{ + label: "iso-8859-5" + for label in ( + "csisolatincyrillic", + "cyrillic", + "iso-8859-5", + "iso-ir-144", + "iso8859-5", + "iso88595", + "iso_8859-5", + "iso_8859-5:1988", + ) + }, + **{ + label: "iso-8859-6" + for label in ( + "arabic", + "asmo-708", + "csiso88596e", + "csiso88596i", + "csisolatinarabic", + "ecma-114", + "iso-8859-6", + "iso-8859-6-e", + "iso-8859-6-i", + "iso-ir-127", + "iso8859-6", + "iso88596", + "iso_8859-6", + "iso_8859-6:1987", + ) + }, + **{ + label: "iso-8859-7" + for label in ( + "csisolatingreek", + "ecma-118", + "elot_928", + "greek", + "greek8", + "iso-8859-7", + "iso-ir-126", + "iso8859-7", + "iso88597", + "iso_8859-7", + "iso_8859-7:1987", + "sun_eu_greek", + ) + }, + **{ + label: "iso-8859-8" + for label in ( + "csiso88598e", + "csisolatinhebrew", + "hebrew", + "iso-8859-8", + "iso-8859-8-e", + "iso-ir-138", + "iso8859-8", + "iso88598", + "iso_8859-8", + "iso_8859-8:1988", + "visual", + ) + }, + **{ + label: "iso-8859-8-i" + for label in ( + "csiso88598i", + "iso-8859-8-i", + "logical", + ) + }, + **{ + label: "iso-8859-10" + for label in ( + "csisolatin6", + "iso-8859-10", + "iso-ir-157", + "iso8859-10", + "iso885910", + "l6", + "latin6", + ) + }, + **{ + label: "iso-8859-10" + for label in ( + "csisolatin6", + "iso-8859-10", + "iso-ir-157", + "iso8859-10", + "iso885910", + "l6", + "latin6", + ) + }, + **{ + label: "iso-8859-13" + for label in ( + "iso-8859-13", + "iso8859-13", + "iso885913", + ) + }, + **{ + label: "iso-8859-14" + for label in ( + "iso-8859-14", + "iso8859-14", + "iso885914", + ) + }, + **{ + label: "iso-8859-15" + for label in ( + "csisolatin9", + "iso-8859-15", + "iso8859-15", + "iso885915", + "iso_8859-15", + "l9", + ) + }, + "iso-8859-16": "iso-8859-16", + **{ + label: "koi8-r" + for label in ( + "cskoi8r", + "koi", + "koi8", + "koi8-r", + "koi8_r", + ) + }, + **{ + label: "koi8-u" + for label in ( + "koi8-ru", + "koi8-u", + ) + }, + **{ + label: "macintosh" + for label in ( + "csmacintosh", + "mac", + "macintosh", + "x-mac-roman", + ) + }, + **{ + label: "cp874" + for label in ( + "dos-874", + "iso-8859-11", + "iso8859-11", + "iso885911", + "tis-620", + "windows-874", + ) + }, + **_short_windows_125(0), + **_short_windows_125(1), + **{ + label: "windows-1252" + for label in ( + "ansi_x3.4-1968", + "ascii", + "cp1252", + "cp819", + "csisolatin1", + "ibm819", + "iso-8859-1", + "iso-ir-100", + "iso8859-1", + "iso88591", + "iso_8859-1", + "iso_8859-1:1987", + "l1", + "latin1", + "us-ascii", + "windows-1252", + "x-cp1252", + ) + }, + **_short_windows_125(3), + **{ + label: "windows-1254" + for label in ( + "cp1254", + "csisolatin5", + "iso-8859-9", + "iso-ir-148", + "iso8859-9", + "iso88599", + "iso_8859-9", + "iso_8859-9:1989", + "l5", + "latin5", + "windows-1254", + "x-cp1254", + ) + }, + **_short_windows_125(5), + **_short_windows_125(6), + **_short_windows_125(7), + **_short_windows_125(8), + **{ + label: "mac-cyrillic" + for label in ( + "x-mac-cyrillic", + "x-mac-ukrainian", + ) + }, + **{ + label: "gbk" + for label in ( + "chinese", + "csgb2312", + "csiso58gb231280", + "gb2312", + "gb_2312", + "gb_2312-80", + "gbk", + "iso-ir-58", + "x-gbk", + ) + }, + "gb18030": "gb18030", + **{ + label: "big5" + for label in ( + "big5", + "big5-hkscs", + "cn-big5", + "csbig5", + "x-x-big5", + ) + }, + **{ + label: "euc-jp" + for label in ( + "cseucpkdfmtjapanese", + "euc-jp", + "x-euc-jp", + ) + }, + **{ + label: "iso-2022-jp" + for label in ( + "csiso2022jp", + "iso-2022-jp", + ) + }, + **{ + label: "shift_jis" + for label in ( + "csshiftjis", + "ms932", + "ms_kanji", + "shift-jis", + "shift_jis", + "sjis", + "windows-31j", + "x-sjis", + ) + }, + **{ + label: "euc-kr" + for label in ( + "cseuckr", + "csksc56011987", + "euc-kr", + "iso-ir-149", + "korean", + "ks_c_5601-1987", + "ks_c_5601-1989", + "ksc5601", + "ksc_5601", + "windows-949", + ) + }, + **{ + label: _REPLACEMENT_ENCODING + for label in ( + "csiso2022kr", + "hz-gb-2312", + "iso-2022-cn", + "iso-2022-cn-ext", + "iso-2022-kr", + "replacement", + ) + }, + **{ + label: _UTF_16BE_ENCODING + for label in ( + "unicodefffe", + "utf-16be", + ) + }, + **{ + label: _UTF_16LE_ENCODING + for label in ( + "csunicode", + "iso-10646-ucs-2", + "ucs-2", + "unicode", + "unicodefeff", + "utf-16", + "utf-16le", + ) + }, + "x-user-defined": "x-user-defined", +} + + +# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder +@lru_cache(maxsize=None) +def _get_encoder(encoding: str) -> EncodeFunction: + codec_info = codecs.lookup(encoding) + return codec_info.encode + + +_UTF_8_ENCODER = _get_encoder("utf-8") + + +# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get +@lru_cache(maxsize=None) +def _get_encoding(label: str) -> str: + label = label.strip(_ASCII_WHITESPACE).lower() + try: + encoding = _LABEL_ENCODINGS[label] + except KeyError: + raise ValueError( + f"{label!r} does not match any encoding label from the Encoding " + f"Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721" + f"bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)" + ) + return encoding + + +_OUTPUT_ENCODING_UTF8_ENCODINGS = ( + _REPLACEMENT_ENCODING, + _UTF_16BE_ENCODING, + _UTF_16LE_ENCODING, +) + + +# https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings +@cfunc +def _get_output_encoding(encoding: str) -> str: + encoding = _get_encoding(encoding) + if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: + return _UTF_8_ENCODING + return encoding + + +# https://url.spec.whatwg.org/ + _ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { ord(char): None for char in _ASCII_TAB_OR_NEWLINE } -SCHEME_START = 0 -SCHEME = 1 -NO_SCHEME = 2 -SPECIAL_RELATIVE_OR_AUTHORITY = 3 -PATH_OR_AUTHORITY = 4 -RELATIVE = 5 -RELATIVE_SLASH = 6 -SPECIAL_AUTHORITY_SLASHES = 7 -SPECIAL_AUTHORITY_IGNORE_SLASHES = 8 -AUTHORITY = 9 -HOST = 10 -PORT = 11 -FILE = 12 -FILE_SLASH = 13 -FILE_HOST = 14 -PATH_START = 15 -PATH = 16 -OPAQUE_PATH = 17 -QUERY = 18 -FRAGMENT = 19 +SCHEME_START = declare(uchar, 0) +SCHEME = declare(uchar, 1) +NO_SCHEME = declare(uchar, 2) +SPECIAL_RELATIVE_OR_AUTHORITY = declare(uchar, 3) +PATH_OR_AUTHORITY = declare(uchar, 4) +RELATIVE = declare(uchar, 5) +RELATIVE_SLASH = declare(uchar, 6) +SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) +SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) +AUTHORITY = declare(uchar, 9) +HOST = declare(uchar, 10) +PORT = declare(uchar, 11) +FILE = declare(uchar, 12) +FILE_SLASH = declare(uchar, 13) +FILE_HOST = declare(uchar, 14) +PATH_START = declare(uchar, 15) +PATH = declare(uchar, 16) +OPAQUE_PATH = declare(uchar, 17) +QUERY = declare(uchar, 18) +FRAGMENT = declare(uchar, 19) # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#default-port From bd15eb9d56aac2dcf1f3ca152037dcb1b61ea4e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 13 Feb 2024 12:37:09 +0100 Subject: [PATCH 30/34] Update test expectations --- tests/test_url.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_url.py b/tests/test_url.py index 058193b7..94554542 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -576,7 +576,6 @@ def test_safe_url_string_encoding(encoding, url, output): "http://192.168.0.256", # Invalid IP address "http://192.168.0.0.0", # Invalid IP address / domain name "http://[2a01:5cc0:1:2::4]", # https://github.com/scrapy/w3lib/issues/193 - "http://[2a01:5cc0:1:2:3:4]", # Invalid IPv6 "https://example.com:", # Removes the : # Does not convert \ to / "https://example.com\\a", From 4960889ab8ff5aa143aeecbc37be2cc28df00ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 13 Feb 2024 16:22:42 +0100 Subject: [PATCH 31/34] WIP --- setup.py | 5 +- tests/test_url.py | 2 +- w3lib/_rfc2396.c | 497 +- w3lib/_rfc3986.c | 497 +- w3lib/_rfc5892.c | 378 +- w3lib/_types.c | 331 ++ w3lib/_url.c | 11942 ++++++++++++++++++++++++-------------------- w3lib/_url.pyx | 272 +- w3lib/_util.c | 564 ++- w3lib/_utr46.c | 779 ++- w3lib/url.py | 105 +- 11 files changed, 9306 insertions(+), 6066 deletions(-) diff --git a/setup.py b/setup.py index 0cfae8a1..c1ff5eb4 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,10 @@ def no_cythonize(extensions, **_ignore): if bool(int(os.getenv("CYTHONIZE", 0))): from Cython.Build import cythonize - compiler_directives = {"language_level": 3} + compiler_directives = { + "language_level": 3, + "profile": bool(int(os.getenv("CYTHON_PROFILE", 0))), + } extensions = cythonize(extensions, compiler_directives=compiler_directives) else: extensions = no_cythonize(extensions) diff --git a/tests/test_url.py b/tests/test_url.py index 2c0769b1..9561c918 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -1043,7 +1043,7 @@ def test_safe_url_performance(url): # presummably due to caching by urllib. number = 1 # TODO: Increase? How much? # Make sure the new implementation is at most this number of times as slow. - multiplier = 4 # TODO: Lower as close to 1 as possible. + multiplier = 3 # TODO: Lower as close to 1 as possible. time1 = timeit( f"safe_url({url!r})", "from w3lib.url import safe_url", number=number diff --git a/w3lib/_rfc2396.c b/w3lib/_rfc2396.c index e5f7fcca..38721b7d 100644 --- a/w3lib/_rfc2396.c +++ b/w3lib/_rfc2396.c @@ -1551,30 +1551,6 @@ static const char *__pyx_f[] = { #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) -/* PyObjectGetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* IncludeStringH.proto */ -#include - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; @@ -1618,6 +1594,268 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif +/* Profile.proto */ +#ifndef CYTHON_PROFILE +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + #define CYTHON_PROFILE 0 +#else + #define CYTHON_PROFILE 1 +#endif +#endif +#ifndef CYTHON_TRACE_NOGIL + #define CYTHON_TRACE_NOGIL 0 +#else + #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) + #define CYTHON_TRACE 1 + #endif +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL(frame) + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) + #endif + #define __Pyx_TraceDeclarations\ + static PyCodeObject *__pyx_frame_code = NULL;\ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceFrameInit(codeobj)\ + if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; +#if PY_VERSION_HEX >= 0x030b00a2 + #if PY_VERSION_HEX >= 0x030C00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + ((!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #endif + #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) + #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) +#elif PY_VERSION_HEX >= 0x030a00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#endif + #ifdef WITH_THREAD + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + }\ + PyGILState_Release(state);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #else + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + { PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #endif + #define __Pyx_TraceException()\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 1)) {\ + __Pyx_EnterTracing(tstate);\ + PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ + if (exc_info) {\ + if (CYTHON_TRACE && tstate->c_tracefunc)\ + tstate->c_tracefunc(\ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + tstate->c_profilefunc(\ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + Py_DECREF(exc_info);\ + }\ + __Pyx_LeaveTracing(tstate);\ + }\ + } + static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_EnterTracing(tstate); + if (CYTHON_TRACE && tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); + if (tstate->c_profilefunc) + tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); + CYTHON_FRAME_DEL(frame); + __Pyx_LeaveTracing(tstate); + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } + #ifdef WITH_THREAD + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + PyGILState_Release(state);\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + }\ + } + #else + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + } + #endif + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceFrameInit(codeobj) + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result, nogil) +#endif +#if CYTHON_TRACE + static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { + int ret; + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_PyFrame_SetLineNumber(frame, lineno); + __Pyx_EnterTracing(tstate); + ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); + __Pyx_LeaveTracing(tstate); + if (likely(!ret)) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + } + return ret; + } + #ifdef WITH_THREAD + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + int ret = 0;\ + PyThreadState *tstate;\ + PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + }\ + __Pyx_PyGILState_Release(state);\ + if (unlikely(ret)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + }\ + } + #else + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + } + #endif +#else + #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; +#endif + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* IncludeStringH.proto */ +#include + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); @@ -2348,6 +2586,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__rfc2396(PyObject *__pyx_pyinit_mo #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -2466,6 +2705,7 @@ if (!__Pyx_RefNanny) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif + __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__rfc2396(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); /* "w3lib/_rfc2396.pyx":1 * from ._infra import _ASCII_ALPHANUMERIC # <<<<<<<<<<<<<< @@ -2659,6 +2899,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_TraceReturn(Py_None, 0); /*--- Wrapped vars code ---*/ @@ -2730,6 +2971,155 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { } #endif +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* Profile */ +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + PyThreadState* tstate, + const char *funcname, + const char *srcfile, + int firstlineno) { + PyObject *type, *value, *traceback; + int retval; + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); + retval = 1; + __Pyx_EnterTracing(tstate); + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + #if CYTHON_TRACE + if (tstate->c_tracefunc) + retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; + if (retval && tstate->c_profilefunc) + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + __Pyx_LeaveTracing(tstate); + if (retval) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + return __Pyx_IsTracing(tstate, 0, 0) && retval; + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + return -1; + } +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyCodeObject *py_code = 0; +#if PY_MAJOR_VERSION >= 3 + py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); + if (likely(py_code)) { + py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; + } +#else + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + py_funcname = PyString_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + py_srcfile = PyString_FromString(srcfile); + if (unlikely(!py_srcfile)) goto bad; + py_code = PyCode_New( + 0, + 0, + 0, + CO_OPTIMIZED | CO_NEWLOCALS, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); +#endif + return py_code; +} +#endif + /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { @@ -2888,65 +3278,6 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta } #endif -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *tmp_value; - assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); - if (value) { - #if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) - #endif - PyException_SetTraceback(value, tb); - } - tmp_value = tstate->current_exception; - tstate->current_exception = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject* exc_value; - exc_value = tstate->current_exception; - tstate->current_exception = 0; - *value = exc_value; - *type = NULL; - *tb = NULL; - if (exc_value) { - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - #if CYTHON_COMPILING_IN_CPYTHON - *tb = ((PyBaseExceptionObject*) exc_value)->traceback; - Py_XINCREF(*tb); - #else - *tb = PyException_GetTraceback(exc_value); - #endif - } -#else - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#endif -} -#endif - /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { diff --git a/w3lib/_rfc3986.c b/w3lib/_rfc3986.c index 24c774e2..b86d71f4 100644 --- a/w3lib/_rfc3986.c +++ b/w3lib/_rfc3986.c @@ -1551,30 +1551,6 @@ static const char *__pyx_f[] = { #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) -/* PyObjectGetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* IncludeStringH.proto */ -#include - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; @@ -1618,6 +1594,268 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif +/* Profile.proto */ +#ifndef CYTHON_PROFILE +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + #define CYTHON_PROFILE 0 +#else + #define CYTHON_PROFILE 1 +#endif +#endif +#ifndef CYTHON_TRACE_NOGIL + #define CYTHON_TRACE_NOGIL 0 +#else + #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) + #define CYTHON_TRACE 1 + #endif +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL(frame) + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) + #endif + #define __Pyx_TraceDeclarations\ + static PyCodeObject *__pyx_frame_code = NULL;\ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceFrameInit(codeobj)\ + if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; +#if PY_VERSION_HEX >= 0x030b00a2 + #if PY_VERSION_HEX >= 0x030C00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + ((!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #endif + #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) + #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) +#elif PY_VERSION_HEX >= 0x030a00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#endif + #ifdef WITH_THREAD + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + }\ + PyGILState_Release(state);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #else + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + { PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #endif + #define __Pyx_TraceException()\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 1)) {\ + __Pyx_EnterTracing(tstate);\ + PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ + if (exc_info) {\ + if (CYTHON_TRACE && tstate->c_tracefunc)\ + tstate->c_tracefunc(\ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + tstate->c_profilefunc(\ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + Py_DECREF(exc_info);\ + }\ + __Pyx_LeaveTracing(tstate);\ + }\ + } + static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_EnterTracing(tstate); + if (CYTHON_TRACE && tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); + if (tstate->c_profilefunc) + tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); + CYTHON_FRAME_DEL(frame); + __Pyx_LeaveTracing(tstate); + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } + #ifdef WITH_THREAD + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + PyGILState_Release(state);\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + }\ + } + #else + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + } + #endif + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceFrameInit(codeobj) + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result, nogil) +#endif +#if CYTHON_TRACE + static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { + int ret; + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_PyFrame_SetLineNumber(frame, lineno); + __Pyx_EnterTracing(tstate); + ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); + __Pyx_LeaveTracing(tstate); + if (likely(!ret)) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + } + return ret; + } + #ifdef WITH_THREAD + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + int ret = 0;\ + PyThreadState *tstate;\ + PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + }\ + __Pyx_PyGILState_Release(state);\ + if (unlikely(ret)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + }\ + } + #else + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + } + #endif +#else + #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; +#endif + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* IncludeStringH.proto */ +#include + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); @@ -2333,6 +2571,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__rfc3986(PyObject *__pyx_pyinit_mo #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -2452,6 +2691,7 @@ if (!__Pyx_RefNanny) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif + __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__rfc3986(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); /* "w3lib/_rfc3986.pyx":1 * from ._infra import _ASCII_ALPHANUMERIC # <<<<<<<<<<<<<< @@ -2695,6 +2935,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_TraceReturn(Py_None, 0); /*--- Wrapped vars code ---*/ @@ -2767,6 +3008,155 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { } #endif +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* Profile */ +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + PyThreadState* tstate, + const char *funcname, + const char *srcfile, + int firstlineno) { + PyObject *type, *value, *traceback; + int retval; + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); + retval = 1; + __Pyx_EnterTracing(tstate); + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + #if CYTHON_TRACE + if (tstate->c_tracefunc) + retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; + if (retval && tstate->c_profilefunc) + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + __Pyx_LeaveTracing(tstate); + if (retval) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + return __Pyx_IsTracing(tstate, 0, 0) && retval; + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + return -1; + } +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyCodeObject *py_code = 0; +#if PY_MAJOR_VERSION >= 3 + py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); + if (likely(py_code)) { + py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; + } +#else + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + py_funcname = PyString_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + py_srcfile = PyString_FromString(srcfile); + if (unlikely(!py_srcfile)) goto bad; + py_code = PyCode_New( + 0, + 0, + 0, + CO_OPTIMIZED | CO_NEWLOCALS, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); +#endif + return py_code; +} +#endif + /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { @@ -2925,65 +3315,6 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta } #endif -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *tmp_value; - assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); - if (value) { - #if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) - #endif - PyException_SetTraceback(value, tb); - } - tmp_value = tstate->current_exception; - tstate->current_exception = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject* exc_value; - exc_value = tstate->current_exception; - tstate->current_exception = 0; - *value = exc_value; - *type = NULL; - *tb = NULL; - if (exc_value) { - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - #if CYTHON_COMPILING_IN_CPYTHON - *tb = ((PyBaseExceptionObject*) exc_value)->traceback; - Py_XINCREF(*tb); - #else - *tb = PyException_GetTraceback(exc_value); - #endif - } -#else - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#endif -} -#endif - /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { diff --git a/w3lib/_rfc5892.c b/w3lib/_rfc5892.c index 80b39db5..b923323a 100644 --- a/w3lib/_rfc5892.c +++ b/w3lib/_rfc5892.c @@ -1703,6 +1703,244 @@ 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); +/* Profile.proto */ +#ifndef CYTHON_PROFILE +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + #define CYTHON_PROFILE 0 +#else + #define CYTHON_PROFILE 1 +#endif +#endif +#ifndef CYTHON_TRACE_NOGIL + #define CYTHON_TRACE_NOGIL 0 +#else + #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) + #define CYTHON_TRACE 1 + #endif +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL(frame) + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) + #endif + #define __Pyx_TraceDeclarations\ + static PyCodeObject *__pyx_frame_code = NULL;\ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceFrameInit(codeobj)\ + if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; +#if PY_VERSION_HEX >= 0x030b00a2 + #if PY_VERSION_HEX >= 0x030C00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + ((!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #endif + #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) + #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) +#elif PY_VERSION_HEX >= 0x030a00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#endif + #ifdef WITH_THREAD + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + }\ + PyGILState_Release(state);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #else + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + { PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #endif + #define __Pyx_TraceException()\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 1)) {\ + __Pyx_EnterTracing(tstate);\ + PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ + if (exc_info) {\ + if (CYTHON_TRACE && tstate->c_tracefunc)\ + tstate->c_tracefunc(\ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + tstate->c_profilefunc(\ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + Py_DECREF(exc_info);\ + }\ + __Pyx_LeaveTracing(tstate);\ + }\ + } + static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_EnterTracing(tstate); + if (CYTHON_TRACE && tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); + if (tstate->c_profilefunc) + tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); + CYTHON_FRAME_DEL(frame); + __Pyx_LeaveTracing(tstate); + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } + #ifdef WITH_THREAD + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + PyGILState_Release(state);\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + }\ + } + #else + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + } + #endif + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceFrameInit(codeobj) + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result, nogil) +#endif +#if CYTHON_TRACE + static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { + int ret; + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_PyFrame_SetLineNumber(frame, lineno); + __Pyx_EnterTracing(tstate); + ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); + __Pyx_LeaveTracing(tstate); + if (likely(!ret)) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + } + return ret; + } + #ifdef WITH_THREAD + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + int ret = 0;\ + PyThreadState *tstate;\ + PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + }\ + __Pyx_PyGILState_Release(state);\ + if (unlikely(ret)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + }\ + } + #else + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + } + #endif +#else + #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; +#endif + /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); @@ -2155,8 +2393,8 @@ int __pyx_module_is_main_w3lib___rfc5892 = 0; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_ValueError; /* #### Code section: string_decls ### */ -static const char __pyx_k_[] = "."; static const char __pyx_k_i[] = "i"; +static const char __pyx_k__2[] = "."; static const char __pyx_k__4[] = "?"; static const char __pyx_k_in[] = " in "; static const char __pyx_k_04X[] = "04X"; @@ -2223,12 +2461,12 @@ typedef struct { #endif #if CYTHON_USE_MODULE_STATE #endif - PyObject *__pyx_kp_u_; PyObject *__pyx_kp_u_04X; PyObject *__pyx_n_u_CONTEXTJ; PyObject *__pyx_kp_u_Joiner_U; PyObject *__pyx_n_s_None; PyObject *__pyx_n_s_ValueError; + PyObject *__pyx_kp_u__2; PyObject *__pyx_n_s__4; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_check_contextj_rules; @@ -2261,8 +2499,8 @@ typedef struct { PyObject *__pyx_kp_s_w3lib__rfc5892_pyx; PyObject *__pyx_int_0; PyObject *__pyx_int_1; - PyObject *__pyx_tuple__2; - PyObject *__pyx_codeobj__3; + PyObject *__pyx_codeobj_; + PyObject *__pyx_tuple__3; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -2305,12 +2543,12 @@ static int __pyx_m_clear(PyObject *m) { #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif - Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_kp_u_04X); Py_CLEAR(clear_module_state->__pyx_n_u_CONTEXTJ); Py_CLEAR(clear_module_state->__pyx_kp_u_Joiner_U); Py_CLEAR(clear_module_state->__pyx_n_s_None); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); + Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_n_s__4); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_check_contextj_rules); @@ -2343,8 +2581,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_s_w3lib__rfc5892_pyx); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); - Py_CLEAR(clear_module_state->__pyx_tuple__2); - Py_CLEAR(clear_module_state->__pyx_codeobj__3); + Py_CLEAR(clear_module_state->__pyx_codeobj_); + Py_CLEAR(clear_module_state->__pyx_tuple__3); return 0; } #endif @@ -2365,12 +2603,12 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif - Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_kp_u_04X); Py_VISIT(traverse_module_state->__pyx_n_u_CONTEXTJ); Py_VISIT(traverse_module_state->__pyx_kp_u_Joiner_U); Py_VISIT(traverse_module_state->__pyx_n_s_None); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); + Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_n_s__4); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_check_contextj_rules); @@ -2403,8 +2641,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_s_w3lib__rfc5892_pyx); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); - Py_VISIT(traverse_module_state->__pyx_tuple__2); - Py_VISIT(traverse_module_state->__pyx_codeobj__3); + Py_VISIT(traverse_module_state->__pyx_codeobj_); + Py_VISIT(traverse_module_state->__pyx_tuple__3); return 0; } #endif @@ -2435,12 +2673,12 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #endif #if CYTHON_USE_MODULE_STATE #endif -#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_kp_u_04X __pyx_mstate_global->__pyx_kp_u_04X #define __pyx_n_u_CONTEXTJ __pyx_mstate_global->__pyx_n_u_CONTEXTJ #define __pyx_kp_u_Joiner_U __pyx_mstate_global->__pyx_kp_u_Joiner_U #define __pyx_n_s_None __pyx_mstate_global->__pyx_n_s_None #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError +#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_n_s__4 __pyx_mstate_global->__pyx_n_s__4 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_check_contextj_rules __pyx_mstate_global->__pyx_n_s_check_contextj_rules @@ -2473,8 +2711,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_s_w3lib__rfc5892_pyx __pyx_mstate_global->__pyx_kp_s_w3lib__rfc5892_pyx #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 -#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 -#define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 +#define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_ +#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 /* #### Code section: module_code ### */ /* "w3lib/_rfc5892.pyx":12 @@ -2493,8 +2731,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_8_rfc5892__check_contextj_rules, "_check_contextj_rules(unicode label: str) -> None"); -static PyMethodDef __pyx_mdef_5w3lib_8_rfc5892_1_check_contextj_rules = {"_check_contextj_rules", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_8_rfc5892_1_check_contextj_rules, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_8_rfc5892__check_contextj_rules}; +static PyMethodDef __pyx_mdef_5w3lib_8_rfc5892_1_check_contextj_rules = {"_check_contextj_rules", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_8_rfc5892_1_check_contextj_rules, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_8_rfc5892_1_check_contextj_rules(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -2592,6 +2829,7 @@ static PyObject *__pyx_pf_5w3lib_8_rfc5892__check_contextj_rules(CYTHON_UNUSED P PyObject *__pyx_v_code_point = NULL; long __pyx_v_value; PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; @@ -2614,7 +2852,9 @@ static PyObject *__pyx_pf_5w3lib_8_rfc5892__check_contextj_rules(CYTHON_UNUSED P int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj_) __Pyx_RefNannySetupContext("_check_contextj_rules", 1); + __Pyx_TraceCall("_check_contextj_rules", __pyx_f[0], 12, 0, __PYX_ERR(0, 12, __pyx_L1_error)); /* "w3lib/_rfc5892.pyx":13 * @@ -2909,6 +3149,7 @@ static PyObject *__pyx_pf_5w3lib_8_rfc5892__check_contextj_rules(CYTHON_UNUSED P __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_code_point); __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -2929,12 +3170,12 @@ static PyMethodDef __pyx_methods[] = { static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_kp_u_04X, __pyx_k_04X, sizeof(__pyx_k_04X), 0, 1, 0, 0}, {&__pyx_n_u_CONTEXTJ, __pyx_k_CONTEXTJ, sizeof(__pyx_k_CONTEXTJ), 0, 1, 0, 1}, {&__pyx_kp_u_Joiner_U, __pyx_k_Joiner_U, sizeof(__pyx_k_Joiner_U), 0, 1, 0, 0}, {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_n_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_check_contextj_rules, __pyx_k_check_contextj_rules, sizeof(__pyx_k_check_contextj_rules), 0, 0, 1, 1}, @@ -2990,10 +3231,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * if label.isascii(): * return */ - __pyx_tuple__2 = PyTuple_Pack(4, __pyx_n_s_label, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_value); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__rfc5892_pyx, __pyx_n_s_check_contextj_rules, 12, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_label, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_value); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__rfc5892_pyx, __pyx_n_s_check_contextj_rules, 12, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -3244,6 +3485,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__rfc5892(PyObject *__pyx_pyinit_mo #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -3362,6 +3604,7 @@ if (!__Pyx_RefNanny) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif + __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__rfc5892(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); /* "w3lib/_rfc5892.pyx":3 * # https://www.rfc-editor.org/rfc/rfc5892.txt @@ -3469,7 +3712,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 12, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 12, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_8_rfc5892_1_check_contextj_rules, 0, __pyx_n_s_check_contextj_rules, NULL, __pyx_n_s_w3lib__rfc5892, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_8_rfc5892_1_check_contextj_rules, 0, __pyx_n_s_check_contextj_rules, NULL, __pyx_n_s_w3lib__rfc5892, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -3485,6 +3728,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_TraceReturn(Py_None, 0); /*--- Wrapped vars code ---*/ @@ -4163,6 +4407,96 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam return 0; } +/* Profile */ +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + PyThreadState* tstate, + const char *funcname, + const char *srcfile, + int firstlineno) { + PyObject *type, *value, *traceback; + int retval; + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); + retval = 1; + __Pyx_EnterTracing(tstate); + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + #if CYTHON_TRACE + if (tstate->c_tracefunc) + retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; + if (retval && tstate->c_profilefunc) + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + __Pyx_LeaveTracing(tstate); + if (retval) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + return __Pyx_IsTracing(tstate, 0, 0) && retval; + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + return -1; + } +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyCodeObject *py_code = 0; +#if PY_MAJOR_VERSION >= 3 + py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); + if (likely(py_code)) { + py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; + } +#else + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + py_funcname = PyString_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + py_srcfile = PyString_FromString(srcfile); + if (unlikely(!py_srcfile)) goto bad; + py_code = PyCode_New( + 0, + 0, + 0, + CO_OPTIMIZED | CO_NEWLOCALS, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); +#endif + return py_code; +} +#endif + /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { @@ -5307,7 +5641,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } diff --git a/w3lib/_types.c b/w3lib/_types.c index 36dad1b6..d997ceca 100644 --- a/w3lib/_types.c +++ b/w3lib/_types.c @@ -1615,6 +1615,244 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); +/* Profile.proto */ +#ifndef CYTHON_PROFILE +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + #define CYTHON_PROFILE 0 +#else + #define CYTHON_PROFILE 1 +#endif +#endif +#ifndef CYTHON_TRACE_NOGIL + #define CYTHON_TRACE_NOGIL 0 +#else + #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) + #define CYTHON_TRACE 1 + #endif +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL(frame) + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) + #endif + #define __Pyx_TraceDeclarations\ + static PyCodeObject *__pyx_frame_code = NULL;\ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceFrameInit(codeobj)\ + if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; +#if PY_VERSION_HEX >= 0x030b00a2 + #if PY_VERSION_HEX >= 0x030C00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + ((!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #endif + #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) + #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) +#elif PY_VERSION_HEX >= 0x030a00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#endif + #ifdef WITH_THREAD + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + }\ + PyGILState_Release(state);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #else + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + { PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #endif + #define __Pyx_TraceException()\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 1)) {\ + __Pyx_EnterTracing(tstate);\ + PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ + if (exc_info) {\ + if (CYTHON_TRACE && tstate->c_tracefunc)\ + tstate->c_tracefunc(\ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + tstate->c_profilefunc(\ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + Py_DECREF(exc_info);\ + }\ + __Pyx_LeaveTracing(tstate);\ + }\ + } + static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_EnterTracing(tstate); + if (CYTHON_TRACE && tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); + if (tstate->c_profilefunc) + tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); + CYTHON_FRAME_DEL(frame); + __Pyx_LeaveTracing(tstate); + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } + #ifdef WITH_THREAD + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + PyGILState_Release(state);\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + }\ + } + #else + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + } + #endif + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceFrameInit(codeobj) + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result, nogil) +#endif +#if CYTHON_TRACE + static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { + int ret; + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_PyFrame_SetLineNumber(frame, lineno); + __Pyx_EnterTracing(tstate); + ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); + __Pyx_LeaveTracing(tstate); + if (likely(!ret)) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + } + return ret; + } + #ifdef WITH_THREAD + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + int ret = 0;\ + PyThreadState *tstate;\ + PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + }\ + __Pyx_PyGILState_Release(state);\ + if (unlikely(ret)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + }\ + } + #else + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + } + #endif +#else + #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; +#endif + /* IncludeStringH.proto */ #include @@ -2348,6 +2586,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__types(PyObject *__pyx_pyinit_modu #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -2466,6 +2705,7 @@ if (!__Pyx_RefNanny) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif + __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__types(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); /* "w3lib/_types.pyx":1 * from typing import Union # <<<<<<<<<<<<<< @@ -2531,6 +2771,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_TraceReturn(Py_None, 0); /*--- Wrapped vars code ---*/ @@ -2761,6 +3002,96 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { return result; } +/* Profile */ +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + PyThreadState* tstate, + const char *funcname, + const char *srcfile, + int firstlineno) { + PyObject *type, *value, *traceback; + int retval; + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); + retval = 1; + __Pyx_EnterTracing(tstate); + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + #if CYTHON_TRACE + if (tstate->c_tracefunc) + retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; + if (retval && tstate->c_profilefunc) + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + __Pyx_LeaveTracing(tstate); + if (retval) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + return __Pyx_IsTracing(tstate, 0, 0) && retval; + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + return -1; + } +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyCodeObject *py_code = 0; +#if PY_MAJOR_VERSION >= 3 + py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); + if (likely(py_code)) { + py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; + } +#else + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + py_funcname = PyString_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + py_srcfile = PyString_FromString(srcfile); + if (unlikely(!py_srcfile)) goto bad; + py_code = PyCode_New( + 0, + 0, + 0, + CO_OPTIMIZED | CO_NEWLOCALS, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); +#endif + return py_code; +} +#endif + /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; diff --git a/w3lib/_url.c b/w3lib/_url.c index 2b1ffa7b..3fc237f9 100644 --- a/w3lib/_url.c +++ b/w3lib/_url.c @@ -1,5 +1,17 @@ /* Generated by Cython 3.0.8 */ +/* BEGIN: Cython Metadata +{ + "distutils": { + "name": "w3lib._url", + "sources": [ + "w3lib/_url.pyx" + ] + }, + "module_name": "w3lib._url" +} +END: Cython Metadata */ + #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ @@ -1479,7 +1491,7 @@ struct __pyx_defaults1 { PyObject *__pyx_arg_min_length; }; -/* "w3lib/_url.pyx":757 +/* "w3lib/_url.pyx":822 * parts = parts[:-1] * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< @@ -1493,7 +1505,7 @@ struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr { }; -/* "w3lib/_url.pyx":777 +/* "w3lib/_url.pyx":842 * result = _parse_ipv4_number(part) * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< @@ -2639,7 +2651,6 @@ static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_chr; static PyObject *__pyx_builtin_AssertionError; -static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_enumerate; /* #### Code section: string_decls ### */ static const char __pyx_k_c[] = "c"; @@ -2694,8 +2705,14 @@ static const char __pyx_k__83[] = " \"#<>"; static const char __pyx_k__84[] = "'"; static const char __pyx_k__85[] = "?`{}"; static const char __pyx_k__86[] = "/:;=@[\\]^|"; -static const char __pyx_k__87[] = "\000\t\n\r #/:<>?@[\\]^|"; -static const char __pyx_k__88[] = "%"; +static const char __pyx_k__87[] = ":/?#[]@"; +static const char __pyx_k__88[] = "!$&'()*+,;="; +static const char __pyx_k__89[] = "-._~"; +static const char __pyx_k__91[] = "|"; +static const char __pyx_k__94[] = ":;="; +static const char __pyx_k__95[] = "#[]|"; +static const char __pyx_k__96[] = "\000\t\n\r #/:<>?@[\\]^|"; +static const char __pyx_k__97[] = "%"; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_ftp[] = "ftp"; @@ -2784,6 +2801,8 @@ static const char __pyx_k_codecs[] = "codecs"; static const char __pyx_k_cp1252[] = "cp1252"; static const char __pyx_k_cp1254[] = "cp1254"; static const char __pyx_k_csbig5[] = "csbig5"; +static const char __pyx_k_delete[] = "delete"; +static const char __pyx_k_digits[] = "digits"; static const char __pyx_k_domain[] = "domain"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_encode[] = "encode"; @@ -2813,6 +2832,7 @@ static const char __pyx_k_result[] = "result"; static const char __pyx_k_return[] = "return"; static const char __pyx_k_scheme[] = "_scheme"; static const char __pyx_k_setter[] = "setter"; +static const char __pyx_k_string[] = "string"; static const char __pyx_k_typing[] = "typing"; static const char __pyx_k_utf_16[] = "utf-16"; static const char __pyx_k_visual[] = "visual"; @@ -2838,6 +2858,9 @@ static const char __pyx_k_maxsize[] = "maxsize"; static const char __pyx_k_numbers[] = "numbers"; static const char __pyx_k_pointer[] = "pointer"; static const char __pyx_k_prepare[] = "__prepare__"; +static const char __pyx_k_replace[] = "replace"; +static const char __pyx_k_rfc2396[] = "_rfc2396"; +static const char __pyx_k_rfc3986[] = "_rfc3986"; static const char __pyx_k_segment[] = "segment"; static const char __pyx_k_tis_620[] = "tis-620"; static const char __pyx_k_unicode[] = "unicode"; @@ -2875,6 +2898,7 @@ static const char __pyx_k_ms_kanji[] = "ms_kanji"; static const char __pyx_k_password[] = "password"; static const char __pyx_k_property[] = "property"; static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_safe_url[] = "_safe_url"; static const char __pyx_k_scheme_2[] = "scheme"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_to_ascii[] = "_to_ascii"; @@ -2915,7 +2939,6 @@ static const char __pyx_k_separator[] = "separator"; static const char __pyx_k_shift_jis[] = "shift-jis"; static const char __pyx_k_translate[] = "translate"; static const char __pyx_k_C0_CONTROL[] = "_C0_CONTROL"; -static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_URL___init[] = "_URL.__init__"; static const char __pyx_k_URL_scheme[] = "_URL.scheme"; static const char __pyx_k_ValueError[] = "ValueError"; @@ -2959,6 +2982,7 @@ static const char __pyx_k_min_length[] = "min_length"; static const char __pyx_k_parse_host[] = "_parse_host"; static const char __pyx_k_parse_ipv4[] = "_parse_ipv4"; static const char __pyx_k_parse_ipv6[] = "_parse_ipv6"; +static const char __pyx_k_safe_chars[] = "_safe_chars"; static const char __pyx_k_w3lib__url[] = "w3lib._url"; static const char __pyx_k_ASCII_ALPHA[] = "_ASCII_ALPHA"; static const char __pyx_k_ASCII_DIGIT[] = "_ASCII_DIGIT"; @@ -2989,6 +3013,7 @@ static const char __pyx_k_iso_8859_14[] = "iso-8859-14"; static const char __pyx_k_iso_8859_15[] = "iso-8859-15"; static const char __pyx_k_iso_8859_16[] = "iso-8859-16"; static const char __pyx_k_piece_index[] = "piece_index"; +static const char __pyx_k_reached_end[] = "reached_end"; static const char __pyx_k_replacement[] = "replacement"; static const char __pyx_k_shift_jis_2[] = "shift_jis"; static const char __pyx_k_unicodefeff[] = "unicodefeff"; @@ -3009,7 +3034,6 @@ static const char __pyx_k_get_encoding[] = "_get_encoding"; static const char __pyx_k_greater_than[] = "greater_than"; static const char __pyx_k_index_length[] = "index_length"; static const char __pyx_k_initializing[] = "_initializing"; -static const char __pyx_k_input_lenght[] = "input_lenght"; static const char __pyx_k_input_length[] = "input_length"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_iso_8859_1_2[] = "iso_8859-1"; @@ -3036,6 +3060,7 @@ static const char __pyx_k_CodecFunction[] = "CodecFunction"; static const char __pyx_k_DEFAULT_PORTS[] = "_DEFAULT_PORTS"; static const char __pyx_k_Optional_bool[] = "Optional[bool]"; static const char __pyx_k_UTF_8_ENCODER[] = "_UTF_8_ENCODER"; +static const char __pyx_k_ascii_letters[] = "ascii_letters"; static const char __pyx_k_at_sign_index[] = "at_sign_index"; static const char __pyx_k_check_hyphens[] = "check_hyphens"; static const char __pyx_k_check_joiners[] = "check_joiners"; @@ -3059,6 +3084,7 @@ static const char __pyx_k_current_length[] = "current_length"; static const char __pyx_k_ends_in_number[] = "_ends_in_number"; static const char __pyx_k_ks_c_5601_1987[] = "ks_c_5601-1987"; static const char __pyx_k_ks_c_5601_1989[] = "ks_c_5601-1989"; +static const char __pyx_k_preprocess_url[] = "_preprocess_url"; static const char __pyx_k_serialize_host[] = "_serialize_host"; static const char __pyx_k_serialize_ipv4[] = "_serialize_ipv4"; static const char __pyx_k_serialize_ipv6[] = "_serialize_ipv6"; @@ -3084,16 +3110,20 @@ static const char __pyx_k_iso_8859_6_1987[] = "iso_8859-6:1987"; static const char __pyx_k_iso_8859_7_1987[] = "iso_8859-7:1987"; static const char __pyx_k_iso_8859_8_1988[] = "iso_8859-8:1988"; static const char __pyx_k_iso_8859_9_1989[] = "iso_8859-9:1989"; +static const char __pyx_k_path_safe_chars[] = "_path_safe_chars"; static const char __pyx_k_path_token_seen[] = "_path_token_seen"; static const char __pyx_k_port_token_seen[] = "_port_token_seen"; static const char __pyx_k_x_mac_ukrainian[] = "x-mac-ukrainian"; static const char __pyx_k_x_unicode20utf8[] = "x-unicode20utf8"; static const char __pyx_k_ASCII_WHITESPACE[] = "_ASCII_WHITESPACE"; +static const char __pyx_k_EXTRA_SAFE_CHARS[] = "EXTRA_SAFE_CHARS"; static const char __pyx_k_PercentEncodeSet[] = "_PercentEncodeSet"; +static const char __pyx_k_RFC3986_RESERVED[] = "RFC3986_RESERVED"; static const char __pyx_k_csisolatinarabic[] = "csisolatinarabic"; static const char __pyx_k_csisolatinhebrew[] = "csisolatinhebrew"; static const char __pyx_k_exclude_fragment[] = "exclude_fragment"; static const char __pyx_k_validation_error[] = "validation_error"; +static const char __pyx_k_PATH_SAFEST_CHARS[] = "_PATH_SAFEST_CHARS"; static const char __pyx_k_UTF_16BE_ENCODING[] = "_UTF_16BE_ENCODING"; static const char __pyx_k_UTF_16LE_ENCODING[] = "_UTF_16LE_ENCODING"; static const char __pyx_k_default_port_seen[] = "_default_port_seen"; @@ -3104,6 +3134,10 @@ static const char __pyx_k_unicode_1_1_utf_8[] = "unicode-1-1-utf-8"; static const char __pyx_k_verify_dns_length[] = "verify_dns_length"; static const char __pyx_k_xmlcharrefreplace[] = "xmlcharrefreplace"; static const char __pyx_k_ASCII_ALPHANUMERIC[] = "_ASCII_ALPHANUMERIC"; +static const char __pyx_k_QUERY_SAFEST_CHARS[] = "_QUERY_SAFEST_CHARS"; +static const char __pyx_k_RFC3986_GEN_DELIMS[] = "RFC3986_GEN_DELIMS"; +static const char __pyx_k_RFC3986_SUB_DELIMS[] = "RFC3986_SUB_DELIMS"; +static const char __pyx_k_RFC3986_UNRESERVED[] = "RFC3986_UNRESERVED"; static const char __pyx_k_Union_str_List_str[] = "Union[str, List[str]]"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; @@ -3119,6 +3153,8 @@ static const char __pyx_k_ASCII_TAB_OR_NEWLINE[] = "_ASCII_TAB_OR_NEWLINE"; static const char __pyx_k_REPLACEMENT_ENCODING[] = "_REPLACEMENT_ENCODING"; static const char __pyx_k_use_std3_ascii_rules[] = "use_std3_ascii_rules"; static const char __pyx_k_utf_8_percent_encode[] = "_utf_8_percent_encode"; +static const char __pyx_k_FRAGMENT_SAFEST_CHARS[] = "_FRAGMENT_SAFEST_CHARS"; +static const char __pyx_k_USERINFO_SAFEST_CHARS[] = "_USERINFO_SAFEST_CHARS"; static const char __pyx_k_Union_int_List_int_str[] = "Union[int, List[int], str]"; static const char __pyx_k_Union_str_int_List_int[] = "Union[str, int, List[int]]"; static const char __pyx_k_PATH_PERCENT_ENCODE_SET[] = "_PATH_PERCENT_ENCODE_SET"; @@ -3130,19 +3166,34 @@ static const char __pyx_k_QUERY_PERCENT_ENCODE_SET[] = "_QUERY_PERCENT_ENCODE_SE static const char __pyx_k_query_percent_encode_set[] = "query_percent_encode_set"; static const char __pyx_k_parse_ipv4_locals_genexpr[] = "_parse_ipv4..genexpr"; static const char __pyx_k_FORBIDDEN_HOST_CODE_POINTS[] = "_FORBIDDEN_HOST_CODE_POINTS"; +static const char __pyx_k_SPECIAL_QUERY_SAFEST_CHARS[] = "_SPECIAL_QUERY_SAFEST_CHARS"; static const char __pyx_k_is_double_dot_path_segment[] = "_is_double_dot_path_segment"; static const char __pyx_k_is_single_dot_path_segment[] = "_is_single_dot_path_segment"; static const char __pyx_k_FRAGMENT_PERCENT_ENCODE_SET[] = "_FRAGMENT_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC3986_USERINFO_SAFE_CHARS[] = "RFC3986_USERINFO_SAFE_CHARS"; static const char __pyx_k_USERINFO_PERCENT_ENCODE_SET[] = "_USERINFO_PERCENT_ENCODE_SET"; static const char __pyx_k_fragment_percent_encode_set[] = "fragment_percent_encode_set"; static const char __pyx_k_userinfo_percent_encode_set[] = "userinfo_percent_encode_set"; static const char __pyx_k_FORBIDDEN_DOMAIN_CODE_POINTS[] = "_FORBIDDEN_DOMAIN_CODE_POINTS"; +static const char __pyx_k_SAFE_PATH_PERCENT_ENCODE_SET[] = "_SAFE_PATH_PERCENT_ENCODE_SET"; static const char __pyx_k_C0_CONTROL_PERCENT_ENCODE_SET[] = "_C0_CONTROL_PERCENT_ENCODE_SET"; +static const char __pyx_k_SAFE_QUERY_PERCENT_ENCODE_SET[] = "_SAFE_QUERY_PERCENT_ENCODE_SET"; static const char __pyx_k_ends_in_number_locals_genexpr[] = "_ends_in_number..genexpr"; static const char __pyx_k_percent_encode_after_encoding[] = "_percent_encode_after_encoding"; static const char __pyx_k_OUTPUT_ENCODING_UTF8_ENCODINGS[] = "_OUTPUT_ENCODING_UTF8_ENCODINGS"; static const char __pyx_k_get_ipv6_first_longest_0_piece[] = "_get_ipv6_first_longest_0_piece_index"; static const char __pyx_k_ASCII_TAB_OR_NEWLINE_TRANSLATIO[] = "_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE"; +static const char __pyx_k_RFC2396_ABS_PATH_PERCENT_ENCODE[] = "_RFC2396_ABS_PATH_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC2396_FRAGMENT_PERCENT_ENCODE[] = "_RFC2396_FRAGMENT_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC2396_QUERY_PERCENT_ENCODE_SE[] = "_RFC2396_QUERY_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC2396_USERINFO_PERCENT_ENCODE[] = "_RFC2396_USERINFO_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC3986_FRAGMENT_PERCENT_ENCODE[] = "_RFC3986_FRAGMENT_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC3986_PATH_PERCENT_ENCODE_SET[] = "_RFC3986_PATH_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC3986_QUERY_PERCENT_ENCODE_SE[] = "_RFC3986_QUERY_PERCENT_ENCODE_SET"; +static const char __pyx_k_RFC3986_USERINFO_PERCENT_ENCODE[] = "_RFC3986_USERINFO_PERCENT_ENCODE_SET"; +static const char __pyx_k_SAFE_FRAGMENT_PERCENT_ENCODE_SE[] = "_SAFE_FRAGMENT_PERCENT_ENCODE_SET"; +static const char __pyx_k_SAFE_SPECIAL_QUERY_PERCENT_ENCO[] = "_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET"; +static const char __pyx_k_SAFE_USERINFO_PERCENT_ENCODE_SE[] = "_SAFE_USERINFO_PERCENT_ENCODE_SET"; static const char __pyx_k_SPECIAL_QUERY_PERCENT_ENCODE_SE[] = "_SPECIAL_QUERY_PERCENT_ENCODE_SET"; static const char __pyx_k_does_not_match_any_encoding_lab[] = " does not match any encoding label from the Encoding Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)"; static const char __pyx_k_idempotent_utf_8_percent_encode[] = "_idempotent_utf_8_percent_encode"; @@ -3174,19 +3225,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHO static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_50__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_base_url, PyObject *__pyx_v_encoding, PyObject *__pyx_v_userinfo_percent_encode_set, PyObject *__pyx_v_path_percent_encode_set, PyObject *__pyx_v_query_percent_encode_set, PyObject *__pyx_v_special_query_percent_encode_set, PyObject *__pyx_v_fragment_percent_encode_set); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_canonicalize); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_exclude_fragment, PyObject *__pyx_v_canonicalize); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_36_preprocess_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_base_url, PyObject *__pyx_v_encoding, PyObject *__pyx_v_userinfo_percent_encode_set, PyObject *__pyx_v_path_percent_encode_set, PyObject *__pyx_v_query_percent_encode_set, PyObject *__pyx_v_special_query_percent_encode_set, PyObject *__pyx_v_fragment_percent_encode_set); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_canonicalize); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_exclude_fragment, PyObject *__pyx_v_canonicalize); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_52_safe_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding); /* proto */ static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_strip = {0, 0, 0, 0, 0}; -static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_translate = {0, 0, 0, 0, 0}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { @@ -3255,11 +3307,12 @@ typedef struct { PyObject *__pyx_n_s_Dict; PyObject *__pyx_kp_s_Dict_str_str; PyObject *__pyx_kp_u_Domain_name; + PyObject *__pyx_n_s_EXTRA_SAFE_CHARS; PyObject *__pyx_n_s_EncodeFunction; PyObject *__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS; PyObject *__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS; PyObject *__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET; - PyObject *__pyx_n_s_IndexError; + PyObject *__pyx_n_s_FRAGMENT_SAFEST_CHARS; PyObject *__pyx_n_s_KeyError; PyObject *__pyx_n_s_LABEL_ENCODINGS; PyObject *__pyx_n_s_List; @@ -3271,11 +3324,32 @@ typedef struct { PyObject *__pyx_kp_s_Optional_int; PyObject *__pyx_kp_s_Optional_str; PyObject *__pyx_n_s_PATH_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_PATH_SAFEST_CHARS; PyObject *__pyx_n_s_PercentEncodeSet; PyObject *__pyx_n_s_QUERY_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_QUERY_SAFEST_CHARS; PyObject *__pyx_n_s_REPLACEMENT_ENCODING; + PyObject *__pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE; + PyObject *__pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE; + PyObject *__pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE; + PyObject *__pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE; + PyObject *__pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE; + PyObject *__pyx_n_s_RFC3986_GEN_DELIMS; + PyObject *__pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE; + PyObject *__pyx_n_s_RFC3986_RESERVED; + PyObject *__pyx_n_s_RFC3986_SUB_DELIMS; + PyObject *__pyx_n_s_RFC3986_UNRESERVED; + PyObject *__pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE; + PyObject *__pyx_n_s_RFC3986_USERINFO_SAFE_CHARS; + PyObject *__pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE; + PyObject *__pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO; + PyObject *__pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE; PyObject *__pyx_n_s_SCHEME_CHARS; PyObject *__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE; + PyObject *__pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS; PyObject *__pyx_n_s_SPECIAL_SCHEMES; PyObject *__pyx_n_s_Tuple; PyObject *__pyx_kp_s_Tuple_int_bool; @@ -3284,6 +3358,7 @@ typedef struct { PyObject *__pyx_n_s_URL_has_opaque_path; PyObject *__pyx_n_s_URL_scheme; PyObject *__pyx_n_s_USERINFO_PERCENT_ENCODE_SET; + PyObject *__pyx_n_s_USERINFO_SAFEST_CHARS; PyObject *__pyx_n_s_UTF_16BE_ENCODING; PyObject *__pyx_n_s_UTF_16LE_ENCODING; PyObject *__pyx_n_s_UTF_8_ENCODER; @@ -3295,6 +3370,7 @@ typedef struct { PyObject *__pyx_n_s_ValueError; PyObject *__pyx_kp_u__10; PyObject *__pyx_kp_u__11; + PyObject *__pyx_kp_b__12; PyObject *__pyx_kp_u__12; PyObject *__pyx_kp_u__13; PyObject *__pyx_n_s__14; @@ -3305,13 +3381,16 @@ typedef struct { PyObject *__pyx_kp_u__18; PyObject *__pyx_kp_u__19; PyObject *__pyx_n_s__2; + PyObject *__pyx_kp_b__2; PyObject *__pyx_kp_u__2; PyObject *__pyx_kp_u__21; PyObject *__pyx_kp_u__22; PyObject *__pyx_kp_u__23; PyObject *__pyx_n_s__24; PyObject *__pyx_kp_u__3; + PyObject *__pyx_kp_b__4; PyObject *__pyx_kp_u__4; + PyObject *__pyx_kp_b__5; PyObject *__pyx_kp_u__5; PyObject *__pyx_kp_u__6; PyObject *__pyx_kp_u__75; @@ -3320,12 +3399,19 @@ typedef struct { PyObject *__pyx_kp_u__81; PyObject *__pyx_kp_u__82; PyObject *__pyx_kp_u__83; + PyObject *__pyx_kp_b__84; PyObject *__pyx_kp_u__84; PyObject *__pyx_kp_u__85; PyObject *__pyx_kp_u__86; - PyObject *__pyx_kp_u__87; - PyObject *__pyx_kp_u__88; + PyObject *__pyx_kp_b__87; + PyObject *__pyx_kp_b__88; + PyObject *__pyx_kp_u__89; PyObject *__pyx_kp_u__9; + PyObject *__pyx_kp_b__91; + PyObject *__pyx_kp_b__94; + PyObject *__pyx_kp_b__95; + PyObject *__pyx_kp_u__96; + PyObject *__pyx_kp_u__97; PyObject *__pyx_n_s_address; PyObject *__pyx_n_s_annotations; PyObject *__pyx_kp_u_ansi_x3_4_1968; @@ -3334,6 +3420,7 @@ typedef struct { PyObject *__pyx_n_s_args; PyObject *__pyx_n_u_ascii; PyObject *__pyx_n_s_ascii_domain; + PyObject *__pyx_n_s_ascii_letters; PyObject *__pyx_kp_u_asmo_708; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_at_sign_index; @@ -3400,7 +3487,9 @@ typedef struct { PyObject *__pyx_n_s_current_length; PyObject *__pyx_n_u_cyrillic; PyObject *__pyx_n_s_default_port_seen; + PyObject *__pyx_n_s_delete; PyObject *__pyx_n_s_dict; + PyObject *__pyx_n_s_digits; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_doc; PyObject *__pyx_kp_u_does_not_match_any_encoding_lab; @@ -3464,7 +3553,6 @@ typedef struct { PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_input; - PyObject *__pyx_n_s_input_lenght; PyObject *__pyx_n_s_input_length; PyObject *__pyx_n_s_inside_brackets; PyObject *__pyx_n_s_int; @@ -3625,6 +3713,7 @@ typedef struct { PyObject *__pyx_n_s_password_token_seen; PyObject *__pyx_n_s_path; PyObject *__pyx_n_s_path_percent_encode_set; + PyObject *__pyx_n_s_path_safe_chars; PyObject *__pyx_n_s_path_token_seen; PyObject *__pyx_n_s_percent_encode_after_encoding; PyObject *__pyx_n_s_percent_encode_set; @@ -3634,15 +3723,22 @@ typedef struct { PyObject *__pyx_n_s_port; PyObject *__pyx_n_s_port_token_seen; PyObject *__pyx_n_s_prepare; + PyObject *__pyx_n_s_preprocess_url; PyObject *__pyx_n_s_property; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_query; PyObject *__pyx_n_s_query_percent_encode_set; PyObject *__pyx_n_s_r; PyObject *__pyx_n_s_range; + PyObject *__pyx_n_s_reached_end; + PyObject *__pyx_n_s_replace; PyObject *__pyx_n_u_replacement; PyObject *__pyx_n_s_result; PyObject *__pyx_n_s_return; + PyObject *__pyx_n_s_rfc2396; + PyObject *__pyx_n_s_rfc3986; + PyObject *__pyx_n_s_safe_chars; + PyObject *__pyx_n_s_safe_url; PyObject *__pyx_n_s_scheme; PyObject *__pyx_n_s_scheme_2; PyObject *__pyx_n_s_segment; @@ -3668,6 +3764,7 @@ typedef struct { PyObject *__pyx_n_s_starts_with_windows_drive_lette; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_str; + PyObject *__pyx_n_s_string; PyObject *__pyx_n_s_strip; PyObject *__pyx_n_u_sun_eu_greek; PyObject *__pyx_n_s_super; @@ -3796,24 +3893,29 @@ typedef struct { PyObject *__pyx_tuple__73; PyObject *__pyx_tuple__76; PyObject *__pyx_tuple__79; - PyObject *__pyx_tuple__89; - PyObject *__pyx_tuple__91; + PyObject *__pyx_tuple__90; + PyObject *__pyx_tuple__92; PyObject *__pyx_tuple__93; - PyObject *__pyx_tuple__95; - PyObject *__pyx_tuple__97; - PyObject *__pyx_tuple__99; - PyObject *__pyx_tuple__101; - PyObject *__pyx_tuple__103; - PyObject *__pyx_tuple__105; - PyObject *__pyx_tuple__107; - PyObject *__pyx_tuple__111; - PyObject *__pyx_tuple__113; - PyObject *__pyx_tuple__115; - PyObject *__pyx_tuple__117; - PyObject *__pyx_tuple__119; - PyObject *__pyx_tuple__121; - PyObject *__pyx_tuple__123; - PyObject *__pyx_tuple__125; + PyObject *__pyx_tuple__98; + PyObject *__pyx_tuple__100; + PyObject *__pyx_tuple__102; + PyObject *__pyx_tuple__104; + PyObject *__pyx_tuple__106; + PyObject *__pyx_tuple__108; + PyObject *__pyx_tuple__110; + PyObject *__pyx_tuple__112; + PyObject *__pyx_tuple__114; + PyObject *__pyx_tuple__116; + PyObject *__pyx_tuple__120; + PyObject *__pyx_tuple__122; + PyObject *__pyx_tuple__124; + PyObject *__pyx_tuple__126; + PyObject *__pyx_tuple__128; + PyObject *__pyx_tuple__130; + PyObject *__pyx_tuple__132; + PyObject *__pyx_tuple__134; + PyObject *__pyx_tuple__136; + PyObject *__pyx_tuple__138; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__65; PyObject *__pyx_codeobj__68; @@ -3823,26 +3925,28 @@ typedef struct { PyObject *__pyx_codeobj__74; PyObject *__pyx_codeobj__77; PyObject *__pyx_codeobj__80; - PyObject *__pyx_codeobj__90; - PyObject *__pyx_codeobj__92; - PyObject *__pyx_codeobj__94; - PyObject *__pyx_codeobj__96; - PyObject *__pyx_codeobj__98; - PyObject *__pyx_codeobj__100; - PyObject *__pyx_codeobj__102; - PyObject *__pyx_codeobj__104; - PyObject *__pyx_codeobj__106; - PyObject *__pyx_codeobj__108; + PyObject *__pyx_codeobj__99; + PyObject *__pyx_codeobj__101; + PyObject *__pyx_codeobj__103; + PyObject *__pyx_codeobj__105; + PyObject *__pyx_codeobj__107; PyObject *__pyx_codeobj__109; - PyObject *__pyx_codeobj__110; - PyObject *__pyx_codeobj__112; - PyObject *__pyx_codeobj__114; - PyObject *__pyx_codeobj__116; + PyObject *__pyx_codeobj__111; + PyObject *__pyx_codeobj__113; + PyObject *__pyx_codeobj__115; + PyObject *__pyx_codeobj__117; PyObject *__pyx_codeobj__118; - PyObject *__pyx_codeobj__120; - PyObject *__pyx_codeobj__122; - PyObject *__pyx_codeobj__124; - PyObject *__pyx_codeobj__126; + PyObject *__pyx_codeobj__119; + PyObject *__pyx_codeobj__121; + PyObject *__pyx_codeobj__123; + PyObject *__pyx_codeobj__125; + PyObject *__pyx_codeobj__127; + PyObject *__pyx_codeobj__129; + PyObject *__pyx_codeobj__131; + PyObject *__pyx_codeobj__133; + PyObject *__pyx_codeobj__135; + PyObject *__pyx_codeobj__137; + PyObject *__pyx_codeobj__139; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -3924,11 +4028,12 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Dict); Py_CLEAR(clear_module_state->__pyx_kp_s_Dict_str_str); Py_CLEAR(clear_module_state->__pyx_kp_u_Domain_name); + Py_CLEAR(clear_module_state->__pyx_n_s_EXTRA_SAFE_CHARS); Py_CLEAR(clear_module_state->__pyx_n_s_EncodeFunction); Py_CLEAR(clear_module_state->__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); Py_CLEAR(clear_module_state->__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); Py_CLEAR(clear_module_state->__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); - Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); + Py_CLEAR(clear_module_state->__pyx_n_s_FRAGMENT_SAFEST_CHARS); Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); Py_CLEAR(clear_module_state->__pyx_n_s_LABEL_ENCODINGS); Py_CLEAR(clear_module_state->__pyx_n_s_List); @@ -3940,11 +4045,32 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_int); Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_str); Py_CLEAR(clear_module_state->__pyx_n_s_PATH_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_PATH_SAFEST_CHARS); Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet); Py_CLEAR(clear_module_state->__pyx_n_s_QUERY_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_QUERY_SAFEST_CHARS); Py_CLEAR(clear_module_state->__pyx_n_s_REPLACEMENT_ENCODING); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_GEN_DELIMS); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_RESERVED); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_SUB_DELIMS); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_UNRESERVED); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); + Py_CLEAR(clear_module_state->__pyx_n_s_RFC3986_USERINFO_SAFE_CHARS); + Py_CLEAR(clear_module_state->__pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE); + Py_CLEAR(clear_module_state->__pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO); + Py_CLEAR(clear_module_state->__pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE); Py_CLEAR(clear_module_state->__pyx_n_s_SCHEME_CHARS); Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); + Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS); Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_SCHEMES); Py_CLEAR(clear_module_state->__pyx_n_s_Tuple); Py_CLEAR(clear_module_state->__pyx_kp_s_Tuple_int_bool); @@ -3953,6 +4079,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_URL_has_opaque_path); Py_CLEAR(clear_module_state->__pyx_n_s_URL_scheme); Py_CLEAR(clear_module_state->__pyx_n_s_USERINFO_PERCENT_ENCODE_SET); + Py_CLEAR(clear_module_state->__pyx_n_s_USERINFO_SAFEST_CHARS); Py_CLEAR(clear_module_state->__pyx_n_s_UTF_16BE_ENCODING); Py_CLEAR(clear_module_state->__pyx_n_s_UTF_16LE_ENCODING); Py_CLEAR(clear_module_state->__pyx_n_s_UTF_8_ENCODER); @@ -3964,6 +4091,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_kp_u__10); Py_CLEAR(clear_module_state->__pyx_kp_u__11); + Py_CLEAR(clear_module_state->__pyx_kp_b__12); Py_CLEAR(clear_module_state->__pyx_kp_u__12); Py_CLEAR(clear_module_state->__pyx_kp_u__13); Py_CLEAR(clear_module_state->__pyx_n_s__14); @@ -3974,13 +4102,16 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_u__18); Py_CLEAR(clear_module_state->__pyx_kp_u__19); Py_CLEAR(clear_module_state->__pyx_n_s__2); + Py_CLEAR(clear_module_state->__pyx_kp_b__2); Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_kp_u__21); Py_CLEAR(clear_module_state->__pyx_kp_u__22); Py_CLEAR(clear_module_state->__pyx_kp_u__23); Py_CLEAR(clear_module_state->__pyx_n_s__24); Py_CLEAR(clear_module_state->__pyx_kp_u__3); + Py_CLEAR(clear_module_state->__pyx_kp_b__4); Py_CLEAR(clear_module_state->__pyx_kp_u__4); + Py_CLEAR(clear_module_state->__pyx_kp_b__5); Py_CLEAR(clear_module_state->__pyx_kp_u__5); Py_CLEAR(clear_module_state->__pyx_kp_u__6); Py_CLEAR(clear_module_state->__pyx_kp_u__75); @@ -3989,12 +4120,19 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_u__81); Py_CLEAR(clear_module_state->__pyx_kp_u__82); Py_CLEAR(clear_module_state->__pyx_kp_u__83); + Py_CLEAR(clear_module_state->__pyx_kp_b__84); Py_CLEAR(clear_module_state->__pyx_kp_u__84); Py_CLEAR(clear_module_state->__pyx_kp_u__85); Py_CLEAR(clear_module_state->__pyx_kp_u__86); - Py_CLEAR(clear_module_state->__pyx_kp_u__87); - Py_CLEAR(clear_module_state->__pyx_kp_u__88); + Py_CLEAR(clear_module_state->__pyx_kp_b__87); + Py_CLEAR(clear_module_state->__pyx_kp_b__88); + Py_CLEAR(clear_module_state->__pyx_kp_u__89); Py_CLEAR(clear_module_state->__pyx_kp_u__9); + Py_CLEAR(clear_module_state->__pyx_kp_b__91); + Py_CLEAR(clear_module_state->__pyx_kp_b__94); + Py_CLEAR(clear_module_state->__pyx_kp_b__95); + Py_CLEAR(clear_module_state->__pyx_kp_u__96); + Py_CLEAR(clear_module_state->__pyx_kp_u__97); Py_CLEAR(clear_module_state->__pyx_n_s_address); Py_CLEAR(clear_module_state->__pyx_n_s_annotations); Py_CLEAR(clear_module_state->__pyx_kp_u_ansi_x3_4_1968); @@ -4003,6 +4141,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_u_ascii); Py_CLEAR(clear_module_state->__pyx_n_s_ascii_domain); + Py_CLEAR(clear_module_state->__pyx_n_s_ascii_letters); Py_CLEAR(clear_module_state->__pyx_kp_u_asmo_708); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_at_sign_index); @@ -4069,7 +4208,9 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_current_length); Py_CLEAR(clear_module_state->__pyx_n_u_cyrillic); Py_CLEAR(clear_module_state->__pyx_n_s_default_port_seen); + Py_CLEAR(clear_module_state->__pyx_n_s_delete); Py_CLEAR(clear_module_state->__pyx_n_s_dict); + Py_CLEAR(clear_module_state->__pyx_n_s_digits); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_kp_u_does_not_match_any_encoding_lab); @@ -4133,7 +4274,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_input); - Py_CLEAR(clear_module_state->__pyx_n_s_input_lenght); Py_CLEAR(clear_module_state->__pyx_n_s_input_length); Py_CLEAR(clear_module_state->__pyx_n_s_inside_brackets); Py_CLEAR(clear_module_state->__pyx_n_s_int); @@ -4294,6 +4434,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_password_token_seen); Py_CLEAR(clear_module_state->__pyx_n_s_path); Py_CLEAR(clear_module_state->__pyx_n_s_path_percent_encode_set); + Py_CLEAR(clear_module_state->__pyx_n_s_path_safe_chars); Py_CLEAR(clear_module_state->__pyx_n_s_path_token_seen); Py_CLEAR(clear_module_state->__pyx_n_s_percent_encode_after_encoding); Py_CLEAR(clear_module_state->__pyx_n_s_percent_encode_set); @@ -4303,15 +4444,22 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_port); Py_CLEAR(clear_module_state->__pyx_n_s_port_token_seen); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); + Py_CLEAR(clear_module_state->__pyx_n_s_preprocess_url); Py_CLEAR(clear_module_state->__pyx_n_s_property); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_query); Py_CLEAR(clear_module_state->__pyx_n_s_query_percent_encode_set); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_range); + Py_CLEAR(clear_module_state->__pyx_n_s_reached_end); + Py_CLEAR(clear_module_state->__pyx_n_s_replace); Py_CLEAR(clear_module_state->__pyx_n_u_replacement); Py_CLEAR(clear_module_state->__pyx_n_s_result); Py_CLEAR(clear_module_state->__pyx_n_s_return); + Py_CLEAR(clear_module_state->__pyx_n_s_rfc2396); + Py_CLEAR(clear_module_state->__pyx_n_s_rfc3986); + Py_CLEAR(clear_module_state->__pyx_n_s_safe_chars); + Py_CLEAR(clear_module_state->__pyx_n_s_safe_url); Py_CLEAR(clear_module_state->__pyx_n_s_scheme); Py_CLEAR(clear_module_state->__pyx_n_s_scheme_2); Py_CLEAR(clear_module_state->__pyx_n_s_segment); @@ -4337,6 +4485,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_starts_with_windows_drive_lette); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_str); + Py_CLEAR(clear_module_state->__pyx_n_s_string); Py_CLEAR(clear_module_state->__pyx_n_s_strip); Py_CLEAR(clear_module_state->__pyx_n_u_sun_eu_greek); Py_CLEAR(clear_module_state->__pyx_n_s_super); @@ -4465,24 +4614,29 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_tuple__73); Py_CLEAR(clear_module_state->__pyx_tuple__76); Py_CLEAR(clear_module_state->__pyx_tuple__79); - Py_CLEAR(clear_module_state->__pyx_tuple__89); - Py_CLEAR(clear_module_state->__pyx_tuple__91); + Py_CLEAR(clear_module_state->__pyx_tuple__90); + Py_CLEAR(clear_module_state->__pyx_tuple__92); Py_CLEAR(clear_module_state->__pyx_tuple__93); - Py_CLEAR(clear_module_state->__pyx_tuple__95); - Py_CLEAR(clear_module_state->__pyx_tuple__97); - Py_CLEAR(clear_module_state->__pyx_tuple__99); - Py_CLEAR(clear_module_state->__pyx_tuple__101); - Py_CLEAR(clear_module_state->__pyx_tuple__103); - Py_CLEAR(clear_module_state->__pyx_tuple__105); - Py_CLEAR(clear_module_state->__pyx_tuple__107); - Py_CLEAR(clear_module_state->__pyx_tuple__111); - Py_CLEAR(clear_module_state->__pyx_tuple__113); - Py_CLEAR(clear_module_state->__pyx_tuple__115); - Py_CLEAR(clear_module_state->__pyx_tuple__117); - Py_CLEAR(clear_module_state->__pyx_tuple__119); - Py_CLEAR(clear_module_state->__pyx_tuple__121); - Py_CLEAR(clear_module_state->__pyx_tuple__123); - Py_CLEAR(clear_module_state->__pyx_tuple__125); + Py_CLEAR(clear_module_state->__pyx_tuple__98); + Py_CLEAR(clear_module_state->__pyx_tuple__100); + Py_CLEAR(clear_module_state->__pyx_tuple__102); + Py_CLEAR(clear_module_state->__pyx_tuple__104); + Py_CLEAR(clear_module_state->__pyx_tuple__106); + Py_CLEAR(clear_module_state->__pyx_tuple__108); + Py_CLEAR(clear_module_state->__pyx_tuple__110); + Py_CLEAR(clear_module_state->__pyx_tuple__112); + Py_CLEAR(clear_module_state->__pyx_tuple__114); + Py_CLEAR(clear_module_state->__pyx_tuple__116); + Py_CLEAR(clear_module_state->__pyx_tuple__120); + Py_CLEAR(clear_module_state->__pyx_tuple__122); + Py_CLEAR(clear_module_state->__pyx_tuple__124); + Py_CLEAR(clear_module_state->__pyx_tuple__126); + Py_CLEAR(clear_module_state->__pyx_tuple__128); + Py_CLEAR(clear_module_state->__pyx_tuple__130); + Py_CLEAR(clear_module_state->__pyx_tuple__132); + Py_CLEAR(clear_module_state->__pyx_tuple__134); + Py_CLEAR(clear_module_state->__pyx_tuple__136); + Py_CLEAR(clear_module_state->__pyx_tuple__138); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__65); Py_CLEAR(clear_module_state->__pyx_codeobj__68); @@ -4492,26 +4646,28 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_codeobj__74); Py_CLEAR(clear_module_state->__pyx_codeobj__77); Py_CLEAR(clear_module_state->__pyx_codeobj__80); - Py_CLEAR(clear_module_state->__pyx_codeobj__90); - Py_CLEAR(clear_module_state->__pyx_codeobj__92); - Py_CLEAR(clear_module_state->__pyx_codeobj__94); - Py_CLEAR(clear_module_state->__pyx_codeobj__96); - Py_CLEAR(clear_module_state->__pyx_codeobj__98); - Py_CLEAR(clear_module_state->__pyx_codeobj__100); - Py_CLEAR(clear_module_state->__pyx_codeobj__102); - Py_CLEAR(clear_module_state->__pyx_codeobj__104); - Py_CLEAR(clear_module_state->__pyx_codeobj__106); - Py_CLEAR(clear_module_state->__pyx_codeobj__108); + Py_CLEAR(clear_module_state->__pyx_codeobj__99); + Py_CLEAR(clear_module_state->__pyx_codeobj__101); + Py_CLEAR(clear_module_state->__pyx_codeobj__103); + Py_CLEAR(clear_module_state->__pyx_codeobj__105); + Py_CLEAR(clear_module_state->__pyx_codeobj__107); Py_CLEAR(clear_module_state->__pyx_codeobj__109); - Py_CLEAR(clear_module_state->__pyx_codeobj__110); - Py_CLEAR(clear_module_state->__pyx_codeobj__112); - Py_CLEAR(clear_module_state->__pyx_codeobj__114); - Py_CLEAR(clear_module_state->__pyx_codeobj__116); + Py_CLEAR(clear_module_state->__pyx_codeobj__111); + Py_CLEAR(clear_module_state->__pyx_codeobj__113); + Py_CLEAR(clear_module_state->__pyx_codeobj__115); + Py_CLEAR(clear_module_state->__pyx_codeobj__117); Py_CLEAR(clear_module_state->__pyx_codeobj__118); - Py_CLEAR(clear_module_state->__pyx_codeobj__120); - Py_CLEAR(clear_module_state->__pyx_codeobj__122); - Py_CLEAR(clear_module_state->__pyx_codeobj__124); - Py_CLEAR(clear_module_state->__pyx_codeobj__126); + Py_CLEAR(clear_module_state->__pyx_codeobj__119); + Py_CLEAR(clear_module_state->__pyx_codeobj__121); + Py_CLEAR(clear_module_state->__pyx_codeobj__123); + Py_CLEAR(clear_module_state->__pyx_codeobj__125); + Py_CLEAR(clear_module_state->__pyx_codeobj__127); + Py_CLEAR(clear_module_state->__pyx_codeobj__129); + Py_CLEAR(clear_module_state->__pyx_codeobj__131); + Py_CLEAR(clear_module_state->__pyx_codeobj__133); + Py_CLEAR(clear_module_state->__pyx_codeobj__135); + Py_CLEAR(clear_module_state->__pyx_codeobj__137); + Py_CLEAR(clear_module_state->__pyx_codeobj__139); return 0; } #endif @@ -4571,11 +4727,12 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Dict); Py_VISIT(traverse_module_state->__pyx_kp_s_Dict_str_str); Py_VISIT(traverse_module_state->__pyx_kp_u_Domain_name); + Py_VISIT(traverse_module_state->__pyx_n_s_EXTRA_SAFE_CHARS); Py_VISIT(traverse_module_state->__pyx_n_s_EncodeFunction); Py_VISIT(traverse_module_state->__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); Py_VISIT(traverse_module_state->__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); Py_VISIT(traverse_module_state->__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); - Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); + Py_VISIT(traverse_module_state->__pyx_n_s_FRAGMENT_SAFEST_CHARS); Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); Py_VISIT(traverse_module_state->__pyx_n_s_LABEL_ENCODINGS); Py_VISIT(traverse_module_state->__pyx_n_s_List); @@ -4587,11 +4744,32 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_int); Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_str); Py_VISIT(traverse_module_state->__pyx_n_s_PATH_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_PATH_SAFEST_CHARS); Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet); Py_VISIT(traverse_module_state->__pyx_n_s_QUERY_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_QUERY_SAFEST_CHARS); Py_VISIT(traverse_module_state->__pyx_n_s_REPLACEMENT_ENCODING); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_GEN_DELIMS); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_RESERVED); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_SUB_DELIMS); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_UNRESERVED); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); + Py_VISIT(traverse_module_state->__pyx_n_s_RFC3986_USERINFO_SAFE_CHARS); + Py_VISIT(traverse_module_state->__pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE); + Py_VISIT(traverse_module_state->__pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO); + Py_VISIT(traverse_module_state->__pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE); Py_VISIT(traverse_module_state->__pyx_n_s_SCHEME_CHARS); Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); + Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS); Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_SCHEMES); Py_VISIT(traverse_module_state->__pyx_n_s_Tuple); Py_VISIT(traverse_module_state->__pyx_kp_s_Tuple_int_bool); @@ -4600,6 +4778,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_URL_has_opaque_path); Py_VISIT(traverse_module_state->__pyx_n_s_URL_scheme); Py_VISIT(traverse_module_state->__pyx_n_s_USERINFO_PERCENT_ENCODE_SET); + Py_VISIT(traverse_module_state->__pyx_n_s_USERINFO_SAFEST_CHARS); Py_VISIT(traverse_module_state->__pyx_n_s_UTF_16BE_ENCODING); Py_VISIT(traverse_module_state->__pyx_n_s_UTF_16LE_ENCODING); Py_VISIT(traverse_module_state->__pyx_n_s_UTF_8_ENCODER); @@ -4611,6 +4790,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_kp_u__10); Py_VISIT(traverse_module_state->__pyx_kp_u__11); + Py_VISIT(traverse_module_state->__pyx_kp_b__12); Py_VISIT(traverse_module_state->__pyx_kp_u__12); Py_VISIT(traverse_module_state->__pyx_kp_u__13); Py_VISIT(traverse_module_state->__pyx_n_s__14); @@ -4621,13 +4801,16 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_u__18); Py_VISIT(traverse_module_state->__pyx_kp_u__19); Py_VISIT(traverse_module_state->__pyx_n_s__2); + Py_VISIT(traverse_module_state->__pyx_kp_b__2); Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_kp_u__21); Py_VISIT(traverse_module_state->__pyx_kp_u__22); Py_VISIT(traverse_module_state->__pyx_kp_u__23); Py_VISIT(traverse_module_state->__pyx_n_s__24); Py_VISIT(traverse_module_state->__pyx_kp_u__3); + Py_VISIT(traverse_module_state->__pyx_kp_b__4); Py_VISIT(traverse_module_state->__pyx_kp_u__4); + Py_VISIT(traverse_module_state->__pyx_kp_b__5); Py_VISIT(traverse_module_state->__pyx_kp_u__5); Py_VISIT(traverse_module_state->__pyx_kp_u__6); Py_VISIT(traverse_module_state->__pyx_kp_u__75); @@ -4636,12 +4819,19 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_u__81); Py_VISIT(traverse_module_state->__pyx_kp_u__82); Py_VISIT(traverse_module_state->__pyx_kp_u__83); + Py_VISIT(traverse_module_state->__pyx_kp_b__84); Py_VISIT(traverse_module_state->__pyx_kp_u__84); Py_VISIT(traverse_module_state->__pyx_kp_u__85); Py_VISIT(traverse_module_state->__pyx_kp_u__86); - Py_VISIT(traverse_module_state->__pyx_kp_u__87); - Py_VISIT(traverse_module_state->__pyx_kp_u__88); + Py_VISIT(traverse_module_state->__pyx_kp_b__87); + Py_VISIT(traverse_module_state->__pyx_kp_b__88); + Py_VISIT(traverse_module_state->__pyx_kp_u__89); Py_VISIT(traverse_module_state->__pyx_kp_u__9); + Py_VISIT(traverse_module_state->__pyx_kp_b__91); + Py_VISIT(traverse_module_state->__pyx_kp_b__94); + Py_VISIT(traverse_module_state->__pyx_kp_b__95); + Py_VISIT(traverse_module_state->__pyx_kp_u__96); + Py_VISIT(traverse_module_state->__pyx_kp_u__97); Py_VISIT(traverse_module_state->__pyx_n_s_address); Py_VISIT(traverse_module_state->__pyx_n_s_annotations); Py_VISIT(traverse_module_state->__pyx_kp_u_ansi_x3_4_1968); @@ -4650,6 +4840,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_u_ascii); Py_VISIT(traverse_module_state->__pyx_n_s_ascii_domain); + Py_VISIT(traverse_module_state->__pyx_n_s_ascii_letters); Py_VISIT(traverse_module_state->__pyx_kp_u_asmo_708); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_at_sign_index); @@ -4716,7 +4907,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_current_length); Py_VISIT(traverse_module_state->__pyx_n_u_cyrillic); Py_VISIT(traverse_module_state->__pyx_n_s_default_port_seen); + Py_VISIT(traverse_module_state->__pyx_n_s_delete); Py_VISIT(traverse_module_state->__pyx_n_s_dict); + Py_VISIT(traverse_module_state->__pyx_n_s_digits); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_kp_u_does_not_match_any_encoding_lab); @@ -4780,7 +4973,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_input); - Py_VISIT(traverse_module_state->__pyx_n_s_input_lenght); Py_VISIT(traverse_module_state->__pyx_n_s_input_length); Py_VISIT(traverse_module_state->__pyx_n_s_inside_brackets); Py_VISIT(traverse_module_state->__pyx_n_s_int); @@ -4941,6 +5133,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_password_token_seen); Py_VISIT(traverse_module_state->__pyx_n_s_path); Py_VISIT(traverse_module_state->__pyx_n_s_path_percent_encode_set); + Py_VISIT(traverse_module_state->__pyx_n_s_path_safe_chars); Py_VISIT(traverse_module_state->__pyx_n_s_path_token_seen); Py_VISIT(traverse_module_state->__pyx_n_s_percent_encode_after_encoding); Py_VISIT(traverse_module_state->__pyx_n_s_percent_encode_set); @@ -4950,15 +5143,22 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_port); Py_VISIT(traverse_module_state->__pyx_n_s_port_token_seen); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); + Py_VISIT(traverse_module_state->__pyx_n_s_preprocess_url); Py_VISIT(traverse_module_state->__pyx_n_s_property); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_query); Py_VISIT(traverse_module_state->__pyx_n_s_query_percent_encode_set); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_range); + Py_VISIT(traverse_module_state->__pyx_n_s_reached_end); + Py_VISIT(traverse_module_state->__pyx_n_s_replace); Py_VISIT(traverse_module_state->__pyx_n_u_replacement); Py_VISIT(traverse_module_state->__pyx_n_s_result); Py_VISIT(traverse_module_state->__pyx_n_s_return); + Py_VISIT(traverse_module_state->__pyx_n_s_rfc2396); + Py_VISIT(traverse_module_state->__pyx_n_s_rfc3986); + Py_VISIT(traverse_module_state->__pyx_n_s_safe_chars); + Py_VISIT(traverse_module_state->__pyx_n_s_safe_url); Py_VISIT(traverse_module_state->__pyx_n_s_scheme); Py_VISIT(traverse_module_state->__pyx_n_s_scheme_2); Py_VISIT(traverse_module_state->__pyx_n_s_segment); @@ -4984,6 +5184,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_starts_with_windows_drive_lette); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_str); + Py_VISIT(traverse_module_state->__pyx_n_s_string); Py_VISIT(traverse_module_state->__pyx_n_s_strip); Py_VISIT(traverse_module_state->__pyx_n_u_sun_eu_greek); Py_VISIT(traverse_module_state->__pyx_n_s_super); @@ -5112,24 +5313,29 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_tuple__73); Py_VISIT(traverse_module_state->__pyx_tuple__76); Py_VISIT(traverse_module_state->__pyx_tuple__79); - Py_VISIT(traverse_module_state->__pyx_tuple__89); - Py_VISIT(traverse_module_state->__pyx_tuple__91); + Py_VISIT(traverse_module_state->__pyx_tuple__90); + Py_VISIT(traverse_module_state->__pyx_tuple__92); Py_VISIT(traverse_module_state->__pyx_tuple__93); - Py_VISIT(traverse_module_state->__pyx_tuple__95); - Py_VISIT(traverse_module_state->__pyx_tuple__97); - Py_VISIT(traverse_module_state->__pyx_tuple__99); - Py_VISIT(traverse_module_state->__pyx_tuple__101); - Py_VISIT(traverse_module_state->__pyx_tuple__103); - Py_VISIT(traverse_module_state->__pyx_tuple__105); - Py_VISIT(traverse_module_state->__pyx_tuple__107); - Py_VISIT(traverse_module_state->__pyx_tuple__111); - Py_VISIT(traverse_module_state->__pyx_tuple__113); - Py_VISIT(traverse_module_state->__pyx_tuple__115); - Py_VISIT(traverse_module_state->__pyx_tuple__117); - Py_VISIT(traverse_module_state->__pyx_tuple__119); - Py_VISIT(traverse_module_state->__pyx_tuple__121); - Py_VISIT(traverse_module_state->__pyx_tuple__123); - Py_VISIT(traverse_module_state->__pyx_tuple__125); + Py_VISIT(traverse_module_state->__pyx_tuple__98); + Py_VISIT(traverse_module_state->__pyx_tuple__100); + Py_VISIT(traverse_module_state->__pyx_tuple__102); + Py_VISIT(traverse_module_state->__pyx_tuple__104); + Py_VISIT(traverse_module_state->__pyx_tuple__106); + Py_VISIT(traverse_module_state->__pyx_tuple__108); + Py_VISIT(traverse_module_state->__pyx_tuple__110); + Py_VISIT(traverse_module_state->__pyx_tuple__112); + Py_VISIT(traverse_module_state->__pyx_tuple__114); + Py_VISIT(traverse_module_state->__pyx_tuple__116); + Py_VISIT(traverse_module_state->__pyx_tuple__120); + Py_VISIT(traverse_module_state->__pyx_tuple__122); + Py_VISIT(traverse_module_state->__pyx_tuple__124); + Py_VISIT(traverse_module_state->__pyx_tuple__126); + Py_VISIT(traverse_module_state->__pyx_tuple__128); + Py_VISIT(traverse_module_state->__pyx_tuple__130); + Py_VISIT(traverse_module_state->__pyx_tuple__132); + Py_VISIT(traverse_module_state->__pyx_tuple__134); + Py_VISIT(traverse_module_state->__pyx_tuple__136); + Py_VISIT(traverse_module_state->__pyx_tuple__138); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__65); Py_VISIT(traverse_module_state->__pyx_codeobj__68); @@ -5139,26 +5345,28 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_codeobj__74); Py_VISIT(traverse_module_state->__pyx_codeobj__77); Py_VISIT(traverse_module_state->__pyx_codeobj__80); - Py_VISIT(traverse_module_state->__pyx_codeobj__90); - Py_VISIT(traverse_module_state->__pyx_codeobj__92); - Py_VISIT(traverse_module_state->__pyx_codeobj__94); - Py_VISIT(traverse_module_state->__pyx_codeobj__96); - Py_VISIT(traverse_module_state->__pyx_codeobj__98); - Py_VISIT(traverse_module_state->__pyx_codeobj__100); - Py_VISIT(traverse_module_state->__pyx_codeobj__102); - Py_VISIT(traverse_module_state->__pyx_codeobj__104); - Py_VISIT(traverse_module_state->__pyx_codeobj__106); - Py_VISIT(traverse_module_state->__pyx_codeobj__108); + Py_VISIT(traverse_module_state->__pyx_codeobj__99); + Py_VISIT(traverse_module_state->__pyx_codeobj__101); + Py_VISIT(traverse_module_state->__pyx_codeobj__103); + Py_VISIT(traverse_module_state->__pyx_codeobj__105); + Py_VISIT(traverse_module_state->__pyx_codeobj__107); Py_VISIT(traverse_module_state->__pyx_codeobj__109); - Py_VISIT(traverse_module_state->__pyx_codeobj__110); - Py_VISIT(traverse_module_state->__pyx_codeobj__112); - Py_VISIT(traverse_module_state->__pyx_codeobj__114); - Py_VISIT(traverse_module_state->__pyx_codeobj__116); + Py_VISIT(traverse_module_state->__pyx_codeobj__111); + Py_VISIT(traverse_module_state->__pyx_codeobj__113); + Py_VISIT(traverse_module_state->__pyx_codeobj__115); + Py_VISIT(traverse_module_state->__pyx_codeobj__117); Py_VISIT(traverse_module_state->__pyx_codeobj__118); - Py_VISIT(traverse_module_state->__pyx_codeobj__120); - Py_VISIT(traverse_module_state->__pyx_codeobj__122); - Py_VISIT(traverse_module_state->__pyx_codeobj__124); - Py_VISIT(traverse_module_state->__pyx_codeobj__126); + Py_VISIT(traverse_module_state->__pyx_codeobj__119); + Py_VISIT(traverse_module_state->__pyx_codeobj__121); + Py_VISIT(traverse_module_state->__pyx_codeobj__123); + Py_VISIT(traverse_module_state->__pyx_codeobj__125); + Py_VISIT(traverse_module_state->__pyx_codeobj__127); + Py_VISIT(traverse_module_state->__pyx_codeobj__129); + Py_VISIT(traverse_module_state->__pyx_codeobj__131); + Py_VISIT(traverse_module_state->__pyx_codeobj__133); + Py_VISIT(traverse_module_state->__pyx_codeobj__135); + Py_VISIT(traverse_module_state->__pyx_codeobj__137); + Py_VISIT(traverse_module_state->__pyx_codeobj__139); return 0; } #endif @@ -5228,11 +5436,12 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Dict __pyx_mstate_global->__pyx_n_s_Dict #define __pyx_kp_s_Dict_str_str __pyx_mstate_global->__pyx_kp_s_Dict_str_str #define __pyx_kp_u_Domain_name __pyx_mstate_global->__pyx_kp_u_Domain_name +#define __pyx_n_s_EXTRA_SAFE_CHARS __pyx_mstate_global->__pyx_n_s_EXTRA_SAFE_CHARS #define __pyx_n_s_EncodeFunction __pyx_mstate_global->__pyx_n_s_EncodeFunction #define __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS __pyx_mstate_global->__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS #define __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS __pyx_mstate_global->__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS #define __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET -#define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError +#define __pyx_n_s_FRAGMENT_SAFEST_CHARS __pyx_mstate_global->__pyx_n_s_FRAGMENT_SAFEST_CHARS #define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError #define __pyx_n_s_LABEL_ENCODINGS __pyx_mstate_global->__pyx_n_s_LABEL_ENCODINGS #define __pyx_n_s_List __pyx_mstate_global->__pyx_n_s_List @@ -5244,11 +5453,32 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_s_Optional_int __pyx_mstate_global->__pyx_kp_s_Optional_int #define __pyx_kp_s_Optional_str __pyx_mstate_global->__pyx_kp_s_Optional_str #define __pyx_n_s_PATH_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_PATH_PERCENT_ENCODE_SET +#define __pyx_n_s_PATH_SAFEST_CHARS __pyx_mstate_global->__pyx_n_s_PATH_SAFEST_CHARS #define __pyx_n_s_PercentEncodeSet __pyx_mstate_global->__pyx_n_s_PercentEncodeSet #define __pyx_n_s_QUERY_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_QUERY_PERCENT_ENCODE_SET +#define __pyx_n_s_QUERY_SAFEST_CHARS __pyx_mstate_global->__pyx_n_s_QUERY_SAFEST_CHARS #define __pyx_n_s_REPLACEMENT_ENCODING __pyx_mstate_global->__pyx_n_s_REPLACEMENT_ENCODING +#define __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE __pyx_mstate_global->__pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE +#define __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE __pyx_mstate_global->__pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE +#define __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE __pyx_mstate_global->__pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE +#define __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE __pyx_mstate_global->__pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE +#define __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE __pyx_mstate_global->__pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE +#define __pyx_n_s_RFC3986_GEN_DELIMS __pyx_mstate_global->__pyx_n_s_RFC3986_GEN_DELIMS +#define __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET +#define __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE __pyx_mstate_global->__pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE +#define __pyx_n_s_RFC3986_RESERVED __pyx_mstate_global->__pyx_n_s_RFC3986_RESERVED +#define __pyx_n_s_RFC3986_SUB_DELIMS __pyx_mstate_global->__pyx_n_s_RFC3986_SUB_DELIMS +#define __pyx_n_s_RFC3986_UNRESERVED __pyx_mstate_global->__pyx_n_s_RFC3986_UNRESERVED +#define __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE __pyx_mstate_global->__pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE +#define __pyx_n_s_RFC3986_USERINFO_SAFE_CHARS __pyx_mstate_global->__pyx_n_s_RFC3986_USERINFO_SAFE_CHARS +#define __pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE __pyx_mstate_global->__pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE +#define __pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET +#define __pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET +#define __pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO __pyx_mstate_global->__pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO +#define __pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE __pyx_mstate_global->__pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE #define __pyx_n_s_SCHEME_CHARS __pyx_mstate_global->__pyx_n_s_SCHEME_CHARS #define __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE __pyx_mstate_global->__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE +#define __pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS __pyx_mstate_global->__pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS #define __pyx_n_s_SPECIAL_SCHEMES __pyx_mstate_global->__pyx_n_s_SPECIAL_SCHEMES #define __pyx_n_s_Tuple __pyx_mstate_global->__pyx_n_s_Tuple #define __pyx_kp_s_Tuple_int_bool __pyx_mstate_global->__pyx_kp_s_Tuple_int_bool @@ -5257,6 +5487,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_URL_has_opaque_path __pyx_mstate_global->__pyx_n_s_URL_has_opaque_path #define __pyx_n_s_URL_scheme __pyx_mstate_global->__pyx_n_s_URL_scheme #define __pyx_n_s_USERINFO_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_USERINFO_PERCENT_ENCODE_SET +#define __pyx_n_s_USERINFO_SAFEST_CHARS __pyx_mstate_global->__pyx_n_s_USERINFO_SAFEST_CHARS #define __pyx_n_s_UTF_16BE_ENCODING __pyx_mstate_global->__pyx_n_s_UTF_16BE_ENCODING #define __pyx_n_s_UTF_16LE_ENCODING __pyx_mstate_global->__pyx_n_s_UTF_16LE_ENCODING #define __pyx_n_s_UTF_8_ENCODER __pyx_mstate_global->__pyx_n_s_UTF_8_ENCODER @@ -5268,6 +5499,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10 #define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11 +#define __pyx_kp_b__12 __pyx_mstate_global->__pyx_kp_b__12 #define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12 #define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13 #define __pyx_n_s__14 __pyx_mstate_global->__pyx_n_s__14 @@ -5278,13 +5510,16 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_u__18 __pyx_mstate_global->__pyx_kp_u__18 #define __pyx_kp_u__19 __pyx_mstate_global->__pyx_kp_u__19 #define __pyx_n_s__2 __pyx_mstate_global->__pyx_n_s__2 +#define __pyx_kp_b__2 __pyx_mstate_global->__pyx_kp_b__2 #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_kp_u__21 __pyx_mstate_global->__pyx_kp_u__21 #define __pyx_kp_u__22 __pyx_mstate_global->__pyx_kp_u__22 #define __pyx_kp_u__23 __pyx_mstate_global->__pyx_kp_u__23 #define __pyx_n_s__24 __pyx_mstate_global->__pyx_n_s__24 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 +#define __pyx_kp_b__4 __pyx_mstate_global->__pyx_kp_b__4 #define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 +#define __pyx_kp_b__5 __pyx_mstate_global->__pyx_kp_b__5 #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 #define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 #define __pyx_kp_u__75 __pyx_mstate_global->__pyx_kp_u__75 @@ -5293,12 +5528,19 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_u__81 __pyx_mstate_global->__pyx_kp_u__81 #define __pyx_kp_u__82 __pyx_mstate_global->__pyx_kp_u__82 #define __pyx_kp_u__83 __pyx_mstate_global->__pyx_kp_u__83 +#define __pyx_kp_b__84 __pyx_mstate_global->__pyx_kp_b__84 #define __pyx_kp_u__84 __pyx_mstate_global->__pyx_kp_u__84 #define __pyx_kp_u__85 __pyx_mstate_global->__pyx_kp_u__85 #define __pyx_kp_u__86 __pyx_mstate_global->__pyx_kp_u__86 -#define __pyx_kp_u__87 __pyx_mstate_global->__pyx_kp_u__87 -#define __pyx_kp_u__88 __pyx_mstate_global->__pyx_kp_u__88 +#define __pyx_kp_b__87 __pyx_mstate_global->__pyx_kp_b__87 +#define __pyx_kp_b__88 __pyx_mstate_global->__pyx_kp_b__88 +#define __pyx_kp_u__89 __pyx_mstate_global->__pyx_kp_u__89 #define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9 +#define __pyx_kp_b__91 __pyx_mstate_global->__pyx_kp_b__91 +#define __pyx_kp_b__94 __pyx_mstate_global->__pyx_kp_b__94 +#define __pyx_kp_b__95 __pyx_mstate_global->__pyx_kp_b__95 +#define __pyx_kp_u__96 __pyx_mstate_global->__pyx_kp_u__96 +#define __pyx_kp_u__97 __pyx_mstate_global->__pyx_kp_u__97 #define __pyx_n_s_address __pyx_mstate_global->__pyx_n_s_address #define __pyx_n_s_annotations __pyx_mstate_global->__pyx_n_s_annotations #define __pyx_kp_u_ansi_x3_4_1968 __pyx_mstate_global->__pyx_kp_u_ansi_x3_4_1968 @@ -5307,6 +5549,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_u_ascii __pyx_mstate_global->__pyx_n_u_ascii #define __pyx_n_s_ascii_domain __pyx_mstate_global->__pyx_n_s_ascii_domain +#define __pyx_n_s_ascii_letters __pyx_mstate_global->__pyx_n_s_ascii_letters #define __pyx_kp_u_asmo_708 __pyx_mstate_global->__pyx_kp_u_asmo_708 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_at_sign_index __pyx_mstate_global->__pyx_n_s_at_sign_index @@ -5373,7 +5616,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_current_length __pyx_mstate_global->__pyx_n_s_current_length #define __pyx_n_u_cyrillic __pyx_mstate_global->__pyx_n_u_cyrillic #define __pyx_n_s_default_port_seen __pyx_mstate_global->__pyx_n_s_default_port_seen +#define __pyx_n_s_delete __pyx_mstate_global->__pyx_n_s_delete #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict +#define __pyx_n_s_digits __pyx_mstate_global->__pyx_n_s_digits #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_kp_u_does_not_match_any_encoding_lab __pyx_mstate_global->__pyx_kp_u_does_not_match_any_encoding_lab @@ -5437,7 +5682,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_input __pyx_mstate_global->__pyx_n_s_input -#define __pyx_n_s_input_lenght __pyx_mstate_global->__pyx_n_s_input_lenght #define __pyx_n_s_input_length __pyx_mstate_global->__pyx_n_s_input_length #define __pyx_n_s_inside_brackets __pyx_mstate_global->__pyx_n_s_inside_brackets #define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int @@ -5598,6 +5842,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_password_token_seen __pyx_mstate_global->__pyx_n_s_password_token_seen #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path #define __pyx_n_s_path_percent_encode_set __pyx_mstate_global->__pyx_n_s_path_percent_encode_set +#define __pyx_n_s_path_safe_chars __pyx_mstate_global->__pyx_n_s_path_safe_chars #define __pyx_n_s_path_token_seen __pyx_mstate_global->__pyx_n_s_path_token_seen #define __pyx_n_s_percent_encode_after_encoding __pyx_mstate_global->__pyx_n_s_percent_encode_after_encoding #define __pyx_n_s_percent_encode_set __pyx_mstate_global->__pyx_n_s_percent_encode_set @@ -5607,15 +5852,22 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_port __pyx_mstate_global->__pyx_n_s_port #define __pyx_n_s_port_token_seen __pyx_mstate_global->__pyx_n_s_port_token_seen #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare +#define __pyx_n_s_preprocess_url __pyx_mstate_global->__pyx_n_s_preprocess_url #define __pyx_n_s_property __pyx_mstate_global->__pyx_n_s_property #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_query __pyx_mstate_global->__pyx_n_s_query #define __pyx_n_s_query_percent_encode_set __pyx_mstate_global->__pyx_n_s_query_percent_encode_set #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range +#define __pyx_n_s_reached_end __pyx_mstate_global->__pyx_n_s_reached_end +#define __pyx_n_s_replace __pyx_mstate_global->__pyx_n_s_replace #define __pyx_n_u_replacement __pyx_mstate_global->__pyx_n_u_replacement #define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result #define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return +#define __pyx_n_s_rfc2396 __pyx_mstate_global->__pyx_n_s_rfc2396 +#define __pyx_n_s_rfc3986 __pyx_mstate_global->__pyx_n_s_rfc3986 +#define __pyx_n_s_safe_chars __pyx_mstate_global->__pyx_n_s_safe_chars +#define __pyx_n_s_safe_url __pyx_mstate_global->__pyx_n_s_safe_url #define __pyx_n_s_scheme __pyx_mstate_global->__pyx_n_s_scheme #define __pyx_n_s_scheme_2 __pyx_mstate_global->__pyx_n_s_scheme_2 #define __pyx_n_s_segment __pyx_mstate_global->__pyx_n_s_segment @@ -5641,6 +5893,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_starts_with_windows_drive_lette __pyx_mstate_global->__pyx_n_s_starts_with_windows_drive_lette #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str +#define __pyx_n_s_string __pyx_mstate_global->__pyx_n_s_string #define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip #define __pyx_n_u_sun_eu_greek __pyx_mstate_global->__pyx_n_u_sun_eu_greek #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super @@ -5769,24 +6022,29 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 #define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 #define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 -#define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89 -#define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91 +#define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90 +#define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92 #define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93 -#define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95 -#define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97 -#define __pyx_tuple__99 __pyx_mstate_global->__pyx_tuple__99 -#define __pyx_tuple__101 __pyx_mstate_global->__pyx_tuple__101 -#define __pyx_tuple__103 __pyx_mstate_global->__pyx_tuple__103 -#define __pyx_tuple__105 __pyx_mstate_global->__pyx_tuple__105 -#define __pyx_tuple__107 __pyx_mstate_global->__pyx_tuple__107 -#define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111 -#define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113 -#define __pyx_tuple__115 __pyx_mstate_global->__pyx_tuple__115 -#define __pyx_tuple__117 __pyx_mstate_global->__pyx_tuple__117 -#define __pyx_tuple__119 __pyx_mstate_global->__pyx_tuple__119 -#define __pyx_tuple__121 __pyx_mstate_global->__pyx_tuple__121 -#define __pyx_tuple__123 __pyx_mstate_global->__pyx_tuple__123 -#define __pyx_tuple__125 __pyx_mstate_global->__pyx_tuple__125 +#define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98 +#define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100 +#define __pyx_tuple__102 __pyx_mstate_global->__pyx_tuple__102 +#define __pyx_tuple__104 __pyx_mstate_global->__pyx_tuple__104 +#define __pyx_tuple__106 __pyx_mstate_global->__pyx_tuple__106 +#define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108 +#define __pyx_tuple__110 __pyx_mstate_global->__pyx_tuple__110 +#define __pyx_tuple__112 __pyx_mstate_global->__pyx_tuple__112 +#define __pyx_tuple__114 __pyx_mstate_global->__pyx_tuple__114 +#define __pyx_tuple__116 __pyx_mstate_global->__pyx_tuple__116 +#define __pyx_tuple__120 __pyx_mstate_global->__pyx_tuple__120 +#define __pyx_tuple__122 __pyx_mstate_global->__pyx_tuple__122 +#define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124 +#define __pyx_tuple__126 __pyx_mstate_global->__pyx_tuple__126 +#define __pyx_tuple__128 __pyx_mstate_global->__pyx_tuple__128 +#define __pyx_tuple__130 __pyx_mstate_global->__pyx_tuple__130 +#define __pyx_tuple__132 __pyx_mstate_global->__pyx_tuple__132 +#define __pyx_tuple__134 __pyx_mstate_global->__pyx_tuple__134 +#define __pyx_tuple__136 __pyx_mstate_global->__pyx_tuple__136 +#define __pyx_tuple__138 __pyx_mstate_global->__pyx_tuple__138 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 #define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68 @@ -5796,29 +6054,31 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74 #define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77 #define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80 -#define __pyx_codeobj__90 __pyx_mstate_global->__pyx_codeobj__90 -#define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92 -#define __pyx_codeobj__94 __pyx_mstate_global->__pyx_codeobj__94 -#define __pyx_codeobj__96 __pyx_mstate_global->__pyx_codeobj__96 -#define __pyx_codeobj__98 __pyx_mstate_global->__pyx_codeobj__98 -#define __pyx_codeobj__100 __pyx_mstate_global->__pyx_codeobj__100 -#define __pyx_codeobj__102 __pyx_mstate_global->__pyx_codeobj__102 -#define __pyx_codeobj__104 __pyx_mstate_global->__pyx_codeobj__104 -#define __pyx_codeobj__106 __pyx_mstate_global->__pyx_codeobj__106 -#define __pyx_codeobj__108 __pyx_mstate_global->__pyx_codeobj__108 +#define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99 +#define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101 +#define __pyx_codeobj__103 __pyx_mstate_global->__pyx_codeobj__103 +#define __pyx_codeobj__105 __pyx_mstate_global->__pyx_codeobj__105 +#define __pyx_codeobj__107 __pyx_mstate_global->__pyx_codeobj__107 #define __pyx_codeobj__109 __pyx_mstate_global->__pyx_codeobj__109 -#define __pyx_codeobj__110 __pyx_mstate_global->__pyx_codeobj__110 -#define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112 -#define __pyx_codeobj__114 __pyx_mstate_global->__pyx_codeobj__114 -#define __pyx_codeobj__116 __pyx_mstate_global->__pyx_codeobj__116 +#define __pyx_codeobj__111 __pyx_mstate_global->__pyx_codeobj__111 +#define __pyx_codeobj__113 __pyx_mstate_global->__pyx_codeobj__113 +#define __pyx_codeobj__115 __pyx_mstate_global->__pyx_codeobj__115 +#define __pyx_codeobj__117 __pyx_mstate_global->__pyx_codeobj__117 #define __pyx_codeobj__118 __pyx_mstate_global->__pyx_codeobj__118 -#define __pyx_codeobj__120 __pyx_mstate_global->__pyx_codeobj__120 -#define __pyx_codeobj__122 __pyx_mstate_global->__pyx_codeobj__122 -#define __pyx_codeobj__124 __pyx_mstate_global->__pyx_codeobj__124 -#define __pyx_codeobj__126 __pyx_mstate_global->__pyx_codeobj__126 +#define __pyx_codeobj__119 __pyx_mstate_global->__pyx_codeobj__119 +#define __pyx_codeobj__121 __pyx_mstate_global->__pyx_codeobj__121 +#define __pyx_codeobj__123 __pyx_mstate_global->__pyx_codeobj__123 +#define __pyx_codeobj__125 __pyx_mstate_global->__pyx_codeobj__125 +#define __pyx_codeobj__127 __pyx_mstate_global->__pyx_codeobj__127 +#define __pyx_codeobj__129 __pyx_mstate_global->__pyx_codeobj__129 +#define __pyx_codeobj__131 __pyx_mstate_global->__pyx_codeobj__131 +#define __pyx_codeobj__133 __pyx_mstate_global->__pyx_codeobj__133 +#define __pyx_codeobj__135 __pyx_mstate_global->__pyx_codeobj__135 +#define __pyx_codeobj__137 __pyx_mstate_global->__pyx_codeobj__137 +#define __pyx_codeobj__139 __pyx_mstate_global->__pyx_codeobj__139 /* #### Code section: module_code ### */ -/* "w3lib/_url.pyx":32 +/* "w3lib/_url.pyx":44 * * * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< @@ -5879,12 +6139,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_short_windows_125") < 0)) __PYX_ERR(0, 32, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_short_windows_125") < 0)) __PYX_ERR(0, 44, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -5895,7 +6155,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_short_windows_125", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 32, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_short_windows_125", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 44, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5909,7 +6169,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_digit), (&PyInt_Type), 0, "last_digit", 1))) __PYX_ERR(0, 32, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_digit), (&PyInt_Type), 0, "last_digit", 1))) __PYX_ERR(0, 44, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url__short_windows_125(__pyx_self, __pyx_v_last_digit); /* function exit code */ @@ -5942,7 +6202,7 @@ static PyObject *__pyx_pf_5w3lib_4_url__short_windows_125(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_short_windows_125", 1); - /* "w3lib/_url.pyx":33 + /* "w3lib/_url.pyx":45 * * def _short_windows_125(last_digit: int) -> Dict[str, str]: * return { # <<<<<<<<<<<<<< @@ -5951,68 +6211,68 @@ static PyObject *__pyx_pf_5w3lib_4_url__short_windows_125(CYTHON_UNUSED PyObject */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L5_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":36 + /* "w3lib/_url.pyx":48 * label: f"windows-125{last_digit}" * for label in ( * f"cp125{last_digit}", # <<<<<<<<<<<<<< * f"windows-125{last_digit}", * f"x-cp125{last_digit}", */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_n_u_cp125, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L5_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_n_u_cp125, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":37 + /* "w3lib/_url.pyx":49 * for label in ( * f"cp125{last_digit}", * f"windows-125{last_digit}", # <<<<<<<<<<<<<< * f"x-cp125{last_digit}", * ) */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_windows_125, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L5_error) + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_windows_125, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":38 + /* "w3lib/_url.pyx":50 * f"cp125{last_digit}", * f"windows-125{last_digit}", * f"x-cp125{last_digit}", # <<<<<<<<<<<<<< * ) * } */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_x_cp125, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 38, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_x_cp125, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 50, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":36 + /* "w3lib/_url.pyx":48 * label: f"windows-125{last_digit}" * for label in ( * f"cp125{last_digit}", # <<<<<<<<<<<<<< * f"windows-125{last_digit}", * f"x-cp125{last_digit}", */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L5_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 36, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 48, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 36, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 48, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5)) __PYX_ERR(0, 36, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5)) __PYX_ERR(0, 48, __pyx_L5_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; - /* "w3lib/_url.pyx":35 + /* "w3lib/_url.pyx":47 * return { * label: f"windows-125{last_digit}" * for label in ( # <<<<<<<<<<<<<< @@ -6025,30 +6285,30 @@ static PyObject *__pyx_pf_5w3lib_4_url__short_windows_125(CYTHON_UNUSED PyObject for (;;) { if (__pyx_t_6 >= 3) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 35, __pyx_L5_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 47, __pyx_L5_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L5_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_label, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":34 + /* "w3lib/_url.pyx":46 * def _short_windows_125(last_digit: int) -> Dict[str, str]: * return { * label: f"windows-125{last_digit}" # <<<<<<<<<<<<<< * for label in ( * f"cp125{last_digit}", */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_windows_125, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L5_error) + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_windows_125, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 34, __pyx_L5_error) + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 46, __pyx_L5_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":35 + /* "w3lib/_url.pyx":47 * return { * label: f"windows-125{last_digit}" * for label in ( # <<<<<<<<<<<<<< @@ -6068,7 +6328,7 @@ static PyObject *__pyx_pf_5w3lib_4_url__short_windows_125(CYTHON_UNUSED PyObject __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":32 + /* "w3lib/_url.pyx":44 * * * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< @@ -6092,7 +6352,7 @@ static PyObject *__pyx_pf_5w3lib_4_url__short_windows_125(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":433 +/* "w3lib/_url.pyx":445 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< @@ -6153,12 +6413,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_encoder") < 0)) __PYX_ERR(0, 433, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_encoder") < 0)) __PYX_ERR(0, 445, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -6169,7 +6429,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_encoder", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 433, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_encoder", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 445, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6183,7 +6443,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 434, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 446, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_2_get_encoder(__pyx_self, __pyx_v_encoding); /* function exit code */ @@ -6214,16 +6474,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_get_encoder(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_encoder", 1); - /* "w3lib/_url.pyx":435 + /* "w3lib/_url.pyx":447 * @lru_cache(maxsize=None) * def _get_encoder(encoding: str) -> EncodeFunction: * codec_info = codecs.lookup(encoding) # <<<<<<<<<<<<<< * return codec_info.encode * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_codecs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_codecs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -6244,14 +6504,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_get_encoder(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_codec_info = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":436 + /* "w3lib/_url.pyx":448 * def _get_encoder(encoding: str) -> EncodeFunction: * codec_info = codecs.lookup(encoding) * return codec_info.encode # <<<<<<<<<<<<<< @@ -6259,13 +6519,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_get_encoder(CYTHON_UNUSED PyObject *__p * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec_info, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec_info, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":433 + /* "w3lib/_url.pyx":445 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< @@ -6287,7 +6547,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_get_encoder(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":443 +/* "w3lib/_url.pyx":455 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< @@ -6348,12 +6608,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 443, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_encoding") < 0)) __PYX_ERR(0, 443, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_encoding") < 0)) __PYX_ERR(0, 455, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -6364,7 +6624,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 443, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 455, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6378,7 +6638,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), (&PyUnicode_Type), 0, "label", 1))) __PYX_ERR(0, 444, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), (&PyUnicode_Type), 0, "label", 1))) __PYX_ERR(0, 456, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_4_get_encoding(__pyx_self, __pyx_v_label); /* function exit code */ @@ -6415,19 +6675,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ __Pyx_RefNannySetupContext("_get_encoding", 0); __Pyx_INCREF(__pyx_v_label); - /* "w3lib/_url.pyx":445 + /* "w3lib/_url.pyx":457 * @lru_cache(maxsize=None) * def _get_encoding(label: str) -> str: * label = label.strip(_ASCII_WHITESPACE).lower() # <<<<<<<<<<<<<< * try: * encoding = _LABEL_ENCODINGS[label] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_WHITESPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_WHITESPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_label, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_label, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -6448,15 +6708,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 445, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_label, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":446 + /* "w3lib/_url.pyx":458 * def _get_encoding(label: str) -> str: * label = label.strip(_ASCII_WHITESPACE).lower() * try: # <<<<<<<<<<<<<< @@ -6472,22 +6732,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { - /* "w3lib/_url.pyx":447 + /* "w3lib/_url.pyx":459 * label = label.strip(_ASCII_WHITESPACE).lower() * try: * encoding = _LABEL_ENCODINGS[label] # <<<<<<<<<<<<<< * except KeyError: * raise ValueError( */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_LABEL_ENCODINGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L3_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_LABEL_ENCODINGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L3_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_encoding = __pyx_t_2; __pyx_t_2 = 0; - /* "w3lib/_url.pyx":446 + /* "w3lib/_url.pyx":458 * def _get_encoding(label: str) -> str: * label = label.strip(_ASCII_WHITESPACE).lower() * try: # <<<<<<<<<<<<<< @@ -6504,7 +6764,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":448 + /* "w3lib/_url.pyx":460 * try: * encoding = _LABEL_ENCODINGS[label] * except KeyError: # <<<<<<<<<<<<<< @@ -6514,41 +6774,41 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_4) { __Pyx_AddTraceback("w3lib._url._get_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 448, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 460, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":450 + /* "w3lib/_url.pyx":462 * except KeyError: * raise ValueError( * f"{label!r} does not match any encoding label from the Encoding " # <<<<<<<<<<<<<< * f"Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721" * f"bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)" */ - __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 450, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 462, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_8, __pyx_kp_u_does_not_match_any_encoding_lab); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 450, __pyx_L5_except_error) + __pyx_t_9 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_8, __pyx_kp_u_does_not_match_any_encoding_lab); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 462, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "w3lib/_url.pyx":449 + /* "w3lib/_url.pyx":461 * encoding = _LABEL_ENCODINGS[label] * except KeyError: * raise ValueError( # <<<<<<<<<<<<<< * f"{label!r} does not match any encoding label from the Encoding " * f"Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721" */ - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 449, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 461, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 449, __pyx_L5_except_error) + __PYX_ERR(0, 461, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "w3lib/_url.pyx":446 + /* "w3lib/_url.pyx":458 * def _get_encoding(label: str) -> str: * label = label.strip(_ASCII_WHITESPACE).lower() * try: # <<<<<<<<<<<<<< @@ -6564,7 +6824,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ __pyx_L8_try_end:; } - /* "w3lib/_url.pyx":454 + /* "w3lib/_url.pyx":466 * f"bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)" * ) * return encoding # <<<<<<<<<<<<<< @@ -6572,12 +6832,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_encoding))||((__pyx_v_encoding) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_encoding))) __PYX_ERR(0, 454, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_encoding))||((__pyx_v_encoding) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_encoding))) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_INCREF(__pyx_v_encoding); __pyx_r = ((PyObject*)__pyx_v_encoding); goto __pyx_L0; - /* "w3lib/_url.pyx":443 + /* "w3lib/_url.pyx":455 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< @@ -6602,7 +6862,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "w3lib/_url.pyx":465 +/* "w3lib/_url.pyx":477 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings * @cfunc # <<<<<<<<<<<<<< @@ -6624,14 +6884,14 @@ static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *__pyx_v_enc __Pyx_RefNannySetupContext("_get_output_encoding", 0); __Pyx_INCREF(__pyx_v_encoding); - /* "w3lib/_url.pyx":467 + /* "w3lib/_url.pyx":479 * @cfunc * def _get_output_encoding(encoding: str) -> str: * encoding = _get_encoding(encoding) # <<<<<<<<<<<<<< * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: * return _UTF_8_ENCODING */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -6651,28 +6911,28 @@ static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *__pyx_v_enc PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 467, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_encoding, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":468 + /* "w3lib/_url.pyx":480 * def _get_output_encoding(encoding: str) -> str: * encoding = _get_encoding(encoding) * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: # <<<<<<<<<<<<<< * return _UTF_8_ENCODING * return encoding */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_encoding, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_encoding, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "w3lib/_url.pyx":469 + /* "w3lib/_url.pyx":481 * encoding = _get_encoding(encoding) * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: * return _UTF_8_ENCODING # <<<<<<<<<<<<<< @@ -6680,14 +6940,14 @@ static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *__pyx_v_enc * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_UTF_8_ENCODING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_UTF_8_ENCODING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 469, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 481, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":468 + /* "w3lib/_url.pyx":480 * def _get_output_encoding(encoding: str) -> str: * encoding = _get_encoding(encoding) * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: # <<<<<<<<<<<<<< @@ -6696,7 +6956,7 @@ static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *__pyx_v_enc */ } - /* "w3lib/_url.pyx":470 + /* "w3lib/_url.pyx":482 * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: * return _UTF_8_ENCODING * return encoding # <<<<<<<<<<<<<< @@ -6708,7 +6968,7 @@ static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *__pyx_v_enc __pyx_r = __pyx_v_encoding; goto __pyx_L0; - /* "w3lib/_url.pyx":465 + /* "w3lib/_url.pyx":477 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings * @cfunc # <<<<<<<<<<<<<< @@ -6730,7 +6990,7 @@ static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *__pyx_v_enc return __pyx_r; } -/* "w3lib/_url.pyx":543 +/* "w3lib/_url.pyx":555 * _path_token_seen: bool = False * * def __init__(self) -> None: # <<<<<<<<<<<<<< @@ -6791,12 +7051,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 543, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 543, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 555, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -6807,7 +7067,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 543, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 555, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6843,28 +7103,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "w3lib/_url.pyx":544 + /* "w3lib/_url.pyx":556 * * def __init__(self) -> None: * self.path = [] # <<<<<<<<<<<<<< * self.is_special = False * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 544, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":545 + /* "w3lib/_url.pyx":557 * def __init__(self) -> None: * self.path = [] * self.is_special = False # <<<<<<<<<<<<<< * * def has_opaque_path(self) -> bool: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, Py_False) < 0) __PYX_ERR(0, 545, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, Py_False) < 0) __PYX_ERR(0, 557, __pyx_L1_error) - /* "w3lib/_url.pyx":543 + /* "w3lib/_url.pyx":555 * _path_token_seen: bool = False * * def __init__(self) -> None: # <<<<<<<<<<<<<< @@ -6885,7 +7145,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "w3lib/_url.pyx":547 +/* "w3lib/_url.pyx":559 * self.is_special = False * * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< @@ -6946,12 +7206,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 559, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "has_opaque_path") < 0)) __PYX_ERR(0, 547, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "has_opaque_path") < 0)) __PYX_ERR(0, 559, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -6962,7 +7222,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("has_opaque_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 547, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("has_opaque_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 559, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6999,7 +7259,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(CYTHON_UNUSED PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_opaque_path", 1); - /* "w3lib/_url.pyx":548 + /* "w3lib/_url.pyx":560 * * def has_opaque_path(self) -> bool: * return isinstance(self.path, str) # <<<<<<<<<<<<<< @@ -7007,17 +7267,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(CYTHON_UNUSED PyOb * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyUnicode_Check(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":547 + /* "w3lib/_url.pyx":559 * self.is_special = False * * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< @@ -7036,7 +7296,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(CYTHON_UNUSED PyOb return __pyx_r; } -/* "w3lib/_url.pyx":550 +/* "w3lib/_url.pyx":562 * return isinstance(self.path, str) * * @property # <<<<<<<<<<<<<< @@ -7097,12 +7357,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 550, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 562, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -7113,7 +7373,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scheme", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 550, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scheme", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 562, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7149,7 +7409,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_4scheme(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scheme", 1); - /* "w3lib/_url.pyx":552 + /* "w3lib/_url.pyx":564 * @property * def scheme(self) -> str: * return self._scheme # <<<<<<<<<<<<<< @@ -7157,14 +7417,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_4scheme(CYTHON_UNUSED PyObject *__p * @scheme.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 552, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 564, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":550 + /* "w3lib/_url.pyx":562 * return isinstance(self.path, str) * * @property # <<<<<<<<<<<<<< @@ -7183,7 +7443,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_4scheme(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":554 +/* "w3lib/_url.pyx":566 * return self._scheme * * @scheme.setter # <<<<<<<<<<<<<< @@ -7247,7 +7507,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -7255,14 +7515,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, 1); __PYX_ERR(0, 554, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, 1); __PYX_ERR(0, 566, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 554, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 566, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -7275,7 +7535,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 554, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 566, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7289,7 +7549,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyUnicode_Type), 0, "value", 1))) __PYX_ERR(0, 555, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyUnicode_Type), 0, "value", 1))) __PYX_ERR(0, 567, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_4_URL_6scheme(__pyx_self, __pyx_v_self, __pyx_v_value); /* function exit code */ @@ -7317,32 +7577,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_6scheme(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scheme", 1); - /* "w3lib/_url.pyx":556 + /* "w3lib/_url.pyx":568 * @scheme.setter * def scheme(self, value: str) -> None: * self._scheme = value # <<<<<<<<<<<<<< * self.is_special = value in _SPECIAL_SCHEMES * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scheme, __pyx_v_value) < 0) __PYX_ERR(0, 556, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scheme, __pyx_v_value) < 0) __PYX_ERR(0, 568, __pyx_L1_error) - /* "w3lib/_url.pyx":557 + /* "w3lib/_url.pyx":569 * def scheme(self, value: str) -> None: * self._scheme = value * self.is_special = value in _SPECIAL_SCHEMES # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, __pyx_t_1) < 0) __PYX_ERR(0, 557, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, __pyx_t_1) < 0) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":554 + /* "w3lib/_url.pyx":566 * return self._scheme * * @scheme.setter # <<<<<<<<<<<<<< @@ -7363,7 +7623,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL_6scheme(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":564 +/* "w3lib/_url.pyx":576 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< @@ -7424,12 +7684,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 564, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 576, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_shorten_path") < 0)) __PYX_ERR(0, 564, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_shorten_path") < 0)) __PYX_ERR(0, 576, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -7440,7 +7700,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_shorten_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 564, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_shorten_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 576, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7484,44 +7744,44 @@ static PyObject *__pyx_pf_5w3lib_4_url_6_shorten_path(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_shorten_path", 1); - /* "w3lib/_url.pyx":565 + /* "w3lib/_url.pyx":577 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path * def _shorten_path(url: _URL) -> None: * path = url.path # <<<<<<<<<<<<<< * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): * return */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_path = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":566 + /* "w3lib/_url.pyx":578 * def _shorten_path(url: _URL) -> None: * path = url.path * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): # <<<<<<<<<<<<<< * return * url.path = path[:-1] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = PyObject_Length(__pyx_v_path); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_4 = PyObject_Length(__pyx_v_path); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 578, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 == 1); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -7542,17 +7802,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_6_shorten_path(CYTHON_UNUSED PyObject *__ __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":567 + /* "w3lib/_url.pyx":579 * path = url.path * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): * return # <<<<<<<<<<<<<< @@ -7563,7 +7823,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_6_shorten_path(CYTHON_UNUSED PyObject *__ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "w3lib/_url.pyx":566 + /* "w3lib/_url.pyx":578 * def _shorten_path(url: _URL) -> None: * path = url.path * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): # <<<<<<<<<<<<<< @@ -7572,19 +7832,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_6_shorten_path(CYTHON_UNUSED PyObject *__ */ } - /* "w3lib/_url.pyx":568 + /* "w3lib/_url.pyx":580 * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): * return * url.path = path[:-1] # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 568, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":564 + /* "w3lib/_url.pyx":576 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< @@ -7609,7 +7869,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_6_shorten_path(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "w3lib/_url.pyx":573 +/* "w3lib/_url.pyx":585 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< @@ -7659,7 +7919,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_encoding,&__pyx_n_s_percent_encode_set,&__pyx_n_s_space_as_plus,0}; - /* "w3lib/_url.pyx":578 + /* "w3lib/_url.pyx":590 * encoding: str, * percent_encode_set: _PercentEncodeSet, * space_as_plus: bool = False, # <<<<<<<<<<<<<< @@ -7682,7 +7942,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -7690,33 +7950,33 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 573, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 585, __pyx_L3_error) } if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_percent_encode_set)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_percent_encode_set); __PYX_ERR(0, 573, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_percent_encode_set); __PYX_ERR(0, 585, __pyx_L3_error) } } if (kw_args == 1) { const Py_ssize_t index = 3; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_percent_encode_after_encoding") < 0)) __PYX_ERR(0, 573, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_percent_encode_after_encoding") < 0)) __PYX_ERR(0, 585, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 573, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 585, __pyx_L3_error) } __pyx_v_input = ((PyObject*)values[0]); __pyx_v_encoding = ((PyObject*)values[1]); @@ -7725,7 +7985,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_percent_encode_after_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 573, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_percent_encode_after_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 585, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7739,11 +7999,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 574, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 576, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 586, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 588, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(__pyx_self, __pyx_v_input, __pyx_v_encoding, __pyx_v_percent_encode_set, __pyx_v_space_as_plus); - /* "w3lib/_url.pyx":573 + /* "w3lib/_url.pyx":585 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< @@ -7792,14 +8052,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_percent_encode_after_encoding", 1); - /* "w3lib/_url.pyx":580 + /* "w3lib/_url.pyx":592 * space_as_plus: bool = False, * ) -> str: * encoder = _get_encoder(encoding) # <<<<<<<<<<<<<< * output = "" * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -7819,14 +8079,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_encoder = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":581 + /* "w3lib/_url.pyx":593 * ) -> str: * encoder = _get_encoder(encoding) * output = "" # <<<<<<<<<<<<<< @@ -7836,7 +8096,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN __Pyx_INCREF(__pyx_kp_u__2); __pyx_v_output = __pyx_kp_u__2; - /* "w3lib/_url.pyx":584 + /* "w3lib/_url.pyx":596 * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B * # instead of &#NNN; * encode_output, _ = encoder(input, "xmlcharrefreplace") # <<<<<<<<<<<<<< @@ -7862,7 +8122,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_input, __pyx_n_u_xmlcharrefreplace}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -7872,7 +8132,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 584, __pyx_L1_error) + __PYX_ERR(0, 596, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7885,15 +8145,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); @@ -7901,7 +8161,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 584, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 596, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; @@ -7909,7 +8169,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 584, __pyx_L1_error) + __PYX_ERR(0, 596, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_encode_output = __pyx_t_2; @@ -7917,17 +8177,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN __pyx_v__ = __pyx_t_3; __pyx_t_3 = 0; - /* "w3lib/_url.pyx":585 + /* "w3lib/_url.pyx":597 * # instead of &#NNN; * encode_output, _ = encoder(input, "xmlcharrefreplace") * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< * byte = encode_output[i] * if space_as_plus and byte == 0x20: */ - __pyx_t_7 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 585, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -7935,9 +8195,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 597, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -7946,28 +8206,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 597, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 597, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 597, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 597, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -7977,7 +8237,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 585, __pyx_L1_error) + else __PYX_ERR(0, 597, __pyx_L1_error) } break; } @@ -7986,49 +8246,49 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":586 + /* "w3lib/_url.pyx":598 * encode_output, _ = encoder(input, "xmlcharrefreplace") * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate * byte = encode_output[i] # <<<<<<<<<<<<<< * if space_as_plus and byte == 0x20: * output += "+" */ - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_byte, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":587 + /* "w3lib/_url.pyx":599 * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate * byte = encode_output[i] * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< * output += "+" * continue */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_space_as_plus); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_space_as_plus); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 599, __pyx_L1_error) if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L8_bool_binop_done; } - __pyx_t_10 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_byte, __pyx_int_32, 0x20, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_byte, __pyx_int_32, 0x20, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 599, __pyx_L1_error) __pyx_t_9 = __pyx_t_10; __pyx_L8_bool_binop_done:; if (__pyx_t_9) { - /* "w3lib/_url.pyx":588 + /* "w3lib/_url.pyx":600 * byte = encode_output[i] * if space_as_plus and byte == 0x20: * output += "+" # <<<<<<<<<<<<<< * continue * isomorph = chr(byte) */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":589 + /* "w3lib/_url.pyx":601 * if space_as_plus and byte == 0x20: * output += "+" * continue # <<<<<<<<<<<<<< @@ -8037,7 +8297,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN */ goto __pyx_L5_continue; - /* "w3lib/_url.pyx":587 + /* "w3lib/_url.pyx":599 * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate * byte = encode_output[i] * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< @@ -8046,41 +8306,41 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN */ } - /* "w3lib/_url.pyx":590 + /* "w3lib/_url.pyx":602 * output += "+" * continue * isomorph = chr(byte) # <<<<<<<<<<<<<< * if isomorph not in percent_encode_set: * output += isomorph */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_isomorph, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":591 + /* "w3lib/_url.pyx":603 * continue * isomorph = chr(byte) * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< * output += isomorph * elif isomorph == "%": */ - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_isomorph, __pyx_v_percent_encode_set, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_isomorph, __pyx_v_percent_encode_set, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) if (__pyx_t_9) { - /* "w3lib/_url.pyx":592 + /* "w3lib/_url.pyx":604 * isomorph = chr(byte) * if isomorph not in percent_encode_set: * output += isomorph # <<<<<<<<<<<<<< * elif isomorph == "%": * if ( */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_v_isomorph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_v_isomorph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":591 + /* "w3lib/_url.pyx":603 * continue * isomorph = chr(byte) * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< @@ -8090,32 +8350,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN goto __pyx_L10; } - /* "w3lib/_url.pyx":593 + /* "w3lib/_url.pyx":605 * if isomorph not in percent_encode_set: * output += isomorph * elif isomorph == "%": # <<<<<<<<<<<<<< * if ( * len(encode_output) <= i + 2 */ - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_isomorph, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_isomorph, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 605, __pyx_L1_error) if (__pyx_t_9) { - /* "w3lib/_url.pyx":595 + /* "w3lib/_url.pyx":607 * elif isomorph == "%": * if ( * len(encode_output) <= i + 2 # <<<<<<<<<<<<<< * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT */ - __pyx_t_11 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 595, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_11 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_10) { } else { @@ -8123,24 +8383,24 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN goto __pyx_L12_bool_binop_done; } - /* "w3lib/_url.pyx":596 + /* "w3lib/_url.pyx":608 * if ( * len(encode_output) <= i + 2 * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT * ): */ - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_10) { @@ -8149,30 +8409,30 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN goto __pyx_L12_bool_binop_done; } - /* "w3lib/_url.pyx":597 + /* "w3lib/_url.pyx":609 * len(encode_output) <= i + 2 * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * ): * output += "%25" */ - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L12_bool_binop_done:; - /* "w3lib/_url.pyx":594 + /* "w3lib/_url.pyx":606 * output += isomorph * elif isomorph == "%": * if ( # <<<<<<<<<<<<<< @@ -8181,19 +8441,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN */ if (__pyx_t_9) { - /* "w3lib/_url.pyx":599 + /* "w3lib/_url.pyx":611 * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT * ): * output += "%25" # <<<<<<<<<<<<<< * else: * output += "%" */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u_25); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u_25); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":594 + /* "w3lib/_url.pyx":606 * output += isomorph * elif isomorph == "%": * if ( # <<<<<<<<<<<<<< @@ -8203,7 +8463,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN goto __pyx_L11; } - /* "w3lib/_url.pyx":601 + /* "w3lib/_url.pyx":613 * output += "%25" * else: * output += "%" # <<<<<<<<<<<<<< @@ -8211,14 +8471,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN * output += f"%{byte:02X}" */ /*else*/ { - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; } __pyx_L11:; - /* "w3lib/_url.pyx":593 + /* "w3lib/_url.pyx":605 * if isomorph not in percent_encode_set: * output += isomorph * elif isomorph == "%": # <<<<<<<<<<<<<< @@ -8228,7 +8488,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN goto __pyx_L10; } - /* "w3lib/_url.pyx":603 + /* "w3lib/_url.pyx":615 * output += "%" * else: * output += f"%{byte:02X}" # <<<<<<<<<<<<<< @@ -8236,12 +8496,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN * return output */ /*else*/ { - __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_byte, __pyx_kp_u_02X); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_byte, __pyx_kp_u_02X); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); @@ -8249,7 +8509,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN } __pyx_L10:; - /* "w3lib/_url.pyx":585 + /* "w3lib/_url.pyx":597 * # instead of &#NNN; * encode_output, _ = encoder(input, "xmlcharrefreplace") * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< @@ -8260,7 +8520,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":605 + /* "w3lib/_url.pyx":617 * output += f"%{byte:02X}" * * return output # <<<<<<<<<<<<<< @@ -8268,12 +8528,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 605, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_INCREF(__pyx_v_output); __pyx_r = ((PyObject*)__pyx_v_output); goto __pyx_L0; - /* "w3lib/_url.pyx":573 + /* "w3lib/_url.pyx":585 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< @@ -8302,7 +8562,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN return __pyx_r; } -/* "w3lib/_url.pyx":623 +/* "w3lib/_url.pyx":688 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< @@ -8363,12 +8623,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv6") < 0)) __PYX_ERR(0, 623, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv6") < 0)) __PYX_ERR(0, 688, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -8379,7 +8639,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 623, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 688, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8393,7 +8653,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 623, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 688, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_10_parse_ipv6(__pyx_self, __pyx_v_input); /* function exit code */ @@ -8416,7 +8676,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p PyObject *__pyx_v_piece_index = NULL; PyObject *__pyx_v_compress = NULL; PyObject *__pyx_v_pointer = NULL; - Py_ssize_t __pyx_v_input_lenght; + Py_ssize_t __pyx_v_input_length; PyObject *__pyx_v_value = NULL; PyObject *__pyx_v_length = NULL; PyObject *__pyx_v_numbers_seen = NULL; @@ -8437,26 +8697,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_ipv6", 1); - /* "w3lib/_url.pyx":624 + /* "w3lib/_url.pyx":689 * * def _parse_ipv6(input: str) -> List[int]: * address = [0] * 8 # <<<<<<<<<<<<<< * piece_index = 0 * compress = None */ - __pyx_t_1 = PyList_New(1 * 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < 8; __pyx_temp++) { __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0)) __PYX_ERR(0, 624, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0)) __PYX_ERR(0, 689, __pyx_L1_error); } } __pyx_v_address = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":625 + /* "w3lib/_url.pyx":690 * def _parse_ipv6(input: str) -> List[int]: * address = [0] * 8 * piece_index = 0 # <<<<<<<<<<<<<< @@ -8466,215 +8726,215 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(__pyx_int_0); __pyx_v_piece_index = __pyx_int_0; - /* "w3lib/_url.pyx":626 + /* "w3lib/_url.pyx":691 * address = [0] * 8 * piece_index = 0 * compress = None # <<<<<<<<<<<<<< * pointer = 0 - * input_lenght = len(input) + * input_length = len(input) */ __Pyx_INCREF(Py_None); __pyx_v_compress = Py_None; - /* "w3lib/_url.pyx":627 + /* "w3lib/_url.pyx":692 * piece_index = 0 * compress = None * pointer = 0 # <<<<<<<<<<<<<< - * input_lenght = len(input) - * if pointer < input_lenght and input[pointer] == ":": + * input_length = len(input) + * if pointer < input_length and input[pointer] == ":": */ __Pyx_INCREF(__pyx_int_0); __pyx_v_pointer = __pyx_int_0; - /* "w3lib/_url.pyx":628 + /* "w3lib/_url.pyx":693 * compress = None * pointer = 0 - * input_lenght = len(input) # <<<<<<<<<<<<<< - * if pointer < input_lenght and input[pointer] == ":": - * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + * input_length = len(input) # <<<<<<<<<<<<<< + * if pointer < input_length and input[pointer] == ":": + * if pointer + 1 >= input_length or input[pointer + 1] != ":": */ - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 628, __pyx_L1_error) - __pyx_v_input_lenght = __pyx_t_2; + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_v_input_length = __pyx_t_2; - /* "w3lib/_url.pyx":629 + /* "w3lib/_url.pyx":694 * pointer = 0 - * input_lenght = len(input) - * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< - * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + * input_length = len(input) + * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< + * if pointer + 1 >= input_length or input[pointer + 1] != ":": * raise ValueError */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":630 - * input_lenght = len(input) - * if pointer < input_lenght and input[pointer] == ":": - * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":695 + * input_length = len(input) + * if pointer < input_length and input[pointer] == ":": + * if pointer + 1 >= input_length or input[pointer + 1] != ":": # <<<<<<<<<<<<<< * raise ValueError * pointer += 2 */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L7_bool_binop_done; } - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L7_bool_binop_done:; if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":631 - * if pointer < input_lenght and input[pointer] == ":": - * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + /* "w3lib/_url.pyx":696 + * if pointer < input_length and input[pointer] == ":": + * if pointer + 1 >= input_length or input[pointer + 1] != ":": * raise ValueError # <<<<<<<<<<<<<< * pointer += 2 * piece_index += 1 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 631, __pyx_L1_error) + __PYX_ERR(0, 696, __pyx_L1_error) - /* "w3lib/_url.pyx":630 - * input_lenght = len(input) - * if pointer < input_lenght and input[pointer] == ":": - * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":695 + * input_length = len(input) + * if pointer < input_length and input[pointer] == ":": + * if pointer + 1 >= input_length or input[pointer + 1] != ":": # <<<<<<<<<<<<<< * raise ValueError * pointer += 2 */ } - /* "w3lib/_url.pyx":632 - * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + /* "w3lib/_url.pyx":697 + * if pointer + 1 >= input_length or input[pointer + 1] != ":": * raise ValueError * pointer += 2 # <<<<<<<<<<<<<< * piece_index += 1 * compress = piece_index */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":633 + /* "w3lib/_url.pyx":698 * raise ValueError * pointer += 2 * piece_index += 1 # <<<<<<<<<<<<<< * compress = piece_index - * while pointer < input_lenght: + * while pointer < input_length: */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":634 + /* "w3lib/_url.pyx":699 * pointer += 2 * piece_index += 1 * compress = piece_index # <<<<<<<<<<<<<< - * while pointer < input_lenght: + * while pointer < input_length: * if piece_index == 8: */ __Pyx_INCREF(__pyx_v_piece_index); __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); - /* "w3lib/_url.pyx":629 + /* "w3lib/_url.pyx":694 * pointer = 0 - * input_lenght = len(input) - * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< - * if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + * input_length = len(input) + * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< + * if pointer + 1 >= input_length or input[pointer + 1] != ":": * raise ValueError */ } - /* "w3lib/_url.pyx":635 + /* "w3lib/_url.pyx":700 * piece_index += 1 * compress = piece_index - * while pointer < input_lenght: # <<<<<<<<<<<<<< + * while pointer < input_length: # <<<<<<<<<<<<<< * if piece_index == 8: * raise ValueError */ while (1) { - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":636 + /* "w3lib/_url.pyx":701 * compress = piece_index - * while pointer < input_lenght: + * while pointer < input_length: * if piece_index == 8: # <<<<<<<<<<<<<< * raise ValueError * if input[pointer] == ":": */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 701, __pyx_L1_error) if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":637 - * while pointer < input_lenght: + /* "w3lib/_url.pyx":702 + * while pointer < input_length: * if piece_index == 8: * raise ValueError # <<<<<<<<<<<<<< * if input[pointer] == ":": * if compress is not None: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 637, __pyx_L1_error) + __PYX_ERR(0, 702, __pyx_L1_error) - /* "w3lib/_url.pyx":636 + /* "w3lib/_url.pyx":701 * compress = piece_index - * while pointer < input_lenght: + * while pointer < input_length: * if piece_index == 8: # <<<<<<<<<<<<<< * raise ValueError * if input[pointer] == ":": */ } - /* "w3lib/_url.pyx":638 + /* "w3lib/_url.pyx":703 * if piece_index == 8: * raise ValueError * if input[pointer] == ":": # <<<<<<<<<<<<<< * if compress is not None: * raise ValueError */ - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":639 + /* "w3lib/_url.pyx":704 * raise ValueError * if input[pointer] == ":": * if compress is not None: # <<<<<<<<<<<<<< @@ -8684,7 +8944,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p __pyx_t_3 = (__pyx_v_compress != Py_None); if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":640 + /* "w3lib/_url.pyx":705 * if input[pointer] == ":": * if compress is not None: * raise ValueError # <<<<<<<<<<<<<< @@ -8692,9 +8952,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p * piece_index += 1 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 640, __pyx_L1_error) + __PYX_ERR(0, 705, __pyx_L1_error) - /* "w3lib/_url.pyx":639 + /* "w3lib/_url.pyx":704 * raise ValueError * if input[pointer] == ":": * if compress is not None: # <<<<<<<<<<<<<< @@ -8703,31 +8963,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":641 + /* "w3lib/_url.pyx":706 * if compress is not None: * raise ValueError * pointer += 1 # <<<<<<<<<<<<<< * piece_index += 1 * compress = piece_index */ - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":642 + /* "w3lib/_url.pyx":707 * raise ValueError * pointer += 1 * piece_index += 1 # <<<<<<<<<<<<<< * compress = piece_index * continue */ - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":643 + /* "w3lib/_url.pyx":708 * pointer += 1 * piece_index += 1 * compress = piece_index # <<<<<<<<<<<<<< @@ -8737,7 +8997,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(__pyx_v_piece_index); __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); - /* "w3lib/_url.pyx":644 + /* "w3lib/_url.pyx":709 * piece_index += 1 * compress = piece_index * continue # <<<<<<<<<<<<<< @@ -8746,7 +9006,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p */ goto __pyx_L9_continue; - /* "w3lib/_url.pyx":638 + /* "w3lib/_url.pyx":703 * if piece_index == 8: * raise ValueError * if input[pointer] == ":": # <<<<<<<<<<<<<< @@ -8755,209 +9015,209 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":645 + /* "w3lib/_url.pyx":710 * compress = piece_index * continue * value = length = 0 # <<<<<<<<<<<<<< * while ( - * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT + * length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT */ __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_int_0); - /* "w3lib/_url.pyx":646 + /* "w3lib/_url.pyx":711 * continue * value = length = 0 * while ( # <<<<<<<<<<<<<< - * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT + * length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT * ): */ while (1) { - /* "w3lib/_url.pyx":647 + /* "w3lib/_url.pyx":712 * value = length = 0 * while ( - * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * ): * value = value * 0x10 + int(input[pointer], base=16) */ - __pyx_t_6 = PyObject_RichCompare(__pyx_v_length, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 647, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_length, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L16_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L16_bool_binop_done:; if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":649 - * length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT + /* "w3lib/_url.pyx":714 + * length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT * ): * value = value * 0x10 + int(input[pointer], base=16) # <<<<<<<<<<<<<< * pointer += 1 * length += 1 */ - __pyx_t_6 = __Pyx_PyInt_MultiplyObjC(__pyx_v_value, __pyx_int_16, 0x10, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 649, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_MultiplyObjC(__pyx_v_value, __pyx_int_16, 0x10, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 649, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 649, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":650 + /* "w3lib/_url.pyx":715 * ): * value = value * 0x10 + int(input[pointer], base=16) * pointer += 1 # <<<<<<<<<<<<<< * length += 1 - * if pointer < input_lenght and input[pointer] == ".": + * if pointer < input_length and input[pointer] == ".": */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":651 + /* "w3lib/_url.pyx":716 * value = value * 0x10 + int(input[pointer], base=16) * pointer += 1 * length += 1 # <<<<<<<<<<<<<< - * if pointer < input_lenght and input[pointer] == ".": + * if pointer < input_length and input[pointer] == ".": * if length == 0: */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_length, __pyx_t_1); __pyx_t_1 = 0; } - /* "w3lib/_url.pyx":652 + /* "w3lib/_url.pyx":717 * pointer += 1 * length += 1 - * if pointer < input_lenght and input[pointer] == ".": # <<<<<<<<<<<<<< + * if pointer < input_length and input[pointer] == ".": # <<<<<<<<<<<<<< * if length == 0: * raise ValueError */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L20_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":653 + /* "w3lib/_url.pyx":718 * length += 1 - * if pointer < input_lenght and input[pointer] == ".": + * if pointer < input_length and input[pointer] == ".": * if length == 0: # <<<<<<<<<<<<<< * raise ValueError * pointer -= length */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_length, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 653, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_length, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 718, __pyx_L1_error) if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":654 - * if pointer < input_lenght and input[pointer] == ".": + /* "w3lib/_url.pyx":719 + * if pointer < input_length and input[pointer] == ".": * if length == 0: * raise ValueError # <<<<<<<<<<<<<< * pointer -= length * if piece_index > 6: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 654, __pyx_L1_error) + __PYX_ERR(0, 719, __pyx_L1_error) - /* "w3lib/_url.pyx":653 + /* "w3lib/_url.pyx":718 * length += 1 - * if pointer < input_lenght and input[pointer] == ".": + * if pointer < input_length and input[pointer] == ".": * if length == 0: # <<<<<<<<<<<<<< * raise ValueError * pointer -= length */ } - /* "w3lib/_url.pyx":655 + /* "w3lib/_url.pyx":720 * if length == 0: * raise ValueError * pointer -= length # <<<<<<<<<<<<<< * if piece_index > 6: * raise ValueError */ - __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_v_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_v_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":656 + /* "w3lib/_url.pyx":721 * raise ValueError * pointer -= length * if piece_index > 6: # <<<<<<<<<<<<<< * raise ValueError * numbers_seen = 0 */ - __pyx_t_7 = PyObject_RichCompare(__pyx_v_piece_index, __pyx_int_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 656, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_piece_index, __pyx_int_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":657 + /* "w3lib/_url.pyx":722 * pointer -= length * if piece_index > 6: * raise ValueError # <<<<<<<<<<<<<< * numbers_seen = 0 - * while pointer < input_lenght: + * while pointer < input_length: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 657, __pyx_L1_error) + __PYX_ERR(0, 722, __pyx_L1_error) - /* "w3lib/_url.pyx":656 + /* "w3lib/_url.pyx":721 * raise ValueError * pointer -= length * if piece_index > 6: # <<<<<<<<<<<<<< @@ -8966,35 +9226,35 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":658 + /* "w3lib/_url.pyx":723 * if piece_index > 6: * raise ValueError * numbers_seen = 0 # <<<<<<<<<<<<<< - * while pointer < input_lenght: + * while pointer < input_length: * ipv4_piece = None */ __Pyx_INCREF(__pyx_int_0); __pyx_v_numbers_seen = __pyx_int_0; - /* "w3lib/_url.pyx":659 + /* "w3lib/_url.pyx":724 * raise ValueError * numbers_seen = 0 - * while pointer < input_lenght: # <<<<<<<<<<<<<< + * while pointer < input_length: # <<<<<<<<<<<<<< * ipv4_piece = None * if numbers_seen > 0: */ while (1) { - __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":660 + /* "w3lib/_url.pyx":725 * numbers_seen = 0 - * while pointer < input_lenght: + * while pointer < input_length: * ipv4_piece = None # <<<<<<<<<<<<<< * if numbers_seen > 0: * if input[pointer] == "." and numbers_seen < 4: @@ -9002,54 +9262,54 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_ipv4_piece, Py_None); - /* "w3lib/_url.pyx":661 - * while pointer < input_lenght: + /* "w3lib/_url.pyx":726 + * while pointer < input_length: * ipv4_piece = None * if numbers_seen > 0: # <<<<<<<<<<<<<< * if input[pointer] == "." and numbers_seen < 4: * pointer += 1 */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":662 + /* "w3lib/_url.pyx":727 * ipv4_piece = None * if numbers_seen > 0: * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< * pointer += 1 * else: */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L28_bool_binop_done; } - __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L28_bool_binop_done:; if (likely(__pyx_t_3)) { - /* "w3lib/_url.pyx":663 + /* "w3lib/_url.pyx":728 * if numbers_seen > 0: * if input[pointer] == "." and numbers_seen < 4: * pointer += 1 # <<<<<<<<<<<<<< * else: * raise ValueError */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":662 + /* "w3lib/_url.pyx":727 * ipv4_piece = None * if numbers_seen > 0: * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< @@ -9059,21 +9319,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p goto __pyx_L27; } - /* "w3lib/_url.pyx":665 + /* "w3lib/_url.pyx":730 * pointer += 1 * else: * raise ValueError # <<<<<<<<<<<<<< - * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: + * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: * raise ValueError */ /*else*/ { __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 665, __pyx_L1_error) + __PYX_ERR(0, 730, __pyx_L1_error) } __pyx_L27:; - /* "w3lib/_url.pyx":661 - * while pointer < input_lenght: + /* "w3lib/_url.pyx":726 + * while pointer < input_length: * ipv4_piece = None * if numbers_seen > 0: # <<<<<<<<<<<<<< * if input[pointer] == "." and numbers_seen < 4: @@ -9081,101 +9341,101 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":666 + /* "w3lib/_url.pyx":731 * else: * raise ValueError - * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< + * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< * raise ValueError - * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + * while pointer < input_length and input[pointer] in _ASCII_DIGIT: */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L31_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L31_bool_binop_done:; if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":667 + /* "w3lib/_url.pyx":732 * raise ValueError - * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: + * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: * raise ValueError # <<<<<<<<<<<<<< - * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + * while pointer < input_length and input[pointer] in _ASCII_DIGIT: * number = int(input[pointer]) */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 667, __pyx_L1_error) + __PYX_ERR(0, 732, __pyx_L1_error) - /* "w3lib/_url.pyx":666 + /* "w3lib/_url.pyx":731 * else: * raise ValueError - * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< + * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< * raise ValueError - * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + * while pointer < input_length and input[pointer] in _ASCII_DIGIT: */ } - /* "w3lib/_url.pyx":668 - * if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: + /* "w3lib/_url.pyx":733 + * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: * raise ValueError - * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: # <<<<<<<<<<<<<< + * while pointer < input_length and input[pointer] in _ASCII_DIGIT: # <<<<<<<<<<<<<< * number = int(input[pointer]) * if ipv4_piece is None: */ while (1) { - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L35_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L35_bool_binop_done:; if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":669 + /* "w3lib/_url.pyx":734 * raise ValueError - * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + * while pointer < input_length and input[pointer] in _ASCII_DIGIT: * number = int(input[pointer]) # <<<<<<<<<<<<<< * if ipv4_piece is None: * ipv4_piece = number */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 669, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_number, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":670 - * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + /* "w3lib/_url.pyx":735 + * while pointer < input_length and input[pointer] in _ASCII_DIGIT: * number = int(input[pointer]) * if ipv4_piece is None: # <<<<<<<<<<<<<< * ipv4_piece = number @@ -9184,7 +9444,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p __pyx_t_3 = (__pyx_v_ipv4_piece == Py_None); if (__pyx_t_3) { - /* "w3lib/_url.pyx":671 + /* "w3lib/_url.pyx":736 * number = int(input[pointer]) * if ipv4_piece is None: * ipv4_piece = number # <<<<<<<<<<<<<< @@ -9194,8 +9454,8 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(__pyx_v_number); __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_v_number); - /* "w3lib/_url.pyx":670 - * while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + /* "w3lib/_url.pyx":735 + * while pointer < input_length and input[pointer] in _ASCII_DIGIT: * number = int(input[pointer]) * if ipv4_piece is None: # <<<<<<<<<<<<<< * ipv4_piece = number @@ -9204,17 +9464,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p goto __pyx_L37; } - /* "w3lib/_url.pyx":672 + /* "w3lib/_url.pyx":737 * if ipv4_piece is None: * ipv4_piece = number * elif ipv4_piece == 0: # <<<<<<<<<<<<<< * raise ValueError * else: */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_ipv4_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 672, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_ipv4_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 737, __pyx_L1_error) if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":673 + /* "w3lib/_url.pyx":738 * ipv4_piece = number * elif ipv4_piece == 0: * raise ValueError # <<<<<<<<<<<<<< @@ -9222,9 +9482,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p * ipv4_piece = ipv4_piece * 10 + number */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 673, __pyx_L1_error) + __PYX_ERR(0, 738, __pyx_L1_error) - /* "w3lib/_url.pyx":672 + /* "w3lib/_url.pyx":737 * if ipv4_piece is None: * ipv4_piece = number * elif ipv4_piece == 0: # <<<<<<<<<<<<<< @@ -9233,7 +9493,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":675 + /* "w3lib/_url.pyx":740 * raise ValueError * else: * ipv4_piece = ipv4_piece * 10 + number # <<<<<<<<<<<<<< @@ -9241,9 +9501,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p * raise ValueError */ /*else*/ { - __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ipv4_piece, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ipv4_piece, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_t_1); @@ -9251,19 +9511,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p } __pyx_L37:; - /* "w3lib/_url.pyx":676 + /* "w3lib/_url.pyx":741 * else: * ipv4_piece = ipv4_piece * 10 + number * if ipv4_piece > 255: # <<<<<<<<<<<<<< * raise ValueError * pointer += 1 */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ipv4_piece, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ipv4_piece, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":677 + /* "w3lib/_url.pyx":742 * ipv4_piece = ipv4_piece * 10 + number * if ipv4_piece > 255: * raise ValueError # <<<<<<<<<<<<<< @@ -9271,9 +9531,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p * assert isinstance(ipv4_piece, int) */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 677, __pyx_L1_error) + __PYX_ERR(0, 742, __pyx_L1_error) - /* "w3lib/_url.pyx":676 + /* "w3lib/_url.pyx":741 * else: * ipv4_piece = ipv4_piece * 10 + number * if ipv4_piece > 255: # <<<<<<<<<<<<<< @@ -9282,20 +9542,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":678 + /* "w3lib/_url.pyx":743 * if ipv4_piece > 255: * raise ValueError * pointer += 1 # <<<<<<<<<<<<<< * assert isinstance(ipv4_piece, int) * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); __pyx_t_1 = 0; } - /* "w3lib/_url.pyx":679 + /* "w3lib/_url.pyx":744 * raise ValueError * pointer += 1 * assert isinstance(ipv4_piece, int) # <<<<<<<<<<<<<< @@ -9307,44 +9567,44 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p __pyx_t_3 = PyInt_Check(__pyx_v_ipv4_piece); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 679, __pyx_L1_error) + __PYX_ERR(0, 744, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 679, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 744, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":680 + /* "w3lib/_url.pyx":745 * pointer += 1 * assert isinstance(ipv4_piece, int) * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece # <<<<<<<<<<<<<< * numbers_seen += 1 * if numbers_seen in (2, 4): */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_ipv4_piece); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_ipv4_piece); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_1) < 0))) __PYX_ERR(0, 680, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_1) < 0))) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":681 + /* "w3lib/_url.pyx":746 * assert isinstance(ipv4_piece, int) * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece * numbers_seen += 1 # <<<<<<<<<<<<<< * if numbers_seen in (2, 4): * piece_index += 1 */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_numbers_seen, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_numbers_seen, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_numbers_seen, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":682 + /* "w3lib/_url.pyx":747 * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece * numbers_seen += 1 * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< @@ -9353,32 +9613,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p */ __Pyx_INCREF(__pyx_v_numbers_seen); __pyx_t_1 = __pyx_v_numbers_seen; - __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 747, __pyx_L1_error) if (!__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L40_bool_binop_done; } - __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 747, __pyx_L1_error) __pyx_t_3 = __pyx_t_5; __pyx_L40_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_3; if (__pyx_t_5) { - /* "w3lib/_url.pyx":683 + /* "w3lib/_url.pyx":748 * numbers_seen += 1 * if numbers_seen in (2, 4): * piece_index += 1 # <<<<<<<<<<<<<< * if numbers_seen != 4: * raise ValueError */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":682 + /* "w3lib/_url.pyx":747 * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece * numbers_seen += 1 * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< @@ -9388,27 +9648,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p } } - /* "w3lib/_url.pyx":684 + /* "w3lib/_url.pyx":749 * if numbers_seen in (2, 4): * piece_index += 1 * if numbers_seen != 4: # <<<<<<<<<<<<<< * raise ValueError * break */ - __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_numbers_seen, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 684, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_numbers_seen, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 749, __pyx_L1_error) if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":685 + /* "w3lib/_url.pyx":750 * piece_index += 1 * if numbers_seen != 4: * raise ValueError # <<<<<<<<<<<<<< * break - * if pointer < input_lenght and input[pointer] == ":": + * if pointer < input_length and input[pointer] == ":": */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 685, __pyx_L1_error) + __PYX_ERR(0, 750, __pyx_L1_error) - /* "w3lib/_url.pyx":684 + /* "w3lib/_url.pyx":749 * if numbers_seen in (2, 4): * piece_index += 1 * if numbers_seen != 4: # <<<<<<<<<<<<<< @@ -9417,158 +9677,158 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":686 + /* "w3lib/_url.pyx":751 * if numbers_seen != 4: * raise ValueError * break # <<<<<<<<<<<<<< - * if pointer < input_lenght and input[pointer] == ":": + * if pointer < input_length and input[pointer] == ":": * pointer += 1 */ goto __pyx_L10_break; - /* "w3lib/_url.pyx":652 + /* "w3lib/_url.pyx":717 * pointer += 1 * length += 1 - * if pointer < input_lenght and input[pointer] == ".": # <<<<<<<<<<<<<< + * if pointer < input_length and input[pointer] == ".": # <<<<<<<<<<<<<< * if length == 0: * raise ValueError */ } - /* "w3lib/_url.pyx":687 + /* "w3lib/_url.pyx":752 * raise ValueError * break - * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< + * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< * pointer += 1 - * if pointer >= input_lenght: + * if pointer >= input_length: */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 687, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 687, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L44_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 687, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 687, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = __pyx_t_3; __pyx_L44_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":688 + /* "w3lib/_url.pyx":753 * break - * if pointer < input_lenght and input[pointer] == ":": + * if pointer < input_length and input[pointer] == ":": * pointer += 1 # <<<<<<<<<<<<<< - * if pointer >= input_lenght: + * if pointer >= input_length: * raise ValueError */ - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":689 - * if pointer < input_lenght and input[pointer] == ":": + /* "w3lib/_url.pyx":754 + * if pointer < input_length and input[pointer] == ":": * pointer += 1 - * if pointer >= input_lenght: # <<<<<<<<<<<<<< + * if pointer >= input_length: # <<<<<<<<<<<<<< * raise ValueError - * elif pointer < input_lenght: + * elif pointer < input_length: */ - __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":690 + /* "w3lib/_url.pyx":755 * pointer += 1 - * if pointer >= input_lenght: + * if pointer >= input_length: * raise ValueError # <<<<<<<<<<<<<< - * elif pointer < input_lenght: + * elif pointer < input_length: * raise ValueError */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 690, __pyx_L1_error) + __PYX_ERR(0, 755, __pyx_L1_error) - /* "w3lib/_url.pyx":689 - * if pointer < input_lenght and input[pointer] == ":": + /* "w3lib/_url.pyx":754 + * if pointer < input_length and input[pointer] == ":": * pointer += 1 - * if pointer >= input_lenght: # <<<<<<<<<<<<<< + * if pointer >= input_length: # <<<<<<<<<<<<<< * raise ValueError - * elif pointer < input_lenght: + * elif pointer < input_length: */ } - /* "w3lib/_url.pyx":687 + /* "w3lib/_url.pyx":752 * raise ValueError * break - * if pointer < input_lenght and input[pointer] == ":": # <<<<<<<<<<<<<< + * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< * pointer += 1 - * if pointer >= input_lenght: + * if pointer >= input_length: */ goto __pyx_L43; } - /* "w3lib/_url.pyx":691 - * if pointer >= input_lenght: + /* "w3lib/_url.pyx":756 + * if pointer >= input_length: * raise ValueError - * elif pointer < input_lenght: # <<<<<<<<<<<<<< + * elif pointer < input_length: # <<<<<<<<<<<<<< * raise ValueError * address[piece_index] = value */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_lenght); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 691, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 691, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":692 + /* "w3lib/_url.pyx":757 * raise ValueError - * elif pointer < input_lenght: + * elif pointer < input_length: * raise ValueError # <<<<<<<<<<<<<< * address[piece_index] = value * piece_index += 1 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 692, __pyx_L1_error) + __PYX_ERR(0, 757, __pyx_L1_error) - /* "w3lib/_url.pyx":691 - * if pointer >= input_lenght: + /* "w3lib/_url.pyx":756 + * if pointer >= input_length: * raise ValueError - * elif pointer < input_lenght: # <<<<<<<<<<<<<< + * elif pointer < input_length: # <<<<<<<<<<<<<< * raise ValueError * address[piece_index] = value */ } __pyx_L43:; - /* "w3lib/_url.pyx":693 - * elif pointer < input_lenght: + /* "w3lib/_url.pyx":758 + * elif pointer < input_length: * raise ValueError * address[piece_index] = value # <<<<<<<<<<<<<< * piece_index += 1 * if compress is not None: */ - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_v_value) < 0))) __PYX_ERR(0, 693, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_v_value) < 0))) __PYX_ERR(0, 758, __pyx_L1_error) - /* "w3lib/_url.pyx":694 + /* "w3lib/_url.pyx":759 * raise ValueError * address[piece_index] = value * piece_index += 1 # <<<<<<<<<<<<<< * if compress is not None: * swaps = piece_index - compress */ - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 694, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_7); __pyx_t_7 = 0; @@ -9576,7 +9836,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p } __pyx_L10_break:; - /* "w3lib/_url.pyx":695 + /* "w3lib/_url.pyx":760 * address[piece_index] = value * piece_index += 1 * if compress is not None: # <<<<<<<<<<<<<< @@ -9586,19 +9846,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p __pyx_t_5 = (__pyx_v_compress != Py_None); if (__pyx_t_5) { - /* "w3lib/_url.pyx":696 + /* "w3lib/_url.pyx":761 * piece_index += 1 * if compress is not None: * swaps = piece_index - compress # <<<<<<<<<<<<<< * piece_index = 7 * while piece_index != 0 and swaps > 0: */ - __pyx_t_7 = PyNumber_Subtract(__pyx_v_piece_index, __pyx_v_compress); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_v_piece_index, __pyx_v_compress); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_swaps = __pyx_t_7; __pyx_t_7 = 0; - /* "w3lib/_url.pyx":697 + /* "w3lib/_url.pyx":762 * if compress is not None: * swaps = piece_index - compress * piece_index = 7 # <<<<<<<<<<<<<< @@ -9608,7 +9868,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(__pyx_int_7); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_int_7); - /* "w3lib/_url.pyx":698 + /* "w3lib/_url.pyx":763 * swaps = piece_index - compress * piece_index = 7 * while piece_index != 0 and swaps > 0: # <<<<<<<<<<<<<< @@ -9616,89 +9876,89 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p * address[compress + swaps - 1], */ while (1) { - __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 763, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L50_bool_binop_done; } - __pyx_t_7 = PyObject_RichCompare(__pyx_v_swaps, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 698, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_swaps, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = __pyx_t_3; __pyx_L50_bool_binop_done:; if (!__pyx_t_5) break; - /* "w3lib/_url.pyx":700 + /* "w3lib/_url.pyx":765 * while piece_index != 0 and swaps > 0: * address[piece_index], address[compress + swaps - 1] = ( * address[compress + swaps - 1], # <<<<<<<<<<<<<< * address[piece_index], * ) */ - __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":701 + /* "w3lib/_url.pyx":766 * address[piece_index], address[compress + swaps - 1] = ( * address[compress + swaps - 1], * address[piece_index], # <<<<<<<<<<<<<< * ) * piece_index -= 1 */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":699 + /* "w3lib/_url.pyx":764 * piece_index = 7 * while piece_index != 0 and swaps > 0: * address[piece_index], address[compress + swaps - 1] = ( # <<<<<<<<<<<<<< * address[compress + swaps - 1], * address[piece_index], */ - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_7) < 0))) __PYX_ERR(0, 699, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_7) < 0))) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_t_6, __pyx_t_1) < 0))) __PYX_ERR(0, 699, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_t_6, __pyx_t_1) < 0))) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":703 + /* "w3lib/_url.pyx":768 * address[piece_index], * ) * piece_index -= 1 # <<<<<<<<<<<<<< * swaps -= 1 * elif compress is None and piece_index != 8: */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":704 + /* "w3lib/_url.pyx":769 * ) * piece_index -= 1 * swaps -= 1 # <<<<<<<<<<<<<< * elif compress is None and piece_index != 8: * raise ValueError */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_swaps, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_swaps, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_swaps, __pyx_t_1); __pyx_t_1 = 0; } - /* "w3lib/_url.pyx":695 + /* "w3lib/_url.pyx":760 * address[piece_index] = value * piece_index += 1 * if compress is not None: # <<<<<<<<<<<<<< @@ -9708,7 +9968,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p goto __pyx_L47; } - /* "w3lib/_url.pyx":705 + /* "w3lib/_url.pyx":770 * piece_index -= 1 * swaps -= 1 * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< @@ -9721,12 +9981,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p __pyx_t_5 = __pyx_t_3; goto __pyx_L52_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 705, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 770, __pyx_L1_error) __pyx_t_5 = __pyx_t_3; __pyx_L52_bool_binop_done:; if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":706 + /* "w3lib/_url.pyx":771 * swaps -= 1 * elif compress is None and piece_index != 8: * raise ValueError # <<<<<<<<<<<<<< @@ -9734,9 +9994,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p * */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 706, __pyx_L1_error) + __PYX_ERR(0, 771, __pyx_L1_error) - /* "w3lib/_url.pyx":705 + /* "w3lib/_url.pyx":770 * piece_index -= 1 * swaps -= 1 * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< @@ -9746,7 +10006,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p } __pyx_L47:; - /* "w3lib/_url.pyx":707 + /* "w3lib/_url.pyx":772 * elif compress is None and piece_index != 8: * raise ValueError * return address # <<<<<<<<<<<<<< @@ -9758,7 +10018,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p __pyx_r = __pyx_v_address; goto __pyx_L0; - /* "w3lib/_url.pyx":623 + /* "w3lib/_url.pyx":688 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< @@ -9790,7 +10050,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":710 +/* "w3lib/_url.pyx":775 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -9854,7 +10114,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 710, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 775, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -9862,14 +10122,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 710, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 775, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, 1); __PYX_ERR(0, 710, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, 1); __PYX_ERR(0, 775, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_utf_8_percent_encode") < 0)) __PYX_ERR(0, 710, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_utf_8_percent_encode") < 0)) __PYX_ERR(0, 775, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -9882,7 +10142,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 710, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 775, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9896,7 +10156,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 711, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 776, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_percent_encode_set); /* function exit code */ @@ -9926,7 +10186,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_utf_8_percent_encode", 1); - /* "w3lib/_url.pyx":714 + /* "w3lib/_url.pyx":779 * percent_encode_set: _PercentEncodeSet, * ) -> str: * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< @@ -9934,60 +10194,60 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyO * encoding="utf-8", */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":715 + /* "w3lib/_url.pyx":780 * ) -> str: * return _percent_encode_after_encoding( * input, # <<<<<<<<<<<<<< * encoding="utf-8", * percent_encode_set=percent_encode_set, */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_input); __Pyx_GIVEREF(__pyx_v_input); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input)) __PYX_ERR(0, 714, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input)) __PYX_ERR(0, 779, __pyx_L1_error); - /* "w3lib/_url.pyx":716 + /* "w3lib/_url.pyx":781 * return _percent_encode_after_encoding( * input, * encoding="utf-8", # <<<<<<<<<<<<<< * percent_encode_set=percent_encode_set, * ) */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 716, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 716, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 781, __pyx_L1_error) - /* "w3lib/_url.pyx":717 + /* "w3lib/_url.pyx":782 * input, * encoding="utf-8", * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< * ) * */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 716, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 781, __pyx_L1_error) - /* "w3lib/_url.pyx":714 + /* "w3lib/_url.pyx":779 * percent_encode_set: _PercentEncodeSet, * ) -> str: * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< * input, * encoding="utf-8", */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 714, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 779, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":710 + /* "w3lib/_url.pyx":775 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -10009,7 +10269,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyO return __pyx_r; } -/* "w3lib/_url.pyx":722 +/* "w3lib/_url.pyx":787 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< @@ -10070,12 +10330,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 722, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 787, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_opaque_host") < 0)) __PYX_ERR(0, 722, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_opaque_host") < 0)) __PYX_ERR(0, 787, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -10086,7 +10346,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_opaque_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 722, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_opaque_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 787, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10100,7 +10360,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 722, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 787, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_14_parse_opaque_host(__pyx_self, __pyx_v_input); /* function exit code */ @@ -10139,7 +10399,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_opaque_host", 1); - /* "w3lib/_url.pyx":723 + /* "w3lib/_url.pyx":788 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: * for code_point in input: # <<<<<<<<<<<<<< @@ -10148,28 +10408,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObje */ __Pyx_INCREF(__pyx_v_input); __pyx_t_1 = __pyx_v_input; - __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 788, __pyx_L1_error) for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) { __pyx_t_2 = __pyx_t_7; __pyx_v_code_point = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2); - /* "w3lib/_url.pyx":724 + /* "w3lib/_url.pyx":789 * def _parse_opaque_host(input: str) -> str: * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< * raise ValueError * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) */ - __pyx_t_8 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(__pyx_t_10)) { - /* "w3lib/_url.pyx":725 + /* "w3lib/_url.pyx":790 * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: * raise ValueError # <<<<<<<<<<<<<< @@ -10177,9 +10437,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObje * */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 725, __pyx_L1_error) + __PYX_ERR(0, 790, __pyx_L1_error) - /* "w3lib/_url.pyx":724 + /* "w3lib/_url.pyx":789 * def _parse_opaque_host(input: str) -> str: * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< @@ -10190,7 +10450,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":726 + /* "w3lib/_url.pyx":791 * if code_point in _FORBIDDEN_HOST_CODE_POINTS: * raise ValueError * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) # <<<<<<<<<<<<<< @@ -10198,9 +10458,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObje * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_5 = 0; @@ -10221,16 +10481,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObje __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 726, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_9))) __PYX_ERR(0, 726, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_9))) __PYX_ERR(0, 791, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":722 + /* "w3lib/_url.pyx":787 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< @@ -10253,7 +10513,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObje return __pyx_r; } -/* "w3lib/_url.pyx":730 +/* "w3lib/_url.pyx":795 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< @@ -10314,12 +10574,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 730, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 795, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4_number") < 0)) __PYX_ERR(0, 730, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4_number") < 0)) __PYX_ERR(0, 795, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -10330,7 +10590,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv4_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 730, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_ipv4_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 795, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10344,7 +10604,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 730, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 795, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_16_parse_ipv4_number(__pyx_self, __pyx_v_input); /* function exit code */ @@ -10380,7 +10640,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje __Pyx_RefNannySetupContext("_parse_ipv4_number", 0); __Pyx_INCREF(__pyx_v_input); - /* "w3lib/_url.pyx":731 + /* "w3lib/_url.pyx":796 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: * if not input: # <<<<<<<<<<<<<< @@ -10391,7 +10651,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":732 + /* "w3lib/_url.pyx":797 * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: * if not input: * raise ValueError # <<<<<<<<<<<<<< @@ -10399,9 +10659,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje * r = 10 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 732, __pyx_L1_error) + __PYX_ERR(0, 797, __pyx_L1_error) - /* "w3lib/_url.pyx":731 + /* "w3lib/_url.pyx":796 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: * if not input: # <<<<<<<<<<<<<< @@ -10410,7 +10670,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje */ } - /* "w3lib/_url.pyx":733 + /* "w3lib/_url.pyx":798 * if not input: * raise ValueError * validation_error = False # <<<<<<<<<<<<<< @@ -10419,7 +10679,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_validation_error = 0; - /* "w3lib/_url.pyx":734 + /* "w3lib/_url.pyx":799 * raise ValueError * validation_error = False * r = 10 # <<<<<<<<<<<<<< @@ -10428,40 +10688,40 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_r = 10; - /* "w3lib/_url.pyx":735 + /* "w3lib/_url.pyx":800 * validation_error = False * r = 10 * if len(input) >= 2: # <<<<<<<<<<<<<< * if input[:2] in ("0X", "0x"): * validation_error = True */ - __pyx_t_3 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 800, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 >= 2); if (__pyx_t_2) { - /* "w3lib/_url.pyx":736 + /* "w3lib/_url.pyx":801 * r = 10 * if len(input) >= 2: * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< * validation_error = True * input = input[2:] */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0X, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0X, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 801, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L6_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0x, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0x, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 801, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __pyx_L6_bool_binop_done:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_2; if (__pyx_t_1) { - /* "w3lib/_url.pyx":737 + /* "w3lib/_url.pyx":802 * if len(input) >= 2: * if input[:2] in ("0X", "0x"): * validation_error = True # <<<<<<<<<<<<<< @@ -10470,19 +10730,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_validation_error = 1; - /* "w3lib/_url.pyx":738 + /* "w3lib/_url.pyx":803 * if input[:2] in ("0X", "0x"): * validation_error = True * input = input[2:] # <<<<<<<<<<<<<< * r = 16 * elif input[0] == "0": */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":739 + /* "w3lib/_url.pyx":804 * validation_error = True * input = input[2:] * r = 16 # <<<<<<<<<<<<<< @@ -10491,7 +10751,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_r = 16; - /* "w3lib/_url.pyx":736 + /* "w3lib/_url.pyx":801 * r = 10 * if len(input) >= 2: * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< @@ -10501,18 +10761,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje goto __pyx_L5; } - /* "w3lib/_url.pyx":740 + /* "w3lib/_url.pyx":805 * input = input[2:] * r = 16 * elif input[0] == "0": # <<<<<<<<<<<<<< * validation_error = True * input = input[1:] */ - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 805, __pyx_L1_error) __pyx_t_1 = (__pyx_t_5 == 48); if (__pyx_t_1) { - /* "w3lib/_url.pyx":741 + /* "w3lib/_url.pyx":806 * r = 16 * elif input[0] == "0": * validation_error = True # <<<<<<<<<<<<<< @@ -10521,19 +10781,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_validation_error = 1; - /* "w3lib/_url.pyx":742 + /* "w3lib/_url.pyx":807 * elif input[0] == "0": * validation_error = True * input = input[1:] # <<<<<<<<<<<<<< * r = 8 * if not input: */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":743 + /* "w3lib/_url.pyx":808 * validation_error = True * input = input[1:] * r = 8 # <<<<<<<<<<<<<< @@ -10542,7 +10802,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_r = 8; - /* "w3lib/_url.pyx":740 + /* "w3lib/_url.pyx":805 * input = input[2:] * r = 16 * elif input[0] == "0": # <<<<<<<<<<<<<< @@ -10552,7 +10812,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje } __pyx_L5:; - /* "w3lib/_url.pyx":735 + /* "w3lib/_url.pyx":800 * validation_error = False * r = 10 * if len(input) >= 2: # <<<<<<<<<<<<<< @@ -10561,7 +10821,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje */ } - /* "w3lib/_url.pyx":744 + /* "w3lib/_url.pyx":809 * input = input[1:] * r = 8 * if not input: # <<<<<<<<<<<<<< @@ -10572,7 +10832,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "w3lib/_url.pyx":745 + /* "w3lib/_url.pyx":810 * r = 8 * if not input: * return (0, True) # <<<<<<<<<<<<<< @@ -10584,7 +10844,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje __pyx_r = __pyx_tuple__7; goto __pyx_L0; - /* "w3lib/_url.pyx":744 + /* "w3lib/_url.pyx":809 * input = input[1:] * r = 8 * if not input: # <<<<<<<<<<<<<< @@ -10593,7 +10853,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje */ } - /* "w3lib/_url.pyx":746 + /* "w3lib/_url.pyx":811 * if not input: * return (0, True) * return (int(input, base=r), validation_error) # <<<<<<<<<<<<<< @@ -10601,36 +10861,36 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_input); __Pyx_GIVEREF(__pyx_v_input); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_input)) __PYX_ERR(0, 746, __pyx_L1_error); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 746, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_input)) __PYX_ERR(0, 811, __pyx_L1_error); + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base, __pyx_t_7) < 0) __PYX_ERR(0, 746, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base, __pyx_t_7) < 0) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_validation_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_validation_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 746, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 746, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 811, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":730 + /* "w3lib/_url.pyx":795 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< @@ -10652,7 +10912,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje return __pyx_r; } -/* "w3lib/_url.pyx":750 +/* "w3lib/_url.pyx":815 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< @@ -10713,12 +10973,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 750, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 815, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ends_in_number") < 0)) __PYX_ERR(0, 750, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ends_in_number") < 0)) __PYX_ERR(0, 815, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -10729,7 +10989,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_ends_in_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 750, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_ends_in_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 815, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10743,7 +11003,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 750, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 815, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_18_ends_in_number(__pyx_self, __pyx_v_input); /* function exit code */ @@ -10762,7 +11022,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "w3lib/_url.pyx":757 +/* "w3lib/_url.pyx":822 * parts = parts[:-1] * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< @@ -10782,7 +11042,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED P if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 757, __pyx_L1_error) + __PYX_ERR(0, 822, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10790,7 +11050,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED P __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_15_ends_in_number_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ends_in_number_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_15_ends_in_number_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ends_in_number_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10828,16 +11088,16 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 757, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 757, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 822, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 822, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 822, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -10845,28 +11105,28 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 757, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 822, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 757, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 822, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -10876,7 +11136,7 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 757, __pyx_L1_error) + else __PYX_ERR(0, 822, __pyx_L1_error) } break; } @@ -10886,9 +11146,9 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { @@ -10926,7 +11186,7 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout return __pyx_r; } -/* "w3lib/_url.pyx":750 +/* "w3lib/_url.pyx":815 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< @@ -10955,51 +11215,51 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_ends_in_number", 1); - /* "w3lib/_url.pyx":751 + /* "w3lib/_url.pyx":816 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: * parts = input.split(".") # <<<<<<<<<<<<<< * if parts and parts[-1] == "": * if len(parts) == 1: */ - __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parts = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":752 + /* "w3lib/_url.pyx":817 * def _ends_in_number(input: str) -> bool: * parts = input.split(".") * if parts and parts[-1] == "": # <<<<<<<<<<<<<< * if len(parts) == 1: * return False */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":753 + /* "w3lib/_url.pyx":818 * parts = input.split(".") * if parts and parts[-1] == "": * if len(parts) == 1: # <<<<<<<<<<<<<< * return False * parts = parts[:-1] */ - __pyx_t_4 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 753, __pyx_L1_error) + __pyx_t_4 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 818, __pyx_L1_error) __pyx_t_2 = (__pyx_t_4 == 1); if (__pyx_t_2) { - /* "w3lib/_url.pyx":754 + /* "w3lib/_url.pyx":819 * if parts and parts[-1] == "": * if len(parts) == 1: * return False # <<<<<<<<<<<<<< @@ -11011,7 +11271,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject __pyx_r = Py_False; goto __pyx_L0; - /* "w3lib/_url.pyx":753 + /* "w3lib/_url.pyx":818 * parts = input.split(".") * if parts and parts[-1] == "": * if len(parts) == 1: # <<<<<<<<<<<<<< @@ -11020,19 +11280,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":755 + /* "w3lib/_url.pyx":820 * if len(parts) == 1: * return False * parts = parts[:-1] # <<<<<<<<<<<<<< * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":752 + /* "w3lib/_url.pyx":817 * def _ends_in_number(input: str) -> bool: * parts = input.split(".") * if parts and parts[-1] == "": # <<<<<<<<<<<<<< @@ -11041,43 +11301,43 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":756 + /* "w3lib/_url.pyx":821 * return False * parts = parts[:-1] * last = parts[-1] # <<<<<<<<<<<<<< * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_last = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":757 + /* "w3lib/_url.pyx":822 * parts = parts[:-1] * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< * return True * try: */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_last); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_last); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L8_bool_binop_done; } - __pyx_t_1 = __pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(NULL, __pyx_v_last); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(NULL, __pyx_v_last); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L8_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":758 + /* "w3lib/_url.pyx":823 * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True # <<<<<<<<<<<<<< @@ -11089,7 +11349,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject __pyx_r = Py_True; goto __pyx_L0; - /* "w3lib/_url.pyx":757 + /* "w3lib/_url.pyx":822 * parts = parts[:-1] * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< @@ -11098,7 +11358,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":759 + /* "w3lib/_url.pyx":824 * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True * try: # <<<<<<<<<<<<<< @@ -11114,14 +11374,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { - /* "w3lib/_url.pyx":760 + /* "w3lib/_url.pyx":825 * return True * try: * _parse_ipv4_number(last) # <<<<<<<<<<<<<< * except ValueError: * return False */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L10_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -11141,13 +11401,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_last}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L10_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 825, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":759 + /* "w3lib/_url.pyx":824 * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True * try: # <<<<<<<<<<<<<< @@ -11164,7 +11424,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":761 + /* "w3lib/_url.pyx":826 * try: * _parse_ipv4_number(last) * except ValueError: # <<<<<<<<<<<<<< @@ -11174,12 +11434,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_10) { __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(0, 761, __pyx_L12_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(0, 826, __pyx_L12_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_9); - /* "w3lib/_url.pyx":762 + /* "w3lib/_url.pyx":827 * _parse_ipv4_number(last) * except ValueError: * return False # <<<<<<<<<<<<<< @@ -11196,7 +11456,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject } goto __pyx_L12_except_error; - /* "w3lib/_url.pyx":759 + /* "w3lib/_url.pyx":824 * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True * try: # <<<<<<<<<<<<<< @@ -11218,7 +11478,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject __pyx_L15_try_end:; } - /* "w3lib/_url.pyx":763 + /* "w3lib/_url.pyx":828 * except ValueError: * return False * return True # <<<<<<<<<<<<<< @@ -11230,7 +11490,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject __pyx_r = Py_True; goto __pyx_L0; - /* "w3lib/_url.pyx":750 + /* "w3lib/_url.pyx":815 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< @@ -11254,7 +11514,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":767 +/* "w3lib/_url.pyx":832 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< @@ -11315,12 +11575,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 767, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4") < 0)) __PYX_ERR(0, 767, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4") < 0)) __PYX_ERR(0, 832, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -11331,7 +11591,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 767, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 832, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11345,7 +11605,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 767, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 832, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_20_parse_ipv4(__pyx_self, __pyx_v_input); /* function exit code */ @@ -11364,7 +11624,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "w3lib/_url.pyx":777 +/* "w3lib/_url.pyx":842 * result = _parse_ipv4_number(part) * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< @@ -11384,7 +11644,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObj if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 777, __pyx_L1_error) + __PYX_ERR(0, 842, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -11392,7 +11652,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObj __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_ipv4_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_ipv4_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -11428,30 +11688,30 @@ static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_Coroutine return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 777, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 777, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 842, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 777, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 842, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 842, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_item, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_item, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { __Pyx_XDECREF(__pyx_r); @@ -11488,7 +11748,7 @@ static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_Coroutine return __pyx_r; } -/* "w3lib/_url.pyx":767 +/* "w3lib/_url.pyx":832 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< @@ -11523,53 +11783,53 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_ipv4", 1); - /* "w3lib/_url.pyx":768 + /* "w3lib/_url.pyx":833 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: * parts = input.split(".") # <<<<<<<<<<<<<< * if parts and not parts[-1]: * parts = parts[:-1] */ - __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parts = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":769 + /* "w3lib/_url.pyx":834 * def _parse_ipv4(input: str) -> int: * parts = input.split(".") * if parts and not parts[-1]: # <<<<<<<<<<<<<< * parts = parts[:-1] * if len(parts) > 4: */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 769, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 834, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 769, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (!__pyx_t_3); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":770 + /* "w3lib/_url.pyx":835 * parts = input.split(".") * if parts and not parts[-1]: * parts = parts[:-1] # <<<<<<<<<<<<<< * if len(parts) > 4: * raise ValueError */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":769 + /* "w3lib/_url.pyx":834 * def _parse_ipv4(input: str) -> int: * parts = input.split(".") * if parts and not parts[-1]: # <<<<<<<<<<<<<< @@ -11578,18 +11838,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":771 + /* "w3lib/_url.pyx":836 * if parts and not parts[-1]: * parts = parts[:-1] * if len(parts) > 4: # <<<<<<<<<<<<<< * raise ValueError * numbers = [] */ - __pyx_t_5 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_5 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 836, __pyx_L1_error) __pyx_t_2 = (__pyx_t_5 > 4); if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":772 + /* "w3lib/_url.pyx":837 * parts = parts[:-1] * if len(parts) > 4: * raise ValueError # <<<<<<<<<<<<<< @@ -11597,9 +11857,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p * for part in parts: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 772, __pyx_L1_error) + __PYX_ERR(0, 837, __pyx_L1_error) - /* "w3lib/_url.pyx":771 + /* "w3lib/_url.pyx":836 * if parts and not parts[-1]: * parts = parts[:-1] * if len(parts) > 4: # <<<<<<<<<<<<<< @@ -11608,19 +11868,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":773 + /* "w3lib/_url.pyx":838 * if len(parts) > 4: * raise ValueError * numbers = [] # <<<<<<<<<<<<<< * for part in parts: * result = _parse_ipv4_number(part) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_numbers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":774 + /* "w3lib/_url.pyx":839 * raise ValueError * numbers = [] * for part in parts: # <<<<<<<<<<<<<< @@ -11632,9 +11892,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 839, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -11642,28 +11902,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 774, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 839, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 839, __pyx_L1_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 774, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 839, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 839, __pyx_L1_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -11673,7 +11933,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 774, __pyx_L1_error) + else __PYX_ERR(0, 839, __pyx_L1_error) } break; } @@ -11682,14 +11942,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p __Pyx_XDECREF_SET(__pyx_v_part, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":775 + /* "w3lib/_url.pyx":840 * numbers = [] * for part in parts: * result = _parse_ipv4_number(part) # <<<<<<<<<<<<<< * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 775, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -11709,26 +11969,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_part}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 775, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":776 + /* "w3lib/_url.pyx":841 * for part in parts: * result = _parse_ipv4_number(part) * numbers.append(result[0]) # <<<<<<<<<<<<<< * if any(item > 255 for item in numbers[:-1]): * raise ValueError */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 776, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_numbers, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 776, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_numbers, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":774 + /* "w3lib/_url.pyx":839 * raise ValueError * numbers = [] * for part in parts: # <<<<<<<<<<<<<< @@ -11738,26 +11998,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":777 + /* "w3lib/_url.pyx":842 * result = _parse_ipv4_number(part) * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< * raise ValueError * if numbers[-1] >= 256 ** (5 - len(numbers)): */ - __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_7 = __pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":778 + /* "w3lib/_url.pyx":843 * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): * raise ValueError # <<<<<<<<<<<<<< @@ -11765,9 +12025,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p * raise ValueError */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 778, __pyx_L1_error) + __PYX_ERR(0, 843, __pyx_L1_error) - /* "w3lib/_url.pyx":777 + /* "w3lib/_url.pyx":842 * result = _parse_ipv4_number(part) * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< @@ -11776,26 +12036,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":779 + /* "w3lib/_url.pyx":844 * if any(item > 255 for item in numbers[:-1]): * raise ValueError * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< * raise ValueError * ipv4 = numbers[-1] */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyList_GET_SIZE(__pyx_v_numbers); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 779, __pyx_L1_error) - __pyx_t_7 = PyFloat_FromDouble(pow(256.0, ((double)(5 - __pyx_t_5)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 779, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyList_GET_SIZE(__pyx_v_numbers); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(pow(256.0, ((double)(5 - __pyx_t_5)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 779, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 779, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":780 + /* "w3lib/_url.pyx":845 * raise ValueError * if numbers[-1] >= 256 ** (5 - len(numbers)): * raise ValueError # <<<<<<<<<<<<<< @@ -11803,9 +12063,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p * counter = 0 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 780, __pyx_L1_error) + __PYX_ERR(0, 845, __pyx_L1_error) - /* "w3lib/_url.pyx":779 + /* "w3lib/_url.pyx":844 * if any(item > 255 for item in numbers[:-1]): * raise ValueError * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< @@ -11814,19 +12074,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":781 + /* "w3lib/_url.pyx":846 * if numbers[-1] >= 256 ** (5 - len(numbers)): * raise ValueError * ipv4 = numbers[-1] # <<<<<<<<<<<<<< * counter = 0 * for n in numbers[:-1]: */ - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_ipv4 = __pyx_t_8; __pyx_t_8 = 0; - /* "w3lib/_url.pyx":782 + /* "w3lib/_url.pyx":847 * raise ValueError * ipv4 = numbers[-1] * counter = 0 # <<<<<<<<<<<<<< @@ -11836,14 +12096,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(__pyx_int_0); __pyx_v_counter = __pyx_int_0; - /* "w3lib/_url.pyx":783 + /* "w3lib/_url.pyx":848 * ipv4 = numbers[-1] * counter = 0 * for n in numbers[:-1]: # <<<<<<<<<<<<<< * ipv4 += n * 256 ** (3 - counter) * counter += 1 */ - __pyx_t_8 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 783, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0; @@ -11852,53 +12112,53 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 783, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 848, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 783, __pyx_L1_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 848, __pyx_L1_error) #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 783, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_8); __pyx_t_8 = 0; - /* "w3lib/_url.pyx":784 + /* "w3lib/_url.pyx":849 * counter = 0 * for n in numbers[:-1]: * ipv4 += n * 256 ** (3 - counter) # <<<<<<<<<<<<<< * counter += 1 * return ipv4 */ - __pyx_t_8 = __Pyx_PyInt_SubtractCObj(__pyx_int_3, __pyx_v_counter, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 784, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_SubtractCObj(__pyx_int_3, __pyx_v_counter, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyNumber_Power(__pyx_int_256, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error) + __pyx_t_1 = PyNumber_Power(__pyx_int_256, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 784, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ipv4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ipv4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_ipv4, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":785 + /* "w3lib/_url.pyx":850 * for n in numbers[:-1]: * ipv4 += n * 256 ** (3 - counter) * counter += 1 # <<<<<<<<<<<<<< * return ipv4 * */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_counter, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_counter, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_counter, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":783 + /* "w3lib/_url.pyx":848 * ipv4 = numbers[-1] * counter = 0 * for n in numbers[:-1]: # <<<<<<<<<<<<<< @@ -11908,7 +12168,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":786 + /* "w3lib/_url.pyx":851 * ipv4 += n * 256 ** (3 - counter) * counter += 1 * return ipv4 # <<<<<<<<<<<<<< @@ -11916,12 +12176,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_ipv4))||((__pyx_v_ipv4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_ipv4))) __PYX_ERR(0, 786, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_ipv4))||((__pyx_v_ipv4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_ipv4))) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_INCREF(__pyx_v_ipv4); __pyx_r = ((PyObject*)__pyx_v_ipv4); goto __pyx_L0; - /* "w3lib/_url.pyx":767 + /* "w3lib/_url.pyx":832 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< @@ -11951,7 +12211,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":790 +/* "w3lib/_url.pyx":855 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< @@ -12014,18 +12274,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_domain_to_ascii") < 0)) __PYX_ERR(0, 790, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_domain_to_ascii") < 0)) __PYX_ERR(0, 855, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -12037,7 +12297,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_domain_to_ascii", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 790, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_domain_to_ascii", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 855, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12051,7 +12311,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain), (&PyUnicode_Type), 0, "domain", 1))) __PYX_ERR(0, 790, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain), (&PyUnicode_Type), 0, "domain", 1))) __PYX_ERR(0, 855, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_22_domain_to_ascii(__pyx_self, __pyx_v_domain, __pyx_v_be_strict); /* function exit code */ @@ -12086,96 +12346,96 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_domain_to_ascii", 1); - /* "w3lib/_url.pyx":791 + /* "w3lib/_url.pyx":856 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: * result = _utr46._to_ascii( # <<<<<<<<<<<<<< * domain, * use_std3_ascii_rules=be_strict, */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utr46); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utr46); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_ascii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_ascii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":792 + /* "w3lib/_url.pyx":857 * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: * result = _utr46._to_ascii( * domain, # <<<<<<<<<<<<<< * use_std3_ascii_rules=be_strict, * check_hyphens=False, */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_domain); __Pyx_GIVEREF(__pyx_v_domain); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domain)) __PYX_ERR(0, 791, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domain)) __PYX_ERR(0, 856, __pyx_L1_error); - /* "w3lib/_url.pyx":793 + /* "w3lib/_url.pyx":858 * result = _utr46._to_ascii( * domain, * use_std3_ascii_rules=be_strict, # <<<<<<<<<<<<<< * check_hyphens=False, * check_bidi=True, */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_v_be_strict) < 0) __PYX_ERR(0, 793, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_v_be_strict) < 0) __PYX_ERR(0, 858, __pyx_L1_error) - /* "w3lib/_url.pyx":794 + /* "w3lib/_url.pyx":859 * domain, * use_std3_ascii_rules=be_strict, * check_hyphens=False, # <<<<<<<<<<<<<< * check_bidi=True, * check_joiners=True, */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, Py_False) < 0) __PYX_ERR(0, 793, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, Py_False) < 0) __PYX_ERR(0, 858, __pyx_L1_error) - /* "w3lib/_url.pyx":795 + /* "w3lib/_url.pyx":860 * use_std3_ascii_rules=be_strict, * check_hyphens=False, * check_bidi=True, # <<<<<<<<<<<<<< * check_joiners=True, * transitional_processing=False, */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, Py_True) < 0) __PYX_ERR(0, 793, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, Py_True) < 0) __PYX_ERR(0, 858, __pyx_L1_error) - /* "w3lib/_url.pyx":796 + /* "w3lib/_url.pyx":861 * check_hyphens=False, * check_bidi=True, * check_joiners=True, # <<<<<<<<<<<<<< * transitional_processing=False, * verify_dns_length=be_strict, */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, Py_True) < 0) __PYX_ERR(0, 793, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, Py_True) < 0) __PYX_ERR(0, 858, __pyx_L1_error) - /* "w3lib/_url.pyx":797 + /* "w3lib/_url.pyx":862 * check_bidi=True, * check_joiners=True, * transitional_processing=False, # <<<<<<<<<<<<<< * verify_dns_length=be_strict, * ) */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, Py_False) < 0) __PYX_ERR(0, 793, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, Py_False) < 0) __PYX_ERR(0, 858, __pyx_L1_error) - /* "w3lib/_url.pyx":798 + /* "w3lib/_url.pyx":863 * check_joiners=True, * transitional_processing=False, * verify_dns_length=be_strict, # <<<<<<<<<<<<<< * ) * if not result: */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_v_be_strict) < 0) __PYX_ERR(0, 793, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_v_be_strict) < 0) __PYX_ERR(0, 858, __pyx_L1_error) - /* "w3lib/_url.pyx":791 + /* "w3lib/_url.pyx":856 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: * result = _utr46._to_ascii( # <<<<<<<<<<<<<< * domain, * use_std3_ascii_rules=be_strict, */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 791, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -12183,25 +12443,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject __pyx_v_result = __pyx_t_4; __pyx_t_4 = 0; - /* "w3lib/_url.pyx":800 + /* "w3lib/_url.pyx":865 * verify_dns_length=be_strict, * ) * if not result: # <<<<<<<<<<<<<< * raise ValueError( * f"Domain name {domain!r} is an empty string after conversion to " */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 800, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 865, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (unlikely(__pyx_t_6)) { - /* "w3lib/_url.pyx":802 + /* "w3lib/_url.pyx":867 * if not result: * raise ValueError( * f"Domain name {domain!r} is an empty string after conversion to " # <<<<<<<<<<<<<< * f"ASCII, which makes for an invalid domain name." * ) */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_8 = 127; @@ -12209,7 +12469,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject __pyx_t_7 += 12; __Pyx_GIVEREF(__pyx_kp_u_Domain_name); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Domain_name); - __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8; __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); @@ -12220,25 +12480,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject __pyx_t_7 += 86; __Pyx_GIVEREF(__pyx_kp_u_is_an_empty_string_after_conver); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_is_an_empty_string_after_conver); - __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":801 + /* "w3lib/_url.pyx":866 * ) * if not result: * raise ValueError( # <<<<<<<<<<<<<< * f"Domain name {domain!r} is an empty string after conversion to " * f"ASCII, which makes for an invalid domain name." */ - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 801, __pyx_L1_error) + __PYX_ERR(0, 866, __pyx_L1_error) - /* "w3lib/_url.pyx":800 + /* "w3lib/_url.pyx":865 * verify_dns_length=be_strict, * ) * if not result: # <<<<<<<<<<<<<< @@ -12247,7 +12507,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":805 + /* "w3lib/_url.pyx":870 * f"ASCII, which makes for an invalid domain name." * ) * return result # <<<<<<<<<<<<<< @@ -12255,12 +12515,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_result))) __PYX_ERR(0, 805, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_result))) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_INCREF(__pyx_v_result); __pyx_r = ((PyObject*)__pyx_v_result); goto __pyx_L0; - /* "w3lib/_url.pyx":790 + /* "w3lib/_url.pyx":855 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< @@ -12283,7 +12543,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":809 +/* "w3lib/_url.pyx":874 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< @@ -12331,7 +12591,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_is_special,0}; - /* "w3lib/_url.pyx":812 + /* "w3lib/_url.pyx":877 * input: str, * *, * is_special: bool = True, # <<<<<<<<<<<<<< @@ -12354,18 +12614,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 874, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 874, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_host") < 0)) __PYX_ERR(0, 809, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_host") < 0)) __PYX_ERR(0, 874, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -12377,7 +12637,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 809, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 874, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12391,10 +12651,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 810, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 875, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_24_parse_host(__pyx_self, __pyx_v_input, __pyx_v_is_special); - /* "w3lib/_url.pyx":809 + /* "w3lib/_url.pyx":874 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< @@ -12437,28 +12697,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_host", 1); - /* "w3lib/_url.pyx":814 + /* "w3lib/_url.pyx":879 * is_special: bool = True, * ) -> Union[str, int, List[int]]: * if input.startswith("["): # <<<<<<<<<<<<<< * if not input.endswith("]"): * raise ValueError */ - __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 879, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":815 + /* "w3lib/_url.pyx":880 * ) -> Union[str, int, List[int]]: * if input.startswith("["): * if not input.endswith("]"): # <<<<<<<<<<<<<< * raise ValueError * return _parse_ipv6(input[1:-1]) */ - __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__9, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 815, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__9, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 880, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":816 + /* "w3lib/_url.pyx":881 * if input.startswith("["): * if not input.endswith("]"): * raise ValueError # <<<<<<<<<<<<<< @@ -12466,9 +12726,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p * if not is_special: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 881, __pyx_L1_error) - /* "w3lib/_url.pyx":815 + /* "w3lib/_url.pyx":880 * ) -> Union[str, int, List[int]]: * if input.startswith("["): * if not input.endswith("]"): # <<<<<<<<<<<<<< @@ -12477,7 +12737,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":817 + /* "w3lib/_url.pyx":882 * if not input.endswith("]"): * raise ValueError * return _parse_ipv6(input[1:-1]) # <<<<<<<<<<<<<< @@ -12485,9 +12745,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p * return _parse_opaque_host(input) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -12508,7 +12768,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -12516,7 +12776,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":814 + /* "w3lib/_url.pyx":879 * is_special: bool = True, * ) -> Union[str, int, List[int]]: * if input.startswith("["): # <<<<<<<<<<<<<< @@ -12525,18 +12785,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":818 + /* "w3lib/_url.pyx":883 * raise ValueError * return _parse_ipv6(input[1:-1]) * if not is_special: # <<<<<<<<<<<<<< * return _parse_opaque_host(input) * domain = unquote(input) */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_is_special); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_is_special); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 883, __pyx_L1_error) __pyx_t_1 = (!__pyx_t_2); if (__pyx_t_1) { - /* "w3lib/_url.pyx":819 + /* "w3lib/_url.pyx":884 * return _parse_ipv6(input[1:-1]) * if not is_special: * return _parse_opaque_host(input) # <<<<<<<<<<<<<< @@ -12544,7 +12804,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p * ascii_domain = _domain_to_ascii(domain) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_opaque_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 819, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_opaque_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -12564,7 +12824,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -12572,7 +12832,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":818 + /* "w3lib/_url.pyx":883 * raise ValueError * return _parse_ipv6(input[1:-1]) * if not is_special: # <<<<<<<<<<<<<< @@ -12581,14 +12841,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":820 + /* "w3lib/_url.pyx":885 * if not is_special: * return _parse_opaque_host(input) * domain = unquote(input) # <<<<<<<<<<<<<< * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unquote); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 820, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unquote); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -12608,21 +12868,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 820, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_domain = __pyx_t_3; __pyx_t_3 = 0; - /* "w3lib/_url.pyx":821 + /* "w3lib/_url.pyx":886 * return _parse_opaque_host(input) * domain = unquote(input) * ascii_domain = _domain_to_ascii(domain) # <<<<<<<<<<<<<< * for code_point in ascii_domain: * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_domain_to_ascii); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 821, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_domain_to_ascii); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -12642,14 +12902,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_domain}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_ascii_domain = __pyx_t_3; __pyx_t_3 = 0; - /* "w3lib/_url.pyx":822 + /* "w3lib/_url.pyx":887 * domain = unquote(input) * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: # <<<<<<<<<<<<<< @@ -12661,9 +12921,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ascii_domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 822, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ascii_domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 822, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 887, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { @@ -12671,28 +12931,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 822, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 887, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 887, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 822, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 887, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 887, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -12702,7 +12962,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 822, __pyx_L1_error) + else __PYX_ERR(0, 887, __pyx_L1_error) } break; } @@ -12711,20 +12971,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":823 + /* "w3lib/_url.pyx":888 * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< * raise ValueError * if _ends_in_number(ascii_domain): */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 823, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 823, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_t_1)) { - /* "w3lib/_url.pyx":824 + /* "w3lib/_url.pyx":889 * for code_point in ascii_domain: * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: * raise ValueError # <<<<<<<<<<<<<< @@ -12732,9 +12992,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p * return _parse_ipv4(ascii_domain) */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 824, __pyx_L1_error) + __PYX_ERR(0, 889, __pyx_L1_error) - /* "w3lib/_url.pyx":823 + /* "w3lib/_url.pyx":888 * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< @@ -12743,7 +13003,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":822 + /* "w3lib/_url.pyx":887 * domain = unquote(input) * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: # <<<<<<<<<<<<<< @@ -12753,14 +13013,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":825 + /* "w3lib/_url.pyx":890 * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: * raise ValueError * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< * return _parse_ipv4(ascii_domain) * return ascii_domain */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ends_in_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 825, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ends_in_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -12780,15 +13040,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 825, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":826 + /* "w3lib/_url.pyx":891 * raise ValueError * if _ends_in_number(ascii_domain): * return _parse_ipv4(ascii_domain) # <<<<<<<<<<<<<< @@ -12796,7 +13056,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -12816,7 +13076,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -12824,7 +13084,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":825 + /* "w3lib/_url.pyx":890 * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: * raise ValueError * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< @@ -12833,7 +13093,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":827 + /* "w3lib/_url.pyx":892 * if _ends_in_number(ascii_domain): * return _parse_ipv4(ascii_domain) * return ascii_domain # <<<<<<<<<<<<<< @@ -12845,7 +13105,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p __pyx_r = __pyx_v_ascii_domain; goto __pyx_L0; - /* "w3lib/_url.pyx":809 + /* "w3lib/_url.pyx":874 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< @@ -12870,7 +13130,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":831 +/* "w3lib/_url.pyx":896 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< @@ -12931,12 +13191,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 831, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 896, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_windows_drive_letter") < 0)) __PYX_ERR(0, 831, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_windows_drive_letter") < 0)) __PYX_ERR(0, 896, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -12947,7 +13207,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 831, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_is_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 896, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12961,7 +13221,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 831, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 896, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(__pyx_self, __pyx_v_input); /* function exit code */ @@ -12994,7 +13254,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_is_windows_drive_letter", 1); - /* "w3lib/_url.pyx":832 + /* "w3lib/_url.pyx":897 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bool: * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" # <<<<<<<<<<<<<< @@ -13002,33 +13262,33 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 897, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 == 2); if (__pyx_t_3) { } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 832, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 897, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 832, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { } else { - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 897, __pyx_L1_error) switch (__pyx_t_5) { case 58: case 0x7C: @@ -13039,7 +13299,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED break; } __pyx_t_7 = __pyx_t_3; - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; @@ -13048,7 +13308,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":831 + /* "w3lib/_url.pyx":896 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< @@ -13069,7 +13329,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED return __pyx_r; } -/* "w3lib/_url.pyx":836 +/* "w3lib/_url.pyx":901 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< @@ -13130,12 +13390,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 836, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 901, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_starts_with_windows_drive_letter") < 0)) __PYX_ERR(0, 836, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_starts_with_windows_drive_letter") < 0)) __PYX_ERR(0, 901, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -13146,7 +13406,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_starts_with_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 836, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_starts_with_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 901, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13160,7 +13420,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 836, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 901, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(__pyx_self, __pyx_v_input); /* function exit code */ @@ -13197,17 +13457,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_starts_with_windows_drive_letter", 1); - /* "w3lib/_url.pyx":837 + /* "w3lib/_url.pyx":902 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bool: * input_length = len(input) # <<<<<<<<<<<<<< * return ( * input_length >= 2 */ - __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 902, __pyx_L1_error) __pyx_v_input_length = __pyx_t_1; - /* "w3lib/_url.pyx":838 + /* "w3lib/_url.pyx":903 * def _starts_with_windows_drive_letter(input: str) -> bool: * input_length = len(input) * return ( # <<<<<<<<<<<<<< @@ -13216,7 +13476,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHO */ __Pyx_XDECREF(__pyx_r); - /* "w3lib/_url.pyx":839 + /* "w3lib/_url.pyx":904 * input_length = len(input) * return ( * input_length >= 2 # <<<<<<<<<<<<<< @@ -13226,23 +13486,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHO __pyx_t_3 = (__pyx_v_input_length >= 2); if (__pyx_t_3) { } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L3_bool_binop_done; } - /* "w3lib/_url.pyx":840 + /* "w3lib/_url.pyx":905 * return ( * input_length >= 2 * and _is_windows_drive_letter(input[:2]) # <<<<<<<<<<<<<< * and (input_length == 2 or input[2] in "/\\?#") * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 840, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -13263,11 +13523,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHO __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 840, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 905, __pyx_L1_error) if (__pyx_t_3) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { @@ -13277,7 +13537,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHO goto __pyx_L3_bool_binop_done; } - /* "w3lib/_url.pyx":841 + /* "w3lib/_url.pyx":906 * input_length >= 2 * and _is_windows_drive_letter(input[:2]) * and (input_length == 2 or input[2] in "/\\?#") # <<<<<<<<<<<<<< @@ -13287,13 +13547,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHO __pyx_t_3 = (__pyx_v_input_length == 2); if (!__pyx_t_3) { } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_9 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == (Py_UCS4)-1)) __PYX_ERR(0, 841, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == (Py_UCS4)-1)) __PYX_ERR(0, 906, __pyx_L1_error) switch (__pyx_t_9) { case 35: case 47: @@ -13306,7 +13566,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHO break; } __pyx_t_10 = __pyx_t_3; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __pyx_t_4 = 0; @@ -13315,7 +13575,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHO __pyx_t_2 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":836 + /* "w3lib/_url.pyx":901 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< @@ -13338,7 +13598,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHO return __pyx_r; } -/* "w3lib/_url.pyx":846 +/* "w3lib/_url.pyx":911 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< @@ -13399,12 +13659,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 846, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 911, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_double_dot_path_segment") < 0)) __PYX_ERR(0, 846, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_double_dot_path_segment") < 0)) __PYX_ERR(0, 911, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -13415,7 +13675,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_double_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 846, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_is_double_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 911, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13429,7 +13689,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 846, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 911, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(__pyx_self, __pyx_v_input); /* function exit code */ @@ -13459,7 +13719,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUS int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_is_double_dot_path_segment", 1); - /* "w3lib/_url.pyx":847 + /* "w3lib/_url.pyx":912 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bool: * return input in ( # <<<<<<<<<<<<<< @@ -13469,65 +13729,65 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUS __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_input); __pyx_t_1 = __pyx_v_input; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":846 + /* "w3lib/_url.pyx":911 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< @@ -13547,7 +13807,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUS return __pyx_r; } -/* "w3lib/_url.pyx":861 +/* "w3lib/_url.pyx":926 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< @@ -13608,12 +13868,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 926, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_single_dot_path_segment") < 0)) __PYX_ERR(0, 861, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_single_dot_path_segment") < 0)) __PYX_ERR(0, 926, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -13624,7 +13884,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_single_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 861, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_is_single_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 926, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13638,7 +13898,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 861, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 926, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(__pyx_self, __pyx_v_input); /* function exit code */ @@ -13668,7 +13928,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUS int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_is_single_dot_path_segment", 1); - /* "w3lib/_url.pyx":862 + /* "w3lib/_url.pyx":927 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bool: * return input in ( # <<<<<<<<<<<<<< @@ -13678,29 +13938,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUS __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_input); __pyx_t_1 = __pyx_v_input; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 862, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 927, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 862, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 927, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 862, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 927, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":861 + /* "w3lib/_url.pyx":926 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< @@ -13720,7 +13980,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUS return __pyx_r; } -/* "w3lib/_url.pyx":872 +/* "w3lib/_url.pyx":937 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -13779,33 +14039,33 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 872, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 937, __pyx_L3_error) else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 872, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 937, __pyx_L3_error) } if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pointer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 872, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 937, __pyx_L3_error) else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_pointer); __PYX_ERR(0, 872, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_pointer); __PYX_ERR(0, 937, __pyx_L3_error) } if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encode_set)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 872, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 937, __pyx_L3_error) else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_encode_set); __PYX_ERR(0, 872, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_encode_set); __PYX_ERR(0, 937, __pyx_L3_error) } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "_idempotent_utf_8_percent_encode") < 0)) __PYX_ERR(0, 872, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "_idempotent_utf_8_percent_encode") < 0)) __PYX_ERR(0, 937, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 0)) { goto __pyx_L5_argtuple_error; } else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 872, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 937, __pyx_L3_error) } __pyx_v_input = ((PyObject*)values[0]); __pyx_v_pointer = ((PyObject*)values[1]); @@ -13813,7 +14073,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_idempotent_utf_8_percent_encode", 1, 0, 0, __pyx_nargs); __PYX_ERR(0, 872, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_idempotent_utf_8_percent_encode", 1, 0, 0, __pyx_nargs); __PYX_ERR(0, 937, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13827,8 +14087,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 873, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pointer), (&PyInt_Type), 0, "pointer", 1))) __PYX_ERR(0, 873, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 938, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pointer), (&PyInt_Type), 0, "pointer", 1))) __PYX_ERR(0, 938, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_pointer, __pyx_v_encode_set); /* function exit code */ @@ -13862,53 +14122,53 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_idempotent_utf_8_percent_encode", 1); - /* "w3lib/_url.pyx":875 + /* "w3lib/_url.pyx":940 * *, input: str, pointer: int, encode_set: _PercentEncodeSet * ) -> str: * code_point = input[pointer] # <<<<<<<<<<<<<< * if code_point == "%" and "%" in encode_set: * if ( */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 875, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 940, __pyx_L1_error) __pyx_v_code_point = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":876 + /* "w3lib/_url.pyx":941 * ) -> str: * code_point = input[pointer] * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< * if ( * pointer + 2 >= len(input) */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 941, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__4, __pyx_v_encode_set, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__4, __pyx_v_encode_set, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 941, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":878 + /* "w3lib/_url.pyx":943 * if code_point == "%" and "%" in encode_set: * if ( * pointer + 2 >= len(input) # <<<<<<<<<<<<<< * or input[pointer + 1] not in _ASCII_HEX_DIGIT * or input[pointer + 2] not in _ASCII_HEX_DIGIT */ - __pyx_t_1 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 878, __pyx_L1_error) - __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 878, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 878, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 878, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_3) { } else { @@ -13916,21 +14176,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON goto __pyx_L7_bool_binop_done; } - /* "w3lib/_url.pyx":879 + /* "w3lib/_url.pyx":944 * if ( * pointer + 2 >= len(input) * or input[pointer + 1] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * or input[pointer + 2] not in _ASCII_HEX_DIGIT * ): */ - __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_3) { @@ -13939,27 +14199,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON goto __pyx_L7_bool_binop_done; } - /* "w3lib/_url.pyx":880 + /* "w3lib/_url.pyx":945 * pointer + 2 >= len(input) * or input[pointer + 1] not in _ASCII_HEX_DIGIT * or input[pointer + 2] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * ): * return "%25" */ - __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; - /* "w3lib/_url.pyx":877 + /* "w3lib/_url.pyx":942 * code_point = input[pointer] * if code_point == "%" and "%" in encode_set: * if ( # <<<<<<<<<<<<<< @@ -13968,7 +14228,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON */ if (__pyx_t_2) { - /* "w3lib/_url.pyx":882 + /* "w3lib/_url.pyx":947 * or input[pointer + 2] not in _ASCII_HEX_DIGIT * ): * return "%25" # <<<<<<<<<<<<<< @@ -13980,7 +14240,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON __pyx_r = __pyx_kp_u_25; goto __pyx_L0; - /* "w3lib/_url.pyx":877 + /* "w3lib/_url.pyx":942 * code_point = input[pointer] * if code_point == "%" and "%" in encode_set: * if ( # <<<<<<<<<<<<<< @@ -13989,7 +14249,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON */ } - /* "w3lib/_url.pyx":883 + /* "w3lib/_url.pyx":948 * ): * return "%25" * return "%" # <<<<<<<<<<<<<< @@ -14001,7 +14261,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON __pyx_r = __pyx_kp_u__4; goto __pyx_L0; - /* "w3lib/_url.pyx":876 + /* "w3lib/_url.pyx":941 * ) -> str: * code_point = input[pointer] * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< @@ -14010,7 +14270,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON */ } - /* "w3lib/_url.pyx":884 + /* "w3lib/_url.pyx":949 * return "%25" * return "%" * return _utf_8_percent_encode(code_point, encode_set) # <<<<<<<<<<<<<< @@ -14018,7 +14278,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 884, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; __pyx_t_7 = 0; @@ -14038,16 +14298,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_code_point, __pyx_v_encode_set}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 884, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_6))) __PYX_ERR(0, 884, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_6))) __PYX_ERR(0, 949, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":872 + /* "w3lib/_url.pyx":937 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -14069,109 +14329,42 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON return __pyx_r; } -/* "w3lib/_url.pyx":887 - * +/* "w3lib/_url.pyx":952 * - * def _parse_url( # <<<<<<<<<<<<<< - * input: str, - * *, - */ - -static PyObject *__pyx_pf_5w3lib_4_url_50__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - - /* "w3lib/_url.pyx":890 - * input: str, - * *, - * base_url: str = None, # <<<<<<<<<<<<<< - * encoding: str = "utf-8", - * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, - */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, Py_None) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, ((PyObject*)__pyx_kp_u_utf_8)) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - - /* "w3lib/_url.pyx":887 * + * def _preprocess_url(url: str) -> str: # <<<<<<<<<<<<<< + * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) * - * def _parse_url( # <<<<<<<<<<<<<< - * input: str, - * *, */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_userinfo_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_path_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_path_percent_encode_set) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_query_percent_encode_set) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_special_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_special_query_percent_encode_set) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fragment_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_fragment_percent_encode_set) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 887, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("w3lib._url.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_37_parse_url(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_37_preprocess_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_36_parse_url, "Return a :class:`_URL` object built from *url*, *base_url* and\n *encoding*, following the URL parsing algorithm defined in the `URL living\n standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *userinfo_percent_encode_set* allows customizing which characters found\n in the user authroization part of the input URL need to be\n percent-encoded.\n "); -static PyMethodDef __pyx_mdef_5w3lib_4_url_37_parse_url = {"_parse_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_37_parse_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_36_parse_url}; -static PyObject *__pyx_pw_5w3lib_4_url_37_parse_url(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_37_preprocess_url = {"_preprocess_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_37_preprocess_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_37_preprocess_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_input = 0; - PyObject *__pyx_v_base_url = 0; - PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_v_userinfo_percent_encode_set = 0; - PyObject *__pyx_v_path_percent_encode_set = 0; - PyObject *__pyx_v_query_percent_encode_set = 0; - PyObject *__pyx_v_special_query_percent_encode_set = 0; - PyObject *__pyx_v_fragment_percent_encode_set = 0; + PyObject *__pyx_v_url = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_parse_url (wrapper)", 0); + __Pyx_RefNannySetupContext("_preprocess_url (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -14181,23 +14374,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_base_url,&__pyx_n_s_encoding,&__pyx_n_s_userinfo_percent_encode_set,&__pyx_n_s_path_percent_encode_set,&__pyx_n_s_query_percent_encode_set,&__pyx_n_s_special_query_percent_encode_set,&__pyx_n_s_fragment_percent_encode_set,0}; - __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); - - /* "w3lib/_url.pyx":890 - * input: str, - * *, - * base_url: str = None, # <<<<<<<<<<<<<< - * encoding: str = "utf-8", - * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, - */ - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None)); - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)((PyObject*)__pyx_kp_u_utf_8))); - values[3] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_userinfo_percent_encode_set); - values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_path_percent_encode_set); - values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_query_percent_encode_set); - values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_special_query_percent_encode_set); - values[7] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_fragment_percent_encode_set); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -14209,33 +14386,306 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 952, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } - if (kw_args > 0 && likely(kw_args <= 7)) { - Py_ssize_t index; - for (index = 1; index < 8 && kw_args > 0; index++) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); - if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L3_error) - } - } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_url") < 0)) __PYX_ERR(0, 887, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_preprocess_url") < 0)) __PYX_ERR(0, 952, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_input = ((PyObject*)values[0]); - __pyx_v_base_url = ((PyObject*)values[1]); - __pyx_v_encoding = ((PyObject*)values[2]); + __pyx_v_url = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_preprocess_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 952, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._preprocess_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_url), (&PyUnicode_Type), 0, "url", 1))) __PYX_ERR(0, 952, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_36_preprocess_url(__pyx_self, __pyx_v_url); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_36_preprocess_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_preprocess_url", 1); + + /* "w3lib/_url.pyx":953 + * + * def _preprocess_url(url: str) -> str: + * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_url, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_translate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 953, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "w3lib/_url.pyx":952 + * + * + * def _preprocess_url(url: str) -> str: # <<<<<<<<<<<<<< + * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._url._preprocess_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":956 + * + * + * def _parse_url( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + +static PyObject *__pyx_pf_5w3lib_4_url_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "w3lib/_url.pyx":959 + * input: str, + * *, + * base_url: str = None, # <<<<<<<<<<<<<< + * encoding: str = "utf-8", + * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, Py_None) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, ((PyObject*)__pyx_kp_u_utf_8)) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + + /* "w3lib/_url.pyx":956 + * + * + * def _parse_url( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_userinfo_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_path_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_path_percent_encode_set) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_query_percent_encode_set) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_special_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_special_query_percent_encode_set) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fragment_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_fragment_percent_encode_set) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 956, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 956, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("w3lib._url.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_39_parse_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_38_parse_url, "Return a :class:`_URL` object built from *url*, *base_url* and\n *encoding*, following the URL parsing algorithm defined in the `URL living\n standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *userinfo_percent_encode_set* allows customizing which characters found\n in the user authroization part of the input URL need to be\n percent-encoded.\n "); +static PyMethodDef __pyx_mdef_5w3lib_4_url_39_parse_url = {"_parse_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_39_parse_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_38_parse_url}; +static PyObject *__pyx_pw_5w3lib_4_url_39_parse_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_base_url = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_userinfo_percent_encode_set = 0; + PyObject *__pyx_v_path_percent_encode_set = 0; + PyObject *__pyx_v_query_percent_encode_set = 0; + PyObject *__pyx_v_special_query_percent_encode_set = 0; + PyObject *__pyx_v_fragment_percent_encode_set = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[8] = {0,0,0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_parse_url (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_base_url,&__pyx_n_s_encoding,&__pyx_n_s_userinfo_percent_encode_set,&__pyx_n_s_path_percent_encode_set,&__pyx_n_s_query_percent_encode_set,&__pyx_n_s_special_query_percent_encode_set,&__pyx_n_s_fragment_percent_encode_set,0}; + __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); + + /* "w3lib/_url.pyx":959 + * input: str, + * *, + * base_url: str = None, # <<<<<<<<<<<<<< + * encoding: str = "utf-8", + * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, + */ + values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None)); + values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)((PyObject*)__pyx_kp_u_utf_8))); + values[3] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_userinfo_percent_encode_set); + values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_path_percent_encode_set); + values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_query_percent_encode_set); + values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_special_query_percent_encode_set); + values[7] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_fragment_percent_encode_set); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 956, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (kw_args > 0 && likely(kw_args <= 7)) { + Py_ssize_t index; + for (index = 1; index < 8 && kw_args > 0; index++) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 956, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_url") < 0)) __PYX_ERR(0, 956, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_base_url = ((PyObject*)values[1]); + __pyx_v_encoding = ((PyObject*)values[2]); __pyx_v_userinfo_percent_encode_set = values[3]; __pyx_v_path_percent_encode_set = values[4]; __pyx_v_query_percent_encode_set = values[5]; @@ -14244,7 +14694,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 887, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 956, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14258,12 +14708,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 888, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_base_url), (&PyUnicode_Type), 1, "base_url", 1))) __PYX_ERR(0, 890, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 891, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_36_parse_url(__pyx_self, __pyx_v_input, __pyx_v_base_url, __pyx_v_encoding, __pyx_v_userinfo_percent_encode_set, __pyx_v_path_percent_encode_set, __pyx_v_query_percent_encode_set, __pyx_v_special_query_percent_encode_set, __pyx_v_fragment_percent_encode_set); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 957, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_base_url), (&PyUnicode_Type), 1, "base_url", 1))) __PYX_ERR(0, 959, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_38_parse_url(__pyx_self, __pyx_v_input, __pyx_v_base_url, __pyx_v_encoding, __pyx_v_userinfo_percent_encode_set, __pyx_v_path_percent_encode_set, __pyx_v_query_percent_encode_set, __pyx_v_special_query_percent_encode_set, __pyx_v_fragment_percent_encode_set); - /* "w3lib/_url.pyx":887 + /* "w3lib/_url.pyx":956 * * * def _parse_url( # <<<<<<<<<<<<<< @@ -14286,7 +14736,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_base_url, PyObject *__pyx_v_encoding, PyObject *__pyx_v_userinfo_percent_encode_set, PyObject *__pyx_v_path_percent_encode_set, PyObject *__pyx_v_query_percent_encode_set, PyObject *__pyx_v_special_query_percent_encode_set, PyObject *__pyx_v_fragment_percent_encode_set) { +static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_base_url, PyObject *__pyx_v_encoding, PyObject *__pyx_v_userinfo_percent_encode_set, PyObject *__pyx_v_path_percent_encode_set, PyObject *__pyx_v_query_percent_encode_set, PyObject *__pyx_v_special_query_percent_encode_set, PyObject *__pyx_v_fragment_percent_encode_set) { PyObject *__pyx_v_base = NULL; PyObject *__pyx_v_url = NULL; unsigned char __pyx_v_state; @@ -14296,6 +14746,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py int __pyx_v_skip_authority_shortcut; PyObject *__pyx_v_pointer = NULL; Py_ssize_t __pyx_v_input_length; + int __pyx_v_reached_end; PyObject *__pyx_v_c = 0; PyObject *__pyx_v_at_sign_index = NULL; PyObject *__pyx_v_i = NULL; @@ -14314,15 +14765,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); int __pyx_t_11; - Py_ssize_t __pyx_t_12; - PyObject *(*__pyx_t_13)(PyObject *); - int __pyx_t_14; - PyObject *__pyx_t_15 = NULL; - int __pyx_t_16; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -14330,7 +14778,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_input); __Pyx_INCREF(__pyx_v_encoding); - /* "w3lib/_url.pyx":923 + /* "w3lib/_url.pyx":992 * # output can match the original parsed URL if desired. * * if base_url is not None: # <<<<<<<<<<<<<< @@ -14340,24 +14788,24 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = (__pyx_v_base_url != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "w3lib/_url.pyx":924 + /* "w3lib/_url.pyx":993 * * if base_url is not None: * base = _parse_url(base_url, encoding=encoding) # <<<<<<<<<<<<<< * else: * base = None */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_base_url); __Pyx_GIVEREF(__pyx_v_base_url); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_base_url)) __PYX_ERR(0, 924, __pyx_L1_error); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_base_url)) __PYX_ERR(0, 993, __pyx_L1_error); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 924, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 924, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 993, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -14365,7 +14813,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_v_base = __pyx_t_5; __pyx_t_5 = 0; - /* "w3lib/_url.pyx":923 + /* "w3lib/_url.pyx":992 * # output can match the original parsed URL if desired. * * if base_url is not None: # <<<<<<<<<<<<<< @@ -14375,7 +14823,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L3; } - /* "w3lib/_url.pyx":926 + /* "w3lib/_url.pyx":995 * base = _parse_url(base_url, encoding=encoding) * else: * base = None # <<<<<<<<<<<<<< @@ -14388,26 +14836,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L3:; - /* "w3lib/_url.pyx":927 + /* "w3lib/_url.pyx":996 * else: * base = None * encoding = _get_output_encoding(encoding) # <<<<<<<<<<<<<< * * url = _URL() */ - __pyx_t_5 = __pyx_f_5w3lib_4_url__get_output_encoding(__pyx_v_encoding); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 927, __pyx_L1_error) + __pyx_t_5 = __pyx_f_5w3lib_4_url__get_output_encoding(__pyx_v_encoding); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_encoding, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":929 + /* "w3lib/_url.pyx":998 * encoding = _get_output_encoding(encoding) * * url = _URL() # <<<<<<<<<<<<<< * state = SCHEME_START * buffer = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_URL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_URL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_6 = 0; @@ -14427,14 +14875,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 929, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_url = __pyx_t_5; __pyx_t_5 = 0; - /* "w3lib/_url.pyx":930 + /* "w3lib/_url.pyx":999 * * url = _URL() * state = SCHEME_START # <<<<<<<<<<<<<< @@ -14443,7 +14891,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_SCHEME_START; - /* "w3lib/_url.pyx":931 + /* "w3lib/_url.pyx":1000 * url = _URL() * state = SCHEME_START * buffer = "" # <<<<<<<<<<<<<< @@ -14453,7 +14901,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __pyx_v_buffer = __pyx_kp_u__2; - /* "w3lib/_url.pyx":932 + /* "w3lib/_url.pyx":1001 * state = SCHEME_START * buffer = "" * at_sign_seen = inside_brackets = skip_authority_shortcut = False # <<<<<<<<<<<<<< @@ -14464,234 +14912,168 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_v_inside_brackets = 0; __pyx_v_skip_authority_shortcut = 0; - /* "w3lib/_url.pyx":933 + /* "w3lib/_url.pyx":1002 * buffer = "" * at_sign_seen = inside_brackets = skip_authority_shortcut = False * pointer = 0 # <<<<<<<<<<<<<< * - * input = input.strip(_C0_CONTROL_OR_SPACE) + * input = _preprocess_url(input) */ __Pyx_INCREF(__pyx_int_0); __pyx_v_pointer = __pyx_int_0; - /* "w3lib/_url.pyx":935 + /* "w3lib/_url.pyx":1004 * pointer = 0 * - * input = input.strip(_C0_CONTROL_OR_SPACE) # <<<<<<<<<<<<<< - * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) - * input_length = len(input) - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 935, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_input, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 935, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 935, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); - __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":936 - * - * input = input.strip(_C0_CONTROL_OR_SPACE) - * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) # <<<<<<<<<<<<<< + * input = _preprocess_url(input) # <<<<<<<<<<<<<< * input_length = len(input) * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 936, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_preprocess_url); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_translate, __pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 936, __pyx_L1_error) + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_input}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":937 - * input = input.strip(_C0_CONTROL_OR_SPACE) - * input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) + /* "w3lib/_url.pyx":1005 + * + * input = _preprocess_url(input) * input_length = len(input) # <<<<<<<<<<<<<< * * while True: */ if (unlikely(__pyx_v_input == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 937, __pyx_L1_error) + __PYX_ERR(0, 1005, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1005, __pyx_L1_error) __pyx_v_input_length = __pyx_t_7; - /* "w3lib/_url.pyx":939 + /* "w3lib/_url.pyx":1007 * input_length = len(input) * * while True: # <<<<<<<<<<<<<< - * try: - * c: Optional[str] = input[pointer] + * reached_end: bint = pointer >= input_length + * if not reached_end: */ while (1) { - /* "w3lib/_url.pyx":940 + /* "w3lib/_url.pyx":1008 * * while True: - * try: # <<<<<<<<<<<<<< - * c: Optional[str] = input[pointer] - * except IndexError: + * reached_end: bint = pointer >= input_length # <<<<<<<<<<<<<< + * if not reached_end: + * c: str = input[pointer] */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); - __Pyx_XGOTREF(__pyx_t_8); - __Pyx_XGOTREF(__pyx_t_9); - __Pyx_XGOTREF(__pyx_t_10); - /*try:*/ { - - /* "w3lib/_url.pyx":941 - * while True: - * try: - * c: Optional[str] = input[pointer] # <<<<<<<<<<<<<< - * except IndexError: - * c = None - */ - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 941, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_5); - if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 941, __pyx_L6_error) - __Pyx_XDECREF_SET(__pyx_v_c, ((PyObject*)__pyx_t_5)); - __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1008, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1008, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_reached_end = __pyx_t_1; - /* "w3lib/_url.pyx":940 - * + /* "w3lib/_url.pyx":1009 * while True: - * try: # <<<<<<<<<<<<<< - * c: Optional[str] = input[pointer] - * except IndexError: - */ - } - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L13_try_end; - __pyx_L6_error:; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":942 - * try: - * c: Optional[str] = input[pointer] - * except IndexError: # <<<<<<<<<<<<<< - * c = None + * reached_end: bint = pointer >= input_length + * if not reached_end: # <<<<<<<<<<<<<< + * c: str = input[pointer] * */ - __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); - if (__pyx_t_6) { - __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 942, __pyx_L8_except_error) - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_1 = (!__pyx_v_reached_end); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":943 - * c: Optional[str] = input[pointer] - * except IndexError: - * c = None # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1010 + * reached_end: bint = pointer >= input_length + * if not reached_end: + * c: str = input[pointer] # <<<<<<<<<<<<<< * * if state == SCHEME_START: */ - __Pyx_INCREF(Py_None); - __Pyx_XDECREF_SET(__pyx_v_c, ((PyObject*)Py_None)); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L7_exception_handled; - } - goto __pyx_L8_except_error; + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1010, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 1010, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_c, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":940 - * + /* "w3lib/_url.pyx":1009 * while True: - * try: # <<<<<<<<<<<<<< - * c: Optional[str] = input[pointer] - * except IndexError: - */ - __pyx_L8_except_error:; - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_XGIVEREF(__pyx_t_9); - __Pyx_XGIVEREF(__pyx_t_10); - __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); - goto __pyx_L1_error; - __pyx_L7_exception_handled:; - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_XGIVEREF(__pyx_t_9); - __Pyx_XGIVEREF(__pyx_t_10); - __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); - __pyx_L13_try_end:; + * reached_end: bint = pointer >= input_length + * if not reached_end: # <<<<<<<<<<<<<< + * c: str = input[pointer] + * + */ } - /* "w3lib/_url.pyx":945 - * c = None + /* "w3lib/_url.pyx":1012 + * c: str = input[pointer] * * if state == SCHEME_START: # <<<<<<<<<<<<<< - * if c is not None and c in _ASCII_ALPHA: - * assert isinstance(c, str) + * if not reached_end and c in _ASCII_ALPHA: + * buffer += c */ __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SCHEME_START); if (__pyx_t_1) { - /* "w3lib/_url.pyx":946 + /* "w3lib/_url.pyx":1013 * * if state == SCHEME_START: - * if c is not None and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if not reached_end and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< * buffer += c + * state = SCHEME */ - __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_11) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L18_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L9_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 946, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 946, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_11; - __pyx_L18_bool_binop_done:; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1013, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1013, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_8; + __pyx_L9_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":947 + /* "w3lib/_url.pyx":1014 * if state == SCHEME_START: - * if c is not None and c in _ASCII_ALPHA: - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * buffer += c - * state = SCHEME - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 947, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 947, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":948 - * if c is not None and c in _ASCII_ALPHA: - * assert isinstance(c, str) + * if not reached_end and c in _ASCII_ALPHA: * buffer += c # <<<<<<<<<<<<<< * state = SCHEME * else: */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 948, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); - __pyx_t_3 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1014, __pyx_L1_error) } + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1014, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":949 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1015 + * if not reached_end and c in _ASCII_ALPHA: * buffer += c * state = SCHEME # <<<<<<<<<<<<<< * else: @@ -14699,17 +15081,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_SCHEME; - /* "w3lib/_url.pyx":946 + /* "w3lib/_url.pyx":1013 * * if state == SCHEME_START: - * if c is not None and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if not reached_end and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< * buffer += c + * state = SCHEME */ - goto __pyx_L17; + goto __pyx_L8; } - /* "w3lib/_url.pyx":951 + /* "w3lib/_url.pyx":1017 * state = SCHEME * else: * state = NO_SCHEME # <<<<<<<<<<<<<< @@ -14719,148 +15101,140 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_NO_SCHEME; - /* "w3lib/_url.pyx":952 + /* "w3lib/_url.pyx":1018 * else: * state = NO_SCHEME * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == SCHEME: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; } - __pyx_L17:; + __pyx_L8:; - /* "w3lib/_url.pyx":945 - * c = None + /* "w3lib/_url.pyx":1012 + * c: str = input[pointer] * * if state == SCHEME_START: # <<<<<<<<<<<<<< - * if c is not None and c in _ASCII_ALPHA: - * assert isinstance(c, str) + * if not reached_end and c in _ASCII_ALPHA: + * buffer += c */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":954 + /* "w3lib/_url.pyx":1020 * pointer -= 1 * * elif state == SCHEME: # <<<<<<<<<<<<<< - * if c is not None and c in _SCHEME_CHARS: - * assert isinstance(c, str) + * if not reached_end and c in _SCHEME_CHARS: + * buffer += c */ __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SCHEME); if (__pyx_t_1) { - /* "w3lib/_url.pyx":955 + /* "w3lib/_url.pyx":1021 * * elif state == SCHEME: - * if c is not None and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if not reached_end and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< * buffer += c + * elif not reached_end and c == ":": */ - __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_11) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L21_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L12_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SCHEME_CHARS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 955, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_11; - __pyx_L21_bool_binop_done:; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1021, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SCHEME_CHARS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1021, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_8; + __pyx_L12_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":956 + /* "w3lib/_url.pyx":1022 * elif state == SCHEME: - * if c is not None and c in _SCHEME_CHARS: - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * buffer += c - * elif c == ":": - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 956, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 956, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":957 - * if c is not None and c in _SCHEME_CHARS: - * assert isinstance(c, str) + * if not reached_end and c in _SCHEME_CHARS: * buffer += c # <<<<<<<<<<<<<< - * elif c == ":": + * elif not reached_end and c == ":": * url.scheme = buffer.lower() */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 957, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); - __pyx_t_3 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1022, __pyx_L1_error) } + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":955 + /* "w3lib/_url.pyx":1021 * * elif state == SCHEME: - * if c is not None and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if not reached_end and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< * buffer += c + * elif not reached_end and c == ":": */ - goto __pyx_L20; + goto __pyx_L11; } - /* "w3lib/_url.pyx":958 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1023 + * if not reached_end and c in _SCHEME_CHARS: * buffer += c - * elif c == ":": # <<<<<<<<<<<<<< + * elif not reached_end and c == ":": # <<<<<<<<<<<<<< * url.scheme = buffer.lower() * buffer = "" */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 958, __pyx_L1_error) + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { + } else { + __pyx_t_1 = __pyx_t_8; + goto __pyx_L14_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1023, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_1 = __pyx_t_8; + __pyx_L14_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":959 + /* "w3lib/_url.pyx":1024 * buffer += c - * elif c == ":": + * elif not reached_end and c == ":": * url.scheme = buffer.lower() # <<<<<<<<<<<<<< * buffer = "" * if url.scheme == "file": */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_buffer, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_buffer, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); + if (likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 959, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_4) < 0) __PYX_ERR(0, 1024, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":960 - * elif c == ":": + /* "w3lib/_url.pyx":1025 + * elif not reached_end and c == ":": * url.scheme = buffer.lower() * buffer = "" # <<<<<<<<<<<<<< * if url.scheme == "file": @@ -14869,20 +15243,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":961 + /* "w3lib/_url.pyx":1026 * url.scheme = buffer.lower() * buffer = "" * if url.scheme == "file": # <<<<<<<<<<<<<< * state = FILE * elif url.is_special: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 961, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1026, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":962 + /* "w3lib/_url.pyx":1027 * buffer = "" * if url.scheme == "file": * state = FILE # <<<<<<<<<<<<<< @@ -14891,56 +15265,56 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FILE; - /* "w3lib/_url.pyx":961 + /* "w3lib/_url.pyx":1026 * url.scheme = buffer.lower() * buffer = "" * if url.scheme == "file": # <<<<<<<<<<<<<< * state = FILE * elif url.is_special: */ - goto __pyx_L23; + goto __pyx_L16; } - /* "w3lib/_url.pyx":963 + /* "w3lib/_url.pyx":1028 * if url.scheme == "file": * state = FILE * elif url.is_special: # <<<<<<<<<<<<<< * if base is not None and base.scheme == url.scheme: * state = SPECIAL_RELATIVE_OR_AUTHORITY */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 963, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 963, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1028, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":964 + /* "w3lib/_url.pyx":1029 * state = FILE * elif url.is_special: * if base is not None and base.scheme == url.scheme: # <<<<<<<<<<<<<< * state = SPECIAL_RELATIVE_OR_AUTHORITY * else: */ - __pyx_t_11 = (__pyx_v_base != Py_None); - if (__pyx_t_11) { + __pyx_t_8 = (__pyx_v_base != Py_None); + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L25_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L18_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 964, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 964, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = __pyx_t_11; - __pyx_L25_bool_binop_done:; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_8; + __pyx_L18_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":965 + /* "w3lib/_url.pyx":1030 * elif url.is_special: * if base is not None and base.scheme == url.scheme: * state = SPECIAL_RELATIVE_OR_AUTHORITY # <<<<<<<<<<<<<< @@ -14949,17 +15323,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_RELATIVE_OR_AUTHORITY; - /* "w3lib/_url.pyx":964 + /* "w3lib/_url.pyx":1029 * state = FILE * elif url.is_special: * if base is not None and base.scheme == url.scheme: # <<<<<<<<<<<<<< * state = SPECIAL_RELATIVE_OR_AUTHORITY * else: */ - goto __pyx_L24; + goto __pyx_L17; } - /* "w3lib/_url.pyx":967 + /* "w3lib/_url.pyx":1032 * state = SPECIAL_RELATIVE_OR_AUTHORITY * else: * state = SPECIAL_AUTHORITY_SLASHES # <<<<<<<<<<<<<< @@ -14969,56 +15343,56 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES; } - __pyx_L24:; + __pyx_L17:; - /* "w3lib/_url.pyx":963 + /* "w3lib/_url.pyx":1028 * if url.scheme == "file": * state = FILE * elif url.is_special: # <<<<<<<<<<<<<< * if base is not None and base.scheme == url.scheme: * state = SPECIAL_RELATIVE_OR_AUTHORITY */ - goto __pyx_L23; + goto __pyx_L16; } - /* "w3lib/_url.pyx":968 + /* "w3lib/_url.pyx":1033 * else: * state = SPECIAL_AUTHORITY_SLASHES * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = PATH_OR_AUTHORITY * pointer += 1 */ - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 968, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); if (unlikely(__pyx_v_input == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 968, __pyx_L1_error) + __PYX_ERR(0, 1033, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 968, __pyx_L1_error) - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 968, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1033, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_11) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L27_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L20_bool_binop_done; } - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 968, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __pyx_t_11; - __pyx_L27_bool_binop_done:; + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __pyx_t_8; + __pyx_L20_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":969 + /* "w3lib/_url.pyx":1034 * state = SPECIAL_AUTHORITY_SLASHES * elif pointer + 1 < len(input) and input[pointer + 1] == "/": * state = PATH_OR_AUTHORITY # <<<<<<<<<<<<<< @@ -15027,29 +15401,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY; - /* "w3lib/_url.pyx":970 + /* "w3lib/_url.pyx":1035 * elif pointer + 1 < len(input) and input[pointer + 1] == "/": * state = PATH_OR_AUTHORITY * pointer += 1 # <<<<<<<<<<<<<< * else: * url.path = "" */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 970, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1035, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":968 + /* "w3lib/_url.pyx":1033 * else: * state = SPECIAL_AUTHORITY_SLASHES * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = PATH_OR_AUTHORITY * pointer += 1 */ - goto __pyx_L23; + goto __pyx_L16; } - /* "w3lib/_url.pyx":972 + /* "w3lib/_url.pyx":1037 * pointer += 1 * else: * url.path = "" # <<<<<<<<<<<<<< @@ -15057,9 +15431,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * else: */ /*else*/ { - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_kp_u__2) < 0) __PYX_ERR(0, 972, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1037, __pyx_L1_error) - /* "w3lib/_url.pyx":973 + /* "w3lib/_url.pyx":1038 * else: * url.path = "" * state = OPAQUE_PATH # <<<<<<<<<<<<<< @@ -15068,19 +15442,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_OPAQUE_PATH; } - __pyx_L23:; + __pyx_L16:; - /* "w3lib/_url.pyx":958 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1023 + * if not reached_end and c in _SCHEME_CHARS: * buffer += c - * elif c == ":": # <<<<<<<<<<<<<< + * elif not reached_end and c == ":": # <<<<<<<<<<<<<< * url.scheme = buffer.lower() * buffer = "" */ - goto __pyx_L20; + goto __pyx_L11; } - /* "w3lib/_url.pyx":975 + /* "w3lib/_url.pyx":1040 * state = OPAQUE_PATH * else: * buffer = "" # <<<<<<<<<<<<<< @@ -15091,7 +15465,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":976 + /* "w3lib/_url.pyx":1041 * else: * buffer = "" * state = NO_SCHEME # <<<<<<<<<<<<<< @@ -15100,7 +15474,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_NO_SCHEME; - /* "w3lib/_url.pyx":977 + /* "w3lib/_url.pyx":1042 * buffer = "" * state = NO_SCHEME * pointer = -1 # <<<<<<<<<<<<<< @@ -15110,19 +15484,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_int_neg_1); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_int_neg_1); } - __pyx_L20:; + __pyx_L11:; - /* "w3lib/_url.pyx":954 + /* "w3lib/_url.pyx":1020 * pointer -= 1 * * elif state == SCHEME: # <<<<<<<<<<<<<< - * if c is not None and c in _SCHEME_CHARS: - * assert isinstance(c, str) + * if not reached_end and c in _SCHEME_CHARS: + * buffer += c */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":979 + /* "w3lib/_url.pyx":1044 * pointer = -1 * * elif state == NO_SCHEME: # <<<<<<<<<<<<<< @@ -15132,7 +15506,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_NO_SCHEME); if (__pyx_t_1) { - /* "w3lib/_url.pyx":980 + /* "w3lib/_url.pyx":1045 * * elif state == NO_SCHEME: * if base is None: # <<<<<<<<<<<<<< @@ -15142,17 +15516,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = (__pyx_v_base == Py_None); if (unlikely(__pyx_t_1)) { - /* "w3lib/_url.pyx":981 + /* "w3lib/_url.pyx":1046 * elif state == NO_SCHEME: * if base is None: * raise ValueError # <<<<<<<<<<<<<< * if base.has_opaque_path(): - * if c != "#": + * if not reached_end and c != "#": */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 981, __pyx_L1_error) + __PYX_ERR(0, 1046, __pyx_L1_error) - /* "w3lib/_url.pyx":980 + /* "w3lib/_url.pyx":1045 * * elif state == NO_SCHEME: * if base is None: # <<<<<<<<<<<<<< @@ -15161,116 +15535,125 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":982 + /* "w3lib/_url.pyx":1047 * if base is None: * raise ValueError * if base.has_opaque_path(): # <<<<<<<<<<<<<< - * if c != "#": + * if not reached_end and c != "#": * raise ValueError */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 982, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":983 + /* "w3lib/_url.pyx":1048 * raise ValueError * if base.has_opaque_path(): - * if c != "#": # <<<<<<<<<<<<<< + * if not reached_end and c != "#": # <<<<<<<<<<<<<< * raise ValueError * url.scheme = base.scheme */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 983, __pyx_L1_error) + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { + } else { + __pyx_t_1 = __pyx_t_8; + goto __pyx_L25_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1048, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1048, __pyx_L1_error) + __pyx_t_1 = __pyx_t_8; + __pyx_L25_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "w3lib/_url.pyx":984 + /* "w3lib/_url.pyx":1049 * if base.has_opaque_path(): - * if c != "#": + * if not reached_end and c != "#": * raise ValueError # <<<<<<<<<<<<<< * url.scheme = base.scheme * url.path = base.path */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 984, __pyx_L1_error) + __PYX_ERR(0, 1049, __pyx_L1_error) - /* "w3lib/_url.pyx":983 + /* "w3lib/_url.pyx":1048 * raise ValueError * if base.has_opaque_path(): - * if c != "#": # <<<<<<<<<<<<<< + * if not reached_end and c != "#": # <<<<<<<<<<<<<< * raise ValueError * url.scheme = base.scheme */ } - /* "w3lib/_url.pyx":985 - * if c != "#": + /* "w3lib/_url.pyx":1050 + * if not reached_end and c != "#": * raise ValueError * url.scheme = base.scheme # <<<<<<<<<<<<<< * url.path = base.path * url.query = base.query */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_4) < 0) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_5) < 0) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":986 + /* "w3lib/_url.pyx":1051 * raise ValueError * url.scheme = base.scheme * url.path = base.path # <<<<<<<<<<<<<< * url.query = base.query * url.fragment = "" */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_4) < 0) __PYX_ERR(0, 986, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1051, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_5) < 0) __PYX_ERR(0, 1051, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":987 + /* "w3lib/_url.pyx":1052 * url.scheme = base.scheme * url.path = base.path * url.query = base.query # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 987, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_4) < 0) __PYX_ERR(0, 987, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_5) < 0) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":988 + /* "w3lib/_url.pyx":1053 * url.path = base.path * url.query = base.query * url.fragment = "" # <<<<<<<<<<<<<< * state = FRAGMENT * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 988, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1053, __pyx_L1_error) - /* "w3lib/_url.pyx":989 + /* "w3lib/_url.pyx":1054 * url.query = base.query * url.fragment = "" * state = FRAGMENT # <<<<<<<<<<<<<< @@ -15279,17 +15662,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":982 + /* "w3lib/_url.pyx":1047 * if base is None: * raise ValueError * if base.has_opaque_path(): # <<<<<<<<<<<<<< - * if c != "#": + * if not reached_end and c != "#": * raise ValueError */ - goto __pyx_L30; + goto __pyx_L23; } - /* "w3lib/_url.pyx":991 + /* "w3lib/_url.pyx":1056 * state = FRAGMENT * else: * if base.scheme != "file": # <<<<<<<<<<<<<< @@ -15297,13 +15680,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * else: */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 991, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_file, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 991, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1056, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_n_u_file, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1056, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":992 + /* "w3lib/_url.pyx":1057 * else: * if base.scheme != "file": * state = RELATIVE # <<<<<<<<<<<<<< @@ -15312,17 +15695,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_RELATIVE; - /* "w3lib/_url.pyx":991 + /* "w3lib/_url.pyx":1056 * state = FRAGMENT * else: * if base.scheme != "file": # <<<<<<<<<<<<<< * state = RELATIVE * else: */ - goto __pyx_L32; + goto __pyx_L27; } - /* "w3lib/_url.pyx":994 + /* "w3lib/_url.pyx":1059 * state = RELATIVE * else: * state = FILE # <<<<<<<<<<<<<< @@ -15332,98 +15715,119 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_FILE; } - __pyx_L32:; + __pyx_L27:; - /* "w3lib/_url.pyx":995 + /* "w3lib/_url.pyx":1060 * else: * state = FILE * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_5); + __pyx_t_5 = 0; } - __pyx_L30:; + __pyx_L23:; - /* "w3lib/_url.pyx":979 + /* "w3lib/_url.pyx":1044 * pointer = -1 * * elif state == NO_SCHEME: # <<<<<<<<<<<<<< * if base is None: * raise ValueError */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":997 + /* "w3lib/_url.pyx":1062 * pointer -= 1 * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< - * if c == "/" and input[pointer + 1] == "/": + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_RELATIVE_OR_AUTHORITY); if (__pyx_t_1) { - /* "w3lib/_url.pyx":998 + /* "w3lib/_url.pyx":1063 * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: - * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 998, __pyx_L1_error) - if (__pyx_t_11) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L34_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L29_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1063, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1063, __pyx_L1_error) + if (__pyx_t_8) { + } else { + __pyx_t_1 = __pyx_t_8; + goto __pyx_L29_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 998, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1063, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1063, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 998, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 998, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1063, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_11; - __pyx_L34_bool_binop_done:; + if (__pyx_t_8) { + } else { + __pyx_t_1 = __pyx_t_8; + goto __pyx_L29_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1063, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1063, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_8; + __pyx_L29_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":999 + /* "w3lib/_url.pyx":1064 * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: - * if c == "/" and input[pointer + 1] == "/": + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< * pointer += 1 * else: */ __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":1000 - * if c == "/" and input[pointer + 1] == "/": + /* "w3lib/_url.pyx":1065 + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 # <<<<<<<<<<<<<< * else: * state = RELATIVE */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1000, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":998 + /* "w3lib/_url.pyx":1063 * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: - * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 */ - goto __pyx_L33; + goto __pyx_L28; } - /* "w3lib/_url.pyx":1002 + /* "w3lib/_url.pyx":1067 * pointer += 1 * else: * state = RELATIVE # <<<<<<<<<<<<<< @@ -15433,70 +15837,79 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_RELATIVE; - /* "w3lib/_url.pyx":1003 + /* "w3lib/_url.pyx":1068 * else: * state = RELATIVE * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == PATH_OR_AUTHORITY: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1068, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; } - __pyx_L33:; + __pyx_L28:; - /* "w3lib/_url.pyx":997 + /* "w3lib/_url.pyx":1062 * pointer -= 1 * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< - * if c == "/" and input[pointer + 1] == "/": + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1005 + /* "w3lib/_url.pyx":1070 * pointer -= 1 * * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< - * if c == "/": + * if not reached_end and c == "/": * state = AUTHORITY */ __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1006 + /* "w3lib/_url.pyx":1071 * * elif state == PATH_OR_AUTHORITY: - * if c == "/": # <<<<<<<<<<<<<< + * if not reached_end and c == "/": # <<<<<<<<<<<<<< * state = AUTHORITY * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1006, __pyx_L1_error) + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { + } else { + __pyx_t_1 = __pyx_t_8; + goto __pyx_L34_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1071, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1071, __pyx_L1_error) + __pyx_t_1 = __pyx_t_8; + __pyx_L34_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1007 + /* "w3lib/_url.pyx":1072 * elif state == PATH_OR_AUTHORITY: - * if c == "/": + * if not reached_end and c == "/": * state = AUTHORITY # <<<<<<<<<<<<<< * else: * state = PATH */ __pyx_v_state = __pyx_v_5w3lib_4_url_AUTHORITY; - /* "w3lib/_url.pyx":1006 + /* "w3lib/_url.pyx":1071 * * elif state == PATH_OR_AUTHORITY: - * if c == "/": # <<<<<<<<<<<<<< + * if not reached_end and c == "/": # <<<<<<<<<<<<<< * state = AUTHORITY * else: */ - goto __pyx_L36; + goto __pyx_L33; } - /* "w3lib/_url.pyx":1009 + /* "w3lib/_url.pyx":1074 * state = AUTHORITY * else: * state = PATH # <<<<<<<<<<<<<< @@ -15506,121 +15919,107 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1010 + /* "w3lib/_url.pyx":1075 * else: * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == RELATIVE: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1075, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); + __pyx_t_4 = 0; } - __pyx_L36:; + __pyx_L33:; - /* "w3lib/_url.pyx":1005 + /* "w3lib/_url.pyx":1070 * pointer -= 1 * * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< - * if c == "/": + * if not reached_end and c == "/": * state = AUTHORITY */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1012 + /* "w3lib/_url.pyx":1077 * pointer -= 1 * * elif state == RELATIVE: # <<<<<<<<<<<<<< - * assert isinstance(base, _URL) * url.scheme = base.scheme + * if not reached_end and (c == "/" or url.is_special and c == "\\"): */ __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_RELATIVE); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1013 + /* "w3lib/_url.pyx":1078 * * elif state == RELATIVE: - * assert isinstance(base, _URL) # <<<<<<<<<<<<<< - * url.scheme = base.scheme - * if c == "/" or url.is_special and c == "\\": - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_URL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1013, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_IsInstance(__pyx_v_base, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1013, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1013, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1013, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":1014 - * elif state == RELATIVE: - * assert isinstance(base, _URL) * url.scheme = base.scheme # <<<<<<<<<<<<<< - * if c == "/" or url.is_special and c == "\\": + * if not reached_end and (c == "/" or url.is_special and c == "\\"): * state = RELATIVE_SLASH */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_3) < 0) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_4) < 0) __PYX_ERR(0, 1078, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1015 - * assert isinstance(base, _URL) + /* "w3lib/_url.pyx":1079 + * elif state == RELATIVE: * url.scheme = base.scheme - * if c == "/" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * if not reached_end and (c == "/" or url.is_special and c == "\\"): # <<<<<<<<<<<<<< * state = RELATIVE_SLASH * else: */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1015, __pyx_L1_error) - if (!__pyx_t_11) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L38_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L37_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1079, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) + if (!__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L38_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L37_bool_binop_done; } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1015, __pyx_L1_error) - __pyx_t_1 = __pyx_t_11; - __pyx_L38_bool_binop_done:; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_8) { + } else { + __pyx_t_1 = __pyx_t_8; + goto __pyx_L37_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1079, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) + __pyx_t_1 = __pyx_t_8; + __pyx_L37_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1016 + /* "w3lib/_url.pyx":1080 * url.scheme = base.scheme - * if c == "/" or url.is_special and c == "\\": + * if not reached_end and (c == "/" or url.is_special and c == "\\"): * state = RELATIVE_SLASH # <<<<<<<<<<<<<< * else: * url.username = base.username */ __pyx_v_state = __pyx_v_5w3lib_4_url_RELATIVE_SLASH; - /* "w3lib/_url.pyx":1015 - * assert isinstance(base, _URL) + /* "w3lib/_url.pyx":1079 + * elif state == RELATIVE: * url.scheme = base.scheme - * if c == "/" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * if not reached_end and (c == "/" or url.is_special and c == "\\"): # <<<<<<<<<<<<<< * state = RELATIVE_SLASH * else: */ - goto __pyx_L37; + goto __pyx_L36; } - /* "w3lib/_url.pyx":1018 + /* "w3lib/_url.pyx":1082 * state = RELATIVE_SLASH * else: * url.username = base.username # <<<<<<<<<<<<<< @@ -15628,179 +16027,192 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * url.hostname = base.hostname */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1018, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_3) < 0) __PYX_ERR(0, 1018, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1082, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_4) < 0) __PYX_ERR(0, 1082, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1019 + /* "w3lib/_url.pyx":1083 * else: * url.username = base.username * url.password = base.password # <<<<<<<<<<<<<< * url.hostname = base.hostname * url.port = base.port */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_3) < 0) __PYX_ERR(0, 1019, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1083, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_4) < 0) __PYX_ERR(0, 1083, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1020 + /* "w3lib/_url.pyx":1084 * url.username = base.username * url.password = base.password * url.hostname = base.hostname # <<<<<<<<<<<<<< * url.port = base.port * url.path = base.path */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1020, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_3) < 0) __PYX_ERR(0, 1020, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 1084, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1021 + /* "w3lib/_url.pyx":1085 * url.password = base.password * url.hostname = base.hostname * url.port = base.port # <<<<<<<<<<<<<< * url.path = base.path * url.query = base.query */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1021, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_3) < 0) __PYX_ERR(0, 1021, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1085, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_4) < 0) __PYX_ERR(0, 1085, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1022 + /* "w3lib/_url.pyx":1086 * url.hostname = base.hostname * url.port = base.port * url.path = base.path # <<<<<<<<<<<<<< * url.query = base.query - * if c == "?": + * if not reached_end and c == "?": */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1022, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_3) < 0) __PYX_ERR(0, 1022, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_4) < 0) __PYX_ERR(0, 1086, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1023 + /* "w3lib/_url.pyx":1087 * url.port = base.port * url.path = base.path * url.query = base.query # <<<<<<<<<<<<<< - * if c == "?": + * if not reached_end and c == "?": * url.query = "" */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1023, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_3) < 0) __PYX_ERR(0, 1023, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_4) < 0) __PYX_ERR(0, 1087, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1024 + /* "w3lib/_url.pyx":1088 * url.path = base.path * url.query = base.query - * if c == "?": # <<<<<<<<<<<<<< + * if not reached_end and c == "?": # <<<<<<<<<<<<<< * url.query = "" * state = QUERY */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1024, __pyx_L1_error) + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { + } else { + __pyx_t_1 = __pyx_t_8; + goto __pyx_L42_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1088, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_1 = __pyx_t_8; + __pyx_L42_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1025 + /* "w3lib/_url.pyx":1089 * url.query = base.query - * if c == "?": + * if not reached_end and c == "?": * url.query = "" # <<<<<<<<<<<<<< * state = QUERY - * elif c == "#": + * elif not reached_end and c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1025, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1089, __pyx_L1_error) - /* "w3lib/_url.pyx":1026 - * if c == "?": + /* "w3lib/_url.pyx":1090 + * if not reached_end and c == "?": * url.query = "" * state = QUERY # <<<<<<<<<<<<<< - * elif c == "#": + * elif not reached_end and c == "#": * url.fragment = "" */ __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":1024 + /* "w3lib/_url.pyx":1088 * url.path = base.path * url.query = base.query - * if c == "?": # <<<<<<<<<<<<<< + * if not reached_end and c == "?": # <<<<<<<<<<<<<< * url.query = "" * state = QUERY */ goto __pyx_L41; } - /* "w3lib/_url.pyx":1027 + /* "w3lib/_url.pyx":1091 * url.query = "" * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< + * elif not reached_end and c == "#": # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1027, __pyx_L1_error) + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { + } else { + __pyx_t_1 = __pyx_t_8; + goto __pyx_L44_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1091, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1091, __pyx_L1_error) + __pyx_t_1 = __pyx_t_8; + __pyx_L44_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1028 + /* "w3lib/_url.pyx":1092 * state = QUERY - * elif c == "#": + * elif not reached_end and c == "#": * url.fragment = "" # <<<<<<<<<<<<<< * state = FRAGMENT - * elif pointer < input_length: + * elif not reached_end: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1028, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1092, __pyx_L1_error) - /* "w3lib/_url.pyx":1029 - * elif c == "#": + /* "w3lib/_url.pyx":1093 + * elif not reached_end and c == "#": * url.fragment = "" * state = FRAGMENT # <<<<<<<<<<<<<< - * elif pointer < input_length: + * elif not reached_end: * url.query = None */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1027 + /* "w3lib/_url.pyx":1091 * url.query = "" * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< + * elif not reached_end and c == "#": # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ goto __pyx_L41; } - /* "w3lib/_url.pyx":1030 + /* "w3lib/_url.pyx":1094 * url.fragment = "" * state = FRAGMENT - * elif pointer < input_length: # <<<<<<<<<<<<<< + * elif not reached_end: # <<<<<<<<<<<<<< * url.query = None * _shorten_path(url) */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1030, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1030, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1030, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (!__pyx_v_reached_end); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1031 + /* "w3lib/_url.pyx":1095 * state = FRAGMENT - * elif pointer < input_length: + * elif not reached_end: * url.query = None # <<<<<<<<<<<<<< * _shorten_path(url) * state = PATH */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 1031, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 1095, __pyx_L1_error) - /* "w3lib/_url.pyx":1032 - * elif pointer < input_length: + /* "w3lib/_url.pyx":1096 + * elif not reached_end: * url.query = None * _shorten_path(url) # <<<<<<<<<<<<<< * state = PATH * pointer -= 1 */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -15820,13 +16232,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_url}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1032, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1033 + /* "w3lib/_url.pyx":1097 * url.query = None * _shorten_path(url) * state = PATH # <<<<<<<<<<<<<< @@ -15835,167 +16247,136 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1034 + /* "w3lib/_url.pyx":1098 * _shorten_path(url) * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == RELATIVE_SLASH: */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1030 + /* "w3lib/_url.pyx":1094 * url.fragment = "" * state = FRAGMENT - * elif pointer < input_length: # <<<<<<<<<<<<<< + * elif not reached_end: # <<<<<<<<<<<<<< * url.query = None * _shorten_path(url) */ } __pyx_L41:; } - __pyx_L37:; + __pyx_L36:; - /* "w3lib/_url.pyx":1012 + /* "w3lib/_url.pyx":1077 * pointer -= 1 * * elif state == RELATIVE: # <<<<<<<<<<<<<< - * assert isinstance(base, _URL) * url.scheme = base.scheme + * if not reached_end and (c == "/" or url.is_special and c == "\\"): */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1036 + /* "w3lib/_url.pyx":1100 * pointer -= 1 * * elif state == RELATIVE_SLASH: # <<<<<<<<<<<<<< - * assert isinstance(base, _URL) - * if url.is_special and c is not None and c in "/\\": + * if url.is_special and not reached_end and c in "/\\": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_RELATIVE_SLASH); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1037 + /* "w3lib/_url.pyx":1101 * * elif state == RELATIVE_SLASH: - * assert isinstance(base, _URL) # <<<<<<<<<<<<<< - * if url.is_special and c is not None and c in "/\\": - * assert isinstance(c, str) - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_URL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_IsInstance(__pyx_v_base, __pyx_t_4); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1037, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1037, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1037, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":1038 - * elif state == RELATIVE_SLASH: - * assert isinstance(base, _URL) - * if url.is_special and c is not None and c in "/\\": # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if url.is_special and not reached_end and c in "/\\": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * elif not reached_end and c == "/": */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1038, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1038, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_11) { + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L43_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L47_bool_binop_done; } - __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_11) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L43_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L47_bool_binop_done; } - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1038, __pyx_L1_error) - __pyx_t_1 = __pyx_t_11; - __pyx_L43_bool_binop_done:; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1101, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1101, __pyx_L1_error) + __pyx_t_1 = __pyx_t_8; + __pyx_L47_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1039 - * assert isinstance(base, _URL) - * if url.is_special and c is not None and c in "/\\": - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * elif c == "/": - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1039, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1039, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":1040 - * if url.is_special and c is not None and c in "/\\": - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1102 + * elif state == RELATIVE_SLASH: + * if url.is_special and not reached_end and c in "/\\": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< - * elif c == "/": + * elif not reached_end and c == "/": * state = AUTHORITY */ __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":1038 + /* "w3lib/_url.pyx":1101 + * * elif state == RELATIVE_SLASH: - * assert isinstance(base, _URL) - * if url.is_special and c is not None and c in "/\\": # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if url.is_special and not reached_end and c in "/\\": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * elif not reached_end and c == "/": */ - goto __pyx_L42; + goto __pyx_L46; } - /* "w3lib/_url.pyx":1041 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1103 + * if url.is_special and not reached_end and c in "/\\": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * elif c == "/": # <<<<<<<<<<<<<< + * elif not reached_end and c == "/": # <<<<<<<<<<<<<< * state = AUTHORITY * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1041, __pyx_L1_error) + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { + } else { + __pyx_t_1 = __pyx_t_8; + goto __pyx_L50_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1103, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_t_1 = __pyx_t_8; + __pyx_L50_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1042 + /* "w3lib/_url.pyx":1104 * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * elif c == "/": + * elif not reached_end and c == "/": * state = AUTHORITY # <<<<<<<<<<<<<< * else: * url.username = base.username */ __pyx_v_state = __pyx_v_5w3lib_4_url_AUTHORITY; - /* "w3lib/_url.pyx":1041 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1103 + * if url.is_special and not reached_end and c in "/\\": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * elif c == "/": # <<<<<<<<<<<<<< + * elif not reached_end and c == "/": # <<<<<<<<<<<<<< * state = AUTHORITY * else: */ - goto __pyx_L42; + goto __pyx_L46; } - /* "w3lib/_url.pyx":1044 + /* "w3lib/_url.pyx":1106 * state = AUTHORITY * else: * url.username = base.username # <<<<<<<<<<<<<< @@ -16003,48 +16384,48 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * url.hostname = base.hostname */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1044, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_4) < 0) __PYX_ERR(0, 1044, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_4) < 0) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1045 + /* "w3lib/_url.pyx":1107 * else: * url.username = base.username * url.password = base.password # <<<<<<<<<<<<<< * url.hostname = base.hostname * url.port = base.port */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_4) < 0) __PYX_ERR(0, 1045, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_4) < 0) __PYX_ERR(0, 1107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1046 + /* "w3lib/_url.pyx":1108 * url.username = base.username * url.password = base.password * url.hostname = base.hostname # <<<<<<<<<<<<<< * url.port = base.port * state = PATH */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1046, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 1046, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 1108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1047 + /* "w3lib/_url.pyx":1109 * url.password = base.password * url.hostname = base.hostname * url.port = base.port # <<<<<<<<<<<<<< * state = PATH * pointer -= 1 */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1047, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_4) < 0) __PYX_ERR(0, 1047, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_4) < 0) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1048 + /* "w3lib/_url.pyx":1110 * url.hostname = base.hostname * url.port = base.port * state = PATH # <<<<<<<<<<<<<< @@ -16053,96 +16434,117 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1049 + /* "w3lib/_url.pyx":1111 * url.port = base.port * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == SPECIAL_AUTHORITY_SLASHES: */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); __pyx_t_4 = 0; } - __pyx_L42:; + __pyx_L46:; - /* "w3lib/_url.pyx":1036 + /* "w3lib/_url.pyx":1100 * pointer -= 1 * * elif state == RELATIVE_SLASH: # <<<<<<<<<<<<<< - * assert isinstance(base, _URL) - * if url.is_special and c is not None and c in "/\\": + * if url.is_special and not reached_end and c in "/\\": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1051 + /* "w3lib/_url.pyx":1113 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< - * if c == "/" and input[pointer + 1] == "/": + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1052 + /* "w3lib/_url.pyx":1114 * * elif state == SPECIAL_AUTHORITY_SLASHES: - * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1052, __pyx_L1_error) - if (__pyx_t_11) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L47_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L53_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1052, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1114, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) + if (__pyx_t_8) { + } else { + __pyx_t_1 = __pyx_t_8; + goto __pyx_L53_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1052, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_11; - __pyx_L47_bool_binop_done:; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_8) { + } else { + __pyx_t_1 = __pyx_t_8; + goto __pyx_L53_bool_binop_done; + } + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_8; + __pyx_L53_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1053 + /* "w3lib/_url.pyx":1115 * elif state == SPECIAL_AUTHORITY_SLASHES: - * if c == "/" and input[pointer + 1] == "/": + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< * pointer += 1 * else: */ __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":1054 - * if c == "/" and input[pointer + 1] == "/": + /* "w3lib/_url.pyx":1116 + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 # <<<<<<<<<<<<<< * else: * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1054, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1052 + /* "w3lib/_url.pyx":1114 * * elif state == SPECIAL_AUTHORITY_SLASHES: - * if c == "/" and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 */ - goto __pyx_L46; + goto __pyx_L52; } - /* "w3lib/_url.pyx":1056 + /* "w3lib/_url.pyx":1118 * pointer += 1 * else: * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< @@ -16152,99 +16554,99 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":1057 + /* "w3lib/_url.pyx":1119 * else: * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1057, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; } - __pyx_L46:; + __pyx_L52:; - /* "w3lib/_url.pyx":1051 + /* "w3lib/_url.pyx":1113 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< - * if c == "/" and input[pointer + 1] == "/": + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1059 + /* "w3lib/_url.pyx":1121 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< - * if c is None or c not in "/\\": + * if reached_end or c not in "/\\": * state = AUTHORITY */ __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1060 + /* "w3lib/_url.pyx":1122 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: - * if c is None or c not in "/\\": # <<<<<<<<<<<<<< + * if reached_end or c not in "/\\": # <<<<<<<<<<<<<< * state = AUTHORITY * pointer -= 1 */ - __pyx_t_11 = (__pyx_v_c == ((PyObject*)Py_None)); - if (!__pyx_t_11) { + if (!__pyx_v_reached_end) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L50_bool_binop_done; + __pyx_t_1 = __pyx_v_reached_end; + goto __pyx_L58_bool_binop_done; } - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1060, __pyx_L1_error) - __pyx_t_1 = __pyx_t_11; - __pyx_L50_bool_binop_done:; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1122, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1122, __pyx_L1_error) + __pyx_t_1 = __pyx_t_8; + __pyx_L58_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1061 + /* "w3lib/_url.pyx":1123 * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: - * if c is None or c not in "/\\": + * if reached_end or c not in "/\\": * state = AUTHORITY # <<<<<<<<<<<<<< * pointer -= 1 * */ __pyx_v_state = __pyx_v_5w3lib_4_url_AUTHORITY; - /* "w3lib/_url.pyx":1062 - * if c is None or c not in "/\\": + /* "w3lib/_url.pyx":1124 + * if reached_end or c not in "/\\": * state = AUTHORITY * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == AUTHORITY: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1060 + /* "w3lib/_url.pyx":1122 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: - * if c is None or c not in "/\\": # <<<<<<<<<<<<<< + * if reached_end or c not in "/\\": # <<<<<<<<<<<<<< * state = AUTHORITY * pointer -= 1 */ } - /* "w3lib/_url.pyx":1059 + /* "w3lib/_url.pyx":1121 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< - * if c is None or c not in "/\\": + * if reached_end or c not in "/\\": * state = AUTHORITY */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1064 + /* "w3lib/_url.pyx":1126 * pointer -= 1 * * elif state == AUTHORITY: # <<<<<<<<<<<<<< @@ -16254,7 +16656,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_AUTHORITY); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1065 + /* "w3lib/_url.pyx":1127 * * elif state == AUTHORITY: * if not skip_authority_shortcut: # <<<<<<<<<<<<<< @@ -16264,7 +16666,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = (!__pyx_v_skip_authority_shortcut); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1066 + /* "w3lib/_url.pyx":1128 * elif state == AUTHORITY: * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) # <<<<<<<<<<<<<< @@ -16273,26 +16675,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ if (unlikely(__pyx_v_input == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "find"); - __PYX_ERR(0, 1066, __pyx_L1_error) + __PYX_ERR(0, 1128, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_Py_IsNone(__pyx_v_pointer) ? (0) : (__Pyx_PyIndex_AsSsize_t(__pyx_v_pointer))); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1066, __pyx_L1_error) - __pyx_t_12 = PyUnicode_Find(__pyx_v_input, __pyx_kp_u__16, __pyx_t_7, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-2))) __PYX_ERR(0, 1066, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_7 = (__Pyx_Py_IsNone(__pyx_v_pointer) ? (0) : (__Pyx_PyIndex_AsSsize_t(__pyx_v_pointer))); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1128, __pyx_L1_error) + __pyx_t_9 = PyUnicode_Find(__pyx_v_input, __pyx_kp_u__16, __pyx_t_7, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-2))) __PYX_ERR(0, 1128, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_at_sign_index, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1067 + /* "w3lib/_url.pyx":1129 * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: # <<<<<<<<<<<<<< * state = HOST * else: */ - __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_at_sign_index, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_at_sign_index, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1129, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":1068 + /* "w3lib/_url.pyx":1130 * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: * state = HOST # <<<<<<<<<<<<<< @@ -16301,91 +16703,100 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_HOST; - /* "w3lib/_url.pyx":1067 + /* "w3lib/_url.pyx":1129 * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: # <<<<<<<<<<<<<< * state = HOST * else: */ - goto __pyx_L53; + goto __pyx_L61; } - /* "w3lib/_url.pyx":1070 + /* "w3lib/_url.pyx":1132 * state = HOST * else: * skip_authority_shortcut = True # <<<<<<<<<<<<<< * pointer -= 1 - * elif c == "@": + * elif not reached_end and c == "@": */ /*else*/ { __pyx_v_skip_authority_shortcut = 1; } - __pyx_L53:; + __pyx_L61:; - /* "w3lib/_url.pyx":1071 + /* "w3lib/_url.pyx":1133 * else: * skip_authority_shortcut = True * pointer -= 1 # <<<<<<<<<<<<<< - * elif c == "@": + * elif not reached_end and c == "@": * if at_sign_seen: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1065 + /* "w3lib/_url.pyx":1127 * * elif state == AUTHORITY: * if not skip_authority_shortcut: # <<<<<<<<<<<<<< * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: */ - goto __pyx_L52; + goto __pyx_L60; } - /* "w3lib/_url.pyx":1072 + /* "w3lib/_url.pyx":1134 * skip_authority_shortcut = True * pointer -= 1 - * elif c == "@": # <<<<<<<<<<<<<< + * elif not reached_end and c == "@": # <<<<<<<<<<<<<< * if at_sign_seen: * buffer = "%40" + buffer */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1072, __pyx_L1_error) + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { + } else { + __pyx_t_1 = __pyx_t_8; + goto __pyx_L62_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1134, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1134, __pyx_L1_error) + __pyx_t_1 = __pyx_t_8; + __pyx_L62_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1073 + /* "w3lib/_url.pyx":1135 * pointer -= 1 - * elif c == "@": + * elif not reached_end and c == "@": * if at_sign_seen: # <<<<<<<<<<<<<< * buffer = "%40" + buffer * at_sign_seen = True */ if (__pyx_v_at_sign_seen) { - /* "w3lib/_url.pyx":1074 - * elif c == "@": + /* "w3lib/_url.pyx":1136 + * elif not reached_end and c == "@": * if at_sign_seen: * buffer = "%40" + buffer # <<<<<<<<<<<<<< * at_sign_seen = True * for i, code_point in enumerate(buffer): */ - __pyx_t_3 = PyNumber_Add(__pyx_kp_u_40, __pyx_v_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_kp_u_40, __pyx_v_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1073 + /* "w3lib/_url.pyx":1135 * pointer -= 1 - * elif c == "@": + * elif not reached_end and c == "@": * if at_sign_seen: # <<<<<<<<<<<<<< * buffer = "%40" + buffer * at_sign_seen = True */ } - /* "w3lib/_url.pyx":1075 + /* "w3lib/_url.pyx":1137 * if at_sign_seen: * buffer = "%40" + buffer * at_sign_seen = True # <<<<<<<<<<<<<< @@ -16394,7 +16805,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_at_sign_seen = 1; - /* "w3lib/_url.pyx":1076 + /* "w3lib/_url.pyx":1138 * buffer = "%40" + buffer * at_sign_seen = True * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< @@ -16404,108 +16815,108 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_int_0); __pyx_t_3 = __pyx_int_0; if (likely(PyList_CheckExact(__pyx_v_buffer)) || PyTuple_CheckExact(__pyx_v_buffer)) { - __pyx_t_4 = __pyx_v_buffer; __Pyx_INCREF(__pyx_t_4); - __pyx_t_12 = 0; - __pyx_t_13 = NULL; + __pyx_t_5 = __pyx_v_buffer; __Pyx_INCREF(__pyx_t_5); + __pyx_t_9 = 0; + __pyx_t_10 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1076, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1076, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1138, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(!__pyx_t_10)) { + if (likely(PyList_CheckExact(__pyx_t_5))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1076, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) #endif - if (__pyx_t_12 >= __pyx_temp) break; + if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1076, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1076, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1076, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) #endif - if (__pyx_t_12 >= __pyx_temp) break; + if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1076, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1076, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); #endif } } else { - __pyx_t_5 = __pyx_t_13(__pyx_t_4); - if (unlikely(!__pyx_t_5)) { + __pyx_t_4 = __pyx_t_10(__pyx_t_5); + if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1076, __pyx_L1_error) + else __PYX_ERR(0, 1138, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_4); + __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1076, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); - __pyx_t_3 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1077 + /* "w3lib/_url.pyx":1139 * at_sign_seen = True * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< * url._password_token_seen = True * continue */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1077, __pyx_L1_error) - if (__pyx_t_11) { + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1139, __pyx_L1_error) + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L58_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L68_bool_binop_done; } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1077, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_14 = (!__pyx_t_11); - __pyx_t_1 = __pyx_t_14; - __pyx_L58_bool_binop_done:; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1139, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = (!__pyx_t_8); + __pyx_t_1 = __pyx_t_11; + __pyx_L68_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1078 + /* "w3lib/_url.pyx":1140 * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: * url._password_token_seen = True # <<<<<<<<<<<<<< * continue * encoded_code_points = _idempotent_utf_8_percent_encode( */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen, Py_True) < 0) __PYX_ERR(0, 1078, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen, Py_True) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) - /* "w3lib/_url.pyx":1079 + /* "w3lib/_url.pyx":1141 * if code_point == ":" and not url._password_token_seen: * url._password_token_seen = True * continue # <<<<<<<<<<<<<< * encoded_code_points = _idempotent_utf_8_percent_encode( * input=buffer, */ - goto __pyx_L55_continue; + goto __pyx_L65_continue; - /* "w3lib/_url.pyx":1077 + /* "w3lib/_url.pyx":1139 * at_sign_seen = True * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< @@ -16514,183 +16925,184 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1080 + /* "w3lib/_url.pyx":1142 * url._password_token_seen = True * continue * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=buffer, * pointer=i, */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1080, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); - /* "w3lib/_url.pyx":1081 + /* "w3lib/_url.pyx":1143 * continue * encoded_code_points = _idempotent_utf_8_percent_encode( * input=buffer, # <<<<<<<<<<<<<< * pointer=i, * encode_set=userinfo_percent_encode_set, */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_buffer) < 0) __PYX_ERR(0, 1081, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_buffer) < 0) __PYX_ERR(0, 1143, __pyx_L1_error) - /* "w3lib/_url.pyx":1082 + /* "w3lib/_url.pyx":1144 * encoded_code_points = _idempotent_utf_8_percent_encode( * input=buffer, * pointer=i, # <<<<<<<<<<<<<< * encode_set=userinfo_percent_encode_set, * ) */ - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_i) < 0) __PYX_ERR(0, 1081, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_i) < 0) __PYX_ERR(0, 1143, __pyx_L1_error) - /* "w3lib/_url.pyx":1083 + /* "w3lib/_url.pyx":1145 * input=buffer, * pointer=i, * encode_set=userinfo_percent_encode_set, # <<<<<<<<<<<<<< * ) * if url._password_token_seen: */ - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 1081, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 1143, __pyx_L1_error) - /* "w3lib/_url.pyx":1080 + /* "w3lib/_url.pyx":1142 * url._password_token_seen = True * continue * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=buffer, * pointer=i, */ - __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1080, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_encoded_code_points, __pyx_t_15); - __pyx_t_15 = 0; + __Pyx_XDECREF_SET(__pyx_v_encoded_code_points, __pyx_t_12); + __pyx_t_12 = 0; - /* "w3lib/_url.pyx":1085 + /* "w3lib/_url.pyx":1147 * encode_set=userinfo_percent_encode_set, * ) * if url._password_token_seen: # <<<<<<<<<<<<<< * url.password += encoded_code_points * else: */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1085, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1085, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1147, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1086 + /* "w3lib/_url.pyx":1148 * ) * if url._password_token_seen: * url.password += encoded_code_points # <<<<<<<<<<<<<< * else: * url.username += encoded_code_points */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1086, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_15, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1086, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_12, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_2) < 0) __PYX_ERR(0, 1086, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_2) < 0) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1085 + /* "w3lib/_url.pyx":1147 * encode_set=userinfo_percent_encode_set, * ) * if url._password_token_seen: # <<<<<<<<<<<<<< * url.password += encoded_code_points * else: */ - goto __pyx_L60; + goto __pyx_L70; } - /* "w3lib/_url.pyx":1088 + /* "w3lib/_url.pyx":1150 * url.password += encoded_code_points * else: * url.username += encoded_code_points # <<<<<<<<<<<<<< * buffer = "" - * elif c is None or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.is_special and c == "\\": */ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1088, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_15) < 0) __PYX_ERR(0, 1088, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_12) < 0) __PYX_ERR(0, 1150, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } - __pyx_L60:; + __pyx_L70:; - /* "w3lib/_url.pyx":1076 + /* "w3lib/_url.pyx":1138 * buffer = "%40" + buffer * at_sign_seen = True * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< * if code_point == ":" and not url._password_token_seen: * url._password_token_seen = True */ - __pyx_L55_continue:; + __pyx_L65_continue:; } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1089 + /* "w3lib/_url.pyx":1151 * else: * url.username += encoded_code_points * buffer = "" # <<<<<<<<<<<<<< - * elif c is None or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.is_special and c == "\\": * if at_sign_seen and not buffer: */ __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":1072 + /* "w3lib/_url.pyx":1134 * skip_authority_shortcut = True * pointer -= 1 - * elif c == "@": # <<<<<<<<<<<<<< + * elif not reached_end and c == "@": # <<<<<<<<<<<<<< * if at_sign_seen: * buffer = "%40" + buffer */ - goto __pyx_L52; + goto __pyx_L60; } - /* "w3lib/_url.pyx":1090 + /* "w3lib/_url.pyx":1152 * url.username += encoded_code_points * buffer = "" - * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * elif reached_end or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< * if at_sign_seen and not buffer: * raise ValueError */ - __pyx_t_14 = (__pyx_v_c == ((PyObject*)Py_None)); - if (!__pyx_t_14) { + if (!__pyx_v_reached_end) { } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L62_bool_binop_done; + __pyx_t_1 = __pyx_v_reached_end; + goto __pyx_L72_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1090, __pyx_L1_error) - if (!__pyx_t_14) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1152, __pyx_L1_error) } + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1152, __pyx_L1_error) + if (!__pyx_t_11) { } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L62_bool_binop_done; + __pyx_t_1 = __pyx_t_11; + goto __pyx_L72_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1090, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1090, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_14) { + if (__pyx_t_11) { } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L62_bool_binop_done; + __pyx_t_1 = __pyx_t_11; + goto __pyx_L72_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1090, __pyx_L1_error) - __pyx_t_1 = __pyx_t_14; - __pyx_L62_bool_binop_done:; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1152, __pyx_L1_error) } + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1152, __pyx_L1_error) + __pyx_t_1 = __pyx_t_11; + __pyx_L72_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1091 + /* "w3lib/_url.pyx":1153 * buffer = "" - * elif c is None or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.is_special and c == "\\": * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< * raise ValueError * pointer -= len(buffer) + 1 @@ -16698,50 +17110,50 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py if (__pyx_v_at_sign_seen) { } else { __pyx_t_1 = __pyx_v_at_sign_seen; - goto __pyx_L67_bool_binop_done; + goto __pyx_L77_bool_binop_done; } - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1091, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_14); - __pyx_t_1 = __pyx_t_11; - __pyx_L67_bool_binop_done:; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_8 = (!__pyx_t_11); + __pyx_t_1 = __pyx_t_8; + __pyx_L77_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "w3lib/_url.pyx":1092 - * elif c is None or c in "/?#" or url.is_special and c == "\\": + /* "w3lib/_url.pyx":1154 + * elif reached_end or c in "/?#" or url.is_special and c == "\\": * if at_sign_seen and not buffer: * raise ValueError # <<<<<<<<<<<<<< * pointer -= len(buffer) + 1 * buffer = "" */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1092, __pyx_L1_error) + __PYX_ERR(0, 1154, __pyx_L1_error) - /* "w3lib/_url.pyx":1091 + /* "w3lib/_url.pyx":1153 * buffer = "" - * elif c is None or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.is_special and c == "\\": * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< * raise ValueError * pointer -= len(buffer) + 1 */ } - /* "w3lib/_url.pyx":1093 + /* "w3lib/_url.pyx":1155 * if at_sign_seen and not buffer: * raise ValueError * pointer -= len(buffer) + 1 # <<<<<<<<<<<<<< * buffer = "" * state = HOST */ - __pyx_t_12 = PyObject_Length(__pyx_v_buffer); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1093, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_12 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1093, __pyx_L1_error) + __pyx_t_9 = PyObject_Length(__pyx_v_buffer); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1155, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_9 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1093, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1094 + /* "w3lib/_url.pyx":1156 * raise ValueError * pointer -= len(buffer) + 1 * buffer = "" # <<<<<<<<<<<<<< @@ -16751,7 +17163,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":1095 + /* "w3lib/_url.pyx":1157 * pointer -= len(buffer) + 1 * buffer = "" * state = HOST # <<<<<<<<<<<<<< @@ -16760,17 +17172,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_HOST; - /* "w3lib/_url.pyx":1090 + /* "w3lib/_url.pyx":1152 * url.username += encoded_code_points * buffer = "" - * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * elif reached_end or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< * if at_sign_seen and not buffer: * raise ValueError */ - goto __pyx_L52; + goto __pyx_L60; } - /* "w3lib/_url.pyx":1097 + /* "w3lib/_url.pyx":1159 * state = HOST * else: * buffer += c # <<<<<<<<<<<<<< @@ -16778,119 +17190,127 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * elif state == HOST: */ /*else*/ { - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1097, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); - __pyx_t_4 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1159, __pyx_L1_error) } + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_5); + __pyx_t_5 = 0; } - __pyx_L52:; + __pyx_L60:; - /* "w3lib/_url.pyx":1064 + /* "w3lib/_url.pyx":1126 * pointer -= 1 * * elif state == AUTHORITY: # <<<<<<<<<<<<<< * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1099 + /* "w3lib/_url.pyx":1161 * buffer += c * * elif state == HOST: # <<<<<<<<<<<<<< - * if c == ":" and not inside_brackets: + * if not reached_end and c == ":" and not inside_brackets: * if not buffer: */ __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_HOST); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1100 + /* "w3lib/_url.pyx":1162 * * elif state == HOST: - * if c == ":" and not inside_brackets: # <<<<<<<<<<<<<< + * if not reached_end and c == ":" and not inside_brackets: # <<<<<<<<<<<<<< * if not buffer: * raise ValueError */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1100, __pyx_L1_error) - if (__pyx_t_11) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L70_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L80_bool_binop_done; } - __pyx_t_11 = (!__pyx_v_inside_brackets); - __pyx_t_1 = __pyx_t_11; - __pyx_L70_bool_binop_done:; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1162, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1162, __pyx_L1_error) + if (__pyx_t_8) { + } else { + __pyx_t_1 = __pyx_t_8; + goto __pyx_L80_bool_binop_done; + } + __pyx_t_8 = (!__pyx_v_inside_brackets); + __pyx_t_1 = __pyx_t_8; + __pyx_L80_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1101 + /* "w3lib/_url.pyx":1163 * elif state == HOST: - * if c == ":" and not inside_brackets: + * if not reached_end and c == ":" and not inside_brackets: * if not buffer: # <<<<<<<<<<<<<< * raise ValueError * host = _parse_host(buffer, is_special=url.is_special) */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1101, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_1); - if (unlikely(__pyx_t_11)) { + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1163, __pyx_L1_error) + __pyx_t_8 = (!__pyx_t_1); + if (unlikely(__pyx_t_8)) { - /* "w3lib/_url.pyx":1102 - * if c == ":" and not inside_brackets: + /* "w3lib/_url.pyx":1164 + * if not reached_end and c == ":" and not inside_brackets: * if not buffer: * raise ValueError # <<<<<<<<<<<<<< * host = _parse_host(buffer, is_special=url.is_special) * url.hostname = host */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1102, __pyx_L1_error) + __PYX_ERR(0, 1164, __pyx_L1_error) - /* "w3lib/_url.pyx":1101 + /* "w3lib/_url.pyx":1163 * elif state == HOST: - * if c == ":" and not inside_brackets: + * if not reached_end and c == ":" and not inside_brackets: * if not buffer: # <<<<<<<<<<<<<< * raise ValueError * host = _parse_host(buffer, is_special=url.is_special) */ } - /* "w3lib/_url.pyx":1103 + /* "w3lib/_url.pyx":1165 * if not buffer: * raise ValueError * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< * url.hostname = host * buffer = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buffer)) __PYX_ERR(0, 1103, __pyx_L1_error); - __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buffer)) __PYX_ERR(0, 1165, __pyx_L1_error); + __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_is_special, __pyx_t_2) < 0) __PYX_ERR(0, 1103, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_is_special, __pyx_t_2) < 0) __PYX_ERR(0, 1165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1104 + /* "w3lib/_url.pyx":1166 * raise ValueError * host = _parse_host(buffer, is_special=url.is_special) * url.hostname = host # <<<<<<<<<<<<<< * buffer = "" * state = PORT */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 1104, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 1166, __pyx_L1_error) - /* "w3lib/_url.pyx":1105 + /* "w3lib/_url.pyx":1167 * host = _parse_host(buffer, is_special=url.is_special) * url.hostname = host * buffer = "" # <<<<<<<<<<<<<< @@ -16900,102 +17320,103 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":1106 + /* "w3lib/_url.pyx":1168 * url.hostname = host * buffer = "" * state = PORT # <<<<<<<<<<<<<< * url._port_token_seen = True - * elif c is None or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.is_special and c == "\\": */ __pyx_v_state = __pyx_v_5w3lib_4_url_PORT; - /* "w3lib/_url.pyx":1107 + /* "w3lib/_url.pyx":1169 * buffer = "" * state = PORT * url._port_token_seen = True # <<<<<<<<<<<<<< - * elif c is None or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.is_special and c == "\\": * pointer -= 1 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen, Py_True) < 0) __PYX_ERR(0, 1107, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen, Py_True) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) - /* "w3lib/_url.pyx":1100 + /* "w3lib/_url.pyx":1162 * * elif state == HOST: - * if c == ":" and not inside_brackets: # <<<<<<<<<<<<<< + * if not reached_end and c == ":" and not inside_brackets: # <<<<<<<<<<<<<< * if not buffer: * raise ValueError */ - goto __pyx_L69; + goto __pyx_L79; } - /* "w3lib/_url.pyx":1108 + /* "w3lib/_url.pyx":1170 * state = PORT * url._port_token_seen = True - * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * elif reached_end or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< * pointer -= 1 * if url.is_special and not buffer: */ - __pyx_t_1 = (__pyx_v_c == ((PyObject*)Py_None)); - if (!__pyx_t_1) { + if (!__pyx_v_reached_end) { } else { - __pyx_t_11 = __pyx_t_1; - goto __pyx_L73_bool_binop_done; + __pyx_t_8 = __pyx_v_reached_end; + goto __pyx_L84_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1170, __pyx_L1_error) } + __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) if (!__pyx_t_1) { } else { - __pyx_t_11 = __pyx_t_1; - goto __pyx_L73_bool_binop_done; + __pyx_t_8 = __pyx_t_1; + goto __pyx_L84_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1108, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { } else { - __pyx_t_11 = __pyx_t_1; - goto __pyx_L73_bool_binop_done; + __pyx_t_8 = __pyx_t_1; + goto __pyx_L84_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) - __pyx_t_11 = __pyx_t_1; - __pyx_L73_bool_binop_done:; - if (__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1170, __pyx_L1_error) } + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) + __pyx_t_8 = __pyx_t_1; + __pyx_L84_bool_binop_done:; + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1109 + /* "w3lib/_url.pyx":1171 * url._port_token_seen = True - * elif c is None or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.is_special and c == "\\": * pointer -= 1 # <<<<<<<<<<<<<< * if url.is_special and not buffer: * raise ValueError */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1110 - * elif c is None or c in "/?#" or url.is_special and c == "\\": + /* "w3lib/_url.pyx":1172 + * elif reached_end or c in "/?#" or url.is_special and c == "\\": * pointer -= 1 * if url.is_special and not buffer: # <<<<<<<<<<<<<< * raise ValueError * host = _parse_host(buffer, is_special=url.is_special) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1110, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1110, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { } else { - __pyx_t_11 = __pyx_t_1; - goto __pyx_L78_bool_binop_done; + __pyx_t_8 = __pyx_t_1; + goto __pyx_L89_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1110, __pyx_L1_error) - __pyx_t_14 = (!__pyx_t_1); - __pyx_t_11 = __pyx_t_14; - __pyx_L78_bool_binop_done:; - if (unlikely(__pyx_t_11)) { + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1172, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_1); + __pyx_t_8 = __pyx_t_11; + __pyx_L89_bool_binop_done:; + if (unlikely(__pyx_t_8)) { - /* "w3lib/_url.pyx":1111 + /* "w3lib/_url.pyx":1173 * pointer -= 1 * if url.is_special and not buffer: * raise ValueError # <<<<<<<<<<<<<< @@ -17003,10 +17424,10 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * url.hostname = host */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1111, __pyx_L1_error) + __PYX_ERR(0, 1173, __pyx_L1_error) - /* "w3lib/_url.pyx":1110 - * elif c is None or c in "/?#" or url.is_special and c == "\\": + /* "w3lib/_url.pyx":1172 + * elif reached_end or c in "/?#" or url.is_special and c == "\\": * pointer -= 1 * if url.is_special and not buffer: # <<<<<<<<<<<<<< * raise ValueError @@ -17014,85 +17435,95 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1112 + /* "w3lib/_url.pyx":1174 * if url.is_special and not buffer: * raise ValueError * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< * url.hostname = host * buffer = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_buffer)) __PYX_ERR(0, 1112, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_buffer)) __PYX_ERR(0, 1174, __pyx_L1_error); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_special, __pyx_t_4) < 0) __PYX_ERR(0, 1112, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_15, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_special, __pyx_t_5) < 0) __PYX_ERR(0, 1174, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1113 + /* "w3lib/_url.pyx":1175 * raise ValueError * host = _parse_host(buffer, is_special=url.is_special) * url.hostname = host # <<<<<<<<<<<<<< * buffer = "" * state = PATH_START */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 1113, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 1175, __pyx_L1_error) - /* "w3lib/_url.pyx":1114 + /* "w3lib/_url.pyx":1176 * host = _parse_host(buffer, is_special=url.is_special) * url.hostname = host * buffer = "" # <<<<<<<<<<<<<< * state = PATH_START - * else: + * elif not reached_end: */ __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":1115 + /* "w3lib/_url.pyx":1177 * url.hostname = host * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< - * else: + * elif not reached_end: * if c == "[": */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":1108 + /* "w3lib/_url.pyx":1170 * state = PORT * url._port_token_seen = True - * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * elif reached_end or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< * pointer -= 1 * if url.is_special and not buffer: */ - goto __pyx_L69; + goto __pyx_L79; } - /* "w3lib/_url.pyx":1117 + /* "w3lib/_url.pyx":1178 + * buffer = "" * state = PATH_START - * else: + * elif not reached_end: # <<<<<<<<<<<<<< + * if c == "[": + * inside_brackets = True + */ + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { + + /* "w3lib/_url.pyx":1179 + * state = PATH_START + * elif not reached_end: * if c == "[": # <<<<<<<<<<<<<< * inside_brackets = True * elif c == "]": */ - /*else*/ { - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1117, __pyx_L1_error) - if (__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1179, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1179, __pyx_L1_error) + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1118 - * else: + /* "w3lib/_url.pyx":1180 + * elif not reached_end: * if c == "[": * inside_brackets = True # <<<<<<<<<<<<<< * elif c == "]": @@ -17100,27 +17531,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_inside_brackets = 1; - /* "w3lib/_url.pyx":1117 + /* "w3lib/_url.pyx":1179 * state = PATH_START - * else: + * elif not reached_end: * if c == "[": # <<<<<<<<<<<<<< * inside_brackets = True * elif c == "]": */ - goto __pyx_L80; + goto __pyx_L91; } - /* "w3lib/_url.pyx":1119 + /* "w3lib/_url.pyx":1181 * if c == "[": * inside_brackets = True * elif c == "]": # <<<<<<<<<<<<<< * inside_brackets = False * buffer += c */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1119, __pyx_L1_error) - if (__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1181, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1181, __pyx_L1_error) + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1120 + /* "w3lib/_url.pyx":1182 * inside_brackets = True * elif c == "]": * inside_brackets = False # <<<<<<<<<<<<<< @@ -17129,7 +17561,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_inside_brackets = 0; - /* "w3lib/_url.pyx":1119 + /* "w3lib/_url.pyx":1181 * if c == "[": * inside_brackets = True * elif c == "]": # <<<<<<<<<<<<<< @@ -17137,172 +17569,165 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * buffer += c */ } - __pyx_L80:; + __pyx_L91:; - /* "w3lib/_url.pyx":1121 + /* "w3lib/_url.pyx":1183 * elif c == "]": * inside_brackets = False * buffer += c # <<<<<<<<<<<<<< * * elif state == PORT: */ - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); - __pyx_t_4 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1183, __pyx_L1_error) } + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_5); + __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":1178 + * buffer = "" + * state = PATH_START + * elif not reached_end: # <<<<<<<<<<<<<< + * if c == "[": + * inside_brackets = True + */ } - __pyx_L69:; + __pyx_L79:; - /* "w3lib/_url.pyx":1099 + /* "w3lib/_url.pyx":1161 * buffer += c * * elif state == HOST: # <<<<<<<<<<<<<< - * if c == ":" and not inside_brackets: + * if not reached_end and c == ":" and not inside_brackets: * if not buffer: */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1123 + /* "w3lib/_url.pyx":1185 * buffer += c * * elif state == PORT: # <<<<<<<<<<<<<< - * if c is not None and c in _ASCII_DIGIT: - * assert isinstance(c, str) + * if not reached_end and c in _ASCII_DIGIT: + * buffer += c */ - __pyx_t_11 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PORT); - if (__pyx_t_11) { + __pyx_t_8 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PORT); + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1124 + /* "w3lib/_url.pyx":1186 * * elif state == PORT: - * if c is not None and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if not reached_end and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< * buffer += c + * elif reached_end or c in "/?#" or url.is_special and c == "\\": */ - __pyx_t_14 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_14) { + __pyx_t_11 = (!__pyx_v_reached_end); + if (__pyx_t_11) { } else { - __pyx_t_11 = __pyx_t_14; - goto __pyx_L82_bool_binop_done; + __pyx_t_8 = __pyx_t_11; + goto __pyx_L93_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1124, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __pyx_t_14; - __pyx_L82_bool_binop_done:; - if (__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1186, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_5, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1186, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __pyx_t_11; + __pyx_L93_bool_binop_done:; + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1125 + /* "w3lib/_url.pyx":1187 * elif state == PORT: - * if c is not None and c in _ASCII_DIGIT: - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * buffer += c - * elif c is None or c in "/?#" or url.is_special and c == "\\": - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_11 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_11)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1125, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1125, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":1126 - * if c is not None and c in _ASCII_DIGIT: - * assert isinstance(c, str) + * if not reached_end and c in _ASCII_DIGIT: * buffer += c # <<<<<<<<<<<<<< - * elif c is None or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.is_special and c == "\\": * if buffer: */ - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); - __pyx_t_4 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1187, __pyx_L1_error) } + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1124 + /* "w3lib/_url.pyx":1186 * * elif state == PORT: - * if c is not None and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if not reached_end and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< * buffer += c + * elif reached_end or c in "/?#" or url.is_special and c == "\\": */ - goto __pyx_L81; + goto __pyx_L92; } - /* "w3lib/_url.pyx":1127 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1188 + * if not reached_end and c in _ASCII_DIGIT: * buffer += c - * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * elif reached_end or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< * if buffer: * port = int(buffer) */ - __pyx_t_14 = (__pyx_v_c == ((PyObject*)Py_None)); - if (!__pyx_t_14) { + if (!__pyx_v_reached_end) { } else { - __pyx_t_11 = __pyx_t_14; - goto __pyx_L84_bool_binop_done; + __pyx_t_8 = __pyx_v_reached_end; + goto __pyx_L95_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1127, __pyx_L1_error) - if (!__pyx_t_14) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1188, __pyx_L1_error) } + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) + if (!__pyx_t_11) { } else { - __pyx_t_11 = __pyx_t_14; - goto __pyx_L84_bool_binop_done; + __pyx_t_8 = __pyx_t_11; + goto __pyx_L95_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1127, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_14) { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_11) { } else { - __pyx_t_11 = __pyx_t_14; - goto __pyx_L84_bool_binop_done; + __pyx_t_8 = __pyx_t_11; + goto __pyx_L95_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1127, __pyx_L1_error) - __pyx_t_11 = __pyx_t_14; - __pyx_L84_bool_binop_done:; - if (likely(__pyx_t_11)) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1188, __pyx_L1_error) } + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) + __pyx_t_8 = __pyx_t_11; + __pyx_L95_bool_binop_done:; + if (likely(__pyx_t_8)) { - /* "w3lib/_url.pyx":1128 + /* "w3lib/_url.pyx":1189 * buffer += c - * elif c is None or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.is_special and c == "\\": * if buffer: # <<<<<<<<<<<<<< * port = int(buffer) * if port > 2**16 - 1: */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1128, __pyx_L1_error) - if (__pyx_t_11) { + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1189, __pyx_L1_error) + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1129 - * elif c is None or c in "/?#" or url.is_special and c == "\\": + /* "w3lib/_url.pyx":1190 + * elif reached_end or c in "/?#" or url.is_special and c == "\\": * if buffer: * port = int(buffer) # <<<<<<<<<<<<<< * if port > 2**16 - 1: * raise ValueError */ - __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_port, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_v_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_port, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1130 + /* "w3lib/_url.pyx":1191 * if buffer: * port = int(buffer) * if port > 2**16 - 1: # <<<<<<<<<<<<<< * raise ValueError * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_port, __pyx_int_65535, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1130, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(__pyx_t_11)) { + __pyx_t_5 = PyObject_RichCompare(__pyx_v_port, __pyx_int_65535, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1191, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(__pyx_t_8)) { - /* "w3lib/_url.pyx":1131 + /* "w3lib/_url.pyx":1192 * port = int(buffer) * if port > 2**16 - 1: * raise ValueError # <<<<<<<<<<<<<< @@ -17310,9 +17735,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * url._default_port_seen = url.port is None */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1131, __pyx_L1_error) + __PYX_ERR(0, 1192, __pyx_L1_error) - /* "w3lib/_url.pyx":1130 + /* "w3lib/_url.pyx":1191 * if buffer: * port = int(buffer) * if port > 2**16 - 1: # <<<<<<<<<<<<<< @@ -17321,28 +17746,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1132 + /* "w3lib/_url.pyx":1193 * if port > 2**16 - 1: * raise ValueError * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port # <<<<<<<<<<<<<< * url._default_port_seen = url.port is None * buffer = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; @@ -17350,45 +17775,45 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_15}; + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_12}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_port, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_port, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_11) { + if (__pyx_t_8) { __Pyx_INCREF(Py_None); - __pyx_t_4 = Py_None; + __pyx_t_5 = Py_None; } else { __Pyx_INCREF(__pyx_v_port); - __pyx_t_4 = __pyx_v_port; + __pyx_t_5 = __pyx_v_port; } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_4) < 0) __PYX_ERR(0, 1132, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_5) < 0) __PYX_ERR(0, 1193, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1133 + /* "w3lib/_url.pyx":1194 * raise ValueError * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port * url._default_port_seen = url.port is None # <<<<<<<<<<<<<< * buffer = "" * state = PATH_START */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = (__pyx_t_4 == Py_None); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen, __pyx_t_4) < 0) __PYX_ERR(0, 1133, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = (__pyx_t_5 == Py_None); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen, __pyx_t_5) < 0) __PYX_ERR(0, 1194, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1134 + /* "w3lib/_url.pyx":1195 * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port * url._default_port_seen = url.port is None * buffer = "" # <<<<<<<<<<<<<< @@ -17398,16 +17823,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":1128 + /* "w3lib/_url.pyx":1189 * buffer += c - * elif c is None or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.is_special and c == "\\": * if buffer: # <<<<<<<<<<<<<< * port = int(buffer) * if port > 2**16 - 1: */ } - /* "w3lib/_url.pyx":1135 + /* "w3lib/_url.pyx":1196 * url._default_port_seen = url.port is None * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< @@ -17416,29 +17841,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":1136 + /* "w3lib/_url.pyx":1197 * buffer = "" * state = PATH_START * pointer -= 1 # <<<<<<<<<<<<<< * else: * raise ValueError */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1127 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1188 + * if not reached_end and c in _ASCII_DIGIT: * buffer += c - * elif c is None or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * elif reached_end or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< * if buffer: * port = int(buffer) */ - goto __pyx_L81; + goto __pyx_L92; } - /* "w3lib/_url.pyx":1138 + /* "w3lib/_url.pyx":1199 * pointer -= 1 * else: * raise ValueError # <<<<<<<<<<<<<< @@ -17447,308 +17872,289 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ /*else*/ { __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1138, __pyx_L1_error) + __PYX_ERR(0, 1199, __pyx_L1_error) } - __pyx_L81:; + __pyx_L92:; - /* "w3lib/_url.pyx":1123 + /* "w3lib/_url.pyx":1185 * buffer += c * * elif state == PORT: # <<<<<<<<<<<<<< - * if c is not None and c in _ASCII_DIGIT: - * assert isinstance(c, str) + * if not reached_end and c in _ASCII_DIGIT: + * buffer += c */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1140 + /* "w3lib/_url.pyx":1201 * raise ValueError * * elif state == FILE: # <<<<<<<<<<<<<< * url.scheme = "file" * url.hostname = "" */ - __pyx_t_11 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE); - if (__pyx_t_11) { + __pyx_t_8 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE); + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1141 + /* "w3lib/_url.pyx":1202 * * elif state == FILE: * url.scheme = "file" # <<<<<<<<<<<<<< * url.hostname = "" - * if c is not None and c in "/\\": + * if not reached_end and c in "/\\": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_n_u_file) < 0) __PYX_ERR(0, 1141, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_n_u_file) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) - /* "w3lib/_url.pyx":1142 + /* "w3lib/_url.pyx":1203 * elif state == FILE: * url.scheme = "file" * url.hostname = "" # <<<<<<<<<<<<<< - * if c is not None and c in "/\\": - * assert isinstance(c, str) + * if not reached_end and c in "/\\": + * state = FILE_SLASH */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1142, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1203, __pyx_L1_error) - /* "w3lib/_url.pyx":1143 + /* "w3lib/_url.pyx":1204 * url.scheme = "file" * url.hostname = "" - * if c is not None and c in "/\\": # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< * state = FILE_SLASH + * elif base is not None and base.scheme == "file": */ - __pyx_t_14 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_14) { + __pyx_t_11 = (!__pyx_v_reached_end); + if (__pyx_t_11) { } else { - __pyx_t_11 = __pyx_t_14; - goto __pyx_L91_bool_binop_done; + __pyx_t_8 = __pyx_t_11; + goto __pyx_L102_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1143, __pyx_L1_error) - __pyx_t_11 = __pyx_t_14; - __pyx_L91_bool_binop_done:; - if (__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1204, __pyx_L1_error) } + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1204, __pyx_L1_error) + __pyx_t_8 = __pyx_t_11; + __pyx_L102_bool_binop_done:; + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1144 + /* "w3lib/_url.pyx":1205 * url.hostname = "" - * if c is not None and c in "/\\": - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * state = FILE_SLASH - * elif base is not None and base.scheme == "file": - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_11 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_11)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1144, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1144, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":1145 - * if c is not None and c in "/\\": - * assert isinstance(c, str) + * if not reached_end and c in "/\\": * state = FILE_SLASH # <<<<<<<<<<<<<< * elif base is not None and base.scheme == "file": * url.hostname = base.hostname */ __pyx_v_state = __pyx_v_5w3lib_4_url_FILE_SLASH; - /* "w3lib/_url.pyx":1143 + /* "w3lib/_url.pyx":1204 * url.scheme = "file" * url.hostname = "" - * if c is not None and c in "/\\": # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< * state = FILE_SLASH + * elif base is not None and base.scheme == "file": */ - goto __pyx_L90; + goto __pyx_L101; } - /* "w3lib/_url.pyx":1146 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1206 + * if not reached_end and c in "/\\": * state = FILE_SLASH * elif base is not None and base.scheme == "file": # <<<<<<<<<<<<<< * url.hostname = base.hostname * url.path = base.path */ - __pyx_t_14 = (__pyx_v_base != Py_None); - if (__pyx_t_14) { + __pyx_t_11 = (__pyx_v_base != Py_None); + if (__pyx_t_11) { } else { - __pyx_t_11 = __pyx_t_14; - goto __pyx_L93_bool_binop_done; + __pyx_t_8 = __pyx_t_11; + goto __pyx_L104_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1146, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __pyx_t_14; - __pyx_L93_bool_binop_done:; - if (__pyx_t_11) { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1206, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __pyx_t_11; + __pyx_L104_bool_binop_done:; + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1147 + /* "w3lib/_url.pyx":1207 * state = FILE_SLASH * elif base is not None and base.scheme == "file": * url.hostname = base.hostname # <<<<<<<<<<<<<< * url.path = base.path * url.query = base.query */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 1147, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_5) < 0) __PYX_ERR(0, 1207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1148 + /* "w3lib/_url.pyx":1208 * elif base is not None and base.scheme == "file": * url.hostname = base.hostname * url.path = base.path # <<<<<<<<<<<<<< * url.query = base.query - * if c == "?": + * if not reached_end and c == "?": */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_4) < 0) __PYX_ERR(0, 1148, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_5) < 0) __PYX_ERR(0, 1208, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1149 + /* "w3lib/_url.pyx":1209 * url.hostname = base.hostname * url.path = base.path * url.query = base.query # <<<<<<<<<<<<<< - * if c == "?": + * if not reached_end and c == "?": * url.query = "" */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_4) < 0) __PYX_ERR(0, 1149, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_5) < 0) __PYX_ERR(0, 1209, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1150 + /* "w3lib/_url.pyx":1210 * url.path = base.path * url.query = base.query - * if c == "?": # <<<<<<<<<<<<<< + * if not reached_end and c == "?": # <<<<<<<<<<<<<< * url.query = "" * state = QUERY */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1150, __pyx_L1_error) + __pyx_t_11 = (!__pyx_v_reached_end); if (__pyx_t_11) { + } else { + __pyx_t_8 = __pyx_t_11; + goto __pyx_L107_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1210, __pyx_L1_error) } + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_8 = __pyx_t_11; + __pyx_L107_bool_binop_done:; + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1151 + /* "w3lib/_url.pyx":1211 * url.query = base.query - * if c == "?": + * if not reached_end and c == "?": * url.query = "" # <<<<<<<<<<<<<< * state = QUERY - * elif c == "#": + * elif not reached_end and c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1151, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) - /* "w3lib/_url.pyx":1152 - * if c == "?": + /* "w3lib/_url.pyx":1212 + * if not reached_end and c == "?": * url.query = "" * state = QUERY # <<<<<<<<<<<<<< - * elif c == "#": + * elif not reached_end and c == "#": * url.fragment = "" */ __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":1150 + /* "w3lib/_url.pyx":1210 * url.path = base.path * url.query = base.query - * if c == "?": # <<<<<<<<<<<<<< + * if not reached_end and c == "?": # <<<<<<<<<<<<<< * url.query = "" * state = QUERY */ - goto __pyx_L95; + goto __pyx_L106; } - /* "w3lib/_url.pyx":1153 + /* "w3lib/_url.pyx":1213 * url.query = "" * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< + * elif not reached_end and c == "#": # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_11 = (!__pyx_v_reached_end); if (__pyx_t_11) { + } else { + __pyx_t_8 = __pyx_t_11; + goto __pyx_L109_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1213, __pyx_L1_error) } + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1213, __pyx_L1_error) + __pyx_t_8 = __pyx_t_11; + __pyx_L109_bool_binop_done:; + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1154 + /* "w3lib/_url.pyx":1214 * state = QUERY - * elif c == "#": + * elif not reached_end and c == "#": * url.fragment = "" # <<<<<<<<<<<<<< * state = FRAGMENT - * elif c is not None: + * elif not reached_end: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1154, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1214, __pyx_L1_error) - /* "w3lib/_url.pyx":1155 - * elif c == "#": + /* "w3lib/_url.pyx":1215 + * elif not reached_end and c == "#": * url.fragment = "" * state = FRAGMENT # <<<<<<<<<<<<<< - * elif c is not None: - * assert isinstance(c, str) + * elif not reached_end: + * url.query = None */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1153 + /* "w3lib/_url.pyx":1213 * url.query = "" * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< + * elif not reached_end and c == "#": # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ - goto __pyx_L95; + goto __pyx_L106; } - /* "w3lib/_url.pyx":1156 + /* "w3lib/_url.pyx":1216 * url.fragment = "" * state = FRAGMENT - * elif c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * url.query = None - */ - __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_11) { - - /* "w3lib/_url.pyx":1157 - * state = FRAGMENT - * elif c is not None: - * assert isinstance(c, str) # <<<<<<<<<<<<<< + * elif not reached_end: # <<<<<<<<<<<<<< * url.query = None * if not _starts_with_windows_drive_letter(input[pointer:]): */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_11 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_11)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1157, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1157, __pyx_L1_error) - #endif + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1158 - * elif c is not None: - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1217 + * state = FRAGMENT + * elif not reached_end: * url.query = None # <<<<<<<<<<<<<< * if not _starts_with_windows_drive_letter(input[pointer:]): * _shorten_path(url) */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 1158, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 1217, __pyx_L1_error) - /* "w3lib/_url.pyx":1159 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1218 + * elif not reached_end: * url.query = None * if not _starts_with_windows_drive_letter(input[pointer:]): # <<<<<<<<<<<<<< * _shorten_path(url) * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_v_input == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1159, __pyx_L1_error) + __PYX_ERR(0, 1218, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_pointer); __pyx_t_3 = __pyx_v_pointer; - __pyx_t_11 = (__pyx_t_3 == Py_None); - if (__pyx_t_11) { - __pyx_t_12 = 0; + __pyx_t_8 = (__pyx_t_3 == Py_None); + if (__pyx_t_8) { + __pyx_t_9 = 0; } else { - __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) - __pyx_t_12 = __pyx_t_7; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1218, __pyx_L1_error) + __pyx_t_9 = __pyx_t_7; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_12, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_9, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = NULL; + __pyx_t_12 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_15)) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; @@ -17756,27 +18162,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_3}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1159, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_14 = (!__pyx_t_11); - if (__pyx_t_14) { + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1218, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_11 = (!__pyx_t_8); + if (__pyx_t_11) { - /* "w3lib/_url.pyx":1160 + /* "w3lib/_url.pyx":1219 * url.query = None * if not _starts_with_windows_drive_letter(input[pointer:]): * _shorten_path(url) # <<<<<<<<<<<<<< * else: * url.path = [] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_6 = 0; @@ -17794,25 +18200,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_url}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1159 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1218 + * elif not reached_end: * url.query = None * if not _starts_with_windows_drive_letter(input[pointer:]): # <<<<<<<<<<<<<< * _shorten_path(url) * else: */ - goto __pyx_L96; + goto __pyx_L111; } - /* "w3lib/_url.pyx":1162 + /* "w3lib/_url.pyx":1221 * _shorten_path(url) * else: * url.path = [] # <<<<<<<<<<<<<< @@ -17820,14 +18226,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * pointer -= 1 */ /*else*/ { - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_4) < 0) __PYX_ERR(0, 1162, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_5) < 0) __PYX_ERR(0, 1221, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_L96:; + __pyx_L111:; - /* "w3lib/_url.pyx":1163 + /* "w3lib/_url.pyx":1222 * else: * url.path = [] * state = PATH # <<<<<<<<<<<<<< @@ -17836,39 +18242,39 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1164 + /* "w3lib/_url.pyx":1223 * url.path = [] * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * else: * state = PATH */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1156 + /* "w3lib/_url.pyx":1216 * url.fragment = "" * state = FRAGMENT - * elif c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * elif not reached_end: # <<<<<<<<<<<<<< * url.query = None + * if not _starts_with_windows_drive_letter(input[pointer:]): */ } - __pyx_L95:; + __pyx_L106:; - /* "w3lib/_url.pyx":1146 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1206 + * if not reached_end and c in "/\\": * state = FILE_SLASH * elif base is not None and base.scheme == "file": # <<<<<<<<<<<<<< * url.hostname = base.hostname * url.path = base.path */ - goto __pyx_L90; + goto __pyx_L101; } - /* "w3lib/_url.pyx":1166 + /* "w3lib/_url.pyx":1225 * pointer -= 1 * else: * state = PATH # <<<<<<<<<<<<<< @@ -17878,119 +18284,79 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1167 + /* "w3lib/_url.pyx":1226 * else: * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == FILE_SLASH: */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_5); + __pyx_t_5 = 0; } - __pyx_L90:; + __pyx_L101:; - /* "w3lib/_url.pyx":1140 + /* "w3lib/_url.pyx":1201 * raise ValueError * * elif state == FILE: # <<<<<<<<<<<<<< * url.scheme = "file" * url.hostname = "" */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1169 + /* "w3lib/_url.pyx":1228 * pointer -= 1 * * elif state == FILE_SLASH: # <<<<<<<<<<<<<< - * assert isinstance(url.path, list) - * if c is not None and c in "/\\": + * if not reached_end and c in "/\\": + * state = FILE_HOST */ - __pyx_t_14 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_SLASH); - if (__pyx_t_14) { + __pyx_t_11 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_SLASH); + if (__pyx_t_11) { - /* "w3lib/_url.pyx":1170 + /* "w3lib/_url.pyx":1229 * * elif state == FILE_SLASH: - * assert isinstance(url.path, list) # <<<<<<<<<<<<<< - * if c is not None and c in "/\\": - * assert isinstance(c, str) - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = PyList_Check(__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_14)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1170, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1170, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":1171 - * elif state == FILE_SLASH: - * assert isinstance(url.path, list) - * if c is not None and c in "/\\": # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< * state = FILE_HOST + * else: */ - __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_11) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_14 = __pyx_t_11; - goto __pyx_L98_bool_binop_done; + __pyx_t_11 = __pyx_t_8; + goto __pyx_L113_bool_binop_done; } - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1171, __pyx_L1_error) - __pyx_t_14 = __pyx_t_11; - __pyx_L98_bool_binop_done:; - if (__pyx_t_14) { - - /* "w3lib/_url.pyx":1172 - * assert isinstance(url.path, list) - * if c is not None and c in "/\\": - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * state = FILE_HOST - * else: - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_14 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_14)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1172, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1172, __pyx_L1_error) - #endif + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1229, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_11 = __pyx_t_8; + __pyx_L113_bool_binop_done:; + if (__pyx_t_11) { - /* "w3lib/_url.pyx":1173 - * if c is not None and c in "/\\": - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1230 + * elif state == FILE_SLASH: + * if not reached_end and c in "/\\": * state = FILE_HOST # <<<<<<<<<<<<<< * else: * if base is not None and base.scheme == "file": */ __pyx_v_state = __pyx_v_5w3lib_4_url_FILE_HOST; - /* "w3lib/_url.pyx":1171 + /* "w3lib/_url.pyx":1229 + * * elif state == FILE_SLASH: - * assert isinstance(url.path, list) - * if c is not None and c in "/\\": # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< * state = FILE_HOST + * else: */ - goto __pyx_L97; + goto __pyx_L112; } - /* "w3lib/_url.pyx":1175 + /* "w3lib/_url.pyx":1232 * state = FILE_HOST * else: * if base is not None and base.scheme == "file": # <<<<<<<<<<<<<< @@ -17998,43 +18364,43 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * if not _starts_with_windows_drive_letter( */ /*else*/ { - __pyx_t_11 = (__pyx_v_base != Py_None); - if (__pyx_t_11) { + __pyx_t_8 = (__pyx_v_base != Py_None); + if (__pyx_t_8) { } else { - __pyx_t_14 = __pyx_t_11; - goto __pyx_L101_bool_binop_done; + __pyx_t_11 = __pyx_t_8; + goto __pyx_L116_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_14 = __pyx_t_11; - __pyx_L101_bool_binop_done:; - if (__pyx_t_14) { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1232, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_11 = __pyx_t_8; + __pyx_L116_bool_binop_done:; + if (__pyx_t_11) { - /* "w3lib/_url.pyx":1176 + /* "w3lib/_url.pyx":1233 * else: * if base is not None and base.scheme == "file": * url.hostname = base.hostname # <<<<<<<<<<<<<< * if not _starts_with_windows_drive_letter( * input[pointer:] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_5) < 0) __PYX_ERR(0, 1233, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1177 + /* "w3lib/_url.pyx":1234 * if base is not None and base.scheme == "file": * url.hostname = base.hostname * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< * input[pointer:] * ) and _is_windows_drive_letter(base.path[0]): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":1178 + /* "w3lib/_url.pyx":1235 * url.hostname = base.hostname * if not _starts_with_windows_drive_letter( * input[pointer:] # <<<<<<<<<<<<<< @@ -18043,28 +18409,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ if (unlikely(__pyx_v_input == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1178, __pyx_L1_error) + __PYX_ERR(0, 1235, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_pointer); __pyx_t_3 = __pyx_v_pointer; - __pyx_t_11 = (__pyx_t_3 == Py_None); - if (__pyx_t_11) { - __pyx_t_12 = 0; + __pyx_t_8 = (__pyx_t_3 == Py_None); + if (__pyx_t_8) { + __pyx_t_9 = 0; } else { - __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1178, __pyx_L1_error) - __pyx_t_12 = __pyx_t_7; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1235, __pyx_L1_error) + __pyx_t_9 = __pyx_t_7; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_12, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1178, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_9, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = NULL; + __pyx_t_12 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_15)) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; @@ -18072,44 +18438,44 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_3}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "w3lib/_url.pyx":1177 + /* "w3lib/_url.pyx":1234 * if base is not None and base.scheme == "file": * url.hostname = base.hostname * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< * input[pointer:] * ) and _is_windows_drive_letter(base.path[0]): */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1177, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = (!__pyx_t_11); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = (!__pyx_t_8); if (__pyx_t_1) { } else { - __pyx_t_14 = __pyx_t_1; - goto __pyx_L104_bool_binop_done; + __pyx_t_11 = __pyx_t_1; + goto __pyx_L119_bool_binop_done; } - /* "w3lib/_url.pyx":1179 + /* "w3lib/_url.pyx":1236 * if not _starts_with_windows_drive_letter( * input[pointer:] * ) and _is_windows_drive_letter(base.path[0]): # <<<<<<<<<<<<<< * url.path.append(base.path[0]) * state = PATH */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; @@ -18126,47 +18492,47 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_15}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_12}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1179, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_14 = __pyx_t_1; - __pyx_L104_bool_binop_done:; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_11 = __pyx_t_1; + __pyx_L119_bool_binop_done:; - /* "w3lib/_url.pyx":1177 + /* "w3lib/_url.pyx":1234 * if base is not None and base.scheme == "file": * url.hostname = base.hostname * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< * input[pointer:] * ) and _is_windows_drive_letter(base.path[0]): */ - if (__pyx_t_14) { + if (__pyx_t_11) { - /* "w3lib/_url.pyx":1180 + /* "w3lib/_url.pyx":1237 * input[pointer:] * ) and _is_windows_drive_letter(base.path[0]): * url.path.append(base.path[0]) # <<<<<<<<<<<<<< * state = PATH * pointer -= 1 */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_15); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1180, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_5, __pyx_t_12); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "w3lib/_url.pyx":1177 + /* "w3lib/_url.pyx":1234 * if base is not None and base.scheme == "file": * url.hostname = base.hostname * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< @@ -18175,7 +18541,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1175 + /* "w3lib/_url.pyx":1232 * state = FILE_HOST * else: * if base is not None and base.scheme == "file": # <<<<<<<<<<<<<< @@ -18184,7 +18550,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1181 + /* "w3lib/_url.pyx":1238 * ) and _is_windows_drive_letter(base.path[0]): * url.path.append(base.path[0]) * state = PATH # <<<<<<<<<<<<<< @@ -18193,106 +18559,106 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1182 + /* "w3lib/_url.pyx":1239 * url.path.append(base.path[0]) * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == FILE_HOST: */ - __pyx_t_15 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_15); - __pyx_t_15 = 0; + __pyx_t_12 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_12); + __pyx_t_12 = 0; } - __pyx_L97:; + __pyx_L112:; - /* "w3lib/_url.pyx":1169 + /* "w3lib/_url.pyx":1228 * pointer -= 1 * * elif state == FILE_SLASH: # <<<<<<<<<<<<<< - * assert isinstance(url.path, list) - * if c is not None and c in "/\\": + * if not reached_end and c in "/\\": + * state = FILE_HOST */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1184 + /* "w3lib/_url.pyx":1241 * pointer -= 1 * * elif state == FILE_HOST: # <<<<<<<<<<<<<< - * if c is None or c in "/\\?#": + * if reached_end or c in "/\\?#": * pointer -= 1 */ - __pyx_t_14 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_HOST); - if (__pyx_t_14) { + __pyx_t_11 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_HOST); + if (__pyx_t_11) { - /* "w3lib/_url.pyx":1185 + /* "w3lib/_url.pyx":1242 * * elif state == FILE_HOST: - * if c is None or c in "/\\?#": # <<<<<<<<<<<<<< + * if reached_end or c in "/\\?#": # <<<<<<<<<<<<<< * pointer -= 1 * if _is_windows_drive_letter(buffer): */ - __pyx_t_1 = (__pyx_v_c == ((PyObject*)Py_None)); - if (!__pyx_t_1) { + if (!__pyx_v_reached_end) { } else { - __pyx_t_14 = __pyx_t_1; - goto __pyx_L107_bool_binop_done; + __pyx_t_11 = __pyx_v_reached_end; + goto __pyx_L122_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1185, __pyx_L1_error) - __pyx_t_14 = __pyx_t_1; - __pyx_L107_bool_binop_done:; - if (__pyx_t_14) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1242, __pyx_L1_error) } + __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_11 = __pyx_t_1; + __pyx_L122_bool_binop_done:; + if (__pyx_t_11) { - /* "w3lib/_url.pyx":1186 + /* "w3lib/_url.pyx":1243 * elif state == FILE_HOST: - * if c is None or c in "/\\?#": + * if reached_end or c in "/\\?#": * pointer -= 1 # <<<<<<<<<<<<<< * if _is_windows_drive_letter(buffer): * state = PATH */ - __pyx_t_15 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_15); - __pyx_t_15 = 0; + __pyx_t_12 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_12); + __pyx_t_12 = 0; - /* "w3lib/_url.pyx":1187 - * if c is None or c in "/\\?#": + /* "w3lib/_url.pyx":1244 + * if reached_end or c in "/\\?#": * pointer -= 1 * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< * state = PATH * elif not buffer: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_buffer}; - __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1187, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (__pyx_t_14) { + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1244, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_11) { - /* "w3lib/_url.pyx":1188 + /* "w3lib/_url.pyx":1245 * pointer -= 1 * if _is_windows_drive_letter(buffer): * state = PATH # <<<<<<<<<<<<<< @@ -18301,37 +18667,37 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1187 - * if c is None or c in "/\\?#": + /* "w3lib/_url.pyx":1244 + * if reached_end or c in "/\\?#": * pointer -= 1 * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< * state = PATH * elif not buffer: */ - goto __pyx_L109; + goto __pyx_L124; } - /* "w3lib/_url.pyx":1189 + /* "w3lib/_url.pyx":1246 * if _is_windows_drive_letter(buffer): * state = PATH * elif not buffer: # <<<<<<<<<<<<<< * url.hostname = "" * state = PATH_START */ - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1189, __pyx_L1_error) - __pyx_t_1 = (!__pyx_t_14); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_1 = (!__pyx_t_11); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1190 + /* "w3lib/_url.pyx":1247 * state = PATH * elif not buffer: * url.hostname = "" # <<<<<<<<<<<<<< * state = PATH_START * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1247, __pyx_L1_error) - /* "w3lib/_url.pyx":1191 + /* "w3lib/_url.pyx":1248 * elif not buffer: * url.hostname = "" * state = PATH_START # <<<<<<<<<<<<<< @@ -18340,17 +18706,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":1189 + /* "w3lib/_url.pyx":1246 * if _is_windows_drive_letter(buffer): * state = PATH * elif not buffer: # <<<<<<<<<<<<<< * url.hostname = "" * state = PATH_START */ - goto __pyx_L109; + goto __pyx_L124; } - /* "w3lib/_url.pyx":1193 + /* "w3lib/_url.pyx":1250 * state = PATH_START * else: * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< @@ -18358,38 +18724,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * host = "" */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_buffer)) __PYX_ERR(0, 1193, __pyx_L1_error); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1193, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_buffer)) __PYX_ERR(0, 1250, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1193, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_special, __pyx_t_3) < 0) __PYX_ERR(0, 1193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_special, __pyx_t_3) < 0) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1193, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1194 + /* "w3lib/_url.pyx":1251 * else: * host = _parse_host(buffer, is_special=url.is_special) * if host == "localhost": # <<<<<<<<<<<<<< * host = "" * url.hostname = host */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_host, __pyx_n_u_localhost, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_host, __pyx_n_u_localhost, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1251, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":1195 + /* "w3lib/_url.pyx":1252 * host = _parse_host(buffer, is_special=url.is_special) * if host == "localhost": * host = "" # <<<<<<<<<<<<<< @@ -18399,7 +18765,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_host, __pyx_kp_u__2); - /* "w3lib/_url.pyx":1194 + /* "w3lib/_url.pyx":1251 * else: * host = _parse_host(buffer, is_special=url.is_special) * if host == "localhost": # <<<<<<<<<<<<<< @@ -18408,91 +18774,90 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1196 + /* "w3lib/_url.pyx":1253 * if host == "localhost": * host = "" * url.hostname = host # <<<<<<<<<<<<<< * buffer = "" * state = PATH_START */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 1196, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 1253, __pyx_L1_error) - /* "w3lib/_url.pyx":1197 + /* "w3lib/_url.pyx":1254 * host = "" * url.hostname = host * buffer = "" # <<<<<<<<<<<<<< * state = PATH_START - * else: + * elif not reached_end: */ __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":1198 + /* "w3lib/_url.pyx":1255 * url.hostname = host * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< - * else: - * assert isinstance(c, str) + * elif not reached_end: + * buffer += c */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; } - __pyx_L109:; + __pyx_L124:; - /* "w3lib/_url.pyx":1185 + /* "w3lib/_url.pyx":1242 * * elif state == FILE_HOST: - * if c is None or c in "/\\?#": # <<<<<<<<<<<<<< + * if reached_end or c in "/\\?#": # <<<<<<<<<<<<<< * pointer -= 1 * if _is_windows_drive_letter(buffer): */ - goto __pyx_L106; + goto __pyx_L121; } - /* "w3lib/_url.pyx":1200 + /* "w3lib/_url.pyx":1256 + * buffer = "" * state = PATH_START - * else: - * assert isinstance(c, str) # <<<<<<<<<<<<<< + * elif not reached_end: # <<<<<<<<<<<<<< * buffer += c * */ - /*else*/ { - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1200, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1200, __pyx_L1_error) - #endif + __pyx_t_1 = (!__pyx_v_reached_end); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":1201 - * else: - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1257 + * state = PATH_START + * elif not reached_end: * buffer += c # <<<<<<<<<<<<<< * * elif state == PATH_START: */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1257, __pyx_L1_error) } + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":1256 + * buffer = "" + * state = PATH_START + * elif not reached_end: # <<<<<<<<<<<<<< + * buffer += c + * + */ } - __pyx_L106:; + __pyx_L121:; - /* "w3lib/_url.pyx":1184 + /* "w3lib/_url.pyx":1241 * pointer -= 1 * * elif state == FILE_HOST: # <<<<<<<<<<<<<< - * if c is None or c in "/\\?#": + * if reached_end or c in "/\\?#": * pointer -= 1 */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1203 + /* "w3lib/_url.pyx":1259 * buffer += c * * elif state == PATH_START: # <<<<<<<<<<<<<< @@ -18502,349 +18867,298 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH_START); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1204 + /* "w3lib/_url.pyx":1260 * * elif state == PATH_START: * if url.is_special: # <<<<<<<<<<<<<< * state = PATH - * if c is not None and c not in "/\\": + * if not reached_end and c not in "/\\": */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1204, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1204, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1205 + /* "w3lib/_url.pyx":1261 * elif state == PATH_START: * if url.is_special: * state = PATH # <<<<<<<<<<<<<< - * if c is not None and c not in "/\\": - * assert isinstance(c, str) + * if not reached_end and c not in "/\\": + * pointer -= 1 */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1206 + /* "w3lib/_url.pyx":1262 * if url.is_special: * state = PATH - * if c is not None and c not in "/\\": # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if not reached_end and c not in "/\\": # <<<<<<<<<<<<<< * pointer -= 1 + * elif not reached_end: */ - __pyx_t_14 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_14) { + __pyx_t_11 = (!__pyx_v_reached_end); + if (__pyx_t_11) { } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L113_bool_binop_done; + __pyx_t_1 = __pyx_t_11; + goto __pyx_L128_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1206, __pyx_L1_error) - __pyx_t_1 = __pyx_t_14; - __pyx_L113_bool_binop_done:; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1262, __pyx_L1_error) } + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1262, __pyx_L1_error) + __pyx_t_1 = __pyx_t_11; + __pyx_L128_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1207 + /* "w3lib/_url.pyx":1263 * state = PATH - * if c is not None and c not in "/\\": - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * pointer -= 1 - * elif c == "?": - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1207, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1207, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":1208 - * if c is not None and c not in "/\\": - * assert isinstance(c, str) + * if not reached_end and c not in "/\\": * pointer -= 1 # <<<<<<<<<<<<<< - * elif c == "?": - * url.query = "" + * elif not reached_end: + * if c == "?": */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1206 + /* "w3lib/_url.pyx":1262 * if url.is_special: * state = PATH - * if c is not None and c not in "/\\": # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if not reached_end and c not in "/\\": # <<<<<<<<<<<<<< * pointer -= 1 + * elif not reached_end: */ } - /* "w3lib/_url.pyx":1204 + /* "w3lib/_url.pyx":1260 * * elif state == PATH_START: * if url.is_special: # <<<<<<<<<<<<<< * state = PATH - * if c is not None and c not in "/\\": + * if not reached_end and c not in "/\\": */ - goto __pyx_L111; + goto __pyx_L126; } - /* "w3lib/_url.pyx":1209 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1264 + * if not reached_end and c not in "/\\": * pointer -= 1 - * elif c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY + * elif not reached_end: # <<<<<<<<<<<<<< + * if c == "?": + * url.query = "" */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1209, __pyx_L1_error) + __pyx_t_1 = (!__pyx_v_reached_end); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1210 + /* "w3lib/_url.pyx":1265 * pointer -= 1 - * elif c == "?": - * url.query = "" # <<<<<<<<<<<<<< - * state = QUERY - * elif c == "#": - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) - - /* "w3lib/_url.pyx":1211 - * elif c == "?": - * url.query = "" - * state = QUERY # <<<<<<<<<<<<<< - * elif c == "#": - * url.fragment = "" + * elif not reached_end: + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY */ - __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1265, __pyx_L1_error) } + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":1209 - * assert isinstance(c, str) - * pointer -= 1 - * elif c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY + /* "w3lib/_url.pyx":1266 + * elif not reached_end: + * if c == "?": + * url.query = "" # <<<<<<<<<<<<<< + * state = QUERY + * elif c == "#": */ - goto __pyx_L111; - } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1266, __pyx_L1_error) - /* "w3lib/_url.pyx":1212 - * url.query = "" - * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":1267 + * if c == "?": + * url.query = "" + * state = QUERY # <<<<<<<<<<<<<< + * elif c == "#": + * url.fragment = "" */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1212, __pyx_L1_error) - if (__pyx_t_1) { + __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":1213 - * state = QUERY - * elif c == "#": - * url.fragment = "" # <<<<<<<<<<<<<< - * state = FRAGMENT - * elif c is not None: + /* "w3lib/_url.pyx":1265 + * pointer -= 1 + * elif not reached_end: + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1213, __pyx_L1_error) + goto __pyx_L130; + } - /* "w3lib/_url.pyx":1214 - * elif c == "#": - * url.fragment = "" - * state = FRAGMENT # <<<<<<<<<<<<<< - * elif c is not None: - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1268 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT */ - __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1268, __pyx_L1_error) } + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1268, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":1212 - * url.query = "" - * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":1269 + * state = QUERY + * elif c == "#": + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * else: */ - goto __pyx_L111; - } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1269, __pyx_L1_error) - /* "w3lib/_url.pyx":1215 - * url.fragment = "" - * state = FRAGMENT - * elif c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * state = PATH + /* "w3lib/_url.pyx":1270 + * elif c == "#": + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * else: + * state = PATH */ - __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_1) { + __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1216 - * state = FRAGMENT - * elif c is not None: - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * state = PATH - * if c != "/": + /* "w3lib/_url.pyx":1268 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1216, __pyx_L1_error) - } + goto __pyx_L130; } - #else - if ((1)); else __PYX_ERR(0, 1216, __pyx_L1_error) - #endif - /* "w3lib/_url.pyx":1217 - * elif c is not None: - * assert isinstance(c, str) - * state = PATH # <<<<<<<<<<<<<< - * if c != "/": - * pointer -= 1 + /* "w3lib/_url.pyx":1272 + * state = FRAGMENT + * else: + * state = PATH # <<<<<<<<<<<<<< + * if c != "/": + * pointer -= 1 */ - __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; + /*else*/ { + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1218 - * assert isinstance(c, str) - * state = PATH - * if c != "/": # <<<<<<<<<<<<<< - * pointer -= 1 + /* "w3lib/_url.pyx":1273 + * else: + * state = PATH + * if c != "/": # <<<<<<<<<<<<<< + * pointer -= 1 * */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1218, __pyx_L1_error) - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1273, __pyx_L1_error) } + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1273, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":1219 - * state = PATH - * if c != "/": - * pointer -= 1 # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1274 + * state = PATH + * if c != "/": + * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == PATH: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1218 - * assert isinstance(c, str) - * state = PATH - * if c != "/": # <<<<<<<<<<<<<< - * pointer -= 1 + /* "w3lib/_url.pyx":1273 + * else: + * state = PATH + * if c != "/": # <<<<<<<<<<<<<< + * pointer -= 1 * */ + } } + __pyx_L130:; - /* "w3lib/_url.pyx":1215 - * url.fragment = "" - * state = FRAGMENT - * elif c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * state = PATH + /* "w3lib/_url.pyx":1264 + * if not reached_end and c not in "/\\": + * pointer -= 1 + * elif not reached_end: # <<<<<<<<<<<<<< + * if c == "?": + * url.query = "" */ } - __pyx_L111:; + __pyx_L126:; - /* "w3lib/_url.pyx":1203 + /* "w3lib/_url.pyx":1259 * buffer += c * * elif state == PATH_START: # <<<<<<<<<<<<<< * if url.is_special: * state = PATH */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1221 - * pointer -= 1 + /* "w3lib/_url.pyx":1276 + * pointer -= 1 * * elif state == PATH: # <<<<<<<<<<<<<< - * assert isinstance(url.path, list) - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if _is_double_dot_path_segment(buffer): */ __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1222 + /* "w3lib/_url.pyx":1277 * * elif state == PATH: - * assert isinstance(url.path, list) # <<<<<<<<<<<<<< - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": - * if _is_double_dot_path_segment(buffer): - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyList_Check(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1222, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1222, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":1223 - * elif state == PATH: - * assert isinstance(url.path, list) - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": # <<<<<<<<<<<<<< + * if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": # <<<<<<<<<<<<<< * if _is_double_dot_path_segment(buffer): * _shorten_path(url) */ - __pyx_t_14 = (__pyx_v_c == ((PyObject*)Py_None)); - if (!__pyx_t_14) { + if (!__pyx_v_reached_end) { } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L117_bool_binop_done; + __pyx_t_1 = __pyx_v_reached_end; + goto __pyx_L133_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1223, __pyx_L1_error) - if (!__pyx_t_14) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1277, __pyx_L1_error) } + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1277, __pyx_L1_error) + if (!__pyx_t_11) { } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L117_bool_binop_done; + __pyx_t_1 = __pyx_t_11; + goto __pyx_L133_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1223, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1223, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1277, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!__pyx_t_14) { - goto __pyx_L120_next_or; + if (!__pyx_t_11) { + goto __pyx_L136_next_or; } else { } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1223, __pyx_L1_error) - if (!__pyx_t_14) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1277, __pyx_L1_error) } + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1277, __pyx_L1_error) + if (!__pyx_t_11) { } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L117_bool_binop_done; + __pyx_t_1 = __pyx_t_11; + goto __pyx_L133_bool_binop_done; } - __pyx_L120_next_or:; - __pyx_t_14 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1223, __pyx_L1_error) - __pyx_t_1 = __pyx_t_14; - __pyx_L117_bool_binop_done:; + __pyx_L136_next_or:; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1277, __pyx_L1_error) } + __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1277, __pyx_L1_error) + __pyx_t_1 = __pyx_t_11; + __pyx_L133_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1224 - * assert isinstance(url.path, list) - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + /* "w3lib/_url.pyx":1278 + * elif state == PATH: + * if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< * _shorten_path(url) * if c != "/" and not (url.is_special and c == "\\"): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_double_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_double_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; + __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; @@ -18852,34 +19166,34 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_buffer}; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_buffer}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1224, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1225 - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + /* "w3lib/_url.pyx":1279 + * if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): * _shorten_path(url) # <<<<<<<<<<<<<< * if c != "/" and not (url.is_special and c == "\\"): * url.path.append("") */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1225, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; + __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; @@ -18887,58 +19201,60 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_url}; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_url}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1225, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1226 + /* "w3lib/_url.pyx":1280 * if _is_double_dot_path_segment(buffer): * _shorten_path(url) * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< * url.path.append("") * elif _is_single_dot_path_segment(buffer): */ - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1226, __pyx_L1_error) - if (__pyx_t_14) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1280, __pyx_L1_error) } + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1280, __pyx_L1_error) + if (__pyx_t_11) { } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L124_bool_binop_done; + __pyx_t_1 = __pyx_t_11; + goto __pyx_L140_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1226, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_11) { + if (__pyx_t_8) { } else { - __pyx_t_14 = __pyx_t_11; - goto __pyx_L126_bool_binop_done; + __pyx_t_11 = __pyx_t_8; + goto __pyx_L142_bool_binop_done; } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1226, __pyx_L1_error) - __pyx_t_14 = __pyx_t_11; - __pyx_L126_bool_binop_done:; - __pyx_t_11 = (!__pyx_t_14); - __pyx_t_1 = __pyx_t_11; - __pyx_L124_bool_binop_done:; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1280, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1280, __pyx_L1_error) + __pyx_t_11 = __pyx_t_8; + __pyx_L142_bool_binop_done:; + __pyx_t_8 = (!__pyx_t_11); + __pyx_t_1 = __pyx_t_8; + __pyx_L140_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1227 + /* "w3lib/_url.pyx":1281 * _shorten_path(url) * if c != "/" and not (url.is_special and c == "\\"): * url.path.append("") # <<<<<<<<<<<<<< * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.is_special and c == "\\"): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1227, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1226 + /* "w3lib/_url.pyx":1280 * if _is_double_dot_path_segment(buffer): * _shorten_path(url) * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< @@ -18947,33 +19263,33 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1224 - * assert isinstance(url.path, list) - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + /* "w3lib/_url.pyx":1278 + * elif state == PATH: + * if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< * _shorten_path(url) * if c != "/" and not (url.is_special and c == "\\"): */ - goto __pyx_L122; + goto __pyx_L138; } - /* "w3lib/_url.pyx":1228 + /* "w3lib/_url.pyx":1282 * if c != "/" and not (url.is_special and c == "\\"): * url.path.append("") * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< * if c != "/" and not (url.is_special and c == "\\"): * url.path.append("") */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_single_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_single_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; + __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; @@ -18981,60 +19297,62 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_buffer}; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_buffer}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1229 + /* "w3lib/_url.pyx":1283 * url.path.append("") * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< * url.path.append("") * else: */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) - if (__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1283, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1283, __pyx_L1_error) + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L129_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L145_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1283, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_14) { + if (__pyx_t_11) { } else { - __pyx_t_11 = __pyx_t_14; - goto __pyx_L131_bool_binop_done; + __pyx_t_8 = __pyx_t_11; + goto __pyx_L147_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) - __pyx_t_11 = __pyx_t_14; - __pyx_L131_bool_binop_done:; - __pyx_t_14 = (!__pyx_t_11); - __pyx_t_1 = __pyx_t_14; - __pyx_L129_bool_binop_done:; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1283, __pyx_L1_error) } + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_t_8 = __pyx_t_11; + __pyx_L147_bool_binop_done:; + __pyx_t_11 = (!__pyx_t_8); + __pyx_t_1 = __pyx_t_11; + __pyx_L145_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1230 + /* "w3lib/_url.pyx":1284 * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.is_special and c == "\\"): * url.path.append("") # <<<<<<<<<<<<<< * else: * if ( */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 1284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1229 + /* "w3lib/_url.pyx":1283 * url.path.append("") * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< @@ -19043,17 +19361,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1228 + /* "w3lib/_url.pyx":1282 * if c != "/" and not (url.is_special and c == "\\"): * url.path.append("") * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< * if c != "/" and not (url.is_special and c == "\\"): * url.path.append("") */ - goto __pyx_L122; + goto __pyx_L138; } - /* "w3lib/_url.pyx":1232 + /* "w3lib/_url.pyx":1286 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< @@ -19062,58 +19380,58 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ /*else*/ { - /* "w3lib/_url.pyx":1233 + /* "w3lib/_url.pyx":1287 * else: * if ( * url.scheme == "file" # <<<<<<<<<<<<<< * and not url.path * and _is_windows_drive_letter(buffer) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_14) { + if (__pyx_t_11) { } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L134_bool_binop_done; + __pyx_t_1 = __pyx_t_11; + goto __pyx_L150_bool_binop_done; } - /* "w3lib/_url.pyx":1234 + /* "w3lib/_url.pyx":1288 * if ( * url.scheme == "file" * and not url.path # <<<<<<<<<<<<<< * and _is_windows_drive_letter(buffer) * ): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = (!__pyx_t_14); - if (__pyx_t_11) { + __pyx_t_8 = (!__pyx_t_11); + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L134_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L150_bool_binop_done; } - /* "w3lib/_url.pyx":1235 + /* "w3lib/_url.pyx":1289 * url.scheme == "file" * and not url.path * and _is_windows_drive_letter(buffer) # <<<<<<<<<<<<<< * ): * buffer = buffer[0] + ":" + buffer[2:] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; + __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; @@ -19121,19 +19439,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_buffer}; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_buffer}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_11; - __pyx_L134_bool_binop_done:; + __pyx_t_1 = __pyx_t_8; + __pyx_L150_bool_binop_done:; - /* "w3lib/_url.pyx":1232 + /* "w3lib/_url.pyx":1286 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< @@ -19142,28 +19460,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ if (__pyx_t_1) { - /* "w3lib/_url.pyx":1237 + /* "w3lib/_url.pyx":1291 * and _is_windows_drive_letter(buffer) * ): * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< * if ( * not url.path */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_buffer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_buffer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_buffer, 2, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_buffer, 2, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1232 + /* "w3lib/_url.pyx":1286 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< @@ -19172,85 +19490,86 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1239 + /* "w3lib/_url.pyx":1293 * buffer = buffer[0] + ":" + buffer[2:] * if ( * not url.path # <<<<<<<<<<<<<< * and not buffer - * and c is not None + * and not reached_end */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1239, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_14 = (!__pyx_t_11); - if (__pyx_t_14) { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1293, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_11 = (!__pyx_t_8); + if (__pyx_t_11) { } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L138_bool_binop_done; + __pyx_t_1 = __pyx_t_11; + goto __pyx_L154_bool_binop_done; } - /* "w3lib/_url.pyx":1240 + /* "w3lib/_url.pyx":1294 * if ( * not url.path * and not buffer # <<<<<<<<<<<<<< - * and c is not None + * and not reached_end * and c in "?#" */ - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1240, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_14); - if (__pyx_t_11) { + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_8 = (!__pyx_t_11); + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L138_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L154_bool_binop_done; } - /* "w3lib/_url.pyx":1241 + /* "w3lib/_url.pyx":1295 * not url.path * and not buffer - * and c is not None # <<<<<<<<<<<<<< + * and not reached_end # <<<<<<<<<<<<<< * and c in "?#" * and input[pointer - 1] not in "/\\" */ - __pyx_t_11 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_11) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L138_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L154_bool_binop_done; } - /* "w3lib/_url.pyx":1242 + /* "w3lib/_url.pyx":1296 * and not buffer - * and c is not None + * and not reached_end * and c in "?#" # <<<<<<<<<<<<<< * and input[pointer - 1] not in "/\\" * ): */ - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1242, __pyx_L1_error) - if (__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1296, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1296, __pyx_L1_error) + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L138_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L154_bool_binop_done; } - /* "w3lib/_url.pyx":1243 - * and c is not None + /* "w3lib/_url.pyx":1297 + * and not reached_end * and c in "?#" * and input[pointer - 1] not in "/\\" # <<<<<<<<<<<<<< * ): * url._path_token_seen = True */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1243, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_t_3, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_t_3, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_11; - __pyx_L138_bool_binop_done:; + __pyx_t_1 = __pyx_t_8; + __pyx_L154_bool_binop_done:; - /* "w3lib/_url.pyx":1238 + /* "w3lib/_url.pyx":1292 * ): * buffer = buffer[0] + ":" + buffer[2:] * if ( # <<<<<<<<<<<<<< @@ -19259,16 +19578,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ if (__pyx_t_1) { - /* "w3lib/_url.pyx":1245 + /* "w3lib/_url.pyx":1299 * and input[pointer - 1] not in "/\\" * ): * url._path_token_seen = True # <<<<<<<<<<<<<< * url.path.append(buffer) * buffer = "" */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen, Py_True) < 0) __PYX_ERR(0, 1245, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen, Py_True) < 0) __PYX_ERR(0, 1299, __pyx_L1_error) - /* "w3lib/_url.pyx":1238 + /* "w3lib/_url.pyx":1292 * ): * buffer = buffer[0] + ":" + buffer[2:] * if ( # <<<<<<<<<<<<<< @@ -19277,561 +19596,513 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1246 + /* "w3lib/_url.pyx":1300 * ): * url._path_token_seen = True * url.path.append(buffer) # <<<<<<<<<<<<<< * buffer = "" - * if c == "?": + * if not reached_end: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_buffer); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_buffer); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 1300, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_L122:; + __pyx_L138:; - /* "w3lib/_url.pyx":1247 + /* "w3lib/_url.pyx":1301 * url._path_token_seen = True * url.path.append(buffer) * buffer = "" # <<<<<<<<<<<<<< - * if c == "?": - * url.query = "" + * if not reached_end: + * if c == "?": */ __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":1248 + /* "w3lib/_url.pyx":1302 * url.path.append(buffer) * buffer = "" - * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY + * if not reached_end: # <<<<<<<<<<<<<< + * if c == "?": + * url.query = "" */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_1 = (!__pyx_v_reached_end); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1249 + /* "w3lib/_url.pyx":1303 * buffer = "" - * if c == "?": - * url.query = "" # <<<<<<<<<<<<<< - * state = QUERY - * elif c == "#": + * if not reached_end: + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1249, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1303, __pyx_L1_error) } + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1303, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":1250 - * if c == "?": - * url.query = "" - * state = QUERY # <<<<<<<<<<<<<< - * elif c == "#": - * url.fragment = "" + /* "w3lib/_url.pyx":1304 + * if not reached_end: + * if c == "?": + * url.query = "" # <<<<<<<<<<<<<< + * state = QUERY + * elif c == "#": */ - __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1304, __pyx_L1_error) - /* "w3lib/_url.pyx":1248 - * url.path.append(buffer) - * buffer = "" - * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY + /* "w3lib/_url.pyx":1305 + * if c == "?": + * url.query = "" + * state = QUERY # <<<<<<<<<<<<<< + * elif c == "#": + * url.fragment = "" */ - goto __pyx_L143; - } + __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":1251 - * url.query = "" - * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":1303 + * buffer = "" + * if not reached_end: + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1251, __pyx_L1_error) - if (__pyx_t_1) { + goto __pyx_L160; + } - /* "w3lib/_url.pyx":1252 - * state = QUERY - * elif c == "#": - * url.fragment = "" # <<<<<<<<<<<<<< - * state = FRAGMENT - * else: + /* "w3lib/_url.pyx":1306 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1252, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1306, __pyx_L1_error) } + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1306, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":1253 - * elif c == "#": - * url.fragment = "" - * state = FRAGMENT # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1307 + * state = QUERY + * elif c == "#": + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT * else: - * assert isinstance(c, str) - */ - __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - - /* "w3lib/_url.pyx":1251 - * url.query = "" - * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT - */ - } - __pyx_L143:; - - /* "w3lib/_url.pyx":1223 - * elif state == PATH: - * assert isinstance(url.path, list) - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": # <<<<<<<<<<<<<< - * if _is_double_dot_path_segment(buffer): - * _shorten_path(url) */ - goto __pyx_L116; - } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1307, __pyx_L1_error) - /* "w3lib/_url.pyx":1255 - * state = FRAGMENT + /* "w3lib/_url.pyx":1308 + * elif c == "#": + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< * else: - * assert isinstance(c, str) # <<<<<<<<<<<<<< * buffer += _idempotent_utf_8_percent_encode( - * input=input, */ - /*else*/ { - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1255, __pyx_L1_error) + __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; + + /* "w3lib/_url.pyx":1306 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT + */ } + __pyx_L160:; + + /* "w3lib/_url.pyx":1302 + * url.path.append(buffer) + * buffer = "" + * if not reached_end: # <<<<<<<<<<<<<< + * if c == "?": + * url.query = "" + */ } - #else - if ((1)); else __PYX_ERR(0, 1255, __pyx_L1_error) - #endif - /* "w3lib/_url.pyx":1256 + /* "w3lib/_url.pyx":1277 + * + * elif state == PATH: + * if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": # <<<<<<<<<<<<<< + * if _is_double_dot_path_segment(buffer): + * _shorten_path(url) + */ + goto __pyx_L132; + } + + /* "w3lib/_url.pyx":1310 + * state = FRAGMENT * else: - * assert isinstance(c, str) * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, * pointer=pointer, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1256, __pyx_L1_error) + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":1257 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1311 + * else: * buffer += _idempotent_utf_8_percent_encode( * input=input, # <<<<<<<<<<<<<< * pointer=pointer, * encode_set=path_percent_encode_set, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1311, __pyx_L1_error) - /* "w3lib/_url.pyx":1258 + /* "w3lib/_url.pyx":1312 * buffer += _idempotent_utf_8_percent_encode( * input=input, * pointer=pointer, # <<<<<<<<<<<<<< * encode_set=path_percent_encode_set, * ) */ - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 1311, __pyx_L1_error) - /* "w3lib/_url.pyx":1259 + /* "w3lib/_url.pyx":1313 * input=input, * pointer=pointer, * encode_set=path_percent_encode_set, # <<<<<<<<<<<<<< * ) * */ - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encode_set, __pyx_v_path_percent_encode_set) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encode_set, __pyx_v_path_percent_encode_set) < 0) __PYX_ERR(0, 1311, __pyx_L1_error) - /* "w3lib/_url.pyx":1256 + /* "w3lib/_url.pyx":1310 + * state = FRAGMENT * else: - * assert isinstance(c, str) * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, * pointer=pointer, */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_5); + __pyx_t_5 = 0; } - __pyx_L116:; + __pyx_L132:; - /* "w3lib/_url.pyx":1221 - * pointer -= 1 + /* "w3lib/_url.pyx":1276 + * pointer -= 1 * * elif state == PATH: # <<<<<<<<<<<<<< - * assert isinstance(url.path, list) - * if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if _is_double_dot_path_segment(buffer): */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1262 + /* "w3lib/_url.pyx":1316 * ) * * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< - * assert isinstance(url.path, str) - * if c == "?": + * if not reached_end: + * if c == "?": */ __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_OPAQUE_PATH); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1263 + /* "w3lib/_url.pyx":1317 * * elif state == OPAQUE_PATH: - * assert isinstance(url.path, str) # <<<<<<<<<<<<<< - * if c == "?": - * url.query = "" + * if not reached_end: # <<<<<<<<<<<<<< + * if c == "?": + * url.query = "" */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyUnicode_Check(__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1263, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1263, __pyx_L1_error) - #endif + __pyx_t_1 = (!__pyx_v_reached_end); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":1264 + /* "w3lib/_url.pyx":1318 * elif state == OPAQUE_PATH: - * assert isinstance(url.path, str) - * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY + * if not reached_end: + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1264, __pyx_L1_error) - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1318, __pyx_L1_error) } + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1318, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":1265 - * assert isinstance(url.path, str) - * if c == "?": - * url.query = "" # <<<<<<<<<<<<<< - * state = QUERY - * elif c == "#": - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1265, __pyx_L1_error) - - /* "w3lib/_url.pyx":1266 - * if c == "?": - * url.query = "" - * state = QUERY # <<<<<<<<<<<<<< - * elif c == "#": - * url.fragment = "" + /* "w3lib/_url.pyx":1319 + * if not reached_end: + * if c == "?": + * url.query = "" # <<<<<<<<<<<<<< + * state = QUERY + * elif c == "#": */ - __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1319, __pyx_L1_error) - /* "w3lib/_url.pyx":1264 - * elif state == OPAQUE_PATH: - * assert isinstance(url.path, str) - * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY + /* "w3lib/_url.pyx":1320 + * if c == "?": + * url.query = "" + * state = QUERY # <<<<<<<<<<<<<< + * elif c == "#": + * url.fragment = "" */ - goto __pyx_L144; - } + __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":1267 - * url.query = "" - * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":1318 + * elif state == OPAQUE_PATH: + * if not reached_end: + * if c == "?": # <<<<<<<<<<<<<< + * url.query = "" + * state = QUERY */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1267, __pyx_L1_error) - if (__pyx_t_1) { + goto __pyx_L162; + } - /* "w3lib/_url.pyx":1268 - * state = QUERY - * elif c == "#": - * url.fragment = "" # <<<<<<<<<<<<<< - * state = FRAGMENT - * elif c is not None: + /* "w3lib/_url.pyx":1321 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1268, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1321, __pyx_L1_error) } + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1321, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":1269 - * elif c == "#": - * url.fragment = "" - * state = FRAGMENT # <<<<<<<<<<<<<< - * elif c is not None: - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1322 + * state = QUERY + * elif c == "#": + * url.fragment = "" # <<<<<<<<<<<<<< + * state = FRAGMENT + * else: */ - __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1322, __pyx_L1_error) - /* "w3lib/_url.pyx":1267 - * url.query = "" - * state = QUERY - * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":1323 + * elif c == "#": + * url.fragment = "" + * state = FRAGMENT # <<<<<<<<<<<<<< + * else: + * encoded = _utf_8_percent_encode( */ - goto __pyx_L144; - } + __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1270 - * url.fragment = "" - * state = FRAGMENT - * elif c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * encoded = _utf_8_percent_encode( + /* "w3lib/_url.pyx":1321 + * url.query = "" + * state = QUERY + * elif c == "#": # <<<<<<<<<<<<<< + * url.fragment = "" + * state = FRAGMENT */ - __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_1) { + goto __pyx_L162; + } - /* "w3lib/_url.pyx":1271 - * state = FRAGMENT - * elif c is not None: - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * encoded = _utf_8_percent_encode( - * c, + /* "w3lib/_url.pyx":1325 + * state = FRAGMENT + * else: + * encoded = _utf_8_percent_encode( # <<<<<<<<<<<<<< + * c, + * _C0_CONTROL_PERCENT_ENCODE_SET, */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1271, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1271, __pyx_L1_error) - #endif + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":1272 - * elif c is not None: - * assert isinstance(c, str) - * encoded = _utf_8_percent_encode( # <<<<<<<<<<<<<< - * c, - * _C0_CONTROL_PERCENT_ENCODE_SET, + /* "w3lib/_url.pyx":1326 + * else: + * encoded = _utf_8_percent_encode( + * c, # <<<<<<<<<<<<<< + * _C0_CONTROL_PERCENT_ENCODE_SET, + * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1326, __pyx_L1_error) } - /* "w3lib/_url.pyx":1274 - * encoded = _utf_8_percent_encode( - * c, - * _C0_CONTROL_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< - * ) - * url.path += encoded + /* "w3lib/_url.pyx":1327 + * encoded = _utf_8_percent_encode( + * c, + * _C0_CONTROL_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * ) + * url.path += encoded */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_15)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_15); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_v_c, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __Pyx_XDECREF_SET(__pyx_v_encoded, __pyx_t_4); - __pyx_t_4 = 0; + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_c, __pyx_t_3}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_encoded, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1276 - * _C0_CONTROL_PERCENT_ENCODE_SET, - * ) - * url.path += encoded # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1329 + * _C0_CONTROL_PERCENT_ENCODE_SET, + * ) + * url.path += encoded # <<<<<<<<<<<<<< * * elif state == QUERY: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_v_encoded); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_2) < 0) __PYX_ERR(0, 1276, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_v_encoded); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_2) < 0) __PYX_ERR(0, 1329, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L162:; - /* "w3lib/_url.pyx":1270 - * url.fragment = "" - * state = FRAGMENT - * elif c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * encoded = _utf_8_percent_encode( + /* "w3lib/_url.pyx":1317 + * + * elif state == OPAQUE_PATH: + * if not reached_end: # <<<<<<<<<<<<<< + * if c == "?": + * url.query = "" */ } - __pyx_L144:; - /* "w3lib/_url.pyx":1262 + /* "w3lib/_url.pyx":1316 * ) * * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< - * assert isinstance(url.path, str) - * if c == "?": + * if not reached_end: + * if c == "?": */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1278 - * url.path += encoded + /* "w3lib/_url.pyx":1331 + * url.path += encoded * * elif state == QUERY: # <<<<<<<<<<<<<< - * assert isinstance(url.query, str) * if encoding != "utf-8" and ( + * not url.is_special or url.scheme in ("ws", "wss") */ __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_QUERY); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1279 + /* "w3lib/_url.pyx":1332 * * elif state == QUERY: - * assert isinstance(url.query, str) # <<<<<<<<<<<<<< - * if encoding != "utf-8" and ( - * not url.is_special or url.scheme in ("ws", "wss") - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyUnicode_Check(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1279, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1279, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":1280 - * elif state == QUERY: - * assert isinstance(url.query, str) * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< * not url.is_special or url.scheme in ("ws", "wss") * ): */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_kp_u_utf_8, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1280, __pyx_L1_error) - if (__pyx_t_11) { + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_kp_u_utf_8, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1332, __pyx_L1_error) + if (__pyx_t_8) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L146_bool_binop_done; + __pyx_t_1 = __pyx_t_8; + goto __pyx_L164_bool_binop_done; } - /* "w3lib/_url.pyx":1281 - * assert isinstance(url.query, str) + /* "w3lib/_url.pyx":1333 + * elif state == QUERY: * if encoding != "utf-8" and ( * not url.is_special or url.scheme in ("ws", "wss") # <<<<<<<<<<<<<< * ): * encoding = "utf-8" */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1281, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1281, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_14 = (!__pyx_t_11); - if (!__pyx_t_14) { + __pyx_t_11 = (!__pyx_t_8); + if (!__pyx_t_11) { } else { - __pyx_t_1 = __pyx_t_14; - goto __pyx_L146_bool_binop_done; + __pyx_t_1 = __pyx_t_11; + goto __pyx_L164_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1281, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_ws, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1281, __pyx_L1_error) - if (!__pyx_t_11) { + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_ws, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1333, __pyx_L1_error) + if (!__pyx_t_8) { } else { - __pyx_t_14 = __pyx_t_11; - goto __pyx_L149_bool_binop_done; + __pyx_t_11 = __pyx_t_8; + goto __pyx_L167_bool_binop_done; } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_wss, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1281, __pyx_L1_error) - __pyx_t_14 = __pyx_t_11; - __pyx_L149_bool_binop_done:; + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_wss, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1333, __pyx_L1_error) + __pyx_t_11 = __pyx_t_8; + __pyx_L167_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = __pyx_t_14; - __pyx_t_1 = __pyx_t_11; - __pyx_L146_bool_binop_done:; + __pyx_t_8 = __pyx_t_11; + __pyx_t_1 = __pyx_t_8; + __pyx_L164_bool_binop_done:; - /* "w3lib/_url.pyx":1280 + /* "w3lib/_url.pyx":1332 + * * elif state == QUERY: - * assert isinstance(url.query, str) * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< * not url.is_special or url.scheme in ("ws", "wss") * ): */ if (__pyx_t_1) { - /* "w3lib/_url.pyx":1283 + /* "w3lib/_url.pyx":1335 * not url.is_special or url.scheme in ("ws", "wss") * ): * encoding = "utf-8" # <<<<<<<<<<<<<< - * if c == "#" or c is None: + * if reached_end or c == "#": * percent_encode_set = ( */ __Pyx_INCREF(__pyx_kp_u_utf_8); __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_kp_u_utf_8); - /* "w3lib/_url.pyx":1280 + /* "w3lib/_url.pyx":1332 + * * elif state == QUERY: - * assert isinstance(url.query, str) * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< * not url.is_special or url.scheme in ("ws", "wss") * ): */ } - /* "w3lib/_url.pyx":1284 + /* "w3lib/_url.pyx":1336 * ): * encoding = "utf-8" - * if c == "#" or c is None: # <<<<<<<<<<<<<< + * if reached_end or c == "#": # <<<<<<<<<<<<<< * percent_encode_set = ( * special_query_percent_encode_set */ - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1284, __pyx_L1_error) - if (!__pyx_t_11) { + if (!__pyx_v_reached_end) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L152_bool_binop_done; + __pyx_t_1 = __pyx_v_reached_end; + goto __pyx_L170_bool_binop_done; } - __pyx_t_11 = (__pyx_v_c == ((PyObject*)Py_None)); - __pyx_t_1 = __pyx_t_11; - __pyx_L152_bool_binop_done:; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1336, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1336, __pyx_L1_error) + __pyx_t_1 = __pyx_t_8; + __pyx_L170_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1287 + /* "w3lib/_url.pyx":1339 * percent_encode_set = ( * special_query_percent_encode_set * if url.is_special # <<<<<<<<<<<<<< * else query_percent_encode_set * ) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1287, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1339, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1286 - * if c == "#" or c is None: + /* "w3lib/_url.pyx":1338 + * if reached_end or c == "#": * percent_encode_set = ( * special_query_percent_encode_set # <<<<<<<<<<<<<< * if url.is_special @@ -19841,7 +20112,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_2 = __pyx_v_special_query_percent_encode_set; } else { - /* "w3lib/_url.pyx":1288 + /* "w3lib/_url.pyx":1340 * special_query_percent_encode_set * if url.is_special * else query_percent_encode_set # <<<<<<<<<<<<<< @@ -19854,327 +20125,277 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_XDECREF_SET(__pyx_v_percent_encode_set, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1290 + /* "w3lib/_url.pyx":1342 * else query_percent_encode_set * ) * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< * buffer, * encoding=encoding, */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); - /* "w3lib/_url.pyx":1291 + /* "w3lib/_url.pyx":1343 * ) * url.query += _percent_encode_after_encoding( * buffer, # <<<<<<<<<<<<<< * encoding=encoding, * percent_encode_set=percent_encode_set, */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buffer)) __PYX_ERR(0, 1290, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buffer)) __PYX_ERR(0, 1342, __pyx_L1_error); - /* "w3lib/_url.pyx":1292 + /* "w3lib/_url.pyx":1344 * url.query += _percent_encode_after_encoding( * buffer, * encoding=encoding, # <<<<<<<<<<<<<< * percent_encode_set=percent_encode_set, * ) */ - __pyx_t_15 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 1292, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 1344, __pyx_L1_error) - /* "w3lib/_url.pyx":1293 + /* "w3lib/_url.pyx":1345 * buffer, * encoding=encoding, * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< * ) * buffer = "" */ - if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 1292, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 1344, __pyx_L1_error) - /* "w3lib/_url.pyx":1290 + /* "w3lib/_url.pyx":1342 * else query_percent_encode_set * ) * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< * buffer, * encoding=encoding, */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_15); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_15) < 0) __PYX_ERR(0, 1290, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_12) < 0) __PYX_ERR(0, 1342, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "w3lib/_url.pyx":1295 + /* "w3lib/_url.pyx":1347 * percent_encode_set=percent_encode_set, * ) * buffer = "" # <<<<<<<<<<<<<< - * if c == "#": + * if not reached_end and c == "#": * url.fragment = "" */ __Pyx_INCREF(__pyx_kp_u__2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); - /* "w3lib/_url.pyx":1296 + /* "w3lib/_url.pyx":1348 * ) * buffer = "" - * if c == "#": # <<<<<<<<<<<<<< + * if not reached_end and c == "#": # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { + } else { + __pyx_t_1 = __pyx_t_8; + goto __pyx_L173_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1348, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_1 = __pyx_t_8; + __pyx_L173_bool_binop_done:; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1297 + /* "w3lib/_url.pyx":1349 * buffer = "" - * if c == "#": + * if not reached_end and c == "#": * url.fragment = "" # <<<<<<<<<<<<<< * state = FRAGMENT - * elif c is not None: + * elif not reached_end: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1297, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1349, __pyx_L1_error) - /* "w3lib/_url.pyx":1298 - * if c == "#": + /* "w3lib/_url.pyx":1350 + * if not reached_end and c == "#": * url.fragment = "" * state = FRAGMENT # <<<<<<<<<<<<<< - * elif c is not None: - * assert isinstance(c, str) + * elif not reached_end: + * buffer += c */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1296 + /* "w3lib/_url.pyx":1348 * ) * buffer = "" - * if c == "#": # <<<<<<<<<<<<<< + * if not reached_end and c == "#": # <<<<<<<<<<<<<< * url.fragment = "" * state = FRAGMENT */ } - /* "w3lib/_url.pyx":1284 + /* "w3lib/_url.pyx":1336 * ): * encoding = "utf-8" - * if c == "#" or c is None: # <<<<<<<<<<<<<< + * if reached_end or c == "#": # <<<<<<<<<<<<<< * percent_encode_set = ( * special_query_percent_encode_set */ - goto __pyx_L151; + goto __pyx_L169; } - /* "w3lib/_url.pyx":1299 + /* "w3lib/_url.pyx":1351 * url.fragment = "" * state = FRAGMENT - * elif c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * elif not reached_end: # <<<<<<<<<<<<<< * buffer += c + * */ - __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); + __pyx_t_1 = (!__pyx_v_reached_end); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1300 + /* "w3lib/_url.pyx":1352 * state = FRAGMENT - * elif c is not None: - * assert isinstance(c, str) # <<<<<<<<<<<<<< - * buffer += c - * - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1300, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1300, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":1301 - * elif c is not None: - * assert isinstance(c, str) + * elif not reached_end: * buffer += c # <<<<<<<<<<<<<< * * elif state == FRAGMENT: */ - __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_15); - __pyx_t_15 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1352, __pyx_L1_error) } + __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_12); + __pyx_t_12 = 0; - /* "w3lib/_url.pyx":1299 + /* "w3lib/_url.pyx":1351 * url.fragment = "" * state = FRAGMENT - * elif c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * elif not reached_end: # <<<<<<<<<<<<<< * buffer += c + * */ } - __pyx_L151:; + __pyx_L169:; - /* "w3lib/_url.pyx":1278 - * url.path += encoded + /* "w3lib/_url.pyx":1331 + * url.path += encoded * * elif state == QUERY: # <<<<<<<<<<<<<< - * assert isinstance(url.query, str) * if encoding != "utf-8" and ( + * not url.is_special or url.scheme in ("ws", "wss") */ - goto __pyx_L16; + goto __pyx_L7; } - /* "w3lib/_url.pyx":1303 + /* "w3lib/_url.pyx":1354 * buffer += c * * elif state == FRAGMENT: # <<<<<<<<<<<<<< - * assert isinstance(url.fragment, str) - * if c is not None: + * if not reached_end: + * url.fragment += _idempotent_utf_8_percent_encode( */ __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FRAGMENT); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1304 + /* "w3lib/_url.pyx":1355 * * elif state == FRAGMENT: - * assert isinstance(url.fragment, str) # <<<<<<<<<<<<<< - * if c is not None: - * assert isinstance(c, str) - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1304, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = PyUnicode_Check(__pyx_t_15); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1304, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1304, __pyx_L1_error) - #endif - - /* "w3lib/_url.pyx":1305 - * elif state == FRAGMENT: - * assert isinstance(url.fragment, str) - * if c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) - * url.fragment += _idempotent_utf_8_percent_encode( - */ - __pyx_t_1 = (__pyx_v_c != ((PyObject*)Py_None)); - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":1306 - * assert isinstance(url.fragment, str) - * if c is not None: - * assert isinstance(c, str) # <<<<<<<<<<<<<< + * if not reached_end: # <<<<<<<<<<<<<< * url.fragment += _idempotent_utf_8_percent_encode( * input=input, pointer=pointer, encode_set=fragment_percent_encode_set */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = PyUnicode_Check(__pyx_v_c); - if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1306, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 1306, __pyx_L1_error) - #endif + __pyx_t_1 = (!__pyx_v_reached_end); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":1307 - * if c is not None: - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1356 + * elif state == FRAGMENT: + * if not reached_end: * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, pointer=pointer, encode_set=fragment_percent_encode_set * ) */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); - /* "w3lib/_url.pyx":1308 - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1357 + * if not reached_end: * url.fragment += _idempotent_utf_8_percent_encode( * input=input, pointer=pointer, encode_set=fragment_percent_encode_set # <<<<<<<<<<<<<< * ) * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1308, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1308, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 1308, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_fragment_percent_encode_set) < 0) __PYX_ERR(0, 1308, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1357, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 1357, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_fragment_percent_encode_set) < 0) __PYX_ERR(0, 1357, __pyx_L1_error) - /* "w3lib/_url.pyx":1307 - * if c is not None: - * assert isinstance(c, str) + /* "w3lib/_url.pyx":1356 + * elif state == FRAGMENT: + * if not reached_end: * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, pointer=pointer, encode_set=fragment_percent_encode_set * ) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1307, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_15, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1307, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_12, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_t_2) < 0) __PYX_ERR(0, 1307, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_t_2) < 0) __PYX_ERR(0, 1356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1305 + /* "w3lib/_url.pyx":1355 + * * elif state == FRAGMENT: - * assert isinstance(url.fragment, str) - * if c is not None: # <<<<<<<<<<<<<< - * assert isinstance(c, str) + * if not reached_end: # <<<<<<<<<<<<<< * url.fragment += _idempotent_utf_8_percent_encode( + * input=input, pointer=pointer, encode_set=fragment_percent_encode_set */ } - /* "w3lib/_url.pyx":1303 + /* "w3lib/_url.pyx":1354 * buffer += c * * elif state == FRAGMENT: # <<<<<<<<<<<<<< - * assert isinstance(url.fragment, str) - * if c is not None: + * if not reached_end: + * url.fragment += _idempotent_utf_8_percent_encode( */ } - __pyx_L16:; + __pyx_L7:; - /* "w3lib/_url.pyx":1311 + /* "w3lib/_url.pyx":1360 * ) * * if pointer >= input_length: # <<<<<<<<<<<<<< * break * pointer += 1 */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1311, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1311, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "w3lib/_url.pyx":1312 + /* "w3lib/_url.pyx":1361 * * if pointer >= input_length: * break # <<<<<<<<<<<<<< @@ -20183,7 +20404,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ goto __pyx_L5_break; - /* "w3lib/_url.pyx":1311 + /* "w3lib/_url.pyx":1360 * ) * * if pointer >= input_length: # <<<<<<<<<<<<<< @@ -20192,21 +20413,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1313 + /* "w3lib/_url.pyx":1362 * if pointer >= input_length: * break * pointer += 1 # <<<<<<<<<<<<<< * * return url */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1313, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L5_break:; - /* "w3lib/_url.pyx":1315 + /* "w3lib/_url.pyx":1364 * pointer += 1 * * return url # <<<<<<<<<<<<<< @@ -20218,7 +20439,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_url; goto __pyx_L0; - /* "w3lib/_url.pyx":887 + /* "w3lib/_url.pyx":956 * * * def _parse_url( # <<<<<<<<<<<<<< @@ -20232,7 +20453,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -20256,7 +20477,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "w3lib/_url.pyx":1319 +/* "w3lib/_url.pyx":1368 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< @@ -20265,15 +20486,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_39_serialize_ipv4(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_41_serialize_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_39_serialize_ipv4 = {"_serialize_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_39_serialize_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_39_serialize_ipv4(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_41_serialize_ipv4 = {"_serialize_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_41_serialize_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_41_serialize_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -20317,12 +20538,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1319, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1368, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv4") < 0)) __PYX_ERR(0, 1319, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv4") < 0)) __PYX_ERR(0, 1368, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -20333,7 +20554,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1319, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1368, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20347,8 +20568,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyInt_Type), 0, "address", 1))) __PYX_ERR(0, 1319, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_38_serialize_ipv4(__pyx_self, __pyx_v_address); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyInt_Type), 0, "address", 1))) __PYX_ERR(0, 1368, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_40_serialize_ipv4(__pyx_self, __pyx_v_address); /* function exit code */ goto __pyx_L0; @@ -20365,7 +20586,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { +static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { PyObject *__pyx_v_output = NULL; PyObject *__pyx_v_n = NULL; long __pyx_v_i; @@ -20383,7 +20604,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_ipv4", 1); - /* "w3lib/_url.pyx":1320 + /* "w3lib/_url.pyx":1369 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: * output = "" # <<<<<<<<<<<<<< @@ -20393,7 +20614,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_kp_u__2); __pyx_v_output = __pyx_kp_u__2; - /* "w3lib/_url.pyx":1321 + /* "w3lib/_url.pyx":1370 * def _serialize_ipv4(address: int) -> str: * output = "" * n = address # <<<<<<<<<<<<<< @@ -20403,7 +20624,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_v_address); __pyx_v_n = __pyx_v_address; - /* "w3lib/_url.pyx":1322 + /* "w3lib/_url.pyx":1371 * output = "" * n = address * for i in range(1, 5): # <<<<<<<<<<<<<< @@ -20413,25 +20634,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject for (__pyx_t_1 = 1; __pyx_t_1 < 5; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "w3lib/_url.pyx":1323 + /* "w3lib/_url.pyx":1372 * n = address * for i in range(1, 5): * output = str(n % 256) + output # <<<<<<<<<<<<<< * if i != 4: * output = "." + output */ - __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1323, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1323, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1324 + /* "w3lib/_url.pyx":1373 * for i in range(1, 5): * output = str(n % 256) + output * if i != 4: # <<<<<<<<<<<<<< @@ -20441,19 +20662,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_4 = (__pyx_v_i != 4); if (__pyx_t_4) { - /* "w3lib/_url.pyx":1325 + /* "w3lib/_url.pyx":1374 * output = str(n % 256) + output * if i != 4: * output = "." + output # <<<<<<<<<<<<<< * n = floor(n / 256) * return output */ - __pyx_t_2 = PyNumber_Add(__pyx_kp_u__6, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1325, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_kp_u__6, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1324 + /* "w3lib/_url.pyx":1373 * for i in range(1, 5): * output = str(n % 256) + output * if i != 4: # <<<<<<<<<<<<<< @@ -20462,16 +20683,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1326 + /* "w3lib/_url.pyx":1375 * if i != 4: * output = "." + output * n = floor(n / 256) # <<<<<<<<<<<<<< * return output * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1326, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1326, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -20492,7 +20713,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -20500,7 +20721,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_2 = 0; } - /* "w3lib/_url.pyx":1327 + /* "w3lib/_url.pyx":1376 * output = "." + output * n = floor(n / 256) * return output # <<<<<<<<<<<<<< @@ -20508,12 +20729,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1327, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_INCREF(__pyx_v_output); __pyx_r = ((PyObject*)__pyx_v_output); goto __pyx_L0; - /* "w3lib/_url.pyx":1319 + /* "w3lib/_url.pyx":1368 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< @@ -20537,7 +20758,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":1330 +/* "w3lib/_url.pyx":1379 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< @@ -20545,7 +20766,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject * ) -> Optional[int]: */ -static PyObject *__pyx_pf_5w3lib_4_url_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_5w3lib_4_url_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -20555,16 +20776,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_52__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_length, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_min_length) < 0) __PYX_ERR(0, 1330, __pyx_L1_error) - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1330, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_length, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_min_length) < 0) __PYX_ERR(0, 1379, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 1330, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 1379, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -20583,15 +20804,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_52__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index = {"_get_ipv6_first_longest_0_piece_index", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index = {"_get_ipv6_first_longest_0_piece_index", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -20638,18 +20859,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1330, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1379, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1330, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1379, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_ipv6_first_longest_0_piece_index") < 0)) __PYX_ERR(0, 1330, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_ipv6_first_longest_0_piece_index") < 0)) __PYX_ERR(0, 1379, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -20661,7 +20882,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_ipv6_first_longest_0_piece_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1330, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_ipv6_first_longest_0_piece_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1379, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20675,9 +20896,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1331, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_min_length), (&PyInt_Type), 0, "min_length", 1))) __PYX_ERR(0, 1331, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(__pyx_self, __pyx_v_address, __pyx_v_min_length); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1380, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_min_length), (&PyInt_Type), 0, "min_length", 1))) __PYX_ERR(0, 1380, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(__pyx_self, __pyx_v_address, __pyx_v_min_length); /* function exit code */ goto __pyx_L0; @@ -20694,7 +20915,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length) { +static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length) { PyObject *__pyx_v_index = NULL; PyObject *__pyx_v_index_length = NULL; PyObject *__pyx_v_current_length = NULL; @@ -20714,7 +20935,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_ipv6_first_longest_0_piece_index", 1); - /* "w3lib/_url.pyx":1333 + /* "w3lib/_url.pyx":1382 * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: * index = None # <<<<<<<<<<<<<< @@ -20724,7 +20945,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(Py_None); __pyx_v_index = Py_None; - /* "w3lib/_url.pyx":1334 + /* "w3lib/_url.pyx":1383 * ) -> Optional[int]: * index = None * index_length = 0 # <<<<<<<<<<<<<< @@ -20734,7 +20955,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __pyx_v_index_length = __pyx_int_0; - /* "w3lib/_url.pyx":1335 + /* "w3lib/_url.pyx":1384 * index = None * index_length = 0 * current_length = 0 # <<<<<<<<<<<<<< @@ -20744,7 +20965,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __pyx_v_current_length = __pyx_int_0; - /* "w3lib/_url.pyx":1336 + /* "w3lib/_url.pyx":1385 * index_length = 0 * current_length = 0 * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< @@ -20759,37 +20980,37 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1336, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1385, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1336, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1385, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1336, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_piece, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_current_index, __pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1336, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1337 + /* "w3lib/_url.pyx":1386 * current_length = 0 * for current_index, piece in enumerate(address): * if piece != 0: # <<<<<<<<<<<<<< * current_length = 0 * continue */ - __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1337, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1386, __pyx_L1_error) if (__pyx_t_5) { - /* "w3lib/_url.pyx":1338 + /* "w3lib/_url.pyx":1387 * for current_index, piece in enumerate(address): * if piece != 0: * current_length = 0 # <<<<<<<<<<<<<< @@ -20799,7 +21020,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_int_0); - /* "w3lib/_url.pyx":1339 + /* "w3lib/_url.pyx":1388 * if piece != 0: * current_length = 0 * continue # <<<<<<<<<<<<<< @@ -20808,7 +21029,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":1337 + /* "w3lib/_url.pyx":1386 * current_length = 0 * for current_index, piece in enumerate(address): * if piece != 0: # <<<<<<<<<<<<<< @@ -20817,56 +21038,56 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C */ } - /* "w3lib/_url.pyx":1340 + /* "w3lib/_url.pyx":1389 * current_length = 0 * continue * current_length += 1 # <<<<<<<<<<<<<< * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1340, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1341 + /* "w3lib/_url.pyx":1390 * continue * current_length += 1 * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< * index = current_index + 1 - current_length * index_length = current_length */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_index_length, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1341, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1341, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_index_length, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L7_bool_binop_done; } - __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_min_length, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1341, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1341, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_min_length, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L7_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":1342 + /* "w3lib/_url.pyx":1391 * current_length += 1 * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length # <<<<<<<<<<<<<< * index_length = current_length * return index */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1342, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_v_current_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1342, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_v_current_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":1343 + /* "w3lib/_url.pyx":1392 * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length * index_length = current_length # <<<<<<<<<<<<<< @@ -20876,7 +21097,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_v_current_length); __Pyx_DECREF_SET(__pyx_v_index_length, __pyx_v_current_length); - /* "w3lib/_url.pyx":1341 + /* "w3lib/_url.pyx":1390 * continue * current_length += 1 * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< @@ -20885,7 +21106,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C */ } - /* "w3lib/_url.pyx":1336 + /* "w3lib/_url.pyx":1385 * index_length = 0 * current_length = 0 * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< @@ -20897,7 +21118,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1344 + /* "w3lib/_url.pyx":1393 * index = current_index + 1 - current_length * index_length = current_length * return index # <<<<<<<<<<<<<< @@ -20905,12 +21126,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_index))||((__pyx_v_index) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_index))) __PYX_ERR(0, 1344, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_index))||((__pyx_v_index) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_index))) __PYX_ERR(0, 1393, __pyx_L1_error) __Pyx_INCREF(__pyx_v_index); __pyx_r = ((PyObject*)__pyx_v_index); goto __pyx_L0; - /* "w3lib/_url.pyx":1330 + /* "w3lib/_url.pyx":1379 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< @@ -20937,7 +21158,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C return __pyx_r; } -/* "w3lib/_url.pyx":1348 +/* "w3lib/_url.pyx":1397 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< @@ -20946,15 +21167,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_43_serialize_ipv6(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_45_serialize_ipv6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_43_serialize_ipv6 = {"_serialize_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_43_serialize_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_43_serialize_ipv6(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_45_serialize_ipv6 = {"_serialize_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_45_serialize_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_45_serialize_ipv6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -20998,12 +21219,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1348, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1397, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv6") < 0)) __PYX_ERR(0, 1348, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv6") < 0)) __PYX_ERR(0, 1397, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -21014,7 +21235,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1348, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1397, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21028,8 +21249,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1348, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_42_serialize_ipv6(__pyx_self, __pyx_v_address); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1397, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_44_serialize_ipv6(__pyx_self, __pyx_v_address); /* function exit code */ goto __pyx_L0; @@ -21046,7 +21267,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { +static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { PyObject *__pyx_v_output = NULL; PyObject *__pyx_v_compress = NULL; int __pyx_v_ignore0; @@ -21066,7 +21287,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_ipv6", 1); - /* "w3lib/_url.pyx":1349 + /* "w3lib/_url.pyx":1398 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: * output = "" # <<<<<<<<<<<<<< @@ -21076,14 +21297,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_kp_u__2); __pyx_v_output = __pyx_kp_u__2; - /* "w3lib/_url.pyx":1350 + /* "w3lib/_url.pyx":1399 * def _serialize_ipv6(address: List[int]) -> str: * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) # <<<<<<<<<<<<<< * ignore0 = False * for piece_index in range(8): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_ipv6_first_longest_0_piece); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1350, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_ipv6_first_longest_0_piece); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -21103,14 +21324,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_address}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_compress = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1351 + /* "w3lib/_url.pyx":1400 * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) * ignore0 = False # <<<<<<<<<<<<<< @@ -21119,7 +21340,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 0; - /* "w3lib/_url.pyx":1352 + /* "w3lib/_url.pyx":1401 * compress = _get_ipv6_first_longest_0_piece_index(address) * ignore0 = False * for piece_index in range(8): # <<<<<<<<<<<<<< @@ -21129,7 +21350,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject for (__pyx_t_5 = 0; __pyx_t_5 < 8; __pyx_t_5+=1) { __pyx_v_piece_index = __pyx_t_5; - /* "w3lib/_url.pyx":1353 + /* "w3lib/_url.pyx":1402 * ignore0 = False * for piece_index in range(8): * if ignore0: # <<<<<<<<<<<<<< @@ -21138,21 +21359,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ if (__pyx_v_ignore0) { - /* "w3lib/_url.pyx":1354 + /* "w3lib/_url.pyx":1403 * for piece_index in range(8): * if ignore0: * if not address[piece_index]: # <<<<<<<<<<<<<< * continue * ignore0 = False */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1354, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "w3lib/_url.pyx":1355 + /* "w3lib/_url.pyx":1404 * if ignore0: * if not address[piece_index]: * continue # <<<<<<<<<<<<<< @@ -21161,7 +21382,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":1354 + /* "w3lib/_url.pyx":1403 * for piece_index in range(8): * if ignore0: * if not address[piece_index]: # <<<<<<<<<<<<<< @@ -21170,7 +21391,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1356 + /* "w3lib/_url.pyx":1405 * if not address[piece_index]: * continue * ignore0 = False # <<<<<<<<<<<<<< @@ -21179,7 +21400,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 0; - /* "w3lib/_url.pyx":1353 + /* "w3lib/_url.pyx":1402 * ignore0 = False * for piece_index in range(8): * if ignore0: # <<<<<<<<<<<<<< @@ -21188,22 +21409,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1357 + /* "w3lib/_url.pyx":1406 * continue * ignore0 = False * if compress == piece_index: # <<<<<<<<<<<<<< * separator = "::" if piece_index == 0 else ":" * output += separator */ - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_compress, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_compress, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1406, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1357, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1406, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_7) { - /* "w3lib/_url.pyx":1358 + /* "w3lib/_url.pyx":1407 * ignore0 = False * if compress == piece_index: * separator = "::" if piece_index == 0 else ":" # <<<<<<<<<<<<<< @@ -21221,19 +21442,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject __Pyx_XDECREF_SET(__pyx_v_separator, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1359 + /* "w3lib/_url.pyx":1408 * if compress == piece_index: * separator = "::" if piece_index == 0 else ":" * output += separator # <<<<<<<<<<<<<< * ignore0 = True * continue */ - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_output, __pyx_v_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1359, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_output, __pyx_v_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1360 + /* "w3lib/_url.pyx":1409 * separator = "::" if piece_index == 0 else ":" * output += separator * ignore0 = True # <<<<<<<<<<<<<< @@ -21242,7 +21463,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 1; - /* "w3lib/_url.pyx":1361 + /* "w3lib/_url.pyx":1410 * output += separator * ignore0 = True * continue # <<<<<<<<<<<<<< @@ -21251,7 +21472,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":1357 + /* "w3lib/_url.pyx":1406 * continue * ignore0 = False * if compress == piece_index: # <<<<<<<<<<<<<< @@ -21260,25 +21481,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1362 + /* "w3lib/_url.pyx":1411 * ignore0 = True * continue * output += f"{address[piece_index]:x}" # <<<<<<<<<<<<<< * if piece_index != 7: * output += ":" */ - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1362, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1362, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1363 + /* "w3lib/_url.pyx":1412 * continue * output += f"{address[piece_index]:x}" * if piece_index != 7: # <<<<<<<<<<<<<< @@ -21288,19 +21509,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_t_7 = (__pyx_v_piece_index != 7); if (__pyx_t_7) { - /* "w3lib/_url.pyx":1364 + /* "w3lib/_url.pyx":1413 * output += f"{address[piece_index]:x}" * if piece_index != 7: * output += ":" # <<<<<<<<<<<<<< * return output * */ - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1363 + /* "w3lib/_url.pyx":1412 * continue * output += f"{address[piece_index]:x}" * if piece_index != 7: # <<<<<<<<<<<<<< @@ -21311,7 +21532,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_L3_continue:; } - /* "w3lib/_url.pyx":1365 + /* "w3lib/_url.pyx":1414 * if piece_index != 7: * output += ":" * return output # <<<<<<<<<<<<<< @@ -21323,7 +21544,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "w3lib/_url.pyx":1348 + /* "w3lib/_url.pyx":1397 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< @@ -21347,7 +21568,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":1369 +/* "w3lib/_url.pyx":1418 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< @@ -21356,15 +21577,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_45_serialize_host(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_47_serialize_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_45_serialize_host = {"_serialize_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_45_serialize_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_45_serialize_host(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_47_serialize_host = {"_serialize_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_47_serialize_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_47_serialize_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -21408,12 +21629,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1369, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1418, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_host") < 0)) __PYX_ERR(0, 1369, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_host") < 0)) __PYX_ERR(0, 1418, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -21424,7 +21645,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1369, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1418, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21438,7 +21659,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_44_serialize_host(__pyx_self, __pyx_v_host); + __pyx_r = __pyx_pf_5w3lib_4_url_46_serialize_host(__pyx_self, __pyx_v_host); /* function exit code */ { @@ -21451,7 +21672,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host) { +static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -21467,7 +21688,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_host", 1); - /* "w3lib/_url.pyx":1370 + /* "w3lib/_url.pyx":1419 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(host: Union[str, int, List[int]]) -> str: * if isinstance(host, int): # <<<<<<<<<<<<<< @@ -21477,7 +21698,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject __pyx_t_1 = PyInt_Check(__pyx_v_host); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1371 + /* "w3lib/_url.pyx":1420 * def _serialize_host(host: Union[str, int, List[int]]) -> str: * if isinstance(host, int): * return _serialize_ipv4(host) # <<<<<<<<<<<<<< @@ -21485,7 +21706,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject * return f"[{_serialize_ipv6(host)}]" */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_serialize_ipv4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1371, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_serialize_ipv4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -21505,16 +21726,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_host}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1371, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 1371, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 1420, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1370 + /* "w3lib/_url.pyx":1419 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(host: Union[str, int, List[int]]) -> str: * if isinstance(host, int): # <<<<<<<<<<<<<< @@ -21523,7 +21744,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1372 + /* "w3lib/_url.pyx":1421 * if isinstance(host, int): * return _serialize_ipv4(host) * if isinstance(host, list): # <<<<<<<<<<<<<< @@ -21533,7 +21754,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject __pyx_t_1 = PyList_Check(__pyx_v_host); if (__pyx_t_1) { - /* "w3lib/_url.pyx":1373 + /* "w3lib/_url.pyx":1422 * return _serialize_ipv4(host) * if isinstance(host, list): * return f"[{_serialize_ipv6(host)}]" # <<<<<<<<<<<<<< @@ -21541,7 +21762,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1373, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = 127; @@ -21549,7 +21770,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject __pyx_t_6 += 1; __Pyx_GIVEREF(__pyx_kp_u__8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__8); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_serialize_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1373, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_serialize_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -21569,11 +21790,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_host}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1373, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1373, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7; @@ -21585,14 +21806,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject __pyx_t_6 += 1; __Pyx_GIVEREF(__pyx_kp_u__9); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__9); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1373, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1372 + /* "w3lib/_url.pyx":1421 * if isinstance(host, int): * return _serialize_ipv4(host) * if isinstance(host, list): # <<<<<<<<<<<<<< @@ -21601,7 +21822,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1374 + /* "w3lib/_url.pyx":1423 * if isinstance(host, list): * return f"[{_serialize_ipv6(host)}]" * return host # <<<<<<<<<<<<<< @@ -21609,12 +21830,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_host))||((__pyx_v_host) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_host))) __PYX_ERR(0, 1374, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_host))||((__pyx_v_host) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_host))) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_INCREF(__pyx_v_host); __pyx_r = ((PyObject*)__pyx_v_host); goto __pyx_L0; - /* "w3lib/_url.pyx":1369 + /* "w3lib/_url.pyx":1418 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< @@ -21636,7 +21857,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":1378 +/* "w3lib/_url.pyx":1427 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< @@ -21645,15 +21866,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_47_serialize_url_path(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_49_serialize_url_path(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_47_serialize_url_path = {"_serialize_url_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_47_serialize_url_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_47_serialize_url_path(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_49_serialize_url_path = {"_serialize_url_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_49_serialize_url_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_49_serialize_url_path(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -21699,18 +21920,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1378, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1378, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url_path") < 0)) __PYX_ERR(0, 1378, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url_path") < 0)) __PYX_ERR(0, 1427, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -21722,7 +21943,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_url_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1378, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_url_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1427, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21736,7 +21957,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_46_serialize_url_path(__pyx_self, __pyx_v_url, __pyx_v_canonicalize); + __pyx_r = __pyx_pf_5w3lib_4_url_48_serialize_url_path(__pyx_self, __pyx_v_url, __pyx_v_canonicalize); /* function exit code */ { @@ -21749,7 +21970,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_canonicalize) { +static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_canonicalize) { PyObject *__pyx_v_output = NULL; PyObject *__pyx_v_segment = NULL; PyObject *__pyx_r = NULL; @@ -21768,14 +21989,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_url_path", 1); - /* "w3lib/_url.pyx":1379 + /* "w3lib/_url.pyx":1428 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: * if url.has_opaque_path(): # <<<<<<<<<<<<<< * assert isinstance(url.path, str) * return url.path */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -21795,15 +22016,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1379, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "w3lib/_url.pyx":1380 + /* "w3lib/_url.pyx":1429 * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: * if url.has_opaque_path(): * assert isinstance(url.path, str) # <<<<<<<<<<<<<< @@ -21812,20 +22033,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyUnicode_Check(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1380, __pyx_L1_error) + __PYX_ERR(0, 1429, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 1380, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 1429, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":1381 + /* "w3lib/_url.pyx":1430 * if url.has_opaque_path(): * assert isinstance(url.path, str) * return url.path # <<<<<<<<<<<<<< @@ -21833,14 +22054,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj * return "" */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1381, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1381, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1430, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1379 + /* "w3lib/_url.pyx":1428 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: * if url.has_opaque_path(): # <<<<<<<<<<<<<< @@ -21849,16 +22070,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj */ } - /* "w3lib/_url.pyx":1382 + /* "w3lib/_url.pyx":1431 * assert isinstance(url.path, str) * return url.path * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: # <<<<<<<<<<<<<< * return "" * output = "" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1382, __pyx_L1_error) + __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1431, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (__pyx_t_6 <= 1); if (__pyx_t_7) { @@ -21866,22 +22087,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj __pyx_t_5 = __pyx_t_7; goto __pyx_L5_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1382, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1431, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { } else { __pyx_t_5 = __pyx_t_7; goto __pyx_L5_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1382, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1431, __pyx_L1_error) __pyx_t_8 = (!__pyx_t_7); __pyx_t_5 = __pyx_t_8; __pyx_L5_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":1383 + /* "w3lib/_url.pyx":1432 * return url.path * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: * return "" # <<<<<<<<<<<<<< @@ -21893,7 +22114,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj __pyx_r = __pyx_kp_u__2; goto __pyx_L0; - /* "w3lib/_url.pyx":1382 + /* "w3lib/_url.pyx":1431 * assert isinstance(url.path, str) * return url.path * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: # <<<<<<<<<<<<<< @@ -21902,7 +22123,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj */ } - /* "w3lib/_url.pyx":1384 + /* "w3lib/_url.pyx":1433 * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: * return "" * output = "" # <<<<<<<<<<<<<< @@ -21912,23 +22133,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj __Pyx_INCREF(__pyx_kp_u__2); __pyx_v_output = __pyx_kp_u__2; - /* "w3lib/_url.pyx":1385 + /* "w3lib/_url.pyx":1434 * return "" * output = "" * for segment in url.path: # <<<<<<<<<<<<<< * output += f"/{segment}" * return output */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1434, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -21937,28 +22158,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1385, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1434, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1434, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1385, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1434, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1434, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -21968,7 +22189,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1385, __pyx_L1_error) + else __PYX_ERR(0, 1434, __pyx_L1_error) } break; } @@ -21977,25 +22198,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj __Pyx_XDECREF_SET(__pyx_v_segment, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1386 + /* "w3lib/_url.pyx":1435 * output = "" * for segment in url.path: * output += f"/{segment}" # <<<<<<<<<<<<<< * return output * */ - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_segment, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_segment, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1385 + /* "w3lib/_url.pyx":1434 * return "" * output = "" * for segment in url.path: # <<<<<<<<<<<<<< @@ -22005,7 +22226,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1387 + /* "w3lib/_url.pyx":1436 * for segment in url.path: * output += f"/{segment}" * return output # <<<<<<<<<<<<<< @@ -22017,7 +22238,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "w3lib/_url.pyx":1378 + /* "w3lib/_url.pyx":1427 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< @@ -22040,7 +22261,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj return __pyx_r; } -/* "w3lib/_url.pyx":1391 +/* "w3lib/_url.pyx":1440 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url( # <<<<<<<<<<<<<< @@ -22049,16 +22270,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_49_serialize_url(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_51_serialize_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_48_serialize_url, "Return a string representation of *url* following the URL serialization\n algorithm defined in the `URL living standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer\n\n If *exclude_fragment* is ``True``, the returned URL does not include\n :attr:`_URL.fragment`.\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *canonicalize*:\n\n - ``None``: Do not deviate from the standard algorithm to apply or\n prevent URL canonicalization.\n\n - ``True``: Deviate from the standard as needed to make sure that\n functionally-equivalent URLs are always rendered the same way.\n\n This value has no effect at the moment, i.e. it applies the same\n level of canonicalization as the standard algorithm.\n\n - ``False``: Deviate from the standard as needed to make sure that\n the returned URL string is as close as possible to the original URL\n string that was parsed into *url*, as long as the returned URL\n string is still a valid URL.\n\n At the moment, this ensures that the password separator (:) is\n included into the returned URL string as long as it was present on\n the original URL string, even if :attr:`_URL.password` is an empty\n string.\n "); -static PyMethodDef __pyx_mdef_5w3lib_4_url_49_serialize_url = {"_serialize_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_49_serialize_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_48_serialize_url}; -static PyObject *__pyx_pw_5w3lib_4_url_49_serialize_url(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_50_serialize_url, "Return a string representation of *url* following the URL serialization\n algorithm defined in the `URL living standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer\n\n If *exclude_fragment* is ``True``, the returned URL does not include\n :attr:`_URL.fragment`.\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *canonicalize*:\n\n - ``None``: Do not deviate from the standard algorithm to apply or\n prevent URL canonicalization.\n\n - ``True``: Deviate from the standard as needed to make sure that\n functionally-equivalent URLs are always rendered the same way.\n\n This value has no effect at the moment, i.e. it applies the same\n level of canonicalization as the standard algorithm.\n\n - ``False``: Deviate from the standard as needed to make sure that\n the returned URL string is as close as possible to the original URL\n string that was parsed into *url*, as long as the returned URL\n string is still a valid URL.\n\n At the moment, this ensures that the password separator (:) is\n included into the returned URL string as long as it was present on\n the original URL string, even if :attr:`_URL.password` is an empty\n string.\n "); +static PyMethodDef __pyx_mdef_5w3lib_4_url_51_serialize_url = {"_serialize_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_51_serialize_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_50_serialize_url}; +static PyObject *__pyx_pw_5w3lib_4_url_51_serialize_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -22090,7 +22311,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,&__pyx_n_s_exclude_fragment,&__pyx_n_s_canonicalize,0}; - /* "w3lib/_url.pyx":1394 + /* "w3lib/_url.pyx":1443 * url: _URL, * *, * exclude_fragment: bool = False, # <<<<<<<<<<<<<< @@ -22099,7 +22320,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - /* "w3lib/_url.pyx":1395 + /* "w3lib/_url.pyx":1444 * *, * exclude_fragment: bool = False, * canonicalize: Optional[bool] = None, # <<<<<<<<<<<<<< @@ -22122,7 +22343,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1391, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1440, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args > 0 && likely(kw_args <= 2)) { @@ -22130,12 +22351,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds for (index = 1; index < 3 && kw_args > 0; index++) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1391, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1440, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url") < 0)) __PYX_ERR(0, 1391, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url") < 0)) __PYX_ERR(0, 1440, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -22148,7 +22369,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1391, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1440, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22162,9 +22383,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_48_serialize_url(__pyx_self, __pyx_v_url, __pyx_v_exclude_fragment, __pyx_v_canonicalize); + __pyx_r = __pyx_pf_5w3lib_4_url_50_serialize_url(__pyx_self, __pyx_v_url, __pyx_v_exclude_fragment, __pyx_v_canonicalize); - /* "w3lib/_url.pyx":1391 + /* "w3lib/_url.pyx":1440 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url( # <<<<<<<<<<<<<< @@ -22183,7 +22404,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_exclude_fragment, PyObject *__pyx_v_canonicalize) { +static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_exclude_fragment, PyObject *__pyx_v_canonicalize) { PyObject *__pyx_v_output = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -22201,120 +22422,120 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_url", 1); - /* "w3lib/_url.pyx":1429 + /* "w3lib/_url.pyx":1478 * string. * """ * output = url.scheme + ":" # <<<<<<<<<<<<<< * if url.hostname is not None: * output += "//" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_output = __pyx_t_2; __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1430 + /* "w3lib/_url.pyx":1479 * """ * output = url.scheme + ":" * if url.hostname is not None: # <<<<<<<<<<<<<< * output += "//" * if url.username or url.password: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1431 + /* "w3lib/_url.pyx":1480 * output = url.scheme + ":" * if url.hostname is not None: * output += "//" # <<<<<<<<<<<<<< * if url.username or url.password: * output += url.username */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1432 + /* "w3lib/_url.pyx":1481 * if url.hostname is not None: * output += "//" * if url.username or url.password: # <<<<<<<<<<<<<< * output += url.username * if url.password: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1433 + /* "w3lib/_url.pyx":1482 * output += "//" * if url.username or url.password: * output += url.username # <<<<<<<<<<<<<< * if url.password: * output += f":{url.password}" */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1434 + /* "w3lib/_url.pyx":1483 * if url.username or url.password: * output += url.username * if url.password: # <<<<<<<<<<<<<< * output += f":{url.password}" * elif not canonicalize and url._password_token_seen: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1434, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1483, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1435 + /* "w3lib/_url.pyx":1484 * output += url.username * if url.password: * output += f":{url.password}" # <<<<<<<<<<<<<< * elif not canonicalize and url._password_token_seen: * output += ":" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1434 + /* "w3lib/_url.pyx":1483 * if url.username or url.password: * output += url.username * if url.password: # <<<<<<<<<<<<<< @@ -22324,41 +22545,41 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L7; } - /* "w3lib/_url.pyx":1436 + /* "w3lib/_url.pyx":1485 * if url.password: * output += f":{url.password}" * elif not canonicalize and url._password_token_seen: # <<<<<<<<<<<<<< * output += ":" * output += "@" */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1436, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1485, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1436, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1485, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L8_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1437 + /* "w3lib/_url.pyx":1486 * output += f":{url.password}" * elif not canonicalize and url._password_token_seen: * output += ":" # <<<<<<<<<<<<<< * output += "@" * output += _serialize_host(url.hostname) */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1436 + /* "w3lib/_url.pyx":1485 * if url.password: * output += f":{url.password}" * elif not canonicalize and url._password_token_seen: # <<<<<<<<<<<<<< @@ -22368,19 +22589,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L7:; - /* "w3lib/_url.pyx":1438 + /* "w3lib/_url.pyx":1487 * elif not canonicalize and url._password_token_seen: * output += ":" * output += "@" # <<<<<<<<<<<<<< * output += _serialize_host(url.hostname) * if url.port is not None: */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1438, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1432 + /* "w3lib/_url.pyx":1481 * if url.hostname is not None: * output += "//" * if url.username or url.password: # <<<<<<<<<<<<<< @@ -22389,16 +22610,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * */ } - /* "w3lib/_url.pyx":1439 + /* "w3lib/_url.pyx":1488 * output += ":" * output += "@" * output += _serialize_host(url.hostname) # <<<<<<<<<<<<<< * if url.port is not None: * output += f":{url.port}" */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1439, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -22419,51 +22640,51 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1440 + /* "w3lib/_url.pyx":1489 * output += "@" * output += _serialize_host(url.hostname) * if url.port is not None: # <<<<<<<<<<<<<< * output += f":{url.port}" * elif not canonicalize: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1440, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_t_1 != Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1441 + /* "w3lib/_url.pyx":1490 * output += _serialize_host(url.hostname) * if url.port is not None: * output += f":{url.port}" # <<<<<<<<<<<<<< * elif not canonicalize: * if url._default_port_seen: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1441, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1441, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1440 + /* "w3lib/_url.pyx":1489 * output += "@" * output += _serialize_host(url.hostname) * if url.port is not None: # <<<<<<<<<<<<<< @@ -22473,58 +22694,58 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L10; } - /* "w3lib/_url.pyx":1442 + /* "w3lib/_url.pyx":1491 * if url.port is not None: * output += f":{url.port}" * elif not canonicalize: # <<<<<<<<<<<<<< * if url._default_port_seen: * output += f":{_DEFAULT_PORTS[url.scheme]}" */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1442, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1491, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_3); if (__pyx_t_5) { - /* "w3lib/_url.pyx":1443 + /* "w3lib/_url.pyx":1492 * output += f":{url.port}" * elif not canonicalize: * if url._default_port_seen: # <<<<<<<<<<<<<< * output += f":{_DEFAULT_PORTS[url.scheme]}" * elif url._port_token_seen: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1443, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1443, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "w3lib/_url.pyx":1444 + /* "w3lib/_url.pyx":1493 * elif not canonicalize: * if url._default_port_seen: * output += f":{_DEFAULT_PORTS[url.scheme]}" # <<<<<<<<<<<<<< * elif url._port_token_seen: * output += ":" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1444, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1444, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1443 + /* "w3lib/_url.pyx":1492 * output += f":{url.port}" * elif not canonicalize: * if url._default_port_seen: # <<<<<<<<<<<<<< @@ -22534,32 +22755,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L11; } - /* "w3lib/_url.pyx":1445 + /* "w3lib/_url.pyx":1494 * if url._default_port_seen: * output += f":{_DEFAULT_PORTS[url.scheme]}" * elif url._port_token_seen: # <<<<<<<<<<<<<< * output += ":" * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1445, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1445, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1494, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "w3lib/_url.pyx":1446 + /* "w3lib/_url.pyx":1495 * output += f":{_DEFAULT_PORTS[url.scheme]}" * elif url._port_token_seen: * output += ":" # <<<<<<<<<<<<<< * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: * output += "/." */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1446, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1445 + /* "w3lib/_url.pyx":1494 * if url._default_port_seen: * output += f":{_DEFAULT_PORTS[url.scheme]}" * elif url._port_token_seen: # <<<<<<<<<<<<<< @@ -22569,7 +22790,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L11:; - /* "w3lib/_url.pyx":1442 + /* "w3lib/_url.pyx":1491 * if url.port is not None: * output += f":{url.port}" * elif not canonicalize: # <<<<<<<<<<<<<< @@ -22579,7 +22800,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L10:; - /* "w3lib/_url.pyx":1430 + /* "w3lib/_url.pyx":1479 * """ * output = url.scheme + ":" * if url.hostname is not None: # <<<<<<<<<<<<<< @@ -22589,14 +22810,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L3; } - /* "w3lib/_url.pyx":1447 + /* "w3lib/_url.pyx":1496 * elif url._port_token_seen: * output += ":" * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< * output += "/." * output += _serialize_url_path(url, canonicalize=canonicalize) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1447, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = NULL; __pyx_t_8 = 0; @@ -22616,11 +22837,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1447, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (!__pyx_t_3); if (__pyx_t_4) { @@ -22628,9 +22849,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * __pyx_t_5 = __pyx_t_4; goto __pyx_L12_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1447, __pyx_L1_error) + __pyx_t_9 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__pyx_t_9 > 1); if (__pyx_t_4) { @@ -22638,31 +22859,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * __pyx_t_5 = __pyx_t_4; goto __pyx_L12_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1447, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1447, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = (!__pyx_t_4); __pyx_t_5 = __pyx_t_3; __pyx_L12_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":1448 + /* "w3lib/_url.pyx":1497 * output += ":" * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: * output += "/." # <<<<<<<<<<<<<< * output += _serialize_url_path(url, canonicalize=canonicalize) * if url.query is not None: */ - __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__23); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1448, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__23); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":1447 + /* "w3lib/_url.pyx":1496 * elif url._port_token_seen: * output += ":" * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< @@ -22672,69 +22893,69 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L3:; - /* "w3lib/_url.pyx":1449 + /* "w3lib/_url.pyx":1498 * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: * output += "/." * output += _serialize_url_path(url, canonicalize=canonicalize) # <<<<<<<<<<<<<< * if url.query is not None: * output += f"?{url.query}" */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_serialize_url_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1449, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_serialize_url_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_url); __Pyx_GIVEREF(__pyx_v_url); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_url)) __PYX_ERR(0, 1449, __pyx_L1_error); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_url)) __PYX_ERR(0, 1498, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_canonicalize, __pyx_v_canonicalize) < 0) __PYX_ERR(0, 1449, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1449, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_canonicalize, __pyx_v_canonicalize) < 0) __PYX_ERR(0, 1498, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1450 + /* "w3lib/_url.pyx":1499 * output += "/." * output += _serialize_url_path(url, canonicalize=canonicalize) * if url.query is not None: # <<<<<<<<<<<<<< * output += f"?{url.query}" * if not exclude_fragment and url.fragment is not None: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1450, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "w3lib/_url.pyx":1451 + /* "w3lib/_url.pyx":1500 * output += _serialize_url_path(url, canonicalize=canonicalize) * if url.query is not None: * output += f"?{url.query}" # <<<<<<<<<<<<<< * if not exclude_fragment and url.fragment is not None: * output += f"#{url.fragment}" */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1451, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1451, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__14, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1451, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__14, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1451, __pyx_L1_error) + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":1450 + /* "w3lib/_url.pyx":1499 * output += "/." * output += _serialize_url_path(url, canonicalize=canonicalize) * if url.query is not None: # <<<<<<<<<<<<<< @@ -22743,86 +22964,385 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * */ } - /* "w3lib/_url.pyx":1452 + /* "w3lib/_url.pyx":1501 + * if url.query is not None: + * output += f"?{url.query}" + * if not exclude_fragment and url.fragment is not None: # <<<<<<<<<<<<<< + * output += f"#{url.fragment}" + * return output + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_exclude_fragment); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1501, __pyx_L1_error) + __pyx_t_4 = (!__pyx_t_3); + if (__pyx_t_4) { + } else { + __pyx_t_5 = __pyx_t_4; + goto __pyx_L17_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = (__pyx_t_7 != Py_None); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __pyx_t_4; + __pyx_L17_bool_binop_done:; + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":1502 + * output += f"?{url.query}" + * if not exclude_fragment and url.fragment is not None: + * output += f"#{url.fragment}" # <<<<<<<<<<<<<< + * return output + * + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__12, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1501 * if url.query is not None: * output += f"?{url.query}" * if not exclude_fragment and url.fragment is not None: # <<<<<<<<<<<<<< * output += f"#{url.fragment}" * return output */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_exclude_fragment); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1452, __pyx_L1_error) - __pyx_t_4 = (!__pyx_t_3); - if (__pyx_t_4) { - } else { - __pyx_t_5 = __pyx_t_4; - goto __pyx_L17_bool_binop_done; - } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = (__pyx_t_7 != Py_None); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __pyx_t_4; - __pyx_L17_bool_binop_done:; - if (__pyx_t_5) { + } + + /* "w3lib/_url.pyx":1503 + * if not exclude_fragment and url.fragment is not None: + * output += f"#{url.fragment}" + * return output # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1503, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_output); + __pyx_r = ((PyObject*)__pyx_v_output); + goto __pyx_L0; + + /* "w3lib/_url.pyx":1440 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing + * def _serialize_url( # <<<<<<<<<<<<<< + * url: _URL, + * *, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._serialize_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":1506 + * + * + * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< + * url = _parse_url( + * input, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_53_safe_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_53_safe_url = {"_safe_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_53_safe_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_53_safe_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_encoding = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_safe_url (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_encoding,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1506, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1506, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_safe_url", 1, 2, 2, 1); __PYX_ERR(0, 1506, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_safe_url") < 0)) __PYX_ERR(0, 1506, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_encoding = ((PyObject*)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_safe_url", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1506, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._safe_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 1506, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 1506, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_52_safe_url(__pyx_self, __pyx_v_input, __pyx_v_encoding); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_52_safe_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding) { + PyObject *__pyx_v_url = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_safe_url", 1); + + /* "w3lib/_url.pyx":1507 + * + * def _safe_url(input: str, encoding: str) -> str: + * url = _parse_url( # <<<<<<<<<<<<<< + * input, + * encoding=encoding, + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "w3lib/_url.pyx":1508 + * def _safe_url(input: str, encoding: str) -> str: + * url = _parse_url( + * input, # <<<<<<<<<<<<<< + * encoding=encoding, + * userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_input); + __Pyx_GIVEREF(__pyx_v_input); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input)) __PYX_ERR(0, 1507, __pyx_L1_error); + + /* "w3lib/_url.pyx":1509 + * url = _parse_url( + * input, + * encoding=encoding, # <<<<<<<<<<<<<< + * userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, + * path_percent_encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) + + /* "w3lib/_url.pyx":1510 + * input, + * encoding=encoding, + * userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * path_percent_encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, + * query_percent_encode_set=_SAFE_QUERY_PERCENT_ENCODE_SET, + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_userinfo_percent_encode_set, __pyx_t_4) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":1511 + * encoding=encoding, + * userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, + * path_percent_encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * query_percent_encode_set=_SAFE_QUERY_PERCENT_ENCODE_SET, + * special_query_percent_encode_set=_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET, + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_path_percent_encode_set, __pyx_t_4) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":1512 + * userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, + * path_percent_encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, + * query_percent_encode_set=_SAFE_QUERY_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * special_query_percent_encode_set=_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET, + * fragment_percent_encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET, + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_query_percent_encode_set, __pyx_t_4) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":1513 + * path_percent_encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, + * query_percent_encode_set=_SAFE_QUERY_PERCENT_ENCODE_SET, + * special_query_percent_encode_set=_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * fragment_percent_encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET, + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_special_query_percent_encode_set, __pyx_t_4) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1453 - * output += f"?{url.query}" - * if not exclude_fragment and url.fragment is not None: - * output += f"#{url.fragment}" # <<<<<<<<<<<<<< - * return output + /* "w3lib/_url.pyx":1514 + * query_percent_encode_set=_SAFE_QUERY_PERCENT_ENCODE_SET, + * special_query_percent_encode_set=_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET, + * fragment_percent_encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * ) + * return _serialize_url(url, canonicalize=False) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1453, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__12, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1453, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fragment_percent_encode_set, __pyx_t_4) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1452 - * if url.query is not None: - * output += f"?{url.query}" - * if not exclude_fragment and url.fragment is not None: # <<<<<<<<<<<<<< - * output += f"#{url.fragment}" - * return output + /* "w3lib/_url.pyx":1507 + * + * def _safe_url(input: str, encoding: str) -> str: + * url = _parse_url( # <<<<<<<<<<<<<< + * input, + * encoding=encoding, */ - } + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_url = __pyx_t_4; + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1454 - * if not exclude_fragment and url.fragment is not None: - * output += f"#{url.fragment}" - * return output # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1516 + * fragment_percent_encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET, + * ) + * return _serialize_url(url, canonicalize=False) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1454, __pyx_L1_error) - __Pyx_INCREF(__pyx_v_output); - __pyx_r = ((PyObject*)__pyx_v_output); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_serialize_url); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_url); + __Pyx_GIVEREF(__pyx_v_url); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_url)) __PYX_ERR(0, 1516, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_canonicalize, Py_False) < 0) __PYX_ERR(0, 1516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1516, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1391 + /* "w3lib/_url.pyx":1506 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing - * def _serialize_url( # <<<<<<<<<<<<<< - * url: _URL, - * *, + * + * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< + * url = _parse_url( + * input, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("w3lib._url._serialize_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._url._safe_url", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_output); + __Pyx_XDECREF(__pyx_v_url); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -23205,11 +23725,12 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Dict, __pyx_k_Dict, sizeof(__pyx_k_Dict), 0, 0, 1, 1}, {&__pyx_kp_s_Dict_str_str, __pyx_k_Dict_str_str, sizeof(__pyx_k_Dict_str_str), 0, 0, 1, 0}, {&__pyx_kp_u_Domain_name, __pyx_k_Domain_name, sizeof(__pyx_k_Domain_name), 0, 1, 0, 0}, + {&__pyx_n_s_EXTRA_SAFE_CHARS, __pyx_k_EXTRA_SAFE_CHARS, sizeof(__pyx_k_EXTRA_SAFE_CHARS), 0, 0, 1, 1}, {&__pyx_n_s_EncodeFunction, __pyx_k_EncodeFunction, sizeof(__pyx_k_EncodeFunction), 0, 0, 1, 1}, {&__pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_k_FORBIDDEN_DOMAIN_CODE_POINTS, sizeof(__pyx_k_FORBIDDEN_DOMAIN_CODE_POINTS), 0, 0, 1, 1}, {&__pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_k_FORBIDDEN_HOST_CODE_POINTS, sizeof(__pyx_k_FORBIDDEN_HOST_CODE_POINTS), 0, 0, 1, 1}, {&__pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_k_FRAGMENT_PERCENT_ENCODE_SET, sizeof(__pyx_k_FRAGMENT_PERCENT_ENCODE_SET), 0, 0, 1, 1}, - {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_n_s_FRAGMENT_SAFEST_CHARS, __pyx_k_FRAGMENT_SAFEST_CHARS, sizeof(__pyx_k_FRAGMENT_SAFEST_CHARS), 0, 0, 1, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_n_s_LABEL_ENCODINGS, __pyx_k_LABEL_ENCODINGS, sizeof(__pyx_k_LABEL_ENCODINGS), 0, 0, 1, 1}, {&__pyx_n_s_List, __pyx_k_List, sizeof(__pyx_k_List), 0, 0, 1, 1}, @@ -23221,11 +23742,32 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_s_Optional_int, __pyx_k_Optional_int, sizeof(__pyx_k_Optional_int), 0, 0, 1, 0}, {&__pyx_kp_s_Optional_str, __pyx_k_Optional_str, sizeof(__pyx_k_Optional_str), 0, 0, 1, 0}, {&__pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_k_PATH_PERCENT_ENCODE_SET, sizeof(__pyx_k_PATH_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_PATH_SAFEST_CHARS, __pyx_k_PATH_SAFEST_CHARS, sizeof(__pyx_k_PATH_SAFEST_CHARS), 0, 0, 1, 1}, {&__pyx_n_s_PercentEncodeSet, __pyx_k_PercentEncodeSet, sizeof(__pyx_k_PercentEncodeSet), 0, 0, 1, 1}, {&__pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_k_QUERY_PERCENT_ENCODE_SET, sizeof(__pyx_k_QUERY_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_QUERY_SAFEST_CHARS, __pyx_k_QUERY_SAFEST_CHARS, sizeof(__pyx_k_QUERY_SAFEST_CHARS), 0, 0, 1, 1}, {&__pyx_n_s_REPLACEMENT_ENCODING, __pyx_k_REPLACEMENT_ENCODING, sizeof(__pyx_k_REPLACEMENT_ENCODING), 0, 0, 1, 1}, + {&__pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE, __pyx_k_RFC2396_ABS_PATH_PERCENT_ENCODE, sizeof(__pyx_k_RFC2396_ABS_PATH_PERCENT_ENCODE), 0, 0, 1, 1}, + {&__pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE, __pyx_k_RFC2396_FRAGMENT_PERCENT_ENCODE, sizeof(__pyx_k_RFC2396_FRAGMENT_PERCENT_ENCODE), 0, 0, 1, 1}, + {&__pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE, __pyx_k_RFC2396_QUERY_PERCENT_ENCODE_SE, sizeof(__pyx_k_RFC2396_QUERY_PERCENT_ENCODE_SE), 0, 0, 1, 1}, + {&__pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE, __pyx_k_RFC2396_USERINFO_PERCENT_ENCODE, sizeof(__pyx_k_RFC2396_USERINFO_PERCENT_ENCODE), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE, __pyx_k_RFC3986_FRAGMENT_PERCENT_ENCODE, sizeof(__pyx_k_RFC3986_FRAGMENT_PERCENT_ENCODE), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_GEN_DELIMS, __pyx_k_RFC3986_GEN_DELIMS, sizeof(__pyx_k_RFC3986_GEN_DELIMS), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET, __pyx_k_RFC3986_PATH_PERCENT_ENCODE_SET, sizeof(__pyx_k_RFC3986_PATH_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE, __pyx_k_RFC3986_QUERY_PERCENT_ENCODE_SE, sizeof(__pyx_k_RFC3986_QUERY_PERCENT_ENCODE_SE), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_RESERVED, __pyx_k_RFC3986_RESERVED, sizeof(__pyx_k_RFC3986_RESERVED), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_SUB_DELIMS, __pyx_k_RFC3986_SUB_DELIMS, sizeof(__pyx_k_RFC3986_SUB_DELIMS), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_UNRESERVED, __pyx_k_RFC3986_UNRESERVED, sizeof(__pyx_k_RFC3986_UNRESERVED), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE, __pyx_k_RFC3986_USERINFO_PERCENT_ENCODE, sizeof(__pyx_k_RFC3986_USERINFO_PERCENT_ENCODE), 0, 0, 1, 1}, + {&__pyx_n_s_RFC3986_USERINFO_SAFE_CHARS, __pyx_k_RFC3986_USERINFO_SAFE_CHARS, sizeof(__pyx_k_RFC3986_USERINFO_SAFE_CHARS), 0, 0, 1, 1}, + {&__pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE, __pyx_k_SAFE_FRAGMENT_PERCENT_ENCODE_SE, sizeof(__pyx_k_SAFE_FRAGMENT_PERCENT_ENCODE_SE), 0, 0, 1, 1}, + {&__pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET, __pyx_k_SAFE_PATH_PERCENT_ENCODE_SET, sizeof(__pyx_k_SAFE_PATH_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET, __pyx_k_SAFE_QUERY_PERCENT_ENCODE_SET, sizeof(__pyx_k_SAFE_QUERY_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO, __pyx_k_SAFE_SPECIAL_QUERY_PERCENT_ENCO, sizeof(__pyx_k_SAFE_SPECIAL_QUERY_PERCENT_ENCO), 0, 0, 1, 1}, + {&__pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE, __pyx_k_SAFE_USERINFO_PERCENT_ENCODE_SE, sizeof(__pyx_k_SAFE_USERINFO_PERCENT_ENCODE_SE), 0, 0, 1, 1}, {&__pyx_n_s_SCHEME_CHARS, __pyx_k_SCHEME_CHARS, sizeof(__pyx_k_SCHEME_CHARS), 0, 0, 1, 1}, {&__pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_k_SPECIAL_QUERY_PERCENT_ENCODE_SE, sizeof(__pyx_k_SPECIAL_QUERY_PERCENT_ENCODE_SE), 0, 0, 1, 1}, + {&__pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS, __pyx_k_SPECIAL_QUERY_SAFEST_CHARS, sizeof(__pyx_k_SPECIAL_QUERY_SAFEST_CHARS), 0, 0, 1, 1}, {&__pyx_n_s_SPECIAL_SCHEMES, __pyx_k_SPECIAL_SCHEMES, sizeof(__pyx_k_SPECIAL_SCHEMES), 0, 0, 1, 1}, {&__pyx_n_s_Tuple, __pyx_k_Tuple, sizeof(__pyx_k_Tuple), 0, 0, 1, 1}, {&__pyx_kp_s_Tuple_int_bool, __pyx_k_Tuple_int_bool, sizeof(__pyx_k_Tuple_int_bool), 0, 0, 1, 0}, @@ -23234,6 +23776,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_URL_has_opaque_path, __pyx_k_URL_has_opaque_path, sizeof(__pyx_k_URL_has_opaque_path), 0, 0, 1, 1}, {&__pyx_n_s_URL_scheme, __pyx_k_URL_scheme, sizeof(__pyx_k_URL_scheme), 0, 0, 1, 1}, {&__pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_k_USERINFO_PERCENT_ENCODE_SET, sizeof(__pyx_k_USERINFO_PERCENT_ENCODE_SET), 0, 0, 1, 1}, + {&__pyx_n_s_USERINFO_SAFEST_CHARS, __pyx_k_USERINFO_SAFEST_CHARS, sizeof(__pyx_k_USERINFO_SAFEST_CHARS), 0, 0, 1, 1}, {&__pyx_n_s_UTF_16BE_ENCODING, __pyx_k_UTF_16BE_ENCODING, sizeof(__pyx_k_UTF_16BE_ENCODING), 0, 0, 1, 1}, {&__pyx_n_s_UTF_16LE_ENCODING, __pyx_k_UTF_16LE_ENCODING, sizeof(__pyx_k_UTF_16LE_ENCODING), 0, 0, 1, 1}, {&__pyx_n_s_UTF_8_ENCODER, __pyx_k_UTF_8_ENCODER, sizeof(__pyx_k_UTF_8_ENCODER), 0, 0, 1, 1}, @@ -23245,6 +23788,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0}, {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, + {&__pyx_kp_b__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 0, 0}, {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0}, {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0}, {&__pyx_n_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 1}, @@ -23255,13 +23799,16 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_u__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0}, {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0}, {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, + {&__pyx_kp_b__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 0, 0}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0}, {&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0}, {&__pyx_kp_u__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0, 0}, {&__pyx_n_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 1}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, + {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0}, {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, + {&__pyx_kp_b__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 0, 0}, {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, {&__pyx_kp_u__75, __pyx_k__75, sizeof(__pyx_k__75), 0, 1, 0, 0}, @@ -23270,12 +23817,19 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_u__81, __pyx_k__81, sizeof(__pyx_k__81), 0, 1, 0, 0}, {&__pyx_kp_u__82, __pyx_k__82, sizeof(__pyx_k__82), 0, 1, 0, 0}, {&__pyx_kp_u__83, __pyx_k__83, sizeof(__pyx_k__83), 0, 1, 0, 0}, + {&__pyx_kp_b__84, __pyx_k__84, sizeof(__pyx_k__84), 0, 0, 0, 0}, {&__pyx_kp_u__84, __pyx_k__84, sizeof(__pyx_k__84), 0, 1, 0, 0}, {&__pyx_kp_u__85, __pyx_k__85, sizeof(__pyx_k__85), 0, 1, 0, 0}, {&__pyx_kp_u__86, __pyx_k__86, sizeof(__pyx_k__86), 0, 1, 0, 0}, - {&__pyx_kp_u__87, __pyx_k__87, sizeof(__pyx_k__87), 0, 1, 0, 0}, - {&__pyx_kp_u__88, __pyx_k__88, sizeof(__pyx_k__88), 0, 1, 0, 0}, + {&__pyx_kp_b__87, __pyx_k__87, sizeof(__pyx_k__87), 0, 0, 0, 0}, + {&__pyx_kp_b__88, __pyx_k__88, sizeof(__pyx_k__88), 0, 0, 0, 0}, + {&__pyx_kp_u__89, __pyx_k__89, sizeof(__pyx_k__89), 0, 1, 0, 0}, {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, + {&__pyx_kp_b__91, __pyx_k__91, sizeof(__pyx_k__91), 0, 0, 0, 0}, + {&__pyx_kp_b__94, __pyx_k__94, sizeof(__pyx_k__94), 0, 0, 0, 0}, + {&__pyx_kp_b__95, __pyx_k__95, sizeof(__pyx_k__95), 0, 0, 0, 0}, + {&__pyx_kp_u__96, __pyx_k__96, sizeof(__pyx_k__96), 0, 1, 0, 0}, + {&__pyx_kp_u__97, __pyx_k__97, sizeof(__pyx_k__97), 0, 1, 0, 0}, {&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1}, {&__pyx_n_s_annotations, __pyx_k_annotations, sizeof(__pyx_k_annotations), 0, 0, 1, 1}, {&__pyx_kp_u_ansi_x3_4_1968, __pyx_k_ansi_x3_4_1968, sizeof(__pyx_k_ansi_x3_4_1968), 0, 1, 0, 0}, @@ -23284,6 +23838,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1}, {&__pyx_n_s_ascii_domain, __pyx_k_ascii_domain, sizeof(__pyx_k_ascii_domain), 0, 0, 1, 1}, + {&__pyx_n_s_ascii_letters, __pyx_k_ascii_letters, sizeof(__pyx_k_ascii_letters), 0, 0, 1, 1}, {&__pyx_kp_u_asmo_708, __pyx_k_asmo_708, sizeof(__pyx_k_asmo_708), 0, 1, 0, 0}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_at_sign_index, __pyx_k_at_sign_index, sizeof(__pyx_k_at_sign_index), 0, 0, 1, 1}, @@ -23350,7 +23905,9 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_current_length, __pyx_k_current_length, sizeof(__pyx_k_current_length), 0, 0, 1, 1}, {&__pyx_n_u_cyrillic, __pyx_k_cyrillic, sizeof(__pyx_k_cyrillic), 0, 1, 0, 1}, {&__pyx_n_s_default_port_seen, __pyx_k_default_port_seen, sizeof(__pyx_k_default_port_seen), 0, 0, 1, 1}, + {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_digits, __pyx_k_digits, sizeof(__pyx_k_digits), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_kp_u_does_not_match_any_encoding_lab, __pyx_k_does_not_match_any_encoding_lab, sizeof(__pyx_k_does_not_match_any_encoding_lab), 0, 1, 0, 0}, @@ -23414,7 +23971,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_input, __pyx_k_input, sizeof(__pyx_k_input), 0, 0, 1, 1}, - {&__pyx_n_s_input_lenght, __pyx_k_input_lenght, sizeof(__pyx_k_input_lenght), 0, 0, 1, 1}, {&__pyx_n_s_input_length, __pyx_k_input_length, sizeof(__pyx_k_input_length), 0, 0, 1, 1}, {&__pyx_n_s_inside_brackets, __pyx_k_inside_brackets, sizeof(__pyx_k_inside_brackets), 0, 0, 1, 1}, {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, @@ -23575,6 +24131,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_password_token_seen, __pyx_k_password_token_seen, sizeof(__pyx_k_password_token_seen), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_path_percent_encode_set, __pyx_k_path_percent_encode_set, sizeof(__pyx_k_path_percent_encode_set), 0, 0, 1, 1}, + {&__pyx_n_s_path_safe_chars, __pyx_k_path_safe_chars, sizeof(__pyx_k_path_safe_chars), 0, 0, 1, 1}, {&__pyx_n_s_path_token_seen, __pyx_k_path_token_seen, sizeof(__pyx_k_path_token_seen), 0, 0, 1, 1}, {&__pyx_n_s_percent_encode_after_encoding, __pyx_k_percent_encode_after_encoding, sizeof(__pyx_k_percent_encode_after_encoding), 0, 0, 1, 1}, {&__pyx_n_s_percent_encode_set, __pyx_k_percent_encode_set, sizeof(__pyx_k_percent_encode_set), 0, 0, 1, 1}, @@ -23584,15 +24141,22 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1}, {&__pyx_n_s_port_token_seen, __pyx_k_port_token_seen, sizeof(__pyx_k_port_token_seen), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_preprocess_url, __pyx_k_preprocess_url, sizeof(__pyx_k_preprocess_url), 0, 0, 1, 1}, {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1}, {&__pyx_n_s_query_percent_encode_set, __pyx_k_query_percent_encode_set, sizeof(__pyx_k_query_percent_encode_set), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_reached_end, __pyx_k_reached_end, sizeof(__pyx_k_reached_end), 0, 0, 1, 1}, + {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, {&__pyx_n_u_replacement, __pyx_k_replacement, sizeof(__pyx_k_replacement), 0, 1, 0, 1}, {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, + {&__pyx_n_s_rfc2396, __pyx_k_rfc2396, sizeof(__pyx_k_rfc2396), 0, 0, 1, 1}, + {&__pyx_n_s_rfc3986, __pyx_k_rfc3986, sizeof(__pyx_k_rfc3986), 0, 0, 1, 1}, + {&__pyx_n_s_safe_chars, __pyx_k_safe_chars, sizeof(__pyx_k_safe_chars), 0, 0, 1, 1}, + {&__pyx_n_s_safe_url, __pyx_k_safe_url, sizeof(__pyx_k_safe_url), 0, 0, 1, 1}, {&__pyx_n_s_scheme, __pyx_k_scheme, sizeof(__pyx_k_scheme), 0, 0, 1, 1}, {&__pyx_n_s_scheme_2, __pyx_k_scheme_2, sizeof(__pyx_k_scheme_2), 0, 0, 1, 1}, {&__pyx_n_s_segment, __pyx_k_segment, sizeof(__pyx_k_segment), 0, 0, 1, 1}, @@ -23618,6 +24182,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_starts_with_windows_drive_lette, __pyx_k_starts_with_windows_drive_lette, sizeof(__pyx_k_starts_with_windows_drive_lette), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1}, {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, {&__pyx_n_u_sun_eu_greek, __pyx_k_sun_eu_greek, sizeof(__pyx_k_sun_eu_greek), 0, 1, 0, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, @@ -23685,14 +24250,13 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 550, __pyx_L1_error) - __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 448, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 449, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 585, __pyx_L1_error) - __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 590, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 679, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 942, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1076, __pyx_L1_error) + __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 461, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1138, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -23703,792 +24267,849 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "w3lib/_url.pyx":568 + /* "w3lib/_url.pyx":580 * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): * return * url.path = path[:-1] # <<<<<<<<<<<<<< * * */ - __pyx_slice_ = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_slice_ = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); - /* "w3lib/_url.pyx":745 + /* "w3lib/_url.pyx":810 * r = 8 * if not input: * return (0, True) # <<<<<<<<<<<<<< * return (int(input, base=r), validation_error) * */ - __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, Py_True); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, Py_True); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "w3lib/_url.pyx":1237 + /* "w3lib/_url.pyx":1291 * and _is_windows_drive_letter(buffer) * ): * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< * if ( * not url.path */ - __pyx_slice__20 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_slice__20 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__20); __Pyx_GIVEREF(__pyx_slice__20); - /* "w3lib/_url.pyx":32 + /* "w3lib/_url.pyx":44 * * * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< * return { * label: f"windows-125{last_digit}" */ - __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_last_digit, __pyx_n_s_label); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_last_digit, __pyx_n_s_label); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_short_windows_125, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_short_windows_125, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 44, __pyx_L1_error) - /* "w3lib/_url.pyx":56 + /* "w3lib/_url.pyx":68 * label: _UTF_8_ENCODING * for label in ( * "unicode-1-1-utf-8", # <<<<<<<<<<<<<< * "unicode11utf8", * "unicode20utf8", */ - __pyx_tuple__27 = PyTuple_Pack(6, __pyx_kp_u_unicode_1_1_utf_8, __pyx_n_u_unicode11utf8, __pyx_n_u_unicode20utf8, __pyx_kp_u_utf_8, __pyx_n_u_utf8, __pyx_kp_u_x_unicode20utf8); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_tuple__27 = PyTuple_Pack(6, __pyx_kp_u_unicode_1_1_utf_8, __pyx_n_u_unicode11utf8, __pyx_n_u_unicode20utf8, __pyx_kp_u_utf_8, __pyx_n_u_utf8, __pyx_kp_u_x_unicode20utf8); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); - /* "w3lib/_url.pyx":67 + /* "w3lib/_url.pyx":79 * label: "ibm866" * for label in ( * "866", # <<<<<<<<<<<<<< * "cp866", * "csibm866", */ - __pyx_tuple__28 = PyTuple_Pack(4, __pyx_kp_u_866, __pyx_n_u_cp866, __pyx_n_u_csibm866, __pyx_n_u_ibm866); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_tuple__28 = PyTuple_Pack(4, __pyx_kp_u_866, __pyx_n_u_cp866, __pyx_n_u_csibm866, __pyx_n_u_ibm866); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); - /* "w3lib/_url.pyx":76 + /* "w3lib/_url.pyx":88 * label: "iso-8859-2" * for label in ( * "csisolatin2", # <<<<<<<<<<<<<< * "iso-8859-2", * "iso-ir-101", */ - __pyx_tuple__29 = PyTuple_Pack(9, __pyx_n_u_csisolatin2, __pyx_kp_u_iso_8859_2, __pyx_kp_u_iso_ir_101, __pyx_kp_u_iso8859_2, __pyx_n_u_iso88592, __pyx_kp_u_iso_8859_2_2, __pyx_kp_u_iso_8859_2_1987, __pyx_n_u_l2, __pyx_n_u_latin2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_tuple__29 = PyTuple_Pack(9, __pyx_n_u_csisolatin2, __pyx_kp_u_iso_8859_2, __pyx_kp_u_iso_ir_101, __pyx_kp_u_iso8859_2, __pyx_n_u_iso88592, __pyx_kp_u_iso_8859_2_2, __pyx_kp_u_iso_8859_2_1987, __pyx_n_u_l2, __pyx_n_u_latin2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); - /* "w3lib/_url.pyx":90 + /* "w3lib/_url.pyx":102 * label: "iso-8859-3" * for label in ( * "csisolatin3", # <<<<<<<<<<<<<< * "iso-8859-3", * "iso-ir-109", */ - __pyx_tuple__30 = PyTuple_Pack(9, __pyx_n_u_csisolatin3, __pyx_kp_u_iso_8859_3, __pyx_kp_u_iso_ir_109, __pyx_kp_u_iso8859_3, __pyx_n_u_iso88593, __pyx_kp_u_iso_8859_3_2, __pyx_kp_u_iso_8859_3_1988, __pyx_n_u_l3, __pyx_n_u_latin3); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_tuple__30 = PyTuple_Pack(9, __pyx_n_u_csisolatin3, __pyx_kp_u_iso_8859_3, __pyx_kp_u_iso_ir_109, __pyx_kp_u_iso8859_3, __pyx_n_u_iso88593, __pyx_kp_u_iso_8859_3_2, __pyx_kp_u_iso_8859_3_1988, __pyx_n_u_l3, __pyx_n_u_latin3); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); - /* "w3lib/_url.pyx":104 + /* "w3lib/_url.pyx":116 * label: "iso-8859-4" * for label in ( * "csisolatin4", # <<<<<<<<<<<<<< * "iso-8859-4", * "iso-ir-110", */ - __pyx_tuple__31 = PyTuple_Pack(9, __pyx_n_u_csisolatin4, __pyx_kp_u_iso_8859_4, __pyx_kp_u_iso_ir_110, __pyx_kp_u_iso8859_4, __pyx_n_u_iso88594, __pyx_kp_u_iso_8859_4_2, __pyx_kp_u_iso_8859_4_1988, __pyx_n_u_l4, __pyx_n_u_latin4); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_tuple__31 = PyTuple_Pack(9, __pyx_n_u_csisolatin4, __pyx_kp_u_iso_8859_4, __pyx_kp_u_iso_ir_110, __pyx_kp_u_iso8859_4, __pyx_n_u_iso88594, __pyx_kp_u_iso_8859_4_2, __pyx_kp_u_iso_8859_4_1988, __pyx_n_u_l4, __pyx_n_u_latin4); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); - /* "w3lib/_url.pyx":118 + /* "w3lib/_url.pyx":130 * label: "iso-8859-5" * for label in ( * "csisolatincyrillic", # <<<<<<<<<<<<<< * "cyrillic", * "iso-8859-5", */ - __pyx_tuple__32 = PyTuple_Pack(8, __pyx_n_u_csisolatincyrillic, __pyx_n_u_cyrillic, __pyx_kp_u_iso_8859_5, __pyx_kp_u_iso_ir_144, __pyx_kp_u_iso8859_5, __pyx_n_u_iso88595, __pyx_kp_u_iso_8859_5_2, __pyx_kp_u_iso_8859_5_1988); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_tuple__32 = PyTuple_Pack(8, __pyx_n_u_csisolatincyrillic, __pyx_n_u_cyrillic, __pyx_kp_u_iso_8859_5, __pyx_kp_u_iso_ir_144, __pyx_kp_u_iso8859_5, __pyx_n_u_iso88595, __pyx_kp_u_iso_8859_5_2, __pyx_kp_u_iso_8859_5_1988); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); - /* "w3lib/_url.pyx":131 + /* "w3lib/_url.pyx":143 * label: "iso-8859-6" * for label in ( * "arabic", # <<<<<<<<<<<<<< * "asmo-708", * "csiso88596e", */ - __pyx_tuple__33 = PyTuple_Pack(14, __pyx_n_u_arabic, __pyx_kp_u_asmo_708, __pyx_n_u_csiso88596e, __pyx_n_u_csiso88596i, __pyx_n_u_csisolatinarabic, __pyx_kp_u_ecma_114, __pyx_kp_u_iso_8859_6, __pyx_kp_u_iso_8859_6_e, __pyx_kp_u_iso_8859_6_i, __pyx_kp_u_iso_ir_127, __pyx_kp_u_iso8859_6, __pyx_n_u_iso88596, __pyx_kp_u_iso_8859_6_2, __pyx_kp_u_iso_8859_6_1987); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_tuple__33 = PyTuple_Pack(14, __pyx_n_u_arabic, __pyx_kp_u_asmo_708, __pyx_n_u_csiso88596e, __pyx_n_u_csiso88596i, __pyx_n_u_csisolatinarabic, __pyx_kp_u_ecma_114, __pyx_kp_u_iso_8859_6, __pyx_kp_u_iso_8859_6_e, __pyx_kp_u_iso_8859_6_i, __pyx_kp_u_iso_ir_127, __pyx_kp_u_iso8859_6, __pyx_n_u_iso88596, __pyx_kp_u_iso_8859_6_2, __pyx_kp_u_iso_8859_6_1987); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); - /* "w3lib/_url.pyx":150 + /* "w3lib/_url.pyx":162 * label: "iso-8859-7" * for label in ( * "csisolatingreek", # <<<<<<<<<<<<<< * "ecma-118", * "elot_928", */ - __pyx_tuple__34 = PyTuple_Pack(12, __pyx_n_u_csisolatingreek, __pyx_kp_u_ecma_118, __pyx_n_u_elot_928, __pyx_n_u_greek, __pyx_n_u_greek8, __pyx_kp_u_iso_8859_7, __pyx_kp_u_iso_ir_126, __pyx_kp_u_iso8859_7, __pyx_n_u_iso88597, __pyx_kp_u_iso_8859_7_2, __pyx_kp_u_iso_8859_7_1987, __pyx_n_u_sun_eu_greek); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_tuple__34 = PyTuple_Pack(12, __pyx_n_u_csisolatingreek, __pyx_kp_u_ecma_118, __pyx_n_u_elot_928, __pyx_n_u_greek, __pyx_n_u_greek8, __pyx_kp_u_iso_8859_7, __pyx_kp_u_iso_ir_126, __pyx_kp_u_iso8859_7, __pyx_n_u_iso88597, __pyx_kp_u_iso_8859_7_2, __pyx_kp_u_iso_8859_7_1987, __pyx_n_u_sun_eu_greek); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); - /* "w3lib/_url.pyx":167 + /* "w3lib/_url.pyx":179 * label: "iso-8859-8" * for label in ( * "csiso88598e", # <<<<<<<<<<<<<< * "csisolatinhebrew", * "hebrew", */ - __pyx_tuple__35 = PyTuple_Pack(11, __pyx_n_u_csiso88598e, __pyx_n_u_csisolatinhebrew, __pyx_n_u_hebrew, __pyx_kp_u_iso_8859_8, __pyx_kp_u_iso_8859_8_e, __pyx_kp_u_iso_ir_138, __pyx_kp_u_iso8859_8, __pyx_n_u_iso88598, __pyx_kp_u_iso_8859_8_2, __pyx_kp_u_iso_8859_8_1988, __pyx_n_u_visual); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_tuple__35 = PyTuple_Pack(11, __pyx_n_u_csiso88598e, __pyx_n_u_csisolatinhebrew, __pyx_n_u_hebrew, __pyx_kp_u_iso_8859_8, __pyx_kp_u_iso_8859_8_e, __pyx_kp_u_iso_ir_138, __pyx_kp_u_iso8859_8, __pyx_n_u_iso88598, __pyx_kp_u_iso_8859_8_2, __pyx_kp_u_iso_8859_8_1988, __pyx_n_u_visual); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); - /* "w3lib/_url.pyx":183 + /* "w3lib/_url.pyx":195 * label: "iso-8859-8-i" * for label in ( * "csiso88598i", # <<<<<<<<<<<<<< * "iso-8859-8-i", * "logical", */ - __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_u_csiso88598i, __pyx_kp_u_iso_8859_8_i, __pyx_n_u_logical); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_u_csiso88598i, __pyx_kp_u_iso_8859_8_i, __pyx_n_u_logical); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); - /* "w3lib/_url.pyx":191 + /* "w3lib/_url.pyx":203 * label: "iso-8859-10" * for label in ( * "csisolatin6", # <<<<<<<<<<<<<< * "iso-8859-10", * "iso-ir-157", */ - __pyx_tuple__37 = PyTuple_Pack(7, __pyx_n_u_csisolatin6, __pyx_kp_u_iso_8859_10, __pyx_kp_u_iso_ir_157, __pyx_kp_u_iso8859_10, __pyx_n_u_iso885910, __pyx_n_u_l6, __pyx_n_u_latin6); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_tuple__37 = PyTuple_Pack(7, __pyx_n_u_csisolatin6, __pyx_kp_u_iso_8859_10, __pyx_kp_u_iso_ir_157, __pyx_kp_u_iso8859_10, __pyx_n_u_iso885910, __pyx_n_u_l6, __pyx_n_u_latin6); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); - /* "w3lib/_url.pyx":215 + /* "w3lib/_url.pyx":227 * label: "iso-8859-13" * for label in ( * "iso-8859-13", # <<<<<<<<<<<<<< * "iso8859-13", * "iso885913", */ - __pyx_tuple__38 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_13, __pyx_kp_u_iso8859_13, __pyx_n_u_iso885913); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_13, __pyx_kp_u_iso8859_13, __pyx_n_u_iso885913); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); - /* "w3lib/_url.pyx":223 + /* "w3lib/_url.pyx":235 * label: "iso-8859-14" * for label in ( * "iso-8859-14", # <<<<<<<<<<<<<< * "iso8859-14", * "iso885914", */ - __pyx_tuple__39 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_14, __pyx_kp_u_iso8859_14, __pyx_n_u_iso885914); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_tuple__39 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_14, __pyx_kp_u_iso8859_14, __pyx_n_u_iso885914); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); - /* "w3lib/_url.pyx":231 + /* "w3lib/_url.pyx":243 * label: "iso-8859-15" * for label in ( * "csisolatin9", # <<<<<<<<<<<<<< * "iso-8859-15", * "iso8859-15", */ - __pyx_tuple__40 = PyTuple_Pack(6, __pyx_n_u_csisolatin9, __pyx_kp_u_iso_8859_15, __pyx_kp_u_iso8859_15, __pyx_n_u_iso885915, __pyx_kp_u_iso_8859_15_2, __pyx_n_u_l9); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(6, __pyx_n_u_csisolatin9, __pyx_kp_u_iso_8859_15, __pyx_kp_u_iso8859_15, __pyx_n_u_iso885915, __pyx_kp_u_iso_8859_15_2, __pyx_n_u_l9); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); - /* "w3lib/_url.pyx":243 + /* "w3lib/_url.pyx":255 * label: "koi8-r" * for label in ( * "cskoi8r", # <<<<<<<<<<<<<< * "koi", * "koi8", */ - __pyx_tuple__41 = PyTuple_Pack(5, __pyx_n_u_cskoi8r, __pyx_n_u_koi, __pyx_n_u_koi8, __pyx_kp_u_koi8_r, __pyx_n_u_koi8_r_2); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_tuple__41 = PyTuple_Pack(5, __pyx_n_u_cskoi8r, __pyx_n_u_koi, __pyx_n_u_koi8, __pyx_kp_u_koi8_r, __pyx_n_u_koi8_r_2); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); - /* "w3lib/_url.pyx":253 + /* "w3lib/_url.pyx":265 * label: "koi8-u" * for label in ( * "koi8-ru", # <<<<<<<<<<<<<< * "koi8-u", * ) */ - __pyx_tuple__42 = PyTuple_Pack(2, __pyx_kp_u_koi8_ru, __pyx_kp_u_koi8_u); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_tuple__42 = PyTuple_Pack(2, __pyx_kp_u_koi8_ru, __pyx_kp_u_koi8_u); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); - /* "w3lib/_url.pyx":260 + /* "w3lib/_url.pyx":272 * label: "macintosh" * for label in ( * "csmacintosh", # <<<<<<<<<<<<<< * "mac", * "macintosh", */ - __pyx_tuple__43 = PyTuple_Pack(4, __pyx_n_u_csmacintosh, __pyx_n_u_mac, __pyx_n_u_macintosh, __pyx_kp_u_x_mac_roman); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_tuple__43 = PyTuple_Pack(4, __pyx_n_u_csmacintosh, __pyx_n_u_mac, __pyx_n_u_macintosh, __pyx_kp_u_x_mac_roman); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); - /* "w3lib/_url.pyx":269 + /* "w3lib/_url.pyx":281 * label: "cp874" * for label in ( * "dos-874", # <<<<<<<<<<<<<< * "iso-8859-11", * "iso8859-11", */ - __pyx_tuple__44 = PyTuple_Pack(6, __pyx_kp_u_dos_874, __pyx_kp_u_iso_8859_11, __pyx_kp_u_iso8859_11, __pyx_n_u_iso885911, __pyx_kp_u_tis_620, __pyx_kp_u_windows_874); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_tuple__44 = PyTuple_Pack(6, __pyx_kp_u_dos_874, __pyx_kp_u_iso_8859_11, __pyx_kp_u_iso8859_11, __pyx_n_u_iso885911, __pyx_kp_u_tis_620, __pyx_kp_u_windows_874); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); - /* "w3lib/_url.pyx":277 + /* "w3lib/_url.pyx":289 * ) * }, * **_short_windows_125(0), # <<<<<<<<<<<<<< * **_short_windows_125(1), * **{ */ - __pyx_tuple__45 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); - /* "w3lib/_url.pyx":278 + /* "w3lib/_url.pyx":290 * }, * **_short_windows_125(0), * **_short_windows_125(1), # <<<<<<<<<<<<<< * **{ * label: "windows-1252" */ - __pyx_tuple__46 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); - /* "w3lib/_url.pyx":282 + /* "w3lib/_url.pyx":294 * label: "windows-1252" * for label in ( * "ansi_x3.4-1968", # <<<<<<<<<<<<<< * "ascii", * "cp1252", */ - __pyx_tuple__47 = PyTuple_Pack(17, __pyx_kp_u_ansi_x3_4_1968, __pyx_n_u_ascii, __pyx_n_u_cp1252, __pyx_n_u_cp819, __pyx_n_u_csisolatin1, __pyx_n_u_ibm819, __pyx_kp_u_iso_8859_1, __pyx_kp_u_iso_ir_100, __pyx_kp_u_iso8859_1, __pyx_n_u_iso88591, __pyx_kp_u_iso_8859_1_2, __pyx_kp_u_iso_8859_1_1987, __pyx_n_u_l1, __pyx_n_u_latin1, __pyx_kp_u_us_ascii, __pyx_kp_u_windows_1252, __pyx_kp_u_x_cp1252); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_tuple__47 = PyTuple_Pack(17, __pyx_kp_u_ansi_x3_4_1968, __pyx_n_u_ascii, __pyx_n_u_cp1252, __pyx_n_u_cp819, __pyx_n_u_csisolatin1, __pyx_n_u_ibm819, __pyx_kp_u_iso_8859_1, __pyx_kp_u_iso_ir_100, __pyx_kp_u_iso8859_1, __pyx_n_u_iso88591, __pyx_kp_u_iso_8859_1_2, __pyx_kp_u_iso_8859_1_1987, __pyx_n_u_l1, __pyx_n_u_latin1, __pyx_kp_u_us_ascii, __pyx_kp_u_windows_1252, __pyx_kp_u_x_cp1252); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); - /* "w3lib/_url.pyx":301 + /* "w3lib/_url.pyx":313 * ) * }, * **_short_windows_125(3), # <<<<<<<<<<<<<< * **{ * label: "windows-1254" */ - __pyx_tuple__48 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); - /* "w3lib/_url.pyx":305 + /* "w3lib/_url.pyx":317 * label: "windows-1254" * for label in ( * "cp1254", # <<<<<<<<<<<<<< * "csisolatin5", * "iso-8859-9", */ - __pyx_tuple__49 = PyTuple_Pack(12, __pyx_n_u_cp1254, __pyx_n_u_csisolatin5, __pyx_kp_u_iso_8859_9, __pyx_kp_u_iso_ir_148, __pyx_kp_u_iso8859_9, __pyx_n_u_iso88599, __pyx_kp_u_iso_8859_9_2, __pyx_kp_u_iso_8859_9_1989, __pyx_n_u_l5, __pyx_n_u_latin5, __pyx_kp_u_windows_1254, __pyx_kp_u_x_cp1254); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_tuple__49 = PyTuple_Pack(12, __pyx_n_u_cp1254, __pyx_n_u_csisolatin5, __pyx_kp_u_iso_8859_9, __pyx_kp_u_iso_ir_148, __pyx_kp_u_iso8859_9, __pyx_n_u_iso88599, __pyx_kp_u_iso_8859_9_2, __pyx_kp_u_iso_8859_9_1989, __pyx_n_u_l5, __pyx_n_u_latin5, __pyx_kp_u_windows_1254, __pyx_kp_u_x_cp1254); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); - /* "w3lib/_url.pyx":319 + /* "w3lib/_url.pyx":331 * ) * }, * **_short_windows_125(5), # <<<<<<<<<<<<<< * **_short_windows_125(6), * **_short_windows_125(7), */ - __pyx_tuple__50 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); - /* "w3lib/_url.pyx":320 + /* "w3lib/_url.pyx":332 * }, * **_short_windows_125(5), * **_short_windows_125(6), # <<<<<<<<<<<<<< * **_short_windows_125(7), * **_short_windows_125(8), */ - __pyx_tuple__51 = PyTuple_Pack(1, __pyx_int_6); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_int_6); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); - /* "w3lib/_url.pyx":321 + /* "w3lib/_url.pyx":333 * **_short_windows_125(5), * **_short_windows_125(6), * **_short_windows_125(7), # <<<<<<<<<<<<<< * **_short_windows_125(8), * **{ */ - __pyx_tuple__52 = PyTuple_Pack(1, __pyx_int_7); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_int_7); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); - /* "w3lib/_url.pyx":322 + /* "w3lib/_url.pyx":334 * **_short_windows_125(6), * **_short_windows_125(7), * **_short_windows_125(8), # <<<<<<<<<<<<<< * **{ * label: "mac-cyrillic" */ - __pyx_tuple__53 = PyTuple_Pack(1, __pyx_int_8); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_int_8); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); - /* "w3lib/_url.pyx":326 + /* "w3lib/_url.pyx":338 * label: "mac-cyrillic" * for label in ( * "x-mac-cyrillic", # <<<<<<<<<<<<<< * "x-mac-ukrainian", * ) */ - __pyx_tuple__54 = PyTuple_Pack(2, __pyx_kp_u_x_mac_cyrillic, __pyx_kp_u_x_mac_ukrainian); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_tuple__54 = PyTuple_Pack(2, __pyx_kp_u_x_mac_cyrillic, __pyx_kp_u_x_mac_ukrainian); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); - /* "w3lib/_url.pyx":333 + /* "w3lib/_url.pyx":345 * label: "gbk" * for label in ( * "chinese", # <<<<<<<<<<<<<< * "csgb2312", * "csiso58gb231280", */ - __pyx_tuple__55 = PyTuple_Pack(9, __pyx_n_u_chinese, __pyx_n_u_csgb2312, __pyx_n_u_csiso58gb231280, __pyx_n_u_gb2312, __pyx_n_u_gb_2312, __pyx_kp_u_gb_2312_80, __pyx_n_u_gbk, __pyx_kp_u_iso_ir_58, __pyx_kp_u_x_gbk); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_tuple__55 = PyTuple_Pack(9, __pyx_n_u_chinese, __pyx_n_u_csgb2312, __pyx_n_u_csiso58gb231280, __pyx_n_u_gb2312, __pyx_n_u_gb_2312, __pyx_kp_u_gb_2312_80, __pyx_n_u_gbk, __pyx_kp_u_iso_ir_58, __pyx_kp_u_x_gbk); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); - /* "w3lib/_url.pyx":348 + /* "w3lib/_url.pyx":360 * label: "big5" * for label in ( * "big5", # <<<<<<<<<<<<<< * "big5-hkscs", * "cn-big5", */ - __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_u_big5, __pyx_kp_u_big5_hkscs, __pyx_kp_u_cn_big5, __pyx_n_u_csbig5, __pyx_kp_u_x_x_big5); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_u_big5, __pyx_kp_u_big5_hkscs, __pyx_kp_u_cn_big5, __pyx_n_u_csbig5, __pyx_kp_u_x_x_big5); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); - /* "w3lib/_url.pyx":358 + /* "w3lib/_url.pyx":370 * label: "euc-jp" * for label in ( * "cseucpkdfmtjapanese", # <<<<<<<<<<<<<< * "euc-jp", * "x-euc-jp", */ - __pyx_tuple__57 = PyTuple_Pack(3, __pyx_n_u_cseucpkdfmtjapanese, __pyx_kp_u_euc_jp, __pyx_kp_u_x_euc_jp); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_tuple__57 = PyTuple_Pack(3, __pyx_n_u_cseucpkdfmtjapanese, __pyx_kp_u_euc_jp, __pyx_kp_u_x_euc_jp); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); - /* "w3lib/_url.pyx":366 + /* "w3lib/_url.pyx":378 * label: "iso-2022-jp" * for label in ( * "csiso2022jp", # <<<<<<<<<<<<<< * "iso-2022-jp", * ) */ - __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_u_csiso2022jp, __pyx_kp_u_iso_2022_jp); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_u_csiso2022jp, __pyx_kp_u_iso_2022_jp); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); - /* "w3lib/_url.pyx":373 + /* "w3lib/_url.pyx":385 * label: "shift_jis" * for label in ( * "csshiftjis", # <<<<<<<<<<<<<< * "ms932", * "ms_kanji", */ - __pyx_tuple__59 = PyTuple_Pack(8, __pyx_n_u_csshiftjis, __pyx_n_u_ms932, __pyx_n_u_ms_kanji, __pyx_kp_u_shift_jis, __pyx_n_u_shift_jis_2, __pyx_n_u_sjis, __pyx_kp_u_windows_31j, __pyx_kp_u_x_sjis); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_tuple__59 = PyTuple_Pack(8, __pyx_n_u_csshiftjis, __pyx_n_u_ms932, __pyx_n_u_ms_kanji, __pyx_kp_u_shift_jis, __pyx_n_u_shift_jis_2, __pyx_n_u_sjis, __pyx_kp_u_windows_31j, __pyx_kp_u_x_sjis); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59); - /* "w3lib/_url.pyx":386 + /* "w3lib/_url.pyx":398 * label: "euc-kr" * for label in ( * "cseuckr", # <<<<<<<<<<<<<< * "csksc56011987", * "euc-kr", */ - __pyx_tuple__60 = PyTuple_Pack(10, __pyx_n_u_cseuckr, __pyx_n_u_csksc56011987, __pyx_kp_u_euc_kr, __pyx_kp_u_iso_ir_149, __pyx_n_u_korean, __pyx_kp_u_ks_c_5601_1987, __pyx_kp_u_ks_c_5601_1989, __pyx_n_u_ksc5601, __pyx_n_u_ksc_5601, __pyx_kp_u_windows_949); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_tuple__60 = PyTuple_Pack(10, __pyx_n_u_cseuckr, __pyx_n_u_csksc56011987, __pyx_kp_u_euc_kr, __pyx_kp_u_iso_ir_149, __pyx_n_u_korean, __pyx_kp_u_ks_c_5601_1987, __pyx_kp_u_ks_c_5601_1989, __pyx_n_u_ksc5601, __pyx_n_u_ksc_5601, __pyx_kp_u_windows_949); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); - /* "w3lib/_url.pyx":401 + /* "w3lib/_url.pyx":413 * label: _REPLACEMENT_ENCODING * for label in ( * "csiso2022kr", # <<<<<<<<<<<<<< * "hz-gb-2312", * "iso-2022-cn", */ - __pyx_tuple__61 = PyTuple_Pack(6, __pyx_n_u_csiso2022kr, __pyx_kp_u_hz_gb_2312, __pyx_kp_u_iso_2022_cn, __pyx_kp_u_iso_2022_cn_ext, __pyx_kp_u_iso_2022_kr, __pyx_n_u_replacement); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_tuple__61 = PyTuple_Pack(6, __pyx_n_u_csiso2022kr, __pyx_kp_u_hz_gb_2312, __pyx_kp_u_iso_2022_cn, __pyx_kp_u_iso_2022_cn_ext, __pyx_kp_u_iso_2022_kr, __pyx_n_u_replacement); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); - /* "w3lib/_url.pyx":412 + /* "w3lib/_url.pyx":424 * label: _UTF_16BE_ENCODING * for label in ( * "unicodefffe", # <<<<<<<<<<<<<< * "utf-16be", * ) */ - __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_u_unicodefffe, __pyx_kp_u_utf_16be); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_u_unicodefffe, __pyx_kp_u_utf_16be); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); - /* "w3lib/_url.pyx":419 + /* "w3lib/_url.pyx":431 * label: _UTF_16LE_ENCODING * for label in ( * "csunicode", # <<<<<<<<<<<<<< * "iso-10646-ucs-2", * "ucs-2", */ - __pyx_tuple__63 = PyTuple_Pack(7, __pyx_n_u_csunicode, __pyx_kp_u_iso_10646_ucs_2, __pyx_kp_u_ucs_2, __pyx_n_u_unicode, __pyx_n_u_unicodefeff, __pyx_kp_u_utf_16, __pyx_kp_u_utf_16le); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_tuple__63 = PyTuple_Pack(7, __pyx_n_u_csunicode, __pyx_kp_u_iso_10646_ucs_2, __pyx_kp_u_ucs_2, __pyx_n_u_unicode, __pyx_n_u_unicodefeff, __pyx_kp_u_utf_16, __pyx_kp_u_utf_16le); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); - /* "w3lib/_url.pyx":433 + /* "w3lib/_url.pyx":445 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def _get_encoder(encoding: str) -> EncodeFunction: * codec_info = codecs.lookup(encoding) */ - __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_encoding, __pyx_n_s_codec_info); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_encoding, __pyx_n_s_codec_info); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); - __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_encoder, 433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_encoder, 445, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 445, __pyx_L1_error) - /* "w3lib/_url.pyx":439 + /* "w3lib/_url.pyx":451 * * * _UTF_8_ENCODER = _get_encoder("utf-8") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66); - /* "w3lib/_url.pyx":443 + /* "w3lib/_url.pyx":455 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def _get_encoding(label: str) -> str: * label = label.strip(_ASCII_WHITESPACE).lower() */ - __pyx_tuple__67 = PyTuple_Pack(2, __pyx_n_s_label, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_tuple__67 = PyTuple_Pack(2, __pyx_n_s_label, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); - __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_encoding, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_encoding, 455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 455, __pyx_L1_error) - /* "w3lib/_url.pyx":543 + /* "w3lib/_url.pyx":555 * _path_token_seen: bool = False * * def __init__(self) -> None: # <<<<<<<<<<<<<< * self.path = [] * self.is_special = False */ - __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); - __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_init, 543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_init, 555, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 555, __pyx_L1_error) - /* "w3lib/_url.pyx":547 + /* "w3lib/_url.pyx":559 * self.is_special = False * * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< * return isinstance(self.path, str) * */ - __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_has_opaque_path, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_has_opaque_path, 559, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 559, __pyx_L1_error) - /* "w3lib/_url.pyx":550 + /* "w3lib/_url.pyx":562 * return isinstance(self.path, str) * * @property # <<<<<<<<<<<<<< * def scheme(self) -> str: * return self._scheme */ - __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 562, __pyx_L1_error) - /* "w3lib/_url.pyx":554 + /* "w3lib/_url.pyx":566 * return self._scheme * * @scheme.setter # <<<<<<<<<<<<<< * def scheme(self, value: str) -> None: * self._scheme = value */ - __pyx_tuple__73 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_tuple__73 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__73); __Pyx_GIVEREF(__pyx_tuple__73); - __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 566, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 566, __pyx_L1_error) - /* "w3lib/_url.pyx":564 + /* "w3lib/_url.pyx":576 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< * path = url.path * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): */ - __pyx_tuple__76 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_path); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_tuple__76 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_path); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); - __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_shorten_path, 564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_shorten_path, 576, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 576, __pyx_L1_error) - /* "w3lib/_url.pyx":573 + /* "w3lib/_url.pyx":585 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_tuple__79 = PyTuple_Pack(11, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_percent_encode_set, __pyx_n_s_space_as_plus, __pyx_n_s_encoder, __pyx_n_s_output, __pyx_n_s_encode_output, __pyx_n_s__78, __pyx_n_s_i, __pyx_n_s_byte, __pyx_n_s_isomorph); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_tuple__79 = PyTuple_Pack(11, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_percent_encode_set, __pyx_n_s_space_as_plus, __pyx_n_s_encoder, __pyx_n_s_output, __pyx_n_s_encode_output, __pyx_n_s__78, __pyx_n_s_i, __pyx_n_s_byte, __pyx_n_s_isomorph); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); - __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_percent_encode_after_encoding, 573, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_percent_encode_after_encoding, 585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 585, __pyx_L1_error) + + /* "w3lib/_url.pyx":634 + * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" + * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS + * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") # <<<<<<<<<<<<<< + * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 + * + */ + __pyx_tuple__90 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + + /* "w3lib/_url.pyx":639 + * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" + * _safe_chars = RFC3986_RESERVED + RFC3986_UNRESERVED + EXTRA_SAFE_CHARS + b"%" + * _path_safe_chars = _safe_chars.replace(b"#", b"") # <<<<<<<<<<<<<< + * + * # Characters that are safe in all of: + */ + __pyx_tuple__92 = PyTuple_Pack(2, __pyx_kp_b__12, __pyx_kp_b__2); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + + /* "w3lib/_url.pyx":651 + * # be escaped as %25 when it is not already being used as part of an escape + * # character. + * _USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") # <<<<<<<<<<<<<< + * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") + * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS + */ + __pyx_tuple__93 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); - /* "w3lib/_url.pyx":623 + /* "w3lib/_url.pyx":688 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< * address = [0] * 8 * piece_index = 0 */ - __pyx_tuple__89 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_address, __pyx_n_s_piece_index, __pyx_n_s_compress, __pyx_n_s_pointer, __pyx_n_s_input_lenght, __pyx_n_s_value, __pyx_n_s_length, __pyx_n_s_numbers_seen, __pyx_n_s_ipv4_piece, __pyx_n_s_number, __pyx_n_s_swaps); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__89); - __Pyx_GIVEREF(__pyx_tuple__89); - __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv6, 623, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_tuple__98 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_address, __pyx_n_s_piece_index, __pyx_n_s_compress, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_value, __pyx_n_s_length, __pyx_n_s_numbers_seen, __pyx_n_s_ipv4_piece, __pyx_n_s_number, __pyx_n_s_swaps); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); + __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv6, 688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 688, __pyx_L1_error) - /* "w3lib/_url.pyx":710 + /* "w3lib/_url.pyx":775 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< * input: str, * percent_encode_set: _PercentEncodeSet, */ - __pyx_tuple__91 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__91); - __Pyx_GIVEREF(__pyx_tuple__91); - __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_utf_8_percent_encode, 710, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_tuple__100 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); + __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_utf_8_percent_encode, 775, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 775, __pyx_L1_error) - /* "w3lib/_url.pyx":722 + /* "w3lib/_url.pyx":787 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: */ - __pyx_tuple__93 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 722, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__93); - __Pyx_GIVEREF(__pyx_tuple__93); - __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_opaque_host, 722, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_tuple__102 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__102); + __Pyx_GIVEREF(__pyx_tuple__102); + __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_opaque_host, 787, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 787, __pyx_L1_error) - /* "w3lib/_url.pyx":730 + /* "w3lib/_url.pyx":795 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< * if not input: * raise ValueError */ - __pyx_tuple__95 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_validation_error, __pyx_n_s_r); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 730, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__95); - __Pyx_GIVEREF(__pyx_tuple__95); - __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4_number, 730, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_tuple__104 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_validation_error, __pyx_n_s_r); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__104); + __Pyx_GIVEREF(__pyx_tuple__104); + __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4_number, 795, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 795, __pyx_L1_error) - /* "w3lib/_url.pyx":750 + /* "w3lib/_url.pyx":815 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and parts[-1] == "": */ - __pyx_tuple__97 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_last, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 750, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__97); - __Pyx_GIVEREF(__pyx_tuple__97); - __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_ends_in_number, 750, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_tuple__106 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_last, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 815, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__106); + __Pyx_GIVEREF(__pyx_tuple__106); + __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_ends_in_number, 815, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 815, __pyx_L1_error) - /* "w3lib/_url.pyx":767 + /* "w3lib/_url.pyx":832 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and not parts[-1]: */ - __pyx_tuple__99 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_numbers, __pyx_n_s_part, __pyx_n_s_result, __pyx_n_s_ipv4, __pyx_n_s_counter, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__99); - __Pyx_GIVEREF(__pyx_tuple__99); - __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4, 767, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_tuple__108 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_numbers, __pyx_n_s_part, __pyx_n_s_result, __pyx_n_s_ipv4, __pyx_n_s_counter, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__108); + __Pyx_GIVEREF(__pyx_tuple__108); + __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4, 832, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 832, __pyx_L1_error) - /* "w3lib/_url.pyx":790 + /* "w3lib/_url.pyx":855 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< * result = _utr46._to_ascii( * domain, */ - __pyx_tuple__101 = PyTuple_Pack(3, __pyx_n_s_domain, __pyx_n_s_be_strict, __pyx_n_s_result); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 790, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__101); - __Pyx_GIVEREF(__pyx_tuple__101); - __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_domain_to_ascii, 790, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_tuple__110 = PyTuple_Pack(3, __pyx_n_s_domain, __pyx_n_s_be_strict, __pyx_n_s_result); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__110); + __Pyx_GIVEREF(__pyx_tuple__110); + __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_domain_to_ascii, 855, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 855, __pyx_L1_error) - /* "w3lib/_url.pyx":809 + /* "w3lib/_url.pyx":874 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_tuple__103 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_is_special, __pyx_n_s_domain, __pyx_n_s_ascii_domain, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 809, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__103); - __Pyx_GIVEREF(__pyx_tuple__103); - __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_host, 809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_tuple__112 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_is_special, __pyx_n_s_domain, __pyx_n_s_ascii_domain, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__112); + __Pyx_GIVEREF(__pyx_tuple__112); + __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_host, 874, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 874, __pyx_L1_error) - /* "w3lib/_url.pyx":831 + /* "w3lib/_url.pyx":896 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * */ - __pyx_tuple__105 = PyTuple_Pack(1, __pyx_n_s_input); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__105); - __Pyx_GIVEREF(__pyx_tuple__105); - __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_windows_drive_letter, 831, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_tuple__114 = PyTuple_Pack(1, __pyx_n_s_input); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__114); + __Pyx_GIVEREF(__pyx_tuple__114); + __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_windows_drive_letter, 896, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 896, __pyx_L1_error) - /* "w3lib/_url.pyx":836 + /* "w3lib/_url.pyx":901 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< * input_length = len(input) * return ( */ - __pyx_tuple__107 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_input_length); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__107); - __Pyx_GIVEREF(__pyx_tuple__107); - __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_starts_with_windows_drive_lette, 836, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_tuple__116 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_input_length); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 901, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__116); + __Pyx_GIVEREF(__pyx_tuple__116); + __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_starts_with_windows_drive_lette, 901, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 901, __pyx_L1_error) - /* "w3lib/_url.pyx":846 + /* "w3lib/_url.pyx":911 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< * return input in ( * "..", */ - __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_double_dot_path_segment, 846, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_double_dot_path_segment, 911, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 911, __pyx_L1_error) - /* "w3lib/_url.pyx":861 + /* "w3lib/_url.pyx":926 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< * return input in ( * ".", */ - __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_single_dot_path_segment, 861, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_single_dot_path_segment, 926, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 926, __pyx_L1_error) - /* "w3lib/_url.pyx":872 + /* "w3lib/_url.pyx":937 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * *, input: str, pointer: int, encode_set: _PercentEncodeSet * ) -> str: */ - __pyx_tuple__111 = PyTuple_Pack(4, __pyx_n_s_input, __pyx_n_s_pointer, __pyx_n_s_encode_set, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__111); - __Pyx_GIVEREF(__pyx_tuple__111); - __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_idempotent_utf_8_percent_encode, 872, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 872, __pyx_L1_error) + __pyx_tuple__120 = PyTuple_Pack(4, __pyx_n_s_input, __pyx_n_s_pointer, __pyx_n_s_encode_set, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 937, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__120); + __Pyx_GIVEREF(__pyx_tuple__120); + __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_idempotent_utf_8_percent_encode, 937, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 937, __pyx_L1_error) - /* "w3lib/_url.pyx":887 + /* "w3lib/_url.pyx":952 + * + * + * def _preprocess_url(url: str) -> str: # <<<<<<<<<<<<<< + * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) + * + */ + __pyx_tuple__122 = PyTuple_Pack(1, __pyx_n_s_url); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__122); + __Pyx_GIVEREF(__pyx_tuple__122); + __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_preprocess_url, 952, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 952, __pyx_L1_error) + + /* "w3lib/_url.pyx":956 * * * def _parse_url( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_tuple__113 = PyTuple_Pack(26, __pyx_n_s_input, __pyx_n_s_base_url, __pyx_n_s_encoding, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_path_percent_encode_set, __pyx_n_s_query_percent_encode_set, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_base, __pyx_n_s_url, __pyx_n_s_state, __pyx_n_s_buffer, __pyx_n_s_at_sign_seen, __pyx_n_s_inside_brackets, __pyx_n_s_skip_authority_shortcut, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_c, __pyx_n_s_at_sign_index, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_encoded_code_points, __pyx_n_s_host, __pyx_n_s_port, __pyx_n_s_encoded, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__113); - __Pyx_GIVEREF(__pyx_tuple__113); - __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_url, 887, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_tuple__124 = PyTuple_Pack(27, __pyx_n_s_input, __pyx_n_s_base_url, __pyx_n_s_encoding, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_path_percent_encode_set, __pyx_n_s_query_percent_encode_set, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_base, __pyx_n_s_url, __pyx_n_s_state, __pyx_n_s_buffer, __pyx_n_s_at_sign_seen, __pyx_n_s_inside_brackets, __pyx_n_s_skip_authority_shortcut, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_reached_end, __pyx_n_s_c, __pyx_n_s_at_sign_index, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_encoded_code_points, __pyx_n_s_host, __pyx_n_s_port, __pyx_n_s_encoded, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 956, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__124); + __Pyx_GIVEREF(__pyx_tuple__124); + __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 27, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_url, 956, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 956, __pyx_L1_error) - /* "w3lib/_url.pyx":1319 + /* "w3lib/_url.pyx":1368 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< * output = "" * n = address */ - __pyx_tuple__115 = PyTuple_Pack(4, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 1319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__115); - __Pyx_GIVEREF(__pyx_tuple__115); - __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv4, 1319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_tuple__126 = PyTuple_Pack(4, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 1368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__126); + __Pyx_GIVEREF(__pyx_tuple__126); + __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv4, 1368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 1368, __pyx_L1_error) - /* "w3lib/_url.pyx":1330 + /* "w3lib/_url.pyx":1379 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: */ - __pyx_tuple__117 = PyTuple_Pack(7, __pyx_n_s_address, __pyx_n_s_min_length, __pyx_n_s_index, __pyx_n_s_index_length, __pyx_n_s_current_length, __pyx_n_s_current_index, __pyx_n_s_piece); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 1330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__117); - __Pyx_GIVEREF(__pyx_tuple__117); - __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_ipv6_first_longest_0_piece, 1330, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_tuple__128 = PyTuple_Pack(7, __pyx_n_s_address, __pyx_n_s_min_length, __pyx_n_s_index, __pyx_n_s_index_length, __pyx_n_s_current_length, __pyx_n_s_current_index, __pyx_n_s_piece); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 1379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__128); + __Pyx_GIVEREF(__pyx_tuple__128); + __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_ipv6_first_longest_0_piece, 1379, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 1379, __pyx_L1_error) - /* "w3lib/_url.pyx":1348 + /* "w3lib/_url.pyx":1397 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) */ - __pyx_tuple__119 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_compress, __pyx_n_s_ignore0, __pyx_n_s_piece_index, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 1348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__119); - __Pyx_GIVEREF(__pyx_tuple__119); - __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv6, 1348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_tuple__130 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_compress, __pyx_n_s_ignore0, __pyx_n_s_piece_index, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 1397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__130); + __Pyx_GIVEREF(__pyx_tuple__130); + __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv6, 1397, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 1397, __pyx_L1_error) - /* "w3lib/_url.pyx":1369 + /* "w3lib/_url.pyx":1418 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< * if isinstance(host, int): * return _serialize_ipv4(host) */ - __pyx_tuple__121 = PyTuple_Pack(1, __pyx_n_s_host); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 1369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__121); - __Pyx_GIVEREF(__pyx_tuple__121); - __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_host, 1369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 1369, __pyx_L1_error) + __pyx_tuple__132 = PyTuple_Pack(1, __pyx_n_s_host); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 1418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__132); + __Pyx_GIVEREF(__pyx_tuple__132); + __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_host, 1418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 1418, __pyx_L1_error) - /* "w3lib/_url.pyx":1378 + /* "w3lib/_url.pyx":1427 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< * if url.has_opaque_path(): * assert isinstance(url.path, str) */ - __pyx_tuple__123 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_canonicalize, __pyx_n_s_output, __pyx_n_s_segment); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 1378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__123); - __Pyx_GIVEREF(__pyx_tuple__123); - __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url_path, 1378, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 1378, __pyx_L1_error) + __pyx_tuple__134 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_canonicalize, __pyx_n_s_output, __pyx_n_s_segment); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 1427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__134); + __Pyx_GIVEREF(__pyx_tuple__134); + __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url_path, 1427, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 1427, __pyx_L1_error) - /* "w3lib/_url.pyx":1391 + /* "w3lib/_url.pyx":1440 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url( # <<<<<<<<<<<<<< * url: _URL, * *, */ - __pyx_tuple__125 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_exclude_fragment, __pyx_n_s_canonicalize, __pyx_n_s_output); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 1391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__125); - __Pyx_GIVEREF(__pyx_tuple__125); - __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url, 1391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 1391, __pyx_L1_error) + __pyx_tuple__136 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_exclude_fragment, __pyx_n_s_canonicalize, __pyx_n_s_output); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(0, 1440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__136); + __Pyx_GIVEREF(__pyx_tuple__136); + __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url, 1440, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(0, 1440, __pyx_L1_error) + + /* "w3lib/_url.pyx":1506 + * + * + * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< + * url = _parse_url( + * input, + */ + __pyx_tuple__138 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_url); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 1506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__138); + __Pyx_GIVEREF(__pyx_tuple__138); + __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_safe_url, 1506, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(0, 1506, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -24500,8 +25121,6 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { __pyx_umethod_PyUnicode_Type_strip.type = (PyObject*)&PyUnicode_Type; __pyx_umethod_PyUnicode_Type_strip.method_name = &__pyx_n_s_strip; - __pyx_umethod_PyUnicode_Type_translate.type = (PyObject*)&PyUnicode_Type; - __pyx_umethod_PyUnicode_Type_translate.method_name = &__pyx_n_s_translate; if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -24612,15 +25231,15 @@ static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr)) __PYX_ERR(0, 757, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr)) __PYX_ERR(0, 822, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 822, __pyx_L1_error) #else __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 757, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 822, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_print = 0; @@ -24631,15 +25250,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 777, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 842, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 842, __pyx_L1_error) #else __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 777, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 842, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_print = 0; @@ -24966,455 +25585,567 @@ if (!__Pyx_RefNanny) { if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":5 - * from cython import cfunc, declare, uchar + /* "w3lib/_url.pyx":3 + * # pylint: disable=protected-access,too-many-instance-attributes,too-many-locals,too-many-nested-blocks,too-many-statements * * import codecs # <<<<<<<<<<<<<< + * import string * from functools import lru_cache - * from math import floor */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_codecs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_codecs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_codecs, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_codecs, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":6 + /* "w3lib/_url.pyx":4 * * import codecs + * import string # <<<<<<<<<<<<<< + * from functools import lru_cache + * from math import floor + */ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_string, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_string, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":5 + * import codecs + * import string * from functools import lru_cache # <<<<<<<<<<<<<< * from math import floor * from typing import AnyStr, Callable, Dict, List, Optional, Tuple, Union */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_lru_cache); __Pyx_GIVEREF(__pyx_n_s_lru_cache); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_lru_cache)) __PYX_ERR(0, 6, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_lru_cache)) __PYX_ERR(0, 5, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_lru_cache, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lru_cache, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":7 - * import codecs + /* "w3lib/_url.pyx":6 + * import string * from functools import lru_cache * from math import floor # <<<<<<<<<<<<<< * from typing import AnyStr, Callable, Dict, List, Optional, Tuple, Union * from urllib.parse import unquote */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_floor); __Pyx_GIVEREF(__pyx_n_s_floor); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_floor)) __PYX_ERR(0, 7, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_math, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_floor)) __PYX_ERR(0, 6, __pyx_L1_error); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_math, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_floor, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_floor, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":8 + /* "w3lib/_url.pyx":7 * from functools import lru_cache * from math import floor * from typing import AnyStr, Callable, Dict, List, Optional, Tuple, Union # <<<<<<<<<<<<<< * from urllib.parse import unquote * */ - __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_AnyStr); __Pyx_GIVEREF(__pyx_n_s_AnyStr); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_AnyStr)) __PYX_ERR(0, 8, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_AnyStr)) __PYX_ERR(0, 7, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_Callable); __Pyx_GIVEREF(__pyx_n_s_Callable); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_Callable)) __PYX_ERR(0, 8, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_Callable)) __PYX_ERR(0, 7, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_Dict); __Pyx_GIVEREF(__pyx_n_s_Dict); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_Dict)) __PYX_ERR(0, 8, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_Dict)) __PYX_ERR(0, 7, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_List); __Pyx_GIVEREF(__pyx_n_s_List); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_List)) __PYX_ERR(0, 8, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_List)) __PYX_ERR(0, 7, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_Optional); __Pyx_GIVEREF(__pyx_n_s_Optional); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_Optional)) __PYX_ERR(0, 8, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_Optional)) __PYX_ERR(0, 7, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_Tuple); __Pyx_GIVEREF(__pyx_n_s_Tuple); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_Tuple)) __PYX_ERR(0, 8, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_Tuple)) __PYX_ERR(0, 7, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_Union); __Pyx_GIVEREF(__pyx_n_s_Union); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_Union)) __PYX_ERR(0, 8, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_Union)) __PYX_ERR(0, 7, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AnyStr, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_AnyStr, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Callable, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Callable, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Dict, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Dict, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_List); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_List); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_List, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_List, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Optional); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Optional); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tuple, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tuple, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":9 + /* "w3lib/_url.pyx":8 * from math import floor * from typing import AnyStr, Callable, Dict, List, Optional, Tuple, Union * from urllib.parse import unquote # <<<<<<<<<<<<<< * - * from . import _utr46 + * from cython import bint, cfunc, declare, uchar */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_unquote); __Pyx_GIVEREF(__pyx_n_s_unquote); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_unquote)) __PYX_ERR(0, 9, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_urllib_parse, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_unquote)) __PYX_ERR(0, 8, __pyx_L1_error); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_urllib_parse, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_unquote); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_unquote); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote, __pyx_t_3) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":11 - * from urllib.parse import unquote + /* "w3lib/_url.pyx":12 + * from cython import bint, cfunc, declare, uchar * * from . import _utr46 # <<<<<<<<<<<<<< * from ._infra import ( * _ASCII_ALPHA, */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_utr46); __Pyx_GIVEREF(__pyx_n_s_utr46); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_utr46)) __PYX_ERR(0, 11, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s__2, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_utr46)) __PYX_ERR(0, 12, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s__2, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_utr46); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_utr46); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_utr46, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utr46, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":13 + /* "w3lib/_url.pyx":14 * from . import _utr46 * from ._infra import ( * _ASCII_ALPHA, # <<<<<<<<<<<<<< * _ASCII_ALPHANUMERIC, * _ASCII_DIGIT, */ - __pyx_t_3 = PyList_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_3 = PyList_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_ASCII_ALPHA); __Pyx_GIVEREF(__pyx_n_s_ASCII_ALPHA); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ASCII_ALPHA)) __PYX_ERR(0, 13, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ASCII_ALPHA)) __PYX_ERR(0, 14, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ASCII_ALPHANUMERIC); __Pyx_GIVEREF(__pyx_n_s_ASCII_ALPHANUMERIC); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_ASCII_ALPHANUMERIC)) __PYX_ERR(0, 13, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_ASCII_ALPHANUMERIC)) __PYX_ERR(0, 14, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ASCII_DIGIT); __Pyx_GIVEREF(__pyx_n_s_ASCII_DIGIT); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ASCII_DIGIT)) __PYX_ERR(0, 13, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ASCII_DIGIT)) __PYX_ERR(0, 14, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ASCII_HEX_DIGIT); __Pyx_GIVEREF(__pyx_n_s_ASCII_HEX_DIGIT); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_ASCII_HEX_DIGIT)) __PYX_ERR(0, 13, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_ASCII_HEX_DIGIT)) __PYX_ERR(0, 14, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ASCII_TAB_OR_NEWLINE); __Pyx_GIVEREF(__pyx_n_s_ASCII_TAB_OR_NEWLINE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_ASCII_TAB_OR_NEWLINE)) __PYX_ERR(0, 13, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_ASCII_TAB_OR_NEWLINE)) __PYX_ERR(0, 14, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ASCII_WHITESPACE); __Pyx_GIVEREF(__pyx_n_s_ASCII_WHITESPACE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_ASCII_WHITESPACE)) __PYX_ERR(0, 13, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_ASCII_WHITESPACE)) __PYX_ERR(0, 14, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_C0_CONTROL); __Pyx_GIVEREF(__pyx_n_s_C0_CONTROL); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_C0_CONTROL)) __PYX_ERR(0, 13, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_C0_CONTROL)) __PYX_ERR(0, 14, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_C0_CONTROL_OR_SPACE); __Pyx_GIVEREF(__pyx_n_s_C0_CONTROL_OR_SPACE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 7, __pyx_n_s_C0_CONTROL_OR_SPACE)) __PYX_ERR(0, 13, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 7, __pyx_n_s_C0_CONTROL_OR_SPACE)) __PYX_ERR(0, 14, __pyx_L1_error); - /* "w3lib/_url.pyx":12 + /* "w3lib/_url.pyx":13 * * from . import _utr46 * from ._infra import ( # <<<<<<<<<<<<<< * _ASCII_ALPHA, * _ASCII_ALPHANUMERIC, */ - __pyx_t_2 = __Pyx_Import(__pyx_n_s_infra, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_n_s_infra, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHA, __pyx_t_3) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHA, __pyx_t_3) < 0) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHANUMERIC, __pyx_t_3) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHANUMERIC, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_HEX_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_HEX_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE, __pyx_t_3) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE, __pyx_t_3) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_WHITESPACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_WHITESPACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_WHITESPACE, __pyx_t_3) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_WHITESPACE, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_OR_SPACE, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_OR_SPACE, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":22 + /* "w3lib/_url.pyx":24 + * ) + * from ._rfc2396 import ( + * _RFC2396_ABS_PATH_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * _RFC2396_FRAGMENT_PERCENT_ENCODE_SET, + * _RFC2396_QUERY_PERCENT_ENCODE_SET, + */ + __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); + __Pyx_GIVEREF(__pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE)) __PYX_ERR(0, 24, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); + __Pyx_GIVEREF(__pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE)) __PYX_ERR(0, 24, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); + __Pyx_GIVEREF(__pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE)) __PYX_ERR(0, 24, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); + __Pyx_GIVEREF(__pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE)) __PYX_ERR(0, 24, __pyx_L1_error); + + /* "w3lib/_url.pyx":23 * _C0_CONTROL_OR_SPACE, * ) + * from ._rfc2396 import ( # <<<<<<<<<<<<<< + * _RFC2396_ABS_PATH_PERCENT_ENCODE_SET, + * _RFC2396_FRAGMENT_PERCENT_ENCODE_SET, + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_rfc2396, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":30 + * ) + * from ._rfc3986 import ( + * _RFC3986_FRAGMENT_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< + * _RFC3986_PATH_PERCENT_ENCODE_SET, + * _RFC3986_QUERY_PERCENT_ENCODE_SET, + */ + __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); + __Pyx_GIVEREF(__pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE)) __PYX_ERR(0, 30, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); + __Pyx_GIVEREF(__pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET)) __PYX_ERR(0, 30, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); + __Pyx_GIVEREF(__pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE)) __PYX_ERR(0, 30, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); + __Pyx_GIVEREF(__pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE)) __PYX_ERR(0, 30, __pyx_L1_error); + + /* "w3lib/_url.pyx":29 + * _RFC2396_USERINFO_PERCENT_ENCODE_SET, + * ) + * from ._rfc3986 import ( # <<<<<<<<<<<<<< + * _RFC3986_FRAGMENT_PERCENT_ENCODE_SET, + * _RFC3986_PATH_PERCENT_ENCODE_SET, + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_rfc3986, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE, __pyx_t_3) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":35 + * _RFC3986_USERINFO_PERCENT_ENCODE_SET, + * ) * from ._util import _PercentEncodeSet # <<<<<<<<<<<<<< * - * + * # https://encoding.spec.whatwg.org/ */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PercentEncodeSet); __Pyx_GIVEREF(__pyx_n_s_PercentEncodeSet); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PercentEncodeSet)) __PYX_ERR(0, 22, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_util, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PercentEncodeSet)) __PYX_ERR(0, 35, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_util, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PercentEncodeSet, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PercentEncodeSet, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":27 + /* "w3lib/_url.pyx":39 * # https://encoding.spec.whatwg.org/ * * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] # <<<<<<<<<<<<<< * DecodeFunction = Callable[[bytes], Tuple[str, int]] * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyInt_Type)); __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 27, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 39, __pyx_L1_error); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CodecFunction, __pyx_t_5) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CodecFunction, __pyx_t_5) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":28 + /* "w3lib/_url.pyx":40 * * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] * DecodeFunction = Callable[[bytes], Tuple[str, int]] # <<<<<<<<<<<<<< * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] * */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Callable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Callable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)(&PyBytes_Type)); __Pyx_GIVEREF((PyObject *)(&PyBytes_Type)); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 28, __pyx_L1_error); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 40, __pyx_L1_error); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 28, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 40, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyInt_Type)); __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 28, __pyx_L1_error); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 40, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(0, 28, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(0, 40, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DecodeFunction, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DecodeFunction, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":29 + /* "w3lib/_url.pyx":41 * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] * DecodeFunction = Callable[[bytes], Tuple[str, int]] * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 29, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 41, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 29, __pyx_L1_error); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 29, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 41, __pyx_L1_error); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)(&PyBytes_Type)); __Pyx_GIVEREF((PyObject *)(&PyBytes_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 29, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 41, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyInt_Type)); __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 29, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 41, __pyx_L1_error); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_EncodeFunction, __pyx_t_3) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EncodeFunction, __pyx_t_3) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":32 + /* "w3lib/_url.pyx":44 * * * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< * return { * label: f"windows-125{last_digit}" */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_last_digit, __pyx_n_s_int) < 0) __PYX_ERR(0, 32, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Dict_str_str) < 0) __PYX_ERR(0, 32, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_1_short_windows_125, 0, __pyx_n_s_short_windows_125, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_last_digit, __pyx_n_s_int) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Dict_str_str) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_1_short_windows_125, 0, __pyx_n_s_short_windows_125, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_short_windows_125, __pyx_t_6) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_short_windows_125, __pyx_t_6) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":43 + /* "w3lib/_url.pyx":55 * * * _REPLACEMENT_ENCODING = "replacement" # <<<<<<<<<<<<<< * _UTF_8_ENCODING = "utf-8" * _UTF_16BE_ENCODING = "utf-16be" */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_REPLACEMENT_ENCODING, __pyx_n_u_replacement) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_REPLACEMENT_ENCODING, __pyx_n_u_replacement) < 0) __PYX_ERR(0, 55, __pyx_L1_error) - /* "w3lib/_url.pyx":44 + /* "w3lib/_url.pyx":56 * * _REPLACEMENT_ENCODING = "replacement" * _UTF_8_ENCODING = "utf-8" # <<<<<<<<<<<<<< * _UTF_16BE_ENCODING = "utf-16be" * _UTF_16LE_ENCODING = "utf-16le" */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODING, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODING, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 56, __pyx_L1_error) - /* "w3lib/_url.pyx":45 + /* "w3lib/_url.pyx":57 * _REPLACEMENT_ENCODING = "replacement" * _UTF_8_ENCODING = "utf-8" * _UTF_16BE_ENCODING = "utf-16be" # <<<<<<<<<<<<<< * _UTF_16LE_ENCODING = "utf-16le" * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_16BE_ENCODING, __pyx_kp_u_utf_16be) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_16BE_ENCODING, __pyx_kp_u_utf_16be) < 0) __PYX_ERR(0, 57, __pyx_L1_error) - /* "w3lib/_url.pyx":46 + /* "w3lib/_url.pyx":58 * _UTF_8_ENCODING = "utf-8" * _UTF_16BE_ENCODING = "utf-16be" * _UTF_16LE_ENCODING = "utf-16le" # <<<<<<<<<<<<<< * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_16LE_ENCODING, __pyx_kp_u_utf_16le) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_16LE_ENCODING, __pyx_kp_u_utf_16le) < 0) __PYX_ERR(0, 58, __pyx_L1_error) - /* "w3lib/_url.pyx":52 + /* "w3lib/_url.pyx":64 * # Maps the labels defined in the standard to an encoding label that Python * # understands. * _LABEL_ENCODINGS = { # <<<<<<<<<<<<<< @@ -25423,17 +26154,17 @@ if (!__Pyx_RefNanny) { */ { /* enter inner scope */ - /* "w3lib/_url.pyx":53 + /* "w3lib/_url.pyx":65 * # understands. * _LABEL_ENCODINGS = { * **{ # <<<<<<<<<<<<<< * label: _UTF_8_ENCODING * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L4_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":55 + /* "w3lib/_url.pyx":67 * **{ * label: _UTF_8_ENCODING * for label in ( # <<<<<<<<<<<<<< @@ -25445,9 +26176,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 6) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 55, __pyx_L4_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 67, __pyx_L4_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L4_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_5w3lib_4_url_label); @@ -25455,19 +26186,19 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":54 + /* "w3lib/_url.pyx":66 * _LABEL_ENCODINGS = { * **{ * label: _UTF_8_ENCODING # <<<<<<<<<<<<<< * for label in ( * "unicode-1-1-utf-8", */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_8_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L4_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_8_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr1__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 54, __pyx_L4_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr1__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 66, __pyx_L4_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":55 + /* "w3lib/_url.pyx":67 * **{ * label: _UTF_8_ENCODING * for label in ( # <<<<<<<<<<<<<< @@ -25485,22 +26216,22 @@ if (!__Pyx_RefNanny) { goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ - __pyx_t_6 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_6 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":64 + /* "w3lib/_url.pyx":76 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "ibm866" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L11_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":66 + /* "w3lib/_url.pyx":78 * **{ * label: "ibm866" * for label in ( # <<<<<<<<<<<<<< @@ -25512,9 +26243,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 4) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 66, __pyx_L11_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 78, __pyx_L11_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L11_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr2__pyx_v_5w3lib_4_url_label); @@ -25522,16 +26253,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":65 + /* "w3lib/_url.pyx":77 * }, * **{ * label: "ibm866" # <<<<<<<<<<<<<< * for label in ( * "866", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr2__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_ibm866))) __PYX_ERR(0, 65, __pyx_L11_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr2__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_ibm866))) __PYX_ERR(0, 77, __pyx_L11_error) - /* "w3lib/_url.pyx":66 + /* "w3lib/_url.pyx":78 * **{ * label: "ibm866" * for label in ( # <<<<<<<<<<<<<< @@ -25551,22 +26282,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 64, __pyx_L1_error) + __PYX_ERR(0, 76, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":73 + /* "w3lib/_url.pyx":85 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-2" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L18_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":75 + /* "w3lib/_url.pyx":87 * **{ * label: "iso-8859-2" * for label in ( # <<<<<<<<<<<<<< @@ -25578,9 +26309,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 9) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 75, __pyx_L18_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 87, __pyx_L18_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L18_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr3__pyx_v_5w3lib_4_url_label); @@ -25588,16 +26319,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":74 + /* "w3lib/_url.pyx":86 * }, * **{ * label: "iso-8859-2" # <<<<<<<<<<<<<< * for label in ( * "csisolatin2", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr3__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_2))) __PYX_ERR(0, 74, __pyx_L18_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr3__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_2))) __PYX_ERR(0, 86, __pyx_L18_error) - /* "w3lib/_url.pyx":75 + /* "w3lib/_url.pyx":87 * **{ * label: "iso-8859-2" * for label in ( # <<<<<<<<<<<<<< @@ -25617,22 +26348,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 73, __pyx_L1_error) + __PYX_ERR(0, 85, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":87 + /* "w3lib/_url.pyx":99 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-3" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L25_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":89 + /* "w3lib/_url.pyx":101 * **{ * label: "iso-8859-3" * for label in ( # <<<<<<<<<<<<<< @@ -25644,9 +26375,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 9) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 89, __pyx_L25_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 101, __pyx_L25_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L25_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr4__pyx_v_5w3lib_4_url_label); @@ -25654,16 +26385,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":88 + /* "w3lib/_url.pyx":100 * }, * **{ * label: "iso-8859-3" # <<<<<<<<<<<<<< * for label in ( * "csisolatin3", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr4__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_3))) __PYX_ERR(0, 88, __pyx_L25_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr4__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_3))) __PYX_ERR(0, 100, __pyx_L25_error) - /* "w3lib/_url.pyx":89 + /* "w3lib/_url.pyx":101 * **{ * label: "iso-8859-3" * for label in ( # <<<<<<<<<<<<<< @@ -25683,22 +26414,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 87, __pyx_L1_error) + __PYX_ERR(0, 99, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":101 + /* "w3lib/_url.pyx":113 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-4" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L32_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":103 + /* "w3lib/_url.pyx":115 * **{ * label: "iso-8859-4" * for label in ( # <<<<<<<<<<<<<< @@ -25710,9 +26441,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 9) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 103, __pyx_L32_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 115, __pyx_L32_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L32_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr5__pyx_v_5w3lib_4_url_label); @@ -25720,16 +26451,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":102 + /* "w3lib/_url.pyx":114 * }, * **{ * label: "iso-8859-4" # <<<<<<<<<<<<<< * for label in ( * "csisolatin4", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr5__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_4))) __PYX_ERR(0, 102, __pyx_L32_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr5__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_4))) __PYX_ERR(0, 114, __pyx_L32_error) - /* "w3lib/_url.pyx":103 + /* "w3lib/_url.pyx":115 * **{ * label: "iso-8859-4" * for label in ( # <<<<<<<<<<<<<< @@ -25749,22 +26480,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 101, __pyx_L1_error) + __PYX_ERR(0, 113, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":115 + /* "w3lib/_url.pyx":127 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-5" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L39_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L39_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":117 + /* "w3lib/_url.pyx":129 * **{ * label: "iso-8859-5" * for label in ( # <<<<<<<<<<<<<< @@ -25776,9 +26507,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 8) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 117, __pyx_L39_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 129, __pyx_L39_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L39_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L39_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr6__pyx_v_5w3lib_4_url_label); @@ -25786,16 +26517,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":116 + /* "w3lib/_url.pyx":128 * }, * **{ * label: "iso-8859-5" # <<<<<<<<<<<<<< * for label in ( * "csisolatincyrillic", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr6__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_5))) __PYX_ERR(0, 116, __pyx_L39_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr6__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_5))) __PYX_ERR(0, 128, __pyx_L39_error) - /* "w3lib/_url.pyx":117 + /* "w3lib/_url.pyx":129 * **{ * label: "iso-8859-5" * for label in ( # <<<<<<<<<<<<<< @@ -25815,22 +26546,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 115, __pyx_L1_error) + __PYX_ERR(0, 127, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":128 + /* "w3lib/_url.pyx":140 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-6" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L46_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L46_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":130 + /* "w3lib/_url.pyx":142 * **{ * label: "iso-8859-6" * for label in ( # <<<<<<<<<<<<<< @@ -25842,9 +26573,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 14) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 130, __pyx_L46_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 142, __pyx_L46_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L46_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L46_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr7__pyx_v_5w3lib_4_url_label); @@ -25852,16 +26583,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":129 + /* "w3lib/_url.pyx":141 * }, * **{ * label: "iso-8859-6" # <<<<<<<<<<<<<< * for label in ( * "arabic", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr7__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_6))) __PYX_ERR(0, 129, __pyx_L46_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr7__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_6))) __PYX_ERR(0, 141, __pyx_L46_error) - /* "w3lib/_url.pyx":130 + /* "w3lib/_url.pyx":142 * **{ * label: "iso-8859-6" * for label in ( # <<<<<<<<<<<<<< @@ -25881,22 +26612,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 128, __pyx_L1_error) + __PYX_ERR(0, 140, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":147 + /* "w3lib/_url.pyx":159 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-7" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L53_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":149 + /* "w3lib/_url.pyx":161 * **{ * label: "iso-8859-7" * for label in ( # <<<<<<<<<<<<<< @@ -25908,9 +26639,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 12) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 149, __pyx_L53_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 161, __pyx_L53_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L53_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr8__pyx_v_5w3lib_4_url_label); @@ -25918,16 +26649,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":148 + /* "w3lib/_url.pyx":160 * }, * **{ * label: "iso-8859-7" # <<<<<<<<<<<<<< * for label in ( * "csisolatingreek", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr8__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_7))) __PYX_ERR(0, 148, __pyx_L53_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr8__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_7))) __PYX_ERR(0, 160, __pyx_L53_error) - /* "w3lib/_url.pyx":149 + /* "w3lib/_url.pyx":161 * **{ * label: "iso-8859-7" * for label in ( # <<<<<<<<<<<<<< @@ -25947,22 +26678,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 147, __pyx_L1_error) + __PYX_ERR(0, 159, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":164 + /* "w3lib/_url.pyx":176 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-8" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L60_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":166 + /* "w3lib/_url.pyx":178 * **{ * label: "iso-8859-8" * for label in ( # <<<<<<<<<<<<<< @@ -25974,9 +26705,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 11) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 166, __pyx_L60_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 178, __pyx_L60_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L60_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr9__pyx_v_5w3lib_4_url_label); @@ -25984,16 +26715,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":165 + /* "w3lib/_url.pyx":177 * }, * **{ * label: "iso-8859-8" # <<<<<<<<<<<<<< * for label in ( * "csiso88598e", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr9__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_8))) __PYX_ERR(0, 165, __pyx_L60_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr9__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_8))) __PYX_ERR(0, 177, __pyx_L60_error) - /* "w3lib/_url.pyx":166 + /* "w3lib/_url.pyx":178 * **{ * label: "iso-8859-8" * for label in ( # <<<<<<<<<<<<<< @@ -26013,22 +26744,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 164, __pyx_L1_error) + __PYX_ERR(0, 176, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":180 + /* "w3lib/_url.pyx":192 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-8-i" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L67_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":182 + /* "w3lib/_url.pyx":194 * **{ * label: "iso-8859-8-i" * for label in ( # <<<<<<<<<<<<<< @@ -26040,9 +26771,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 3) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 182, __pyx_L67_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 194, __pyx_L67_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L67_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr10__pyx_v_5w3lib_4_url_label); @@ -26050,16 +26781,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":181 + /* "w3lib/_url.pyx":193 * }, * **{ * label: "iso-8859-8-i" # <<<<<<<<<<<<<< * for label in ( * "csiso88598i", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr10__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_8_i))) __PYX_ERR(0, 181, __pyx_L67_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr10__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_8_i))) __PYX_ERR(0, 193, __pyx_L67_error) - /* "w3lib/_url.pyx":182 + /* "w3lib/_url.pyx":194 * **{ * label: "iso-8859-8-i" * for label in ( # <<<<<<<<<<<<<< @@ -26079,22 +26810,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 180, __pyx_L1_error) + __PYX_ERR(0, 192, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":188 + /* "w3lib/_url.pyx":200 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-10" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L74_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L74_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":190 + /* "w3lib/_url.pyx":202 * **{ * label: "iso-8859-10" * for label in ( # <<<<<<<<<<<<<< @@ -26106,9 +26837,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 7) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 190, __pyx_L74_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 202, __pyx_L74_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L74_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L74_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr11__pyx_v_5w3lib_4_url_label); @@ -26116,16 +26847,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":189 + /* "w3lib/_url.pyx":201 * }, * **{ * label: "iso-8859-10" # <<<<<<<<<<<<<< * for label in ( * "csisolatin6", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr11__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_10))) __PYX_ERR(0, 189, __pyx_L74_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr11__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_10))) __PYX_ERR(0, 201, __pyx_L74_error) - /* "w3lib/_url.pyx":190 + /* "w3lib/_url.pyx":202 * **{ * label: "iso-8859-10" * for label in ( # <<<<<<<<<<<<<< @@ -26145,22 +26876,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 188, __pyx_L1_error) + __PYX_ERR(0, 200, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":200 + /* "w3lib/_url.pyx":212 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-10" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L81_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L81_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":202 + /* "w3lib/_url.pyx":214 * **{ * label: "iso-8859-10" * for label in ( # <<<<<<<<<<<<<< @@ -26172,9 +26903,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 7) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 202, __pyx_L81_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 214, __pyx_L81_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L81_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L81_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr12__pyx_v_5w3lib_4_url_label); @@ -26182,16 +26913,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":201 + /* "w3lib/_url.pyx":213 * }, * **{ * label: "iso-8859-10" # <<<<<<<<<<<<<< * for label in ( * "csisolatin6", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr12__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_10))) __PYX_ERR(0, 201, __pyx_L81_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr12__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_10))) __PYX_ERR(0, 213, __pyx_L81_error) - /* "w3lib/_url.pyx":202 + /* "w3lib/_url.pyx":214 * **{ * label: "iso-8859-10" * for label in ( # <<<<<<<<<<<<<< @@ -26211,22 +26942,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 200, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":212 + /* "w3lib/_url.pyx":224 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-13" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L88_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L88_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":214 + /* "w3lib/_url.pyx":226 * **{ * label: "iso-8859-13" * for label in ( # <<<<<<<<<<<<<< @@ -26238,9 +26969,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 3) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 214, __pyx_L88_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 226, __pyx_L88_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L88_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L88_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr13__pyx_v_5w3lib_4_url_label); @@ -26248,16 +26979,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":213 + /* "w3lib/_url.pyx":225 * }, * **{ * label: "iso-8859-13" # <<<<<<<<<<<<<< * for label in ( * "iso-8859-13", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr13__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_13))) __PYX_ERR(0, 213, __pyx_L88_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr13__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_13))) __PYX_ERR(0, 225, __pyx_L88_error) - /* "w3lib/_url.pyx":214 + /* "w3lib/_url.pyx":226 * **{ * label: "iso-8859-13" * for label in ( # <<<<<<<<<<<<<< @@ -26277,22 +27008,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 212, __pyx_L1_error) + __PYX_ERR(0, 224, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":220 + /* "w3lib/_url.pyx":232 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-14" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L95_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L95_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":222 + /* "w3lib/_url.pyx":234 * **{ * label: "iso-8859-14" * for label in ( # <<<<<<<<<<<<<< @@ -26304,9 +27035,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 3) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 222, __pyx_L95_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 234, __pyx_L95_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L95_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L95_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr14__pyx_v_5w3lib_4_url_label); @@ -26314,16 +27045,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":221 + /* "w3lib/_url.pyx":233 * }, * **{ * label: "iso-8859-14" # <<<<<<<<<<<<<< * for label in ( * "iso-8859-14", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr14__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_14))) __PYX_ERR(0, 221, __pyx_L95_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr14__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_14))) __PYX_ERR(0, 233, __pyx_L95_error) - /* "w3lib/_url.pyx":222 + /* "w3lib/_url.pyx":234 * **{ * label: "iso-8859-14" * for label in ( # <<<<<<<<<<<<<< @@ -26343,22 +27074,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 220, __pyx_L1_error) + __PYX_ERR(0, 232, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":228 + /* "w3lib/_url.pyx":240 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-15" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L102_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L102_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":230 + /* "w3lib/_url.pyx":242 * **{ * label: "iso-8859-15" * for label in ( # <<<<<<<<<<<<<< @@ -26370,9 +27101,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 6) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 230, __pyx_L102_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 242, __pyx_L102_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L102_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L102_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr15__pyx_v_5w3lib_4_url_label); @@ -26380,16 +27111,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":229 + /* "w3lib/_url.pyx":241 * }, * **{ * label: "iso-8859-15" # <<<<<<<<<<<<<< * for label in ( * "csisolatin9", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr15__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_15))) __PYX_ERR(0, 229, __pyx_L102_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr15__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_15))) __PYX_ERR(0, 241, __pyx_L102_error) - /* "w3lib/_url.pyx":230 + /* "w3lib/_url.pyx":242 * **{ * label: "iso-8859-15" * for label in ( # <<<<<<<<<<<<<< @@ -26409,23 +27140,23 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 228, __pyx_L1_error) + __PYX_ERR(0, 240, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_kp_u_iso_8859_16, __pyx_kp_u_iso_8859_16) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_kp_u_iso_8859_16, __pyx_kp_u_iso_8859_16) < 0) __PYX_ERR(0, 251, __pyx_L1_error) { /* enter inner scope */ - /* "w3lib/_url.pyx":240 + /* "w3lib/_url.pyx":252 * }, * "iso-8859-16": "iso-8859-16", * **{ # <<<<<<<<<<<<<< * label: "koi8-r" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L109_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L109_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":242 + /* "w3lib/_url.pyx":254 * **{ * label: "koi8-r" * for label in ( # <<<<<<<<<<<<<< @@ -26437,9 +27168,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 5) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 242, __pyx_L109_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 254, __pyx_L109_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L109_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L109_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr16__pyx_v_5w3lib_4_url_label); @@ -26447,16 +27178,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":241 + /* "w3lib/_url.pyx":253 * "iso-8859-16": "iso-8859-16", * **{ * label: "koi8-r" # <<<<<<<<<<<<<< * for label in ( * "cskoi8r", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr16__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_koi8_r))) __PYX_ERR(0, 241, __pyx_L109_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr16__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_koi8_r))) __PYX_ERR(0, 253, __pyx_L109_error) - /* "w3lib/_url.pyx":242 + /* "w3lib/_url.pyx":254 * **{ * label: "koi8-r" * for label in ( # <<<<<<<<<<<<<< @@ -26476,22 +27207,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 240, __pyx_L1_error) + __PYX_ERR(0, 252, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":250 + /* "w3lib/_url.pyx":262 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "koi8-u" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L116_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":252 + /* "w3lib/_url.pyx":264 * **{ * label: "koi8-u" * for label in ( # <<<<<<<<<<<<<< @@ -26503,9 +27234,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 2) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 252, __pyx_L116_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 264, __pyx_L116_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L116_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr17__pyx_v_5w3lib_4_url_label); @@ -26513,16 +27244,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":251 + /* "w3lib/_url.pyx":263 * }, * **{ * label: "koi8-u" # <<<<<<<<<<<<<< * for label in ( * "koi8-ru", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr17__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_koi8_u))) __PYX_ERR(0, 251, __pyx_L116_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr17__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_koi8_u))) __PYX_ERR(0, 263, __pyx_L116_error) - /* "w3lib/_url.pyx":252 + /* "w3lib/_url.pyx":264 * **{ * label: "koi8-u" * for label in ( # <<<<<<<<<<<<<< @@ -26542,22 +27273,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 250, __pyx_L1_error) + __PYX_ERR(0, 262, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":257 + /* "w3lib/_url.pyx":269 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "macintosh" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L123_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L123_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":259 + /* "w3lib/_url.pyx":271 * **{ * label: "macintosh" * for label in ( # <<<<<<<<<<<<<< @@ -26569,9 +27300,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 4) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 259, __pyx_L123_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 271, __pyx_L123_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L123_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L123_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr18__pyx_v_5w3lib_4_url_label); @@ -26579,16 +27310,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":258 + /* "w3lib/_url.pyx":270 * }, * **{ * label: "macintosh" # <<<<<<<<<<<<<< * for label in ( * "csmacintosh", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr18__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_macintosh))) __PYX_ERR(0, 258, __pyx_L123_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr18__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_macintosh))) __PYX_ERR(0, 270, __pyx_L123_error) - /* "w3lib/_url.pyx":259 + /* "w3lib/_url.pyx":271 * **{ * label: "macintosh" * for label in ( # <<<<<<<<<<<<<< @@ -26608,22 +27339,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 257, __pyx_L1_error) + __PYX_ERR(0, 269, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":266 + /* "w3lib/_url.pyx":278 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "cp874" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L130_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L130_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":268 + /* "w3lib/_url.pyx":280 * **{ * label: "cp874" * for label in ( # <<<<<<<<<<<<<< @@ -26635,9 +27366,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 6) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 268, __pyx_L130_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 280, __pyx_L130_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L130_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L130_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr19__pyx_v_5w3lib_4_url_label); @@ -26645,16 +27376,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":267 + /* "w3lib/_url.pyx":279 * }, * **{ * label: "cp874" # <<<<<<<<<<<<<< * for label in ( * "dos-874", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr19__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_cp874))) __PYX_ERR(0, 267, __pyx_L130_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr19__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_cp874))) __PYX_ERR(0, 279, __pyx_L130_error) - /* "w3lib/_url.pyx":268 + /* "w3lib/_url.pyx":280 * **{ * label: "cp874" * for label in ( # <<<<<<<<<<<<<< @@ -26674,66 +27405,66 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 266, __pyx_L1_error) + __PYX_ERR(0, 278, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":277 + /* "w3lib/_url.pyx":289 * ) * }, * **_short_windows_125(0), # <<<<<<<<<<<<<< * **_short_windows_125(1), * **{ */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 277, __pyx_L1_error) + __PYX_ERR(0, 289, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 277, __pyx_L1_error) + __PYX_ERR(0, 289, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":278 + /* "w3lib/_url.pyx":290 * }, * **_short_windows_125(0), * **_short_windows_125(1), # <<<<<<<<<<<<<< * **{ * label: "windows-1252" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 278, __pyx_L1_error) + __PYX_ERR(0, 290, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 278, __pyx_L1_error) + __PYX_ERR(0, 290, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":279 + /* "w3lib/_url.pyx":291 * **_short_windows_125(0), * **_short_windows_125(1), * **{ # <<<<<<<<<<<<<< * label: "windows-1252" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L137_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L137_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":281 + /* "w3lib/_url.pyx":293 * **{ * label: "windows-1252" * for label in ( # <<<<<<<<<<<<<< @@ -26745,9 +27476,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 17) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 281, __pyx_L137_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 293, __pyx_L137_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L137_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L137_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr20__pyx_v_5w3lib_4_url_label); @@ -26755,16 +27486,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":280 + /* "w3lib/_url.pyx":292 * **_short_windows_125(1), * **{ * label: "windows-1252" # <<<<<<<<<<<<<< * for label in ( * "ansi_x3.4-1968", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr20__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_windows_1252))) __PYX_ERR(0, 280, __pyx_L137_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr20__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_windows_1252))) __PYX_ERR(0, 292, __pyx_L137_error) - /* "w3lib/_url.pyx":281 + /* "w3lib/_url.pyx":293 * **{ * label: "windows-1252" * for label in ( # <<<<<<<<<<<<<< @@ -26784,44 +27515,44 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 279, __pyx_L1_error) + __PYX_ERR(0, 291, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":301 + /* "w3lib/_url.pyx":313 * ) * }, * **_short_windows_125(3), # <<<<<<<<<<<<<< * **{ * label: "windows-1254" */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 301, __pyx_L1_error) + __PYX_ERR(0, 313, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 301, __pyx_L1_error) + __PYX_ERR(0, 313, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":302 + /* "w3lib/_url.pyx":314 * }, * **_short_windows_125(3), * **{ # <<<<<<<<<<<<<< * label: "windows-1254" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L144_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L144_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":304 + /* "w3lib/_url.pyx":316 * **{ * label: "windows-1254" * for label in ( # <<<<<<<<<<<<<< @@ -26833,9 +27564,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 12) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 304, __pyx_L144_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 316, __pyx_L144_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L144_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L144_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr21__pyx_v_5w3lib_4_url_label); @@ -26843,16 +27574,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":303 + /* "w3lib/_url.pyx":315 * **_short_windows_125(3), * **{ * label: "windows-1254" # <<<<<<<<<<<<<< * for label in ( * "cp1254", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr21__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_windows_1254))) __PYX_ERR(0, 303, __pyx_L144_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr21__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_windows_1254))) __PYX_ERR(0, 315, __pyx_L144_error) - /* "w3lib/_url.pyx":304 + /* "w3lib/_url.pyx":316 * **{ * label: "windows-1254" * for label in ( # <<<<<<<<<<<<<< @@ -26872,110 +27603,110 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 302, __pyx_L1_error) + __PYX_ERR(0, 314, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":319 + /* "w3lib/_url.pyx":331 * ) * }, * **_short_windows_125(5), # <<<<<<<<<<<<<< * **_short_windows_125(6), * **_short_windows_125(7), */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 319, __pyx_L1_error) + __PYX_ERR(0, 331, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 319, __pyx_L1_error) + __PYX_ERR(0, 331, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":320 + /* "w3lib/_url.pyx":332 * }, * **_short_windows_125(5), * **_short_windows_125(6), # <<<<<<<<<<<<<< * **_short_windows_125(7), * **_short_windows_125(8), */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 320, __pyx_L1_error) + __PYX_ERR(0, 332, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 320, __pyx_L1_error) + __PYX_ERR(0, 332, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":321 + /* "w3lib/_url.pyx":333 * **_short_windows_125(5), * **_short_windows_125(6), * **_short_windows_125(7), # <<<<<<<<<<<<<< * **_short_windows_125(8), * **{ */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 321, __pyx_L1_error) + __PYX_ERR(0, 333, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 321, __pyx_L1_error) + __PYX_ERR(0, 333, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":322 + /* "w3lib/_url.pyx":334 * **_short_windows_125(6), * **_short_windows_125(7), * **_short_windows_125(8), # <<<<<<<<<<<<<< * **{ * label: "mac-cyrillic" */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 322, __pyx_L1_error) + __PYX_ERR(0, 334, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 322, __pyx_L1_error) + __PYX_ERR(0, 334, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":323 + /* "w3lib/_url.pyx":335 * **_short_windows_125(7), * **_short_windows_125(8), * **{ # <<<<<<<<<<<<<< * label: "mac-cyrillic" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L151_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L151_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":325 + /* "w3lib/_url.pyx":337 * **{ * label: "mac-cyrillic" * for label in ( # <<<<<<<<<<<<<< @@ -26987,9 +27718,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 2) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 325, __pyx_L151_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 337, __pyx_L151_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L151_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L151_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr22__pyx_v_5w3lib_4_url_label); @@ -26997,16 +27728,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":324 + /* "w3lib/_url.pyx":336 * **_short_windows_125(8), * **{ * label: "mac-cyrillic" # <<<<<<<<<<<<<< * for label in ( * "x-mac-cyrillic", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr22__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_mac_cyrillic))) __PYX_ERR(0, 324, __pyx_L151_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr22__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_mac_cyrillic))) __PYX_ERR(0, 336, __pyx_L151_error) - /* "w3lib/_url.pyx":325 + /* "w3lib/_url.pyx":337 * **{ * label: "mac-cyrillic" * for label in ( # <<<<<<<<<<<<<< @@ -27026,22 +27757,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 323, __pyx_L1_error) + __PYX_ERR(0, 335, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":330 + /* "w3lib/_url.pyx":342 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "gbk" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L158_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L158_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":332 + /* "w3lib/_url.pyx":344 * **{ * label: "gbk" * for label in ( # <<<<<<<<<<<<<< @@ -27053,9 +27784,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 9) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 332, __pyx_L158_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 344, __pyx_L158_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L158_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L158_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr23__pyx_v_5w3lib_4_url_label); @@ -27063,16 +27794,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":331 + /* "w3lib/_url.pyx":343 * }, * **{ * label: "gbk" # <<<<<<<<<<<<<< * for label in ( * "chinese", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr23__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_gbk))) __PYX_ERR(0, 331, __pyx_L158_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr23__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_gbk))) __PYX_ERR(0, 343, __pyx_L158_error) - /* "w3lib/_url.pyx":332 + /* "w3lib/_url.pyx":344 * **{ * label: "gbk" * for label in ( # <<<<<<<<<<<<<< @@ -27092,23 +27823,23 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 330, __pyx_L1_error) + __PYX_ERR(0, 342, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_gb18030, __pyx_n_u_gb18030) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_gb18030, __pyx_n_u_gb18030) < 0) __PYX_ERR(0, 356, __pyx_L1_error) { /* enter inner scope */ - /* "w3lib/_url.pyx":345 + /* "w3lib/_url.pyx":357 * }, * "gb18030": "gb18030", * **{ # <<<<<<<<<<<<<< * label: "big5" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L165_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L165_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":347 + /* "w3lib/_url.pyx":359 * **{ * label: "big5" * for label in ( # <<<<<<<<<<<<<< @@ -27120,9 +27851,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 5) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 347, __pyx_L165_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 359, __pyx_L165_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L165_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L165_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr24__pyx_v_5w3lib_4_url_label); @@ -27130,16 +27861,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":346 + /* "w3lib/_url.pyx":358 * "gb18030": "gb18030", * **{ * label: "big5" # <<<<<<<<<<<<<< * for label in ( * "big5", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr24__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_big5))) __PYX_ERR(0, 346, __pyx_L165_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr24__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_big5))) __PYX_ERR(0, 358, __pyx_L165_error) - /* "w3lib/_url.pyx":347 + /* "w3lib/_url.pyx":359 * **{ * label: "big5" * for label in ( # <<<<<<<<<<<<<< @@ -27159,22 +27890,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 345, __pyx_L1_error) + __PYX_ERR(0, 357, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":355 + /* "w3lib/_url.pyx":367 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "euc-jp" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L172_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L172_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":357 + /* "w3lib/_url.pyx":369 * **{ * label: "euc-jp" * for label in ( # <<<<<<<<<<<<<< @@ -27186,9 +27917,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 3) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 357, __pyx_L172_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 369, __pyx_L172_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L172_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L172_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr25__pyx_v_5w3lib_4_url_label); @@ -27196,16 +27927,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":356 + /* "w3lib/_url.pyx":368 * }, * **{ * label: "euc-jp" # <<<<<<<<<<<<<< * for label in ( * "cseucpkdfmtjapanese", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr25__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_euc_jp))) __PYX_ERR(0, 356, __pyx_L172_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr25__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_euc_jp))) __PYX_ERR(0, 368, __pyx_L172_error) - /* "w3lib/_url.pyx":357 + /* "w3lib/_url.pyx":369 * **{ * label: "euc-jp" * for label in ( # <<<<<<<<<<<<<< @@ -27225,22 +27956,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 355, __pyx_L1_error) + __PYX_ERR(0, 367, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":363 + /* "w3lib/_url.pyx":375 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-2022-jp" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L179_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L179_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":365 + /* "w3lib/_url.pyx":377 * **{ * label: "iso-2022-jp" * for label in ( # <<<<<<<<<<<<<< @@ -27252,9 +27983,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 2) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 365, __pyx_L179_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 377, __pyx_L179_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L179_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L179_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr26__pyx_v_5w3lib_4_url_label); @@ -27262,16 +27993,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":364 + /* "w3lib/_url.pyx":376 * }, * **{ * label: "iso-2022-jp" # <<<<<<<<<<<<<< * for label in ( * "csiso2022jp", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr26__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_2022_jp))) __PYX_ERR(0, 364, __pyx_L179_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr26__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_2022_jp))) __PYX_ERR(0, 376, __pyx_L179_error) - /* "w3lib/_url.pyx":365 + /* "w3lib/_url.pyx":377 * **{ * label: "iso-2022-jp" * for label in ( # <<<<<<<<<<<<<< @@ -27291,22 +28022,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 363, __pyx_L1_error) + __PYX_ERR(0, 375, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":370 + /* "w3lib/_url.pyx":382 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "shift_jis" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L186_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L186_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":372 + /* "w3lib/_url.pyx":384 * **{ * label: "shift_jis" * for label in ( # <<<<<<<<<<<<<< @@ -27318,9 +28049,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 8) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 372, __pyx_L186_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 384, __pyx_L186_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L186_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L186_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr27__pyx_v_5w3lib_4_url_label); @@ -27328,16 +28059,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":371 + /* "w3lib/_url.pyx":383 * }, * **{ * label: "shift_jis" # <<<<<<<<<<<<<< * for label in ( * "csshiftjis", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr27__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_shift_jis_2))) __PYX_ERR(0, 371, __pyx_L186_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr27__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_shift_jis_2))) __PYX_ERR(0, 383, __pyx_L186_error) - /* "w3lib/_url.pyx":372 + /* "w3lib/_url.pyx":384 * **{ * label: "shift_jis" * for label in ( # <<<<<<<<<<<<<< @@ -27357,22 +28088,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 370, __pyx_L1_error) + __PYX_ERR(0, 382, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":383 + /* "w3lib/_url.pyx":395 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "euc-kr" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L193_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L193_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":385 + /* "w3lib/_url.pyx":397 * **{ * label: "euc-kr" * for label in ( # <<<<<<<<<<<<<< @@ -27384,9 +28115,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 10) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 385, __pyx_L193_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 397, __pyx_L193_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L193_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L193_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr28__pyx_v_5w3lib_4_url_label); @@ -27394,16 +28125,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":384 + /* "w3lib/_url.pyx":396 * }, * **{ * label: "euc-kr" # <<<<<<<<<<<<<< * for label in ( * "cseuckr", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr28__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_euc_kr))) __PYX_ERR(0, 384, __pyx_L193_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr28__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_euc_kr))) __PYX_ERR(0, 396, __pyx_L193_error) - /* "w3lib/_url.pyx":385 + /* "w3lib/_url.pyx":397 * **{ * label: "euc-kr" * for label in ( # <<<<<<<<<<<<<< @@ -27423,22 +28154,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 383, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":398 + /* "w3lib/_url.pyx":410 * ) * }, * **{ # <<<<<<<<<<<<<< * label: _REPLACEMENT_ENCODING * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L200_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L200_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":400 + /* "w3lib/_url.pyx":412 * **{ * label: _REPLACEMENT_ENCODING * for label in ( # <<<<<<<<<<<<<< @@ -27450,9 +28181,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 6) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 400, __pyx_L200_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 412, __pyx_L200_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L200_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L200_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr29__pyx_v_5w3lib_4_url_label); @@ -27460,19 +28191,19 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":399 + /* "w3lib/_url.pyx":411 * }, * **{ * label: _REPLACEMENT_ENCODING # <<<<<<<<<<<<<< * for label in ( * "csiso2022kr", */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_REPLACEMENT_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L200_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_REPLACEMENT_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 411, __pyx_L200_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr29__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 399, __pyx_L200_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr29__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 411, __pyx_L200_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":400 + /* "w3lib/_url.pyx":412 * **{ * label: _REPLACEMENT_ENCODING * for label in ( # <<<<<<<<<<<<<< @@ -27492,22 +28223,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 398, __pyx_L1_error) + __PYX_ERR(0, 410, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":409 + /* "w3lib/_url.pyx":421 * ) * }, * **{ # <<<<<<<<<<<<<< * label: _UTF_16BE_ENCODING * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L207_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L207_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":411 + /* "w3lib/_url.pyx":423 * **{ * label: _UTF_16BE_ENCODING * for label in ( # <<<<<<<<<<<<<< @@ -27519,9 +28250,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 2) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 411, __pyx_L207_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 423, __pyx_L207_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 411, __pyx_L207_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L207_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr30__pyx_v_5w3lib_4_url_label); @@ -27529,19 +28260,19 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":410 + /* "w3lib/_url.pyx":422 * }, * **{ * label: _UTF_16BE_ENCODING # <<<<<<<<<<<<<< * for label in ( * "unicodefffe", */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_16BE_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __pyx_L207_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_16BE_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L207_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr30__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 410, __pyx_L207_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr30__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 422, __pyx_L207_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":411 + /* "w3lib/_url.pyx":423 * **{ * label: _UTF_16BE_ENCODING * for label in ( # <<<<<<<<<<<<<< @@ -27561,22 +28292,22 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 409, __pyx_L1_error) + __PYX_ERR(0, 421, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":416 + /* "w3lib/_url.pyx":428 * ) * }, * **{ # <<<<<<<<<<<<<< * label: _UTF_16LE_ENCODING * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L214_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L214_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":418 + /* "w3lib/_url.pyx":430 * **{ * label: _UTF_16LE_ENCODING * for label in ( # <<<<<<<<<<<<<< @@ -27588,9 +28319,9 @@ if (!__Pyx_RefNanny) { for (;;) { if (__pyx_t_7 >= 7) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 418, __pyx_L214_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 430, __pyx_L214_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 418, __pyx_L214_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L214_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr31__pyx_v_5w3lib_4_url_label); @@ -27598,19 +28329,19 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":417 + /* "w3lib/_url.pyx":429 * }, * **{ * label: _UTF_16LE_ENCODING # <<<<<<<<<<<<<< * for label in ( * "csunicode", */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_16LE_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L214_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_16LE_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L214_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr31__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 417, __pyx_L214_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr31__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 429, __pyx_L214_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":418 + /* "w3lib/_url.pyx":430 * **{ * label: _UTF_16LE_ENCODING * for label in ( # <<<<<<<<<<<<<< @@ -27630,142 +28361,142 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 416, __pyx_L1_error) + __PYX_ERR(0, 428, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_kp_u_x_user_defined, __pyx_kp_u_x_user_defined) < 0) __PYX_ERR(0, 428, __pyx_L1_error) - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LABEL_ENCODINGS, __pyx_t_6) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_kp_u_x_user_defined, __pyx_kp_u_x_user_defined) < 0) __PYX_ERR(0, 440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LABEL_ENCODINGS, __pyx_t_6) < 0) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":433 + /* "w3lib/_url.pyx":445 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def _get_encoder(encoding: str) -> EncodeFunction: * codec_info = codecs.lookup(encoding) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 433, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 433, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_EncodeFunction) < 0) __PYX_ERR(0, 433, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_3_get_encoder, 0, __pyx_n_s_get_encoder, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 445, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_EncodeFunction) < 0) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_3_get_encoder, 0, __pyx_n_s_get_encoder, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoder, __pyx_t_2) < 0) __PYX_ERR(0, 433, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoder, __pyx_t_2) < 0) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":439 + /* "w3lib/_url.pyx":451 * * * _UTF_8_ENCODER = _get_encoder("utf-8") # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODER, __pyx_t_6) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODER, __pyx_t_6) < 0) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":443 + /* "w3lib/_url.pyx":455 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def _get_encoding(label: str) -> str: * label = label.strip(_ASCII_WHITESPACE).lower() */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 443, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 443, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 443, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_5_get_encoding, 0, __pyx_n_s_get_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 455, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_5_get_encoding, 0, __pyx_n_s_get_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 443, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":458 + /* "w3lib/_url.pyx":470 * * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( * _REPLACEMENT_ENCODING, # <<<<<<<<<<<<<< * _UTF_16BE_ENCODING, * _UTF_16LE_ENCODING, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_REPLACEMENT_ENCODING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_REPLACEMENT_ENCODING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":459 + /* "w3lib/_url.pyx":471 * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( * _REPLACEMENT_ENCODING, * _UTF_16BE_ENCODING, # <<<<<<<<<<<<<< * _UTF_16LE_ENCODING, * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_UTF_16BE_ENCODING); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 459, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_UTF_16BE_ENCODING); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "w3lib/_url.pyx":460 + /* "w3lib/_url.pyx":472 * _REPLACEMENT_ENCODING, * _UTF_16BE_ENCODING, * _UTF_16LE_ENCODING, # <<<<<<<<<<<<<< * ) * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_UTF_16LE_ENCODING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_UTF_16LE_ENCODING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":458 + /* "w3lib/_url.pyx":470 * * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( * _REPLACEMENT_ENCODING, # <<<<<<<<<<<<<< * _UTF_16BE_ENCODING, * _UTF_16LE_ENCODING, */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS, __pyx_t_4) < 0) __PYX_ERR(0, 457, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS, __pyx_t_4) < 0) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":475 + /* "w3lib/_url.pyx":487 * # https://url.spec.whatwg.org/ * * _ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { # <<<<<<<<<<<<<< @@ -27773,26 +28504,26 @@ if (!__Pyx_RefNanny) { * } */ { /* enter inner scope */ - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L221_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L221_error) __Pyx_GOTREF(__pyx_t_4); - /* "w3lib/_url.pyx":476 + /* "w3lib/_url.pyx":488 * * _ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { * ord(char): None for char in _ASCII_TAB_OR_NEWLINE # <<<<<<<<<<<<<< * } * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L221_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L221_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 476, __pyx_L221_error) + __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 488, __pyx_L221_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 476, __pyx_L221_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 488, __pyx_L221_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -27801,28 +28532,28 @@ if (!__Pyx_RefNanny) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 476, __pyx_L221_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 488, __pyx_L221_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 476, __pyx_L221_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 488, __pyx_L221_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L221_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L221_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 476, __pyx_L221_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 488, __pyx_L221_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 476, __pyx_L221_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 488, __pyx_L221_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L221_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L221_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -27832,7 +28563,7 @@ if (!__Pyx_RefNanny) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 476, __pyx_L221_error) + else __PYX_ERR(0, 488, __pyx_L221_error) } break; } @@ -27844,11 +28575,11 @@ if (!__Pyx_RefNanny) { __pyx_t_3 = 0; __pyx_t_3 = __pyx_9genexpr32__pyx_v_5w3lib_4_url_char; __Pyx_INCREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_Ord(__pyx_t_3); if (unlikely(__pyx_t_9 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 476, __pyx_L221_error) + __pyx_t_9 = __Pyx_PyObject_Ord(__pyx_t_3); if (unlikely(__pyx_t_9 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 488, __pyx_L221_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L221_error) + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L221_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_t_3, (PyObject*)Py_None))) __PYX_ERR(0, 476, __pyx_L221_error) + if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_t_3, (PyObject*)Py_None))) __PYX_ERR(0, 488, __pyx_L221_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -27861,10 +28592,10 @@ if (!__Pyx_RefNanny) { goto __pyx_L1_error; __pyx_L225_exit_scope:; } /* exit inner scope */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO, __pyx_t_4) < 0) __PYX_ERR(0, 475, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO, __pyx_t_4) < 0) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":479 + /* "w3lib/_url.pyx":491 * } * * SCHEME_START = declare(uchar, 0) # <<<<<<<<<<<<<< @@ -27873,7 +28604,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_SCHEME_START = 0; - /* "w3lib/_url.pyx":480 + /* "w3lib/_url.pyx":492 * * SCHEME_START = declare(uchar, 0) * SCHEME = declare(uchar, 1) # <<<<<<<<<<<<<< @@ -27882,7 +28613,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_SCHEME = 1; - /* "w3lib/_url.pyx":481 + /* "w3lib/_url.pyx":493 * SCHEME_START = declare(uchar, 0) * SCHEME = declare(uchar, 1) * NO_SCHEME = declare(uchar, 2) # <<<<<<<<<<<<<< @@ -27891,7 +28622,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_NO_SCHEME = 2; - /* "w3lib/_url.pyx":482 + /* "w3lib/_url.pyx":494 * SCHEME = declare(uchar, 1) * NO_SCHEME = declare(uchar, 2) * SPECIAL_RELATIVE_OR_AUTHORITY = declare(uchar, 3) # <<<<<<<<<<<<<< @@ -27900,7 +28631,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_SPECIAL_RELATIVE_OR_AUTHORITY = 3; - /* "w3lib/_url.pyx":483 + /* "w3lib/_url.pyx":495 * NO_SCHEME = declare(uchar, 2) * SPECIAL_RELATIVE_OR_AUTHORITY = declare(uchar, 3) * PATH_OR_AUTHORITY = declare(uchar, 4) # <<<<<<<<<<<<<< @@ -27909,7 +28640,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY = 4; - /* "w3lib/_url.pyx":484 + /* "w3lib/_url.pyx":496 * SPECIAL_RELATIVE_OR_AUTHORITY = declare(uchar, 3) * PATH_OR_AUTHORITY = declare(uchar, 4) * RELATIVE = declare(uchar, 5) # <<<<<<<<<<<<<< @@ -27918,7 +28649,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_RELATIVE = 5; - /* "w3lib/_url.pyx":485 + /* "w3lib/_url.pyx":497 * PATH_OR_AUTHORITY = declare(uchar, 4) * RELATIVE = declare(uchar, 5) * RELATIVE_SLASH = declare(uchar, 6) # <<<<<<<<<<<<<< @@ -27927,7 +28658,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_RELATIVE_SLASH = 6; - /* "w3lib/_url.pyx":486 + /* "w3lib/_url.pyx":498 * RELATIVE = declare(uchar, 5) * RELATIVE_SLASH = declare(uchar, 6) * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) # <<<<<<<<<<<<<< @@ -27936,7 +28667,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES = 7; - /* "w3lib/_url.pyx":487 + /* "w3lib/_url.pyx":499 * RELATIVE_SLASH = declare(uchar, 6) * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) # <<<<<<<<<<<<<< @@ -27945,7 +28676,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES = 8; - /* "w3lib/_url.pyx":488 + /* "w3lib/_url.pyx":500 * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) * AUTHORITY = declare(uchar, 9) # <<<<<<<<<<<<<< @@ -27954,7 +28685,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_AUTHORITY = 9; - /* "w3lib/_url.pyx":489 + /* "w3lib/_url.pyx":501 * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) * AUTHORITY = declare(uchar, 9) * HOST = declare(uchar, 10) # <<<<<<<<<<<<<< @@ -27963,7 +28694,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_HOST = 10; - /* "w3lib/_url.pyx":490 + /* "w3lib/_url.pyx":502 * AUTHORITY = declare(uchar, 9) * HOST = declare(uchar, 10) * PORT = declare(uchar, 11) # <<<<<<<<<<<<<< @@ -27972,7 +28703,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_PORT = 11; - /* "w3lib/_url.pyx":491 + /* "w3lib/_url.pyx":503 * HOST = declare(uchar, 10) * PORT = declare(uchar, 11) * FILE = declare(uchar, 12) # <<<<<<<<<<<<<< @@ -27981,7 +28712,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_FILE = 12; - /* "w3lib/_url.pyx":492 + /* "w3lib/_url.pyx":504 * PORT = declare(uchar, 11) * FILE = declare(uchar, 12) * FILE_SLASH = declare(uchar, 13) # <<<<<<<<<<<<<< @@ -27990,7 +28721,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_FILE_SLASH = 13; - /* "w3lib/_url.pyx":493 + /* "w3lib/_url.pyx":505 * FILE = declare(uchar, 12) * FILE_SLASH = declare(uchar, 13) * FILE_HOST = declare(uchar, 14) # <<<<<<<<<<<<<< @@ -27999,7 +28730,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_FILE_HOST = 14; - /* "w3lib/_url.pyx":494 + /* "w3lib/_url.pyx":506 * FILE_SLASH = declare(uchar, 13) * FILE_HOST = declare(uchar, 14) * PATH_START = declare(uchar, 15) # <<<<<<<<<<<<<< @@ -28008,7 +28739,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_PATH_START = 15; - /* "w3lib/_url.pyx":495 + /* "w3lib/_url.pyx":507 * FILE_HOST = declare(uchar, 14) * PATH_START = declare(uchar, 15) * PATH = declare(uchar, 16) # <<<<<<<<<<<<<< @@ -28017,7 +28748,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_PATH = 16; - /* "w3lib/_url.pyx":496 + /* "w3lib/_url.pyx":508 * PATH_START = declare(uchar, 15) * PATH = declare(uchar, 16) * OPAQUE_PATH = declare(uchar, 17) # <<<<<<<<<<<<<< @@ -28026,7 +28757,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_OPAQUE_PATH = 17; - /* "w3lib/_url.pyx":497 + /* "w3lib/_url.pyx":509 * PATH = declare(uchar, 16) * OPAQUE_PATH = declare(uchar, 17) * QUERY = declare(uchar, 18) # <<<<<<<<<<<<<< @@ -28035,7 +28766,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_QUERY = 18; - /* "w3lib/_url.pyx":498 + /* "w3lib/_url.pyx":510 * OPAQUE_PATH = declare(uchar, 17) * QUERY = declare(uchar, 18) * FRAGMENT = declare(uchar, 19) # <<<<<<<<<<<<<< @@ -28044,233 +28775,233 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_FRAGMENT = 19; - /* "w3lib/_url.pyx":503 + /* "w3lib/_url.pyx":515 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#default-port * _DEFAULT_PORTS = { * "ftp": 21, # <<<<<<<<<<<<<< * "file": None, * "http": 80, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_ftp, __pyx_int_21) < 0) __PYX_ERR(0, 503, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_ftp, __pyx_int_21) < 0) __PYX_ERR(0, 515, __pyx_L1_error) - /* "w3lib/_url.pyx":504 + /* "w3lib/_url.pyx":516 * _DEFAULT_PORTS = { * "ftp": 21, * "file": None, # <<<<<<<<<<<<<< * "http": 80, * "https": 443, */ - if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_file, Py_None) < 0) __PYX_ERR(0, 503, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_http, __pyx_int_80) < 0) __PYX_ERR(0, 503, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_https, __pyx_int_443) < 0) __PYX_ERR(0, 503, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_ws, __pyx_int_80) < 0) __PYX_ERR(0, 503, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_wss, __pyx_int_443) < 0) __PYX_ERR(0, 503, __pyx_L1_error) - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_PORTS, __pyx_t_4) < 0) __PYX_ERR(0, 502, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_file, Py_None) < 0) __PYX_ERR(0, 515, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_http, __pyx_int_80) < 0) __PYX_ERR(0, 515, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_https, __pyx_int_443) < 0) __PYX_ERR(0, 515, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_ws, __pyx_int_80) < 0) __PYX_ERR(0, 515, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_wss, __pyx_int_443) < 0) __PYX_ERR(0, 515, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_PORTS, __pyx_t_4) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":510 + /* "w3lib/_url.pyx":522 * "wss": 443, * } * _SPECIAL_SCHEMES = set(_DEFAULT_PORTS.keys()) # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_keys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_keys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error) + __pyx_t_6 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_SCHEMES, __pyx_t_6) < 0) __PYX_ERR(0, 510, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_SCHEMES, __pyx_t_6) < 0) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":513 + /* "w3lib/_url.pyx":525 * * * class _URL: # <<<<<<<<<<<<<< * _scheme: str = "" * username: str = "" */ - __pyx_t_6 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_URL, __pyx_n_s_URL, (PyObject *) NULL, __pyx_n_s_w3lib__url, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_URL, __pyx_n_s_URL, (PyObject *) NULL, __pyx_n_s_w3lib__url, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_scheme, __pyx_n_s_str) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_username, __pyx_n_s_str) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_password, __pyx_n_s_str) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hostname, __pyx_kp_s_Union_int_List_int_str) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_port, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path, __pyx_kp_s_Union_str_List_str) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fragment, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_password_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_port_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_default_port_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_annotations, __pyx_t_4) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_scheme, __pyx_n_s_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_username, __pyx_n_s_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_password, __pyx_n_s_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hostname, __pyx_kp_s_Union_int_List_int_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_port, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path, __pyx_kp_s_Union_str_List_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fragment, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_password_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_port_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_default_port_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_annotations, __pyx_t_4) < 0) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":514 + /* "w3lib/_url.pyx":526 * * class _URL: * _scheme: str = "" # <<<<<<<<<<<<<< * username: str = "" * password: str = "" */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_scheme, __pyx_kp_u__2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_scheme, __pyx_kp_u__2) < 0) __PYX_ERR(0, 526, __pyx_L1_error) - /* "w3lib/_url.pyx":515 + /* "w3lib/_url.pyx":527 * class _URL: * _scheme: str = "" * username: str = "" # <<<<<<<<<<<<<< * password: str = "" * hostname: Union[int, List[int], str] = "" */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_username, __pyx_kp_u__2) < 0) __PYX_ERR(0, 515, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_username, __pyx_kp_u__2) < 0) __PYX_ERR(0, 527, __pyx_L1_error) - /* "w3lib/_url.pyx":516 + /* "w3lib/_url.pyx":528 * _scheme: str = "" * username: str = "" * password: str = "" # <<<<<<<<<<<<<< * hostname: Union[int, List[int], str] = "" * port: Optional[int] = None */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_password, __pyx_kp_u__2) < 0) __PYX_ERR(0, 516, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_password, __pyx_kp_u__2) < 0) __PYX_ERR(0, 528, __pyx_L1_error) - /* "w3lib/_url.pyx":517 + /* "w3lib/_url.pyx":529 * username: str = "" * password: str = "" * hostname: Union[int, List[int], str] = "" # <<<<<<<<<<<<<< * port: Optional[int] = None * path: Union[str, List[str]] */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 517, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 529, __pyx_L1_error) - /* "w3lib/_url.pyx":518 + /* "w3lib/_url.pyx":530 * password: str = "" * hostname: Union[int, List[int], str] = "" * port: Optional[int] = None # <<<<<<<<<<<<<< * path: Union[str, List[str]] * query: Optional[str] = None */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_port, Py_None) < 0) __PYX_ERR(0, 518, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_port, Py_None) < 0) __PYX_ERR(0, 530, __pyx_L1_error) - /* "w3lib/_url.pyx":520 + /* "w3lib/_url.pyx":532 * port: Optional[int] = None * path: Union[str, List[str]] * query: Optional[str] = None # <<<<<<<<<<<<<< * fragment: Optional[str] = None * */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 520, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 532, __pyx_L1_error) - /* "w3lib/_url.pyx":521 + /* "w3lib/_url.pyx":533 * path: Union[str, List[str]] * query: Optional[str] = None * fragment: Optional[str] = None # <<<<<<<<<<<<<< * * # Indicates whether a color (:) separating a username from a password */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fragment, Py_None) < 0) __PYX_ERR(0, 521, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fragment, Py_None) < 0) __PYX_ERR(0, 533, __pyx_L1_error) - /* "w3lib/_url.pyx":526 + /* "w3lib/_url.pyx":538 * # existed in the parsed URL. This enables :func:`_serialize_url` to * # generate a URL that matches the input URL, if desired. * _password_token_seen: bool = False # <<<<<<<<<<<<<< * * # Indicates, for an empty port component, whether or not a colon (:) */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_password_token_seen, Py_False) < 0) __PYX_ERR(0, 526, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_password_token_seen, Py_False) < 0) __PYX_ERR(0, 538, __pyx_L1_error) - /* "w3lib/_url.pyx":531 + /* "w3lib/_url.pyx":543 * # character was used. This enables :func:`_serialize_url` to * # generate a URL that matches the input URL, if desired. * _port_token_seen: bool = False # <<<<<<<<<<<<<< * * # Indicates whether or not a default port was specified in the input URL. */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_port_token_seen, Py_False) < 0) __PYX_ERR(0, 531, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_port_token_seen, Py_False) < 0) __PYX_ERR(0, 543, __pyx_L1_error) - /* "w3lib/_url.pyx":536 + /* "w3lib/_url.pyx":548 * # This enables :func:`_serialize_url` to generate a URL that matches the * # input URL, if desired. * _default_port_seen: bool = False # <<<<<<<<<<<<<< * * # Indicates, for an empty path component, whether or not a slash (/) */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_default_port_seen, Py_False) < 0) __PYX_ERR(0, 536, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_default_port_seen, Py_False) < 0) __PYX_ERR(0, 548, __pyx_L1_error) - /* "w3lib/_url.pyx":541 + /* "w3lib/_url.pyx":553 * # character was used. This enables :func:`_serialize_url` to * # generate a URL that matches the input URL, if desired. * _path_token_seen: bool = False # <<<<<<<<<<<<<< * * def __init__(self) -> None: */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_path_token_seen, Py_False) < 0) __PYX_ERR(0, 541, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_path_token_seen, Py_False) < 0) __PYX_ERR(0, 553, __pyx_L1_error) - /* "w3lib/_url.pyx":543 + /* "w3lib/_url.pyx":555 * _path_token_seen: bool = False * * def __init__(self) -> None: # <<<<<<<<<<<<<< * self.path = [] * self.is_special = False */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 543, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_1__init__, 0, __pyx_n_s_URL___init, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_1__init__, 0, __pyx_n_s_URL___init, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 543, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":547 + /* "w3lib/_url.pyx":559 * self.is_special = False * * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< * return isinstance(self.path, str) * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 547, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_3has_opaque_path, 0, __pyx_n_s_URL_has_opaque_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_3has_opaque_path, 0, __pyx_n_s_URL_has_opaque_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_has_opaque_path, __pyx_t_4) < 0) __PYX_ERR(0, 547, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_has_opaque_path, __pyx_t_4) < 0) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":550 + /* "w3lib/_url.pyx":562 * return isinstance(self.path, str) * * @property # <<<<<<<<<<<<<< * def scheme(self) -> str: * return self._scheme */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 550, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_5scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_5scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_scheme_2, __pyx_t_4) < 0) __PYX_ERR(0, 550, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_scheme_2, __pyx_t_4) < 0) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":554 + /* "w3lib/_url.pyx":566 * return self._scheme * * @scheme.setter # <<<<<<<<<<<<<< @@ -28282,16 +29013,16 @@ if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_scheme_2); } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_setter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_setter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_value, __pyx_n_s_str) < 0) __PYX_ERR(0, 554, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 554, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_7scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_value, __pyx_n_s_str) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_7scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -28314,752 +29045,1223 @@ if (!__Pyx_RefNanny) { __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_scheme_2, __pyx_t_4) < 0) __PYX_ERR(0, 554, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_scheme_2, __pyx_t_4) < 0) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":513 + /* "w3lib/_url.pyx":525 * * * class _URL: # <<<<<<<<<<<<<< * _scheme: str = "" * username: str = "" */ - __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_URL, __pyx_empty_tuple, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_URL, __pyx_empty_tuple, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_URL, __pyx_t_4) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_URL, __pyx_t_4) < 0) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":560 + /* "w3lib/_url.pyx":572 * * * _SCHEME_CHARS = _ASCII_ALPHANUMERIC + "+-." # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__75); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__75); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME_CHARS, __pyx_t_4) < 0) __PYX_ERR(0, 560, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME_CHARS, __pyx_t_4) < 0) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":564 + /* "w3lib/_url.pyx":576 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< * path = url.path * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 564, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 564, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_7_shorten_path, 0, __pyx_n_s_shorten_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 564, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 576, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_7_shorten_path, 0, __pyx_n_s_shorten_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_shorten_path, __pyx_t_6) < 0) __PYX_ERR(0, 564, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_shorten_path, __pyx_t_6) < 0) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":573 + /* "w3lib/_url.pyx":585 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_space_as_plus, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 573, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 573, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_space_as_plus, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 573, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 573, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 573, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_space_as_plus, __pyx_n_s_bool) < 0) __PYX_ERR(0, 573, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 573, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_9_percent_encode_after_encoding, 0, __pyx_n_s_percent_encode_after_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_space_as_plus, __pyx_n_s_bool) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_9_percent_encode_after_encoding, 0, __pyx_n_s_percent_encode_after_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_percent_encode_after_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 573, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_percent_encode_after_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":608 + /* "w3lib/_url.pyx":620 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":609 + /* "w3lib/_url.pyx":621 * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( * _C0_CONTROL, # <<<<<<<<<<<<<< * greater_than="~", * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "w3lib/_url.pyx":608 + /* "w3lib/_url.pyx":620 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 608, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 608, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":610 + /* "w3lib/_url.pyx":622 * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( * _C0_CONTROL, * greater_than="~", # <<<<<<<<<<<<<< * ) * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_greater_than, __pyx_kp_u__81) < 0) __PYX_ERR(0, 610, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_greater_than, __pyx_kp_u__81) < 0) __PYX_ERR(0, 622, __pyx_L1_error) - /* "w3lib/_url.pyx":608 + /* "w3lib/_url.pyx":620 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":624 + * greater_than="~", + * ) + * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' # <<<<<<<<<<<<<< + * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' + * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_u__82); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 624, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":625 + * ) + * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' + * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' # <<<<<<<<<<<<<< + * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" + * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__83); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 625, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":626 + * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' + * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' + * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" # <<<<<<<<<<<<<< + * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" + * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_u__84); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_t_4) < 0) __PYX_ERR(0, 626, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":627 + * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' + * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" + * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" # <<<<<<<<<<<<<< + * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__85); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 627, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":628 + * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" + * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" + * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" # <<<<<<<<<<<<<< + * + * # constants from RFC 3986, Section 2.2 and 2.3 + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_u__86); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":631 + * + * # constants from RFC 3986, Section 2.2 and 2.3 + * RFC3986_GEN_DELIMS = b":/?#[]@" # <<<<<<<<<<<<<< + * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" + * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_GEN_DELIMS, __pyx_kp_b__87) < 0) __PYX_ERR(0, 631, __pyx_L1_error) + + /* "w3lib/_url.pyx":632 + * # constants from RFC 3986, Section 2.2 and 2.3 + * RFC3986_GEN_DELIMS = b":/?#[]@" + * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" # <<<<<<<<<<<<<< + * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS + * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_SUB_DELIMS, __pyx_kp_b__88) < 0) __PYX_ERR(0, 632, __pyx_L1_error) + + /* "w3lib/_url.pyx":633 + * RFC3986_GEN_DELIMS = b":/?#[]@" + * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" + * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS # <<<<<<<<<<<<<< + * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") + * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RFC3986_GEN_DELIMS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RFC3986_SUB_DELIMS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_RESERVED, __pyx_t_6) < 0) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_url.pyx":634 + * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" + * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS + * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") # <<<<<<<<<<<<<< + * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_string); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascii_letters); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_string); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_digits); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__89); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_UNRESERVED, __pyx_t_4) < 0) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":635 + * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS + * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") + * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 # <<<<<<<<<<<<<< + * + * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRA_SAFE_CHARS, __pyx_kp_b__91) < 0) __PYX_ERR(0, 635, __pyx_L1_error) + + /* "w3lib/_url.pyx":637 + * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 + * + * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" # <<<<<<<<<<<<<< + * _safe_chars = RFC3986_RESERVED + RFC3986_UNRESERVED + EXTRA_SAFE_CHARS + b"%" + * _path_safe_chars = _safe_chars.replace(b"#", b"") + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RFC3986_UNRESERVED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_SUB_DELIMS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_USERINFO_SAFE_CHARS, __pyx_t_6) < 0) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_url.pyx":638 + * + * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" + * _safe_chars = RFC3986_RESERVED + RFC3986_UNRESERVED + EXTRA_SAFE_CHARS + b"%" # <<<<<<<<<<<<<< + * _path_safe_chars = _safe_chars.replace(b"#", b"") + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_RESERVED); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RFC3986_UNRESERVED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_EXTRA_SAFE_CHARS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_chars, __pyx_t_5) < 0) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":639 + * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" + * _safe_chars = RFC3986_RESERVED + RFC3986_UNRESERVED + EXTRA_SAFE_CHARS + b"%" + * _path_safe_chars = _safe_chars.replace(b"#", b"") # <<<<<<<<<<<<<< + * + * # Characters that are safe in all of: + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_safe_chars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_path_safe_chars, __pyx_t_5) < 0) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":651 + * # be escaped as %25 when it is not already being used as part of an escape + * # character. + * _USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") # <<<<<<<<<<<<<< + * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") + * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RFC3986_USERINFO_SAFE_CHARS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_translate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_delete, __pyx_kp_b__94) < 0) __PYX_ERR(0, 651, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__93, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_SAFEST_CHARS, __pyx_t_4) < 0) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":652 + * # character. + * _USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") + * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") # <<<<<<<<<<<<<< + * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS + * _SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_safe_chars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_translate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_delete, __pyx_kp_b__95) < 0) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__93, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_SAFEST_CHARS, __pyx_t_6) < 0) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_url.pyx":653 + * _USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") + * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") + * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS # <<<<<<<<<<<<<< + * _SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") + * _FRAGMENT_SAFEST_CHARS = _PATH_SAFEST_CHARS + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_SAFEST_CHARS, __pyx_t_6) < 0) __PYX_ERR(0, 653, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_url.pyx":654 + * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") + * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS + * _SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") # <<<<<<<<<<<<<< + * _FRAGMENT_SAFEST_CHARS = _PATH_SAFEST_CHARS + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_translate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_delete, __pyx_kp_b__84) < 0) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__93, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS, __pyx_t_5) < 0) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":655 + * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS + * _SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") + * _FRAGMENT_SAFEST_CHARS = _PATH_SAFEST_CHARS # <<<<<<<<<<<<<< + * + * _SAFE_USERINFO_PERCENT_ENCODE_SET = ( + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_SAFEST_CHARS, __pyx_t_5) < 0) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":658 + * + * _SAFE_USERINFO_PERCENT_ENCODE_SET = ( + * _USERINFO_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * | _RFC3986_USERINFO_PERCENT_ENCODE_SET + * | _RFC2396_USERINFO_PERCENT_ENCODE_SET + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + + /* "w3lib/_url.pyx":659 + * _SAFE_USERINFO_PERCENT_ENCODE_SET = ( + * _USERINFO_PERCENT_ENCODE_SET + * | _RFC3986_USERINFO_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * | _RFC2396_USERINFO_PERCENT_ENCODE_SET + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyNumber_Or(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_url.pyx":660 + * _USERINFO_PERCENT_ENCODE_SET + * | _RFC3986_USERINFO_PERCENT_ENCODE_SET + * | _RFC2396_USERINFO_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * ) + * _SAFE_PATH_PERCENT_ENCODE_SET = ( + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE, __pyx_t_5) < 0) __PYX_ERR(0, 657, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":663 + * ) + * _SAFE_PATH_PERCENT_ENCODE_SET = ( + * _PATH_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * | _RFC3986_PATH_PERCENT_ENCODE_SET + * | _RFC2396_ABS_PATH_PERCENT_ENCODE_SET + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + + /* "w3lib/_url.pyx":664 + * _SAFE_PATH_PERCENT_ENCODE_SET = ( + * _PATH_PERCENT_ENCODE_SET + * | _RFC3986_PATH_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * | _RFC2396_ABS_PATH_PERCENT_ENCODE_SET + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyNumber_Or(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_url.pyx":665 + * _PATH_PERCENT_ENCODE_SET + * | _RFC3986_PATH_PERCENT_ENCODE_SET + * | _RFC2396_ABS_PATH_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * ) + * _SAFE_QUERY_PERCENT_ENCODE_SET = ( + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":668 + * ) + * _SAFE_QUERY_PERCENT_ENCODE_SET = ( + * _QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * | _RFC3986_QUERY_PERCENT_ENCODE_SET + * | _RFC2396_QUERY_PERCENT_ENCODE_SET + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + + /* "w3lib/_url.pyx":669 + * _SAFE_QUERY_PERCENT_ENCODE_SET = ( + * _QUERY_PERCENT_ENCODE_SET + * | _RFC3986_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * | _RFC2396_QUERY_PERCENT_ENCODE_SET + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyNumber_Or(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_url.pyx":670 + * _QUERY_PERCENT_ENCODE_SET + * | _RFC3986_QUERY_PERCENT_ENCODE_SET + * | _RFC2396_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * ) + * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET = ( + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":612 - * greater_than="~", + /* "w3lib/_url.pyx":673 * ) - * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' # <<<<<<<<<<<<<< - * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' - * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" + * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET = ( + * _SPECIAL_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * | _RFC3986_QUERY_PERCENT_ENCODE_SET + * | _RFC2396_QUERY_PERCENT_ENCODE_SET */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_u__82); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error) + + /* "w3lib/_url.pyx":674 + * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET = ( + * _SPECIAL_QUERY_PERCENT_ENCODE_SET + * | _RFC3986_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * | _RFC2396_QUERY_PERCENT_ENCODE_SET + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyNumber_Or(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 612, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":613 + /* "w3lib/_url.pyx":675 + * _SPECIAL_QUERY_PERCENT_ENCODE_SET + * | _RFC3986_QUERY_PERCENT_ENCODE_SET + * | _RFC2396_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) - * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' - * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' # <<<<<<<<<<<<<< - * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" - * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" + * _SAFE_FRAGMENT_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__83); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO, __pyx_t_5) < 0) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":614 - * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' - * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' - * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" # <<<<<<<<<<<<<< - * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" - * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" + /* "w3lib/_url.pyx":678 + * ) + * _SAFE_FRAGMENT_PERCENT_ENCODE_SET = ( + * _FRAGMENT_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * | _RFC3986_FRAGMENT_PERCENT_ENCODE_SET + * | _RFC2396_FRAGMENT_PERCENT_ENCODE_SET */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_u__84); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_t_4) < 0) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":615 - * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' - * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" - * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" # <<<<<<<<<<<<<< - * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" - * + /* "w3lib/_url.pyx":679 + * _SAFE_FRAGMENT_PERCENT_ENCODE_SET = ( + * _FRAGMENT_PERCENT_ENCODE_SET + * | _RFC3986_FRAGMENT_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * | _RFC2396_FRAGMENT_PERCENT_ENCODE_SET + * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyNumber_Or(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__85); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":616 - * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" - * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" - * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":680 + * _FRAGMENT_PERCENT_ENCODE_SET + * | _RFC3986_FRAGMENT_PERCENT_ENCODE_SET + * | _RFC2396_FRAGMENT_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * ) * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_u__86); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE, __pyx_t_5) < 0) __PYX_ERR(0, 677, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":619 + /* "w3lib/_url.pyx":684 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point * _FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" # <<<<<<<<<<<<<< * _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_kp_u__87) < 0) __PYX_ERR(0, 619, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_kp_u__96) < 0) __PYX_ERR(0, 684, __pyx_L1_error) - /* "w3lib/_url.pyx":620 + /* "w3lib/_url.pyx":685 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point * _FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" * _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__88); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_t_5) < 0) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__97); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_t_6) < 0) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":623 + /* "w3lib/_url.pyx":688 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< * address = [0] * 8 * piece_index = 0 */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 623, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 623, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_11_parse_ipv6, 0, __pyx_n_s_parse_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv6, __pyx_t_6) < 0) __PYX_ERR(0, 623, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 688, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_11_parse_ipv6, 0, __pyx_n_s_parse_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":710 + /* "w3lib/_url.pyx":775 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< * input: str, * percent_encode_set: _PercentEncodeSet, */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 775, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 775, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_13_utf_8_percent_encode, 0, __pyx_n_s_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 710, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 710, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 710, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_13_utf_8_percent_encode, 0, __pyx_n_s_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf_8_percent_encode, __pyx_t_6) < 0) __PYX_ERR(0, 775, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf_8_percent_encode, __pyx_t_5) < 0) __PYX_ERR(0, 710, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":722 + /* "w3lib/_url.pyx":787 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 722, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 722, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 722, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_15_parse_opaque_host, 0, __pyx_n_s_parse_opaque_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_opaque_host, __pyx_t_6) < 0) __PYX_ERR(0, 722, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 787, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 787, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_15_parse_opaque_host, 0, __pyx_n_s_parse_opaque_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_opaque_host, __pyx_t_4) < 0) __PYX_ERR(0, 787, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":730 + /* "w3lib/_url.pyx":795 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< * if not input: * raise ValueError */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 795, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Tuple_int_bool) < 0) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_17_parse_ipv4_number, 0, __pyx_n_s_parse_ipv4_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 730, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_Tuple_int_bool) < 0) __PYX_ERR(0, 730, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_17_parse_ipv4_number, 0, __pyx_n_s_parse_ipv4_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 730, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4_number, __pyx_t_6) < 0) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4_number, __pyx_t_5) < 0) __PYX_ERR(0, 730, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":750 + /* "w3lib/_url.pyx":815 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and parts[-1] == "": */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 750, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 750, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 750, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_19_ends_in_number, 0, __pyx_n_s_ends_in_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ends_in_number, __pyx_t_6) < 0) __PYX_ERR(0, 750, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 815, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 815, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_19_ends_in_number, 0, __pyx_n_s_ends_in_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 815, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ends_in_number, __pyx_t_4) < 0) __PYX_ERR(0, 815, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":767 + /* "w3lib/_url.pyx":832 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and not parts[-1]: */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 832, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_21_parse_ipv4, 0, __pyx_n_s_parse_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 767, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 767, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_21_parse_ipv4, 0, __pyx_n_s_parse_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4, __pyx_t_6) < 0) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4, __pyx_t_5) < 0) __PYX_ERR(0, 767, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":790 + /* "w3lib/_url.pyx":855 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< * result = _utr46._to_ascii( * domain, */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 790, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_be_strict, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 790, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domain, __pyx_n_s_str) < 0) __PYX_ERR(0, 790, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_be_strict, __pyx_n_s_bool) < 0) __PYX_ERR(0, 790, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 790, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_23_domain_to_ascii, 0, __pyx_n_s_domain_to_ascii, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_be_strict, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_4, __pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domain, __pyx_n_s_str) < 0) __PYX_ERR(0, 855, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_be_strict, __pyx_n_s_bool) < 0) __PYX_ERR(0, 855, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_23_domain_to_ascii, 0, __pyx_n_s_domain_to_ascii, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_5, __pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_domain_to_ascii, __pyx_t_4) < 0) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_domain_to_ascii, __pyx_t_5) < 0) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":809 + /* "w3lib/_url.pyx":874 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_is_special, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 874, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_is_special, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 809, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 874, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_is_special, __pyx_n_s_bool) < 0) __PYX_ERR(0, 874, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 874, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_25_parse_host, 0, __pyx_n_s_parse_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 809, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_is_special, __pyx_n_s_bool) < 0) __PYX_ERR(0, 809, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 809, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_25_parse_host, 0, __pyx_n_s_parse_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 809, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_5, __pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_6, __pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_host, __pyx_t_6) < 0) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_host, __pyx_t_5) < 0) __PYX_ERR(0, 809, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":831 + /* "w3lib/_url.pyx":896 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 831, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 831, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_27_is_windows_drive_letter, 0, __pyx_n_s_is_windows_drive_letter, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_windows_drive_letter, __pyx_t_6) < 0) __PYX_ERR(0, 831, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 896, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 896, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_27_is_windows_drive_letter, 0, __pyx_n_s_is_windows_drive_letter, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_windows_drive_letter, __pyx_t_4) < 0) __PYX_ERR(0, 896, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":836 + /* "w3lib/_url.pyx":901 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< * input_length = len(input) * return ( */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 901, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 901, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 901, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_29_starts_with_windows_drive_letter, 0, __pyx_n_s_starts_with_windows_drive_lette, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 836, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 836, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_29_starts_with_windows_drive_letter, 0, __pyx_n_s_starts_with_windows_drive_lette, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_starts_with_windows_drive_lette, __pyx_t_6) < 0) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_starts_with_windows_drive_lette, __pyx_t_5) < 0) __PYX_ERR(0, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":846 + /* "w3lib/_url.pyx":911 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< * return input in ( * "..", */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 846, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 846, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_31_is_double_dot_path_segment, 0, __pyx_n_s_is_double_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_double_dot_path_segment, __pyx_t_6) < 0) __PYX_ERR(0, 846, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 911, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 911, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_31_is_double_dot_path_segment, 0, __pyx_n_s_is_double_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_double_dot_path_segment, __pyx_t_4) < 0) __PYX_ERR(0, 911, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":861 + /* "w3lib/_url.pyx":926 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< * return input in ( * ".", */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 926, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 926, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_33_is_single_dot_path_segment, 0, __pyx_n_s_is_single_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 861, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 861, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_33_is_single_dot_path_segment, 0, __pyx_n_s_is_single_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 861, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_single_dot_path_segment, __pyx_t_6) < 0) __PYX_ERR(0, 926, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_single_dot_path_segment, __pyx_t_5) < 0) __PYX_ERR(0, 861, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":872 + /* "w3lib/_url.pyx":937 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * *, input: str, pointer: int, encode_set: _PercentEncodeSet * ) -> str: */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 872, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_pointer, __pyx_n_s_int) < 0) __PYX_ERR(0, 872, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 872, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 872, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_35_idempotent_utf_8_percent_encode, 0, __pyx_n_s_idempotent_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 872, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_idempotent_utf_8_percent_encode, __pyx_t_6) < 0) __PYX_ERR(0, 872, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 937, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pointer, __pyx_n_s_int) < 0) __PYX_ERR(0, 937, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 937, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_35_idempotent_utf_8_percent_encode, 0, __pyx_n_s_idempotent_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 937, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_idempotent_utf_8_percent_encode, __pyx_t_4) < 0) __PYX_ERR(0, 937, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":887 + /* "w3lib/_url.pyx":952 + * + * + * def _preprocess_url(url: str) -> str: # <<<<<<<<<<<<<< + * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) + * + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_str) < 0) __PYX_ERR(0, 952, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 952, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_37_preprocess_url, 0, __pyx_n_s_preprocess_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 952, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_preprocess_url, __pyx_t_6) < 0) __PYX_ERR(0, 952, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "w3lib/_url.pyx":956 * * * def _parse_url( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base_url, __pyx_n_s_str) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_path_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_37_parse_url, 0, __pyx_n_s_parse_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, sizeof(__pyx_defaults), 5)) __PYX_ERR(0, 887, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base_url, __pyx_n_s_str) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_path_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_39_parse_url, 0, __pyx_n_s_parse_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 956, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults), 5)) __PYX_ERR(0, 956, __pyx_L1_error) - /* "w3lib/_url.pyx":892 + /* "w3lib/_url.pyx":961 * base_url: str = None, * encoding: str = "utf-8", * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_userinfo_percent_encode_set = __pyx_t_4; - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_userinfo_percent_encode_set = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":893 + /* "w3lib/_url.pyx":962 * encoding: str = "utf-8", * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_path_percent_encode_set = __pyx_t_4; - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_path_percent_encode_set = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":894 + /* "w3lib/_url.pyx":963 * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 894, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_query_percent_encode_set = __pyx_t_4; - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 963, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_query_percent_encode_set = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":895 + /* "w3lib/_url.pyx":964 * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, * ) -> _URL: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 895, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_special_query_percent_encode_set = __pyx_t_4; - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 964, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_special_query_percent_encode_set = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":896 + /* "w3lib/_url.pyx":965 * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * ) -> _URL: * """Return a :class:`_URL` object built from *url*, *base_url* and */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 896, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_fragment_percent_encode_set = __pyx_t_4; - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_5w3lib_4_url_50__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 965, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_fragment_percent_encode_set = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_5w3lib_4_url_54__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_url, __pyx_t_5) < 0) __PYX_ERR(0, 887, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_url, __pyx_t_4) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1319 + /* "w3lib/_url.pyx":1368 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< * output = "" * n = address */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_address, __pyx_n_s_int) < 0) __PYX_ERR(0, 1319, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1319, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_39_serialize_ipv4, 0, __pyx_n_s_serialize_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_address, __pyx_n_s_int) < 0) __PYX_ERR(0, 1368, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1368, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_41_serialize_ipv4, 0, __pyx_n_s_serialize_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv4, __pyx_t_6) < 0) __PYX_ERR(0, 1319, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv4, __pyx_t_6) < 0) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":1330 + /* "w3lib/_url.pyx":1379 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1330, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_min_length, __pyx_n_s_int) < 0) __PYX_ERR(0, 1330, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 1330, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index, 0, __pyx_n_s_get_ipv6_first_longest_0_piece, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 1330, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1379, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_min_length, __pyx_n_s_int) < 0) __PYX_ERR(0, 1379, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 1379, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index, 0, __pyx_n_s_get_ipv6_first_longest_0_piece, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 1379, __pyx_L1_error) - /* "w3lib/_url.pyx":1331 + /* "w3lib/_url.pyx":1380 * * def _get_ipv6_first_longest_0_piece_index( * address: List[int], *, min_length: int = 2 # <<<<<<<<<<<<<< * ) -> Optional[int]: * index = None */ - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_2))) __PYX_ERR(0, 1331, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_2))) __PYX_ERR(0, 1380, __pyx_L1_error) __Pyx_INCREF(__pyx_int_2); - __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_5)->__pyx_arg_min_length = ((PyObject*)__pyx_int_2); + __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_4)->__pyx_arg_min_length = ((PyObject*)__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_5w3lib_4_url_52__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_5w3lib_4_url_56__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_t_5) < 0) __PYX_ERR(0, 1330, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_t_4) < 0) __PYX_ERR(0, 1379, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1348 + /* "w3lib/_url.pyx":1397 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1348, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1348, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_43_serialize_ipv6, 0, __pyx_n_s_serialize_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1397, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1397, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_45_serialize_ipv6, 0, __pyx_n_s_serialize_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv6, __pyx_t_6) < 0) __PYX_ERR(0, 1348, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv6, __pyx_t_6) < 0) __PYX_ERR(0, 1397, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":1369 + /* "w3lib/_url.pyx":1418 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< * if isinstance(host, int): * return _serialize_ipv4(host) */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1369, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_host, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 1369, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1369, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_45_serialize_host, 0, __pyx_n_s_serialize_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_host, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 1418, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1418, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_47_serialize_host, 0, __pyx_n_s_serialize_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_host, __pyx_t_5) < 0) __PYX_ERR(0, 1369, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_host, __pyx_t_4) < 0) __PYX_ERR(0, 1418, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1378 + /* "w3lib/_url.pyx":1427 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< * if url.has_opaque_path(): * assert isinstance(url.path, str) */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_canonicalize, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_47_serialize_url_path, 0, __pyx_n_s_serialize_url_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1378, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_4, __pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url_path, __pyx_t_4) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1427, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_canonicalize, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1427, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_49_serialize_url_path, 0, __pyx_n_s_serialize_url_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_5, __pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url_path, __pyx_t_5) < 0) __PYX_ERR(0, 1427, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1391 + /* "w3lib/_url.pyx":1440 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url( # <<<<<<<<<<<<<< * url: _URL, * *, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_exclude_fragment, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_exclude_fragment, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) - /* "w3lib/_url.pyx":1395 + /* "w3lib/_url.pyx":1444 * *, * exclude_fragment: bool = False, * canonicalize: Optional[bool] = None, # <<<<<<<<<<<<<< * ) -> str: * """Return a string representation of *url* following the URL serialization */ - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) - /* "w3lib/_url.pyx":1391 + /* "w3lib/_url.pyx":1440 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url( # <<<<<<<<<<<<<< * url: _URL, * *, */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1391, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_exclude_fragment, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_canonicalize, __pyx_kp_s_Optional_bool) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_49_serialize_url, 0, __pyx_n_s_serialize_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_5, __pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_exclude_fragment, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_canonicalize, __pyx_kp_s_Optional_bool) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_51_serialize_url, 0, __pyx_n_s_serialize_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_4, __pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url, __pyx_t_4) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":1506 + * + * + * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< + * url = _parse_url( + * input, + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 1506, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 1506, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1506, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_53_safe_url, 0, __pyx_n_s_safe_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_url, __pyx_t_6) < 0) __PYX_ERR(0, 1506, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url, __pyx_t_5) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "w3lib/_url.pyx":1 * # pylint: disable=protected-access,too-many-instance-attributes,too-many-locals,too-many-nested-blocks,too-many-statements # <<<<<<<<<<<<<< * - * from cython import cfunc, declare, uchar + * import codecs */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /*--- Wrapped vars code ---*/ diff --git a/w3lib/_url.pyx b/w3lib/_url.pyx index 44df98cf..b6773592 100644 --- a/w3lib/_url.pyx +++ b/w3lib/_url.pyx @@ -1,13 +1,14 @@ # pylint: disable=protected-access,too-many-instance-attributes,too-many-locals,too-many-nested-blocks,too-many-statements -from cython import cfunc, declare, uchar - import codecs +import string from functools import lru_cache from math import floor from typing import AnyStr, Callable, Dict, List, Optional, Tuple, Union from urllib.parse import unquote +from cython import bint, cfunc, declare, uchar + from . import _utr46 from ._infra import ( _ASCII_ALPHA, @@ -19,9 +20,20 @@ from ._infra import ( _C0_CONTROL, _C0_CONTROL_OR_SPACE, ) +from ._rfc2396 import ( + _RFC2396_ABS_PATH_PERCENT_ENCODE_SET, + _RFC2396_FRAGMENT_PERCENT_ENCODE_SET, + _RFC2396_QUERY_PERCENT_ENCODE_SET, + _RFC2396_USERINFO_PERCENT_ENCODE_SET, +) +from ._rfc3986 import ( + _RFC3986_FRAGMENT_PERCENT_ENCODE_SET, + _RFC3986_PATH_PERCENT_ENCODE_SET, + _RFC3986_QUERY_PERCENT_ENCODE_SET, + _RFC3986_USERINFO_PERCENT_ENCODE_SET, +) from ._util import _PercentEncodeSet - # https://encoding.spec.whatwg.org/ CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] @@ -615,6 +627,59 @@ _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" +# constants from RFC 3986, Section 2.2 and 2.3 +RFC3986_GEN_DELIMS = b":/?#[]@" +RFC3986_SUB_DELIMS = b"!$&'()*+,;=" +RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS +RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") +EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 + +RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" +_safe_chars = RFC3986_RESERVED + RFC3986_UNRESERVED + EXTRA_SAFE_CHARS + b"%" +_path_safe_chars = _safe_chars.replace(b"#", b"") + +# Characters that are safe in all of: +# +# - RFC 2396 + RFC 2732, as interpreted by Java 8’s java.net.URI class +# - RFC 3986 +# - The URL living standard +# +# NOTE: % is currently excluded from these lists of characters, due to +# limitations of the current safe_url_string implementation, but it should also +# be escaped as %25 when it is not already being used as part of an escape +# character. +_USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") +_PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") +_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS +_SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") +_FRAGMENT_SAFEST_CHARS = _PATH_SAFEST_CHARS + +_SAFE_USERINFO_PERCENT_ENCODE_SET = ( + _USERINFO_PERCENT_ENCODE_SET + | _RFC3986_USERINFO_PERCENT_ENCODE_SET + | _RFC2396_USERINFO_PERCENT_ENCODE_SET +) +_SAFE_PATH_PERCENT_ENCODE_SET = ( + _PATH_PERCENT_ENCODE_SET + | _RFC3986_PATH_PERCENT_ENCODE_SET + | _RFC2396_ABS_PATH_PERCENT_ENCODE_SET +) +_SAFE_QUERY_PERCENT_ENCODE_SET = ( + _QUERY_PERCENT_ENCODE_SET + | _RFC3986_QUERY_PERCENT_ENCODE_SET + | _RFC2396_QUERY_PERCENT_ENCODE_SET +) +_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET = ( + _SPECIAL_QUERY_PERCENT_ENCODE_SET + | _RFC3986_QUERY_PERCENT_ENCODE_SET + | _RFC2396_QUERY_PERCENT_ENCODE_SET +) +_SAFE_FRAGMENT_PERCENT_ENCODE_SET = ( + _FRAGMENT_PERCENT_ENCODE_SET + | _RFC3986_FRAGMENT_PERCENT_ENCODE_SET + | _RFC2396_FRAGMENT_PERCENT_ENCODE_SET +) + # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point _FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" @@ -625,14 +690,14 @@ def _parse_ipv6(input: str) -> List[int]: piece_index = 0 compress = None pointer = 0 - input_lenght = len(input) - if pointer < input_lenght and input[pointer] == ":": - if pointer + 1 >= input_lenght or input[pointer + 1] != ":": + input_length = len(input) + if pointer < input_length and input[pointer] == ":": + if pointer + 1 >= input_length or input[pointer + 1] != ":": raise ValueError pointer += 2 piece_index += 1 compress = piece_index - while pointer < input_lenght: + while pointer < input_length: if piece_index == 8: raise ValueError if input[pointer] == ":": @@ -644,28 +709,28 @@ def _parse_ipv6(input: str) -> List[int]: continue value = length = 0 while ( - length < 4 and pointer < input_lenght and input[pointer] in _ASCII_HEX_DIGIT + length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT ): value = value * 0x10 + int(input[pointer], base=16) pointer += 1 length += 1 - if pointer < input_lenght and input[pointer] == ".": + if pointer < input_length and input[pointer] == ".": if length == 0: raise ValueError pointer -= length if piece_index > 6: raise ValueError numbers_seen = 0 - while pointer < input_lenght: + while pointer < input_length: ipv4_piece = None if numbers_seen > 0: if input[pointer] == "." and numbers_seen < 4: pointer += 1 else: raise ValueError - if pointer >= input_lenght or input[pointer] not in _ASCII_DIGIT: + if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: raise ValueError - while pointer < input_lenght and input[pointer] in _ASCII_DIGIT: + while pointer < input_length and input[pointer] in _ASCII_DIGIT: number = int(input[pointer]) if ipv4_piece is None: ipv4_piece = number @@ -684,11 +749,11 @@ def _parse_ipv6(input: str) -> List[int]: if numbers_seen != 4: raise ValueError break - if pointer < input_lenght and input[pointer] == ":": + if pointer < input_length and input[pointer] == ":": pointer += 1 - if pointer >= input_lenght: + if pointer >= input_length: raise ValueError - elif pointer < input_lenght: + elif pointer < input_length: raise ValueError address[piece_index] = value piece_index += 1 @@ -884,6 +949,10 @@ def _idempotent_utf_8_percent_encode( return _utf_8_percent_encode(code_point, encode_set) +def _preprocess_url(url: str) -> str: + return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) + + def _parse_url( input: str, *, @@ -932,19 +1001,16 @@ def _parse_url( at_sign_seen = inside_brackets = skip_authority_shortcut = False pointer = 0 - input = input.strip(_C0_CONTROL_OR_SPACE) - input = input.translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) + input = _preprocess_url(input) input_length = len(input) while True: - try: - c: Optional[str] = input[pointer] - except IndexError: - c = None + reached_end: bint = pointer >= input_length + if not reached_end: + c: str = input[pointer] if state == SCHEME_START: - if c is not None and c in _ASCII_ALPHA: - assert isinstance(c, str) + if not reached_end and c in _ASCII_ALPHA: buffer += c state = SCHEME else: @@ -952,10 +1018,9 @@ def _parse_url( pointer -= 1 elif state == SCHEME: - if c is not None and c in _SCHEME_CHARS: - assert isinstance(c, str) + if not reached_end and c in _SCHEME_CHARS: buffer += c - elif c == ":": + elif not reached_end and c == ":": url.scheme = buffer.lower() buffer = "" if url.scheme == "file": @@ -980,7 +1045,7 @@ def _parse_url( if base is None: raise ValueError if base.has_opaque_path(): - if c != "#": + if not reached_end and c != "#": raise ValueError url.scheme = base.scheme url.path = base.path @@ -995,7 +1060,7 @@ def _parse_url( pointer -= 1 elif state == SPECIAL_RELATIVE_OR_AUTHORITY: - if c == "/" and input[pointer + 1] == "/": + if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": state = SPECIAL_AUTHORITY_IGNORE_SLASHES pointer += 1 else: @@ -1003,16 +1068,15 @@ def _parse_url( pointer -= 1 elif state == PATH_OR_AUTHORITY: - if c == "/": + if not reached_end and c == "/": state = AUTHORITY else: state = PATH pointer -= 1 elif state == RELATIVE: - assert isinstance(base, _URL) url.scheme = base.scheme - if c == "/" or url.is_special and c == "\\": + if not reached_end and (c == "/" or url.is_special and c == "\\"): state = RELATIVE_SLASH else: url.username = base.username @@ -1021,24 +1085,22 @@ def _parse_url( url.port = base.port url.path = base.path url.query = base.query - if c == "?": + if not reached_end and c == "?": url.query = "" state = QUERY - elif c == "#": + elif not reached_end and c == "#": url.fragment = "" state = FRAGMENT - elif pointer < input_length: + elif not reached_end: url.query = None _shorten_path(url) state = PATH pointer -= 1 elif state == RELATIVE_SLASH: - assert isinstance(base, _URL) - if url.is_special and c is not None and c in "/\\": - assert isinstance(c, str) + if url.is_special and not reached_end and c in "/\\": state = SPECIAL_AUTHORITY_IGNORE_SLASHES - elif c == "/": + elif not reached_end and c == "/": state = AUTHORITY else: url.username = base.username @@ -1049,7 +1111,7 @@ def _parse_url( pointer -= 1 elif state == SPECIAL_AUTHORITY_SLASHES: - if c == "/" and input[pointer + 1] == "/": + if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": state = SPECIAL_AUTHORITY_IGNORE_SLASHES pointer += 1 else: @@ -1057,7 +1119,7 @@ def _parse_url( pointer -= 1 elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: - if c is None or c not in "/\\": + if reached_end or c not in "/\\": state = AUTHORITY pointer -= 1 @@ -1069,7 +1131,7 @@ def _parse_url( else: skip_authority_shortcut = True pointer -= 1 - elif c == "@": + elif not reached_end and c == "@": if at_sign_seen: buffer = "%40" + buffer at_sign_seen = True @@ -1087,7 +1149,7 @@ def _parse_url( else: url.username += encoded_code_points buffer = "" - elif c is None or c in "/?#" or url.is_special and c == "\\": + elif reached_end or c in "/?#" or url.is_special and c == "\\": if at_sign_seen and not buffer: raise ValueError pointer -= len(buffer) + 1 @@ -1097,7 +1159,7 @@ def _parse_url( buffer += c elif state == HOST: - if c == ":" and not inside_brackets: + if not reached_end and c == ":" and not inside_brackets: if not buffer: raise ValueError host = _parse_host(buffer, is_special=url.is_special) @@ -1105,7 +1167,7 @@ def _parse_url( buffer = "" state = PORT url._port_token_seen = True - elif c is None or c in "/?#" or url.is_special and c == "\\": + elif reached_end or c in "/?#" or url.is_special and c == "\\": pointer -= 1 if url.is_special and not buffer: raise ValueError @@ -1113,7 +1175,7 @@ def _parse_url( url.hostname = host buffer = "" state = PATH_START - else: + elif not reached_end: if c == "[": inside_brackets = True elif c == "]": @@ -1121,10 +1183,9 @@ def _parse_url( buffer += c elif state == PORT: - if c is not None and c in _ASCII_DIGIT: - assert isinstance(c, str) + if not reached_end and c in _ASCII_DIGIT: buffer += c - elif c is None or c in "/?#" or url.is_special and c == "\\": + elif reached_end or c in "/?#" or url.is_special and c == "\\": if buffer: port = int(buffer) if port > 2**16 - 1: @@ -1140,21 +1201,19 @@ def _parse_url( elif state == FILE: url.scheme = "file" url.hostname = "" - if c is not None and c in "/\\": - assert isinstance(c, str) + if not reached_end and c in "/\\": state = FILE_SLASH elif base is not None and base.scheme == "file": url.hostname = base.hostname url.path = base.path url.query = base.query - if c == "?": + if not reached_end and c == "?": url.query = "" state = QUERY - elif c == "#": + elif not reached_end and c == "#": url.fragment = "" state = FRAGMENT - elif c is not None: - assert isinstance(c, str) + elif not reached_end: url.query = None if not _starts_with_windows_drive_letter(input[pointer:]): _shorten_path(url) @@ -1167,9 +1226,7 @@ def _parse_url( pointer -= 1 elif state == FILE_SLASH: - assert isinstance(url.path, list) - if c is not None and c in "/\\": - assert isinstance(c, str) + if not reached_end and c in "/\\": state = FILE_HOST else: if base is not None and base.scheme == "file": @@ -1182,7 +1239,7 @@ def _parse_url( pointer -= 1 elif state == FILE_HOST: - if c is None or c in "/\\?#": + if reached_end or c in "/\\?#": pointer -= 1 if _is_windows_drive_letter(buffer): state = PATH @@ -1196,31 +1253,28 @@ def _parse_url( url.hostname = host buffer = "" state = PATH_START - else: - assert isinstance(c, str) + elif not reached_end: buffer += c elif state == PATH_START: if url.is_special: state = PATH - if c is not None and c not in "/\\": - assert isinstance(c, str) - pointer -= 1 - elif c == "?": - url.query = "" - state = QUERY - elif c == "#": - url.fragment = "" - state = FRAGMENT - elif c is not None: - assert isinstance(c, str) - state = PATH - if c != "/": + if not reached_end and c not in "/\\": pointer -= 1 + elif not reached_end: + if c == "?": + url.query = "" + state = QUERY + elif c == "#": + url.fragment = "" + state = FRAGMENT + else: + state = PATH + if c != "/": + pointer -= 1 elif state == PATH: - assert isinstance(url.path, list) - if c is None or c == "/" or (url.is_special and c == "\\") or c in "?#": + if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": if _is_double_dot_path_segment(buffer): _shorten_path(url) if c != "/" and not (url.is_special and c == "\\"): @@ -1238,21 +1292,21 @@ def _parse_url( if ( not url.path and not buffer - and c is not None + and not reached_end and c in "?#" and input[pointer - 1] not in "/\\" ): url._path_token_seen = True url.path.append(buffer) buffer = "" - if c == "?": - url.query = "" - state = QUERY - elif c == "#": - url.fragment = "" - state = FRAGMENT + if not reached_end: + if c == "?": + url.query = "" + state = QUERY + elif c == "#": + url.fragment = "" + state = FRAGMENT else: - assert isinstance(c, str) buffer += _idempotent_utf_8_percent_encode( input=input, pointer=pointer, @@ -1260,28 +1314,26 @@ def _parse_url( ) elif state == OPAQUE_PATH: - assert isinstance(url.path, str) - if c == "?": - url.query = "" - state = QUERY - elif c == "#": - url.fragment = "" - state = FRAGMENT - elif c is not None: - assert isinstance(c, str) - encoded = _utf_8_percent_encode( - c, - _C0_CONTROL_PERCENT_ENCODE_SET, - ) - url.path += encoded + if not reached_end: + if c == "?": + url.query = "" + state = QUERY + elif c == "#": + url.fragment = "" + state = FRAGMENT + else: + encoded = _utf_8_percent_encode( + c, + _C0_CONTROL_PERCENT_ENCODE_SET, + ) + url.path += encoded elif state == QUERY: - assert isinstance(url.query, str) if encoding != "utf-8" and ( not url.is_special or url.scheme in ("ws", "wss") ): encoding = "utf-8" - if c == "#" or c is None: + if reached_end or c == "#": percent_encode_set = ( special_query_percent_encode_set if url.is_special @@ -1293,17 +1345,14 @@ def _parse_url( percent_encode_set=percent_encode_set, ) buffer = "" - if c == "#": + if not reached_end and c == "#": url.fragment = "" state = FRAGMENT - elif c is not None: - assert isinstance(c, str) + elif not reached_end: buffer += c elif state == FRAGMENT: - assert isinstance(url.fragment, str) - if c is not None: - assert isinstance(c, str) + if not reached_end: url.fragment += _idempotent_utf_8_percent_encode( input=input, pointer=pointer, encode_set=fragment_percent_encode_set ) @@ -1452,3 +1501,16 @@ def _serialize_url( if not exclude_fragment and url.fragment is not None: output += f"#{url.fragment}" return output + + +def _safe_url(input: str, encoding: str) -> str: + url = _parse_url( + input, + encoding=encoding, + userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, + path_percent_encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, + query_percent_encode_set=_SAFE_QUERY_PERCENT_ENCODE_SET, + special_query_percent_encode_set=_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET, + fragment_percent_encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET, + ) + return _serialize_url(url, canonicalize=False) diff --git a/w3lib/_util.c b/w3lib/_util.c index 9178ab54..1f9b3750 100644 --- a/w3lib/_util.c +++ b/w3lib/_util.c @@ -1733,6 +1733,244 @@ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); +/* Profile.proto */ +#ifndef CYTHON_PROFILE +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + #define CYTHON_PROFILE 0 +#else + #define CYTHON_PROFILE 1 +#endif +#endif +#ifndef CYTHON_TRACE_NOGIL + #define CYTHON_TRACE_NOGIL 0 +#else + #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) + #define CYTHON_TRACE 1 + #endif +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL(frame) + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) + #endif + #define __Pyx_TraceDeclarations\ + static PyCodeObject *__pyx_frame_code = NULL;\ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceFrameInit(codeobj)\ + if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; +#if PY_VERSION_HEX >= 0x030b00a2 + #if PY_VERSION_HEX >= 0x030C00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + ((!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #endif + #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) + #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) +#elif PY_VERSION_HEX >= 0x030a00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#endif + #ifdef WITH_THREAD + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + }\ + PyGILState_Release(state);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #else + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + { PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #endif + #define __Pyx_TraceException()\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 1)) {\ + __Pyx_EnterTracing(tstate);\ + PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ + if (exc_info) {\ + if (CYTHON_TRACE && tstate->c_tracefunc)\ + tstate->c_tracefunc(\ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + tstate->c_profilefunc(\ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + Py_DECREF(exc_info);\ + }\ + __Pyx_LeaveTracing(tstate);\ + }\ + } + static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_EnterTracing(tstate); + if (CYTHON_TRACE && tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); + if (tstate->c_profilefunc) + tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); + CYTHON_FRAME_DEL(frame); + __Pyx_LeaveTracing(tstate); + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } + #ifdef WITH_THREAD + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + PyGILState_Release(state);\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + }\ + } + #else + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + } + #endif + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceFrameInit(codeobj) + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result, nogil) +#endif +#if CYTHON_TRACE + static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { + int ret; + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_PyFrame_SetLineNumber(frame, lineno); + __Pyx_EnterTracing(tstate); + ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); + __Pyx_LeaveTracing(tstate); + if (likely(!ret)) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + } + return ret; + } + #ifdef WITH_THREAD + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + int ret = 0;\ + PyThreadState *tstate;\ + PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + }\ + __Pyx_PyGILState_Release(state);\ + if (unlikely(ret)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + }\ + } + #else + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + } + #endif +#else + #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; +#endif + /* RaiseUnboundLocalError.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); @@ -2337,13 +2575,13 @@ static PyObject *__pyx_builtin_chr; static PyObject *__pyx_builtin_sorted; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = ""; -static const char __pyx_k__2[] = ""; -static const char __pyx_k__3[] = ")"; -static const char __pyx_k__4[] = "."; +static const char __pyx_k__3[] = ""; static const char __pyx_k_cp[] = "cp"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_gt[] = "gt"; static const char __pyx_k_or[] = "__or__"; +static const char __pyx_k__10[] = ")"; +static const char __pyx_k__11[] = "."; static const char __pyx_k__18[] = "?"; static const char __pyx_k_add[] = "__add__"; static const char __pyx_k_and[] = "__and__"; @@ -2470,10 +2708,10 @@ typedef struct { PyObject *__pyx_kp_s_Set_of_code_points_that_require; PyObject *__pyx_n_s_Union; PyObject *__pyx_kp_s_Union_int_str; + PyObject *__pyx_kp_u__10; + PyObject *__pyx_kp_u__11; PyObject *__pyx_n_s__18; - PyObject *__pyx_kp_u__2; PyObject *__pyx_kp_u__3; - PyObject *__pyx_kp_u__4; PyObject *__pyx_n_s_add; PyObject *__pyx_n_s_and; PyObject *__pyx_n_s_args; @@ -2531,19 +2769,19 @@ typedef struct { PyObject *__pyx_n_s_w3lib__util; PyObject *__pyx_kp_s_w3lib__util_pyx; PyObject *__pyx_int_1; - PyObject *__pyx_tuple__5; - PyObject *__pyx_tuple__7; - PyObject *__pyx_tuple__9; - PyObject *__pyx_tuple__11; + PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__13; + PyObject *__pyx_tuple__14; + PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__16; + PyObject *__pyx_tuple__17; + PyObject *__pyx_codeobj__2; + PyObject *__pyx_codeobj__4; + PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__6; + PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__8; - PyObject *__pyx_codeobj__10; - PyObject *__pyx_codeobj__12; - PyObject *__pyx_codeobj__14; - PyObject *__pyx_codeobj__15; - PyObject *__pyx_codeobj__17; + PyObject *__pyx_codeobj__9; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -2605,10 +2843,10 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_s_Set_of_code_points_that_require); Py_CLEAR(clear_module_state->__pyx_n_s_Union); Py_CLEAR(clear_module_state->__pyx_kp_s_Union_int_str); + Py_CLEAR(clear_module_state->__pyx_kp_u__10); + Py_CLEAR(clear_module_state->__pyx_kp_u__11); Py_CLEAR(clear_module_state->__pyx_n_s__18); - Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_kp_u__3); - Py_CLEAR(clear_module_state->__pyx_kp_u__4); Py_CLEAR(clear_module_state->__pyx_n_s_add); Py_CLEAR(clear_module_state->__pyx_n_s_and); Py_CLEAR(clear_module_state->__pyx_n_s_args); @@ -2666,19 +2904,19 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_w3lib__util); Py_CLEAR(clear_module_state->__pyx_kp_s_w3lib__util_pyx); Py_CLEAR(clear_module_state->__pyx_int_1); - Py_CLEAR(clear_module_state->__pyx_tuple__5); - Py_CLEAR(clear_module_state->__pyx_tuple__7); - Py_CLEAR(clear_module_state->__pyx_tuple__9); - Py_CLEAR(clear_module_state->__pyx_tuple__11); + Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__13); + Py_CLEAR(clear_module_state->__pyx_tuple__14); + Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__16); + Py_CLEAR(clear_module_state->__pyx_tuple__17); + Py_CLEAR(clear_module_state->__pyx_codeobj__2); + Py_CLEAR(clear_module_state->__pyx_codeobj__4); + Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__6); + Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__8); - Py_CLEAR(clear_module_state->__pyx_codeobj__10); - Py_CLEAR(clear_module_state->__pyx_codeobj__12); - Py_CLEAR(clear_module_state->__pyx_codeobj__14); - Py_CLEAR(clear_module_state->__pyx_codeobj__15); - Py_CLEAR(clear_module_state->__pyx_codeobj__17); + Py_CLEAR(clear_module_state->__pyx_codeobj__9); return 0; } #endif @@ -2718,10 +2956,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_s_Set_of_code_points_that_require); Py_VISIT(traverse_module_state->__pyx_n_s_Union); Py_VISIT(traverse_module_state->__pyx_kp_s_Union_int_str); + Py_VISIT(traverse_module_state->__pyx_kp_u__10); + Py_VISIT(traverse_module_state->__pyx_kp_u__11); Py_VISIT(traverse_module_state->__pyx_n_s__18); - Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_kp_u__3); - Py_VISIT(traverse_module_state->__pyx_kp_u__4); Py_VISIT(traverse_module_state->__pyx_n_s_add); Py_VISIT(traverse_module_state->__pyx_n_s_and); Py_VISIT(traverse_module_state->__pyx_n_s_args); @@ -2779,19 +3017,19 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_w3lib__util); Py_VISIT(traverse_module_state->__pyx_kp_s_w3lib__util_pyx); Py_VISIT(traverse_module_state->__pyx_int_1); - Py_VISIT(traverse_module_state->__pyx_tuple__5); - Py_VISIT(traverse_module_state->__pyx_tuple__7); - Py_VISIT(traverse_module_state->__pyx_tuple__9); - Py_VISIT(traverse_module_state->__pyx_tuple__11); + Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__13); + Py_VISIT(traverse_module_state->__pyx_tuple__14); + Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__16); + Py_VISIT(traverse_module_state->__pyx_tuple__17); + Py_VISIT(traverse_module_state->__pyx_codeobj__2); + Py_VISIT(traverse_module_state->__pyx_codeobj__4); + Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__6); + Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__8); - Py_VISIT(traverse_module_state->__pyx_codeobj__10); - Py_VISIT(traverse_module_state->__pyx_codeobj__12); - Py_VISIT(traverse_module_state->__pyx_codeobj__14); - Py_VISIT(traverse_module_state->__pyx_codeobj__15); - Py_VISIT(traverse_module_state->__pyx_codeobj__17); + Py_VISIT(traverse_module_state->__pyx_codeobj__9); return 0; } #endif @@ -2841,10 +3079,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_s_Set_of_code_points_that_require __pyx_mstate_global->__pyx_kp_s_Set_of_code_points_that_require #define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union #define __pyx_kp_s_Union_int_str __pyx_mstate_global->__pyx_kp_s_Union_int_str +#define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10 +#define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11 #define __pyx_n_s__18 __pyx_mstate_global->__pyx_n_s__18 -#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 -#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 #define __pyx_n_s_add __pyx_mstate_global->__pyx_n_s_add #define __pyx_n_s_and __pyx_mstate_global->__pyx_n_s_and #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args @@ -2902,19 +3140,19 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_w3lib__util __pyx_mstate_global->__pyx_n_s_w3lib__util #define __pyx_kp_s_w3lib__util_pyx __pyx_mstate_global->__pyx_kp_s_w3lib__util_pyx #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 -#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 -#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 -#define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 -#define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 +#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 +#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 +#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 +#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 +#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 +#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 +#define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 +#define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 -#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 -#define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 -#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 -#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 -#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 +#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 /* #### Code section: module_code ### */ /* "w3lib/_util.pyx":18 @@ -2933,8 +3171,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_5_util_17_PercentEncodeSet___init__, "_PercentEncodeSet.__init__(self, unicode code_points: str, *, greater_than: Union[int, str] = u'\\x7f', exclude: bool = False)"); -static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_5_util_17_PercentEncodeSet___init__}; +static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3124,6 +3361,7 @@ static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator { struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); @@ -3134,9 +3372,11 @@ static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); + __Pyx_TraceCall("genexpr", __pyx_f[0], 30, 0, __PYX_ERR(0, 30, __pyx_L1_error)); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ + __Pyx_TraceReturn(Py_None, 0); __Pyx_RefNannyFinishContext(); return NULL; } @@ -3283,6 +3523,7 @@ static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3299,6 +3540,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ *__pyx_cur_scope; PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator = 0; PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations int __pyx_t_1; long __pyx_t_2; @@ -3307,6 +3549,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__2) __Pyx_RefNannySetupContext("__init__", 0); __pyx_cur_scope = (struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ *)__pyx_tp_new_5w3lib_5_util___pyx_scope_struct____init__(__pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { @@ -3316,6 +3559,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } + __Pyx_TraceCall("__init__", __pyx_f[0], 18, 0, __PYX_ERR(0, 18, __pyx_L1_error)); __pyx_cur_scope->__pyx_v_code_points = __pyx_v_code_points; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_code_points); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_code_points); @@ -3409,7 +3653,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__3, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_code_points); @@ -3456,6 +3700,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS __Pyx_XDECREF(__pyx_v_greater_than); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3476,8 +3721,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_5_util_17_PercentEncodeSet_2__contains__, "_PercentEncodeSet.__contains__(self, unicode code_point: str) -> bool"); -static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_3__contains__ = {"__contains__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_3__contains__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_5_util_17_PercentEncodeSet_2__contains__}; +static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_3__contains__ = {"__contains__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_3__contains__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_3__contains__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3587,6 +3831,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_point) { PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -3597,7 +3842,9 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(CYTHON int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__4) __Pyx_RefNannySetupContext("__contains__", 1); + __Pyx_TraceCall("__contains__", __pyx_f[0], 36, 0, __PYX_ERR(0, 36, __pyx_L1_error)); /* "w3lib/_util.pyx":37 * @@ -3653,6 +3900,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(CYTHON __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3673,8 +3921,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_5_util_17_PercentEncodeSet_4__add__, "_PercentEncodeSet.__add__(self, unicode code_points: str) -> '_PercentEncodeSet'"); -static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_5__add__ = {"__add__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_5__add__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_5_util_17_PercentEncodeSet_4__add__}; +static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_5__add__ = {"__add__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_5__add__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_5__add__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3784,6 +4031,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_points) { PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -3792,7 +4040,9 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(CYTHON_UNUS int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__5) __Pyx_RefNannySetupContext("__add__", 1); + __Pyx_TraceCall("__add__", __pyx_f[0], 39, 0, __PYX_ERR(0, 39, __pyx_L1_error)); /* "w3lib/_util.pyx":40 * @@ -3879,6 +4129,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(CYTHON_UNUS __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3899,8 +4150,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_5_util_17_PercentEncodeSet_6__sub__, "_PercentEncodeSet.__sub__(self, unicode code_points: str) -> '_PercentEncodeSet'"); -static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_7__sub__ = {"__sub__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_7__sub__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_5_util_17_PercentEncodeSet_6__sub__}; +static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_7__sub__ = {"__sub__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_7__sub__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_7__sub__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4012,6 +4262,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS PyObject *__pyx_v_new_code_points = NULL; Py_UCS4 __pyx_v_code_point; PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -4027,7 +4278,9 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__6) __Pyx_RefNannySetupContext("__sub__", 1); + __Pyx_TraceCall("__sub__", __pyx_f[0], 45, 0, __PYX_ERR(0, 45, __pyx_L1_error)); /* "w3lib/_util.pyx":46 * @@ -4081,7 +4334,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_10, __pyx_kp_u__2}; + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_10, __pyx_kp_u__3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -4168,6 +4421,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS __pyx_L0:; __Pyx_XDECREF(__pyx_v_new_code_points); __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4188,8 +4442,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_5_util_17_PercentEncodeSet_8__or__, "_PercentEncodeSet.__or__(self, other: '_PercentEncodeSet') -> '_PercentEncodeSet'"); -static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_9__or__ = {"__or__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_9__or__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_5_util_17_PercentEncodeSet_8__or__}; +static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_9__or__ = {"__or__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_9__or__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_9__or__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4296,6 +4549,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSE PyObject *__pyx_v_greater_than = NULL; PyObject *__pyx_v_code_points = NULL; PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -4305,7 +4559,9 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSE int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__7) __Pyx_RefNannySetupContext("__or__", 1); + __Pyx_TraceCall("__or__", __pyx_f[0], 54, 0, __PYX_ERR(0, 54, __pyx_L1_error)); /* "w3lib/_util.pyx":55 * @@ -4357,7 +4613,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSE __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_code_points = ((PyObject*)__pyx_t_2); @@ -4434,6 +4690,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSE __Pyx_XDECREF(__pyx_v_greater_than); __Pyx_XDECREF(__pyx_v_code_points); __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4454,8 +4711,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_5_util_17_PercentEncodeSet_10__and__, "_PercentEncodeSet.__and__(self, other: '_PercentEncodeSet') -> '_PercentEncodeSet'"); -static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_11__and__ = {"__and__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_11__and__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_5_util_17_PercentEncodeSet_10__and__}; +static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_11__and__ = {"__and__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_11__and__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_11__and__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4562,6 +4818,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNU PyObject *__pyx_v_greater_than = NULL; PyObject *__pyx_v_code_points = NULL; PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -4571,7 +4828,9 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNU int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__8) __Pyx_RefNannySetupContext("__and__", 1); + __Pyx_TraceCall("__and__", __pyx_f[0], 62, 0, __PYX_ERR(0, 62, __pyx_L1_error)); /* "w3lib/_util.pyx":63 * @@ -4623,7 +4882,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNU __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_code_points = ((PyObject*)__pyx_t_2); @@ -4700,6 +4959,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNU __Pyx_XDECREF(__pyx_v_greater_than); __Pyx_XDECREF(__pyx_v_code_points); __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4720,8 +4980,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_5_util_17_PercentEncodeSet_12__repr__, "_PercentEncodeSet.__repr__(self) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_13__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_13__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_5_util_17_PercentEncodeSet_12__repr__}; +static PyMethodDef __pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_13__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_13__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_5_util_17_PercentEncodeSet_13__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4813,6 +5072,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UN PyObject *__pyx_v_cp = NULL; PyObject *__pyx_v_gt = NULL; PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -4822,7 +5082,9 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UN int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__9) __Pyx_RefNannySetupContext("__repr__", 1); + __Pyx_TraceCall("__repr__", __pyx_f[0], 70, 0, __PYX_ERR(0, 70, __pyx_L1_error)); /* "w3lib/_util.pyx":71 * @@ -4851,7 +5113,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UN __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__3, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_cp = ((PyObject*)__pyx_t_2); @@ -4903,10 +5165,10 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UN __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2); __pyx_t_2 = 0; - __Pyx_INCREF(__pyx_kp_u__3); + __Pyx_INCREF(__pyx_kp_u__10); __pyx_t_4 += 1; - __Pyx_GIVEREF(__pyx_kp_u__3); - PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__3); + __Pyx_GIVEREF(__pyx_kp_u__10); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__10); __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4933,6 +5195,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UN __Pyx_XDECREF(__pyx_v_cp); __Pyx_XDECREF(__pyx_v_gt); __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5282,10 +5545,10 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_s_Set_of_code_points_that_require, __pyx_k_Set_of_code_points_that_require, sizeof(__pyx_k_Set_of_code_points_that_require), 0, 0, 1, 0}, {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, {&__pyx_kp_s_Union_int_str, __pyx_k_Union_int_str, sizeof(__pyx_k_Union_int_str), 0, 0, 1, 0}, + {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0}, + {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, {&__pyx_n_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 1}, - {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, - {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, {&__pyx_n_s_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, @@ -5368,10 +5631,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * self, * code_points: str, */ - __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_code_points, __pyx_n_s_greater_than, __pyx_n_s_exclude, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_init, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_code_points, __pyx_n_s_greater_than, __pyx_n_s_exclude, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_init, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 18, __pyx_L1_error) /* "w3lib/_util.pyx":36 * self._code_points = code_points @@ -5380,10 +5643,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * return code_point in self._code_points or ord(code_point) > self._greater_than * */ - __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 36, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_contains, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_contains, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 36, __pyx_L1_error) /* "w3lib/_util.pyx":39 * return code_point in self._code_points or ord(code_point) > self._greater_than @@ -5392,10 +5655,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * return _PercentEncodeSet( * self._code_points + code_points, */ - __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_code_points); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_add, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_code_points); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_add, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 39, __pyx_L1_error) /* "w3lib/_util.pyx":45 * ) @@ -5404,10 +5667,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * new_code_points = self._code_points * for code_point in code_points: */ - __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_code_points, __pyx_n_s_new_code_points, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_sub, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_tuple__15 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_code_points, __pyx_n_s_new_code_points, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_sub, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 45, __pyx_L1_error) /* "w3lib/_util.pyx":54 * ) @@ -5416,10 +5679,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * greater_than = min(self._greater_than, other._greater_than) * code_points = "".join(set(self._code_points) | set(other._code_points)) */ - __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_greater_than, __pyx_n_s_code_points); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_or, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_tuple__16 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_greater_than, __pyx_n_s_code_points); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_or, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 54, __pyx_L1_error) /* "w3lib/_util.pyx":62 * ) @@ -5428,7 +5691,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * greater_than = max(self._greater_than, other._greater_than) * code_points = "".join(set(self._code_points) & set(other._code_points)) */ - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_and, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_and, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 62, __pyx_L1_error) /* "w3lib/_util.pyx":70 * ) @@ -5437,10 +5700,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cp = "".join(sorted(tuple(self._code_points), key=ord)) * gt = chr(self._greater_than) */ - __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_cp, __pyx_n_s_gt); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 70, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_repr, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_cp, __pyx_n_s_gt); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_repr, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -5732,6 +5995,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__util(PyObject *__pyx_pyinit_modul #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -5851,6 +6115,7 @@ if (!__Pyx_RefNanny) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif + __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__util(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); /* "w3lib/_util.pyx":1 * from typing import Union # <<<<<<<<<<<<<< @@ -5897,7 +6162,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 18, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_greater_than, __pyx_kp_s_Union_int_str) < 0) __PYX_ERR(0, 18, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_exclude, __pyx_n_s_bool) < 0) __PYX_ERR(0, 18, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_1__init__, 0, __pyx_n_s_PercentEncodeSet___init, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_1__init__, 0, __pyx_n_s_PercentEncodeSet___init, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_5, __pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); @@ -5917,7 +6182,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_code_point, __pyx_n_s_str) < 0) __PYX_ERR(0, 36, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_3__contains__, 0, __pyx_n_s_PercentEncodeSet___contains, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_3__contains__, 0, __pyx_n_s_PercentEncodeSet___contains, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -5935,7 +6200,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 39, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 39, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_5__add__, 0, __pyx_n_s_PercentEncodeSet___add, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_5__add__, 0, __pyx_n_s_PercentEncodeSet___add, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5953,7 +6218,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 45, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_7__sub__, 0, __pyx_n_s_PercentEncodeSet___sub, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_7__sub__, 0, __pyx_n_s_PercentEncodeSet___sub, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -5971,7 +6236,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_other, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_9__or__, 0, __pyx_n_s_PercentEncodeSet___or, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_9__or__, 0, __pyx_n_s_PercentEncodeSet___or, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5989,7 +6254,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_other, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_11__and__, 0, __pyx_n_s_PercentEncodeSet___and, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_11__and__, 0, __pyx_n_s_PercentEncodeSet___and, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -6006,7 +6271,7 @@ if (!__Pyx_RefNanny) { __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 70, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_13__repr__, 0, __pyx_n_s_PercentEncodeSet___repr, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_13__repr__, 0, __pyx_n_s_PercentEncodeSet___repr, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -6035,6 +6300,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_TraceReturn(Py_None, 0); /*--- Wrapped vars code ---*/ @@ -6714,6 +6980,96 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam return 0; } +/* Profile */ +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + PyThreadState* tstate, + const char *funcname, + const char *srcfile, + int firstlineno) { + PyObject *type, *value, *traceback; + int retval; + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); + retval = 1; + __Pyx_EnterTracing(tstate); + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + #if CYTHON_TRACE + if (tstate->c_tracefunc) + retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; + if (retval && tstate->c_profilefunc) + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + __Pyx_LeaveTracing(tstate); + if (retval) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + return __Pyx_IsTracing(tstate, 0, 0) && retval; + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + return -1; + } +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyCodeObject *py_code = 0; +#if PY_MAJOR_VERSION >= 3 + py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); + if (likely(py_code)) { + py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; + } +#else + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + py_funcname = PyString_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + py_srcfile = PyString_FromString(srcfile); + if (unlikely(!py_srcfile)) goto bad; + py_code = PyCode_New( + 0, + 0, + 0, + CO_OPTIMIZED | CO_NEWLOCALS, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); +#endif + return py_code; +} +#endif + /* RaiseUnboundLocalError */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); @@ -7971,7 +8327,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__4); + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__11); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } diff --git a/w3lib/_utr46.c b/w3lib/_utr46.c index cafff2d0..5de800b9 100644 --- a/w3lib/_utr46.c +++ b/w3lib/_utr46.c @@ -1733,6 +1733,244 @@ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); +/* Profile.proto */ +#ifndef CYTHON_PROFILE +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + #define CYTHON_PROFILE 0 +#else + #define CYTHON_PROFILE 1 +#endif +#endif +#ifndef CYTHON_TRACE_NOGIL + #define CYTHON_TRACE_NOGIL 0 +#else + #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) + #define CYTHON_TRACE 1 + #endif +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL(frame) + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) + #endif + #define __Pyx_TraceDeclarations\ + static PyCodeObject *__pyx_frame_code = NULL;\ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceFrameInit(codeobj)\ + if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; +#if PY_VERSION_HEX >= 0x030b00a2 + #if PY_VERSION_HEX >= 0x030C00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + ((!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #endif + #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) + #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) +#elif PY_VERSION_HEX >= 0x030a00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#endif + #ifdef WITH_THREAD + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + }\ + PyGILState_Release(state);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #else + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + { PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #endif + #define __Pyx_TraceException()\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 1)) {\ + __Pyx_EnterTracing(tstate);\ + PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ + if (exc_info) {\ + if (CYTHON_TRACE && tstate->c_tracefunc)\ + tstate->c_tracefunc(\ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + tstate->c_profilefunc(\ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + Py_DECREF(exc_info);\ + }\ + __Pyx_LeaveTracing(tstate);\ + }\ + } + static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_EnterTracing(tstate); + if (CYTHON_TRACE && tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); + if (tstate->c_profilefunc) + tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); + CYTHON_FRAME_DEL(frame); + __Pyx_LeaveTracing(tstate); + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } + #ifdef WITH_THREAD + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + PyGILState_Release(state);\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + }\ + } + #else + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + } + #endif + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceFrameInit(codeobj) + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result, nogil) +#endif +#if CYTHON_TRACE + static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { + int ret; + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_PyFrame_SetLineNumber(frame, lineno); + __Pyx_EnterTracing(tstate); + ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); + __Pyx_LeaveTracing(tstate); + if (likely(!ret)) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + } + return ret; + } + #ifdef WITH_THREAD + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + int ret = 0;\ + PyThreadState *tstate;\ + PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + }\ + __Pyx_PyGILState_Release(state);\ + if (unlikely(ret)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + }\ + } + #else + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + } + #endif +#else + #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; +#endif + /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) @@ -2561,19 +2799,14 @@ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_enumerate; /* #### Code section: string_decls ### */ -static const char __pyx_k_[] = ""; static const char __pyx_k_M[] = "M"; static const char __pyx_k_R[] = "R"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_AL[] = "AL"; static const char __pyx_k_AN[] = "AN"; -static const char __pyx_k__2[] = " "; -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__9[] = ")."; +static const char __pyx_k__3[] = ""; +static const char __pyx_k__4[] = " "; +static const char __pyx_k__7[] = "#"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_is[] = " is "; @@ -2581,7 +2814,12 @@ static const char __pyx_k_re[] = "re"; static const char __pyx_k_xn[] = "xn--"; static const char __pyx_k_04X[] = "04X"; static const char __pyx_k_NFC[] = "NFC"; -static const char __pyx_k__11[] = "*"; +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__14[] = ")."; +static const char __pyx_k__20[] = "*"; static const char __pyx_k__30[] = "?"; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_cls[] = "cls"; @@ -2792,7 +3030,6 @@ typedef struct { #endif PyTypeObject *__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr; PyTypeObject *__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr; - PyObject *__pyx_kp_u_; PyObject *__pyx_kp_u_04X; PyObject *__pyx_n_u_AL; PyObject *__pyx_n_u_AN; @@ -2833,15 +3070,16 @@ typedef struct { PyObject *__pyx_kp_u_Unknown_IDNA_mapping_table_statu; PyObject *__pyx_n_s_VALID; PyObject *__pyx_n_s_ValueError; - PyObject *__pyx_n_s__11; - PyObject *__pyx_kp_u__2; + PyObject *__pyx_kp_u__10; + PyObject *__pyx_kp_u__11; + PyObject *__pyx_kp_u__12; + PyObject *__pyx_kp_u__13; + PyObject *__pyx_kp_u__14; + PyObject *__pyx_n_s__20; PyObject *__pyx_kp_u__3; PyObject *__pyx_n_s__30; - PyObject *__pyx_kp_u__5; - PyObject *__pyx_kp_u__6; + PyObject *__pyx_kp_u__4; PyObject *__pyx_kp_u__7; - PyObject *__pyx_kp_u__8; - PyObject *__pyx_kp_u__9; PyObject *__pyx_n_s_args; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_auto; @@ -2984,26 +3222,26 @@ typedef struct { PyObject *__pyx_int_1; PyObject *__pyx_int_4; PyObject *__pyx_int_16; - PyObject *__pyx_tuple__4; - PyObject *__pyx_slice__10; - PyObject *__pyx_tuple__12; - PyObject *__pyx_tuple__14; - PyObject *__pyx_tuple__16; - PyObject *__pyx_tuple__18; - PyObject *__pyx_tuple__20; + PyObject *__pyx_codeobj_; + PyObject *__pyx_tuple__8; + PyObject *__pyx_slice__17; + PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__22; + PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__24; + PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__26; + PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__28; - PyObject *__pyx_codeobj__13; + PyObject *__pyx_tuple__29; + PyObject *__pyx_codeobj__2; + PyObject *__pyx_codeobj__5; + PyObject *__pyx_codeobj__6; + PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__15; - PyObject *__pyx_codeobj__17; + PyObject *__pyx_codeobj__16; + PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; - PyObject *__pyx_codeobj__21; - PyObject *__pyx_codeobj__23; - PyObject *__pyx_codeobj__25; - PyObject *__pyx_codeobj__27; - PyObject *__pyx_codeobj__29; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -3050,7 +3288,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr); Py_CLEAR(clear_module_state->__pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr); - Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_kp_u_04X); Py_CLEAR(clear_module_state->__pyx_n_u_AL); Py_CLEAR(clear_module_state->__pyx_n_u_AN); @@ -3091,15 +3328,16 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_u_Unknown_IDNA_mapping_table_statu); Py_CLEAR(clear_module_state->__pyx_n_s_VALID); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); - Py_CLEAR(clear_module_state->__pyx_n_s__11); - Py_CLEAR(clear_module_state->__pyx_kp_u__2); + Py_CLEAR(clear_module_state->__pyx_kp_u__10); + Py_CLEAR(clear_module_state->__pyx_kp_u__11); + Py_CLEAR(clear_module_state->__pyx_kp_u__12); + Py_CLEAR(clear_module_state->__pyx_kp_u__13); + Py_CLEAR(clear_module_state->__pyx_kp_u__14); + Py_CLEAR(clear_module_state->__pyx_n_s__20); Py_CLEAR(clear_module_state->__pyx_kp_u__3); Py_CLEAR(clear_module_state->__pyx_n_s__30); - Py_CLEAR(clear_module_state->__pyx_kp_u__5); - Py_CLEAR(clear_module_state->__pyx_kp_u__6); + Py_CLEAR(clear_module_state->__pyx_kp_u__4); Py_CLEAR(clear_module_state->__pyx_kp_u__7); - Py_CLEAR(clear_module_state->__pyx_kp_u__8); - Py_CLEAR(clear_module_state->__pyx_kp_u__9); Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_auto); @@ -3242,26 +3480,26 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_4); Py_CLEAR(clear_module_state->__pyx_int_16); - Py_CLEAR(clear_module_state->__pyx_tuple__4); - Py_CLEAR(clear_module_state->__pyx_slice__10); - Py_CLEAR(clear_module_state->__pyx_tuple__12); - Py_CLEAR(clear_module_state->__pyx_tuple__14); - Py_CLEAR(clear_module_state->__pyx_tuple__16); - Py_CLEAR(clear_module_state->__pyx_tuple__18); - Py_CLEAR(clear_module_state->__pyx_tuple__20); + Py_CLEAR(clear_module_state->__pyx_codeobj_); + Py_CLEAR(clear_module_state->__pyx_tuple__8); + Py_CLEAR(clear_module_state->__pyx_slice__17); + Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__22); + Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__24); + Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__26); + Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__28); - Py_CLEAR(clear_module_state->__pyx_codeobj__13); + Py_CLEAR(clear_module_state->__pyx_tuple__29); + Py_CLEAR(clear_module_state->__pyx_codeobj__2); + Py_CLEAR(clear_module_state->__pyx_codeobj__5); + Py_CLEAR(clear_module_state->__pyx_codeobj__6); + Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__15); - Py_CLEAR(clear_module_state->__pyx_codeobj__17); + Py_CLEAR(clear_module_state->__pyx_codeobj__16); + Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__19); - Py_CLEAR(clear_module_state->__pyx_codeobj__21); - Py_CLEAR(clear_module_state->__pyx_codeobj__23); - Py_CLEAR(clear_module_state->__pyx_codeobj__25); - Py_CLEAR(clear_module_state->__pyx_codeobj__27); - Py_CLEAR(clear_module_state->__pyx_codeobj__29); return 0; } #endif @@ -3286,7 +3524,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr); Py_VISIT(traverse_module_state->__pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr); - Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_kp_u_04X); Py_VISIT(traverse_module_state->__pyx_n_u_AL); Py_VISIT(traverse_module_state->__pyx_n_u_AN); @@ -3327,15 +3564,16 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_u_Unknown_IDNA_mapping_table_statu); Py_VISIT(traverse_module_state->__pyx_n_s_VALID); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); - Py_VISIT(traverse_module_state->__pyx_n_s__11); - Py_VISIT(traverse_module_state->__pyx_kp_u__2); + Py_VISIT(traverse_module_state->__pyx_kp_u__10); + Py_VISIT(traverse_module_state->__pyx_kp_u__11); + Py_VISIT(traverse_module_state->__pyx_kp_u__12); + Py_VISIT(traverse_module_state->__pyx_kp_u__13); + Py_VISIT(traverse_module_state->__pyx_kp_u__14); + Py_VISIT(traverse_module_state->__pyx_n_s__20); Py_VISIT(traverse_module_state->__pyx_kp_u__3); Py_VISIT(traverse_module_state->__pyx_n_s__30); - Py_VISIT(traverse_module_state->__pyx_kp_u__5); - Py_VISIT(traverse_module_state->__pyx_kp_u__6); + Py_VISIT(traverse_module_state->__pyx_kp_u__4); Py_VISIT(traverse_module_state->__pyx_kp_u__7); - Py_VISIT(traverse_module_state->__pyx_kp_u__8); - Py_VISIT(traverse_module_state->__pyx_kp_u__9); Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_auto); @@ -3478,26 +3716,26 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_4); Py_VISIT(traverse_module_state->__pyx_int_16); - Py_VISIT(traverse_module_state->__pyx_tuple__4); - Py_VISIT(traverse_module_state->__pyx_slice__10); - Py_VISIT(traverse_module_state->__pyx_tuple__12); - Py_VISIT(traverse_module_state->__pyx_tuple__14); - Py_VISIT(traverse_module_state->__pyx_tuple__16); - Py_VISIT(traverse_module_state->__pyx_tuple__18); - Py_VISIT(traverse_module_state->__pyx_tuple__20); + Py_VISIT(traverse_module_state->__pyx_codeobj_); + Py_VISIT(traverse_module_state->__pyx_tuple__8); + Py_VISIT(traverse_module_state->__pyx_slice__17); + Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__22); + Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__24); + Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__26); + Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__28); - Py_VISIT(traverse_module_state->__pyx_codeobj__13); + Py_VISIT(traverse_module_state->__pyx_tuple__29); + Py_VISIT(traverse_module_state->__pyx_codeobj__2); + Py_VISIT(traverse_module_state->__pyx_codeobj__5); + Py_VISIT(traverse_module_state->__pyx_codeobj__6); + Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__15); - Py_VISIT(traverse_module_state->__pyx_codeobj__17); + Py_VISIT(traverse_module_state->__pyx_codeobj__16); + Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__19); - Py_VISIT(traverse_module_state->__pyx_codeobj__21); - Py_VISIT(traverse_module_state->__pyx_codeobj__23); - Py_VISIT(traverse_module_state->__pyx_codeobj__25); - Py_VISIT(traverse_module_state->__pyx_codeobj__27); - Py_VISIT(traverse_module_state->__pyx_codeobj__29); return 0; } #endif @@ -3532,7 +3770,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #endif #define __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr #define __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr -#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_kp_u_04X __pyx_mstate_global->__pyx_kp_u_04X #define __pyx_n_u_AL __pyx_mstate_global->__pyx_n_u_AL #define __pyx_n_u_AN __pyx_mstate_global->__pyx_n_u_AN @@ -3573,15 +3810,16 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_u_Unknown_IDNA_mapping_table_statu __pyx_mstate_global->__pyx_kp_u_Unknown_IDNA_mapping_table_statu #define __pyx_n_s_VALID __pyx_mstate_global->__pyx_n_s_VALID #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError -#define __pyx_n_s__11 __pyx_mstate_global->__pyx_n_s__11 -#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 +#define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10 +#define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11 +#define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12 +#define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13 +#define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14 +#define __pyx_n_s__20 __pyx_mstate_global->__pyx_n_s__20 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 #define __pyx_n_s__30 __pyx_mstate_global->__pyx_n_s__30 -#define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 -#define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 +#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 -#define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8 -#define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9 #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_auto __pyx_mstate_global->__pyx_n_s_auto @@ -3724,26 +3962,26 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 #define __pyx_int_16 __pyx_mstate_global->__pyx_int_16 -#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 -#define __pyx_slice__10 __pyx_mstate_global->__pyx_slice__10 -#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 -#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 -#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 -#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 -#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 +#define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_ +#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 +#define __pyx_slice__17 __pyx_mstate_global->__pyx_slice__17 +#define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 +#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 +#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 +#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 -#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 +#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 +#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 +#define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 +#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 +#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 -#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 +#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 +#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 -#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 -#define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 -#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 -#define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 -#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 /* #### Code section: module_code ### */ /* "w3lib/_utr46.pyx":17 @@ -3762,8 +4000,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46__is_normalized, "_is_normalized(unicode form: str, unicode unistr: str) -> bool"); -static PyMethodDef __pyx_mdef_5w3lib_6_utr46_1_is_normalized = {"_is_normalized", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_1_is_normalized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46__is_normalized}; +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_1_is_normalized = {"_is_normalized", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_1_is_normalized, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_6_utr46_1_is_normalized(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3874,6 +4111,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_5w3lib_6_utr46__is_normalized(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_form, PyObject *__pyx_v_unistr) { PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -3882,7 +4120,9 @@ static PyObject *__pyx_pf_5w3lib_6_utr46__is_normalized(CYTHON_UNUSED PyObject * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj_) __Pyx_RefNannySetupContext("_is_normalized", 1); + __Pyx_TraceCall("_is_normalized", __pyx_f[0], 17, 0, __PYX_ERR(0, 17, __pyx_L1_error)); /* "w3lib/_utr46.pyx":18 * @@ -3942,6 +4182,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46__is_normalized(CYTHON_UNUSED PyObject * __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3962,8 +4203,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_6_Entry_from_match, "_Entry.from_match(cls: Type['_Entry'], match: Match) -> '_Entry'"); -static PyMethodDef __pyx_mdef_5w3lib_6_utr46_6_Entry_1from_match = {"from_match", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_6_Entry_1from_match, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46_6_Entry_from_match}; +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_6_Entry_1from_match = {"from_match", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_6_Entry_1from_match, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_6_utr46_6_Entry_1from_match(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4115,6 +4355,7 @@ static PyObject *__pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator(__pyx_C { struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); @@ -4126,9 +4367,11 @@ static PyObject *__pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator(__pyx_C int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); + __Pyx_TraceCall("genexpr", __pyx_f[0], 57, 0, __PYX_ERR(0, 57, __pyx_L1_error)); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ + __Pyx_TraceReturn(Py_None, 0); __Pyx_RefNannyFinishContext(); return NULL; } @@ -4231,6 +4474,7 @@ static PyObject *__pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator(__pyx_C #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4248,6 +4492,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_from_match(CYTHON_UNUSED PyObje PyObject *__pyx_v_mapping = NULL; PyObject *__pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator = 0; PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; @@ -4257,7 +4502,9 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_from_match(CYTHON_UNUSED PyObje int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__2) __Pyx_RefNannySetupContext("from_match", 1); + __Pyx_TraceCall("from_match", __pyx_f[0], 32, 0, __PYX_ERR(0, 32, __pyx_L1_error)); /* "w3lib/_utr46.pyx":34 * @classmethod @@ -4643,7 +4890,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_from_match(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__2}; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) @@ -4664,7 +4911,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_from_match(CYTHON_UNUSED PyObje __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyUnicode_Join(__pyx_kp_u_, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_mapping = ((PyObject*)__pyx_t_4); @@ -4735,6 +4982,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_from_match(CYTHON_UNUSED PyObje __Pyx_XDECREF(__pyx_v_mapping); __Pyx_XDECREF(__pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator); __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4755,8 +5003,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_6_Entry_2__init__, "_Entry.__init__(self: '_Entry', *, unicode mapping: Optional[str], status: _Status) -> None"); -static PyMethodDef __pyx_mdef_5w3lib_6_utr46_6_Entry_3__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_6_Entry_3__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46_6_Entry_2__init__}; +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_6_Entry_3__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_6_Entry_3__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_6_utr46_6_Entry_3__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4873,11 +5120,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_2__init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mapping, PyObject *__pyx_v_status) { PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__5) __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_TraceCall("__init__", __pyx_f[0], 64, 0, __PYX_ERR(0, 64, __pyx_L1_error)); /* "w3lib/_utr46.pyx":65 * @@ -4913,6 +5163,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_2__init__(CYTHON_UNUSED PyObjec __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4927,8 +5178,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_2__init__(CYTHON_UNUSED PyObjec /* Python wrapper */ static PyObject *__pyx_pw_5w3lib_6_utr46_3_load_idna_mapping_table(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_2_load_idna_mapping_table, "_load_idna_mapping_table() -> Dict[str, _Entry]"); -static PyMethodDef __pyx_mdef_5w3lib_6_utr46_3_load_idna_mapping_table = {"_load_idna_mapping_table", (PyCFunction)__pyx_pw_5w3lib_6_utr46_3_load_idna_mapping_table, METH_NOARGS, __pyx_doc_5w3lib_6_utr46_2_load_idna_mapping_table}; +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_3_load_idna_mapping_table = {"_load_idna_mapping_table", (PyCFunction)__pyx_pw_5w3lib_6_utr46_3_load_idna_mapping_table, METH_NOARGS, 0}; static PyObject *__pyx_pw_5w3lib_6_utr46_3_load_idna_mapping_table(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; @@ -4955,6 +5205,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_2_load_idna_mapping_table(CYTHON_UNUSED PyObject *__pyx_v_end = NULL; PyObject *__pyx_v_id = NULL; PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -4977,7 +5228,9 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_2_load_idna_mapping_table(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__6) __Pyx_RefNannySetupContext("_load_idna_mapping_table", 1); + __Pyx_TraceCall("_load_idna_mapping_table", __pyx_f[0], 69, 0, __PYX_ERR(0, 69, __pyx_L1_error)); /* "w3lib/_utr46.pyx":70 * @@ -5191,7 +5444,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_2_load_idna_mapping_table(CYTHON_UNUSED } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u__3}; + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u__7}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L7_error) @@ -5700,7 +5953,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_2_load_idna_mapping_table(CYTHON_UNUSED /*finally:*/ { /*normal exit:*/{ if (__pyx_t_6) { - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__4, NULL); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__8, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -5758,6 +6011,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_2_load_idna_mapping_table(CYTHON_UNUSED __Pyx_XDECREF(__pyx_v_end); __Pyx_XDECREF(__pyx_v_id); __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5778,7 +6032,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_4_validate_label, "_validate_label(unicode label: str, *, check_hyphens: bool, check_joiners: bool, check_bidi: bool, transitional_processing: bool, use_std3_ascii_rules: bool) -> None\nValidates the *label* domain name label.\n\n Only set *check_bidi* to ``True`` if the source domain name is a bidi\n domain name, i.e. if any character in it is in the Unicode Character\n Database with Bidi_Class R, AL, or AN.\n "); +PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_4_validate_label, "Validates the *label* domain name label.\n\n Only set *check_bidi* to ``True`` if the source domain name is a bidi\n domain name, i.e. if any character in it is in the Unicode Character\n Database with Bidi_Class R, AL, or AN.\n "); static PyMethodDef __pyx_mdef_5w3lib_6_utr46_5_validate_label = {"_validate_label", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_5_validate_label, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46_4_validate_label}; static PyObject *__pyx_pw_5w3lib_6_utr46_5_validate_label(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -5929,6 +6183,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject PyObject *__pyx_v_code_point = NULL; PyObject *__pyx_v_entry = NULL; PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -5948,7 +6203,9 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__9) __Pyx_RefNannySetupContext("_validate_label", 1); + __Pyx_TraceCall("_validate_label", __pyx_f[0], 121, 0, __PYX_ERR(0, 121, __pyx_L1_error)); /* "w3lib/_utr46.pyx":136 * Database with Bidi_Class R, AL, or AN. @@ -6074,7 +6331,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject } __pyx_t_1 = __Pyx_PyUnicode_Substring(__pyx_v_label, 3, 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_5; __pyx_L6_bool_binop_done:; @@ -6140,7 +6397,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject * raise ValueError(f"Domain name label {label!r} starts with '-'.") * if label.endswith("-"): */ - __pyx_t_6 = __Pyx_PyUnicode_Tailmatch(__pyx_v_label, __pyx_kp_u__6, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Tailmatch(__pyx_v_label, __pyx_kp_u__11, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 147, __pyx_L1_error) if (unlikely(__pyx_t_6)) { /* "w3lib/_utr46.pyx":148 @@ -6195,7 +6452,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject * raise ValueError(f"Domain name label {label!r} ends with '-'.") * if "." in label: */ - __pyx_t_6 = __Pyx_PyUnicode_Tailmatch(__pyx_v_label, __pyx_kp_u__6, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Tailmatch(__pyx_v_label, __pyx_kp_u__11, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error) if (unlikely(__pyx_t_6)) { /* "w3lib/_utr46.pyx":150 @@ -6259,7 +6516,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject * raise ValueError(f"Domain name label {label!r} contains a '.'.") * if length >= 1 and unicodedata.category(label[0])[0] == "M": */ - __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__7, __pyx_v_label, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__12, __pyx_v_label, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) if (unlikely(__pyx_t_6)) { /* "w3lib/_utr46.pyx":152 @@ -6556,10 +6813,10 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_9); __pyx_t_9 = 0; - __Pyx_INCREF(__pyx_kp_u__8); + __Pyx_INCREF(__pyx_kp_u__13); __pyx_t_13 += 2; - __Pyx_GIVEREF(__pyx_kp_u__8); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__8); + __Pyx_GIVEREF(__pyx_kp_u__13); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__13); __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_code_point, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8; @@ -6567,10 +6824,10 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_9); __pyx_t_9 = 0; - __Pyx_INCREF(__pyx_kp_u__9); + __Pyx_INCREF(__pyx_kp_u__14); __pyx_t_13 += 2; - __Pyx_GIVEREF(__pyx_kp_u__9); - PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__9); + __Pyx_GIVEREF(__pyx_kp_u__14); + PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__14); /* "w3lib/_utr46.pyx":163 * if entry is None: @@ -6753,10 +7010,10 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_9); __pyx_t_9 = 0; - __Pyx_INCREF(__pyx_kp_u__8); + __Pyx_INCREF(__pyx_kp_u__13); __pyx_t_13 += 2; - __Pyx_GIVEREF(__pyx_kp_u__8); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__8); + __Pyx_GIVEREF(__pyx_kp_u__13); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__13); __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_code_point, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8; @@ -6931,6 +7188,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject __Pyx_XDECREF(__pyx_v_code_point); __Pyx_XDECREF(__pyx_v_entry); __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6951,8 +7209,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_6_is_bidi_domain_name, "_is_bidi_domain_name(unicode domain_name: str) -> bool"); -static PyMethodDef __pyx_mdef_5w3lib_6_utr46_7_is_bidi_domain_name = {"_is_bidi_domain_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_7_is_bidi_domain_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46_6_is_bidi_domain_name}; +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_7_is_bidi_domain_name = {"_is_bidi_domain_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_7_is_bidi_domain_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_6_utr46_7_is_bidi_domain_name(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -7094,6 +7351,7 @@ static PyObject *__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1(__py { struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; @@ -7109,9 +7367,11 @@ static PyObject *__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1(__py int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); + __Pyx_TraceCall("genexpr", __pyx_f[0], 187, 0, __PYX_ERR(0, 187, __pyx_L1_error)); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ + __Pyx_TraceReturn(Py_None, 0); __Pyx_RefNannyFinishContext(); return NULL; } @@ -7262,6 +7522,7 @@ static PyObject *__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1(__py #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -7277,13 +7538,16 @@ static PyObject *__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1(__py static PyObject *__pyx_pf_5w3lib_6_utr46_6_is_bidi_domain_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain_name) { PyObject *__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1 = 0; PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__15) __Pyx_RefNannySetupContext("_is_bidi_domain_name", 1); + __Pyx_TraceCall("_is_bidi_domain_name", __pyx_f[0], 185, 0, __PYX_ERR(0, 185, __pyx_L1_error)); /* "w3lib/_utr46.pyx":186 * # https://www.unicode.org/reports/tr46/#Notation @@ -7327,6 +7591,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_is_bidi_domain_name(CYTHON_UNUSED PyO __pyx_L0:; __Pyx_XDECREF(__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1); __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -7347,8 +7612,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_8_process, "_process(unicode domain_name: str, *, use_std3_ascii_rules: bool, check_hyphens: bool, check_bidi: bool, check_joiners: bool, transitional_processing: bool) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_6_utr46_9_process = {"_process", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_9_process, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46_8_process}; +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_9_process = {"_process", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_9_process, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_6_utr46_9_process(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -7501,6 +7765,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_v_label = NULL; PyObject *__pyx_v_new_label = NULL; PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -7522,7 +7787,9 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__16) __Pyx_RefNannySetupContext("_process", 0); + __Pyx_TraceCall("_process", __pyx_f[0], 193, 0, __PYX_ERR(0, 193, __pyx_L1_error)); __Pyx_INCREF(__pyx_v_domain_name); __Pyx_INCREF(__pyx_v_check_bidi); @@ -7638,10 +7905,10 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_8); __pyx_t_8 = 0; - __Pyx_INCREF(__pyx_kp_u__8); + __Pyx_INCREF(__pyx_kp_u__13); __pyx_t_10 += 2; - __Pyx_GIVEREF(__pyx_kp_u__8); - PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u__8); + __Pyx_GIVEREF(__pyx_kp_u__13); + PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u__13); __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_code_point, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_11; @@ -7649,10 +7916,10 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_8); __pyx_t_8 = 0; - __Pyx_INCREF(__pyx_kp_u__9); + __Pyx_INCREF(__pyx_kp_u__14); __pyx_t_10 += 2; - __Pyx_GIVEREF(__pyx_kp_u__9); - PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_kp_u__9); + __Pyx_GIVEREF(__pyx_kp_u__14); + PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_kp_u__14); /* "w3lib/_utr46.pyx":206 * if entry is None: @@ -7846,10 +8113,10 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6); __pyx_t_6 = 0; - __Pyx_INCREF(__pyx_kp_u__8); + __Pyx_INCREF(__pyx_kp_u__13); __pyx_t_10 += 2; - __Pyx_GIVEREF(__pyx_kp_u__8); - PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__8); + __Pyx_GIVEREF(__pyx_kp_u__13); + PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__13); __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_code_point, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_11; @@ -7857,10 +8124,10 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_6); __pyx_t_6 = 0; - __Pyx_INCREF(__pyx_kp_u__9); + __Pyx_INCREF(__pyx_kp_u__14); __pyx_t_10 += 2; - __Pyx_GIVEREF(__pyx_kp_u__9); - PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_kp_u__9); + __Pyx_GIVEREF(__pyx_kp_u__14); + PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_kp_u__14); /* "w3lib/_utr46.pyx":218 * ): @@ -7926,7 +8193,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace"); __PYX_ERR(0, 222, __pyx_L1_error) } - __pyx_t_8 = PyUnicode_Replace(__pyx_v_domain_name, __pyx_v_code_point, __pyx_kp_u_, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_8 = PyUnicode_Replace(__pyx_v_domain_name, __pyx_v_code_point, __pyx_kp_u__3, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_domain_name, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; @@ -8180,7 +8447,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "split"); __PYX_ERR(0, 232, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_Split(__pyx_v_domain_name, __Pyx_NoneAsNull(__pyx_kp_u__7), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Split(__pyx_v_domain_name, __Pyx_NoneAsNull(__pyx_kp_u__12), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_labels = __pyx_t_1; __pyx_t_1 = 0; @@ -8343,7 +8610,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx * _validate_label( * new_label, */ - __pyx_t_16 = __Pyx_PyObject_GetSlice(__pyx_v_label, 4, 0, NULL, NULL, &__pyx_slice__10, 1, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_GetSlice(__pyx_v_label, 4, 0, NULL, NULL, &__pyx_slice__17, 1, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_encode); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); @@ -8607,7 +8874,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__7, __pyx_v_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__12, __pyx_v_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -8641,6 +8908,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx __Pyx_XDECREF(__pyx_v_domain_name); __Pyx_XDECREF(__pyx_v_check_bidi); __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -8661,8 +8929,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_10_convert_label, "_convert_label(unicode label: str) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_6_utr46_11_convert_label = {"_convert_label", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_11_convert_label, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46_10_convert_label}; +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_11_convert_label = {"_convert_label", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_11_convert_label, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_6_utr46_11_convert_label(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -8757,6 +9024,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_5w3lib_6_utr46_10_convert_label(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label) { PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; @@ -8764,7 +9032,9 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_10_convert_label(CYTHON_UNUSED PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__18) __Pyx_RefNannySetupContext("_convert_label", 1); + __Pyx_TraceCall("_convert_label", __pyx_f[0], 258, 0, __PYX_ERR(0, 258, __pyx_L1_error)); /* "w3lib/_utr46.pyx":259 * @@ -8836,6 +9106,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_10_convert_label(CYTHON_UNUSED PyObject __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -8856,8 +9127,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_6_utr46_12_to_ascii, "_to_ascii(unicode domain_name: str, *, check_hyphens: bool, check_bidi: bool, check_joiners: bool, use_std3_ascii_rules: bool, transitional_processing: bool, verify_dns_length: bool) -> str"); -static PyMethodDef __pyx_mdef_5w3lib_6_utr46_13_to_ascii = {"_to_ascii", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_13_to_ascii, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_6_utr46_12_to_ascii}; +static PyMethodDef __pyx_mdef_5w3lib_6_utr46_13_to_ascii = {"_to_ascii", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_6_utr46_13_to_ascii, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5w3lib_6_utr46_13_to_ascii(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -9018,6 +9288,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_12_to_ascii(CYTHON_UNUSED PyObject *__p PyObject *__pyx_v_label = NULL; PyObject *__pyx_8genexpr2__pyx_v_label = NULL; PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -9033,7 +9304,9 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_12_to_ascii(CYTHON_UNUSED PyObject *__p int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__19) __Pyx_RefNannySetupContext("_to_ascii", 0); + __Pyx_TraceCall("_to_ascii", __pyx_f[0], 265, 0, __PYX_ERR(0, 265, __pyx_L1_error)); __Pyx_INCREF(__pyx_v_domain_name); /* "w3lib/_utr46.pyx":275 @@ -9136,7 +9409,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_12_to_ascii(CYTHON_UNUSED PyObject *__p PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "split"); __PYX_ERR(0, 283, __pyx_L5_error) } - __pyx_t_3 = PyUnicode_Split(__pyx_v_domain_name, __Pyx_NoneAsNull(__pyx_kp_u__7), -1L); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L5_error) + __pyx_t_3 = PyUnicode_Split(__pyx_v_domain_name, __Pyx_NoneAsNull(__pyx_kp_u__12), -1L); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; @@ -9202,7 +9475,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_12_to_ascii(CYTHON_UNUSED PyObject *__p * if verify_dns_length: * length = len(domain_name.rstrip(".")) */ - __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__7, __pyx_v_labels); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__12, __pyx_v_labels); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_domain_name, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; @@ -9224,7 +9497,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_12_to_ascii(CYTHON_UNUSED PyObject *__p * if not 1 <= length <= 253: * raise ValueError( */ - __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_rstrip, __pyx_v_domain_name, __pyx_kp_u__7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_rstrip, __pyx_v_domain_name, __pyx_kp_u__12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -9515,6 +9788,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_12_to_ascii(CYTHON_UNUSED PyObject *__p __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_label); __Pyx_XDECREF(__pyx_v_domain_name); __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -9858,7 +10132,6 @@ static PyMethodDef __pyx_methods[] = { static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_kp_u_04X, __pyx_k_04X, sizeof(__pyx_k_04X), 0, 1, 0, 0}, {&__pyx_n_u_AL, __pyx_k_AL, sizeof(__pyx_k_AL), 0, 1, 0, 1}, {&__pyx_n_u_AN, __pyx_k_AN, sizeof(__pyx_k_AN), 0, 1, 0, 1}, @@ -9899,15 +10172,16 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_u_Unknown_IDNA_mapping_table_statu, __pyx_k_Unknown_IDNA_mapping_table_statu, sizeof(__pyx_k_Unknown_IDNA_mapping_table_statu), 0, 1, 0, 0}, {&__pyx_n_s_VALID, __pyx_k_VALID, sizeof(__pyx_k_VALID), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_n_s__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 1, 1}, - {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, + {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0}, + {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, + {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0}, + {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0}, + {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0}, + {&__pyx_n_s__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 1}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, {&__pyx_n_s__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 0, 1, 1}, - {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, - {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, + {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, - {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, - {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_auto, __pyx_k_auto, sizeof(__pyx_k_auto), 0, 0, 1, 1}, @@ -10075,9 +10349,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * for line in input: * if line.startswith("#") or not line.strip(): */ - __pyx_tuple__4 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__8 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "w3lib/_utr46.pyx":236 * for i, label in enumerate(labels): @@ -10086,9 +10360,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * _validate_label( * new_label, */ - __pyx_slice__10 = PySlice_New(__pyx_int_4, Py_None, Py_None); if (unlikely(!__pyx_slice__10)) __PYX_ERR(0, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__10); - __Pyx_GIVEREF(__pyx_slice__10); + __pyx_slice__17 = PySlice_New(__pyx_int_4, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__17); + __Pyx_GIVEREF(__pyx_slice__17); /* "w3lib/_utr46.pyx":17 * else: @@ -10097,10 +10371,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * return unicodedata.normalize(form, unistr) == unistr * */ - __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_form, __pyx_n_s_unistr); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_is_normalized, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 17, __pyx_L1_error) + __pyx_tuple__21 = PyTuple_Pack(2, __pyx_n_s_form, __pyx_n_s_unistr); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_is_normalized, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 17, __pyx_L1_error) /* "w3lib/_utr46.pyx":32 * @@ -10109,10 +10383,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def from_match(cls: Type["_Entry"], match: Match) -> "_Entry": * if match["status"] == "disallowed": */ - __pyx_tuple__14 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_match, __pyx_n_s_status, __pyx_n_s_mapping, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_from_match, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_tuple__22 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_match, __pyx_n_s_status, __pyx_n_s_mapping, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_from_match, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 32, __pyx_L1_error) /* "w3lib/_utr46.pyx":64 * ) @@ -10121,10 +10395,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * self.mapping = mapping * self.status = status */ - __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_mapping, __pyx_n_s_status); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_init, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_tuple__23 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_mapping, __pyx_n_s_status); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_init, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 64, __pyx_L1_error) /* "w3lib/_utr46.pyx":69 * @@ -10133,10 +10407,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * file_name = Path(__file__).parent / "idna.txt" * pattern = r"""(?x) */ - __pyx_tuple__18 = PyTuple_Pack(11, __pyx_n_s_file_name, __pyx_n_s_pattern, __pyx_n_s_mapping, __pyx_n_s_input, __pyx_n_s_line, __pyx_n_s_match, __pyx_n_s_entry, __pyx_n_s_code_point, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_id); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_load_idna_mapping_table, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_tuple__24 = PyTuple_Pack(11, __pyx_n_s_file_name, __pyx_n_s_pattern, __pyx_n_s_mapping, __pyx_n_s_input, __pyx_n_s_line, __pyx_n_s_match, __pyx_n_s_entry, __pyx_n_s_code_point, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_id); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_load_idna_mapping_table, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 69, __pyx_L1_error) /* "w3lib/_utr46.pyx":121 * @@ -10145,10 +10419,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * label: str, * *, */ - __pyx_tuple__20 = PyTuple_Pack(9, __pyx_n_s_label, __pyx_n_s_check_hyphens, __pyx_n_s_check_joiners, __pyx_n_s_check_bidi, __pyx_n_s_transitional_processing, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_length, __pyx_n_s_code_point, __pyx_n_s_entry); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_validate_label, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_tuple__25 = PyTuple_Pack(9, __pyx_n_s_label, __pyx_n_s_check_hyphens, __pyx_n_s_check_joiners, __pyx_n_s_check_bidi, __pyx_n_s_transitional_processing, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_length, __pyx_n_s_code_point, __pyx_n_s_entry); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_validate_label, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 121, __pyx_L1_error) /* "w3lib/_utr46.pyx":185 * @@ -10157,10 +10431,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * return any( * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} */ - __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_domain_name, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_is_bidi_domain_name, 185, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(3, __pyx_n_s_domain_name, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_is_bidi_domain_name, 185, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 185, __pyx_L1_error) /* "w3lib/_utr46.pyx":193 * @@ -10169,10 +10443,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * domain_name: str, * *, */ - __pyx_tuple__24 = PyTuple_Pack(12, __pyx_n_s_domain_name, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_check_hyphens, __pyx_n_s_check_bidi, __pyx_n_s_check_joiners, __pyx_n_s_transitional_processing, __pyx_n_s_code_point, __pyx_n_s_entry, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_label, __pyx_n_s_new_label); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_process, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_tuple__27 = PyTuple_Pack(12, __pyx_n_s_domain_name, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_check_hyphens, __pyx_n_s_check_bidi, __pyx_n_s_check_joiners, __pyx_n_s_transitional_processing, __pyx_n_s_code_point, __pyx_n_s_entry, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_label, __pyx_n_s_new_label); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_process, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 193, __pyx_L1_error) /* "w3lib/_utr46.pyx":258 * @@ -10181,10 +10455,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * if label.isascii(): * return label */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_label); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_convert_label, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_label); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_convert_label, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 258, __pyx_L1_error) /* "w3lib/_utr46.pyx":265 * @@ -10193,10 +10467,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * domain_name: str, * *, */ - __pyx_tuple__28 = PyTuple_Pack(11, __pyx_n_s_domain_name, __pyx_n_s_check_hyphens, __pyx_n_s_check_bidi, __pyx_n_s_check_joiners, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_transitional_processing, __pyx_n_s_verify_dns_length, __pyx_n_s_labels, __pyx_n_s_length, __pyx_n_s_label, __pyx_n_s_label); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_to_ascii, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_tuple__29 = PyTuple_Pack(11, __pyx_n_s_domain_name, __pyx_n_s_check_hyphens, __pyx_n_s_check_bidi, __pyx_n_s_check_joiners, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_transitional_processing, __pyx_n_s_verify_dns_length, __pyx_n_s_labels, __pyx_n_s_length, __pyx_n_s_label, __pyx_n_s_label); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_to_ascii, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -10502,6 +10776,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__utr46(PyObject *__pyx_pyinit_modu #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -10625,6 +10900,7 @@ if (!__Pyx_RefNanny) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif + __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__utr46(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); /* "w3lib/_utr46.pyx":3 * # https://www.unicode.org/reports/tr46/ @@ -10834,7 +11110,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_form, __pyx_n_s_str) < 0) __PYX_ERR(0, 17, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_unistr, __pyx_n_s_str) < 0) __PYX_ERR(0, 17, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 17, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_1_is_normalized, 0, __pyx_n_s_is_normalized, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_1_is_normalized, 0, __pyx_n_s_is_normalized, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11143,7 +11419,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_cls, __pyx_kp_s_Type__Entry) < 0) __PYX_ERR(0, 32, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_match, __pyx_n_s_Match) < 0) __PYX_ERR(0, 32, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_Entry_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_6_Entry_1from_match, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Entry_from_match, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_6_Entry_1from_match, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Entry_from_match, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -11166,7 +11442,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mapping, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_status, __pyx_n_s_Status) < 0) __PYX_ERR(0, 64, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_6_Entry_3__init__, 0, __pyx_n_s_Entry___init, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_6_Entry_3__init__, 0, __pyx_n_s_Entry___init, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -11196,7 +11472,7 @@ if (!__Pyx_RefNanny) { __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Dict_str__Entry) < 0) __PYX_ERR(0, 69, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_3_load_idna_mapping_table, 0, __pyx_n_s_load_idna_mapping_table, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_3_load_idna_mapping_table, 0, __pyx_n_s_load_idna_mapping_table, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11234,7 +11510,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, __pyx_n_s_bool) < 0) __PYX_ERR(0, 121, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_bool) < 0) __PYX_ERR(0, 121, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 121, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_5_validate_label, 0, __pyx_n_s_validate_label, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_5_validate_label, 0, __pyx_n_s_validate_label, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11252,7 +11528,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domain_name, __pyx_n_s_str) < 0) __PYX_ERR(0, 185, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 185, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_7_is_bidi_domain_name, 0, __pyx_n_s_is_bidi_domain_name, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_7_is_bidi_domain_name, 0, __pyx_n_s_is_bidi_domain_name, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -11275,7 +11551,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, __pyx_n_s_bool) < 0) __PYX_ERR(0, 193, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, __pyx_n_s_bool) < 0) __PYX_ERR(0, 193, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 193, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_9_process, 0, __pyx_n_s_process, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_9_process, 0, __pyx_n_s_process, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11293,7 +11569,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 258, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 258, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_11_convert_label, 0, __pyx_n_s_convert_label, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_11_convert_label, 0, __pyx_n_s_convert_label, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -11317,7 +11593,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, __pyx_n_s_bool) < 0) __PYX_ERR(0, 265, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_n_s_bool) < 0) __PYX_ERR(0, 265, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 265, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_13_to_ascii, 0, __pyx_n_s_to_ascii, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_13_to_ascii, 0, __pyx_n_s_to_ascii, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11333,6 +11609,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_TraceReturn(Py_None, 0); /*--- Wrapped vars code ---*/ @@ -12014,6 +12291,96 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam return 0; } +/* Profile */ +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + PyThreadState* tstate, + const char *funcname, + const char *srcfile, + int firstlineno) { + PyObject *type, *value, *traceback; + int retval; + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); + retval = 1; + __Pyx_EnterTracing(tstate); + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + #if CYTHON_TRACE + if (tstate->c_tracefunc) + retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; + if (retval && tstate->c_profilefunc) + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + __Pyx_LeaveTracing(tstate); + if (retval) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + return __Pyx_IsTracing(tstate, 0, 0) && retval; + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + return -1; + } +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyCodeObject *py_code = 0; +#if PY_MAJOR_VERSION >= 3 + py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); + if (likely(py_code)) { + py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; + } +#else + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + py_funcname = PyString_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + py_srcfile = PyString_FromString(srcfile); + if (unlikely(!py_srcfile)) goto bad; + py_code = PyCode_New( + 0, + 0, + 0, + CO_OPTIMIZED | CO_NEWLOCALS, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); +#endif + return py_code; +} +#endif + /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { @@ -14372,7 +14739,7 @@ static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject * #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__11; + PyObject *module, *from_list, *star = __pyx_n_s__20; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) @@ -14435,7 +14802,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__7); + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__12); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } diff --git a/w3lib/url.py b/w3lib/url.py index c5c2fea3..8d1e1266 100644 --- a/w3lib/url.py +++ b/w3lib/url.py @@ -7,9 +7,7 @@ import os import posixpath import re -import string from typing import ( - cast, Callable, Dict, List, @@ -18,12 +16,15 @@ Sequence, Tuple, Union, + cast, ) +from urllib.parse import _coerce_args # type: ignore from urllib.parse import ( + ParseResult, parse_qs, parse_qsl, - ParseResult, quote, + unquote, unquote_to_bytes, urldefrag, urlencode, @@ -31,37 +32,21 @@ urlsplit, urlunparse, urlunsplit, - unquote, ) -from urllib.parse import _coerce_args # type: ignore from urllib.request import pathname2url, url2pathname -from ._infra import ( - _ASCII_TAB_OR_NEWLINE, - _C0_CONTROL_OR_SPACE, -) -from ._rfc2396 import ( - _RFC2396_ABS_PATH_PERCENT_ENCODE_SET, - _RFC2396_FRAGMENT_PERCENT_ENCODE_SET, - _RFC2396_QUERY_PERCENT_ENCODE_SET, - _RFC2396_USERINFO_PERCENT_ENCODE_SET, -) -from ._rfc3986 import ( - _RFC3986_FRAGMENT_PERCENT_ENCODE_SET, - _RFC3986_QUERY_PERCENT_ENCODE_SET, - _RFC3986_PATH_PERCENT_ENCODE_SET, - _RFC3986_USERINFO_PERCENT_ENCODE_SET, -) +from ._infra import _ASCII_TAB_OR_NEWLINE, _C0_CONTROL_OR_SPACE from ._types import AnyUnicodeError, StrOrBytes from ._url import ( - _FRAGMENT_PERCENT_ENCODE_SET, - _parse_url, - _PATH_PERCENT_ENCODE_SET, - _QUERY_PERCENT_ENCODE_SET, - _serialize_url, - _SPECIAL_QUERY_PERCENT_ENCODE_SET, + _FRAGMENT_SAFEST_CHARS, + _PATH_SAFEST_CHARS, + _QUERY_SAFEST_CHARS, + _SPECIAL_QUERY_SAFEST_CHARS, _SPECIAL_SCHEMES, - _USERINFO_PERCENT_ENCODE_SET, + _USERINFO_SAFEST_CHARS, + _safe_url, + _safe_chars, + _path_safe_chars, ) from .util import to_unicode @@ -74,59 +59,6 @@ def _quote_byte(error: UnicodeError) -> Tuple[str, int]: codecs.register_error("percentencode", _quote_byte) -# constants from RFC 3986, Section 2.2 and 2.3 -RFC3986_GEN_DELIMS = b":/?#[]@" -RFC3986_SUB_DELIMS = b"!$&'()*+,;=" -RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS -RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") -EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 - -RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" -_safe_chars = RFC3986_RESERVED + RFC3986_UNRESERVED + EXTRA_SAFE_CHARS + b"%" -_path_safe_chars = _safe_chars.replace(b"#", b"") - -# Characters that are safe in all of: -# -# - RFC 2396 + RFC 2732, as interpreted by Java 8’s java.net.URI class -# - RFC 3986 -# - The URL living standard -# -# NOTE: % is currently excluded from these lists of characters, due to -# limitations of the current safe_url_string implementation, but it should also -# be escaped as %25 when it is not already being used as part of an escape -# character. -_USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") -_PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") -_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS -_SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") -_FRAGMENT_SAFEST_CHARS = _PATH_SAFEST_CHARS - -_SAFE_USERINFO_PERCENT_ENCODE_SET = ( - _USERINFO_PERCENT_ENCODE_SET - | _RFC3986_USERINFO_PERCENT_ENCODE_SET - | _RFC2396_USERINFO_PERCENT_ENCODE_SET -) -_SAFE_PATH_PERCENT_ENCODE_SET = ( - _PATH_PERCENT_ENCODE_SET - | _RFC3986_PATH_PERCENT_ENCODE_SET - | _RFC2396_ABS_PATH_PERCENT_ENCODE_SET -) -_SAFE_QUERY_PERCENT_ENCODE_SET = ( - _QUERY_PERCENT_ENCODE_SET - | _RFC3986_QUERY_PERCENT_ENCODE_SET - | _RFC2396_QUERY_PERCENT_ENCODE_SET -) -_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET = ( - _SPECIAL_QUERY_PERCENT_ENCODE_SET - | _RFC3986_QUERY_PERCENT_ENCODE_SET - | _RFC2396_QUERY_PERCENT_ENCODE_SET -) -_SAFE_FRAGMENT_PERCENT_ENCODE_SET = ( - _FRAGMENT_PERCENT_ENCODE_SET - | _RFC3986_FRAGMENT_PERCENT_ENCODE_SET - | _RFC2396_FRAGMENT_PERCENT_ENCODE_SET -) - def safe_url( input: str, @@ -163,16 +95,7 @@ def safe_url( extracted. If *url* does not come from an HTML page, *encoding* should not be passed, i.e. it should be left as UTF-8. """ - url = _parse_url( - input, - encoding=encoding, - userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, - path_percent_encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, - query_percent_encode_set=_SAFE_QUERY_PERCENT_ENCODE_SET, - special_query_percent_encode_set=_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET, - fragment_percent_encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET, - ) - return _serialize_url(url, canonicalize=False) + return _safe_url(input, encoding=encoding) _ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { From 25ecb97c3be19c6ef57ccac5334b513fbc53fe18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 13 Feb 2024 18:13:11 +0100 Subject: [PATCH 32/34] Refactor _URL --- tests/test_url.py | 10 +- w3lib/_rfc2396.c | 497 +- w3lib/_rfc3986.c | 497 +- w3lib/_rfc5892.c | 375 +- w3lib/_types.c | 331 - w3lib/_url.c | 23532 ++++++++++++++++++++------------------------ w3lib/_url.pyx | 406 +- w3lib/_util.c | 543 +- w3lib/_utr46.c | 753 +- 9 files changed, 11440 insertions(+), 15504 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index 9561c918..9f37f6e4 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -537,12 +537,18 @@ def test_parse_url( search, hash, ): + # TODO: Take into account test scenarios where the base path does not + # impact the outcome. + if base: + raise pytest.skip( + "Our implementation does not support indicating a base URL." + ) if failure: with pytest.raises(ValueError): - _parse_url(input, base_url=base) + _parse_url(input) return - url = _parse_url(input, base_url=base) + url = _parse_url(input) assert url.scheme == (protocol[:-1] if protocol else None) assert url.username == username assert url.password == password diff --git a/w3lib/_rfc2396.c b/w3lib/_rfc2396.c index 38721b7d..e5f7fcca 100644 --- a/w3lib/_rfc2396.c +++ b/w3lib/_rfc2396.c @@ -1551,6 +1551,30 @@ static const char *__pyx_f[] = { #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* IncludeStringH.proto */ +#include + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; @@ -1594,268 +1618,6 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif -/* Profile.proto */ -#ifndef CYTHON_PROFILE -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - #define CYTHON_PROFILE 0 -#else - #define CYTHON_PROFILE 1 -#endif -#endif -#ifndef CYTHON_TRACE_NOGIL - #define CYTHON_TRACE_NOGIL 0 -#else - #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) - #define CYTHON_TRACE 1 - #endif -#endif -#ifndef CYTHON_TRACE - #define CYTHON_TRACE 0 -#endif -#if CYTHON_TRACE - #undef CYTHON_PROFILE_REUSE_FRAME -#endif -#ifndef CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_PROFILE_REUSE_FRAME 0 -#endif -#if CYTHON_PROFILE || CYTHON_TRACE - #include "compile.h" - #include "frameobject.h" - #include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #if CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_FRAME_MODIFIER static - #define CYTHON_FRAME_DEL(frame) - #else - #define CYTHON_FRAME_MODIFIER - #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) - #endif - #define __Pyx_TraceDeclarations\ - static PyCodeObject *__pyx_frame_code = NULL;\ - CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ - int __Pyx_use_tracing = 0; - #define __Pyx_TraceFrameInit(codeobj)\ - if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; -#if PY_VERSION_HEX >= 0x030b00a2 - #if PY_VERSION_HEX >= 0x030C00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - ((!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #endif - #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) - #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) -#elif PY_VERSION_HEX >= 0x030a00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#endif - #ifdef WITH_THREAD - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - }\ - PyGILState_Release(state);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #else - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - { PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #endif - #define __Pyx_TraceException()\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 1)) {\ - __Pyx_EnterTracing(tstate);\ - PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ - if (exc_info) {\ - if (CYTHON_TRACE && tstate->c_tracefunc)\ - tstate->c_tracefunc(\ - tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - tstate->c_profilefunc(\ - tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - Py_DECREF(exc_info);\ - }\ - __Pyx_LeaveTracing(tstate);\ - }\ - } - static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_EnterTracing(tstate); - if (CYTHON_TRACE && tstate->c_tracefunc) - tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); - if (tstate->c_profilefunc) - tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); - CYTHON_FRAME_DEL(frame); - __Pyx_LeaveTracing(tstate); - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } - #ifdef WITH_THREAD - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - PyGILState_Release(state);\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - }\ - } - #else - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - } - #endif - static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); - static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); -#else - #define __Pyx_TraceDeclarations - #define __Pyx_TraceFrameInit(codeobj) - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; - #define __Pyx_TraceException() - #define __Pyx_TraceReturn(result, nogil) -#endif -#if CYTHON_TRACE - static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { - int ret; - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_PyFrame_SetLineNumber(frame, lineno); - __Pyx_EnterTracing(tstate); - ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); - __Pyx_LeaveTracing(tstate); - if (likely(!ret)) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - } - return ret; - } - #ifdef WITH_THREAD - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - int ret = 0;\ - PyThreadState *tstate;\ - PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - }\ - __Pyx_PyGILState_Release(state);\ - if (unlikely(ret)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - }\ - } - #else - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - } - #endif -#else - #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; -#endif - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* IncludeStringH.proto */ -#include - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); @@ -2586,7 +2348,6 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__rfc2396(PyObject *__pyx_pyinit_mo #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif - __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -2705,7 +2466,6 @@ if (!__Pyx_RefNanny) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__rfc2396(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); /* "w3lib/_rfc2396.pyx":1 * from ._infra import _ASCII_ALPHANUMERIC # <<<<<<<<<<<<<< @@ -2899,7 +2659,6 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_TraceReturn(Py_None, 0); /*--- Wrapped vars code ---*/ @@ -2971,155 +2730,6 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { } #endif -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *tmp_value; - assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); - if (value) { - #if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) - #endif - PyException_SetTraceback(value, tb); - } - tmp_value = tstate->current_exception; - tstate->current_exception = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject* exc_value; - exc_value = tstate->current_exception; - tstate->current_exception = 0; - *value = exc_value; - *type = NULL; - *tb = NULL; - if (exc_value) { - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - #if CYTHON_COMPILING_IN_CPYTHON - *tb = ((PyBaseExceptionObject*) exc_value)->traceback; - Py_XINCREF(*tb); - #else - *tb = PyException_GetTraceback(exc_value); - #endif - } -#else - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#endif -} -#endif - -/* Profile */ -#if CYTHON_PROFILE -static int __Pyx_TraceSetupAndCall(PyCodeObject** code, - PyFrameObject** frame, - PyThreadState* tstate, - const char *funcname, - const char *srcfile, - int firstlineno) { - PyObject *type, *value, *traceback; - int retval; - if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { - if (*code == NULL) { - *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); - if (*code == NULL) return 0; - } - *frame = PyFrame_New( - tstate, /*PyThreadState *tstate*/ - *code, /*PyCodeObject *code*/ - __pyx_d, /*PyObject *globals*/ - 0 /*PyObject *locals*/ - ); - if (*frame == NULL) return 0; - if (CYTHON_TRACE && (*frame)->f_trace == NULL) { - Py_INCREF(Py_None); - (*frame)->f_trace = Py_None; - } -#if PY_VERSION_HEX < 0x030400B1 - } else { - (*frame)->f_tstate = tstate; -#endif - } - __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); - retval = 1; - __Pyx_EnterTracing(tstate); - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - #if CYTHON_TRACE - if (tstate->c_tracefunc) - retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; - if (retval && tstate->c_profilefunc) - #endif - retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; - __Pyx_LeaveTracing(tstate); - if (retval) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - return __Pyx_IsTracing(tstate, 0, 0) && retval; - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - return -1; - } -} -static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { - PyCodeObject *py_code = 0; -#if PY_MAJOR_VERSION >= 3 - py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); - if (likely(py_code)) { - py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; - } -#else - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - py_funcname = PyString_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - py_srcfile = PyString_FromString(srcfile); - if (unlikely(!py_srcfile)) goto bad; - py_code = PyCode_New( - 0, - 0, - 0, - CO_OPTIMIZED | CO_NEWLOCALS, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - firstlineno, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); -#endif - return py_code; -} -#endif - /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { @@ -3278,6 +2888,65 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta } #endif +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { diff --git a/w3lib/_rfc3986.c b/w3lib/_rfc3986.c index b86d71f4..24c774e2 100644 --- a/w3lib/_rfc3986.c +++ b/w3lib/_rfc3986.c @@ -1551,6 +1551,30 @@ static const char *__pyx_f[] = { #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* IncludeStringH.proto */ +#include + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; @@ -1594,268 +1618,6 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif -/* Profile.proto */ -#ifndef CYTHON_PROFILE -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - #define CYTHON_PROFILE 0 -#else - #define CYTHON_PROFILE 1 -#endif -#endif -#ifndef CYTHON_TRACE_NOGIL - #define CYTHON_TRACE_NOGIL 0 -#else - #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) - #define CYTHON_TRACE 1 - #endif -#endif -#ifndef CYTHON_TRACE - #define CYTHON_TRACE 0 -#endif -#if CYTHON_TRACE - #undef CYTHON_PROFILE_REUSE_FRAME -#endif -#ifndef CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_PROFILE_REUSE_FRAME 0 -#endif -#if CYTHON_PROFILE || CYTHON_TRACE - #include "compile.h" - #include "frameobject.h" - #include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #if CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_FRAME_MODIFIER static - #define CYTHON_FRAME_DEL(frame) - #else - #define CYTHON_FRAME_MODIFIER - #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) - #endif - #define __Pyx_TraceDeclarations\ - static PyCodeObject *__pyx_frame_code = NULL;\ - CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ - int __Pyx_use_tracing = 0; - #define __Pyx_TraceFrameInit(codeobj)\ - if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; -#if PY_VERSION_HEX >= 0x030b00a2 - #if PY_VERSION_HEX >= 0x030C00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - ((!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #endif - #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) - #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) -#elif PY_VERSION_HEX >= 0x030a00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#endif - #ifdef WITH_THREAD - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - }\ - PyGILState_Release(state);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #else - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - { PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #endif - #define __Pyx_TraceException()\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 1)) {\ - __Pyx_EnterTracing(tstate);\ - PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ - if (exc_info) {\ - if (CYTHON_TRACE && tstate->c_tracefunc)\ - tstate->c_tracefunc(\ - tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - tstate->c_profilefunc(\ - tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - Py_DECREF(exc_info);\ - }\ - __Pyx_LeaveTracing(tstate);\ - }\ - } - static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_EnterTracing(tstate); - if (CYTHON_TRACE && tstate->c_tracefunc) - tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); - if (tstate->c_profilefunc) - tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); - CYTHON_FRAME_DEL(frame); - __Pyx_LeaveTracing(tstate); - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } - #ifdef WITH_THREAD - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - PyGILState_Release(state);\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - }\ - } - #else - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - } - #endif - static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); - static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); -#else - #define __Pyx_TraceDeclarations - #define __Pyx_TraceFrameInit(codeobj) - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; - #define __Pyx_TraceException() - #define __Pyx_TraceReturn(result, nogil) -#endif -#if CYTHON_TRACE - static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { - int ret; - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_PyFrame_SetLineNumber(frame, lineno); - __Pyx_EnterTracing(tstate); - ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); - __Pyx_LeaveTracing(tstate); - if (likely(!ret)) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - } - return ret; - } - #ifdef WITH_THREAD - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - int ret = 0;\ - PyThreadState *tstate;\ - PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - }\ - __Pyx_PyGILState_Release(state);\ - if (unlikely(ret)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - }\ - } - #else - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - } - #endif -#else - #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; -#endif - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* IncludeStringH.proto */ -#include - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); @@ -2571,7 +2333,6 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__rfc3986(PyObject *__pyx_pyinit_mo #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif - __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -2691,7 +2452,6 @@ if (!__Pyx_RefNanny) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__rfc3986(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); /* "w3lib/_rfc3986.pyx":1 * from ._infra import _ASCII_ALPHANUMERIC # <<<<<<<<<<<<<< @@ -2935,7 +2695,6 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_TraceReturn(Py_None, 0); /*--- Wrapped vars code ---*/ @@ -3008,155 +2767,6 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { } #endif -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *tmp_value; - assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); - if (value) { - #if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) - #endif - PyException_SetTraceback(value, tb); - } - tmp_value = tstate->current_exception; - tstate->current_exception = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject* exc_value; - exc_value = tstate->current_exception; - tstate->current_exception = 0; - *value = exc_value; - *type = NULL; - *tb = NULL; - if (exc_value) { - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - #if CYTHON_COMPILING_IN_CPYTHON - *tb = ((PyBaseExceptionObject*) exc_value)->traceback; - Py_XINCREF(*tb); - #else - *tb = PyException_GetTraceback(exc_value); - #endif - } -#else - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#endif -} -#endif - -/* Profile */ -#if CYTHON_PROFILE -static int __Pyx_TraceSetupAndCall(PyCodeObject** code, - PyFrameObject** frame, - PyThreadState* tstate, - const char *funcname, - const char *srcfile, - int firstlineno) { - PyObject *type, *value, *traceback; - int retval; - if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { - if (*code == NULL) { - *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); - if (*code == NULL) return 0; - } - *frame = PyFrame_New( - tstate, /*PyThreadState *tstate*/ - *code, /*PyCodeObject *code*/ - __pyx_d, /*PyObject *globals*/ - 0 /*PyObject *locals*/ - ); - if (*frame == NULL) return 0; - if (CYTHON_TRACE && (*frame)->f_trace == NULL) { - Py_INCREF(Py_None); - (*frame)->f_trace = Py_None; - } -#if PY_VERSION_HEX < 0x030400B1 - } else { - (*frame)->f_tstate = tstate; -#endif - } - __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); - retval = 1; - __Pyx_EnterTracing(tstate); - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - #if CYTHON_TRACE - if (tstate->c_tracefunc) - retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; - if (retval && tstate->c_profilefunc) - #endif - retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; - __Pyx_LeaveTracing(tstate); - if (retval) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - return __Pyx_IsTracing(tstate, 0, 0) && retval; - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - return -1; - } -} -static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { - PyCodeObject *py_code = 0; -#if PY_MAJOR_VERSION >= 3 - py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); - if (likely(py_code)) { - py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; - } -#else - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - py_funcname = PyString_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - py_srcfile = PyString_FromString(srcfile); - if (unlikely(!py_srcfile)) goto bad; - py_code = PyCode_New( - 0, - 0, - 0, - CO_OPTIMIZED | CO_NEWLOCALS, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - firstlineno, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); -#endif - return py_code; -} -#endif - /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { @@ -3315,6 +2925,65 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta } #endif +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { diff --git a/w3lib/_rfc5892.c b/w3lib/_rfc5892.c index b923323a..59363cc4 100644 --- a/w3lib/_rfc5892.c +++ b/w3lib/_rfc5892.c @@ -1703,244 +1703,6 @@ 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); -/* Profile.proto */ -#ifndef CYTHON_PROFILE -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - #define CYTHON_PROFILE 0 -#else - #define CYTHON_PROFILE 1 -#endif -#endif -#ifndef CYTHON_TRACE_NOGIL - #define CYTHON_TRACE_NOGIL 0 -#else - #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) - #define CYTHON_TRACE 1 - #endif -#endif -#ifndef CYTHON_TRACE - #define CYTHON_TRACE 0 -#endif -#if CYTHON_TRACE - #undef CYTHON_PROFILE_REUSE_FRAME -#endif -#ifndef CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_PROFILE_REUSE_FRAME 0 -#endif -#if CYTHON_PROFILE || CYTHON_TRACE - #include "compile.h" - #include "frameobject.h" - #include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #if CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_FRAME_MODIFIER static - #define CYTHON_FRAME_DEL(frame) - #else - #define CYTHON_FRAME_MODIFIER - #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) - #endif - #define __Pyx_TraceDeclarations\ - static PyCodeObject *__pyx_frame_code = NULL;\ - CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ - int __Pyx_use_tracing = 0; - #define __Pyx_TraceFrameInit(codeobj)\ - if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; -#if PY_VERSION_HEX >= 0x030b00a2 - #if PY_VERSION_HEX >= 0x030C00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - ((!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #endif - #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) - #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) -#elif PY_VERSION_HEX >= 0x030a00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#endif - #ifdef WITH_THREAD - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - }\ - PyGILState_Release(state);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #else - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - { PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #endif - #define __Pyx_TraceException()\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 1)) {\ - __Pyx_EnterTracing(tstate);\ - PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ - if (exc_info) {\ - if (CYTHON_TRACE && tstate->c_tracefunc)\ - tstate->c_tracefunc(\ - tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - tstate->c_profilefunc(\ - tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - Py_DECREF(exc_info);\ - }\ - __Pyx_LeaveTracing(tstate);\ - }\ - } - static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_EnterTracing(tstate); - if (CYTHON_TRACE && tstate->c_tracefunc) - tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); - if (tstate->c_profilefunc) - tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); - CYTHON_FRAME_DEL(frame); - __Pyx_LeaveTracing(tstate); - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } - #ifdef WITH_THREAD - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - PyGILState_Release(state);\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - }\ - } - #else - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - } - #endif - static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); - static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); -#else - #define __Pyx_TraceDeclarations - #define __Pyx_TraceFrameInit(codeobj) - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; - #define __Pyx_TraceException() - #define __Pyx_TraceReturn(result, nogil) -#endif -#if CYTHON_TRACE - static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { - int ret; - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_PyFrame_SetLineNumber(frame, lineno); - __Pyx_EnterTracing(tstate); - ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); - __Pyx_LeaveTracing(tstate); - if (likely(!ret)) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - } - return ret; - } - #ifdef WITH_THREAD - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - int ret = 0;\ - PyThreadState *tstate;\ - PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - }\ - __Pyx_PyGILState_Release(state);\ - if (unlikely(ret)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - }\ - } - #else - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - } - #endif -#else - #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; -#endif - /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); @@ -2393,8 +2155,8 @@ int __pyx_module_is_main_w3lib___rfc5892 = 0; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_ValueError; /* #### Code section: string_decls ### */ +static const char __pyx_k_[] = "."; static const char __pyx_k_i[] = "i"; -static const char __pyx_k__2[] = "."; static const char __pyx_k__4[] = "?"; static const char __pyx_k_in[] = " in "; static const char __pyx_k_04X[] = "04X"; @@ -2461,12 +2223,12 @@ typedef struct { #endif #if CYTHON_USE_MODULE_STATE #endif + PyObject *__pyx_kp_u_; PyObject *__pyx_kp_u_04X; PyObject *__pyx_n_u_CONTEXTJ; PyObject *__pyx_kp_u_Joiner_U; PyObject *__pyx_n_s_None; PyObject *__pyx_n_s_ValueError; - PyObject *__pyx_kp_u__2; PyObject *__pyx_n_s__4; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_check_contextj_rules; @@ -2499,8 +2261,8 @@ typedef struct { PyObject *__pyx_kp_s_w3lib__rfc5892_pyx; PyObject *__pyx_int_0; PyObject *__pyx_int_1; - PyObject *__pyx_codeobj_; - PyObject *__pyx_tuple__3; + PyObject *__pyx_tuple__2; + PyObject *__pyx_codeobj__3; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -2543,12 +2305,12 @@ static int __pyx_m_clear(PyObject *m) { #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif + Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_kp_u_04X); Py_CLEAR(clear_module_state->__pyx_n_u_CONTEXTJ); Py_CLEAR(clear_module_state->__pyx_kp_u_Joiner_U); Py_CLEAR(clear_module_state->__pyx_n_s_None); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); - Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_n_s__4); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_check_contextj_rules); @@ -2581,8 +2343,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_s_w3lib__rfc5892_pyx); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); - Py_CLEAR(clear_module_state->__pyx_codeobj_); - Py_CLEAR(clear_module_state->__pyx_tuple__3); + Py_CLEAR(clear_module_state->__pyx_tuple__2); + Py_CLEAR(clear_module_state->__pyx_codeobj__3); return 0; } #endif @@ -2603,12 +2365,12 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif + Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_kp_u_04X); Py_VISIT(traverse_module_state->__pyx_n_u_CONTEXTJ); Py_VISIT(traverse_module_state->__pyx_kp_u_Joiner_U); Py_VISIT(traverse_module_state->__pyx_n_s_None); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); - Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_n_s__4); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_check_contextj_rules); @@ -2641,8 +2403,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_s_w3lib__rfc5892_pyx); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); - Py_VISIT(traverse_module_state->__pyx_codeobj_); - Py_VISIT(traverse_module_state->__pyx_tuple__3); + Py_VISIT(traverse_module_state->__pyx_tuple__2); + Py_VISIT(traverse_module_state->__pyx_codeobj__3); return 0; } #endif @@ -2673,12 +2435,12 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #endif #if CYTHON_USE_MODULE_STATE #endif +#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_kp_u_04X __pyx_mstate_global->__pyx_kp_u_04X #define __pyx_n_u_CONTEXTJ __pyx_mstate_global->__pyx_n_u_CONTEXTJ #define __pyx_kp_u_Joiner_U __pyx_mstate_global->__pyx_kp_u_Joiner_U #define __pyx_n_s_None __pyx_mstate_global->__pyx_n_s_None #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError -#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_n_s__4 __pyx_mstate_global->__pyx_n_s__4 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_check_contextj_rules __pyx_mstate_global->__pyx_n_s_check_contextj_rules @@ -2711,8 +2473,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_s_w3lib__rfc5892_pyx __pyx_mstate_global->__pyx_kp_s_w3lib__rfc5892_pyx #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 -#define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_ -#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 +#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 +#define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 /* #### Code section: module_code ### */ /* "w3lib/_rfc5892.pyx":12 @@ -2829,7 +2591,6 @@ static PyObject *__pyx_pf_5w3lib_8_rfc5892__check_contextj_rules(CYTHON_UNUSED P PyObject *__pyx_v_code_point = NULL; long __pyx_v_value; PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; @@ -2852,9 +2613,7 @@ static PyObject *__pyx_pf_5w3lib_8_rfc5892__check_contextj_rules(CYTHON_UNUSED P int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj_) __Pyx_RefNannySetupContext("_check_contextj_rules", 1); - __Pyx_TraceCall("_check_contextj_rules", __pyx_f[0], 12, 0, __PYX_ERR(0, 12, __pyx_L1_error)); /* "w3lib/_rfc5892.pyx":13 * @@ -3149,7 +2908,6 @@ static PyObject *__pyx_pf_5w3lib_8_rfc5892__check_contextj_rules(CYTHON_UNUSED P __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_code_point); __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3170,12 +2928,12 @@ static PyMethodDef __pyx_methods[] = { static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_kp_u_04X, __pyx_k_04X, sizeof(__pyx_k_04X), 0, 1, 0, 0}, {&__pyx_n_u_CONTEXTJ, __pyx_k_CONTEXTJ, sizeof(__pyx_k_CONTEXTJ), 0, 1, 0, 1}, {&__pyx_kp_u_Joiner_U, __pyx_k_Joiner_U, sizeof(__pyx_k_Joiner_U), 0, 1, 0, 0}, {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_n_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_check_contextj_rules, __pyx_k_check_contextj_rules, sizeof(__pyx_k_check_contextj_rules), 0, 0, 1, 1}, @@ -3231,10 +2989,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * if label.isascii(): * return */ - __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_label, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_value); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__rfc5892_pyx, __pyx_n_s_check_contextj_rules, 12, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(4, __pyx_n_s_label, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_value); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__rfc5892_pyx, __pyx_n_s_check_contextj_rules, 12, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -3485,7 +3243,6 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__rfc5892(PyObject *__pyx_pyinit_mo #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif - __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -3604,7 +3361,6 @@ if (!__Pyx_RefNanny) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__rfc5892(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); /* "w3lib/_rfc5892.pyx":3 * # https://www.rfc-editor.org/rfc/rfc5892.txt @@ -3712,7 +3468,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 12, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 12, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_8_rfc5892_1_check_contextj_rules, 0, __pyx_n_s_check_contextj_rules, NULL, __pyx_n_s_w3lib__rfc5892, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_8_rfc5892_1_check_contextj_rules, 0, __pyx_n_s_check_contextj_rules, NULL, __pyx_n_s_w3lib__rfc5892, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -3728,7 +3484,6 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_TraceReturn(Py_None, 0); /*--- Wrapped vars code ---*/ @@ -4407,96 +4162,6 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam return 0; } -/* Profile */ -#if CYTHON_PROFILE -static int __Pyx_TraceSetupAndCall(PyCodeObject** code, - PyFrameObject** frame, - PyThreadState* tstate, - const char *funcname, - const char *srcfile, - int firstlineno) { - PyObject *type, *value, *traceback; - int retval; - if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { - if (*code == NULL) { - *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); - if (*code == NULL) return 0; - } - *frame = PyFrame_New( - tstate, /*PyThreadState *tstate*/ - *code, /*PyCodeObject *code*/ - __pyx_d, /*PyObject *globals*/ - 0 /*PyObject *locals*/ - ); - if (*frame == NULL) return 0; - if (CYTHON_TRACE && (*frame)->f_trace == NULL) { - Py_INCREF(Py_None); - (*frame)->f_trace = Py_None; - } -#if PY_VERSION_HEX < 0x030400B1 - } else { - (*frame)->f_tstate = tstate; -#endif - } - __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); - retval = 1; - __Pyx_EnterTracing(tstate); - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - #if CYTHON_TRACE - if (tstate->c_tracefunc) - retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; - if (retval && tstate->c_profilefunc) - #endif - retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; - __Pyx_LeaveTracing(tstate); - if (retval) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - return __Pyx_IsTracing(tstate, 0, 0) && retval; - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - return -1; - } -} -static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { - PyCodeObject *py_code = 0; -#if PY_MAJOR_VERSION >= 3 - py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); - if (likely(py_code)) { - py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; - } -#else - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - py_funcname = PyString_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - py_srcfile = PyString_FromString(srcfile); - if (unlikely(!py_srcfile)) goto bad; - py_code = PyCode_New( - 0, - 0, - 0, - CO_OPTIMIZED | CO_NEWLOCALS, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - firstlineno, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); -#endif - return py_code; -} -#endif - /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { @@ -5641,7 +5306,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } diff --git a/w3lib/_types.c b/w3lib/_types.c index d997ceca..36dad1b6 100644 --- a/w3lib/_types.c +++ b/w3lib/_types.c @@ -1615,244 +1615,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); -/* Profile.proto */ -#ifndef CYTHON_PROFILE -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - #define CYTHON_PROFILE 0 -#else - #define CYTHON_PROFILE 1 -#endif -#endif -#ifndef CYTHON_TRACE_NOGIL - #define CYTHON_TRACE_NOGIL 0 -#else - #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) - #define CYTHON_TRACE 1 - #endif -#endif -#ifndef CYTHON_TRACE - #define CYTHON_TRACE 0 -#endif -#if CYTHON_TRACE - #undef CYTHON_PROFILE_REUSE_FRAME -#endif -#ifndef CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_PROFILE_REUSE_FRAME 0 -#endif -#if CYTHON_PROFILE || CYTHON_TRACE - #include "compile.h" - #include "frameobject.h" - #include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #if CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_FRAME_MODIFIER static - #define CYTHON_FRAME_DEL(frame) - #else - #define CYTHON_FRAME_MODIFIER - #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) - #endif - #define __Pyx_TraceDeclarations\ - static PyCodeObject *__pyx_frame_code = NULL;\ - CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ - int __Pyx_use_tracing = 0; - #define __Pyx_TraceFrameInit(codeobj)\ - if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; -#if PY_VERSION_HEX >= 0x030b00a2 - #if PY_VERSION_HEX >= 0x030C00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - ((!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #endif - #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) - #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) -#elif PY_VERSION_HEX >= 0x030a00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#endif - #ifdef WITH_THREAD - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - }\ - PyGILState_Release(state);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #else - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - { PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #endif - #define __Pyx_TraceException()\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 1)) {\ - __Pyx_EnterTracing(tstate);\ - PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ - if (exc_info) {\ - if (CYTHON_TRACE && tstate->c_tracefunc)\ - tstate->c_tracefunc(\ - tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - tstate->c_profilefunc(\ - tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - Py_DECREF(exc_info);\ - }\ - __Pyx_LeaveTracing(tstate);\ - }\ - } - static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_EnterTracing(tstate); - if (CYTHON_TRACE && tstate->c_tracefunc) - tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); - if (tstate->c_profilefunc) - tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); - CYTHON_FRAME_DEL(frame); - __Pyx_LeaveTracing(tstate); - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } - #ifdef WITH_THREAD - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - PyGILState_Release(state);\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - }\ - } - #else - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - } - #endif - static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); - static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); -#else - #define __Pyx_TraceDeclarations - #define __Pyx_TraceFrameInit(codeobj) - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; - #define __Pyx_TraceException() - #define __Pyx_TraceReturn(result, nogil) -#endif -#if CYTHON_TRACE - static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { - int ret; - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_PyFrame_SetLineNumber(frame, lineno); - __Pyx_EnterTracing(tstate); - ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); - __Pyx_LeaveTracing(tstate); - if (likely(!ret)) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - } - return ret; - } - #ifdef WITH_THREAD - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - int ret = 0;\ - PyThreadState *tstate;\ - PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - }\ - __Pyx_PyGILState_Release(state);\ - if (unlikely(ret)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - }\ - } - #else - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - } - #endif -#else - #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; -#endif - /* IncludeStringH.proto */ #include @@ -2586,7 +2348,6 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__types(PyObject *__pyx_pyinit_modu #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif - __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -2705,7 +2466,6 @@ if (!__Pyx_RefNanny) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__types(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); /* "w3lib/_types.pyx":1 * from typing import Union # <<<<<<<<<<<<<< @@ -2771,7 +2531,6 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_TraceReturn(Py_None, 0); /*--- Wrapped vars code ---*/ @@ -3002,96 +2761,6 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { return result; } -/* Profile */ -#if CYTHON_PROFILE -static int __Pyx_TraceSetupAndCall(PyCodeObject** code, - PyFrameObject** frame, - PyThreadState* tstate, - const char *funcname, - const char *srcfile, - int firstlineno) { - PyObject *type, *value, *traceback; - int retval; - if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { - if (*code == NULL) { - *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); - if (*code == NULL) return 0; - } - *frame = PyFrame_New( - tstate, /*PyThreadState *tstate*/ - *code, /*PyCodeObject *code*/ - __pyx_d, /*PyObject *globals*/ - 0 /*PyObject *locals*/ - ); - if (*frame == NULL) return 0; - if (CYTHON_TRACE && (*frame)->f_trace == NULL) { - Py_INCREF(Py_None); - (*frame)->f_trace = Py_None; - } -#if PY_VERSION_HEX < 0x030400B1 - } else { - (*frame)->f_tstate = tstate; -#endif - } - __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); - retval = 1; - __Pyx_EnterTracing(tstate); - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - #if CYTHON_TRACE - if (tstate->c_tracefunc) - retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; - if (retval && tstate->c_profilefunc) - #endif - retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; - __Pyx_LeaveTracing(tstate); - if (retval) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - return __Pyx_IsTracing(tstate, 0, 0) && retval; - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - return -1; - } -} -static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { - PyCodeObject *py_code = 0; -#if PY_MAJOR_VERSION >= 3 - py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); - if (likely(py_code)) { - py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; - } -#else - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - py_funcname = PyString_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - py_srcfile = PyString_FromString(srcfile); - if (unlikely(!py_srcfile)) goto bad; - py_code = PyCode_New( - 0, - 0, - 0, - CO_OPTIMIZED | CO_NEWLOCALS, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - firstlineno, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); -#endif - return py_code; -} -#endif - /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; diff --git a/w3lib/_url.c b/w3lib/_url.c index 3fc237f9..60ebdd12 100644 --- a/w3lib/_url.c +++ b/w3lib/_url.c @@ -1478,20 +1478,11 @@ struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr; struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr; struct __pyx_defaults; typedef struct __pyx_defaults __pyx_defaults; -struct __pyx_defaults1; -typedef struct __pyx_defaults1 __pyx_defaults1; struct __pyx_defaults { - PyObject *__pyx_arg_userinfo_percent_encode_set; - PyObject *__pyx_arg_path_percent_encode_set; - PyObject *__pyx_arg_query_percent_encode_set; - PyObject *__pyx_arg_special_query_percent_encode_set; - PyObject *__pyx_arg_fragment_percent_encode_set; -}; -struct __pyx_defaults1 { PyObject *__pyx_arg_min_length; }; -/* "w3lib/_url.pyx":822 +/* "w3lib/_url.pyx":817 * parts = parts[:-1] * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< @@ -1505,7 +1496,7 @@ struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr { }; -/* "w3lib/_url.pyx":842 +/* "w3lib/_url.pyx":837 * result = _parse_ipv4_number(part) * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< @@ -2157,6 +2148,18 @@ static CYTHON_INLINE int __Pyx_PyUnicode_ContainsTF(PyObject* substring, PyObjec return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* BuildPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, + int prepend_sign, char padding_char); + +/* CIntToPyUnicode.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char); + /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); @@ -2443,17 +2446,21 @@ 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); -/* GCCDiagnostics.proto */ -#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -#define __Pyx_HAS_GCC_DIAGNOSTIC -#endif - /* PyUCS4InUnicode.proto */ static CYTHON_INLINE int __Pyx_UnicodeContainsUCS4(PyObject* unicode, Py_UCS4 character); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); @@ -2470,9 +2477,6 @@ typedef const char *__Pyx_TypeName; #define __Pyx_DECREF_TypeName(obj) #endif -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) @@ -2583,14 +2587,14 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ +/* Module declarations from "cython" */ + /* Module declarations from "w3lib._url" */ static unsigned char __pyx_v_5w3lib_4_url_SCHEME_START; static unsigned char __pyx_v_5w3lib_4_url_SCHEME; static unsigned char __pyx_v_5w3lib_4_url_NO_SCHEME; static unsigned char __pyx_v_5w3lib_4_url_SPECIAL_RELATIVE_OR_AUTHORITY; static unsigned char __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY; -static unsigned char __pyx_v_5w3lib_4_url_RELATIVE; -static unsigned char __pyx_v_5w3lib_4_url_RELATIVE_SLASH; static unsigned char __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES; static unsigned char __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; static unsigned char __pyx_v_5w3lib_4_url_AUTHORITY; @@ -2604,6 +2608,9 @@ static unsigned char __pyx_v_5w3lib_4_url_PATH; static unsigned char __pyx_v_5w3lib_4_url_OPAQUE_PATH; static unsigned char __pyx_v_5w3lib_4_url_QUERY; static unsigned char __pyx_v_5w3lib_4_url_FRAGMENT; +static unsigned char __pyx_v_5w3lib_4_url_HOSTNAME; +static unsigned char __pyx_v_5w3lib_4_url_IPV4; +static unsigned char __pyx_v_5w3lib_4_url_IPV6; static PyObject *__pyx_8genexpr1__pyx_v_5w3lib_4_url_label; static PyObject *__pyx_8genexpr2__pyx_v_5w3lib_4_url_label; static PyObject *__pyx_8genexpr3__pyx_v_5w3lib_4_url_label; @@ -2645,7 +2652,6 @@ int __pyx_module_is_main_w3lib___url = 0; /* Implementation of "w3lib._url" */ /* #### Code section: global_var ### */ -static PyObject *__pyx_builtin_property; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; @@ -2653,6 +2659,7 @@ static PyObject *__pyx_builtin_chr; static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_enumerate; /* #### Code section: string_decls ### */ +static const char __pyx_k_[] = ""; static const char __pyx_k_c[] = "c"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_n[] = "n"; @@ -2664,7 +2671,6 @@ static const char __pyx_k_25[] = "%25"; static const char __pyx_k_2E[] = ".%2E"; static const char __pyx_k_2e[] = ".%2e"; static const char __pyx_k_40[] = "%40"; -static const char __pyx_k__2[] = ""; static const char __pyx_k__3[] = "+"; static const char __pyx_k__4[] = "%"; static const char __pyx_k__5[] = ":"; @@ -2685,39 +2691,38 @@ static const char __pyx_k_866[] = "866"; static const char __pyx_k_URL[] = "_URL"; 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__14[] = "?"; -static const char __pyx_k__15[] = "/\\"; -static const char __pyx_k__16[] = "@"; -static const char __pyx_k__17[] = "/?#"; +static const char __pyx_k__14[] = "/\\"; +static const char __pyx_k__15[] = "@"; +static const char __pyx_k__16[] = "/?#"; +static const char __pyx_k__17[] = "\\"; static const char __pyx_k__18[] = "/\\?#"; -static const char __pyx_k__19[] = "?#"; -static const char __pyx_k__21[] = "::"; -static const char __pyx_k__22[] = "//"; -static const char __pyx_k__23[] = "/."; -static const char __pyx_k__24[] = "*"; -static const char __pyx_k__75[] = "+-."; -static const char __pyx_k__78[] = "_"; -static const char __pyx_k__81[] = "~"; -static const char __pyx_k__82[] = " \"<>`"; -static const char __pyx_k__83[] = " \"#<>"; -static const char __pyx_k__84[] = "'"; -static const char __pyx_k__85[] = "?`{}"; -static const char __pyx_k__86[] = "/:;=@[\\]^|"; -static const char __pyx_k__87[] = ":/?#[]@"; -static const char __pyx_k__88[] = "!$&'()*+,;="; -static const char __pyx_k__89[] = "-._~"; -static const char __pyx_k__91[] = "|"; -static const char __pyx_k__94[] = ":;="; -static const char __pyx_k__95[] = "#[]|"; -static const char __pyx_k__96[] = "\000\t\n\r #/:<>?@[\\]^|"; -static const char __pyx_k__97[] = "%"; +static const char __pyx_k__19[] = "?"; +static const char __pyx_k__20[] = "#"; +static const char __pyx_k__21[] = "?#"; +static const char __pyx_k__23[] = "::"; +static const char __pyx_k__24[] = "//"; +static const char __pyx_k__25[] = "/."; +static const char __pyx_k__26[] = "*"; +static const char __pyx_k__73[] = "+-."; +static const char __pyx_k__76[] = "_"; +static const char __pyx_k__79[] = "~"; +static const char __pyx_k__80[] = " \"<>`"; +static const char __pyx_k__81[] = " \"#<>"; +static const char __pyx_k__82[] = "'"; +static const char __pyx_k__83[] = "?`{}"; +static const char __pyx_k__84[] = "/:;=@[\\]^|"; +static const char __pyx_k__85[] = ":/?#[]@"; +static const char __pyx_k__86[] = "!$&'()*+,;="; +static const char __pyx_k__87[] = "-._~"; +static const char __pyx_k__89[] = "|"; +static const char __pyx_k__92[] = ":;="; +static const char __pyx_k__93[] = "#[]|"; +static const char __pyx_k__94[] = "\000\t\n\r #/:<>?@[\\]^|"; +static const char __pyx_k__95[] = "%"; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_ftp[] = "ftp"; static const char __pyx_k_gbk[] = "gbk"; -static const char __pyx_k_get[] = "get"; static const char __pyx_k_int[] = "int"; static const char __pyx_k_koi[] = "koi"; static const char __pyx_k_mac[] = "mac"; @@ -2731,6 +2736,7 @@ static const char __pyx_k_2e_3[] = "%2e"; static const char __pyx_k_Dict[] = "Dict"; static const char __pyx_k_List[] = "List"; static const char __pyx_k_None[] = "None"; +static const char __pyx_k_Port[] = "Port "; static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_big5[] = "big5"; @@ -2738,10 +2744,10 @@ static const char __pyx_k_bool[] = "bool"; static const char __pyx_k_byte[] = "byte"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_file[] = "file"; -static const char __pyx_k_host[] = "host"; static const char __pyx_k_http[] = "http"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_ipv4[] = "ipv4"; +static const char __pyx_k_ipv6[] = "ipv6"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_koi8[] = "koi8"; static const char __pyx_k_last[] = "last"; @@ -2788,6 +2794,7 @@ static const char __pyx_k_strip[] = "strip"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_swaps[] = "swaps"; static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_uchar[] = "uchar"; static const char __pyx_k_ucs_2[] = "ucs-2"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_utr46[] = "_utr46"; @@ -2830,8 +2837,7 @@ static const char __pyx_k_number[] = "number"; static const char __pyx_k_output[] = "output"; static const char __pyx_k_result[] = "result"; static const char __pyx_k_return[] = "return"; -static const char __pyx_k_scheme[] = "_scheme"; -static const char __pyx_k_setter[] = "setter"; +static const char __pyx_k_scheme[] = "scheme"; static const char __pyx_k_string[] = "string"; static const char __pyx_k_typing[] = "typing"; static const char __pyx_k_utf_16[] = "utf-16"; @@ -2869,9 +2875,9 @@ static const char __pyx_k_x_cp125[] = "x-cp125"; static const char __pyx_k_Callable[] = "Callable"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_List_int[] = "List[int]"; +static const char __pyx_k_List_str[] = "List[str]"; static const char __pyx_k_Optional[] = "Optional"; static const char __pyx_k_asmo_708[] = "asmo-708"; -static const char __pyx_k_base_url[] = "base_url"; static const char __pyx_k_compress[] = "compress"; static const char __pyx_k_csgb2312[] = "csgb2312"; static const char __pyx_k_csibm866[] = "csibm866"; @@ -2896,10 +2902,8 @@ static const char __pyx_k_koi8_r_2[] = "koi8_r"; static const char __pyx_k_ksc_5601[] = "ksc_5601"; static const char __pyx_k_ms_kanji[] = "ms_kanji"; static const char __pyx_k_password[] = "password"; -static const char __pyx_k_property[] = "property"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_safe_url[] = "_safe_url"; -static const char __pyx_k_scheme_2[] = "scheme"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_to_ascii[] = "_to_ascii"; static const char __pyx_k_us_ascii[] = "us-ascii"; @@ -2914,6 +2918,7 @@ static const char __pyx_k_be_strict[] = "be_strict"; static const char __pyx_k_csunicode[] = "csunicode"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_functools[] = "functools"; +static const char __pyx_k_host_type[] = "_host_type"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_iso885910[] = "iso885910"; static const char __pyx_k_iso885911[] = "iso885911"; @@ -2940,18 +2945,17 @@ static const char __pyx_k_shift_jis[] = "shift-jis"; static const char __pyx_k_translate[] = "translate"; static const char __pyx_k_C0_CONTROL[] = "_C0_CONTROL"; static const char __pyx_k_URL___init[] = "_URL.__init__"; -static const char __pyx_k_URL_scheme[] = "_URL.scheme"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_big5_hkscs[] = "big5-hkscs"; static const char __pyx_k_check_bidi[] = "check_bidi"; static const char __pyx_k_code_point[] = "code_point"; static const char __pyx_k_codec_info[] = "codec_info"; static const char __pyx_k_csshiftjis[] = "csshiftjis"; +static const char __pyx_k_cython_int[] = "cython.int"; static const char __pyx_k_encode_set[] = "encode_set"; static const char __pyx_k_gb_2312_80[] = "gb_2312-80"; static const char __pyx_k_hz_gb_2312[] = "hz-gb-2312"; static const char __pyx_k_ipv4_piece[] = "ipv4_piece"; -static const char __pyx_k_is_special[] = "is_special"; static const char __pyx_k_iso8859_10[] = "iso8859-10"; static const char __pyx_k_iso8859_11[] = "iso8859-11"; static const char __pyx_k_iso8859_13[] = "iso8859-13"; @@ -3003,6 +3007,7 @@ static const char __pyx_k_csisolatin6[] = "csisolatin6"; static const char __pyx_k_csisolatin9[] = "csisolatin9"; static const char __pyx_k_csmacintosh[] = "csmacintosh"; static const char __pyx_k_get_encoder[] = "_get_encoder"; +static const char __pyx_k_is_too_high[] = " is too high."; static const char __pyx_k_iso_2022_cn[] = "iso-2022-cn"; static const char __pyx_k_iso_2022_jp[] = "iso-2022-jp"; static const char __pyx_k_iso_2022_kr[] = "iso-2022-kr"; @@ -3012,6 +3017,7 @@ static const char __pyx_k_iso_8859_13[] = "iso-8859-13"; static const char __pyx_k_iso_8859_14[] = "iso-8859-14"; static const char __pyx_k_iso_8859_15[] = "iso-8859-15"; static const char __pyx_k_iso_8859_16[] = "iso-8859-16"; +static const char __pyx_k_opaque_path[] = "opaque_path"; static const char __pyx_k_piece_index[] = "piece_index"; static const char __pyx_k_reached_end[] = "reached_end"; static const char __pyx_k_replacement[] = "replacement"; @@ -3025,11 +3031,10 @@ static const char __pyx_k_windows_949[] = "windows-949"; static const char __pyx_k_x_mac_roman[] = "x-mac-roman"; static const char __pyx_k_Dict_str_str[] = "Dict[str, str]"; static const char __pyx_k_Optional_int[] = "Optional[int]"; -static const char __pyx_k_Optional_str[] = "Optional[str]"; static const char __pyx_k_SCHEME_CHARS[] = "_SCHEME_CHARS"; static const char __pyx_k_ascii_domain[] = "ascii_domain"; static const char __pyx_k_at_sign_seen[] = "at_sign_seen"; -static const char __pyx_k_canonicalize[] = "canonicalize"; +static const char __pyx_k_cython_int_8[] = "cython.int[8]"; static const char __pyx_k_get_encoding[] = "_get_encoding"; static const char __pyx_k_greater_than[] = "greater_than"; static const char __pyx_k_index_length[] = "index_length"; @@ -3058,7 +3063,7 @@ static const char __pyx_k_windows_1252[] = "windows-1252"; static const char __pyx_k_windows_1254[] = "windows-1254"; static const char __pyx_k_CodecFunction[] = "CodecFunction"; static const char __pyx_k_DEFAULT_PORTS[] = "_DEFAULT_PORTS"; -static const char __pyx_k_Optional_bool[] = "Optional[bool]"; +static const char __pyx_k_No_URL_scheme[] = "No URL scheme"; static const char __pyx_k_UTF_8_ENCODER[] = "_UTF_8_ENCODER"; static const char __pyx_k_ascii_letters[] = "ascii_letters"; static const char __pyx_k_at_sign_index[] = "at_sign_index"; @@ -3094,10 +3099,10 @@ static const char __pyx_k_x_user_defined[] = "x-user-defined"; static const char __pyx_k_ASCII_HEX_DIGIT[] = "_ASCII_HEX_DIGIT"; static const char __pyx_k_LABEL_ENCODINGS[] = "_LABEL_ENCODINGS"; static const char __pyx_k_SPECIAL_SCHEMES[] = "_SPECIAL_SCHEMES"; +static const char __pyx_k_URL_is_relative[] = "URL is relative"; static const char __pyx_k_csiso58gb231280[] = "csiso58gb231280"; static const char __pyx_k_csisolatingreek[] = "csisolatingreek"; static const char __pyx_k_domain_to_ascii[] = "_domain_to_ascii"; -static const char __pyx_k_has_opaque_path[] = "has_opaque_path"; static const char __pyx_k_inside_brackets[] = "inside_brackets"; static const char __pyx_k_iso_10646_ucs_2[] = "iso-10646-ucs-2"; static const char __pyx_k_iso_2022_cn_ext[] = "iso-2022-cn-ext"; @@ -3121,12 +3126,11 @@ static const char __pyx_k_PercentEncodeSet[] = "_PercentEncodeSet"; static const char __pyx_k_RFC3986_RESERVED[] = "RFC3986_RESERVED"; static const char __pyx_k_csisolatinarabic[] = "csisolatinarabic"; static const char __pyx_k_csisolatinhebrew[] = "csisolatinhebrew"; -static const char __pyx_k_exclude_fragment[] = "exclude_fragment"; +static const char __pyx_k_query_token_seen[] = "_query_token_seen"; static const char __pyx_k_validation_error[] = "validation_error"; static const char __pyx_k_PATH_SAFEST_CHARS[] = "_PATH_SAFEST_CHARS"; static const char __pyx_k_UTF_16BE_ENCODING[] = "_UTF_16BE_ENCODING"; static const char __pyx_k_UTF_16LE_ENCODING[] = "_UTF_16LE_ENCODING"; -static const char __pyx_k_default_port_seen[] = "_default_port_seen"; static const char __pyx_k_parse_ipv4_number[] = "_parse_ipv4_number"; static const char __pyx_k_parse_opaque_host[] = "_parse_opaque_host"; static const char __pyx_k_short_windows_125[] = "_short_windows_125"; @@ -3138,16 +3142,15 @@ static const char __pyx_k_QUERY_SAFEST_CHARS[] = "_QUERY_SAFEST_CHARS"; static const char __pyx_k_RFC3986_GEN_DELIMS[] = "RFC3986_GEN_DELIMS"; static const char __pyx_k_RFC3986_SUB_DELIMS[] = "RFC3986_SUB_DELIMS"; static const char __pyx_k_RFC3986_UNRESERVED[] = "RFC3986_UNRESERVED"; -static const char __pyx_k_Union_str_List_str[] = "Union[str, List[str]]"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_csisolatincyrillic[] = "csisolatincyrillic"; static const char __pyx_k_percent_encode_set[] = "percent_encode_set"; static const char __pyx_k_serialize_url_path[] = "_serialize_url_path"; static const char __pyx_k_C0_CONTROL_OR_SPACE[] = "_C0_CONTROL_OR_SPACE"; -static const char __pyx_k_URL_has_opaque_path[] = "_URL.has_opaque_path"; static const char __pyx_k_cseucpkdfmtjapanese[] = "cseucpkdfmtjapanese"; static const char __pyx_k_encoded_code_points[] = "encoded_code_points"; +static const char __pyx_k_fragment_token_seen[] = "_fragment_token_seen"; static const char __pyx_k_password_token_seen[] = "_password_token_seen"; static const char __pyx_k_ASCII_TAB_OR_NEWLINE[] = "_ASCII_TAB_OR_NEWLINE"; static const char __pyx_k_REPLACEMENT_ENCODING[] = "_REPLACEMENT_ENCODING"; @@ -3155,15 +3158,11 @@ static const char __pyx_k_use_std3_ascii_rules[] = "use_std3_ascii_rules"; static const char __pyx_k_utf_8_percent_encode[] = "_utf_8_percent_encode"; static const char __pyx_k_FRAGMENT_SAFEST_CHARS[] = "_FRAGMENT_SAFEST_CHARS"; static const char __pyx_k_USERINFO_SAFEST_CHARS[] = "_USERINFO_SAFEST_CHARS"; -static const char __pyx_k_Union_int_List_int_str[] = "Union[int, List[int], str]"; -static const char __pyx_k_Union_str_int_List_int[] = "Union[str, int, List[int]]"; static const char __pyx_k_PATH_PERCENT_ENCODE_SET[] = "_PATH_PERCENT_ENCODE_SET"; static const char __pyx_k_is_windows_drive_letter[] = "_is_windows_drive_letter"; -static const char __pyx_k_path_percent_encode_set[] = "path_percent_encode_set"; static const char __pyx_k_skip_authority_shortcut[] = "skip_authority_shortcut"; static const char __pyx_k_transitional_processing[] = "transitional_processing"; static const char __pyx_k_QUERY_PERCENT_ENCODE_SET[] = "_QUERY_PERCENT_ENCODE_SET"; -static const char __pyx_k_query_percent_encode_set[] = "query_percent_encode_set"; static const char __pyx_k_parse_ipv4_locals_genexpr[] = "_parse_ipv4..genexpr"; static const char __pyx_k_FORBIDDEN_HOST_CODE_POINTS[] = "_FORBIDDEN_HOST_CODE_POINTS"; static const char __pyx_k_SPECIAL_QUERY_SAFEST_CHARS[] = "_SPECIAL_QUERY_SAFEST_CHARS"; @@ -3172,8 +3171,6 @@ static const char __pyx_k_is_single_dot_path_segment[] = "_is_single_dot_path_se static const char __pyx_k_FRAGMENT_PERCENT_ENCODE_SET[] = "_FRAGMENT_PERCENT_ENCODE_SET"; static const char __pyx_k_RFC3986_USERINFO_SAFE_CHARS[] = "RFC3986_USERINFO_SAFE_CHARS"; static const char __pyx_k_USERINFO_PERCENT_ENCODE_SET[] = "_USERINFO_PERCENT_ENCODE_SET"; -static const char __pyx_k_fragment_percent_encode_set[] = "fragment_percent_encode_set"; -static const char __pyx_k_userinfo_percent_encode_set[] = "userinfo_percent_encode_set"; static const char __pyx_k_FORBIDDEN_DOMAIN_CODE_POINTS[] = "_FORBIDDEN_DOMAIN_CODE_POINTS"; static const char __pyx_k_SAFE_PATH_PERCENT_ENCODE_SET[] = "_SAFE_PATH_PERCENT_ENCODE_SET"; static const char __pyx_k_C0_CONTROL_PERCENT_ENCODE_SET[] = "_C0_CONTROL_PERCENT_ENCODE_SET"; @@ -3199,15 +3196,11 @@ static const char __pyx_k_does_not_match_any_encoding_lab[] = " does not match a static const char __pyx_k_idempotent_utf_8_percent_encode[] = "_idempotent_utf_8_percent_encode"; static const char __pyx_k_is_an_empty_string_after_conver[] = " is an empty string after conversion to ASCII, which makes for an invalid domain name."; static const char __pyx_k_starts_with_windows_drive_lette[] = "_starts_with_windows_drive_letter"; -static const char __pyx_k_special_query_percent_encode_set[] = "special_query_percent_encode_set"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_5w3lib_4_url__short_windows_125(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_last_digit); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_2_get_encoder(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_encoding); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_4_URL_4scheme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_4_URL_6scheme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_6_shorten_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set, PyObject *__pyx_v_space_as_plus); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ @@ -3219,22 +3212,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, PyObject *__pyx_v_be_strict); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_is_special); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_url); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_36_preprocess_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_base_url, PyObject *__pyx_v_encoding, PyObject *__pyx_v_userinfo_percent_encode_set, PyObject *__pyx_v_path_percent_encode_set, PyObject *__pyx_v_query_percent_encode_set, PyObject *__pyx_v_special_query_percent_encode_set, PyObject *__pyx_v_fragment_percent_encode_set); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_canonicalize); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_exclude_fragment, PyObject *__pyx_v_canonicalize); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_52_safe_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding); /* proto */ static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -3267,11 +3259,16 @@ typedef struct { PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr; PyObject *__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr; #endif PyTypeObject *__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr; PyTypeObject *__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr; + PyObject *__pyx_n_s_; + PyObject *__pyx_kp_b_; + PyObject *__pyx_kp_u_; PyObject *__pyx_kp_u_02X; PyObject *__pyx_kp_u_0X; PyObject *__pyx_kp_u_0x; @@ -3317,15 +3314,16 @@ typedef struct { PyObject *__pyx_n_s_LABEL_ENCODINGS; PyObject *__pyx_n_s_List; PyObject *__pyx_kp_s_List_int; + PyObject *__pyx_kp_s_List_str; + PyObject *__pyx_kp_u_No_URL_scheme; PyObject *__pyx_n_s_None; PyObject *__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS; PyObject *__pyx_n_s_Optional; - PyObject *__pyx_kp_s_Optional_bool; PyObject *__pyx_kp_s_Optional_int; - PyObject *__pyx_kp_s_Optional_str; PyObject *__pyx_n_s_PATH_PERCENT_ENCODE_SET; PyObject *__pyx_n_s_PATH_SAFEST_CHARS; PyObject *__pyx_n_s_PercentEncodeSet; + PyObject *__pyx_kp_u_Port; PyObject *__pyx_n_s_QUERY_PERCENT_ENCODE_SET; PyObject *__pyx_n_s_QUERY_SAFEST_CHARS; PyObject *__pyx_n_s_REPLACEMENT_ENCODING; @@ -3355,8 +3353,7 @@ typedef struct { PyObject *__pyx_kp_s_Tuple_int_bool; PyObject *__pyx_n_s_URL; PyObject *__pyx_n_s_URL___init; - PyObject *__pyx_n_s_URL_has_opaque_path; - PyObject *__pyx_n_s_URL_scheme; + PyObject *__pyx_kp_u_URL_is_relative; PyObject *__pyx_n_s_USERINFO_PERCENT_ENCODE_SET; PyObject *__pyx_n_s_USERINFO_SAFEST_CHARS; PyObject *__pyx_n_s_UTF_16BE_ENCODING; @@ -3364,54 +3361,48 @@ typedef struct { PyObject *__pyx_n_s_UTF_8_ENCODER; PyObject *__pyx_n_s_UTF_8_ENCODING; PyObject *__pyx_n_s_Union; - PyObject *__pyx_kp_s_Union_int_List_int_str; - PyObject *__pyx_kp_s_Union_str_List_str; - PyObject *__pyx_kp_s_Union_str_int_List_int; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_kp_u__10; PyObject *__pyx_kp_u__11; - PyObject *__pyx_kp_b__12; - PyObject *__pyx_kp_u__12; - PyObject *__pyx_kp_u__13; - PyObject *__pyx_n_s__14; PyObject *__pyx_kp_u__14; PyObject *__pyx_kp_u__15; PyObject *__pyx_kp_u__16; PyObject *__pyx_kp_u__17; PyObject *__pyx_kp_u__18; + PyObject *__pyx_n_s__19; PyObject *__pyx_kp_u__19; - PyObject *__pyx_n_s__2; - PyObject *__pyx_kp_b__2; - PyObject *__pyx_kp_u__2; + PyObject *__pyx_kp_b__20; + PyObject *__pyx_kp_u__20; PyObject *__pyx_kp_u__21; - PyObject *__pyx_kp_u__22; PyObject *__pyx_kp_u__23; - PyObject *__pyx_n_s__24; + PyObject *__pyx_kp_u__24; + PyObject *__pyx_kp_u__25; + PyObject *__pyx_n_s__26; PyObject *__pyx_kp_u__3; PyObject *__pyx_kp_b__4; PyObject *__pyx_kp_u__4; PyObject *__pyx_kp_b__5; PyObject *__pyx_kp_u__5; PyObject *__pyx_kp_u__6; - PyObject *__pyx_kp_u__75; - PyObject *__pyx_n_s__78; + PyObject *__pyx_kp_u__73; + PyObject *__pyx_n_s__76; + PyObject *__pyx_kp_u__79; PyObject *__pyx_kp_u__8; + PyObject *__pyx_kp_u__80; PyObject *__pyx_kp_u__81; + PyObject *__pyx_kp_b__82; PyObject *__pyx_kp_u__82; PyObject *__pyx_kp_u__83; - PyObject *__pyx_kp_b__84; PyObject *__pyx_kp_u__84; - PyObject *__pyx_kp_u__85; - PyObject *__pyx_kp_u__86; - PyObject *__pyx_kp_b__87; - PyObject *__pyx_kp_b__88; - PyObject *__pyx_kp_u__89; + PyObject *__pyx_kp_b__85; + PyObject *__pyx_kp_b__86; + PyObject *__pyx_kp_u__87; + PyObject *__pyx_kp_b__89; PyObject *__pyx_kp_u__9; - PyObject *__pyx_kp_b__91; - PyObject *__pyx_kp_b__94; - PyObject *__pyx_kp_b__95; - PyObject *__pyx_kp_u__96; - PyObject *__pyx_kp_u__97; + PyObject *__pyx_kp_b__92; + PyObject *__pyx_kp_b__93; + PyObject *__pyx_kp_u__94; + PyObject *__pyx_kp_u__95; PyObject *__pyx_n_s_address; PyObject *__pyx_n_s_annotations; PyObject *__pyx_kp_u_ansi_x3_4_1968; @@ -3426,7 +3417,6 @@ typedef struct { PyObject *__pyx_n_s_at_sign_index; PyObject *__pyx_n_s_at_sign_seen; PyObject *__pyx_n_s_base; - PyObject *__pyx_n_s_base_url; PyObject *__pyx_n_s_be_strict; PyObject *__pyx_n_u_big5; PyObject *__pyx_kp_u_big5_hkscs; @@ -3434,7 +3424,6 @@ typedef struct { PyObject *__pyx_n_s_buffer; PyObject *__pyx_n_s_byte; PyObject *__pyx_n_s_c; - PyObject *__pyx_n_s_canonicalize; PyObject *__pyx_n_s_check_bidi; PyObject *__pyx_n_s_check_hyphens; PyObject *__pyx_n_s_check_joiners; @@ -3486,7 +3475,8 @@ typedef struct { PyObject *__pyx_n_s_current_index; PyObject *__pyx_n_s_current_length; PyObject *__pyx_n_u_cyrillic; - PyObject *__pyx_n_s_default_port_seen; + PyObject *__pyx_kp_s_cython_int; + PyObject *__pyx_kp_s_cython_int_8; PyObject *__pyx_n_s_delete; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_digits; @@ -3512,11 +3502,10 @@ typedef struct { PyObject *__pyx_n_s_enumerate; PyObject *__pyx_kp_u_euc_jp; PyObject *__pyx_kp_u_euc_kr; - PyObject *__pyx_n_s_exclude_fragment; PyObject *__pyx_n_u_file; PyObject *__pyx_n_s_floor; PyObject *__pyx_n_s_fragment; - PyObject *__pyx_n_s_fragment_percent_encode_set; + PyObject *__pyx_n_s_fragment_token_seen; PyObject *__pyx_n_u_ftp; PyObject *__pyx_n_s_functools; PyObject *__pyx_n_u_gb18030; @@ -3526,16 +3515,14 @@ typedef struct { PyObject *__pyx_n_u_gbk; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_genexpr; - PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_encoder; PyObject *__pyx_n_s_get_encoding; PyObject *__pyx_n_s_get_ipv6_first_longest_0_piece; PyObject *__pyx_n_s_greater_than; PyObject *__pyx_n_u_greek; PyObject *__pyx_n_u_greek8; - PyObject *__pyx_n_s_has_opaque_path; PyObject *__pyx_n_u_hebrew; - PyObject *__pyx_n_s_host; + PyObject *__pyx_n_s_host_type; PyObject *__pyx_n_s_hostname; PyObject *__pyx_n_u_http; PyObject *__pyx_n_u_https; @@ -3558,11 +3545,12 @@ typedef struct { PyObject *__pyx_n_s_int; PyObject *__pyx_n_s_ipv4; PyObject *__pyx_n_s_ipv4_piece; + PyObject *__pyx_n_s_ipv6; PyObject *__pyx_kp_u_is_an_empty_string_after_conver; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_is_double_dot_path_segment; PyObject *__pyx_n_s_is_single_dot_path_segment; - PyObject *__pyx_n_s_is_special; + PyObject *__pyx_kp_u_is_too_high; PyObject *__pyx_n_s_is_windows_drive_letter; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_u_iso88591; @@ -3699,6 +3687,7 @@ typedef struct { PyObject *__pyx_n_s_number; PyObject *__pyx_n_s_numbers; PyObject *__pyx_n_s_numbers_seen; + PyObject *__pyx_n_s_opaque_path; PyObject *__pyx_n_s_output; PyObject *__pyx_n_s_parse_host; PyObject *__pyx_n_s_parse_ipv4; @@ -3712,7 +3701,6 @@ typedef struct { PyObject *__pyx_n_s_password; PyObject *__pyx_n_s_password_token_seen; PyObject *__pyx_n_s_path; - PyObject *__pyx_n_s_path_percent_encode_set; PyObject *__pyx_n_s_path_safe_chars; PyObject *__pyx_n_s_path_token_seen; PyObject *__pyx_n_s_percent_encode_after_encoding; @@ -3724,10 +3712,9 @@ typedef struct { PyObject *__pyx_n_s_port_token_seen; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_preprocess_url; - PyObject *__pyx_n_s_property; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_query; - PyObject *__pyx_n_s_query_percent_encode_set; + PyObject *__pyx_n_s_query_token_seen; PyObject *__pyx_n_s_r; PyObject *__pyx_n_s_range; PyObject *__pyx_n_s_reached_end; @@ -3740,7 +3727,6 @@ typedef struct { PyObject *__pyx_n_s_safe_chars; PyObject *__pyx_n_s_safe_url; PyObject *__pyx_n_s_scheme; - PyObject *__pyx_n_s_scheme_2; PyObject *__pyx_n_s_segment; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_send; @@ -3751,7 +3737,6 @@ typedef struct { PyObject *__pyx_n_s_serialize_url; PyObject *__pyx_n_s_serialize_url_path; PyObject *__pyx_n_s_set_name; - PyObject *__pyx_n_s_setter; PyObject *__pyx_kp_u_shift_jis; PyObject *__pyx_n_u_shift_jis_2; PyObject *__pyx_n_s_short_windows_125; @@ -3760,7 +3745,6 @@ typedef struct { PyObject *__pyx_n_s_skip_authority_shortcut; PyObject *__pyx_n_s_space_as_plus; PyObject *__pyx_n_s_spec; - PyObject *__pyx_n_s_special_query_percent_encode_set; PyObject *__pyx_n_s_starts_with_windows_drive_lette; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_str; @@ -3776,6 +3760,7 @@ typedef struct { PyObject *__pyx_n_s_transitional_processing; PyObject *__pyx_n_s_translate; PyObject *__pyx_n_s_typing; + PyObject *__pyx_n_s_uchar; PyObject *__pyx_kp_u_ucs_2; PyObject *__pyx_n_u_unicode; PyObject *__pyx_n_u_unicode11utf8; @@ -3788,7 +3773,6 @@ typedef struct { PyObject *__pyx_n_s_urllib_parse; PyObject *__pyx_kp_u_us_ascii; PyObject *__pyx_n_s_use_std3_ascii_rules; - PyObject *__pyx_n_s_userinfo_percent_encode_set; PyObject *__pyx_n_s_username; PyObject *__pyx_n_u_utf8; PyObject *__pyx_kp_u_utf_16; @@ -3843,14 +3827,13 @@ typedef struct { PyObject *__pyx_int_255; PyObject *__pyx_int_256; PyObject *__pyx_int_443; - PyObject *__pyx_int_65535; PyObject *__pyx_int_neg_1; - PyObject *__pyx_slice_; + PyObject *__pyx_slice__2; PyObject *__pyx_tuple__7; - PyObject *__pyx_slice__20; - PyObject *__pyx_tuple__25; + PyObject *__pyx_slice__22; + PyObject *__pyx_tuple__12; + PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__27; - PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__31; @@ -3887,15 +3870,17 @@ typedef struct { PyObject *__pyx_tuple__62; PyObject *__pyx_tuple__63; PyObject *__pyx_tuple__64; + PyObject *__pyx_tuple__65; PyObject *__pyx_tuple__66; - PyObject *__pyx_tuple__67; + PyObject *__pyx_tuple__68; PyObject *__pyx_tuple__69; - PyObject *__pyx_tuple__73; - PyObject *__pyx_tuple__76; - PyObject *__pyx_tuple__79; + PyObject *__pyx_tuple__71; + PyObject *__pyx_tuple__74; + PyObject *__pyx_tuple__77; + PyObject *__pyx_tuple__88; PyObject *__pyx_tuple__90; - PyObject *__pyx_tuple__92; - PyObject *__pyx_tuple__93; + PyObject *__pyx_tuple__91; + PyObject *__pyx_tuple__96; PyObject *__pyx_tuple__98; PyObject *__pyx_tuple__100; PyObject *__pyx_tuple__102; @@ -3905,26 +3890,22 @@ typedef struct { PyObject *__pyx_tuple__110; PyObject *__pyx_tuple__112; PyObject *__pyx_tuple__114; - PyObject *__pyx_tuple__116; + PyObject *__pyx_tuple__118; PyObject *__pyx_tuple__120; PyObject *__pyx_tuple__122; PyObject *__pyx_tuple__124; PyObject *__pyx_tuple__126; PyObject *__pyx_tuple__128; - PyObject *__pyx_tuple__130; - PyObject *__pyx_tuple__132; - PyObject *__pyx_tuple__134; - PyObject *__pyx_tuple__136; - PyObject *__pyx_tuple__138; - PyObject *__pyx_codeobj__26; - PyObject *__pyx_codeobj__65; - PyObject *__pyx_codeobj__68; + PyObject *__pyx_tuple__131; + PyObject *__pyx_tuple__133; + PyObject *__pyx_tuple__135; + PyObject *__pyx_codeobj__28; + PyObject *__pyx_codeobj__67; PyObject *__pyx_codeobj__70; - PyObject *__pyx_codeobj__71; PyObject *__pyx_codeobj__72; - PyObject *__pyx_codeobj__74; - PyObject *__pyx_codeobj__77; - PyObject *__pyx_codeobj__80; + PyObject *__pyx_codeobj__75; + PyObject *__pyx_codeobj__78; + PyObject *__pyx_codeobj__97; PyObject *__pyx_codeobj__99; PyObject *__pyx_codeobj__101; PyObject *__pyx_codeobj__103; @@ -3934,19 +3915,18 @@ typedef struct { PyObject *__pyx_codeobj__111; PyObject *__pyx_codeobj__113; PyObject *__pyx_codeobj__115; + PyObject *__pyx_codeobj__116; PyObject *__pyx_codeobj__117; - PyObject *__pyx_codeobj__118; PyObject *__pyx_codeobj__119; PyObject *__pyx_codeobj__121; PyObject *__pyx_codeobj__123; PyObject *__pyx_codeobj__125; PyObject *__pyx_codeobj__127; PyObject *__pyx_codeobj__129; - PyObject *__pyx_codeobj__131; - PyObject *__pyx_codeobj__133; - PyObject *__pyx_codeobj__135; - PyObject *__pyx_codeobj__137; - PyObject *__pyx_codeobj__139; + PyObject *__pyx_codeobj__130; + PyObject *__pyx_codeobj__132; + PyObject *__pyx_codeobj__134; + PyObject *__pyx_codeobj__136; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -3993,6 +3973,9 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr); Py_CLEAR(clear_module_state->__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr); + Py_CLEAR(clear_module_state->__pyx_n_s_); + Py_CLEAR(clear_module_state->__pyx_kp_b_); + Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_kp_u_02X); Py_CLEAR(clear_module_state->__pyx_kp_u_0X); Py_CLEAR(clear_module_state->__pyx_kp_u_0x); @@ -4038,15 +4021,16 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_LABEL_ENCODINGS); Py_CLEAR(clear_module_state->__pyx_n_s_List); Py_CLEAR(clear_module_state->__pyx_kp_s_List_int); + Py_CLEAR(clear_module_state->__pyx_kp_s_List_str); + Py_CLEAR(clear_module_state->__pyx_kp_u_No_URL_scheme); Py_CLEAR(clear_module_state->__pyx_n_s_None); Py_CLEAR(clear_module_state->__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); Py_CLEAR(clear_module_state->__pyx_n_s_Optional); - Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_bool); Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_int); - Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_str); Py_CLEAR(clear_module_state->__pyx_n_s_PATH_PERCENT_ENCODE_SET); Py_CLEAR(clear_module_state->__pyx_n_s_PATH_SAFEST_CHARS); Py_CLEAR(clear_module_state->__pyx_n_s_PercentEncodeSet); + Py_CLEAR(clear_module_state->__pyx_kp_u_Port); Py_CLEAR(clear_module_state->__pyx_n_s_QUERY_PERCENT_ENCODE_SET); Py_CLEAR(clear_module_state->__pyx_n_s_QUERY_SAFEST_CHARS); Py_CLEAR(clear_module_state->__pyx_n_s_REPLACEMENT_ENCODING); @@ -4076,8 +4060,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_s_Tuple_int_bool); Py_CLEAR(clear_module_state->__pyx_n_s_URL); Py_CLEAR(clear_module_state->__pyx_n_s_URL___init); - Py_CLEAR(clear_module_state->__pyx_n_s_URL_has_opaque_path); - Py_CLEAR(clear_module_state->__pyx_n_s_URL_scheme); + Py_CLEAR(clear_module_state->__pyx_kp_u_URL_is_relative); Py_CLEAR(clear_module_state->__pyx_n_s_USERINFO_PERCENT_ENCODE_SET); Py_CLEAR(clear_module_state->__pyx_n_s_USERINFO_SAFEST_CHARS); Py_CLEAR(clear_module_state->__pyx_n_s_UTF_16BE_ENCODING); @@ -4085,54 +4068,48 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_UTF_8_ENCODER); Py_CLEAR(clear_module_state->__pyx_n_s_UTF_8_ENCODING); Py_CLEAR(clear_module_state->__pyx_n_s_Union); - Py_CLEAR(clear_module_state->__pyx_kp_s_Union_int_List_int_str); - Py_CLEAR(clear_module_state->__pyx_kp_s_Union_str_List_str); - Py_CLEAR(clear_module_state->__pyx_kp_s_Union_str_int_List_int); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_kp_u__10); Py_CLEAR(clear_module_state->__pyx_kp_u__11); - Py_CLEAR(clear_module_state->__pyx_kp_b__12); - Py_CLEAR(clear_module_state->__pyx_kp_u__12); - Py_CLEAR(clear_module_state->__pyx_kp_u__13); - Py_CLEAR(clear_module_state->__pyx_n_s__14); Py_CLEAR(clear_module_state->__pyx_kp_u__14); Py_CLEAR(clear_module_state->__pyx_kp_u__15); Py_CLEAR(clear_module_state->__pyx_kp_u__16); Py_CLEAR(clear_module_state->__pyx_kp_u__17); Py_CLEAR(clear_module_state->__pyx_kp_u__18); + Py_CLEAR(clear_module_state->__pyx_n_s__19); Py_CLEAR(clear_module_state->__pyx_kp_u__19); - Py_CLEAR(clear_module_state->__pyx_n_s__2); - Py_CLEAR(clear_module_state->__pyx_kp_b__2); - Py_CLEAR(clear_module_state->__pyx_kp_u__2); + Py_CLEAR(clear_module_state->__pyx_kp_b__20); + Py_CLEAR(clear_module_state->__pyx_kp_u__20); Py_CLEAR(clear_module_state->__pyx_kp_u__21); - Py_CLEAR(clear_module_state->__pyx_kp_u__22); Py_CLEAR(clear_module_state->__pyx_kp_u__23); - Py_CLEAR(clear_module_state->__pyx_n_s__24); + Py_CLEAR(clear_module_state->__pyx_kp_u__24); + Py_CLEAR(clear_module_state->__pyx_kp_u__25); + Py_CLEAR(clear_module_state->__pyx_n_s__26); Py_CLEAR(clear_module_state->__pyx_kp_u__3); Py_CLEAR(clear_module_state->__pyx_kp_b__4); Py_CLEAR(clear_module_state->__pyx_kp_u__4); Py_CLEAR(clear_module_state->__pyx_kp_b__5); Py_CLEAR(clear_module_state->__pyx_kp_u__5); Py_CLEAR(clear_module_state->__pyx_kp_u__6); - Py_CLEAR(clear_module_state->__pyx_kp_u__75); - Py_CLEAR(clear_module_state->__pyx_n_s__78); + Py_CLEAR(clear_module_state->__pyx_kp_u__73); + Py_CLEAR(clear_module_state->__pyx_n_s__76); + Py_CLEAR(clear_module_state->__pyx_kp_u__79); Py_CLEAR(clear_module_state->__pyx_kp_u__8); + Py_CLEAR(clear_module_state->__pyx_kp_u__80); Py_CLEAR(clear_module_state->__pyx_kp_u__81); + Py_CLEAR(clear_module_state->__pyx_kp_b__82); Py_CLEAR(clear_module_state->__pyx_kp_u__82); Py_CLEAR(clear_module_state->__pyx_kp_u__83); - Py_CLEAR(clear_module_state->__pyx_kp_b__84); Py_CLEAR(clear_module_state->__pyx_kp_u__84); - Py_CLEAR(clear_module_state->__pyx_kp_u__85); - Py_CLEAR(clear_module_state->__pyx_kp_u__86); - Py_CLEAR(clear_module_state->__pyx_kp_b__87); - Py_CLEAR(clear_module_state->__pyx_kp_b__88); - Py_CLEAR(clear_module_state->__pyx_kp_u__89); + Py_CLEAR(clear_module_state->__pyx_kp_b__85); + Py_CLEAR(clear_module_state->__pyx_kp_b__86); + Py_CLEAR(clear_module_state->__pyx_kp_u__87); + Py_CLEAR(clear_module_state->__pyx_kp_b__89); Py_CLEAR(clear_module_state->__pyx_kp_u__9); - Py_CLEAR(clear_module_state->__pyx_kp_b__91); - Py_CLEAR(clear_module_state->__pyx_kp_b__94); - Py_CLEAR(clear_module_state->__pyx_kp_b__95); - Py_CLEAR(clear_module_state->__pyx_kp_u__96); - Py_CLEAR(clear_module_state->__pyx_kp_u__97); + Py_CLEAR(clear_module_state->__pyx_kp_b__92); + Py_CLEAR(clear_module_state->__pyx_kp_b__93); + Py_CLEAR(clear_module_state->__pyx_kp_u__94); + Py_CLEAR(clear_module_state->__pyx_kp_u__95); Py_CLEAR(clear_module_state->__pyx_n_s_address); Py_CLEAR(clear_module_state->__pyx_n_s_annotations); Py_CLEAR(clear_module_state->__pyx_kp_u_ansi_x3_4_1968); @@ -4147,7 +4124,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_at_sign_index); Py_CLEAR(clear_module_state->__pyx_n_s_at_sign_seen); Py_CLEAR(clear_module_state->__pyx_n_s_base); - Py_CLEAR(clear_module_state->__pyx_n_s_base_url); Py_CLEAR(clear_module_state->__pyx_n_s_be_strict); Py_CLEAR(clear_module_state->__pyx_n_u_big5); Py_CLEAR(clear_module_state->__pyx_kp_u_big5_hkscs); @@ -4155,7 +4131,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_byte); Py_CLEAR(clear_module_state->__pyx_n_s_c); - Py_CLEAR(clear_module_state->__pyx_n_s_canonicalize); Py_CLEAR(clear_module_state->__pyx_n_s_check_bidi); Py_CLEAR(clear_module_state->__pyx_n_s_check_hyphens); Py_CLEAR(clear_module_state->__pyx_n_s_check_joiners); @@ -4207,7 +4182,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_current_index); Py_CLEAR(clear_module_state->__pyx_n_s_current_length); Py_CLEAR(clear_module_state->__pyx_n_u_cyrillic); - Py_CLEAR(clear_module_state->__pyx_n_s_default_port_seen); + Py_CLEAR(clear_module_state->__pyx_kp_s_cython_int); + Py_CLEAR(clear_module_state->__pyx_kp_s_cython_int_8); Py_CLEAR(clear_module_state->__pyx_n_s_delete); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_digits); @@ -4233,11 +4209,10 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_enumerate); Py_CLEAR(clear_module_state->__pyx_kp_u_euc_jp); Py_CLEAR(clear_module_state->__pyx_kp_u_euc_kr); - Py_CLEAR(clear_module_state->__pyx_n_s_exclude_fragment); Py_CLEAR(clear_module_state->__pyx_n_u_file); Py_CLEAR(clear_module_state->__pyx_n_s_floor); Py_CLEAR(clear_module_state->__pyx_n_s_fragment); - Py_CLEAR(clear_module_state->__pyx_n_s_fragment_percent_encode_set); + Py_CLEAR(clear_module_state->__pyx_n_s_fragment_token_seen); Py_CLEAR(clear_module_state->__pyx_n_u_ftp); Py_CLEAR(clear_module_state->__pyx_n_s_functools); Py_CLEAR(clear_module_state->__pyx_n_u_gb18030); @@ -4247,16 +4222,14 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_u_gbk); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); - Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_encoder); Py_CLEAR(clear_module_state->__pyx_n_s_get_encoding); Py_CLEAR(clear_module_state->__pyx_n_s_get_ipv6_first_longest_0_piece); Py_CLEAR(clear_module_state->__pyx_n_s_greater_than); Py_CLEAR(clear_module_state->__pyx_n_u_greek); Py_CLEAR(clear_module_state->__pyx_n_u_greek8); - Py_CLEAR(clear_module_state->__pyx_n_s_has_opaque_path); Py_CLEAR(clear_module_state->__pyx_n_u_hebrew); - Py_CLEAR(clear_module_state->__pyx_n_s_host); + Py_CLEAR(clear_module_state->__pyx_n_s_host_type); Py_CLEAR(clear_module_state->__pyx_n_s_hostname); Py_CLEAR(clear_module_state->__pyx_n_u_http); Py_CLEAR(clear_module_state->__pyx_n_u_https); @@ -4279,11 +4252,12 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_int); Py_CLEAR(clear_module_state->__pyx_n_s_ipv4); Py_CLEAR(clear_module_state->__pyx_n_s_ipv4_piece); + Py_CLEAR(clear_module_state->__pyx_n_s_ipv6); Py_CLEAR(clear_module_state->__pyx_kp_u_is_an_empty_string_after_conver); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_is_double_dot_path_segment); Py_CLEAR(clear_module_state->__pyx_n_s_is_single_dot_path_segment); - Py_CLEAR(clear_module_state->__pyx_n_s_is_special); + Py_CLEAR(clear_module_state->__pyx_kp_u_is_too_high); Py_CLEAR(clear_module_state->__pyx_n_s_is_windows_drive_letter); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_u_iso88591); @@ -4420,6 +4394,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_number); Py_CLEAR(clear_module_state->__pyx_n_s_numbers); Py_CLEAR(clear_module_state->__pyx_n_s_numbers_seen); + Py_CLEAR(clear_module_state->__pyx_n_s_opaque_path); Py_CLEAR(clear_module_state->__pyx_n_s_output); Py_CLEAR(clear_module_state->__pyx_n_s_parse_host); Py_CLEAR(clear_module_state->__pyx_n_s_parse_ipv4); @@ -4433,7 +4408,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_password); Py_CLEAR(clear_module_state->__pyx_n_s_password_token_seen); Py_CLEAR(clear_module_state->__pyx_n_s_path); - Py_CLEAR(clear_module_state->__pyx_n_s_path_percent_encode_set); Py_CLEAR(clear_module_state->__pyx_n_s_path_safe_chars); Py_CLEAR(clear_module_state->__pyx_n_s_path_token_seen); Py_CLEAR(clear_module_state->__pyx_n_s_percent_encode_after_encoding); @@ -4445,10 +4419,9 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_port_token_seen); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_preprocess_url); - Py_CLEAR(clear_module_state->__pyx_n_s_property); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_query); - Py_CLEAR(clear_module_state->__pyx_n_s_query_percent_encode_set); + Py_CLEAR(clear_module_state->__pyx_n_s_query_token_seen); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_n_s_reached_end); @@ -4461,7 +4434,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_safe_chars); Py_CLEAR(clear_module_state->__pyx_n_s_safe_url); Py_CLEAR(clear_module_state->__pyx_n_s_scheme); - Py_CLEAR(clear_module_state->__pyx_n_s_scheme_2); Py_CLEAR(clear_module_state->__pyx_n_s_segment); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_send); @@ -4472,7 +4444,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_serialize_url); Py_CLEAR(clear_module_state->__pyx_n_s_serialize_url_path); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); - Py_CLEAR(clear_module_state->__pyx_n_s_setter); Py_CLEAR(clear_module_state->__pyx_kp_u_shift_jis); Py_CLEAR(clear_module_state->__pyx_n_u_shift_jis_2); Py_CLEAR(clear_module_state->__pyx_n_s_short_windows_125); @@ -4481,7 +4452,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_skip_authority_shortcut); Py_CLEAR(clear_module_state->__pyx_n_s_space_as_plus); Py_CLEAR(clear_module_state->__pyx_n_s_spec); - Py_CLEAR(clear_module_state->__pyx_n_s_special_query_percent_encode_set); Py_CLEAR(clear_module_state->__pyx_n_s_starts_with_windows_drive_lette); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_str); @@ -4497,6 +4467,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_transitional_processing); Py_CLEAR(clear_module_state->__pyx_n_s_translate); Py_CLEAR(clear_module_state->__pyx_n_s_typing); + Py_CLEAR(clear_module_state->__pyx_n_s_uchar); Py_CLEAR(clear_module_state->__pyx_kp_u_ucs_2); Py_CLEAR(clear_module_state->__pyx_n_u_unicode); Py_CLEAR(clear_module_state->__pyx_n_u_unicode11utf8); @@ -4509,7 +4480,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_urllib_parse); Py_CLEAR(clear_module_state->__pyx_kp_u_us_ascii); Py_CLEAR(clear_module_state->__pyx_n_s_use_std3_ascii_rules); - Py_CLEAR(clear_module_state->__pyx_n_s_userinfo_percent_encode_set); Py_CLEAR(clear_module_state->__pyx_n_s_username); Py_CLEAR(clear_module_state->__pyx_n_u_utf8); Py_CLEAR(clear_module_state->__pyx_kp_u_utf_16); @@ -4564,14 +4534,13 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_int_255); Py_CLEAR(clear_module_state->__pyx_int_256); Py_CLEAR(clear_module_state->__pyx_int_443); - Py_CLEAR(clear_module_state->__pyx_int_65535); Py_CLEAR(clear_module_state->__pyx_int_neg_1); - Py_CLEAR(clear_module_state->__pyx_slice_); + Py_CLEAR(clear_module_state->__pyx_slice__2); Py_CLEAR(clear_module_state->__pyx_tuple__7); - Py_CLEAR(clear_module_state->__pyx_slice__20); - Py_CLEAR(clear_module_state->__pyx_tuple__25); + Py_CLEAR(clear_module_state->__pyx_slice__22); + Py_CLEAR(clear_module_state->__pyx_tuple__12); + Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__27); - Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__31); @@ -4608,15 +4577,17 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_tuple__62); Py_CLEAR(clear_module_state->__pyx_tuple__63); Py_CLEAR(clear_module_state->__pyx_tuple__64); + Py_CLEAR(clear_module_state->__pyx_tuple__65); Py_CLEAR(clear_module_state->__pyx_tuple__66); - Py_CLEAR(clear_module_state->__pyx_tuple__67); + Py_CLEAR(clear_module_state->__pyx_tuple__68); Py_CLEAR(clear_module_state->__pyx_tuple__69); - Py_CLEAR(clear_module_state->__pyx_tuple__73); - Py_CLEAR(clear_module_state->__pyx_tuple__76); - Py_CLEAR(clear_module_state->__pyx_tuple__79); + Py_CLEAR(clear_module_state->__pyx_tuple__71); + Py_CLEAR(clear_module_state->__pyx_tuple__74); + Py_CLEAR(clear_module_state->__pyx_tuple__77); + Py_CLEAR(clear_module_state->__pyx_tuple__88); Py_CLEAR(clear_module_state->__pyx_tuple__90); - Py_CLEAR(clear_module_state->__pyx_tuple__92); - Py_CLEAR(clear_module_state->__pyx_tuple__93); + Py_CLEAR(clear_module_state->__pyx_tuple__91); + Py_CLEAR(clear_module_state->__pyx_tuple__96); Py_CLEAR(clear_module_state->__pyx_tuple__98); Py_CLEAR(clear_module_state->__pyx_tuple__100); Py_CLEAR(clear_module_state->__pyx_tuple__102); @@ -4626,26 +4597,22 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_tuple__110); Py_CLEAR(clear_module_state->__pyx_tuple__112); Py_CLEAR(clear_module_state->__pyx_tuple__114); - Py_CLEAR(clear_module_state->__pyx_tuple__116); + Py_CLEAR(clear_module_state->__pyx_tuple__118); Py_CLEAR(clear_module_state->__pyx_tuple__120); Py_CLEAR(clear_module_state->__pyx_tuple__122); Py_CLEAR(clear_module_state->__pyx_tuple__124); Py_CLEAR(clear_module_state->__pyx_tuple__126); Py_CLEAR(clear_module_state->__pyx_tuple__128); - Py_CLEAR(clear_module_state->__pyx_tuple__130); - Py_CLEAR(clear_module_state->__pyx_tuple__132); - Py_CLEAR(clear_module_state->__pyx_tuple__134); - Py_CLEAR(clear_module_state->__pyx_tuple__136); - Py_CLEAR(clear_module_state->__pyx_tuple__138); - Py_CLEAR(clear_module_state->__pyx_codeobj__26); - Py_CLEAR(clear_module_state->__pyx_codeobj__65); - Py_CLEAR(clear_module_state->__pyx_codeobj__68); + Py_CLEAR(clear_module_state->__pyx_tuple__131); + Py_CLEAR(clear_module_state->__pyx_tuple__133); + Py_CLEAR(clear_module_state->__pyx_tuple__135); + Py_CLEAR(clear_module_state->__pyx_codeobj__28); + Py_CLEAR(clear_module_state->__pyx_codeobj__67); Py_CLEAR(clear_module_state->__pyx_codeobj__70); - Py_CLEAR(clear_module_state->__pyx_codeobj__71); Py_CLEAR(clear_module_state->__pyx_codeobj__72); - Py_CLEAR(clear_module_state->__pyx_codeobj__74); - Py_CLEAR(clear_module_state->__pyx_codeobj__77); - Py_CLEAR(clear_module_state->__pyx_codeobj__80); + Py_CLEAR(clear_module_state->__pyx_codeobj__75); + Py_CLEAR(clear_module_state->__pyx_codeobj__78); + Py_CLEAR(clear_module_state->__pyx_codeobj__97); Py_CLEAR(clear_module_state->__pyx_codeobj__99); Py_CLEAR(clear_module_state->__pyx_codeobj__101); Py_CLEAR(clear_module_state->__pyx_codeobj__103); @@ -4655,19 +4622,18 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_codeobj__111); Py_CLEAR(clear_module_state->__pyx_codeobj__113); Py_CLEAR(clear_module_state->__pyx_codeobj__115); + Py_CLEAR(clear_module_state->__pyx_codeobj__116); Py_CLEAR(clear_module_state->__pyx_codeobj__117); - Py_CLEAR(clear_module_state->__pyx_codeobj__118); Py_CLEAR(clear_module_state->__pyx_codeobj__119); Py_CLEAR(clear_module_state->__pyx_codeobj__121); Py_CLEAR(clear_module_state->__pyx_codeobj__123); Py_CLEAR(clear_module_state->__pyx_codeobj__125); Py_CLEAR(clear_module_state->__pyx_codeobj__127); Py_CLEAR(clear_module_state->__pyx_codeobj__129); - Py_CLEAR(clear_module_state->__pyx_codeobj__131); - Py_CLEAR(clear_module_state->__pyx_codeobj__133); - Py_CLEAR(clear_module_state->__pyx_codeobj__135); - Py_CLEAR(clear_module_state->__pyx_codeobj__137); - Py_CLEAR(clear_module_state->__pyx_codeobj__139); + Py_CLEAR(clear_module_state->__pyx_codeobj__130); + Py_CLEAR(clear_module_state->__pyx_codeobj__132); + Py_CLEAR(clear_module_state->__pyx_codeobj__134); + Py_CLEAR(clear_module_state->__pyx_codeobj__136); return 0; } #endif @@ -4692,6 +4658,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr); Py_VISIT(traverse_module_state->__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr); + Py_VISIT(traverse_module_state->__pyx_n_s_); + Py_VISIT(traverse_module_state->__pyx_kp_b_); + Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_kp_u_02X); Py_VISIT(traverse_module_state->__pyx_kp_u_0X); Py_VISIT(traverse_module_state->__pyx_kp_u_0x); @@ -4737,15 +4706,16 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_LABEL_ENCODINGS); Py_VISIT(traverse_module_state->__pyx_n_s_List); Py_VISIT(traverse_module_state->__pyx_kp_s_List_int); + Py_VISIT(traverse_module_state->__pyx_kp_s_List_str); + Py_VISIT(traverse_module_state->__pyx_kp_u_No_URL_scheme); Py_VISIT(traverse_module_state->__pyx_n_s_None); Py_VISIT(traverse_module_state->__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); Py_VISIT(traverse_module_state->__pyx_n_s_Optional); - Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_bool); Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_int); - Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_str); Py_VISIT(traverse_module_state->__pyx_n_s_PATH_PERCENT_ENCODE_SET); Py_VISIT(traverse_module_state->__pyx_n_s_PATH_SAFEST_CHARS); Py_VISIT(traverse_module_state->__pyx_n_s_PercentEncodeSet); + Py_VISIT(traverse_module_state->__pyx_kp_u_Port); Py_VISIT(traverse_module_state->__pyx_n_s_QUERY_PERCENT_ENCODE_SET); Py_VISIT(traverse_module_state->__pyx_n_s_QUERY_SAFEST_CHARS); Py_VISIT(traverse_module_state->__pyx_n_s_REPLACEMENT_ENCODING); @@ -4775,8 +4745,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_s_Tuple_int_bool); Py_VISIT(traverse_module_state->__pyx_n_s_URL); Py_VISIT(traverse_module_state->__pyx_n_s_URL___init); - Py_VISIT(traverse_module_state->__pyx_n_s_URL_has_opaque_path); - Py_VISIT(traverse_module_state->__pyx_n_s_URL_scheme); + Py_VISIT(traverse_module_state->__pyx_kp_u_URL_is_relative); Py_VISIT(traverse_module_state->__pyx_n_s_USERINFO_PERCENT_ENCODE_SET); Py_VISIT(traverse_module_state->__pyx_n_s_USERINFO_SAFEST_CHARS); Py_VISIT(traverse_module_state->__pyx_n_s_UTF_16BE_ENCODING); @@ -4784,54 +4753,48 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_UTF_8_ENCODER); Py_VISIT(traverse_module_state->__pyx_n_s_UTF_8_ENCODING); Py_VISIT(traverse_module_state->__pyx_n_s_Union); - Py_VISIT(traverse_module_state->__pyx_kp_s_Union_int_List_int_str); - Py_VISIT(traverse_module_state->__pyx_kp_s_Union_str_List_str); - Py_VISIT(traverse_module_state->__pyx_kp_s_Union_str_int_List_int); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_kp_u__10); Py_VISIT(traverse_module_state->__pyx_kp_u__11); - Py_VISIT(traverse_module_state->__pyx_kp_b__12); - Py_VISIT(traverse_module_state->__pyx_kp_u__12); - Py_VISIT(traverse_module_state->__pyx_kp_u__13); - Py_VISIT(traverse_module_state->__pyx_n_s__14); Py_VISIT(traverse_module_state->__pyx_kp_u__14); Py_VISIT(traverse_module_state->__pyx_kp_u__15); Py_VISIT(traverse_module_state->__pyx_kp_u__16); Py_VISIT(traverse_module_state->__pyx_kp_u__17); Py_VISIT(traverse_module_state->__pyx_kp_u__18); + Py_VISIT(traverse_module_state->__pyx_n_s__19); Py_VISIT(traverse_module_state->__pyx_kp_u__19); - Py_VISIT(traverse_module_state->__pyx_n_s__2); - Py_VISIT(traverse_module_state->__pyx_kp_b__2); - Py_VISIT(traverse_module_state->__pyx_kp_u__2); + Py_VISIT(traverse_module_state->__pyx_kp_b__20); + Py_VISIT(traverse_module_state->__pyx_kp_u__20); Py_VISIT(traverse_module_state->__pyx_kp_u__21); - Py_VISIT(traverse_module_state->__pyx_kp_u__22); Py_VISIT(traverse_module_state->__pyx_kp_u__23); - Py_VISIT(traverse_module_state->__pyx_n_s__24); + Py_VISIT(traverse_module_state->__pyx_kp_u__24); + Py_VISIT(traverse_module_state->__pyx_kp_u__25); + Py_VISIT(traverse_module_state->__pyx_n_s__26); Py_VISIT(traverse_module_state->__pyx_kp_u__3); Py_VISIT(traverse_module_state->__pyx_kp_b__4); Py_VISIT(traverse_module_state->__pyx_kp_u__4); Py_VISIT(traverse_module_state->__pyx_kp_b__5); Py_VISIT(traverse_module_state->__pyx_kp_u__5); Py_VISIT(traverse_module_state->__pyx_kp_u__6); - Py_VISIT(traverse_module_state->__pyx_kp_u__75); - Py_VISIT(traverse_module_state->__pyx_n_s__78); + Py_VISIT(traverse_module_state->__pyx_kp_u__73); + Py_VISIT(traverse_module_state->__pyx_n_s__76); + Py_VISIT(traverse_module_state->__pyx_kp_u__79); Py_VISIT(traverse_module_state->__pyx_kp_u__8); + Py_VISIT(traverse_module_state->__pyx_kp_u__80); Py_VISIT(traverse_module_state->__pyx_kp_u__81); + Py_VISIT(traverse_module_state->__pyx_kp_b__82); Py_VISIT(traverse_module_state->__pyx_kp_u__82); Py_VISIT(traverse_module_state->__pyx_kp_u__83); - Py_VISIT(traverse_module_state->__pyx_kp_b__84); Py_VISIT(traverse_module_state->__pyx_kp_u__84); - Py_VISIT(traverse_module_state->__pyx_kp_u__85); - Py_VISIT(traverse_module_state->__pyx_kp_u__86); - Py_VISIT(traverse_module_state->__pyx_kp_b__87); - Py_VISIT(traverse_module_state->__pyx_kp_b__88); - Py_VISIT(traverse_module_state->__pyx_kp_u__89); + Py_VISIT(traverse_module_state->__pyx_kp_b__85); + Py_VISIT(traverse_module_state->__pyx_kp_b__86); + Py_VISIT(traverse_module_state->__pyx_kp_u__87); + Py_VISIT(traverse_module_state->__pyx_kp_b__89); Py_VISIT(traverse_module_state->__pyx_kp_u__9); - Py_VISIT(traverse_module_state->__pyx_kp_b__91); - Py_VISIT(traverse_module_state->__pyx_kp_b__94); - Py_VISIT(traverse_module_state->__pyx_kp_b__95); - Py_VISIT(traverse_module_state->__pyx_kp_u__96); - Py_VISIT(traverse_module_state->__pyx_kp_u__97); + Py_VISIT(traverse_module_state->__pyx_kp_b__92); + Py_VISIT(traverse_module_state->__pyx_kp_b__93); + Py_VISIT(traverse_module_state->__pyx_kp_u__94); + Py_VISIT(traverse_module_state->__pyx_kp_u__95); Py_VISIT(traverse_module_state->__pyx_n_s_address); Py_VISIT(traverse_module_state->__pyx_n_s_annotations); Py_VISIT(traverse_module_state->__pyx_kp_u_ansi_x3_4_1968); @@ -4846,7 +4809,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_at_sign_index); Py_VISIT(traverse_module_state->__pyx_n_s_at_sign_seen); Py_VISIT(traverse_module_state->__pyx_n_s_base); - Py_VISIT(traverse_module_state->__pyx_n_s_base_url); Py_VISIT(traverse_module_state->__pyx_n_s_be_strict); Py_VISIT(traverse_module_state->__pyx_n_u_big5); Py_VISIT(traverse_module_state->__pyx_kp_u_big5_hkscs); @@ -4854,7 +4816,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_byte); Py_VISIT(traverse_module_state->__pyx_n_s_c); - Py_VISIT(traverse_module_state->__pyx_n_s_canonicalize); Py_VISIT(traverse_module_state->__pyx_n_s_check_bidi); Py_VISIT(traverse_module_state->__pyx_n_s_check_hyphens); Py_VISIT(traverse_module_state->__pyx_n_s_check_joiners); @@ -4906,7 +4867,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_current_index); Py_VISIT(traverse_module_state->__pyx_n_s_current_length); Py_VISIT(traverse_module_state->__pyx_n_u_cyrillic); - Py_VISIT(traverse_module_state->__pyx_n_s_default_port_seen); + Py_VISIT(traverse_module_state->__pyx_kp_s_cython_int); + Py_VISIT(traverse_module_state->__pyx_kp_s_cython_int_8); Py_VISIT(traverse_module_state->__pyx_n_s_delete); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_digits); @@ -4932,11 +4894,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_enumerate); Py_VISIT(traverse_module_state->__pyx_kp_u_euc_jp); Py_VISIT(traverse_module_state->__pyx_kp_u_euc_kr); - Py_VISIT(traverse_module_state->__pyx_n_s_exclude_fragment); Py_VISIT(traverse_module_state->__pyx_n_u_file); Py_VISIT(traverse_module_state->__pyx_n_s_floor); Py_VISIT(traverse_module_state->__pyx_n_s_fragment); - Py_VISIT(traverse_module_state->__pyx_n_s_fragment_percent_encode_set); + Py_VISIT(traverse_module_state->__pyx_n_s_fragment_token_seen); Py_VISIT(traverse_module_state->__pyx_n_u_ftp); Py_VISIT(traverse_module_state->__pyx_n_s_functools); Py_VISIT(traverse_module_state->__pyx_n_u_gb18030); @@ -4946,16 +4907,14 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_u_gbk); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); - Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_encoder); Py_VISIT(traverse_module_state->__pyx_n_s_get_encoding); Py_VISIT(traverse_module_state->__pyx_n_s_get_ipv6_first_longest_0_piece); Py_VISIT(traverse_module_state->__pyx_n_s_greater_than); Py_VISIT(traverse_module_state->__pyx_n_u_greek); Py_VISIT(traverse_module_state->__pyx_n_u_greek8); - Py_VISIT(traverse_module_state->__pyx_n_s_has_opaque_path); Py_VISIT(traverse_module_state->__pyx_n_u_hebrew); - Py_VISIT(traverse_module_state->__pyx_n_s_host); + Py_VISIT(traverse_module_state->__pyx_n_s_host_type); Py_VISIT(traverse_module_state->__pyx_n_s_hostname); Py_VISIT(traverse_module_state->__pyx_n_u_http); Py_VISIT(traverse_module_state->__pyx_n_u_https); @@ -4978,11 +4937,12 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_int); Py_VISIT(traverse_module_state->__pyx_n_s_ipv4); Py_VISIT(traverse_module_state->__pyx_n_s_ipv4_piece); + Py_VISIT(traverse_module_state->__pyx_n_s_ipv6); Py_VISIT(traverse_module_state->__pyx_kp_u_is_an_empty_string_after_conver); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_is_double_dot_path_segment); Py_VISIT(traverse_module_state->__pyx_n_s_is_single_dot_path_segment); - Py_VISIT(traverse_module_state->__pyx_n_s_is_special); + Py_VISIT(traverse_module_state->__pyx_kp_u_is_too_high); Py_VISIT(traverse_module_state->__pyx_n_s_is_windows_drive_letter); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_u_iso88591); @@ -5119,6 +5079,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_number); Py_VISIT(traverse_module_state->__pyx_n_s_numbers); Py_VISIT(traverse_module_state->__pyx_n_s_numbers_seen); + Py_VISIT(traverse_module_state->__pyx_n_s_opaque_path); Py_VISIT(traverse_module_state->__pyx_n_s_output); Py_VISIT(traverse_module_state->__pyx_n_s_parse_host); Py_VISIT(traverse_module_state->__pyx_n_s_parse_ipv4); @@ -5132,7 +5093,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_password); Py_VISIT(traverse_module_state->__pyx_n_s_password_token_seen); Py_VISIT(traverse_module_state->__pyx_n_s_path); - Py_VISIT(traverse_module_state->__pyx_n_s_path_percent_encode_set); Py_VISIT(traverse_module_state->__pyx_n_s_path_safe_chars); Py_VISIT(traverse_module_state->__pyx_n_s_path_token_seen); Py_VISIT(traverse_module_state->__pyx_n_s_percent_encode_after_encoding); @@ -5144,10 +5104,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_port_token_seen); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_preprocess_url); - Py_VISIT(traverse_module_state->__pyx_n_s_property); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_query); - Py_VISIT(traverse_module_state->__pyx_n_s_query_percent_encode_set); + Py_VISIT(traverse_module_state->__pyx_n_s_query_token_seen); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_n_s_reached_end); @@ -5160,7 +5119,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_safe_chars); Py_VISIT(traverse_module_state->__pyx_n_s_safe_url); Py_VISIT(traverse_module_state->__pyx_n_s_scheme); - Py_VISIT(traverse_module_state->__pyx_n_s_scheme_2); Py_VISIT(traverse_module_state->__pyx_n_s_segment); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_send); @@ -5171,7 +5129,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_serialize_url); Py_VISIT(traverse_module_state->__pyx_n_s_serialize_url_path); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); - Py_VISIT(traverse_module_state->__pyx_n_s_setter); Py_VISIT(traverse_module_state->__pyx_kp_u_shift_jis); Py_VISIT(traverse_module_state->__pyx_n_u_shift_jis_2); Py_VISIT(traverse_module_state->__pyx_n_s_short_windows_125); @@ -5180,7 +5137,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_skip_authority_shortcut); Py_VISIT(traverse_module_state->__pyx_n_s_space_as_plus); Py_VISIT(traverse_module_state->__pyx_n_s_spec); - Py_VISIT(traverse_module_state->__pyx_n_s_special_query_percent_encode_set); Py_VISIT(traverse_module_state->__pyx_n_s_starts_with_windows_drive_lette); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_str); @@ -5196,6 +5152,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_transitional_processing); Py_VISIT(traverse_module_state->__pyx_n_s_translate); Py_VISIT(traverse_module_state->__pyx_n_s_typing); + Py_VISIT(traverse_module_state->__pyx_n_s_uchar); Py_VISIT(traverse_module_state->__pyx_kp_u_ucs_2); Py_VISIT(traverse_module_state->__pyx_n_u_unicode); Py_VISIT(traverse_module_state->__pyx_n_u_unicode11utf8); @@ -5208,7 +5165,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_urllib_parse); Py_VISIT(traverse_module_state->__pyx_kp_u_us_ascii); Py_VISIT(traverse_module_state->__pyx_n_s_use_std3_ascii_rules); - Py_VISIT(traverse_module_state->__pyx_n_s_userinfo_percent_encode_set); Py_VISIT(traverse_module_state->__pyx_n_s_username); Py_VISIT(traverse_module_state->__pyx_n_u_utf8); Py_VISIT(traverse_module_state->__pyx_kp_u_utf_16); @@ -5263,14 +5219,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_int_255); Py_VISIT(traverse_module_state->__pyx_int_256); Py_VISIT(traverse_module_state->__pyx_int_443); - Py_VISIT(traverse_module_state->__pyx_int_65535); Py_VISIT(traverse_module_state->__pyx_int_neg_1); - Py_VISIT(traverse_module_state->__pyx_slice_); + Py_VISIT(traverse_module_state->__pyx_slice__2); Py_VISIT(traverse_module_state->__pyx_tuple__7); - Py_VISIT(traverse_module_state->__pyx_slice__20); - Py_VISIT(traverse_module_state->__pyx_tuple__25); + Py_VISIT(traverse_module_state->__pyx_slice__22); + Py_VISIT(traverse_module_state->__pyx_tuple__12); + Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__27); - Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__31); @@ -5307,15 +5262,17 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_tuple__62); Py_VISIT(traverse_module_state->__pyx_tuple__63); Py_VISIT(traverse_module_state->__pyx_tuple__64); + Py_VISIT(traverse_module_state->__pyx_tuple__65); Py_VISIT(traverse_module_state->__pyx_tuple__66); - Py_VISIT(traverse_module_state->__pyx_tuple__67); + Py_VISIT(traverse_module_state->__pyx_tuple__68); Py_VISIT(traverse_module_state->__pyx_tuple__69); - Py_VISIT(traverse_module_state->__pyx_tuple__73); - Py_VISIT(traverse_module_state->__pyx_tuple__76); - Py_VISIT(traverse_module_state->__pyx_tuple__79); + Py_VISIT(traverse_module_state->__pyx_tuple__71); + Py_VISIT(traverse_module_state->__pyx_tuple__74); + Py_VISIT(traverse_module_state->__pyx_tuple__77); + Py_VISIT(traverse_module_state->__pyx_tuple__88); Py_VISIT(traverse_module_state->__pyx_tuple__90); - Py_VISIT(traverse_module_state->__pyx_tuple__92); - Py_VISIT(traverse_module_state->__pyx_tuple__93); + Py_VISIT(traverse_module_state->__pyx_tuple__91); + Py_VISIT(traverse_module_state->__pyx_tuple__96); Py_VISIT(traverse_module_state->__pyx_tuple__98); Py_VISIT(traverse_module_state->__pyx_tuple__100); Py_VISIT(traverse_module_state->__pyx_tuple__102); @@ -5325,26 +5282,22 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_tuple__110); Py_VISIT(traverse_module_state->__pyx_tuple__112); Py_VISIT(traverse_module_state->__pyx_tuple__114); - Py_VISIT(traverse_module_state->__pyx_tuple__116); + Py_VISIT(traverse_module_state->__pyx_tuple__118); Py_VISIT(traverse_module_state->__pyx_tuple__120); Py_VISIT(traverse_module_state->__pyx_tuple__122); Py_VISIT(traverse_module_state->__pyx_tuple__124); Py_VISIT(traverse_module_state->__pyx_tuple__126); Py_VISIT(traverse_module_state->__pyx_tuple__128); - Py_VISIT(traverse_module_state->__pyx_tuple__130); - Py_VISIT(traverse_module_state->__pyx_tuple__132); - Py_VISIT(traverse_module_state->__pyx_tuple__134); - Py_VISIT(traverse_module_state->__pyx_tuple__136); - Py_VISIT(traverse_module_state->__pyx_tuple__138); - Py_VISIT(traverse_module_state->__pyx_codeobj__26); - Py_VISIT(traverse_module_state->__pyx_codeobj__65); - Py_VISIT(traverse_module_state->__pyx_codeobj__68); + Py_VISIT(traverse_module_state->__pyx_tuple__131); + Py_VISIT(traverse_module_state->__pyx_tuple__133); + Py_VISIT(traverse_module_state->__pyx_tuple__135); + Py_VISIT(traverse_module_state->__pyx_codeobj__28); + Py_VISIT(traverse_module_state->__pyx_codeobj__67); Py_VISIT(traverse_module_state->__pyx_codeobj__70); - Py_VISIT(traverse_module_state->__pyx_codeobj__71); Py_VISIT(traverse_module_state->__pyx_codeobj__72); - Py_VISIT(traverse_module_state->__pyx_codeobj__74); - Py_VISIT(traverse_module_state->__pyx_codeobj__77); - Py_VISIT(traverse_module_state->__pyx_codeobj__80); + Py_VISIT(traverse_module_state->__pyx_codeobj__75); + Py_VISIT(traverse_module_state->__pyx_codeobj__78); + Py_VISIT(traverse_module_state->__pyx_codeobj__97); Py_VISIT(traverse_module_state->__pyx_codeobj__99); Py_VISIT(traverse_module_state->__pyx_codeobj__101); Py_VISIT(traverse_module_state->__pyx_codeobj__103); @@ -5354,19 +5307,18 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_codeobj__111); Py_VISIT(traverse_module_state->__pyx_codeobj__113); Py_VISIT(traverse_module_state->__pyx_codeobj__115); + Py_VISIT(traverse_module_state->__pyx_codeobj__116); Py_VISIT(traverse_module_state->__pyx_codeobj__117); - Py_VISIT(traverse_module_state->__pyx_codeobj__118); Py_VISIT(traverse_module_state->__pyx_codeobj__119); Py_VISIT(traverse_module_state->__pyx_codeobj__121); Py_VISIT(traverse_module_state->__pyx_codeobj__123); Py_VISIT(traverse_module_state->__pyx_codeobj__125); Py_VISIT(traverse_module_state->__pyx_codeobj__127); Py_VISIT(traverse_module_state->__pyx_codeobj__129); - Py_VISIT(traverse_module_state->__pyx_codeobj__131); - Py_VISIT(traverse_module_state->__pyx_codeobj__133); - Py_VISIT(traverse_module_state->__pyx_codeobj__135); - Py_VISIT(traverse_module_state->__pyx_codeobj__137); - Py_VISIT(traverse_module_state->__pyx_codeobj__139); + Py_VISIT(traverse_module_state->__pyx_codeobj__130); + Py_VISIT(traverse_module_state->__pyx_codeobj__132); + Py_VISIT(traverse_module_state->__pyx_codeobj__134); + Py_VISIT(traverse_module_state->__pyx_codeobj__136); return 0; } #endif @@ -5396,11 +5348,16 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE #define __pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr #define __pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr #endif #define __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr #define __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr +#define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ +#define __pyx_kp_b_ __pyx_mstate_global->__pyx_kp_b_ +#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_kp_u_02X __pyx_mstate_global->__pyx_kp_u_02X #define __pyx_kp_u_0X __pyx_mstate_global->__pyx_kp_u_0X #define __pyx_kp_u_0x __pyx_mstate_global->__pyx_kp_u_0x @@ -5446,15 +5403,16 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_LABEL_ENCODINGS __pyx_mstate_global->__pyx_n_s_LABEL_ENCODINGS #define __pyx_n_s_List __pyx_mstate_global->__pyx_n_s_List #define __pyx_kp_s_List_int __pyx_mstate_global->__pyx_kp_s_List_int +#define __pyx_kp_s_List_str __pyx_mstate_global->__pyx_kp_s_List_str +#define __pyx_kp_u_No_URL_scheme __pyx_mstate_global->__pyx_kp_u_No_URL_scheme #define __pyx_n_s_None __pyx_mstate_global->__pyx_n_s_None #define __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS __pyx_mstate_global->__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS #define __pyx_n_s_Optional __pyx_mstate_global->__pyx_n_s_Optional -#define __pyx_kp_s_Optional_bool __pyx_mstate_global->__pyx_kp_s_Optional_bool #define __pyx_kp_s_Optional_int __pyx_mstate_global->__pyx_kp_s_Optional_int -#define __pyx_kp_s_Optional_str __pyx_mstate_global->__pyx_kp_s_Optional_str #define __pyx_n_s_PATH_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_PATH_PERCENT_ENCODE_SET #define __pyx_n_s_PATH_SAFEST_CHARS __pyx_mstate_global->__pyx_n_s_PATH_SAFEST_CHARS #define __pyx_n_s_PercentEncodeSet __pyx_mstate_global->__pyx_n_s_PercentEncodeSet +#define __pyx_kp_u_Port __pyx_mstate_global->__pyx_kp_u_Port #define __pyx_n_s_QUERY_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_QUERY_PERCENT_ENCODE_SET #define __pyx_n_s_QUERY_SAFEST_CHARS __pyx_mstate_global->__pyx_n_s_QUERY_SAFEST_CHARS #define __pyx_n_s_REPLACEMENT_ENCODING __pyx_mstate_global->__pyx_n_s_REPLACEMENT_ENCODING @@ -5484,8 +5442,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_s_Tuple_int_bool __pyx_mstate_global->__pyx_kp_s_Tuple_int_bool #define __pyx_n_s_URL __pyx_mstate_global->__pyx_n_s_URL #define __pyx_n_s_URL___init __pyx_mstate_global->__pyx_n_s_URL___init -#define __pyx_n_s_URL_has_opaque_path __pyx_mstate_global->__pyx_n_s_URL_has_opaque_path -#define __pyx_n_s_URL_scheme __pyx_mstate_global->__pyx_n_s_URL_scheme +#define __pyx_kp_u_URL_is_relative __pyx_mstate_global->__pyx_kp_u_URL_is_relative #define __pyx_n_s_USERINFO_PERCENT_ENCODE_SET __pyx_mstate_global->__pyx_n_s_USERINFO_PERCENT_ENCODE_SET #define __pyx_n_s_USERINFO_SAFEST_CHARS __pyx_mstate_global->__pyx_n_s_USERINFO_SAFEST_CHARS #define __pyx_n_s_UTF_16BE_ENCODING __pyx_mstate_global->__pyx_n_s_UTF_16BE_ENCODING @@ -5493,54 +5450,48 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_UTF_8_ENCODER __pyx_mstate_global->__pyx_n_s_UTF_8_ENCODER #define __pyx_n_s_UTF_8_ENCODING __pyx_mstate_global->__pyx_n_s_UTF_8_ENCODING #define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union -#define __pyx_kp_s_Union_int_List_int_str __pyx_mstate_global->__pyx_kp_s_Union_int_List_int_str -#define __pyx_kp_s_Union_str_List_str __pyx_mstate_global->__pyx_kp_s_Union_str_List_str -#define __pyx_kp_s_Union_str_int_List_int __pyx_mstate_global->__pyx_kp_s_Union_str_int_List_int #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10 #define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11 -#define __pyx_kp_b__12 __pyx_mstate_global->__pyx_kp_b__12 -#define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12 -#define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13 -#define __pyx_n_s__14 __pyx_mstate_global->__pyx_n_s__14 #define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14 #define __pyx_kp_u__15 __pyx_mstate_global->__pyx_kp_u__15 #define __pyx_kp_u__16 __pyx_mstate_global->__pyx_kp_u__16 #define __pyx_kp_u__17 __pyx_mstate_global->__pyx_kp_u__17 #define __pyx_kp_u__18 __pyx_mstate_global->__pyx_kp_u__18 +#define __pyx_n_s__19 __pyx_mstate_global->__pyx_n_s__19 #define __pyx_kp_u__19 __pyx_mstate_global->__pyx_kp_u__19 -#define __pyx_n_s__2 __pyx_mstate_global->__pyx_n_s__2 -#define __pyx_kp_b__2 __pyx_mstate_global->__pyx_kp_b__2 -#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 +#define __pyx_kp_b__20 __pyx_mstate_global->__pyx_kp_b__20 +#define __pyx_kp_u__20 __pyx_mstate_global->__pyx_kp_u__20 #define __pyx_kp_u__21 __pyx_mstate_global->__pyx_kp_u__21 -#define __pyx_kp_u__22 __pyx_mstate_global->__pyx_kp_u__22 #define __pyx_kp_u__23 __pyx_mstate_global->__pyx_kp_u__23 -#define __pyx_n_s__24 __pyx_mstate_global->__pyx_n_s__24 +#define __pyx_kp_u__24 __pyx_mstate_global->__pyx_kp_u__24 +#define __pyx_kp_u__25 __pyx_mstate_global->__pyx_kp_u__25 +#define __pyx_n_s__26 __pyx_mstate_global->__pyx_n_s__26 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 #define __pyx_kp_b__4 __pyx_mstate_global->__pyx_kp_b__4 #define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 #define __pyx_kp_b__5 __pyx_mstate_global->__pyx_kp_b__5 #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 #define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 -#define __pyx_kp_u__75 __pyx_mstate_global->__pyx_kp_u__75 -#define __pyx_n_s__78 __pyx_mstate_global->__pyx_n_s__78 +#define __pyx_kp_u__73 __pyx_mstate_global->__pyx_kp_u__73 +#define __pyx_n_s__76 __pyx_mstate_global->__pyx_n_s__76 +#define __pyx_kp_u__79 __pyx_mstate_global->__pyx_kp_u__79 #define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8 +#define __pyx_kp_u__80 __pyx_mstate_global->__pyx_kp_u__80 #define __pyx_kp_u__81 __pyx_mstate_global->__pyx_kp_u__81 +#define __pyx_kp_b__82 __pyx_mstate_global->__pyx_kp_b__82 #define __pyx_kp_u__82 __pyx_mstate_global->__pyx_kp_u__82 #define __pyx_kp_u__83 __pyx_mstate_global->__pyx_kp_u__83 -#define __pyx_kp_b__84 __pyx_mstate_global->__pyx_kp_b__84 #define __pyx_kp_u__84 __pyx_mstate_global->__pyx_kp_u__84 -#define __pyx_kp_u__85 __pyx_mstate_global->__pyx_kp_u__85 -#define __pyx_kp_u__86 __pyx_mstate_global->__pyx_kp_u__86 -#define __pyx_kp_b__87 __pyx_mstate_global->__pyx_kp_b__87 -#define __pyx_kp_b__88 __pyx_mstate_global->__pyx_kp_b__88 -#define __pyx_kp_u__89 __pyx_mstate_global->__pyx_kp_u__89 +#define __pyx_kp_b__85 __pyx_mstate_global->__pyx_kp_b__85 +#define __pyx_kp_b__86 __pyx_mstate_global->__pyx_kp_b__86 +#define __pyx_kp_u__87 __pyx_mstate_global->__pyx_kp_u__87 +#define __pyx_kp_b__89 __pyx_mstate_global->__pyx_kp_b__89 #define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9 -#define __pyx_kp_b__91 __pyx_mstate_global->__pyx_kp_b__91 -#define __pyx_kp_b__94 __pyx_mstate_global->__pyx_kp_b__94 -#define __pyx_kp_b__95 __pyx_mstate_global->__pyx_kp_b__95 -#define __pyx_kp_u__96 __pyx_mstate_global->__pyx_kp_u__96 -#define __pyx_kp_u__97 __pyx_mstate_global->__pyx_kp_u__97 +#define __pyx_kp_b__92 __pyx_mstate_global->__pyx_kp_b__92 +#define __pyx_kp_b__93 __pyx_mstate_global->__pyx_kp_b__93 +#define __pyx_kp_u__94 __pyx_mstate_global->__pyx_kp_u__94 +#define __pyx_kp_u__95 __pyx_mstate_global->__pyx_kp_u__95 #define __pyx_n_s_address __pyx_mstate_global->__pyx_n_s_address #define __pyx_n_s_annotations __pyx_mstate_global->__pyx_n_s_annotations #define __pyx_kp_u_ansi_x3_4_1968 __pyx_mstate_global->__pyx_kp_u_ansi_x3_4_1968 @@ -5555,7 +5506,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_at_sign_index __pyx_mstate_global->__pyx_n_s_at_sign_index #define __pyx_n_s_at_sign_seen __pyx_mstate_global->__pyx_n_s_at_sign_seen #define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base -#define __pyx_n_s_base_url __pyx_mstate_global->__pyx_n_s_base_url #define __pyx_n_s_be_strict __pyx_mstate_global->__pyx_n_s_be_strict #define __pyx_n_u_big5 __pyx_mstate_global->__pyx_n_u_big5 #define __pyx_kp_u_big5_hkscs __pyx_mstate_global->__pyx_kp_u_big5_hkscs @@ -5563,7 +5513,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_buffer __pyx_mstate_global->__pyx_n_s_buffer #define __pyx_n_s_byte __pyx_mstate_global->__pyx_n_s_byte #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c -#define __pyx_n_s_canonicalize __pyx_mstate_global->__pyx_n_s_canonicalize #define __pyx_n_s_check_bidi __pyx_mstate_global->__pyx_n_s_check_bidi #define __pyx_n_s_check_hyphens __pyx_mstate_global->__pyx_n_s_check_hyphens #define __pyx_n_s_check_joiners __pyx_mstate_global->__pyx_n_s_check_joiners @@ -5615,7 +5564,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_current_index __pyx_mstate_global->__pyx_n_s_current_index #define __pyx_n_s_current_length __pyx_mstate_global->__pyx_n_s_current_length #define __pyx_n_u_cyrillic __pyx_mstate_global->__pyx_n_u_cyrillic -#define __pyx_n_s_default_port_seen __pyx_mstate_global->__pyx_n_s_default_port_seen +#define __pyx_kp_s_cython_int __pyx_mstate_global->__pyx_kp_s_cython_int +#define __pyx_kp_s_cython_int_8 __pyx_mstate_global->__pyx_kp_s_cython_int_8 #define __pyx_n_s_delete __pyx_mstate_global->__pyx_n_s_delete #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_digits __pyx_mstate_global->__pyx_n_s_digits @@ -5641,11 +5591,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate #define __pyx_kp_u_euc_jp __pyx_mstate_global->__pyx_kp_u_euc_jp #define __pyx_kp_u_euc_kr __pyx_mstate_global->__pyx_kp_u_euc_kr -#define __pyx_n_s_exclude_fragment __pyx_mstate_global->__pyx_n_s_exclude_fragment #define __pyx_n_u_file __pyx_mstate_global->__pyx_n_u_file #define __pyx_n_s_floor __pyx_mstate_global->__pyx_n_s_floor #define __pyx_n_s_fragment __pyx_mstate_global->__pyx_n_s_fragment -#define __pyx_n_s_fragment_percent_encode_set __pyx_mstate_global->__pyx_n_s_fragment_percent_encode_set +#define __pyx_n_s_fragment_token_seen __pyx_mstate_global->__pyx_n_s_fragment_token_seen #define __pyx_n_u_ftp __pyx_mstate_global->__pyx_n_u_ftp #define __pyx_n_s_functools __pyx_mstate_global->__pyx_n_s_functools #define __pyx_n_u_gb18030 __pyx_mstate_global->__pyx_n_u_gb18030 @@ -5655,16 +5604,14 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_u_gbk __pyx_mstate_global->__pyx_n_u_gbk #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr -#define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_encoder __pyx_mstate_global->__pyx_n_s_get_encoder #define __pyx_n_s_get_encoding __pyx_mstate_global->__pyx_n_s_get_encoding #define __pyx_n_s_get_ipv6_first_longest_0_piece __pyx_mstate_global->__pyx_n_s_get_ipv6_first_longest_0_piece #define __pyx_n_s_greater_than __pyx_mstate_global->__pyx_n_s_greater_than #define __pyx_n_u_greek __pyx_mstate_global->__pyx_n_u_greek #define __pyx_n_u_greek8 __pyx_mstate_global->__pyx_n_u_greek8 -#define __pyx_n_s_has_opaque_path __pyx_mstate_global->__pyx_n_s_has_opaque_path #define __pyx_n_u_hebrew __pyx_mstate_global->__pyx_n_u_hebrew -#define __pyx_n_s_host __pyx_mstate_global->__pyx_n_s_host +#define __pyx_n_s_host_type __pyx_mstate_global->__pyx_n_s_host_type #define __pyx_n_s_hostname __pyx_mstate_global->__pyx_n_s_hostname #define __pyx_n_u_http __pyx_mstate_global->__pyx_n_u_http #define __pyx_n_u_https __pyx_mstate_global->__pyx_n_u_https @@ -5687,11 +5634,12 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int #define __pyx_n_s_ipv4 __pyx_mstate_global->__pyx_n_s_ipv4 #define __pyx_n_s_ipv4_piece __pyx_mstate_global->__pyx_n_s_ipv4_piece +#define __pyx_n_s_ipv6 __pyx_mstate_global->__pyx_n_s_ipv6 #define __pyx_kp_u_is_an_empty_string_after_conver __pyx_mstate_global->__pyx_kp_u_is_an_empty_string_after_conver #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_is_double_dot_path_segment __pyx_mstate_global->__pyx_n_s_is_double_dot_path_segment #define __pyx_n_s_is_single_dot_path_segment __pyx_mstate_global->__pyx_n_s_is_single_dot_path_segment -#define __pyx_n_s_is_special __pyx_mstate_global->__pyx_n_s_is_special +#define __pyx_kp_u_is_too_high __pyx_mstate_global->__pyx_kp_u_is_too_high #define __pyx_n_s_is_windows_drive_letter __pyx_mstate_global->__pyx_n_s_is_windows_drive_letter #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_u_iso88591 __pyx_mstate_global->__pyx_n_u_iso88591 @@ -5828,6 +5776,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_number __pyx_mstate_global->__pyx_n_s_number #define __pyx_n_s_numbers __pyx_mstate_global->__pyx_n_s_numbers #define __pyx_n_s_numbers_seen __pyx_mstate_global->__pyx_n_s_numbers_seen +#define __pyx_n_s_opaque_path __pyx_mstate_global->__pyx_n_s_opaque_path #define __pyx_n_s_output __pyx_mstate_global->__pyx_n_s_output #define __pyx_n_s_parse_host __pyx_mstate_global->__pyx_n_s_parse_host #define __pyx_n_s_parse_ipv4 __pyx_mstate_global->__pyx_n_s_parse_ipv4 @@ -5841,7 +5790,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_password __pyx_mstate_global->__pyx_n_s_password #define __pyx_n_s_password_token_seen __pyx_mstate_global->__pyx_n_s_password_token_seen #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path -#define __pyx_n_s_path_percent_encode_set __pyx_mstate_global->__pyx_n_s_path_percent_encode_set #define __pyx_n_s_path_safe_chars __pyx_mstate_global->__pyx_n_s_path_safe_chars #define __pyx_n_s_path_token_seen __pyx_mstate_global->__pyx_n_s_path_token_seen #define __pyx_n_s_percent_encode_after_encoding __pyx_mstate_global->__pyx_n_s_percent_encode_after_encoding @@ -5853,10 +5801,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_port_token_seen __pyx_mstate_global->__pyx_n_s_port_token_seen #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_preprocess_url __pyx_mstate_global->__pyx_n_s_preprocess_url -#define __pyx_n_s_property __pyx_mstate_global->__pyx_n_s_property #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_query __pyx_mstate_global->__pyx_n_s_query -#define __pyx_n_s_query_percent_encode_set __pyx_mstate_global->__pyx_n_s_query_percent_encode_set +#define __pyx_n_s_query_token_seen __pyx_mstate_global->__pyx_n_s_query_token_seen #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_n_s_reached_end __pyx_mstate_global->__pyx_n_s_reached_end @@ -5869,7 +5816,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_safe_chars __pyx_mstate_global->__pyx_n_s_safe_chars #define __pyx_n_s_safe_url __pyx_mstate_global->__pyx_n_s_safe_url #define __pyx_n_s_scheme __pyx_mstate_global->__pyx_n_s_scheme -#define __pyx_n_s_scheme_2 __pyx_mstate_global->__pyx_n_s_scheme_2 #define __pyx_n_s_segment __pyx_mstate_global->__pyx_n_s_segment #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send @@ -5880,7 +5826,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_serialize_url __pyx_mstate_global->__pyx_n_s_serialize_url #define __pyx_n_s_serialize_url_path __pyx_mstate_global->__pyx_n_s_serialize_url_path #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name -#define __pyx_n_s_setter __pyx_mstate_global->__pyx_n_s_setter #define __pyx_kp_u_shift_jis __pyx_mstate_global->__pyx_kp_u_shift_jis #define __pyx_n_u_shift_jis_2 __pyx_mstate_global->__pyx_n_u_shift_jis_2 #define __pyx_n_s_short_windows_125 __pyx_mstate_global->__pyx_n_s_short_windows_125 @@ -5889,7 +5834,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_skip_authority_shortcut __pyx_mstate_global->__pyx_n_s_skip_authority_shortcut #define __pyx_n_s_space_as_plus __pyx_mstate_global->__pyx_n_s_space_as_plus #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec -#define __pyx_n_s_special_query_percent_encode_set __pyx_mstate_global->__pyx_n_s_special_query_percent_encode_set #define __pyx_n_s_starts_with_windows_drive_lette __pyx_mstate_global->__pyx_n_s_starts_with_windows_drive_lette #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str @@ -5905,6 +5849,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_transitional_processing __pyx_mstate_global->__pyx_n_s_transitional_processing #define __pyx_n_s_translate __pyx_mstate_global->__pyx_n_s_translate #define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing +#define __pyx_n_s_uchar __pyx_mstate_global->__pyx_n_s_uchar #define __pyx_kp_u_ucs_2 __pyx_mstate_global->__pyx_kp_u_ucs_2 #define __pyx_n_u_unicode __pyx_mstate_global->__pyx_n_u_unicode #define __pyx_n_u_unicode11utf8 __pyx_mstate_global->__pyx_n_u_unicode11utf8 @@ -5917,7 +5862,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_urllib_parse __pyx_mstate_global->__pyx_n_s_urllib_parse #define __pyx_kp_u_us_ascii __pyx_mstate_global->__pyx_kp_u_us_ascii #define __pyx_n_s_use_std3_ascii_rules __pyx_mstate_global->__pyx_n_s_use_std3_ascii_rules -#define __pyx_n_s_userinfo_percent_encode_set __pyx_mstate_global->__pyx_n_s_userinfo_percent_encode_set #define __pyx_n_s_username __pyx_mstate_global->__pyx_n_s_username #define __pyx_n_u_utf8 __pyx_mstate_global->__pyx_n_u_utf8 #define __pyx_kp_u_utf_16 __pyx_mstate_global->__pyx_kp_u_utf_16 @@ -5972,14 +5916,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_int_255 __pyx_mstate_global->__pyx_int_255 #define __pyx_int_256 __pyx_mstate_global->__pyx_int_256 #define __pyx_int_443 __pyx_mstate_global->__pyx_int_443 -#define __pyx_int_65535 __pyx_mstate_global->__pyx_int_65535 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 -#define __pyx_slice_ __pyx_mstate_global->__pyx_slice_ +#define __pyx_slice__2 __pyx_mstate_global->__pyx_slice__2 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 -#define __pyx_slice__20 __pyx_mstate_global->__pyx_slice__20 -#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 +#define __pyx_slice__22 __pyx_mstate_global->__pyx_slice__22 +#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 +#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 -#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 @@ -6016,15 +5959,17 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 #define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63 #define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 +#define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 #define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 -#define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 +#define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 -#define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 -#define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 -#define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 +#define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 +#define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74 +#define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77 +#define __pyx_tuple__88 __pyx_mstate_global->__pyx_tuple__88 #define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90 -#define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92 -#define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93 +#define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91 +#define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96 #define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98 #define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100 #define __pyx_tuple__102 __pyx_mstate_global->__pyx_tuple__102 @@ -6034,26 +5979,22 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_tuple__110 __pyx_mstate_global->__pyx_tuple__110 #define __pyx_tuple__112 __pyx_mstate_global->__pyx_tuple__112 #define __pyx_tuple__114 __pyx_mstate_global->__pyx_tuple__114 -#define __pyx_tuple__116 __pyx_mstate_global->__pyx_tuple__116 +#define __pyx_tuple__118 __pyx_mstate_global->__pyx_tuple__118 #define __pyx_tuple__120 __pyx_mstate_global->__pyx_tuple__120 #define __pyx_tuple__122 __pyx_mstate_global->__pyx_tuple__122 #define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124 #define __pyx_tuple__126 __pyx_mstate_global->__pyx_tuple__126 #define __pyx_tuple__128 __pyx_mstate_global->__pyx_tuple__128 -#define __pyx_tuple__130 __pyx_mstate_global->__pyx_tuple__130 -#define __pyx_tuple__132 __pyx_mstate_global->__pyx_tuple__132 -#define __pyx_tuple__134 __pyx_mstate_global->__pyx_tuple__134 -#define __pyx_tuple__136 __pyx_mstate_global->__pyx_tuple__136 -#define __pyx_tuple__138 __pyx_mstate_global->__pyx_tuple__138 -#define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 -#define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 -#define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68 +#define __pyx_tuple__131 __pyx_mstate_global->__pyx_tuple__131 +#define __pyx_tuple__133 __pyx_mstate_global->__pyx_tuple__133 +#define __pyx_tuple__135 __pyx_mstate_global->__pyx_tuple__135 +#define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 +#define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67 #define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 -#define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71 #define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72 -#define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74 -#define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77 -#define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80 +#define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75 +#define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78 +#define __pyx_codeobj__97 __pyx_mstate_global->__pyx_codeobj__97 #define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99 #define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101 #define __pyx_codeobj__103 __pyx_mstate_global->__pyx_codeobj__103 @@ -6063,22 +6004,21 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_codeobj__111 __pyx_mstate_global->__pyx_codeobj__111 #define __pyx_codeobj__113 __pyx_mstate_global->__pyx_codeobj__113 #define __pyx_codeobj__115 __pyx_mstate_global->__pyx_codeobj__115 +#define __pyx_codeobj__116 __pyx_mstate_global->__pyx_codeobj__116 #define __pyx_codeobj__117 __pyx_mstate_global->__pyx_codeobj__117 -#define __pyx_codeobj__118 __pyx_mstate_global->__pyx_codeobj__118 #define __pyx_codeobj__119 __pyx_mstate_global->__pyx_codeobj__119 #define __pyx_codeobj__121 __pyx_mstate_global->__pyx_codeobj__121 #define __pyx_codeobj__123 __pyx_mstate_global->__pyx_codeobj__123 #define __pyx_codeobj__125 __pyx_mstate_global->__pyx_codeobj__125 #define __pyx_codeobj__127 __pyx_mstate_global->__pyx_codeobj__127 #define __pyx_codeobj__129 __pyx_mstate_global->__pyx_codeobj__129 -#define __pyx_codeobj__131 __pyx_mstate_global->__pyx_codeobj__131 -#define __pyx_codeobj__133 __pyx_mstate_global->__pyx_codeobj__133 -#define __pyx_codeobj__135 __pyx_mstate_global->__pyx_codeobj__135 -#define __pyx_codeobj__137 __pyx_mstate_global->__pyx_codeobj__137 -#define __pyx_codeobj__139 __pyx_mstate_global->__pyx_codeobj__139 +#define __pyx_codeobj__130 __pyx_mstate_global->__pyx_codeobj__130 +#define __pyx_codeobj__132 __pyx_mstate_global->__pyx_codeobj__132 +#define __pyx_codeobj__134 __pyx_mstate_global->__pyx_codeobj__134 +#define __pyx_codeobj__136 __pyx_mstate_global->__pyx_codeobj__136 /* #### Code section: module_code ### */ -/* "w3lib/_url.pyx":44 +/* "w3lib/_url.pyx":45 * * * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< @@ -6139,12 +6079,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_short_windows_125") < 0)) __PYX_ERR(0, 44, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_short_windows_125") < 0)) __PYX_ERR(0, 45, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -6155,7 +6095,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_short_windows_125", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 44, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_short_windows_125", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 45, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6169,7 +6109,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_digit), (&PyInt_Type), 0, "last_digit", 1))) __PYX_ERR(0, 44, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_digit), (&PyInt_Type), 0, "last_digit", 1))) __PYX_ERR(0, 45, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url__short_windows_125(__pyx_self, __pyx_v_last_digit); /* function exit code */ @@ -6202,7 +6142,7 @@ static PyObject *__pyx_pf_5w3lib_4_url__short_windows_125(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_short_windows_125", 1); - /* "w3lib/_url.pyx":45 + /* "w3lib/_url.pyx":46 * * def _short_windows_125(last_digit: int) -> Dict[str, str]: * return { # <<<<<<<<<<<<<< @@ -6211,68 +6151,68 @@ static PyObject *__pyx_pf_5w3lib_4_url__short_windows_125(CYTHON_UNUSED PyObject */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L5_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":48 + /* "w3lib/_url.pyx":49 * label: f"windows-125{last_digit}" * for label in ( * f"cp125{last_digit}", # <<<<<<<<<<<<<< * f"windows-125{last_digit}", * f"x-cp125{last_digit}", */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_n_u_cp125, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L5_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_n_u_cp125, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":49 + /* "w3lib/_url.pyx":50 * for label in ( * f"cp125{last_digit}", * f"windows-125{last_digit}", # <<<<<<<<<<<<<< * f"x-cp125{last_digit}", * ) */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_windows_125, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L5_error) + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_windows_125, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":50 + /* "w3lib/_url.pyx":51 * f"cp125{last_digit}", * f"windows-125{last_digit}", * f"x-cp125{last_digit}", # <<<<<<<<<<<<<< * ) * } */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_x_cp125, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 50, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_x_cp125, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":48 + /* "w3lib/_url.pyx":49 * label: f"windows-125{last_digit}" * for label in ( * f"cp125{last_digit}", # <<<<<<<<<<<<<< * f"windows-125{last_digit}", * f"x-cp125{last_digit}", */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L5_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 48, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 49, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 48, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 49, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5)) __PYX_ERR(0, 48, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5)) __PYX_ERR(0, 49, __pyx_L5_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; - /* "w3lib/_url.pyx":47 + /* "w3lib/_url.pyx":48 * return { * label: f"windows-125{last_digit}" * for label in ( # <<<<<<<<<<<<<< @@ -6285,30 +6225,30 @@ static PyObject *__pyx_pf_5w3lib_4_url__short_windows_125(CYTHON_UNUSED PyObject for (;;) { if (__pyx_t_6 >= 3) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 47, __pyx_L5_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 48, __pyx_L5_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L5_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_label, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":46 + /* "w3lib/_url.pyx":47 * def _short_windows_125(last_digit: int) -> Dict[str, str]: * return { * label: f"windows-125{last_digit}" # <<<<<<<<<<<<<< * for label in ( * f"cp125{last_digit}", */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_last_digit, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_windows_125, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L5_error) + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_windows_125, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 46, __pyx_L5_error) + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 47, __pyx_L5_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":47 + /* "w3lib/_url.pyx":48 * return { * label: f"windows-125{last_digit}" * for label in ( # <<<<<<<<<<<<<< @@ -6328,7 +6268,7 @@ static PyObject *__pyx_pf_5w3lib_4_url__short_windows_125(CYTHON_UNUSED PyObject __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":44 + /* "w3lib/_url.pyx":45 * * * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< @@ -6352,7 +6292,7 @@ static PyObject *__pyx_pf_5w3lib_4_url__short_windows_125(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":445 +/* "w3lib/_url.pyx":446 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< @@ -6413,12 +6353,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_encoder") < 0)) __PYX_ERR(0, 445, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_encoder") < 0)) __PYX_ERR(0, 446, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -6429,7 +6369,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_encoder", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 445, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_encoder", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 446, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6443,7 +6383,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 446, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 447, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_2_get_encoder(__pyx_self, __pyx_v_encoding); /* function exit code */ @@ -6474,16 +6414,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_get_encoder(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_encoder", 1); - /* "w3lib/_url.pyx":447 + /* "w3lib/_url.pyx":448 * @lru_cache(maxsize=None) * def _get_encoder(encoding: str) -> EncodeFunction: * codec_info = codecs.lookup(encoding) # <<<<<<<<<<<<<< * return codec_info.encode * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_codecs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_codecs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -6504,14 +6444,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_get_encoder(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_codec_info = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":448 + /* "w3lib/_url.pyx":449 * def _get_encoder(encoding: str) -> EncodeFunction: * codec_info = codecs.lookup(encoding) * return codec_info.encode # <<<<<<<<<<<<<< @@ -6519,13 +6459,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_get_encoder(CYTHON_UNUSED PyObject *__p * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec_info, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec_info, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":445 + /* "w3lib/_url.pyx":446 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< @@ -6547,7 +6487,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_get_encoder(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":455 +/* "w3lib/_url.pyx":456 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< @@ -6608,12 +6548,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_encoding") < 0)) __PYX_ERR(0, 455, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_encoding") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -6624,7 +6564,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 455, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 456, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6638,7 +6578,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), (&PyUnicode_Type), 0, "label", 1))) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), (&PyUnicode_Type), 0, "label", 1))) __PYX_ERR(0, 457, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_4_get_encoding(__pyx_self, __pyx_v_label); /* function exit code */ @@ -6675,19 +6615,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ __Pyx_RefNannySetupContext("_get_encoding", 0); __Pyx_INCREF(__pyx_v_label); - /* "w3lib/_url.pyx":457 + /* "w3lib/_url.pyx":458 * @lru_cache(maxsize=None) * def _get_encoding(label: str) -> str: * label = label.strip(_ASCII_WHITESPACE).lower() # <<<<<<<<<<<<<< * try: * encoding = _LABEL_ENCODINGS[label] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_WHITESPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_WHITESPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_label, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_label, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -6708,15 +6648,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 457, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_label, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":458 + /* "w3lib/_url.pyx":459 * def _get_encoding(label: str) -> str: * label = label.strip(_ASCII_WHITESPACE).lower() * try: # <<<<<<<<<<<<<< @@ -6732,22 +6672,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { - /* "w3lib/_url.pyx":459 + /* "w3lib/_url.pyx":460 * label = label.strip(_ASCII_WHITESPACE).lower() * try: * encoding = _LABEL_ENCODINGS[label] # <<<<<<<<<<<<<< * except KeyError: * raise ValueError( */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_LABEL_ENCODINGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L3_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_LABEL_ENCODINGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L3_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_encoding = __pyx_t_2; __pyx_t_2 = 0; - /* "w3lib/_url.pyx":458 + /* "w3lib/_url.pyx":459 * def _get_encoding(label: str) -> str: * label = label.strip(_ASCII_WHITESPACE).lower() * try: # <<<<<<<<<<<<<< @@ -6764,7 +6704,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":460 + /* "w3lib/_url.pyx":461 * try: * encoding = _LABEL_ENCODINGS[label] * except KeyError: # <<<<<<<<<<<<<< @@ -6774,41 +6714,41 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_4) { __Pyx_AddTraceback("w3lib._url._get_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 460, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 461, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":462 + /* "w3lib/_url.pyx":463 * except KeyError: * raise ValueError( * f"{label!r} does not match any encoding label from the Encoding " # <<<<<<<<<<<<<< * f"Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721" * f"bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)" */ - __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 462, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 463, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_8, __pyx_kp_u_does_not_match_any_encoding_lab); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 462, __pyx_L5_except_error) + __pyx_t_9 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_8, __pyx_kp_u_does_not_match_any_encoding_lab); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 463, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "w3lib/_url.pyx":461 + /* "w3lib/_url.pyx":462 * encoding = _LABEL_ENCODINGS[label] * except KeyError: * raise ValueError( # <<<<<<<<<<<<<< * f"{label!r} does not match any encoding label from the Encoding " * f"Standard (https://encoding.spec.whatwg.org/commit-snapshots/3721" */ - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 461, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 462, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 461, __pyx_L5_except_error) + __PYX_ERR(0, 462, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "w3lib/_url.pyx":458 + /* "w3lib/_url.pyx":459 * def _get_encoding(label: str) -> str: * label = label.strip(_ASCII_WHITESPACE).lower() * try: # <<<<<<<<<<<<<< @@ -6824,7 +6764,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ __pyx_L8_try_end:; } - /* "w3lib/_url.pyx":466 + /* "w3lib/_url.pyx":467 * f"bec25c59f5506744dfeb8e3af7783e2f0f52/#ref-for-name%E2%91%A1)" * ) * return encoding # <<<<<<<<<<<<<< @@ -6832,12 +6772,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_encoding))||((__pyx_v_encoding) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_encoding))) __PYX_ERR(0, 466, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_encoding))||((__pyx_v_encoding) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_encoding))) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_INCREF(__pyx_v_encoding); __pyx_r = ((PyObject*)__pyx_v_encoding); goto __pyx_L0; - /* "w3lib/_url.pyx":455 + /* "w3lib/_url.pyx":456 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< @@ -6862,7 +6802,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "w3lib/_url.pyx":477 +/* "w3lib/_url.pyx":478 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings * @cfunc # <<<<<<<<<<<<<< @@ -6884,14 +6824,14 @@ static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *__pyx_v_enc __Pyx_RefNannySetupContext("_get_output_encoding", 0); __Pyx_INCREF(__pyx_v_encoding); - /* "w3lib/_url.pyx":479 + /* "w3lib/_url.pyx":480 * @cfunc * def _get_output_encoding(encoding: str) -> str: * encoding = _get_encoding(encoding) # <<<<<<<<<<<<<< * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: * return _UTF_8_ENCODING */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -6911,28 +6851,28 @@ static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *__pyx_v_enc PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 479, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_encoding, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":480 + /* "w3lib/_url.pyx":481 * def _get_output_encoding(encoding: str) -> str: * encoding = _get_encoding(encoding) * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: # <<<<<<<<<<<<<< * return _UTF_8_ENCODING * return encoding */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_encoding, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_encoding, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "w3lib/_url.pyx":481 + /* "w3lib/_url.pyx":482 * encoding = _get_encoding(encoding) * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: * return _UTF_8_ENCODING # <<<<<<<<<<<<<< @@ -6940,14 +6880,14 @@ static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *__pyx_v_enc * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_UTF_8_ENCODING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_UTF_8_ENCODING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 481, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 482, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":480 + /* "w3lib/_url.pyx":481 * def _get_output_encoding(encoding: str) -> str: * encoding = _get_encoding(encoding) * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: # <<<<<<<<<<<<<< @@ -6956,7 +6896,7 @@ static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *__pyx_v_enc */ } - /* "w3lib/_url.pyx":482 + /* "w3lib/_url.pyx":483 * if encoding in _OUTPUT_ENCODING_UTF8_ENCODINGS: * return _UTF_8_ENCODING * return encoding # <<<<<<<<<<<<<< @@ -6968,7 +6908,7 @@ static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *__pyx_v_enc __pyx_r = __pyx_v_encoding; goto __pyx_L0; - /* "w3lib/_url.pyx":477 + /* "w3lib/_url.pyx":478 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#output-encodings * @cfunc # <<<<<<<<<<<<<< @@ -6990,12 +6930,12 @@ static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *__pyx_v_enc return __pyx_r; } -/* "w3lib/_url.pyx":555 - * _path_token_seen: bool = False +/* "w3lib/_url.pyx":547 + * _fragment_token_seen: bool * - * def __init__(self) -> None: # <<<<<<<<<<<<<< - * self.path = [] - * self.is_special = False + * def __init__(self): # <<<<<<<<<<<<<< + * self.scheme = "" + * self.username = "" */ /* Python wrapper */ @@ -7051,12 +6991,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 555, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 547, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -7067,7 +7007,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 555, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 547, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7103,33 +7043,198 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "w3lib/_url.pyx":556 - * - * def __init__(self) -> None: - * self.path = [] # <<<<<<<<<<<<<< - * self.is_special = False + /* "w3lib/_url.pyx":548 * + * def __init__(self): + * self.scheme = "" # <<<<<<<<<<<<<< + * self.username = "" + * self.password = "" + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scheme, __pyx_kp_u_) < 0) __PYX_ERR(0, 548, __pyx_L1_error) + + /* "w3lib/_url.pyx":549 + * def __init__(self): + * self.scheme = "" + * self.username = "" # <<<<<<<<<<<<<< + * self.password = "" + * self._password_token_seen = False + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_username, __pyx_kp_u_) < 0) __PYX_ERR(0, 549, __pyx_L1_error) + + /* "w3lib/_url.pyx":550 + * self.scheme = "" + * self.username = "" + * self.password = "" # <<<<<<<<<<<<<< + * self._password_token_seen = False + * self._host_type = HOSTNAME + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_password, __pyx_kp_u_) < 0) __PYX_ERR(0, 550, __pyx_L1_error) + + /* "w3lib/_url.pyx":551 + * self.username = "" + * self.password = "" + * self._password_token_seen = False # <<<<<<<<<<<<<< + * self._host_type = HOSTNAME + * self.hostname = "" + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_password_token_seen, Py_False) < 0) __PYX_ERR(0, 551, __pyx_L1_error) + + /* "w3lib/_url.pyx":552 + * self.password = "" + * self._password_token_seen = False + * self._host_type = HOSTNAME # <<<<<<<<<<<<<< + * self.hostname = "" + * self.ipv4 = -1 + */ + __pyx_t_1 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_HOSTNAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_host_type, __pyx_t_1) < 0) __PYX_ERR(0, 552, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":553 + * self._password_token_seen = False + * self._host_type = HOSTNAME + * self.hostname = "" # <<<<<<<<<<<<<< + * self.ipv4 = -1 + * self.ipv6 = [0, 0, 0, 0, 0, 0, 0, 0] + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 553, __pyx_L1_error) + + /* "w3lib/_url.pyx":554 + * self._host_type = HOSTNAME + * self.hostname = "" + * self.ipv4 = -1 # <<<<<<<<<<<<<< + * self.ipv6 = [0, 0, 0, 0, 0, 0, 0, 0] + * self.port = -1 + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ipv4, __pyx_int_neg_1) < 0) __PYX_ERR(0, 554, __pyx_L1_error) + + /* "w3lib/_url.pyx":555 + * self.hostname = "" + * self.ipv4 = -1 + * self.ipv6 = [0, 0, 0, 0, 0, 0, 0, 0] # <<<<<<<<<<<<<< + * self.port = -1 + * self._port_token_seen = False */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_1 = PyList_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 556, __pyx_L1_error) + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0)) __PYX_ERR(0, 555, __pyx_L1_error); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(0, 555, __pyx_L1_error); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_0)) __PYX_ERR(0, 555, __pyx_L1_error); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_0)) __PYX_ERR(0, 555, __pyx_L1_error); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_int_0)) __PYX_ERR(0, 555, __pyx_L1_error); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_int_0)) __PYX_ERR(0, 555, __pyx_L1_error); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 6, __pyx_int_0)) __PYX_ERR(0, 555, __pyx_L1_error); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 7, __pyx_int_0)) __PYX_ERR(0, 555, __pyx_L1_error); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ipv6, __pyx_t_1) < 0) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "w3lib/_url.pyx":556 + * self.ipv4 = -1 + * self.ipv6 = [0, 0, 0, 0, 0, 0, 0, 0] + * self.port = -1 # <<<<<<<<<<<<<< + * self._port_token_seen = False + * self.path = [] + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_port, __pyx_int_neg_1) < 0) __PYX_ERR(0, 556, __pyx_L1_error) + /* "w3lib/_url.pyx":557 - * def __init__(self) -> None: + * self.ipv6 = [0, 0, 0, 0, 0, 0, 0, 0] + * self.port = -1 + * self._port_token_seen = False # <<<<<<<<<<<<<< + * self.path = [] + * self._path_token_seen = False + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_port_token_seen, Py_False) < 0) __PYX_ERR(0, 557, __pyx_L1_error) + + /* "w3lib/_url.pyx":558 + * self.port = -1 + * self._port_token_seen = False + * self.path = [] # <<<<<<<<<<<<<< + * self._path_token_seen = False + * self.opaque_path = "" + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":559 + * self._port_token_seen = False + * self.path = [] + * self._path_token_seen = False # <<<<<<<<<<<<<< + * self.opaque_path = "" + * self.query = "" + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_path_token_seen, Py_False) < 0) __PYX_ERR(0, 559, __pyx_L1_error) + + /* "w3lib/_url.pyx":560 * self.path = [] - * self.is_special = False # <<<<<<<<<<<<<< + * self._path_token_seen = False + * self.opaque_path = "" # <<<<<<<<<<<<<< + * self.query = "" + * self._query_token_seen = False + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_opaque_path, __pyx_kp_u_) < 0) __PYX_ERR(0, 560, __pyx_L1_error) + + /* "w3lib/_url.pyx":561 + * self._path_token_seen = False + * self.opaque_path = "" + * self.query = "" # <<<<<<<<<<<<<< + * self._query_token_seen = False + * self.fragment = "" + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_query, __pyx_kp_u_) < 0) __PYX_ERR(0, 561, __pyx_L1_error) + + /* "w3lib/_url.pyx":562 + * self.opaque_path = "" + * self.query = "" + * self._query_token_seen = False # <<<<<<<<<<<<<< + * self.fragment = "" + * self._fragment_token_seen = False + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_query_token_seen, Py_False) < 0) __PYX_ERR(0, 562, __pyx_L1_error) + + /* "w3lib/_url.pyx":563 + * self.query = "" + * self._query_token_seen = False + * self.fragment = "" # <<<<<<<<<<<<<< + * self._fragment_token_seen = False * - * def has_opaque_path(self) -> bool: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, Py_False) < 0) __PYX_ERR(0, 557, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_fragment, __pyx_kp_u_) < 0) __PYX_ERR(0, 563, __pyx_L1_error) - /* "w3lib/_url.pyx":555 - * _path_token_seen: bool = False + /* "w3lib/_url.pyx":564 + * self._query_token_seen = False + * self.fragment = "" + * self._fragment_token_seen = False # <<<<<<<<<<<<<< * - * def __init__(self) -> None: # <<<<<<<<<<<<<< - * self.path = [] - * self.is_special = False + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_fragment_token_seen, Py_False) < 0) __PYX_ERR(0, 564, __pyx_L1_error) + + /* "w3lib/_url.pyx":547 + * _fragment_token_seen: bool + * + * def __init__(self): # <<<<<<<<<<<<<< + * self.scheme = "" + * self.username = "" */ /* function exit code */ @@ -7145,31 +7250,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "w3lib/_url.pyx":559 - * self.is_special = False - * - * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< - * return isinstance(self.path, str) +/* "w3lib/_url.pyx":571 * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path + * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_7_shorten_path(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_3has_opaque_path = {"has_opaque_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_4_URL_3has_opaque_path(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_7_shorten_path = {"_shorten_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_7_shorten_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_7_shorten_path(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_url = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -7180,7 +7285,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("has_opaque_path (wrapper)", 0); + __Pyx_RefNannySetupContext("_shorten_path (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -7190,7 +7295,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -7202,27 +7307,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 559, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 571, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "has_opaque_path") < 0)) __PYX_ERR(0, 559, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_shorten_path") < 0)) __PYX_ERR(0, 571, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_self = values[0]; + __pyx_v_url = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("has_opaque_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 559, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_shorten_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 571, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7232,11 +7337,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._URL.has_opaque_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._shorten_path", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_5w3lib_4_url_6_shorten_path(__pyx_self, __pyx_v_url); /* function exit code */ { @@ -7249,89 +7354,187 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_4_URL_2has_opaque_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_5w3lib_4_url_6_shorten_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { + PyObject *__pyx_v_path = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("has_opaque_path", 1); + __Pyx_RefNannySetupContext("_shorten_path", 1); - /* "w3lib/_url.pyx":560 + /* "w3lib/_url.pyx":572 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path + * def _shorten_path(url: _URL) -> None: + * path = url.path # <<<<<<<<<<<<<< + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + * return + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_path = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":573 + * def _shorten_path(url: _URL) -> None: + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): # <<<<<<<<<<<<<< + * return + * url.path = path[:-1] + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = PyObject_Length(__pyx_v_path); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_4 == 1); + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":574 + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + * return # <<<<<<<<<<<<<< + * url.path = path[:-1] + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "w3lib/_url.pyx":573 + * def _shorten_path(url: _URL) -> None: + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): # <<<<<<<<<<<<<< + * return + * url.path = path[:-1] + */ + } + + /* "w3lib/_url.pyx":575 + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + * return + * url.path = path[:-1] # <<<<<<<<<<<<<< * - * def has_opaque_path(self) -> bool: - * return isinstance(self.path, str) # <<<<<<<<<<<<<< * - * @property */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, -1L, NULL, NULL, &__pyx_slice__2, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyUnicode_Check(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - /* "w3lib/_url.pyx":559 - * self.is_special = False - * - * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< - * return isinstance(self.path, str) + /* "w3lib/_url.pyx":571 * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path + * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< + * path = url.path + * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): */ /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("w3lib._url._URL.has_opaque_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._shorten_path", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_path); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":562 - * return isinstance(self.path, str) - * - * @property # <<<<<<<<<<<<<< - * def scheme(self) -> str: - * return self._scheme +/* "w3lib/_url.pyx":580 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode + * # Extended to handled cases where % is to be percent-encoded. + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input: str, + * *, */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_4_URL_5scheme(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_5scheme = {"scheme", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_5scheme, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_4_URL_5scheme(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_9_percent_encode_after_encoding = {"_percent_encode_after_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_percent_encode_set = 0; + PyObject *__pyx_v_space_as_plus = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("scheme (wrapper)", 0); + __Pyx_RefNannySetupContext("_percent_encode_after_encoding (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -7341,160 +7544,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 562, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_self = values[0]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scheme", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 562, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_4_URL_4scheme(__pyx_self, __pyx_v_self); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5w3lib_4_url_4_URL_4scheme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("scheme", 1); - - /* "w3lib/_url.pyx":564 - * @property - * def scheme(self) -> str: - * return self._scheme # <<<<<<<<<<<<<< - * - * @scheme.setter - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 564, __pyx_L1_error) - __pyx_r = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "w3lib/_url.pyx":562 - * return isinstance(self.path, str) - * - * @property # <<<<<<<<<<<<<< - * def scheme(self) -> str: - * return self._scheme - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_encoding,&__pyx_n_s_percent_encode_set,&__pyx_n_s_space_as_plus,0}; -/* "w3lib/_url.pyx":566 - * return self._scheme - * - * @scheme.setter # <<<<<<<<<<<<<< - * def scheme(self, value: str) -> None: - * self._scheme = value + /* "w3lib/_url.pyx":585 + * encoding: str, + * percent_encode_set: _PercentEncodeSet, + * space_as_plus: bool = False, # <<<<<<<<<<<<<< + * ) -> str: + * encoder = _get_encoder(encoding) */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_4_URL_7scheme(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_4_URL_7scheme = {"scheme", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_4_URL_7scheme, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_4_URL_7scheme(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_value = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("scheme (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0}; - if (__pyx_kwds) { + values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + if (likely(__pyx_kwds)) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -7503,39 +7565,54 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 580, __pyx_L3_error) + } + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_percent_encode_set)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, 1); __PYX_ERR(0, 566, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_percent_encode_set); __PYX_ERR(0, 580, __pyx_L3_error) } } + if (kw_args == 1) { + const Py_ssize_t index = 3; + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) + } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scheme") < 0)) __PYX_ERR(0, 566, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_percent_encode_after_encoding") < 0)) __PYX_ERR(0, 580, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 2)) { + } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 580, __pyx_L3_error) } - __pyx_v_self = values[0]; - __pyx_v_value = ((PyObject*)values[1]); + __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_encoding = ((PyObject*)values[1]); + __pyx_v_percent_encode_set = values[2]; + __pyx_v_space_as_plus = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scheme", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 566, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_percent_encode_after_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 580, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7545,12 +7622,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._percent_encode_after_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyUnicode_Type), 0, "value", 1))) __PYX_ERR(0, 567, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_4_URL_6scheme(__pyx_self, __pyx_v_self, __pyx_v_value); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 581, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(__pyx_self, __pyx_v_input, __pyx_v_encoding, __pyx_v_percent_encode_set, __pyx_v_space_as_plus); + + /* "w3lib/_url.pyx":580 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode + * # Extended to handled cases where % is to be percent-encoded. + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input: str, + * *, + */ /* function exit code */ goto __pyx_L0; @@ -7567,2970 +7653,2048 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_4_URL_6scheme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set, PyObject *__pyx_v_space_as_plus) { + PyObject *__pyx_v_encoder = NULL; + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_v_encode_output = NULL; + CYTHON_UNUSED PyObject *__pyx_v__ = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_byte = NULL; + PyObject *__pyx_v_isomorph = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *(*__pyx_t_6)(PyObject *); + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("scheme", 1); - - /* "w3lib/_url.pyx":568 - * @scheme.setter - * def scheme(self, value: str) -> None: - * self._scheme = value # <<<<<<<<<<<<<< - * self.is_special = value in _SPECIAL_SCHEMES - * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scheme, __pyx_v_value) < 0) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_RefNannySetupContext("_percent_encode_after_encoding", 1); - /* "w3lib/_url.pyx":569 - * def scheme(self, value: str) -> None: - * self._scheme = value - * self.is_special = value in _SPECIAL_SCHEMES # <<<<<<<<<<<<<< - * - * + /* "w3lib/_url.pyx":587 + * space_as_plus: bool = False, + * ) -> str: + * encoder = _get_encoder(encoding) # <<<<<<<<<<<<<< + * output = "" + * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_special, __pyx_t_1) < 0) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_v_encoder = __pyx_t_1; + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":566 - * return self._scheme - * - * @scheme.setter # <<<<<<<<<<<<<< - * def scheme(self, value: str) -> None: - * self._scheme = value + /* "w3lib/_url.pyx":588 + * ) -> str: + * encoder = _get_encoder(encoding) + * output = "" # <<<<<<<<<<<<<< + * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B + * # instead of &#NNN; */ + __Pyx_INCREF(__pyx_kp_u_); + __pyx_v_output = __pyx_kp_u_; - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("w3lib._url._URL.scheme", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "w3lib/_url.pyx":576 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path - * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< - * path = url.path - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): + /* "w3lib/_url.pyx":591 + * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B + * # instead of &#NNN; + * encode_output, _ = encoder(input, "xmlcharrefreplace") # <<<<<<<<<<<<<< + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + * byte = encode_output[i] */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_7_shorten_path(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_7_shorten_path = {"_shorten_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_7_shorten_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_7_shorten_path(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_url = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_shorten_path (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 576, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_shorten_path") < 0)) __PYX_ERR(0, 576, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_url = values[0]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_shorten_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 576, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("w3lib._url._shorten_path", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_6_shorten_path(__pyx_self, __pyx_v_url); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5w3lib_4_url_6_shorten_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { - PyObject *__pyx_v_path = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_shorten_path", 1); - - /* "w3lib/_url.pyx":577 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path - * def _shorten_path(url: _URL) -> None: - * path = url.path # <<<<<<<<<<<<<< - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): - * return - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_path = __pyx_t_1; - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":578 - * def _shorten_path(url: _URL) -> None: - * path = url.path - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): # <<<<<<<<<<<<<< - * return - * url.path = path[:-1] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 578, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = PyObject_Length(__pyx_v_path); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 578, __pyx_L1_error) - __pyx_t_3 = (__pyx_t_4 == 1); - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L4_bool_binop_done; - } - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 578, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 578, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; + __Pyx_INCREF(__pyx_v_encoder); + __pyx_t_2 = __pyx_v_encoder; __pyx_t_3 = NULL; + __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_8 = 1; + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_input, __pyx_n_u_xmlcharrefreplace}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 578, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __pyx_t_3; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "w3lib/_url.pyx":579 - * path = url.path - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): - * return # <<<<<<<<<<<<<< - * url.path = path[:-1] - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "w3lib/_url.pyx":578 - * def _shorten_path(url: _URL) -> None: - * path = url.path - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): # <<<<<<<<<<<<<< - * return - * url.path = path[:-1] - */ + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 591, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); + index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_6 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_L4_unpacking_done:; } + __pyx_v_encode_output = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v__ = __pyx_t_3; + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":580 - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): - * return - * url.path = path[:-1] # <<<<<<<<<<<<<< - * - * + /* "w3lib/_url.pyx":592 + * # instead of &#NNN; + * encode_output, _ = encoder(input, "xmlcharrefreplace") + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":576 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path - * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< - * path = url.path - * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("w3lib._url._shorten_path", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_path); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "w3lib/_url.pyx":585 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode - * # Extended to handled cases where % is to be percent-encoded. - * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input: str, - * *, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_9_percent_encode_after_encoding = {"_percent_encode_after_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_input = 0; - PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_v_percent_encode_set = 0; - PyObject *__pyx_v_space_as_plus = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[4] = {0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_percent_encode_after_encoding (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_encoding,&__pyx_n_s_percent_encode_set,&__pyx_n_s_space_as_plus,0}; - - /* "w3lib/_url.pyx":590 - * encoding: str, - * percent_encode_set: _PercentEncodeSet, - * space_as_plus: bool = False, # <<<<<<<<<<<<<< - * ) -> str: - * encoder = _get_encoder(encoding) - */ - values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (likely(__pyx_kwds)) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) - else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 585, __pyx_L3_error) - } - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_percent_encode_set)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) - else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_percent_encode_set); __PYX_ERR(0, 585, __pyx_L3_error) - } - } - if (kw_args == 1) { - const Py_ssize_t index = 3; - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); - if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_percent_encode_after_encoding") < 0)) __PYX_ERR(0, 585, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 585, __pyx_L3_error) - } - __pyx_v_input = ((PyObject*)values[0]); - __pyx_v_encoding = ((PyObject*)values[1]); - __pyx_v_percent_encode_set = values[2]; - __pyx_v_space_as_plus = values[3]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_percent_encode_after_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 585, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("w3lib._url._percent_encode_after_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 586, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 588, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(__pyx_self, __pyx_v_input, __pyx_v_encoding, __pyx_v_percent_encode_set, __pyx_v_space_as_plus); - - /* "w3lib/_url.pyx":585 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode - * # Extended to handled cases where % is to be percent-encoded. - * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input: str, - * *, - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set, PyObject *__pyx_v_space_as_plus) { - PyObject *__pyx_v_encoder = NULL; - PyObject *__pyx_v_output = NULL; - PyObject *__pyx_v_encode_output = NULL; - CYTHON_UNUSED PyObject *__pyx_v__ = NULL; - PyObject *__pyx_v_i = NULL; - PyObject *__pyx_v_byte = NULL; - PyObject *__pyx_v_isomorph = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - Py_ssize_t __pyx_t_7; - PyObject *(*__pyx_t_8)(PyObject *); - int __pyx_t_9; - int __pyx_t_10; - Py_ssize_t __pyx_t_11; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_percent_encode_after_encoding", 1); - - /* "w3lib/_url.pyx":592 - * space_as_plus: bool = False, - * ) -> str: - * encoder = _get_encoder(encoding) # <<<<<<<<<<<<<< - * output = "" - * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_v_encoder = __pyx_t_1; - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":593 - * ) -> str: - * encoder = _get_encoder(encoding) - * output = "" # <<<<<<<<<<<<<< - * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B - * # instead of &#NNN; - */ - __Pyx_INCREF(__pyx_kp_u__2); - __pyx_v_output = __pyx_kp_u__2; - - /* "w3lib/_url.pyx":596 - * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B - * # instead of &#NNN; - * encode_output, _ = encoder(input, "xmlcharrefreplace") # <<<<<<<<<<<<<< - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate - * byte = encode_output[i] - */ - __Pyx_INCREF(__pyx_v_encoder); - __pyx_t_2 = __pyx_v_encoder; __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_input, __pyx_n_u_xmlcharrefreplace}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 596, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 596, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L4_unpacking_done; - __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 596, __pyx_L1_error) - __pyx_L4_unpacking_done:; - } - __pyx_v_encode_output = __pyx_t_2; - __pyx_t_2 = 0; - __pyx_v__ = __pyx_t_3; - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":597 - * # instead of &#NNN; - * encode_output, _ = encoder(input, "xmlcharrefreplace") - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< - * byte = encode_output[i] - * if space_as_plus and byte == 0x20: - */ - __pyx_t_7 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); - __pyx_t_7 = 0; - __pyx_t_8 = NULL; - } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 597, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 597, __pyx_L1_error) - #endif - if (__pyx_t_7 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 597, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 597, __pyx_L1_error) - #endif - if (__pyx_t_7 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 597, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } - } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 597, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":598 - * encode_output, _ = encoder(input, "xmlcharrefreplace") - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate - * byte = encode_output[i] # <<<<<<<<<<<<<< - * if space_as_plus and byte == 0x20: - * output += "+" - */ - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_byte, __pyx_t_3); - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":599 - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate - * byte = encode_output[i] - * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< - * output += "+" - * continue - */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_space_as_plus); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 599, __pyx_L1_error) - if (__pyx_t_10) { - } else { - __pyx_t_9 = __pyx_t_10; - goto __pyx_L8_bool_binop_done; - } - __pyx_t_10 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_byte, __pyx_int_32, 0x20, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 599, __pyx_L1_error) - __pyx_t_9 = __pyx_t_10; - __pyx_L8_bool_binop_done:; - if (__pyx_t_9) { - - /* "w3lib/_url.pyx":600 - * byte = encode_output[i] - * if space_as_plus and byte == 0x20: - * output += "+" # <<<<<<<<<<<<<< - * continue - * isomorph = chr(byte) - */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":601 - * if space_as_plus and byte == 0x20: - * output += "+" - * continue # <<<<<<<<<<<<<< - * isomorph = chr(byte) - * if isomorph not in percent_encode_set: - */ - goto __pyx_L5_continue; - - /* "w3lib/_url.pyx":599 - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate - * byte = encode_output[i] - * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< - * output += "+" - * continue - */ - } - - /* "w3lib/_url.pyx":602 - * output += "+" - * continue - * isomorph = chr(byte) # <<<<<<<<<<<<<< - * if isomorph not in percent_encode_set: - * output += isomorph - */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_isomorph, __pyx_t_3); - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":603 - * continue - * isomorph = chr(byte) - * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< - * output += isomorph - * elif isomorph == "%": - */ - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_isomorph, __pyx_v_percent_encode_set, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) - if (__pyx_t_9) { - - /* "w3lib/_url.pyx":604 - * isomorph = chr(byte) - * if isomorph not in percent_encode_set: - * output += isomorph # <<<<<<<<<<<<<< - * elif isomorph == "%": - * if ( - */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_v_isomorph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":603 - * continue - * isomorph = chr(byte) - * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< - * output += isomorph - * elif isomorph == "%": - */ - goto __pyx_L10; - } - - /* "w3lib/_url.pyx":605 - * if isomorph not in percent_encode_set: - * output += isomorph - * elif isomorph == "%": # <<<<<<<<<<<<<< - * if ( - * len(encode_output) <= i + 2 - */ - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_isomorph, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 605, __pyx_L1_error) - if (__pyx_t_9) { - - /* "w3lib/_url.pyx":607 - * elif isomorph == "%": - * if ( - * len(encode_output) <= i + 2 # <<<<<<<<<<<<<< - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT - * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT - */ - __pyx_t_11 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 607, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!__pyx_t_10) { - } else { - __pyx_t_9 = __pyx_t_10; - goto __pyx_L12_bool_binop_done; - } - - /* "w3lib/_url.pyx":608 - * if ( - * len(encode_output) <= i + 2 - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< - * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT - * ): - */ - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 608, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_10) { - } else { - __pyx_t_9 = __pyx_t_10; - goto __pyx_L12_bool_binop_done; - } - - /* "w3lib/_url.pyx":609 - * len(encode_output) <= i + 2 - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT - * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< - * ): - * output += "%25" - */ - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __pyx_t_10; - __pyx_L12_bool_binop_done:; - - /* "w3lib/_url.pyx":606 - * output += isomorph - * elif isomorph == "%": - * if ( # <<<<<<<<<<<<<< - * len(encode_output) <= i + 2 - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT - */ - if (__pyx_t_9) { - - /* "w3lib/_url.pyx":611 - * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT - * ): - * output += "%25" # <<<<<<<<<<<<<< - * else: - * output += "%" - */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u_25); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); - __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":606 - * output += isomorph - * elif isomorph == "%": - * if ( # <<<<<<<<<<<<<< - * len(encode_output) <= i + 2 - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT - */ - goto __pyx_L11; - } - - /* "w3lib/_url.pyx":613 - * output += "%25" - * else: - * output += "%" # <<<<<<<<<<<<<< - * else: - * output += f"%{byte:02X}" - */ - /*else*/ { - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); - __pyx_t_5 = 0; - } - __pyx_L11:; - - /* "w3lib/_url.pyx":605 - * if isomorph not in percent_encode_set: - * output += isomorph - * elif isomorph == "%": # <<<<<<<<<<<<<< - * if ( - * len(encode_output) <= i + 2 - */ - goto __pyx_L10; - } - - /* "w3lib/_url.pyx":615 - * output += "%" - * else: - * output += f"%{byte:02X}" # <<<<<<<<<<<<<< - * - * return output - */ - /*else*/ { - __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_byte, __pyx_kp_u_02X); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); - __pyx_t_5 = 0; - } - __pyx_L10:; - - /* "w3lib/_url.pyx":597 - * # instead of &#NNN; - * encode_output, _ = encoder(input, "xmlcharrefreplace") - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< - * byte = encode_output[i] - * if space_as_plus and byte == 0x20: - */ - __pyx_L5_continue:; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":617 - * output += f"%{byte:02X}" - * - * return output # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 617, __pyx_L1_error) - __Pyx_INCREF(__pyx_v_output); - __pyx_r = ((PyObject*)__pyx_v_output); - goto __pyx_L0; - - /* "w3lib/_url.pyx":585 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode - * # Extended to handled cases where % is to be percent-encoded. - * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input: str, - * *, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("w3lib._url._percent_encode_after_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_encoder); - __Pyx_XDECREF(__pyx_v_output); - __Pyx_XDECREF(__pyx_v_encode_output); - __Pyx_XDECREF(__pyx_v__); - __Pyx_XDECREF(__pyx_v_i); - __Pyx_XDECREF(__pyx_v_byte); - __Pyx_XDECREF(__pyx_v_isomorph); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "w3lib/_url.pyx":688 - * - * - * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< - * address = [0] * 8 - * piece_index = 0 - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv6(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_11_parse_ipv6 = {"_parse_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_11_parse_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv6(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_input = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_parse_ipv6 (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv6") < 0)) __PYX_ERR(0, 688, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_input = ((PyObject*)values[0]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 688, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("w3lib._url._parse_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 688, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_10_parse_ipv6(__pyx_self, __pyx_v_input); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { - PyObject *__pyx_v_address = NULL; - PyObject *__pyx_v_piece_index = NULL; - PyObject *__pyx_v_compress = NULL; - PyObject *__pyx_v_pointer = NULL; - Py_ssize_t __pyx_v_input_length; - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_v_length = NULL; - PyObject *__pyx_v_numbers_seen = NULL; - PyObject *__pyx_v_ipv4_piece = NULL; - PyObject *__pyx_v_number = NULL; - PyObject *__pyx_v_swaps = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_ipv6", 1); - - /* "w3lib/_url.pyx":689 - * - * def _parse_ipv6(input: str) -> List[int]: - * address = [0] * 8 # <<<<<<<<<<<<<< - * piece_index = 0 - * compress = None - */ - __pyx_t_1 = PyList_New(1 * 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - { Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < 8; __pyx_temp++) { - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0)) __PYX_ERR(0, 689, __pyx_L1_error); - } - } - __pyx_v_address = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":690 - * def _parse_ipv6(input: str) -> List[int]: - * address = [0] * 8 - * piece_index = 0 # <<<<<<<<<<<<<< - * compress = None - * pointer = 0 - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_piece_index = __pyx_int_0; - - /* "w3lib/_url.pyx":691 - * address = [0] * 8 - * piece_index = 0 - * compress = None # <<<<<<<<<<<<<< - * pointer = 0 - * input_length = len(input) - */ - __Pyx_INCREF(Py_None); - __pyx_v_compress = Py_None; - - /* "w3lib/_url.pyx":692 - * piece_index = 0 - * compress = None - * pointer = 0 # <<<<<<<<<<<<<< - * input_length = len(input) - * if pointer < input_length and input[pointer] == ":": - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_pointer = __pyx_int_0; - - /* "w3lib/_url.pyx":693 - * compress = None - * pointer = 0 - * input_length = len(input) # <<<<<<<<<<<<<< - * if pointer < input_length and input[pointer] == ":": - * if pointer + 1 >= input_length or input[pointer + 1] != ":": - */ - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 693, __pyx_L1_error) - __pyx_v_input_length = __pyx_t_2; - - /* "w3lib/_url.pyx":694 - * pointer = 0 - * input_length = len(input) - * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< - * if pointer + 1 >= input_length or input[pointer + 1] != ":": - * raise ValueError - */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 694, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_5) { + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 694, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L4_bool_binop_done:; - if (__pyx_t_3) { - - /* "w3lib/_url.pyx":695 - * input_length = len(input) - * if pointer < input_length and input[pointer] == ":": - * if pointer + 1 >= input_length or input[pointer + 1] != ":": # <<<<<<<<<<<<<< - * raise ValueError - * pointer += 2 - */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!__pyx_t_5) { + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 592, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 592, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 592, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 592, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 592, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L7_bool_binop_done; + __pyx_t_3 = __pyx_t_8(__pyx_t_1); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 592, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L7_bool_binop_done:; - if (unlikely(__pyx_t_3)) { + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":696 - * if pointer < input_length and input[pointer] == ":": - * if pointer + 1 >= input_length or input[pointer + 1] != ":": - * raise ValueError # <<<<<<<<<<<<<< - * pointer += 2 - * piece_index += 1 + /* "w3lib/_url.pyx":593 + * encode_output, _ = encoder(input, "xmlcharrefreplace") + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + * byte = encode_output[i] # <<<<<<<<<<<<<< + * if space_as_plus and byte == 0x20: + * output += "+" */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_byte, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":695 - * input_length = len(input) - * if pointer < input_length and input[pointer] == ":": - * if pointer + 1 >= input_length or input[pointer + 1] != ":": # <<<<<<<<<<<<<< - * raise ValueError - * pointer += 2 + /* "w3lib/_url.pyx":594 + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< + * output += "+" + * continue */ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_space_as_plus); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 594, __pyx_L1_error) + if (__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L8_bool_binop_done; } + __pyx_t_10 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_byte, __pyx_int_32, 0x20, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_t_9 = __pyx_t_10; + __pyx_L8_bool_binop_done:; + if (__pyx_t_9) { - /* "w3lib/_url.pyx":697 - * if pointer + 1 >= input_length or input[pointer + 1] != ":": - * raise ValueError - * pointer += 2 # <<<<<<<<<<<<<< - * piece_index += 1 - * compress = piece_index - */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":698 - * raise ValueError - * pointer += 2 - * piece_index += 1 # <<<<<<<<<<<<<< - * compress = piece_index - * while pointer < input_length: - */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":699 - * pointer += 2 - * piece_index += 1 - * compress = piece_index # <<<<<<<<<<<<<< - * while pointer < input_length: - * if piece_index == 8: - */ - __Pyx_INCREF(__pyx_v_piece_index); - __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); - - /* "w3lib/_url.pyx":694 - * pointer = 0 - * input_length = len(input) - * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< - * if pointer + 1 >= input_length or input[pointer + 1] != ":": - * raise ValueError - */ - } - - /* "w3lib/_url.pyx":700 - * piece_index += 1 - * compress = piece_index - * while pointer < input_length: # <<<<<<<<<<<<<< - * if piece_index == 8: - * raise ValueError - */ - while (1) { - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!__pyx_t_3) break; - - /* "w3lib/_url.pyx":701 - * compress = piece_index - * while pointer < input_length: - * if piece_index == 8: # <<<<<<<<<<<<<< - * raise ValueError - * if input[pointer] == ":": + /* "w3lib/_url.pyx":595 + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: + * output += "+" # <<<<<<<<<<<<<< + * continue + * isomorph = chr(byte) */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 701, __pyx_L1_error) - if (unlikely(__pyx_t_3)) { + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":702 - * while pointer < input_length: - * if piece_index == 8: - * raise ValueError # <<<<<<<<<<<<<< - * if input[pointer] == ":": - * if compress is not None: + /* "w3lib/_url.pyx":596 + * if space_as_plus and byte == 0x20: + * output += "+" + * continue # <<<<<<<<<<<<<< + * isomorph = chr(byte) + * if isomorph not in percent_encode_set: */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 702, __pyx_L1_error) + goto __pyx_L5_continue; - /* "w3lib/_url.pyx":701 - * compress = piece_index - * while pointer < input_length: - * if piece_index == 8: # <<<<<<<<<<<<<< - * raise ValueError - * if input[pointer] == ":": + /* "w3lib/_url.pyx":594 + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< + * output += "+" + * continue */ } - /* "w3lib/_url.pyx":703 - * if piece_index == 8: - * raise ValueError - * if input[pointer] == ":": # <<<<<<<<<<<<<< - * if compress is not None: - * raise ValueError - */ - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 703, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_3) { - - /* "w3lib/_url.pyx":704 - * raise ValueError - * if input[pointer] == ":": - * if compress is not None: # <<<<<<<<<<<<<< - * raise ValueError - * pointer += 1 - */ - __pyx_t_3 = (__pyx_v_compress != Py_None); - if (unlikely(__pyx_t_3)) { - - /* "w3lib/_url.pyx":705 - * if input[pointer] == ":": - * if compress is not None: - * raise ValueError # <<<<<<<<<<<<<< - * pointer += 1 - * piece_index += 1 - */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 705, __pyx_L1_error) - - /* "w3lib/_url.pyx":704 - * raise ValueError - * if input[pointer] == ":": - * if compress is not None: # <<<<<<<<<<<<<< - * raise ValueError - * pointer += 1 - */ - } - - /* "w3lib/_url.pyx":706 - * if compress is not None: - * raise ValueError - * pointer += 1 # <<<<<<<<<<<<<< - * piece_index += 1 - * compress = piece_index - */ - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_6); - __pyx_t_6 = 0; - - /* "w3lib/_url.pyx":707 - * raise ValueError - * pointer += 1 - * piece_index += 1 # <<<<<<<<<<<<<< - * compress = piece_index + /* "w3lib/_url.pyx":597 + * output += "+" * continue + * isomorph = chr(byte) # <<<<<<<<<<<<<< + * if isomorph not in percent_encode_set: + * output += isomorph */ - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_6); - __pyx_t_6 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_isomorph, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":708 - * pointer += 1 - * piece_index += 1 - * compress = piece_index # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":598 * continue - * value = length = 0 - */ - __Pyx_INCREF(__pyx_v_piece_index); - __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); - - /* "w3lib/_url.pyx":709 - * piece_index += 1 - * compress = piece_index - * continue # <<<<<<<<<<<<<< - * value = length = 0 - * while ( + * isomorph = chr(byte) + * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< + * output += isomorph + * elif isomorph == "%": */ - goto __pyx_L9_continue; + __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_isomorph, __pyx_v_percent_encode_set, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 598, __pyx_L1_error) + if (__pyx_t_9) { - /* "w3lib/_url.pyx":703 - * if piece_index == 8: - * raise ValueError - * if input[pointer] == ":": # <<<<<<<<<<<<<< - * if compress is not None: - * raise ValueError + /* "w3lib/_url.pyx":599 + * isomorph = chr(byte) + * if isomorph not in percent_encode_set: + * output += isomorph # <<<<<<<<<<<<<< + * elif isomorph == "%": + * if ( */ - } + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_v_isomorph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":710 - * compress = piece_index + /* "w3lib/_url.pyx":598 * continue - * value = length = 0 # <<<<<<<<<<<<<< - * while ( - * length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT + * isomorph = chr(byte) + * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< + * output += isomorph + * elif isomorph == "%": */ - __Pyx_INCREF(__pyx_int_0); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_int_0); - __Pyx_INCREF(__pyx_int_0); - __Pyx_XDECREF_SET(__pyx_v_length, __pyx_int_0); + goto __pyx_L10; + } - /* "w3lib/_url.pyx":711 - * continue - * value = length = 0 - * while ( # <<<<<<<<<<<<<< - * length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT - * ): + /* "w3lib/_url.pyx":600 + * if isomorph not in percent_encode_set: + * output += isomorph + * elif isomorph == "%": # <<<<<<<<<<<<<< + * if ( + * len(encode_output) <= i + 2 */ - while (1) { + __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_isomorph, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 600, __pyx_L1_error) + if (__pyx_t_9) { - /* "w3lib/_url.pyx":712 - * value = length = 0 - * while ( - * length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< - * ): - * value = value * 0x10 + int(input[pointer], base=16) + /* "w3lib/_url.pyx":602 + * elif isomorph == "%": + * if ( + * len(encode_output) <= i + 2 # <<<<<<<<<<<<<< + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT + * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT */ - __pyx_t_6 = PyObject_RichCompare(__pyx_v_length, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L16_bool_binop_done; - } - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { + __pyx_t_11 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!__pyx_t_10) { } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L16_bool_binop_done; + __pyx_t_9 = __pyx_t_10; + goto __pyx_L12_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L16_bool_binop_done:; - if (!__pyx_t_3) break; - - /* "w3lib/_url.pyx":714 - * length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT - * ): - * value = value * 0x10 + int(input[pointer], base=16) # <<<<<<<<<<<<<< - * pointer += 1 - * length += 1 - */ - __pyx_t_6 = __Pyx_PyInt_MultiplyObjC(__pyx_v_value, __pyx_int_16, 0x10, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 714, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; - /* "w3lib/_url.pyx":715 - * ): - * value = value * 0x10 + int(input[pointer], base=16) - * pointer += 1 # <<<<<<<<<<<<<< - * length += 1 - * if pointer < input_length and input[pointer] == ".": + /* "w3lib/_url.pyx":603 + * if ( + * len(encode_output) <= i + 2 + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT + * ): */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L12_bool_binop_done; + } - /* "w3lib/_url.pyx":716 - * value = value * 0x10 + int(input[pointer], base=16) - * pointer += 1 - * length += 1 # <<<<<<<<<<<<<< - * if pointer < input_length and input[pointer] == ".": - * if length == 0: + /* "w3lib/_url.pyx":604 + * len(encode_output) <= i + 2 + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT + * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * ): + * output += "%25" */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_length, __pyx_t_1); - __pyx_t_1 = 0; - } + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = __pyx_t_10; + __pyx_L12_bool_binop_done:; - /* "w3lib/_url.pyx":717 - * pointer += 1 - * length += 1 - * if pointer < input_length and input[pointer] == ".": # <<<<<<<<<<<<<< - * if length == 0: - * raise ValueError + /* "w3lib/_url.pyx":601 + * output += isomorph + * elif isomorph == "%": + * if ( # <<<<<<<<<<<<<< + * len(encode_output) <= i + 2 + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 717, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 717, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L20_bool_binop_done; - } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 717, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 717, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L20_bool_binop_done:; - if (__pyx_t_3) { + if (__pyx_t_9) { - /* "w3lib/_url.pyx":718 - * length += 1 - * if pointer < input_length and input[pointer] == ".": - * if length == 0: # <<<<<<<<<<<<<< - * raise ValueError - * pointer -= length + /* "w3lib/_url.pyx":606 + * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT + * ): + * output += "%25" # <<<<<<<<<<<<<< + * else: + * output += "%" */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_length, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 718, __pyx_L1_error) - if (unlikely(__pyx_t_3)) { + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u_25); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":719 - * if pointer < input_length and input[pointer] == ".": - * if length == 0: - * raise ValueError # <<<<<<<<<<<<<< - * pointer -= length - * if piece_index > 6: + /* "w3lib/_url.pyx":601 + * output += isomorph + * elif isomorph == "%": + * if ( # <<<<<<<<<<<<<< + * len(encode_output) <= i + 2 + * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 719, __pyx_L1_error) + goto __pyx_L11; + } - /* "w3lib/_url.pyx":718 - * length += 1 - * if pointer < input_length and input[pointer] == ".": - * if length == 0: # <<<<<<<<<<<<<< - * raise ValueError - * pointer -= length + /* "w3lib/_url.pyx":608 + * output += "%25" + * else: + * output += "%" # <<<<<<<<<<<<<< + * else: + * output += f"%{byte:02X}" */ + /*else*/ { + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; } + __pyx_L11:; - /* "w3lib/_url.pyx":720 - * if length == 0: - * raise ValueError - * pointer -= length # <<<<<<<<<<<<<< - * if piece_index > 6: - * raise ValueError + /* "w3lib/_url.pyx":600 + * if isomorph not in percent_encode_set: + * output += isomorph + * elif isomorph == "%": # <<<<<<<<<<<<<< + * if ( + * len(encode_output) <= i + 2 */ - __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_v_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 720, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_7); - __pyx_t_7 = 0; + goto __pyx_L10; + } - /* "w3lib/_url.pyx":721 - * raise ValueError - * pointer -= length - * if piece_index > 6: # <<<<<<<<<<<<<< - * raise ValueError - * numbers_seen = 0 + /* "w3lib/_url.pyx":610 + * output += "%" + * else: + * output += f"%{byte:02X}" # <<<<<<<<<<<<<< + * + * return output */ - __pyx_t_7 = PyObject_RichCompare(__pyx_v_piece_index, __pyx_int_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 721, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 721, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(__pyx_t_3)) { + /*else*/ { + __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_byte, __pyx_kp_u_02X); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; + } + __pyx_L10:; - /* "w3lib/_url.pyx":722 - * pointer -= length - * if piece_index > 6: - * raise ValueError # <<<<<<<<<<<<<< - * numbers_seen = 0 - * while pointer < input_length: + /* "w3lib/_url.pyx":592 + * # instead of &#NNN; + * encode_output, _ = encoder(input, "xmlcharrefreplace") + * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< + * byte = encode_output[i] + * if space_as_plus and byte == 0x20: */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_L5_continue:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":721 - * raise ValueError - * pointer -= length - * if piece_index > 6: # <<<<<<<<<<<<<< - * raise ValueError - * numbers_seen = 0 + /* "w3lib/_url.pyx":612 + * output += f"%{byte:02X}" + * + * return output # <<<<<<<<<<<<<< + * + * */ - } + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_output); + __pyx_r = ((PyObject*)__pyx_v_output); + goto __pyx_L0; - /* "w3lib/_url.pyx":723 - * if piece_index > 6: - * raise ValueError - * numbers_seen = 0 # <<<<<<<<<<<<<< - * while pointer < input_length: - * ipv4_piece = None + /* "w3lib/_url.pyx":580 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode + * # Extended to handled cases where % is to be percent-encoded. + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input: str, + * *, */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_numbers_seen = __pyx_int_0; - /* "w3lib/_url.pyx":724 - * raise ValueError - * numbers_seen = 0 - * while pointer < input_length: # <<<<<<<<<<<<<< - * ipv4_piece = None - * if numbers_seen > 0: - */ - while (1) { - __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 724, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 724, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!__pyx_t_3) break; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("w3lib._url._percent_encode_after_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_encoder); + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XDECREF(__pyx_v_encode_output); + __Pyx_XDECREF(__pyx_v__); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_byte); + __Pyx_XDECREF(__pyx_v_isomorph); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":725 - * numbers_seen = 0 - * while pointer < input_length: - * ipv4_piece = None # <<<<<<<<<<<<<< - * if numbers_seen > 0: - * if input[pointer] == "." and numbers_seen < 4: +/* "w3lib/_url.pyx":683 + * + * + * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< + * address = [0] * 8 + * piece_index = 0 */ - __Pyx_INCREF(Py_None); - __Pyx_XDECREF_SET(__pyx_v_ipv4_piece, Py_None); - /* "w3lib/_url.pyx":726 - * while pointer < input_length: - * ipv4_piece = None - * if numbers_seen > 0: # <<<<<<<<<<<<<< - * if input[pointer] == "." and numbers_seen < 4: - * pointer += 1 - */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_3) { +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv6(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_11_parse_ipv6 = {"_parse_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_11_parse_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv6(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_parse_ipv6 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv6") < 0)) __PYX_ERR(0, 683, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_input = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_parse_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 683, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._parse_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_10_parse_ipv6(__pyx_self, __pyx_v_input); - /* "w3lib/_url.pyx":727 - * ipv4_piece = None - * if numbers_seen > 0: - * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< - * pointer += 1 - * else: + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + PyObject *__pyx_v_address = NULL; + PyObject *__pyx_v_piece_index = NULL; + PyObject *__pyx_v_compress = NULL; + PyObject *__pyx_v_pointer = NULL; + Py_ssize_t __pyx_v_input_length; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_v_numbers_seen = NULL; + PyObject *__pyx_v_ipv4_piece = NULL; + PyObject *__pyx_v_number = NULL; + PyObject *__pyx_v_swaps = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_ipv6", 1); + + /* "w3lib/_url.pyx":684 + * + * def _parse_ipv6(input: str) -> List[int]: + * address = [0] * 8 # <<<<<<<<<<<<<< + * piece_index = 0 + * compress = None */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 727, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L28_bool_binop_done; - } - __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 727, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L28_bool_binop_done:; - if (likely(__pyx_t_3)) { + __pyx_t_1 = PyList_New(1 * 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < 8; __pyx_temp++) { + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0)) __PYX_ERR(0, 684, __pyx_L1_error); + } + } + __pyx_v_address = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":685 + * def _parse_ipv6(input: str) -> List[int]: + * address = [0] * 8 + * piece_index = 0 # <<<<<<<<<<<<<< + * compress = None + * pointer = 0 + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_piece_index = __pyx_int_0; - /* "w3lib/_url.pyx":728 - * if numbers_seen > 0: - * if input[pointer] == "." and numbers_seen < 4: - * pointer += 1 # <<<<<<<<<<<<<< - * else: - * raise ValueError + /* "w3lib/_url.pyx":686 + * address = [0] * 8 + * piece_index = 0 + * compress = None # <<<<<<<<<<<<<< + * pointer = 0 + * input_length = len(input) */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_INCREF(Py_None); + __pyx_v_compress = Py_None; - /* "w3lib/_url.pyx":727 - * ipv4_piece = None - * if numbers_seen > 0: - * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< - * pointer += 1 - * else: + /* "w3lib/_url.pyx":687 + * piece_index = 0 + * compress = None + * pointer = 0 # <<<<<<<<<<<<<< + * input_length = len(input) + * if pointer < input_length and input[pointer] == ":": */ - goto __pyx_L27; - } + __Pyx_INCREF(__pyx_int_0); + __pyx_v_pointer = __pyx_int_0; - /* "w3lib/_url.pyx":730 - * pointer += 1 - * else: - * raise ValueError # <<<<<<<<<<<<<< - * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: - * raise ValueError + /* "w3lib/_url.pyx":688 + * compress = None + * pointer = 0 + * input_length = len(input) # <<<<<<<<<<<<<< + * if pointer < input_length and input[pointer] == ":": + * if pointer + 1 >= input_length or input[pointer + 1] != ":": */ - /*else*/ { - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 730, __pyx_L1_error) - } - __pyx_L27:; + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_v_input_length = __pyx_t_2; - /* "w3lib/_url.pyx":726 - * while pointer < input_length: - * ipv4_piece = None - * if numbers_seen > 0: # <<<<<<<<<<<<<< - * if input[pointer] == "." and numbers_seen < 4: - * pointer += 1 + /* "w3lib/_url.pyx":689 + * pointer = 0 + * input_length = len(input) + * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< + * if pointer + 1 >= input_length or input[pointer + 1] != ":": + * raise ValueError */ - } + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L4_bool_binop_done:; + if (__pyx_t_3) { - /* "w3lib/_url.pyx":731 - * else: - * raise ValueError - * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< - * raise ValueError - * while pointer < input_length and input[pointer] in _ASCII_DIGIT: + /* "w3lib/_url.pyx":690 + * input_length = len(input) + * if pointer < input_length and input[pointer] == ":": + * if pointer + 1 >= input_length or input[pointer + 1] != ":": # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 2 */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L31_bool_binop_done; - } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L31_bool_binop_done:; - if (unlikely(__pyx_t_3)) { + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L7_bool_binop_done:; + if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":732 - * raise ValueError - * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: - * raise ValueError # <<<<<<<<<<<<<< - * while pointer < input_length and input[pointer] in _ASCII_DIGIT: - * number = int(input[pointer]) + /* "w3lib/_url.pyx":691 + * if pointer < input_length and input[pointer] == ":": + * if pointer + 1 >= input_length or input[pointer + 1] != ":": + * raise ValueError # <<<<<<<<<<<<<< + * pointer += 2 + * piece_index += 1 */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 732, __pyx_L1_error) + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 691, __pyx_L1_error) - /* "w3lib/_url.pyx":731 - * else: - * raise ValueError - * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< - * raise ValueError - * while pointer < input_length and input[pointer] in _ASCII_DIGIT: + /* "w3lib/_url.pyx":690 + * input_length = len(input) + * if pointer < input_length and input[pointer] == ":": + * if pointer + 1 >= input_length or input[pointer + 1] != ":": # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 2 */ - } + } - /* "w3lib/_url.pyx":733 - * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: - * raise ValueError - * while pointer < input_length and input[pointer] in _ASCII_DIGIT: # <<<<<<<<<<<<<< - * number = int(input[pointer]) - * if ipv4_piece is None: + /* "w3lib/_url.pyx":692 + * if pointer + 1 >= input_length or input[pointer + 1] != ":": + * raise ValueError + * pointer += 2 # <<<<<<<<<<<<<< + * piece_index += 1 + * compress = piece_index */ - while (1) { - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 733, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 733, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L35_bool_binop_done; - } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 733, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L35_bool_binop_done:; - if (!__pyx_t_3) break; + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":734 - * raise ValueError - * while pointer < input_length and input[pointer] in _ASCII_DIGIT: - * number = int(input[pointer]) # <<<<<<<<<<<<<< - * if ipv4_piece is None: - * ipv4_piece = number + /* "w3lib/_url.pyx":693 + * raise ValueError + * pointer += 2 + * piece_index += 1 # <<<<<<<<<<<<<< + * compress = piece_index + * while pointer < input_length: */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 734, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_number, __pyx_t_7); - __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":735 - * while pointer < input_length and input[pointer] in _ASCII_DIGIT: - * number = int(input[pointer]) - * if ipv4_piece is None: # <<<<<<<<<<<<<< - * ipv4_piece = number - * elif ipv4_piece == 0: + /* "w3lib/_url.pyx":694 + * pointer += 2 + * piece_index += 1 + * compress = piece_index # <<<<<<<<<<<<<< + * while pointer < input_length: + * if piece_index == 8: */ - __pyx_t_3 = (__pyx_v_ipv4_piece == Py_None); - if (__pyx_t_3) { + __Pyx_INCREF(__pyx_v_piece_index); + __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); - /* "w3lib/_url.pyx":736 - * number = int(input[pointer]) - * if ipv4_piece is None: - * ipv4_piece = number # <<<<<<<<<<<<<< - * elif ipv4_piece == 0: - * raise ValueError + /* "w3lib/_url.pyx":689 + * pointer = 0 + * input_length = len(input) + * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< + * if pointer + 1 >= input_length or input[pointer + 1] != ":": + * raise ValueError */ - __Pyx_INCREF(__pyx_v_number); - __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_v_number); + } - /* "w3lib/_url.pyx":735 - * while pointer < input_length and input[pointer] in _ASCII_DIGIT: - * number = int(input[pointer]) - * if ipv4_piece is None: # <<<<<<<<<<<<<< - * ipv4_piece = number - * elif ipv4_piece == 0: + /* "w3lib/_url.pyx":695 + * piece_index += 1 + * compress = piece_index + * while pointer < input_length: # <<<<<<<<<<<<<< + * if piece_index == 8: + * raise ValueError */ - goto __pyx_L37; - } + while (1) { + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 695, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":737 - * if ipv4_piece is None: - * ipv4_piece = number - * elif ipv4_piece == 0: # <<<<<<<<<<<<<< - * raise ValueError - * else: + /* "w3lib/_url.pyx":696 + * compress = piece_index + * while pointer < input_length: + * if piece_index == 8: # <<<<<<<<<<<<<< + * raise ValueError + * if input[pointer] == ":": */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_ipv4_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 737, __pyx_L1_error) - if (unlikely(__pyx_t_3)) { + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 696, __pyx_L1_error) + if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":738 - * ipv4_piece = number - * elif ipv4_piece == 0: - * raise ValueError # <<<<<<<<<<<<<< - * else: - * ipv4_piece = ipv4_piece * 10 + number + /* "w3lib/_url.pyx":697 + * while pointer < input_length: + * if piece_index == 8: + * raise ValueError # <<<<<<<<<<<<<< + * if input[pointer] == ":": + * if compress is not None: */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 738, __pyx_L1_error) + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 697, __pyx_L1_error) - /* "w3lib/_url.pyx":737 - * if ipv4_piece is None: - * ipv4_piece = number - * elif ipv4_piece == 0: # <<<<<<<<<<<<<< - * raise ValueError - * else: + /* "w3lib/_url.pyx":696 + * compress = piece_index + * while pointer < input_length: + * if piece_index == 8: # <<<<<<<<<<<<<< + * raise ValueError + * if input[pointer] == ":": */ - } + } - /* "w3lib/_url.pyx":740 - * raise ValueError - * else: - * ipv4_piece = ipv4_piece * 10 + number # <<<<<<<<<<<<<< - * if ipv4_piece > 255: - * raise ValueError + /* "w3lib/_url.pyx":698 + * if piece_index == 8: + * raise ValueError + * if input[pointer] == ":": # <<<<<<<<<<<<<< + * if compress is not None: + * raise ValueError */ - /*else*/ { - __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ipv4_piece, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_t_1); - __pyx_t_1 = 0; - } - __pyx_L37:; + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_3) { - /* "w3lib/_url.pyx":741 - * else: - * ipv4_piece = ipv4_piece * 10 + number - * if ipv4_piece > 255: # <<<<<<<<<<<<<< - * raise ValueError - * pointer += 1 + /* "w3lib/_url.pyx":699 + * raise ValueError + * if input[pointer] == ":": + * if compress is not None: # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 1 */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ipv4_piece, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 741, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__pyx_t_3)) { + __pyx_t_3 = (__pyx_v_compress != Py_None); + if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":742 - * ipv4_piece = ipv4_piece * 10 + number - * if ipv4_piece > 255: - * raise ValueError # <<<<<<<<<<<<<< - * pointer += 1 - * assert isinstance(ipv4_piece, int) + /* "w3lib/_url.pyx":700 + * if input[pointer] == ":": + * if compress is not None: + * raise ValueError # <<<<<<<<<<<<<< + * pointer += 1 + * piece_index += 1 */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 742, __pyx_L1_error) + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 700, __pyx_L1_error) - /* "w3lib/_url.pyx":741 - * else: - * ipv4_piece = ipv4_piece * 10 + number - * if ipv4_piece > 255: # <<<<<<<<<<<<<< - * raise ValueError - * pointer += 1 + /* "w3lib/_url.pyx":699 + * raise ValueError + * if input[pointer] == ":": + * if compress is not None: # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 1 */ - } + } - /* "w3lib/_url.pyx":743 - * if ipv4_piece > 255: - * raise ValueError - * pointer += 1 # <<<<<<<<<<<<<< - * assert isinstance(ipv4_piece, int) - * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + /* "w3lib/_url.pyx":701 + * if compress is not None: + * raise ValueError + * pointer += 1 # <<<<<<<<<<<<<< + * piece_index += 1 + * compress = piece_index */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 743, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; - } + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_6); + __pyx_t_6 = 0; - /* "w3lib/_url.pyx":744 - * raise ValueError - * pointer += 1 - * assert isinstance(ipv4_piece, int) # <<<<<<<<<<<<<< - * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece - * numbers_seen += 1 + /* "w3lib/_url.pyx":702 + * raise ValueError + * pointer += 1 + * piece_index += 1 # <<<<<<<<<<<<<< + * compress = piece_index + * continue */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_3 = PyInt_Check(__pyx_v_ipv4_piece); - if (unlikely(!__pyx_t_3)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 744, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 744, __pyx_L1_error) - #endif + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_6); + __pyx_t_6 = 0; - /* "w3lib/_url.pyx":745 - * pointer += 1 - * assert isinstance(ipv4_piece, int) - * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece # <<<<<<<<<<<<<< - * numbers_seen += 1 - * if numbers_seen in (2, 4): + /* "w3lib/_url.pyx":703 + * pointer += 1 + * piece_index += 1 + * compress = piece_index # <<<<<<<<<<<<<< + * continue + * value = length = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 745, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_ipv4_piece); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_1) < 0))) __PYX_ERR(0, 745, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_piece_index); + __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); - /* "w3lib/_url.pyx":746 - * assert isinstance(ipv4_piece, int) - * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece - * numbers_seen += 1 # <<<<<<<<<<<<<< - * if numbers_seen in (2, 4): - * piece_index += 1 + /* "w3lib/_url.pyx":704 + * piece_index += 1 + * compress = piece_index + * continue # <<<<<<<<<<<<<< + * value = length = 0 + * while ( */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_numbers_seen, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_numbers_seen, __pyx_t_1); - __pyx_t_1 = 0; + goto __pyx_L9_continue; - /* "w3lib/_url.pyx":747 - * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece - * numbers_seen += 1 - * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< - * piece_index += 1 - * if numbers_seen != 4: + /* "w3lib/_url.pyx":698 + * if piece_index == 8: + * raise ValueError + * if input[pointer] == ":": # <<<<<<<<<<<<<< + * if compress is not None: + * raise ValueError */ - __Pyx_INCREF(__pyx_v_numbers_seen); - __pyx_t_1 = __pyx_v_numbers_seen; - __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 747, __pyx_L1_error) - if (!__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L40_bool_binop_done; - } - __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 747, __pyx_L1_error) - __pyx_t_3 = __pyx_t_5; - __pyx_L40_bool_binop_done:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __pyx_t_3; - if (__pyx_t_5) { + } - /* "w3lib/_url.pyx":748 - * numbers_seen += 1 - * if numbers_seen in (2, 4): - * piece_index += 1 # <<<<<<<<<<<<<< - * if numbers_seen != 4: - * raise ValueError + /* "w3lib/_url.pyx":705 + * compress = piece_index + * continue + * value = length = 0 # <<<<<<<<<<<<<< + * while ( + * length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_int_0); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_int_0); + __Pyx_INCREF(__pyx_int_0); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_int_0); - /* "w3lib/_url.pyx":747 - * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece - * numbers_seen += 1 - * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< - * piece_index += 1 - * if numbers_seen != 4: + /* "w3lib/_url.pyx":706 + * continue + * value = length = 0 + * while ( # <<<<<<<<<<<<<< + * length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT + * ): */ - } - } + while (1) { - /* "w3lib/_url.pyx":749 - * if numbers_seen in (2, 4): - * piece_index += 1 - * if numbers_seen != 4: # <<<<<<<<<<<<<< - * raise ValueError - * break + /* "w3lib/_url.pyx":707 + * value = length = 0 + * while ( + * length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * ): + * value = value * 0x10 + int(input[pointer], base=16) */ - __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_numbers_seen, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 749, __pyx_L1_error) - if (unlikely(__pyx_t_5)) { + __pyx_t_6 = PyObject_RichCompare(__pyx_v_length, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L16_bool_binop_done:; + if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":750 - * piece_index += 1 - * if numbers_seen != 4: - * raise ValueError # <<<<<<<<<<<<<< - * break - * if pointer < input_length and input[pointer] == ":": + /* "w3lib/_url.pyx":709 + * length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT + * ): + * value = value * 0x10 + int(input[pointer], base=16) # <<<<<<<<<<<<<< + * pointer += 1 + * length += 1 */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_MultiplyObjC(__pyx_v_value, __pyx_int_16, 0x10, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 709, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":749 - * if numbers_seen in (2, 4): - * piece_index += 1 - * if numbers_seen != 4: # <<<<<<<<<<<<<< - * raise ValueError - * break + /* "w3lib/_url.pyx":710 + * ): + * value = value * 0x10 + int(input[pointer], base=16) + * pointer += 1 # <<<<<<<<<<<<<< + * length += 1 + * if pointer < input_length and input[pointer] == ".": */ - } + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":751 - * if numbers_seen != 4: - * raise ValueError - * break # <<<<<<<<<<<<<< - * if pointer < input_length and input[pointer] == ":": + /* "w3lib/_url.pyx":711 + * value = value * 0x10 + int(input[pointer], base=16) * pointer += 1 + * length += 1 # <<<<<<<<<<<<<< + * if pointer < input_length and input[pointer] == ".": + * if length == 0: */ - goto __pyx_L10_break; + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_length, __pyx_t_1); + __pyx_t_1 = 0; + } - /* "w3lib/_url.pyx":717 + /* "w3lib/_url.pyx":712 * pointer += 1 * length += 1 * if pointer < input_length and input[pointer] == ".": # <<<<<<<<<<<<<< * if length == 0: * raise ValueError */ - } - - /* "w3lib/_url.pyx":752 - * raise ValueError - * break - * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< - * pointer += 1 - * if pointer >= input_length: - */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_3) { + if (__pyx_t_5) { } else { - __pyx_t_5 = __pyx_t_3; - goto __pyx_L44_bool_binop_done; + __pyx_t_3 = __pyx_t_5; + goto __pyx_L20_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __pyx_t_3; - __pyx_L44_bool_binop_done:; - if (__pyx_t_5) { + __pyx_t_3 = __pyx_t_5; + __pyx_L20_bool_binop_done:; + if (__pyx_t_3) { - /* "w3lib/_url.pyx":753 - * break - * if pointer < input_length and input[pointer] == ":": - * pointer += 1 # <<<<<<<<<<<<<< - * if pointer >= input_length: + /* "w3lib/_url.pyx":713 + * length += 1 + * if pointer < input_length and input[pointer] == ".": + * if length == 0: # <<<<<<<<<<<<<< + * raise ValueError + * pointer -= length + */ + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_length, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 713, __pyx_L1_error) + if (unlikely(__pyx_t_3)) { + + /* "w3lib/_url.pyx":714 + * if pointer < input_length and input[pointer] == ".": + * if length == 0: + * raise ValueError # <<<<<<<<<<<<<< + * pointer -= length + * if piece_index > 6: + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 714, __pyx_L1_error) + + /* "w3lib/_url.pyx":713 + * length += 1 + * if pointer < input_length and input[pointer] == ".": + * if length == 0: # <<<<<<<<<<<<<< + * raise ValueError + * pointer -= length + */ + } + + /* "w3lib/_url.pyx":715 + * if length == 0: + * raise ValueError + * pointer -= length # <<<<<<<<<<<<<< + * if piece_index > 6: * raise ValueError */ - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 753, __pyx_L1_error) + __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_v_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":754 - * if pointer < input_length and input[pointer] == ":": - * pointer += 1 - * if pointer >= input_length: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":716 * raise ValueError - * elif pointer < input_length: + * pointer -= length + * if piece_index > 6: # <<<<<<<<<<<<<< + * raise ValueError + * numbers_seen = 0 */ - __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 754, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_piece_index, __pyx_int_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 716, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 754, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__pyx_t_5)) { + if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":755 - * pointer += 1 - * if pointer >= input_length: + /* "w3lib/_url.pyx":717 + * pointer -= length + * if piece_index > 6: * raise ValueError # <<<<<<<<<<<<<< - * elif pointer < input_length: - * raise ValueError + * numbers_seen = 0 + * while pointer < input_length: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 755, __pyx_L1_error) + __PYX_ERR(0, 717, __pyx_L1_error) - /* "w3lib/_url.pyx":754 - * if pointer < input_length and input[pointer] == ":": - * pointer += 1 - * if pointer >= input_length: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":716 * raise ValueError - * elif pointer < input_length: + * pointer -= length + * if piece_index > 6: # <<<<<<<<<<<<<< + * raise ValueError + * numbers_seen = 0 */ } - /* "w3lib/_url.pyx":752 + /* "w3lib/_url.pyx":718 + * if piece_index > 6: * raise ValueError - * break - * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< - * pointer += 1 - * if pointer >= input_length: + * numbers_seen = 0 # <<<<<<<<<<<<<< + * while pointer < input_length: + * ipv4_piece = None */ - goto __pyx_L43; - } + __Pyx_INCREF(__pyx_int_0); + __pyx_v_numbers_seen = __pyx_int_0; - /* "w3lib/_url.pyx":756 - * if pointer >= input_length: + /* "w3lib/_url.pyx":719 * raise ValueError - * elif pointer < input_length: # <<<<<<<<<<<<<< - * raise ValueError - * address[piece_index] = value + * numbers_seen = 0 + * while pointer < input_length: # <<<<<<<<<<<<<< + * ipv4_piece = None + * if numbers_seen > 0: */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 756, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(__pyx_t_5)) { + while (1) { + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 719, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":757 - * raise ValueError - * elif pointer < input_length: - * raise ValueError # <<<<<<<<<<<<<< - * address[piece_index] = value - * piece_index += 1 + /* "w3lib/_url.pyx":720 + * numbers_seen = 0 + * while pointer < input_length: + * ipv4_piece = None # <<<<<<<<<<<<<< + * if numbers_seen > 0: + * if input[pointer] == "." and numbers_seen < 4: */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 757, __pyx_L1_error) + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_ipv4_piece, Py_None); - /* "w3lib/_url.pyx":756 - * if pointer >= input_length: - * raise ValueError - * elif pointer < input_length: # <<<<<<<<<<<<<< - * raise ValueError - * address[piece_index] = value + /* "w3lib/_url.pyx":721 + * while pointer < input_length: + * ipv4_piece = None + * if numbers_seen > 0: # <<<<<<<<<<<<<< + * if input[pointer] == "." and numbers_seen < 4: + * pointer += 1 */ - } - __pyx_L43:; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { - /* "w3lib/_url.pyx":758 - * elif pointer < input_length: - * raise ValueError - * address[piece_index] = value # <<<<<<<<<<<<<< - * piece_index += 1 - * if compress is not None: + /* "w3lib/_url.pyx":722 + * ipv4_piece = None + * if numbers_seen > 0: + * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< + * pointer += 1 + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 722, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L28_bool_binop_done; + } + __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 722, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L28_bool_binop_done:; + if (likely(__pyx_t_3)) { + + /* "w3lib/_url.pyx":723 + * if numbers_seen > 0: + * if input[pointer] == "." and numbers_seen < 4: + * pointer += 1 # <<<<<<<<<<<<<< + * else: + * raise ValueError + */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":722 + * ipv4_piece = None + * if numbers_seen > 0: + * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< + * pointer += 1 + * else: + */ + goto __pyx_L27; + } + + /* "w3lib/_url.pyx":725 + * pointer += 1 + * else: + * raise ValueError # <<<<<<<<<<<<<< + * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: + * raise ValueError + */ + /*else*/ { + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 725, __pyx_L1_error) + } + __pyx_L27:; + + /* "w3lib/_url.pyx":721 + * while pointer < input_length: + * ipv4_piece = None + * if numbers_seen > 0: # <<<<<<<<<<<<<< + * if input[pointer] == "." and numbers_seen < 4: + * pointer += 1 + */ + } + + /* "w3lib/_url.pyx":726 + * else: + * raise ValueError + * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< + * raise ValueError + * while pointer < input_length and input[pointer] in _ASCII_DIGIT: */ - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_v_value) < 0))) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L31_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L31_bool_binop_done:; + if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":759 - * raise ValueError - * address[piece_index] = value - * piece_index += 1 # <<<<<<<<<<<<<< - * if compress is not None: - * swaps = piece_index - compress + /* "w3lib/_url.pyx":727 + * raise ValueError + * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: + * raise ValueError # <<<<<<<<<<<<<< + * while pointer < input_length and input[pointer] in _ASCII_DIGIT: + * number = int(input[pointer]) */ - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 759, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_L9_continue:; - } - __pyx_L10_break:; + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 727, __pyx_L1_error) - /* "w3lib/_url.pyx":760 - * address[piece_index] = value - * piece_index += 1 - * if compress is not None: # <<<<<<<<<<<<<< - * swaps = piece_index - compress - * piece_index = 7 + /* "w3lib/_url.pyx":726 + * else: + * raise ValueError + * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< + * raise ValueError + * while pointer < input_length and input[pointer] in _ASCII_DIGIT: */ - __pyx_t_5 = (__pyx_v_compress != Py_None); - if (__pyx_t_5) { + } - /* "w3lib/_url.pyx":761 - * piece_index += 1 - * if compress is not None: - * swaps = piece_index - compress # <<<<<<<<<<<<<< - * piece_index = 7 - * while piece_index != 0 and swaps > 0: + /* "w3lib/_url.pyx":728 + * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: + * raise ValueError + * while pointer < input_length and input[pointer] in _ASCII_DIGIT: # <<<<<<<<<<<<<< + * number = int(input[pointer]) + * if ipv4_piece is None: */ - __pyx_t_7 = PyNumber_Subtract(__pyx_v_piece_index, __pyx_v_compress); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_v_swaps = __pyx_t_7; - __pyx_t_7 = 0; + while (1) { + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L35_bool_binop_done; + } + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_L35_bool_binop_done:; + if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":762 - * if compress is not None: - * swaps = piece_index - compress - * piece_index = 7 # <<<<<<<<<<<<<< - * while piece_index != 0 and swaps > 0: - * address[piece_index], address[compress + swaps - 1] = ( + /* "w3lib/_url.pyx":729 + * raise ValueError + * while pointer < input_length and input[pointer] in _ASCII_DIGIT: + * number = int(input[pointer]) # <<<<<<<<<<<<<< + * if ipv4_piece is None: + * ipv4_piece = number */ - __Pyx_INCREF(__pyx_int_7); - __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_int_7); + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_number, __pyx_t_7); + __pyx_t_7 = 0; - /* "w3lib/_url.pyx":763 - * swaps = piece_index - compress - * piece_index = 7 - * while piece_index != 0 and swaps > 0: # <<<<<<<<<<<<<< - * address[piece_index], address[compress + swaps - 1] = ( - * address[compress + swaps - 1], + /* "w3lib/_url.pyx":730 + * while pointer < input_length and input[pointer] in _ASCII_DIGIT: + * number = int(input[pointer]) + * if ipv4_piece is None: # <<<<<<<<<<<<<< + * ipv4_piece = number + * elif ipv4_piece == 0: */ - while (1) { - __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 763, __pyx_L1_error) - if (__pyx_t_3) { - } else { - __pyx_t_5 = __pyx_t_3; - goto __pyx_L50_bool_binop_done; - } - __pyx_t_7 = PyObject_RichCompare(__pyx_v_swaps, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 763, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __pyx_t_3; - __pyx_L50_bool_binop_done:; - if (!__pyx_t_5) break; + __pyx_t_3 = (__pyx_v_ipv4_piece == Py_None); + if (__pyx_t_3) { - /* "w3lib/_url.pyx":765 - * while piece_index != 0 and swaps > 0: - * address[piece_index], address[compress + swaps - 1] = ( - * address[compress + swaps - 1], # <<<<<<<<<<<<<< - * address[piece_index], - * ) + /* "w3lib/_url.pyx":731 + * number = int(input[pointer]) + * if ipv4_piece is None: + * ipv4_piece = number # <<<<<<<<<<<<<< + * elif ipv4_piece == 0: + * raise ValueError */ - __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_number); + __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_v_number); - /* "w3lib/_url.pyx":766 - * address[piece_index], address[compress + swaps - 1] = ( - * address[compress + swaps - 1], - * address[piece_index], # <<<<<<<<<<<<<< - * ) - * piece_index -= 1 + /* "w3lib/_url.pyx":730 + * while pointer < input_length and input[pointer] in _ASCII_DIGIT: + * number = int(input[pointer]) + * if ipv4_piece is None: # <<<<<<<<<<<<<< + * ipv4_piece = number + * elif ipv4_piece == 0: */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + goto __pyx_L37; + } - /* "w3lib/_url.pyx":764 - * piece_index = 7 - * while piece_index != 0 and swaps > 0: - * address[piece_index], address[compress + swaps - 1] = ( # <<<<<<<<<<<<<< - * address[compress + swaps - 1], - * address[piece_index], + /* "w3lib/_url.pyx":732 + * if ipv4_piece is None: + * ipv4_piece = number + * elif ipv4_piece == 0: # <<<<<<<<<<<<<< + * raise ValueError + * else: */ - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_7) < 0))) __PYX_ERR(0, 764, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 764, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 764, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_t_6, __pyx_t_1) < 0))) __PYX_ERR(0, 764, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_ipv4_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 732, __pyx_L1_error) + if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":768 - * address[piece_index], - * ) - * piece_index -= 1 # <<<<<<<<<<<<<< - * swaps -= 1 - * elif compress is None and piece_index != 8: + /* "w3lib/_url.pyx":733 + * ipv4_piece = number + * elif ipv4_piece == 0: + * raise ValueError # <<<<<<<<<<<<<< + * else: + * ipv4_piece = ipv4_piece * 10 + number */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 733, __pyx_L1_error) - /* "w3lib/_url.pyx":769 - * ) - * piece_index -= 1 - * swaps -= 1 # <<<<<<<<<<<<<< - * elif compress is None and piece_index != 8: - * raise ValueError + /* "w3lib/_url.pyx":732 + * if ipv4_piece is None: + * ipv4_piece = number + * elif ipv4_piece == 0: # <<<<<<<<<<<<<< + * raise ValueError + * else: */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_swaps, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_swaps, __pyx_t_1); - __pyx_t_1 = 0; - } + } - /* "w3lib/_url.pyx":760 - * address[piece_index] = value - * piece_index += 1 - * if compress is not None: # <<<<<<<<<<<<<< - * swaps = piece_index - compress - * piece_index = 7 + /* "w3lib/_url.pyx":735 + * raise ValueError + * else: + * ipv4_piece = ipv4_piece * 10 + number # <<<<<<<<<<<<<< + * if ipv4_piece > 255: + * raise ValueError */ - goto __pyx_L47; - } + /*else*/ { + __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ipv4_piece, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 735, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L37:; - /* "w3lib/_url.pyx":770 - * piece_index -= 1 - * swaps -= 1 - * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< - * raise ValueError - * return address + /* "w3lib/_url.pyx":736 + * else: + * ipv4_piece = ipv4_piece * 10 + number + * if ipv4_piece > 255: # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 1 */ - __pyx_t_3 = (__pyx_v_compress == Py_None); - if (__pyx_t_3) { - } else { - __pyx_t_5 = __pyx_t_3; - goto __pyx_L52_bool_binop_done; - } - __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 770, __pyx_L1_error) - __pyx_t_5 = __pyx_t_3; - __pyx_L52_bool_binop_done:; - if (unlikely(__pyx_t_5)) { + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ipv4_piece, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 736, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":771 - * swaps -= 1 - * elif compress is None and piece_index != 8: - * raise ValueError # <<<<<<<<<<<<<< - * return address - * + /* "w3lib/_url.pyx":737 + * ipv4_piece = ipv4_piece * 10 + number + * if ipv4_piece > 255: + * raise ValueError # <<<<<<<<<<<<<< + * pointer += 1 + * assert isinstance(ipv4_piece, int) */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 737, __pyx_L1_error) - /* "w3lib/_url.pyx":770 - * piece_index -= 1 - * swaps -= 1 - * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< - * raise ValueError - * return address + /* "w3lib/_url.pyx":736 + * else: + * ipv4_piece = ipv4_piece * 10 + number + * if ipv4_piece > 255: # <<<<<<<<<<<<<< + * raise ValueError + * pointer += 1 */ - } - __pyx_L47:; + } - /* "w3lib/_url.pyx":772 - * elif compress is None and piece_index != 8: - * raise ValueError - * return address # <<<<<<<<<<<<<< - * - * + /* "w3lib/_url.pyx":738 + * if ipv4_piece > 255: + * raise ValueError + * pointer += 1 # <<<<<<<<<<<<<< + * assert isinstance(ipv4_piece, int) + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_address); - __pyx_r = __pyx_v_address; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; + } - /* "w3lib/_url.pyx":688 - * - * - * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< - * address = [0] * 8 - * piece_index = 0 + /* "w3lib/_url.pyx":739 + * raise ValueError + * pointer += 1 + * assert isinstance(ipv4_piece, int) # <<<<<<<<<<<<<< + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + * numbers_seen += 1 */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_3 = PyInt_Check(__pyx_v_ipv4_piece); + if (unlikely(!__pyx_t_3)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 739, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 739, __pyx_L1_error) + #endif - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("w3lib._url._parse_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_address); - __Pyx_XDECREF(__pyx_v_piece_index); - __Pyx_XDECREF(__pyx_v_compress); - __Pyx_XDECREF(__pyx_v_pointer); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_v_length); - __Pyx_XDECREF(__pyx_v_numbers_seen); - __Pyx_XDECREF(__pyx_v_ipv4_piece); - __Pyx_XDECREF(__pyx_v_number); - __Pyx_XDECREF(__pyx_v_swaps); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "w3lib/_url.pyx":740 + * pointer += 1 + * assert isinstance(ipv4_piece, int) + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece # <<<<<<<<<<<<<< + * numbers_seen += 1 + * if numbers_seen in (2, 4): + */ + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_ipv4_piece); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_1) < 0))) __PYX_ERR(0, 740, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -/* "w3lib/_url.pyx":775 - * - * - * def _utf_8_percent_encode( # <<<<<<<<<<<<<< - * input: str, - * percent_encode_set: _PercentEncodeSet, + /* "w3lib/_url.pyx":741 + * assert isinstance(ipv4_piece, int) + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + * numbers_seen += 1 # <<<<<<<<<<<<<< + * if numbers_seen in (2, 4): + * piece_index += 1 */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_numbers_seen, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_numbers_seen, __pyx_t_1); + __pyx_t_1 = 0; -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_13_utf_8_percent_encode = {"_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_input = 0; - PyObject *__pyx_v_percent_encode_set = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_utf_8_percent_encode (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_percent_encode_set,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 775, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_percent_encode_set)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 775, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, 1); __PYX_ERR(0, 775, __pyx_L3_error) + /* "w3lib/_url.pyx":742 + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + * numbers_seen += 1 + * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< + * piece_index += 1 + * if numbers_seen != 4: + */ + __Pyx_INCREF(__pyx_v_numbers_seen); + __pyx_t_1 = __pyx_v_numbers_seen; + __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 742, __pyx_L1_error) + if (!__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L40_bool_binop_done; } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_utf_8_percent_encode") < 0)) __PYX_ERR(0, 775, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - } - __pyx_v_input = ((PyObject*)values[0]); - __pyx_v_percent_encode_set = values[1]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 775, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("w3lib._url._utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 776, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_percent_encode_set); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_utf_8_percent_encode", 1); + __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 742, __pyx_L1_error) + __pyx_t_3 = __pyx_t_5; + __pyx_L40_bool_binop_done:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __pyx_t_3; + if (__pyx_t_5) { - /* "w3lib/_url.pyx":779 - * percent_encode_set: _PercentEncodeSet, - * ) -> str: - * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input, - * encoding="utf-8", + /* "w3lib/_url.pyx":743 + * numbers_seen += 1 + * if numbers_seen in (2, 4): + * piece_index += 1 # <<<<<<<<<<<<<< + * if numbers_seen != 4: + * raise ValueError */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":780 - * ) -> str: - * return _percent_encode_after_encoding( - * input, # <<<<<<<<<<<<<< - * encoding="utf-8", - * percent_encode_set=percent_encode_set, + /* "w3lib/_url.pyx":742 + * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece + * numbers_seen += 1 + * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< + * piece_index += 1 + * if numbers_seen != 4: */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_input); - __Pyx_GIVEREF(__pyx_v_input); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input)) __PYX_ERR(0, 779, __pyx_L1_error); + } + } - /* "w3lib/_url.pyx":781 - * return _percent_encode_after_encoding( - * input, - * encoding="utf-8", # <<<<<<<<<<<<<< - * percent_encode_set=percent_encode_set, - * ) + /* "w3lib/_url.pyx":744 + * if numbers_seen in (2, 4): + * piece_index += 1 + * if numbers_seen != 4: # <<<<<<<<<<<<<< + * raise ValueError + * break */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_numbers_seen, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 744, __pyx_L1_error) + if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":782 - * input, - * encoding="utf-8", - * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< - * ) - * + /* "w3lib/_url.pyx":745 + * piece_index += 1 + * if numbers_seen != 4: + * raise ValueError # <<<<<<<<<<<<<< + * break + * if pointer < input_length and input[pointer] == ":": */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 781, __pyx_L1_error) + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 745, __pyx_L1_error) - /* "w3lib/_url.pyx":779 - * percent_encode_set: _PercentEncodeSet, - * ) -> str: - * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input, - * encoding="utf-8", + /* "w3lib/_url.pyx":744 + * if numbers_seen in (2, 4): + * piece_index += 1 + * if numbers_seen != 4: # <<<<<<<<<<<<<< + * raise ValueError + * break */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 779, __pyx_L1_error) - __pyx_r = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; - goto __pyx_L0; + } - /* "w3lib/_url.pyx":775 - * - * - * def _utf_8_percent_encode( # <<<<<<<<<<<<<< - * input: str, - * percent_encode_set: _PercentEncodeSet, + /* "w3lib/_url.pyx":746 + * if numbers_seen != 4: + * raise ValueError + * break # <<<<<<<<<<<<<< + * if pointer < input_length and input[pointer] == ":": + * pointer += 1 */ + goto __pyx_L10_break; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("w3lib._url._utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "w3lib/_url.pyx":787 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser - * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< - * for code_point in input: - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + /* "w3lib/_url.pyx":712 + * pointer += 1 + * length += 1 + * if pointer < input_length and input[pointer] == ".": # <<<<<<<<<<<<<< + * if length == 0: + * raise ValueError */ + } -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_15_parse_opaque_host(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_15_parse_opaque_host = {"_parse_opaque_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_15_parse_opaque_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_15_parse_opaque_host(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_input = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_parse_opaque_host (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 787, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_opaque_host") < 0)) __PYX_ERR(0, 787, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; + /* "w3lib/_url.pyx":747 + * raise ValueError + * break + * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< + * pointer += 1 + * if pointer >= input_length: + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 747, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 747, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_3) { } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_input = ((PyObject*)values[0]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_opaque_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 787, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + __pyx_t_5 = __pyx_t_3; + goto __pyx_L44_bool_binop_done; } - } - __Pyx_AddTraceback("w3lib._url._parse_opaque_host", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 787, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_14_parse_opaque_host(__pyx_self, __pyx_v_input); + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 747, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __pyx_t_3; + __pyx_L44_bool_binop_done:; + if (__pyx_t_5) { - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "w3lib/_url.pyx":748 + * break + * if pointer < input_length and input[pointer] == ":": + * pointer += 1 # <<<<<<<<<<<<<< + * if pointer >= input_length: + * raise ValueError + */ + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_7); + __pyx_t_7 = 0; -static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { - Py_UCS4 __pyx_v_code_point; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - Py_ssize_t __pyx_t_3; - void *__pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - Py_ssize_t __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_opaque_host", 1); + /* "w3lib/_url.pyx":749 + * if pointer < input_length and input[pointer] == ":": + * pointer += 1 + * if pointer >= input_length: # <<<<<<<<<<<<<< + * raise ValueError + * elif pointer < input_length: + */ + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 749, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 749, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_5)) { + + /* "w3lib/_url.pyx":750 + * pointer += 1 + * if pointer >= input_length: + * raise ValueError # <<<<<<<<<<<<<< + * elif pointer < input_length: + * raise ValueError + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 750, __pyx_L1_error) + + /* "w3lib/_url.pyx":749 + * if pointer < input_length and input[pointer] == ":": + * pointer += 1 + * if pointer >= input_length: # <<<<<<<<<<<<<< + * raise ValueError + * elif pointer < input_length: + */ + } - /* "w3lib/_url.pyx":788 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser - * def _parse_opaque_host(input: str) -> str: - * for code_point in input: # <<<<<<<<<<<<<< - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: - * raise ValueError + /* "w3lib/_url.pyx":747 + * raise ValueError + * break + * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< + * pointer += 1 + * if pointer >= input_length: */ - __Pyx_INCREF(__pyx_v_input); - __pyx_t_1 = __pyx_v_input; - __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 788, __pyx_L1_error) - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) { - __pyx_t_2 = __pyx_t_7; - __pyx_v_code_point = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2); + goto __pyx_L43; + } - /* "w3lib/_url.pyx":789 - * def _parse_opaque_host(input: str) -> str: - * for code_point in input: - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":751 + * if pointer >= input_length: + * raise ValueError + * elif pointer < input_length: # <<<<<<<<<<<<<< * raise ValueError - * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) + * address[piece_index] = value */ - __pyx_t_8 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 789, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(__pyx_t_10)) { + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":790 - * for code_point in input: - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + /* "w3lib/_url.pyx":752 + * raise ValueError + * elif pointer < input_length: * raise ValueError # <<<<<<<<<<<<<< - * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) - * + * address[piece_index] = value + * piece_index += 1 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 790, __pyx_L1_error) + __PYX_ERR(0, 752, __pyx_L1_error) - /* "w3lib/_url.pyx":789 - * def _parse_opaque_host(input: str) -> str: - * for code_point in input: - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":751 + * if pointer >= input_length: + * raise ValueError + * elif pointer < input_length: # <<<<<<<<<<<<<< * raise ValueError - * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) + * address[piece_index] = value */ } - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_L43:; - /* "w3lib/_url.pyx":791 - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + /* "w3lib/_url.pyx":753 + * elif pointer < input_length: * raise ValueError - * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) # <<<<<<<<<<<<<< - * - * + * address[piece_index] = value # <<<<<<<<<<<<<< + * piece_index += 1 + * if compress is not None: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_5 = 1; + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_v_value) < 0))) __PYX_ERR(0, 753, __pyx_L1_error) + + /* "w3lib/_url.pyx":754 + * raise ValueError + * address[piece_index] = value + * piece_index += 1 # <<<<<<<<<<<<<< + * if compress is not None: + * swaps = piece_index - compress + */ + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 754, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_L9_continue:; + } + __pyx_L10_break:; + + /* "w3lib/_url.pyx":755 + * address[piece_index] = value + * piece_index += 1 + * if compress is not None: # <<<<<<<<<<<<<< + * swaps = piece_index - compress + * piece_index = 7 + */ + __pyx_t_5 = (__pyx_v_compress != Py_None); + if (__pyx_t_5) { + + /* "w3lib/_url.pyx":756 + * piece_index += 1 + * if compress is not None: + * swaps = piece_index - compress # <<<<<<<<<<<<<< + * piece_index = 7 + * while piece_index != 0 and swaps > 0: + */ + __pyx_t_7 = PyNumber_Subtract(__pyx_v_piece_index, __pyx_v_compress); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_v_swaps = __pyx_t_7; + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":757 + * if compress is not None: + * swaps = piece_index - compress + * piece_index = 7 # <<<<<<<<<<<<<< + * while piece_index != 0 and swaps > 0: + * address[piece_index], address[compress + swaps - 1] = ( + */ + __Pyx_INCREF(__pyx_int_7); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_int_7); + + /* "w3lib/_url.pyx":758 + * swaps = piece_index - compress + * piece_index = 7 + * while piece_index != 0 and swaps > 0: # <<<<<<<<<<<<<< + * address[piece_index], address[compress + swaps - 1] = ( + * address[compress + swaps - 1], + */ + while (1) { + __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 758, __pyx_L1_error) + if (__pyx_t_3) { + } else { + __pyx_t_5 = __pyx_t_3; + goto __pyx_L50_bool_binop_done; + } + __pyx_t_7 = PyObject_RichCompare(__pyx_v_swaps, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 758, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __pyx_t_3; + __pyx_L50_bool_binop_done:; + if (!__pyx_t_5) break; + + /* "w3lib/_url.pyx":760 + * while piece_index != 0 and swaps > 0: + * address[piece_index], address[compress + swaps - 1] = ( + * address[compress + swaps - 1], # <<<<<<<<<<<<<< + * address[piece_index], + * ) + */ + __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":761 + * address[piece_index], address[compress + swaps - 1] = ( + * address[compress + swaps - 1], + * address[piece_index], # <<<<<<<<<<<<<< + * ) + * piece_index -= 1 + */ + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "w3lib/_url.pyx":759 + * piece_index = 7 + * while piece_index != 0 and swaps > 0: + * address[piece_index], address[compress + swaps - 1] = ( # <<<<<<<<<<<<<< + * address[compress + swaps - 1], + * address[piece_index], + */ + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_7) < 0))) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_t_6, __pyx_t_1) < 0))) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":763 + * address[piece_index], + * ) + * piece_index -= 1 # <<<<<<<<<<<<<< + * swaps -= 1 + * elif compress is None and piece_index != 8: + */ + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":764 + * ) + * piece_index -= 1 + * swaps -= 1 # <<<<<<<<<<<<<< + * elif compress is None and piece_index != 8: + * raise ValueError + */ + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_swaps, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_swaps, __pyx_t_1); + __pyx_t_1 = 0; } + + /* "w3lib/_url.pyx":755 + * address[piece_index] = value + * piece_index += 1 + * if compress is not None: # <<<<<<<<<<<<<< + * swaps = piece_index - compress + * piece_index = 7 + */ + goto __pyx_L47; } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_input, __pyx_t_11}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "w3lib/_url.pyx":765 + * piece_index -= 1 + * swaps -= 1 + * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< + * raise ValueError + * return address + */ + __pyx_t_3 = (__pyx_v_compress == Py_None); + if (__pyx_t_3) { + } else { + __pyx_t_5 = __pyx_t_3; + goto __pyx_L52_bool_binop_done; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_9))) __PYX_ERR(0, 791, __pyx_L1_error) - __pyx_r = ((PyObject*)__pyx_t_9); - __pyx_t_9 = 0; - goto __pyx_L0; + __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 765, __pyx_L1_error) + __pyx_t_5 = __pyx_t_3; + __pyx_L52_bool_binop_done:; + if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":787 + /* "w3lib/_url.pyx":766 + * swaps -= 1 + * elif compress is None and piece_index != 8: + * raise ValueError # <<<<<<<<<<<<<< + * return address * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser - * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< - * for code_point in input: - * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 766, __pyx_L1_error) + + /* "w3lib/_url.pyx":765 + * piece_index -= 1 + * swaps -= 1 + * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< + * raise ValueError + * return address + */ + } + __pyx_L47:; + + /* "w3lib/_url.pyx":767 + * elif compress is None and piece_index != 8: + * raise ValueError + * return address # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_address); + __pyx_r = __pyx_v_address; + goto __pyx_L0; + + /* "w3lib/_url.pyx":683 + * + * + * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< + * address = [0] * 8 + * piece_index = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_AddTraceback("w3lib._url._parse_opaque_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._parse_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_address); + __Pyx_XDECREF(__pyx_v_piece_index); + __Pyx_XDECREF(__pyx_v_compress); + __Pyx_XDECREF(__pyx_v_pointer); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XDECREF(__pyx_v_numbers_seen); + __Pyx_XDECREF(__pyx_v_ipv4_piece); + __Pyx_XDECREF(__pyx_v_number); + __Pyx_XDECREF(__pyx_v_swaps); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":795 +/* "w3lib/_url.pyx":770 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< - * if not input: - * raise ValueError + * + * def _utf_8_percent_encode( # <<<<<<<<<<<<<< + * input: str, + * percent_encode_set: _PercentEncodeSet, */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_17_parse_ipv4_number(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_17_parse_ipv4_number = {"_parse_ipv4_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_17_parse_ipv4_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_17_parse_ipv4_number(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_13_utf_8_percent_encode = {"_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10538,17 +9702,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_percent_encode_set = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_parse_ipv4_number (wrapper)", 0); + __Pyx_RefNannySetupContext("_utf_8_percent_encode (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -10558,10 +9723,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_percent_encode_set,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -10574,23 +9741,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 795, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 770, __pyx_L3_error) else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_percent_encode_set)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 770, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, 1); __PYX_ERR(0, 770, __pyx_L3_error) + } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4_number") < 0)) __PYX_ERR(0, 795, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_utf_8_percent_encode") < 0)) __PYX_ERR(0, 770, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 1)) { + } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_percent_encode_set = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv4_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 795, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 770, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10600,12 +9779,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._parse_ipv4_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 795, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_16_parse_ipv4_number(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_percent_encode_set); /* function exit code */ goto __pyx_L0; @@ -10622,314 +9801,119 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { - int __pyx_v_validation_error; - long __pyx_v_r; +static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - Py_UCS4 __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_ipv4_number", 0); - __Pyx_INCREF(__pyx_v_input); - - /* "w3lib/_url.pyx":796 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: - * if not input: # <<<<<<<<<<<<<< - * raise ValueError - * validation_error = False - */ - __pyx_t_1 = (__Pyx_PyUnicode_IS_TRUE(__pyx_v_input) != 0); - __pyx_t_2 = (!__pyx_t_1); - if (unlikely(__pyx_t_2)) { - - /* "w3lib/_url.pyx":797 - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: - * if not input: - * raise ValueError # <<<<<<<<<<<<<< - * validation_error = False - * r = 10 - */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 797, __pyx_L1_error) - - /* "w3lib/_url.pyx":796 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: - * if not input: # <<<<<<<<<<<<<< - * raise ValueError - * validation_error = False - */ - } - - /* "w3lib/_url.pyx":798 - * if not input: - * raise ValueError - * validation_error = False # <<<<<<<<<<<<<< - * r = 10 - * if len(input) >= 2: - */ - __pyx_v_validation_error = 0; - - /* "w3lib/_url.pyx":799 - * raise ValueError - * validation_error = False - * r = 10 # <<<<<<<<<<<<<< - * if len(input) >= 2: - * if input[:2] in ("0X", "0x"): - */ - __pyx_v_r = 10; - - /* "w3lib/_url.pyx":800 - * validation_error = False - * r = 10 - * if len(input) >= 2: # <<<<<<<<<<<<<< - * if input[:2] in ("0X", "0x"): - * validation_error = True - */ - __pyx_t_3 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 800, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_3 >= 2); - if (__pyx_t_2) { - - /* "w3lib/_url.pyx":801 - * r = 10 - * if len(input) >= 2: - * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< - * validation_error = True - * input = input[2:] - */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0X, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 801, __pyx_L1_error) - if (!__pyx_t_1) { - } else { - __pyx_t_2 = __pyx_t_1; - goto __pyx_L6_bool_binop_done; - } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0x, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 801, __pyx_L1_error) - __pyx_t_2 = __pyx_t_1; - __pyx_L6_bool_binop_done:; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __pyx_t_2; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":802 - * if len(input) >= 2: - * if input[:2] in ("0X", "0x"): - * validation_error = True # <<<<<<<<<<<<<< - * input = input[2:] - * r = 16 - */ - __pyx_v_validation_error = 1; - - /* "w3lib/_url.pyx":803 - * if input[:2] in ("0X", "0x"): - * validation_error = True - * input = input[2:] # <<<<<<<<<<<<<< - * r = 16 - * elif input[0] == "0": - */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); - __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":804 - * validation_error = True - * input = input[2:] - * r = 16 # <<<<<<<<<<<<<< - * elif input[0] == "0": - * validation_error = True - */ - __pyx_v_r = 16; - - /* "w3lib/_url.pyx":801 - * r = 10 - * if len(input) >= 2: - * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< - * validation_error = True - * input = input[2:] - */ - goto __pyx_L5; - } - - /* "w3lib/_url.pyx":805 - * input = input[2:] - * r = 16 - * elif input[0] == "0": # <<<<<<<<<<<<<< - * validation_error = True - * input = input[1:] - */ - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 805, __pyx_L1_error) - __pyx_t_1 = (__pyx_t_5 == 48); - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":806 - * r = 16 - * elif input[0] == "0": - * validation_error = True # <<<<<<<<<<<<<< - * input = input[1:] - * r = 8 - */ - __pyx_v_validation_error = 1; - - /* "w3lib/_url.pyx":807 - * elif input[0] == "0": - * validation_error = True - * input = input[1:] # <<<<<<<<<<<<<< - * r = 8 - * if not input: - */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); - __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":808 - * validation_error = True - * input = input[1:] - * r = 8 # <<<<<<<<<<<<<< - * if not input: - * return (0, True) - */ - __pyx_v_r = 8; - - /* "w3lib/_url.pyx":805 - * input = input[2:] - * r = 16 - * elif input[0] == "0": # <<<<<<<<<<<<<< - * validation_error = True - * input = input[1:] - */ - } - __pyx_L5:; - - /* "w3lib/_url.pyx":800 - * validation_error = False - * r = 10 - * if len(input) >= 2: # <<<<<<<<<<<<<< - * if input[:2] in ("0X", "0x"): - * validation_error = True - */ - } + __Pyx_RefNannySetupContext("_utf_8_percent_encode", 1); - /* "w3lib/_url.pyx":809 - * input = input[1:] - * r = 8 - * if not input: # <<<<<<<<<<<<<< - * return (0, True) - * return (int(input, base=r), validation_error) + /* "w3lib/_url.pyx":774 + * percent_encode_set: _PercentEncodeSet, + * ) -> str: + * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input, + * encoding="utf-8", */ - __pyx_t_1 = (__Pyx_PyUnicode_IS_TRUE(__pyx_v_input) != 0); - __pyx_t_2 = (!__pyx_t_1); - if (__pyx_t_2) { + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":810 - * r = 8 - * if not input: - * return (0, True) # <<<<<<<<<<<<<< - * return (int(input, base=r), validation_error) - * + /* "w3lib/_url.pyx":775 + * ) -> str: + * return _percent_encode_after_encoding( + * input, # <<<<<<<<<<<<<< + * encoding="utf-8", + * percent_encode_set=percent_encode_set, */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_tuple__7); - __pyx_r = __pyx_tuple__7; - goto __pyx_L0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_input); + __Pyx_GIVEREF(__pyx_v_input); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input)) __PYX_ERR(0, 774, __pyx_L1_error); - /* "w3lib/_url.pyx":809 - * input = input[1:] - * r = 8 - * if not input: # <<<<<<<<<<<<<< - * return (0, True) - * return (int(input, base=r), validation_error) + /* "w3lib/_url.pyx":776 + * return _percent_encode_after_encoding( + * input, + * encoding="utf-8", # <<<<<<<<<<<<<< + * percent_encode_set=percent_encode_set, + * ) */ - } + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 776, __pyx_L1_error) - /* "w3lib/_url.pyx":811 - * if not input: - * return (0, True) - * return (int(input, base=r), validation_error) # <<<<<<<<<<<<<< - * + /* "w3lib/_url.pyx":777 + * input, + * encoding="utf-8", + * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< + * ) * */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_input); - __Pyx_GIVEREF(__pyx_v_input); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_input)) __PYX_ERR(0, 811, __pyx_L1_error); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base, __pyx_t_7) < 0) __PYX_ERR(0, 811, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_validation_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 776, __pyx_L1_error) + + /* "w3lib/_url.pyx":774 + * percent_encode_set: _PercentEncodeSet, + * ) -> str: + * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input, + * encoding="utf-8", + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 811, __pyx_L1_error); - __pyx_t_7 = 0; - __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 774, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":795 + /* "w3lib/_url.pyx":770 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< - * if not input: - * raise ValueError + * + * def _utf_8_percent_encode( # <<<<<<<<<<<<<< + * input: str, + * percent_encode_set: _PercentEncodeSet, */ /* function exit code */ __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("w3lib._url._parse_ipv4_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_input); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":815 +/* "w3lib/_url.pyx":782 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< - * parts = input.split(".") - * if parts and parts[-1] == "": + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser + * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_19_ends_in_number(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_15_parse_opaque_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_19_ends_in_number = {"_ends_in_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_19_ends_in_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_19_ends_in_number(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_15_parse_opaque_host = {"_parse_opaque_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_15_parse_opaque_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_15_parse_opaque_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10947,7 +9931,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_ends_in_number (wrapper)", 0); + __Pyx_RefNannySetupContext("_parse_opaque_host (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -10973,12 +9957,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 815, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 782, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ends_in_number") < 0)) __PYX_ERR(0, 815, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_opaque_host") < 0)) __PYX_ERR(0, 782, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -10989,7 +9973,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_ends_in_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 815, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_opaque_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 782, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10999,539 +9983,181 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._parse_opaque_host", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 815, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_18_ends_in_number(__pyx_self, __pyx_v_input); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "w3lib/_url.pyx":822 - * parts = parts[:-1] - * last = parts[-1] - * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< - * return True - * try: - */ - -static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 822, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; - __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_15_ends_in_number_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ends_in_number_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("w3lib._url._ends_in_number.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("genexpr", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 822, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 822, __pyx_L1_error) } - if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { - __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 822, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 822, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 822, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 822, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_code_point); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = (!__pyx_t_5); - if (__pyx_t_6) { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - } - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_14_parse_opaque_host(__pyx_self, __pyx_v_input); - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":815 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< - * parts = input.split(".") - * if parts and parts[-1] == "": - */ - -static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { - PyObject *__pyx_v_parts = NULL; - PyObject *__pyx_v_last = NULL; - PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator = 0; +static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + Py_UCS4 __pyx_v_code_point; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + void *__pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ends_in_number", 1); - - /* "w3lib/_url.pyx":816 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: - * parts = input.split(".") # <<<<<<<<<<<<<< - * if parts and parts[-1] == "": - * if len(parts) == 1: - */ - __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_parts = __pyx_t_1; - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":817 - * def _ends_in_number(input: str) -> bool: - * parts = input.split(".") - * if parts and parts[-1] == "": # <<<<<<<<<<<<<< - * if len(parts) == 1: - * return False - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __pyx_t_3; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "w3lib/_url.pyx":818 - * parts = input.split(".") - * if parts and parts[-1] == "": - * if len(parts) == 1: # <<<<<<<<<<<<<< - * return False - * parts = parts[:-1] - */ - __pyx_t_4 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 818, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_4 == 1); - if (__pyx_t_2) { - - /* "w3lib/_url.pyx":819 - * if parts and parts[-1] == "": - * if len(parts) == 1: - * return False # <<<<<<<<<<<<<< - * parts = parts[:-1] - * last = parts[-1] - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "w3lib/_url.pyx":818 - * parts = input.split(".") - * if parts and parts[-1] == "": - * if len(parts) == 1: # <<<<<<<<<<<<<< - * return False - * parts = parts[:-1] - */ - } - - /* "w3lib/_url.pyx":820 - * if len(parts) == 1: - * return False - * parts = parts[:-1] # <<<<<<<<<<<<<< - * last = parts[-1] - * if last and all(code_point in _ASCII_DIGIT for code_point in last): - */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":817 - * def _ends_in_number(input: str) -> bool: - * parts = input.split(".") - * if parts and parts[-1] == "": # <<<<<<<<<<<<<< - * if len(parts) == 1: - * return False - */ - } - - /* "w3lib/_url.pyx":821 - * return False - * parts = parts[:-1] - * last = parts[-1] # <<<<<<<<<<<<<< - * if last and all(code_point in _ASCII_DIGIT for code_point in last): - * return True - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_last = __pyx_t_1; - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":822 - * parts = parts[:-1] - * last = parts[-1] - * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< - * return True - * try: - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_last); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L8_bool_binop_done; - } - __pyx_t_1 = __pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(NULL, __pyx_v_last); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __pyx_t_3; - __pyx_L8_bool_binop_done:; - if (__pyx_t_2) { - - /* "w3lib/_url.pyx":823 - * last = parts[-1] - * if last and all(code_point in _ASCII_DIGIT for code_point in last): - * return True # <<<<<<<<<<<<<< - * try: - * _parse_ipv4_number(last) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - - /* "w3lib/_url.pyx":822 - * parts = parts[:-1] - * last = parts[-1] - * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< - * return True - * try: - */ - } - - /* "w3lib/_url.pyx":824 - * if last and all(code_point in _ASCII_DIGIT for code_point in last): - * return True - * try: # <<<<<<<<<<<<<< - * _parse_ipv4_number(last) - * except ValueError: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - __Pyx_XGOTREF(__pyx_t_8); - /*try:*/ { - - /* "w3lib/_url.pyx":825 - * return True - * try: - * _parse_ipv4_number(last) # <<<<<<<<<<<<<< - * except ValueError: - * return False - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_10 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_last}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 825, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_RefNannySetupContext("_parse_opaque_host", 1); - /* "w3lib/_url.pyx":824 - * if last and all(code_point in _ASCII_DIGIT for code_point in last): - * return True - * try: # <<<<<<<<<<<<<< - * _parse_ipv4_number(last) - * except ValueError: + /* "w3lib/_url.pyx":783 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser + * def _parse_opaque_host(input: str) -> str: + * for code_point in input: # <<<<<<<<<<<<<< + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + * raise ValueError */ - } - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L15_try_end; - __pyx_L10_error:; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_v_input); + __pyx_t_1 = __pyx_v_input; + __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 783, __pyx_L1_error) + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) { + __pyx_t_2 = __pyx_t_7; + __pyx_v_code_point = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2); - /* "w3lib/_url.pyx":826 - * try: - * _parse_ipv4_number(last) - * except ValueError: # <<<<<<<<<<<<<< - * return False - * return True - */ - __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); - if (__pyx_t_10) { - __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(0, 826, __pyx_L12_except_error) - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_9); + /* "w3lib/_url.pyx":784 + * def _parse_opaque_host(input: str) -> str: + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< + * raise ValueError + * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) + */ + __pyx_t_8 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__pyx_t_10)) { - /* "w3lib/_url.pyx":827 - * _parse_ipv4_number(last) - * except ValueError: - * return False # <<<<<<<<<<<<<< - * return True + /* "w3lib/_url.pyx":785 + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + * raise ValueError # <<<<<<<<<<<<<< + * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) * */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L13_except_return; - } - goto __pyx_L12_except_error; + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 785, __pyx_L1_error) - /* "w3lib/_url.pyx":824 - * if last and all(code_point in _ASCII_DIGIT for code_point in last): - * return True - * try: # <<<<<<<<<<<<<< - * _parse_ipv4_number(last) - * except ValueError: + /* "w3lib/_url.pyx":784 + * def _parse_opaque_host(input: str) -> str: + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< + * raise ValueError + * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) */ - __pyx_L12_except_error:; - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); - goto __pyx_L1_error; - __pyx_L13_except_return:; - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); - goto __pyx_L0; - __pyx_L15_try_end:; + } } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":828 - * except ValueError: - * return False - * return True # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":786 + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: + * raise ValueError + * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_input, __pyx_t_11}; + __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_9))) __PYX_ERR(0, 786, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":815 + /* "w3lib/_url.pyx":782 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< - * parts = input.split(".") - * if parts and parts[-1] == "": + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser + * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< + * for code_point in input: + * if code_point in _FORBIDDEN_HOST_CODE_POINTS: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("w3lib._url._parse_opaque_host", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_parts); - __Pyx_XDECREF(__pyx_v_last); - __Pyx_XDECREF(__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":832 +/* "w3lib/_url.pyx":790 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser - * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< - * parts = input.split(".") - * if parts and not parts[-1]: + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< + * if not input: + * raise ValueError */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_21_parse_ipv4(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_17_parse_ipv4_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_21_parse_ipv4 = {"_parse_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_21_parse_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_21_parse_ipv4(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_17_parse_ipv4_number = {"_parse_ipv4_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_17_parse_ipv4_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_17_parse_ipv4_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11549,7 +10175,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_parse_ipv4 (wrapper)", 0); + __Pyx_RefNannySetupContext("_parse_ipv4_number (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -11575,12 +10201,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4") < 0)) __PYX_ERR(0, 832, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4_number") < 0)) __PYX_ERR(0, 790, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -11591,7 +10217,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 832, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_ipv4_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 790, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11601,12 +10227,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._parse_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._parse_ipv4_number", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 832, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_20_parse_ipv4(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_16_parse_ipv4_number(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -11622,632 +10248,333 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "w3lib/_url.pyx":842 - * result = _parse_ipv4_number(part) - * numbers.append(result[0]) - * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< - * raise ValueError - * if numbers[-1] >= 256 ** (5 - len(numbers)): - */ - -static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 842, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; - __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_ipv4_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("w3lib._url._parse_ipv4.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("genexpr", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 842, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 842, __pyx_L1_error) } - __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 842, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 842, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_item, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - } - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "w3lib/_url.pyx":832 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser - * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< - * parts = input.split(".") - * if parts and not parts[-1]: - */ -static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { - PyObject *__pyx_v_parts = NULL; - PyObject *__pyx_v_numbers = NULL; - PyObject *__pyx_v_part = NULL; - PyObject *__pyx_v_result = NULL; - PyObject *__pyx_v_ipv4 = NULL; - PyObject *__pyx_v_counter = NULL; - PyObject *__pyx_v_n = NULL; - PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1 = 0; +static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + int __pyx_v_validation_error; + long __pyx_v_r; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - Py_ssize_t __pyx_t_5; - PyObject *(*__pyx_t_6)(PyObject *); + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_UCS4 __pyx_t_5; + PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_ipv4", 1); - - /* "w3lib/_url.pyx":833 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser - * def _parse_ipv4(input: str) -> int: - * parts = input.split(".") # <<<<<<<<<<<<<< - * if parts and not parts[-1]: - * parts = parts[:-1] - */ - __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_parts = __pyx_t_1; - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":834 - * def _parse_ipv4(input: str) -> int: - * parts = input.split(".") - * if parts and not parts[-1]: # <<<<<<<<<<<<<< - * parts = parts[:-1] - * if len(parts) > 4: - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 834, __pyx_L1_error) - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = (!__pyx_t_3); - __pyx_t_2 = __pyx_t_4; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "w3lib/_url.pyx":835 - * parts = input.split(".") - * if parts and not parts[-1]: - * parts = parts[:-1] # <<<<<<<<<<<<<< - * if len(parts) > 4: - * raise ValueError - */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice_, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":834 - * def _parse_ipv4(input: str) -> int: - * parts = input.split(".") - * if parts and not parts[-1]: # <<<<<<<<<<<<<< - * parts = parts[:-1] - * if len(parts) > 4: - */ - } + __Pyx_RefNannySetupContext("_parse_ipv4_number", 0); + __Pyx_INCREF(__pyx_v_input); - /* "w3lib/_url.pyx":836 - * if parts and not parts[-1]: - * parts = parts[:-1] - * if len(parts) > 4: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":791 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: + * if not input: # <<<<<<<<<<<<<< * raise ValueError - * numbers = [] + * validation_error = False */ - __pyx_t_5 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 836, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_5 > 4); + __pyx_t_1 = (__Pyx_PyUnicode_IS_TRUE(__pyx_v_input) != 0); + __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":837 - * parts = parts[:-1] - * if len(parts) > 4: + /* "w3lib/_url.pyx":792 + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: + * if not input: * raise ValueError # <<<<<<<<<<<<<< - * numbers = [] - * for part in parts: + * validation_error = False + * r = 10 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 837, __pyx_L1_error) + __PYX_ERR(0, 792, __pyx_L1_error) - /* "w3lib/_url.pyx":836 - * if parts and not parts[-1]: - * parts = parts[:-1] - * if len(parts) > 4: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":791 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: + * if not input: # <<<<<<<<<<<<<< * raise ValueError - * numbers = [] + * validation_error = False */ } - /* "w3lib/_url.pyx":838 - * if len(parts) > 4: + /* "w3lib/_url.pyx":793 + * if not input: * raise ValueError - * numbers = [] # <<<<<<<<<<<<<< - * for part in parts: - * result = _parse_ipv4_number(part) + * validation_error = False # <<<<<<<<<<<<<< + * r = 10 + * if len(input) >= 2: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_numbers = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_validation_error = 0; - /* "w3lib/_url.pyx":839 + /* "w3lib/_url.pyx":794 * raise ValueError - * numbers = [] - * for part in parts: # <<<<<<<<<<<<<< - * result = _parse_ipv4_number(part) - * numbers.append(result[0]) - */ - if (likely(PyList_CheckExact(__pyx_v_parts)) || PyTuple_CheckExact(__pyx_v_parts)) { - __pyx_t_1 = __pyx_v_parts; __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; - __pyx_t_6 = NULL; - } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 839, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_6)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 839, __pyx_L1_error) - #endif - if (__pyx_t_5 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 839, __pyx_L1_error) - #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 839, __pyx_L1_error) - #endif - if (__pyx_t_5 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 839, __pyx_L1_error) - #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - } - } else { - __pyx_t_7 = __pyx_t_6(__pyx_t_1); - if (unlikely(!__pyx_t_7)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 839, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_7); - } - __Pyx_XDECREF_SET(__pyx_v_part, __pyx_t_7); - __pyx_t_7 = 0; - - /* "w3lib/_url.pyx":840 - * numbers = [] - * for part in parts: - * result = _parse_ipv4_number(part) # <<<<<<<<<<<<<< - * numbers.append(result[0]) - * if any(item > 255 for item in numbers[:-1]): + * validation_error = False + * r = 10 # <<<<<<<<<<<<<< + * if len(input) >= 2: + * if input[:2] in ("0X", "0x"): */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_10 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_part}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_7); - __pyx_t_7 = 0; + __pyx_v_r = 10; - /* "w3lib/_url.pyx":841 - * for part in parts: - * result = _parse_ipv4_number(part) - * numbers.append(result[0]) # <<<<<<<<<<<<<< - * if any(item > 255 for item in numbers[:-1]): - * raise ValueError + /* "w3lib/_url.pyx":795 + * validation_error = False + * r = 10 + * if len(input) >= 2: # <<<<<<<<<<<<<< + * if input[:2] in ("0X", "0x"): + * validation_error = True */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_numbers, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_3 >= 2); + if (__pyx_t_2) { - /* "w3lib/_url.pyx":839 - * raise ValueError - * numbers = [] - * for part in parts: # <<<<<<<<<<<<<< - * result = _parse_ipv4_number(part) - * numbers.append(result[0]) + /* "w3lib/_url.pyx":796 + * r = 10 + * if len(input) >= 2: + * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< + * validation_error = True + * input = input[2:] */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0X, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 796, __pyx_L1_error) + if (!__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0x, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 796, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1; + __pyx_L6_bool_binop_done:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_2; + if (__pyx_t_1) { - /* "w3lib/_url.pyx":842 - * result = _parse_ipv4_number(part) - * numbers.append(result[0]) - * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< - * raise ValueError - * if numbers[-1] >= 256 ** (5 - len(numbers)): - */ - __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__pyx_t_2)) { + /* "w3lib/_url.pyx":797 + * if len(input) >= 2: + * if input[:2] in ("0X", "0x"): + * validation_error = True # <<<<<<<<<<<<<< + * input = input[2:] + * r = 16 + */ + __pyx_v_validation_error = 1; - /* "w3lib/_url.pyx":843 - * numbers.append(result[0]) - * if any(item > 255 for item in numbers[:-1]): - * raise ValueError # <<<<<<<<<<<<<< - * if numbers[-1] >= 256 ** (5 - len(numbers)): - * raise ValueError + /* "w3lib/_url.pyx":798 + * if input[:2] in ("0X", "0x"): + * validation_error = True + * input = input[2:] # <<<<<<<<<<<<<< + * r = 16 + * elif input[0] == "0": */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 843, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":842 - * result = _parse_ipv4_number(part) - * numbers.append(result[0]) - * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< - * raise ValueError - * if numbers[-1] >= 256 ** (5 - len(numbers)): + /* "w3lib/_url.pyx":799 + * validation_error = True + * input = input[2:] + * r = 16 # <<<<<<<<<<<<<< + * elif input[0] == "0": + * validation_error = True */ - } + __pyx_v_r = 16; - /* "w3lib/_url.pyx":844 - * if any(item > 255 for item in numbers[:-1]): - * raise ValueError - * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< - * raise ValueError - * ipv4 = numbers[-1] + /* "w3lib/_url.pyx":796 + * r = 10 + * if len(input) >= 2: + * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< + * validation_error = True + * input = input[2:] */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyList_GET_SIZE(__pyx_v_numbers); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 844, __pyx_L1_error) - __pyx_t_7 = PyFloat_FromDouble(pow(256.0, ((double)(5 - __pyx_t_5)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(__pyx_t_2)) { + goto __pyx_L5; + } - /* "w3lib/_url.pyx":845 - * raise ValueError - * if numbers[-1] >= 256 ** (5 - len(numbers)): - * raise ValueError # <<<<<<<<<<<<<< - * ipv4 = numbers[-1] - * counter = 0 + /* "w3lib/_url.pyx":800 + * input = input[2:] + * r = 16 + * elif input[0] == "0": # <<<<<<<<<<<<<< + * validation_error = True + * input = input[1:] */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 845, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 800, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_5 == 48); + if (__pyx_t_1) { - /* "w3lib/_url.pyx":844 - * if any(item > 255 for item in numbers[:-1]): - * raise ValueError - * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< - * raise ValueError - * ipv4 = numbers[-1] + /* "w3lib/_url.pyx":801 + * r = 16 + * elif input[0] == "0": + * validation_error = True # <<<<<<<<<<<<<< + * input = input[1:] + * r = 8 */ - } + __pyx_v_validation_error = 1; - /* "w3lib/_url.pyx":846 - * if numbers[-1] >= 256 ** (5 - len(numbers)): - * raise ValueError - * ipv4 = numbers[-1] # <<<<<<<<<<<<<< - * counter = 0 - * for n in numbers[:-1]: + /* "w3lib/_url.pyx":802 + * elif input[0] == "0": + * validation_error = True + * input = input[1:] # <<<<<<<<<<<<<< + * r = 8 + * if not input: */ - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_ipv4 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; - /* "w3lib/_url.pyx":847 - * raise ValueError - * ipv4 = numbers[-1] - * counter = 0 # <<<<<<<<<<<<<< - * for n in numbers[:-1]: - * ipv4 += n * 256 ** (3 - counter) + /* "w3lib/_url.pyx":803 + * validation_error = True + * input = input[1:] + * r = 8 # <<<<<<<<<<<<<< + * if not input: + * return (0, True) */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_counter = __pyx_int_0; + __pyx_v_r = 8; - /* "w3lib/_url.pyx":848 - * ipv4 = numbers[-1] - * counter = 0 - * for n in numbers[:-1]: # <<<<<<<<<<<<<< - * ipv4 += n * 256 ** (3 - counter) - * counter += 1 + /* "w3lib/_url.pyx":800 + * input = input[2:] + * r = 16 + * elif input[0] == "0": # <<<<<<<<<<<<<< + * validation_error = True + * input = input[1:] */ - __pyx_t_8 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); - __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 848, __pyx_L1_error) - #endif - if (__pyx_t_5 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 848, __pyx_L1_error) - #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - #endif - __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_8); - __pyx_t_8 = 0; + __pyx_L5:; - /* "w3lib/_url.pyx":849 - * counter = 0 - * for n in numbers[:-1]: - * ipv4 += n * 256 ** (3 - counter) # <<<<<<<<<<<<<< - * counter += 1 - * return ipv4 + /* "w3lib/_url.pyx":795 + * validation_error = False + * r = 10 + * if len(input) >= 2: # <<<<<<<<<<<<<< + * if input[:2] in ("0X", "0x"): + * validation_error = True */ - __pyx_t_8 = __Pyx_PyInt_SubtractCObj(__pyx_int_3, __pyx_v_counter, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyNumber_Power(__pyx_int_256, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ipv4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF_SET(__pyx_v_ipv4, __pyx_t_1); - __pyx_t_1 = 0; + } - /* "w3lib/_url.pyx":850 - * for n in numbers[:-1]: - * ipv4 += n * 256 ** (3 - counter) - * counter += 1 # <<<<<<<<<<<<<< - * return ipv4 + /* "w3lib/_url.pyx":804 + * input = input[1:] + * r = 8 + * if not input: # <<<<<<<<<<<<<< + * return (0, True) + * return (int(input, base=r), validation_error) + */ + __pyx_t_1 = (__Pyx_PyUnicode_IS_TRUE(__pyx_v_input) != 0); + __pyx_t_2 = (!__pyx_t_1); + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":805 + * r = 8 + * if not input: + * return (0, True) # <<<<<<<<<<<<<< + * return (int(input, base=r), validation_error) * */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_counter, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_counter, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__7); + __pyx_r = __pyx_tuple__7; + goto __pyx_L0; - /* "w3lib/_url.pyx":848 - * ipv4 = numbers[-1] - * counter = 0 - * for n in numbers[:-1]: # <<<<<<<<<<<<<< - * ipv4 += n * 256 ** (3 - counter) - * counter += 1 + /* "w3lib/_url.pyx":804 + * input = input[1:] + * r = 8 + * if not input: # <<<<<<<<<<<<<< + * return (0, True) + * return (int(input, base=r), validation_error) */ } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":851 - * ipv4 += n * 256 ** (3 - counter) - * counter += 1 - * return ipv4 # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":806 + * if not input: + * return (0, True) + * return (int(input, base=r), validation_error) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_ipv4))||((__pyx_v_ipv4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_ipv4))) __PYX_ERR(0, 851, __pyx_L1_error) - __Pyx_INCREF(__pyx_v_ipv4); - __pyx_r = ((PyObject*)__pyx_v_ipv4); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_input); + __Pyx_GIVEREF(__pyx_v_input); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_input)) __PYX_ERR(0, 806, __pyx_L1_error); + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base, __pyx_t_7) < 0) __PYX_ERR(0, 806, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_validation_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 806, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 806, __pyx_L1_error); + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_r = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":832 + /* "w3lib/_url.pyx":790 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser - * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< - * parts = input.split(".") - * if parts and not parts[-1]: + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser + * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< + * if not input: + * raise ValueError */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("w3lib._url._parse_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._parse_ipv4_number", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_parts); - __Pyx_XDECREF(__pyx_v_numbers); - __Pyx_XDECREF(__pyx_v_part); - __Pyx_XDECREF(__pyx_v_result); - __Pyx_XDECREF(__pyx_v_ipv4); - __Pyx_XDECREF(__pyx_v_counter); - __Pyx_XDECREF(__pyx_v_n); - __Pyx_XDECREF(__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1); + __Pyx_XDECREF(__pyx_v_input); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":855 +/* "w3lib/_url.pyx":810 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< - * result = _utr46._to_ascii( - * domain, + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and parts[-1] == "": */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_23_domain_to_ascii(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_19_ends_in_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif -); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_23_domain_to_ascii = {"_domain_to_ascii", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_23_domain_to_ascii, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_23_domain_to_ascii(PyObject *__pyx_self, +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_19_ends_in_number = {"_ends_in_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_19_ends_in_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_19_ends_in_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_domain = 0; - PyObject *__pyx_v_be_strict = 0; + PyObject *__pyx_v_input = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_domain_to_ascii (wrapper)", 0); + __Pyx_RefNannySetupContext("_ends_in_number (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -12257,8 +10584,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain,&__pyx_n_s_be_strict,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -12270,34 +10596,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domain)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 810, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } - if (kw_args == 1) { - const Py_ssize_t index = 1; - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); - if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L3_error) - } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_domain_to_ascii") < 0)) __PYX_ERR(0, 855, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ends_in_number") < 0)) __PYX_ERR(0, 810, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_domain = ((PyObject*)values[0]); - __pyx_v_be_strict = values[1]; + __pyx_v_input = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_domain_to_ascii", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 855, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_ends_in_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 810, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12307,12 +10626,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._domain_to_ascii", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain), (&PyUnicode_Type), 0, "domain", 1))) __PYX_ERR(0, 855, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_22_domain_to_ascii(__pyx_self, __pyx_v_domain, __pyx_v_be_strict); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 810, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_18_ends_in_number(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -12328,239 +10647,518 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, PyObject *__pyx_v_be_strict) { - PyObject *__pyx_v_result = NULL; +/* "w3lib/_url.pyx":817 + * parts = parts[:-1] + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< + * return True + * try: + */ + +static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 817, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_15_ends_in_number_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ends_in_number_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("w3lib._url._ends_in_number.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; - Py_ssize_t __pyx_t_7; - Py_UCS4 __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_domain_to_ascii", 1); + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 817, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 817, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 817, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_code_point); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "w3lib/_url.pyx":856 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: - * result = _utr46._to_ascii( # <<<<<<<<<<<<<< - * domain, - * use_std3_ascii_rules=be_strict, + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":810 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and parts[-1] == "": + */ + +static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + PyObject *__pyx_v_parts = NULL; + PyObject *__pyx_v_last = NULL; + PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_ends_in_number", 1); + + /* "w3lib/_url.pyx":811 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: + * parts = input.split(".") # <<<<<<<<<<<<<< + * if parts and parts[-1] == "": + * if len(parts) == 1: + */ + __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_parts = __pyx_t_1; + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":812 + * def _ends_in_number(input: str) -> bool: + * parts = input.split(".") + * if parts and parts[-1] == "": # <<<<<<<<<<<<<< + * if len(parts) == 1: + * return False + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 812, __pyx_L1_error) + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 812, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":813 + * parts = input.split(".") + * if parts and parts[-1] == "": + * if len(parts) == 1: # <<<<<<<<<<<<<< + * return False + * parts = parts[:-1] + */ + __pyx_t_4 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 813, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_4 == 1); + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":814 + * if parts and parts[-1] == "": + * if len(parts) == 1: + * return False # <<<<<<<<<<<<<< + * parts = parts[:-1] + * last = parts[-1] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "w3lib/_url.pyx":813 + * parts = input.split(".") + * if parts and parts[-1] == "": + * if len(parts) == 1: # <<<<<<<<<<<<<< + * return False + * parts = parts[:-1] */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utr46); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_ascii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } - /* "w3lib/_url.pyx":857 - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: - * result = _utr46._to_ascii( - * domain, # <<<<<<<<<<<<<< - * use_std3_ascii_rules=be_strict, - * check_hyphens=False, + /* "w3lib/_url.pyx":815 + * if len(parts) == 1: + * return False + * parts = parts[:-1] # <<<<<<<<<<<<<< + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_domain); - __Pyx_GIVEREF(__pyx_v_domain); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domain)) __PYX_ERR(0, 856, __pyx_L1_error); + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice__2, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":858 - * result = _utr46._to_ascii( - * domain, - * use_std3_ascii_rules=be_strict, # <<<<<<<<<<<<<< - * check_hyphens=False, - * check_bidi=True, + /* "w3lib/_url.pyx":812 + * def _ends_in_number(input: str) -> bool: + * parts = input.split(".") + * if parts and parts[-1] == "": # <<<<<<<<<<<<<< + * if len(parts) == 1: + * return False */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_v_be_strict) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + } - /* "w3lib/_url.pyx":859 - * domain, - * use_std3_ascii_rules=be_strict, - * check_hyphens=False, # <<<<<<<<<<<<<< - * check_bidi=True, - * check_joiners=True, + /* "w3lib/_url.pyx":816 + * return False + * parts = parts[:-1] + * last = parts[-1] # <<<<<<<<<<<<<< + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, Py_False) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_last = __pyx_t_1; + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":860 - * use_std3_ascii_rules=be_strict, - * check_hyphens=False, - * check_bidi=True, # <<<<<<<<<<<<<< - * check_joiners=True, - * transitional_processing=False, + /* "w3lib/_url.pyx":817 + * parts = parts[:-1] + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< + * return True + * try: */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, Py_True) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_last); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_1 = __pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(NULL, __pyx_v_last); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __pyx_t_3; + __pyx_L8_bool_binop_done:; + if (__pyx_t_2) { - /* "w3lib/_url.pyx":861 - * check_hyphens=False, - * check_bidi=True, - * check_joiners=True, # <<<<<<<<<<<<<< - * transitional_processing=False, - * verify_dns_length=be_strict, + /* "w3lib/_url.pyx":818 + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True # <<<<<<<<<<<<<< + * try: + * _parse_ipv4_number(last) */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, Py_True) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; - /* "w3lib/_url.pyx":862 - * check_bidi=True, - * check_joiners=True, - * transitional_processing=False, # <<<<<<<<<<<<<< - * verify_dns_length=be_strict, - * ) + /* "w3lib/_url.pyx":817 + * parts = parts[:-1] + * last = parts[-1] + * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< + * return True + * try: */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, Py_False) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + } - /* "w3lib/_url.pyx":863 - * check_joiners=True, - * transitional_processing=False, - * verify_dns_length=be_strict, # <<<<<<<<<<<<<< - * ) - * if not result: + /* "w3lib/_url.pyx":819 + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True + * try: # <<<<<<<<<<<<<< + * _parse_ipv4_number(last) + * except ValueError: */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_v_be_strict) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { - /* "w3lib/_url.pyx":856 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: - * result = _utr46._to_ascii( # <<<<<<<<<<<<<< - * domain, - * use_std3_ascii_rules=be_strict, + /* "w3lib/_url.pyx":820 + * return True + * try: + * _parse_ipv4_number(last) # <<<<<<<<<<<<<< + * except ValueError: + * return False */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_result = __pyx_t_4; - __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_last}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 820, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":865 - * verify_dns_length=be_strict, - * ) - * if not result: # <<<<<<<<<<<<<< - * raise ValueError( - * f"Domain name {domain!r} is an empty string after conversion to " + /* "w3lib/_url.pyx":819 + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True + * try: # <<<<<<<<<<<<<< + * _parse_ipv4_number(last) + * except ValueError: */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 865, __pyx_L1_error) - __pyx_t_6 = (!__pyx_t_5); - if (unlikely(__pyx_t_6)) { + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L15_try_end; + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":867 - * if not result: - * raise ValueError( - * f"Domain name {domain!r} is an empty string after conversion to " # <<<<<<<<<<<<<< - * f"ASCII, which makes for an invalid domain name." - * ) + /* "w3lib/_url.pyx":821 + * try: + * _parse_ipv4_number(last) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * return True */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = 0; - __pyx_t_8 = 127; - __Pyx_INCREF(__pyx_kp_u_Domain_name); - __pyx_t_7 += 12; - __Pyx_GIVEREF(__pyx_kp_u_Domain_name); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Domain_name); - __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8; - __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __pyx_t_3 = 0; - __Pyx_INCREF(__pyx_kp_u_is_an_empty_string_after_conver); - __pyx_t_7 += 86; - __Pyx_GIVEREF(__pyx_kp_u_is_an_empty_string_after_conver); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_is_an_empty_string_after_conver); - __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_10) { + __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(0, 821, __pyx_L12_except_error) + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_9); - /* "w3lib/_url.pyx":866 - * ) - * if not result: - * raise ValueError( # <<<<<<<<<<<<<< - * f"Domain name {domain!r} is an empty string after conversion to " - * f"ASCII, which makes for an invalid domain name." + /* "w3lib/_url.pyx":822 + * _parse_ipv4_number(last) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * return True + * */ - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L13_except_return; + } + goto __pyx_L12_except_error; - /* "w3lib/_url.pyx":865 - * verify_dns_length=be_strict, - * ) - * if not result: # <<<<<<<<<<<<<< - * raise ValueError( - * f"Domain name {domain!r} is an empty string after conversion to " + /* "w3lib/_url.pyx":819 + * if last and all(code_point in _ASCII_DIGIT for code_point in last): + * return True + * try: # <<<<<<<<<<<<<< + * _parse_ipv4_number(last) + * except ValueError: */ + __pyx_L12_except_error:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L13_except_return:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L0; + __pyx_L15_try_end:; } - /* "w3lib/_url.pyx":870 - * f"ASCII, which makes for an invalid domain name." - * ) - * return result # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":823 + * except ValueError: + * return False + * return True # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_result))) __PYX_ERR(0, 870, __pyx_L1_error) - __Pyx_INCREF(__pyx_v_result); - __pyx_r = ((PyObject*)__pyx_v_result); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; goto __pyx_L0; - /* "w3lib/_url.pyx":855 + /* "w3lib/_url.pyx":810 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< - * result = _utr46._to_ascii( - * domain, + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker + * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and parts[-1] == "": */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("w3lib._url._domain_to_ascii", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_parts); + __Pyx_XDECREF(__pyx_v_last); + __Pyx_XDECREF(__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":874 +/* "w3lib/_url.pyx":827 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser - * def _parse_host( # <<<<<<<<<<<<<< - * input: str, - * *, + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and not parts[-1]: */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_25_parse_host(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_21_parse_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_25_parse_host = {"_parse_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_25_parse_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_25_parse_host(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_21_parse_ipv4 = {"_parse_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_21_parse_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_21_parse_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -12568,18 +11166,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_input = 0; - PyObject *__pyx_v_is_special = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_parse_host (wrapper)", 0); + __Pyx_RefNannySetupContext("_parse_ipv4 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -12589,16 +11186,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_is_special,0}; - - /* "w3lib/_url.pyx":877 - * input: str, - * *, - * is_special: bool = True, # <<<<<<<<<<<<<< - * ) -> Union[str, int, List[int]]: - * if input.startswith("["): - */ - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -12614,18 +11202,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 874, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } - if (kw_args == 1) { - const Py_ssize_t index = 1; - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); - if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 874, __pyx_L3_error) - } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_host") < 0)) __PYX_ERR(0, 874, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4") < 0)) __PYX_ERR(0, 827, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -12633,11 +11215,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_input = ((PyObject*)values[0]); - __pyx_v_is_special = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 874, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 827, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12647,20 +11228,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._parse_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._parse_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 875, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_24_parse_host(__pyx_self, __pyx_v_input, __pyx_v_is_special); - - /* "w3lib/_url.pyx":874 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser - * def _parse_host( # <<<<<<<<<<<<<< - * input: str, - * *, - */ + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 827, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_20_parse_ipv4(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -12676,496 +11249,632 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_is_special) { - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_ascii_domain = NULL; - PyObject *__pyx_v_code_point = NULL; +/* "w3lib/_url.pyx":837 + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): + */ + +static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 837, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_ipv4_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("w3lib._url._parse_ipv4.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - Py_ssize_t __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_host", 1); + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 837, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 837, __pyx_L1_error) } + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 837, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 837, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_item, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "w3lib/_url.pyx":879 - * is_special: bool = True, - * ) -> Union[str, int, List[int]]: - * if input.startswith("["): # <<<<<<<<<<<<<< - * if not input.endswith("]"): - * raise ValueError - */ - __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 879, __pyx_L1_error) - if (__pyx_t_1) { + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":880 - * ) -> Union[str, int, List[int]]: - * if input.startswith("["): - * if not input.endswith("]"): # <<<<<<<<<<<<<< - * raise ValueError - * return _parse_ipv6(input[1:-1]) +/* "w3lib/_url.pyx":827 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and not parts[-1]: */ - __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__9, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 880, __pyx_L1_error) - __pyx_t_2 = (!__pyx_t_1); - if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":881 - * if input.startswith("["): - * if not input.endswith("]"): - * raise ValueError # <<<<<<<<<<<<<< - * return _parse_ipv6(input[1:-1]) - * if not is_special: - */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 881, __pyx_L1_error) +static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + PyObject *__pyx_v_parts = NULL; + PyObject *__pyx_v_numbers = NULL; + PyObject *__pyx_v_part = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_ipv4 = NULL; + PyObject *__pyx_v_counter = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1 = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_ipv4", 1); - /* "w3lib/_url.pyx":880 - * ) -> Union[str, int, List[int]]: - * if input.startswith("["): - * if not input.endswith("]"): # <<<<<<<<<<<<<< - * raise ValueError - * return _parse_ipv6(input[1:-1]) + /* "w3lib/_url.pyx":828 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: + * parts = input.split(".") # <<<<<<<<<<<<<< + * if parts and not parts[-1]: + * parts = parts[:-1] */ - } + __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_parts = __pyx_t_1; + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":882 - * if not input.endswith("]"): - * raise ValueError - * return _parse_ipv6(input[1:-1]) # <<<<<<<<<<<<<< - * if not is_special: - * return _parse_opaque_host(input) + /* "w3lib/_url.pyx":829 + * def _parse_ipv4(input: str) -> int: + * parts = input.split(".") + * if parts and not parts[-1]: # <<<<<<<<<<<<<< + * parts = parts[:-1] + * if len(parts) > 4: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 882, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 829, __pyx_L1_error) + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (!__pyx_t_3); + __pyx_t_2 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { - /* "w3lib/_url.pyx":879 - * is_special: bool = True, - * ) -> Union[str, int, List[int]]: - * if input.startswith("["): # <<<<<<<<<<<<<< - * if not input.endswith("]"): - * raise ValueError + /* "w3lib/_url.pyx":830 + * parts = input.split(".") + * if parts and not parts[-1]: + * parts = parts[:-1] # <<<<<<<<<<<<<< + * if len(parts) > 4: + * raise ValueError */ - } + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice__2, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":883 - * raise ValueError - * return _parse_ipv6(input[1:-1]) - * if not is_special: # <<<<<<<<<<<<<< - * return _parse_opaque_host(input) - * domain = unquote(input) + /* "w3lib/_url.pyx":829 + * def _parse_ipv4(input: str) -> int: + * parts = input.split(".") + * if parts and not parts[-1]: # <<<<<<<<<<<<<< + * parts = parts[:-1] + * if len(parts) > 4: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_is_special); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 883, __pyx_L1_error) - __pyx_t_1 = (!__pyx_t_2); - if (__pyx_t_1) { + } - /* "w3lib/_url.pyx":884 - * return _parse_ipv6(input[1:-1]) - * if not is_special: - * return _parse_opaque_host(input) # <<<<<<<<<<<<<< - * domain = unquote(input) - * ascii_domain = _domain_to_ascii(domain) + /* "w3lib/_url.pyx":831 + * if parts and not parts[-1]: + * parts = parts[:-1] + * if len(parts) > 4: # <<<<<<<<<<<<<< + * raise ValueError + * numbers = [] */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_opaque_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + __pyx_t_5 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_5 > 4); + if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":883 - * raise ValueError - * return _parse_ipv6(input[1:-1]) - * if not is_special: # <<<<<<<<<<<<<< - * return _parse_opaque_host(input) - * domain = unquote(input) + /* "w3lib/_url.pyx":832 + * parts = parts[:-1] + * if len(parts) > 4: + * raise ValueError # <<<<<<<<<<<<<< + * numbers = [] + * for part in parts: */ - } + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 832, __pyx_L1_error) - /* "w3lib/_url.pyx":885 - * if not is_special: - * return _parse_opaque_host(input) - * domain = unquote(input) # <<<<<<<<<<<<<< - * ascii_domain = _domain_to_ascii(domain) - * for code_point in ascii_domain: + /* "w3lib/_url.pyx":831 + * if parts and not parts[-1]: + * parts = parts[:-1] + * if len(parts) > 4: # <<<<<<<<<<<<<< + * raise ValueError + * numbers = [] */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unquote); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_v_domain = __pyx_t_3; - __pyx_t_3 = 0; - /* "w3lib/_url.pyx":886 - * return _parse_opaque_host(input) - * domain = unquote(input) - * ascii_domain = _domain_to_ascii(domain) # <<<<<<<<<<<<<< - * for code_point in ascii_domain: - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + /* "w3lib/_url.pyx":833 + * if len(parts) > 4: + * raise ValueError + * numbers = [] # <<<<<<<<<<<<<< + * for part in parts: + * result = _parse_ipv4_number(part) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_domain_to_ascii); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 886, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_domain}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 886, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_v_ascii_domain = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_numbers = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":887 - * domain = unquote(input) - * ascii_domain = _domain_to_ascii(domain) - * for code_point in ascii_domain: # <<<<<<<<<<<<<< - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: - * raise ValueError + /* "w3lib/_url.pyx":834 + * raise ValueError + * numbers = [] + * for part in parts: # <<<<<<<<<<<<<< + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) */ - if (likely(PyList_CheckExact(__pyx_v_ascii_domain)) || PyTuple_CheckExact(__pyx_v_ascii_domain)) { - __pyx_t_3 = __pyx_v_ascii_domain; __Pyx_INCREF(__pyx_t_3); - __pyx_t_8 = 0; - __pyx_t_9 = NULL; + if (likely(PyList_CheckExact(__pyx_v_parts)) || PyTuple_CheckExact(__pyx_v_parts)) { + __pyx_t_1 = __pyx_v_parts; __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ascii_domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 834, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 887, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 834, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 834, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 887, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 834, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 834, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #endif } } else { - __pyx_t_4 = __pyx_t_9(__pyx_t_3); - if (unlikely(!__pyx_t_4)) { + __pyx_t_7 = __pyx_t_6(__pyx_t_1); + if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 887, __pyx_L1_error) + else __PYX_ERR(0, 834, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); } - __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_part, __pyx_t_7); + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":835 + * numbers = [] + * for part in parts: + * result = _parse_ipv4_number(part) # <<<<<<<<<<<<<< + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): + */ + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_part}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_7); + __pyx_t_7 = 0; + + /* "w3lib/_url.pyx":836 + * for part in parts: + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) # <<<<<<<<<<<<<< + * if any(item > 255 for item in numbers[:-1]): + * raise ValueError + */ + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_numbers, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 836, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":888 - * ascii_domain = _domain_to_ascii(domain) - * for code_point in ascii_domain: - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< - * raise ValueError - * if _ends_in_number(ascii_domain): + /* "w3lib/_url.pyx":834 + * raise ValueError + * numbers = [] + * for part in parts: # <<<<<<<<<<<<<< + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 888, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(__pyx_t_1)) { + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":889 - * for code_point in ascii_domain: - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: - * raise ValueError # <<<<<<<<<<<<<< - * if _ends_in_number(ascii_domain): - * return _parse_ipv4(ascii_domain) + /* "w3lib/_url.pyx":837 + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":888 - * ascii_domain = _domain_to_ascii(domain) - * for code_point in ascii_domain: - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< - * raise ValueError - * if _ends_in_number(ascii_domain): + /* "w3lib/_url.pyx":838 + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): + * raise ValueError # <<<<<<<<<<<<<< + * if numbers[-1] >= 256 ** (5 - len(numbers)): + * raise ValueError */ - } + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 838, __pyx_L1_error) - /* "w3lib/_url.pyx":887 - * domain = unquote(input) - * ascii_domain = _domain_to_ascii(domain) - * for code_point in ascii_domain: # <<<<<<<<<<<<<< - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: - * raise ValueError + /* "w3lib/_url.pyx":837 + * result = _parse_ipv4_number(part) + * numbers.append(result[0]) + * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":890 - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: - * raise ValueError - * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< - * return _parse_ipv4(ascii_domain) - * return ascii_domain + /* "w3lib/_url.pyx":839 + * if any(item > 255 for item in numbers[:-1]): + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< + * raise ValueError + * ipv4 = numbers[-1] + */ + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyList_GET_SIZE(__pyx_v_numbers); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(pow(256.0, ((double)(5 - __pyx_t_5)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(__pyx_t_2)) { + + /* "w3lib/_url.pyx":840 + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): + * raise ValueError # <<<<<<<<<<<<<< + * ipv4 = numbers[-1] + * counter = 0 + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 840, __pyx_L1_error) + + /* "w3lib/_url.pyx":839 + * if any(item > 255 for item in numbers[:-1]): + * raise ValueError + * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< + * raise ValueError + * ipv4 = numbers[-1] */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ends_in_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 890, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { - /* "w3lib/_url.pyx":891 - * raise ValueError - * if _ends_in_number(ascii_domain): - * return _parse_ipv4(ascii_domain) # <<<<<<<<<<<<<< - * return ascii_domain - * + /* "w3lib/_url.pyx":841 + * if numbers[-1] >= 256 ** (5 - len(numbers)): + * raise ValueError + * ipv4 = numbers[-1] # <<<<<<<<<<<<<< + * counter = 0 + * for n in numbers[:-1]: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - #endif + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_ipv4 = __pyx_t_8; + __pyx_t_8 = 0; + + /* "w3lib/_url.pyx":842 + * raise ValueError + * ipv4 = numbers[-1] + * counter = 0 # <<<<<<<<<<<<<< + * for n in numbers[:-1]: + * ipv4 += n * 256 ** (3 - counter) + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_counter = __pyx_int_0; + + /* "w3lib/_url.pyx":843 + * ipv4 = numbers[-1] + * counter = 0 + * for n in numbers[:-1]: # <<<<<<<<<<<<<< + * ipv4 += n * 256 ** (3 - counter) + * counter += 1 + */ + __pyx_t_8 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 843, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); + __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + for (;;) { { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 891, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 843, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 843, __pyx_L1_error) + #else + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 843, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; - /* "w3lib/_url.pyx":890 - * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: - * raise ValueError - * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< - * return _parse_ipv4(ascii_domain) - * return ascii_domain + /* "w3lib/_url.pyx":844 + * counter = 0 + * for n in numbers[:-1]: + * ipv4 += n * 256 ** (3 - counter) # <<<<<<<<<<<<<< + * counter += 1 + * return ipv4 + */ + __pyx_t_8 = __Pyx_PyInt_SubtractCObj(__pyx_int_3, __pyx_v_counter, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyNumber_Power(__pyx_int_256, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ipv4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_ipv4, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":845 + * for n in numbers[:-1]: + * ipv4 += n * 256 ** (3 - counter) + * counter += 1 # <<<<<<<<<<<<<< + * return ipv4 + * + */ + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_counter, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_counter, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":843 + * ipv4 = numbers[-1] + * counter = 0 + * for n in numbers[:-1]: # <<<<<<<<<<<<<< + * ipv4 += n * 256 ** (3 - counter) + * counter += 1 */ } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":892 - * if _ends_in_number(ascii_domain): - * return _parse_ipv4(ascii_domain) - * return ascii_domain # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":846 + * ipv4 += n * 256 ** (3 - counter) + * counter += 1 + * return ipv4 # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_ascii_domain); - __pyx_r = __pyx_v_ascii_domain; + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_ipv4))||((__pyx_v_ipv4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_ipv4))) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_ipv4); + __pyx_r = ((PyObject*)__pyx_v_ipv4); goto __pyx_L0; - /* "w3lib/_url.pyx":874 + /* "w3lib/_url.pyx":827 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser - * def _parse_host( # <<<<<<<<<<<<<< - * input: str, - * *, + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser + * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< + * parts = input.split(".") + * if parts and not parts[-1]: */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("w3lib._url._parse_host", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("w3lib._url._parse_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_ascii_domain); - __Pyx_XDECREF(__pyx_v_code_point); + __Pyx_XDECREF(__pyx_v_parts); + __Pyx_XDECREF(__pyx_v_numbers); + __Pyx_XDECREF(__pyx_v_part); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_ipv4); + __Pyx_XDECREF(__pyx_v_counter); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":896 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter - * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< - * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" +/* "w3lib/_url.pyx":850 * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< + * result = _utr46._to_ascii( + * domain, */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_23_domain_to_ascii(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_27_is_windows_drive_letter = {"_is_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_23_domain_to_ascii = {"_domain_to_ascii", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_23_domain_to_ascii, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_23_domain_to_ascii(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_domain = 0; + PyObject *__pyx_v_be_strict = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_is_windows_drive_letter (wrapper)", 0); + __Pyx_RefNannySetupContext("_domain_to_ascii (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -13175,7 +11884,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain,&__pyx_n_s_be_strict,0}; + values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -13187,27 +11897,34 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domain)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 896, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 850, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 850, __pyx_L3_error) + } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_windows_drive_letter") < 0)) __PYX_ERR(0, 896, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_domain_to_ascii") < 0)) __PYX_ERR(0, 850, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_domain = ((PyObject*)values[0]); + __pyx_v_be_strict = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 896, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_domain_to_ascii", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 850, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13217,12 +11934,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._is_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._domain_to_ascii", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 896, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain), (&PyUnicode_Type), 0, "domain", 1))) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_22_domain_to_ascii(__pyx_self, __pyx_v_domain, __pyx_v_be_strict); /* function exit code */ goto __pyx_L0; @@ -13239,114 +11956,238 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, PyObject *__pyx_v_be_strict) { + PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - Py_UCS4 __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_UCS4 __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_is_windows_drive_letter", 1); + __Pyx_RefNannySetupContext("_domain_to_ascii", 1); - /* "w3lib/_url.pyx":897 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter - * def _is_windows_drive_letter(input: str) -> bool: - * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" # <<<<<<<<<<<<<< - * - * + /* "w3lib/_url.pyx":851 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: + * result = _utr46._to_ascii( # <<<<<<<<<<<<<< + * domain, + * use_std3_ascii_rules=be_strict, */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 897, __pyx_L1_error) - __pyx_t_3 = (__pyx_t_2 == 2); - if (__pyx_t_3) { - } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 897, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utr46); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_ascii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":852 + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: + * result = _utr46._to_ascii( + * domain, # <<<<<<<<<<<<<< + * use_std3_ascii_rules=be_strict, + * check_hyphens=False, + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_domain); + __Pyx_GIVEREF(__pyx_v_domain); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domain)) __PYX_ERR(0, 851, __pyx_L1_error); + + /* "w3lib/_url.pyx":853 + * result = _utr46._to_ascii( + * domain, + * use_std3_ascii_rules=be_strict, # <<<<<<<<<<<<<< + * check_hyphens=False, + * check_bidi=True, + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_v_be_strict) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + + /* "w3lib/_url.pyx":854 + * domain, + * use_std3_ascii_rules=be_strict, + * check_hyphens=False, # <<<<<<<<<<<<<< + * check_bidi=True, + * check_joiners=True, + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, Py_False) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + + /* "w3lib/_url.pyx":855 + * use_std3_ascii_rules=be_strict, + * check_hyphens=False, + * check_bidi=True, # <<<<<<<<<<<<<< + * check_joiners=True, + * transitional_processing=False, + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, Py_True) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + + /* "w3lib/_url.pyx":856 + * check_hyphens=False, + * check_bidi=True, + * check_joiners=True, # <<<<<<<<<<<<<< + * transitional_processing=False, + * verify_dns_length=be_strict, + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, Py_True) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + + /* "w3lib/_url.pyx":857 + * check_bidi=True, + * check_joiners=True, + * transitional_processing=False, # <<<<<<<<<<<<<< + * verify_dns_length=be_strict, + * ) + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, Py_False) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + + /* "w3lib/_url.pyx":858 + * check_joiners=True, + * transitional_processing=False, + * verify_dns_length=be_strict, # <<<<<<<<<<<<<< + * ) + * if not result: + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_v_be_strict) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + + /* "w3lib/_url.pyx":851 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: + * result = _utr46._to_ascii( # <<<<<<<<<<<<<< + * domain, + * use_std3_ascii_rules=be_strict, + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 897, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_3) { - } else { - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __pyx_t_6; - __pyx_t_6 = 0; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 897, __pyx_L1_error) - switch (__pyx_t_5) { - case 58: - case 0x7C: - __pyx_t_3 = 1; - break; - default: + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":860 + * verify_dns_length=be_strict, + * ) + * if not result: # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name {domain!r} is an empty string after conversion to " + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_6 = (!__pyx_t_5); + if (unlikely(__pyx_t_6)) { + + /* "w3lib/_url.pyx":862 + * if not result: + * raise ValueError( + * f"Domain name {domain!r} is an empty string after conversion to " # <<<<<<<<<<<<<< + * f"ASCII, which makes for an invalid domain name." + * ) + */ + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = 0; + __pyx_t_8 = 127; + __Pyx_INCREF(__pyx_kp_u_Domain_name); + __pyx_t_7 += 12; + __Pyx_GIVEREF(__pyx_kp_u_Domain_name); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Domain_name); + __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8; + __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_3 = 0; - break; + __Pyx_INCREF(__pyx_kp_u_is_an_empty_string_after_conver); + __pyx_t_7 += 86; + __Pyx_GIVEREF(__pyx_kp_u_is_an_empty_string_after_conver); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_is_an_empty_string_after_conver); + __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":861 + * ) + * if not result: + * raise ValueError( # <<<<<<<<<<<<<< + * f"Domain name {domain!r} is an empty string after conversion to " + * f"ASCII, which makes for an invalid domain name." + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 861, __pyx_L1_error) + + /* "w3lib/_url.pyx":860 + * verify_dns_length=be_strict, + * ) + * if not result: # <<<<<<<<<<<<<< + * raise ValueError( + * f"Domain name {domain!r} is an empty string after conversion to " + */ } - __pyx_t_7 = __pyx_t_3; - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __pyx_t_6; - __pyx_t_6 = 0; - __pyx_L3_bool_binop_done:; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - /* "w3lib/_url.pyx":896 + /* "w3lib/_url.pyx":865 + * f"ASCII, which makes for an invalid domain name." + * ) + * return result # <<<<<<<<<<<<<< * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter - * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< - * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyUnicode_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_result))) __PYX_ERR(0, 865, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_result); + __pyx_r = ((PyObject*)__pyx_v_result); + goto __pyx_L0; + + /* "w3lib/_url.pyx":850 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii + * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< + * result = _utr46._to_ascii( + * domain, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("w3lib._url._is_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._domain_to_ascii", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":901 +/* "w3lib/_url.pyx":869 * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter - * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< - * input_length = len(input) - * return ( + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser + * def _parse_host( # <<<<<<<<<<<<<< + * input: str, + * url: _URL, */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_25_parse_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_29_starts_with_windows_drive_letter = {"_starts_with_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_25_parse_host = {"_parse_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_25_parse_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_25_parse_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13354,17 +12195,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_url = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_starts_with_windows_drive_letter (wrapper)", 0); + __Pyx_RefNannySetupContext("_parse_host (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -13374,10 +12216,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_url,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -13390,23 +12234,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 901, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 869, __pyx_L3_error) else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 869, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_parse_host", 1, 2, 2, 1); __PYX_ERR(0, 869, __pyx_L3_error) + } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_starts_with_windows_drive_letter") < 0)) __PYX_ERR(0, 901, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_host") < 0)) __PYX_ERR(0, 869, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 1)) { + } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_url = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_starts_with_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 901, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_host", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 869, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13416,12 +12272,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._starts_with_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._parse_host", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 901, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 870, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_24_parse_host(__pyx_self, __pyx_v_input, __pyx_v_url); /* function exit code */ goto __pyx_L0; @@ -13438,566 +12294,569 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { - Py_ssize_t __pyx_v_input_length; +static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_url) { + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_ascii_domain = NULL; + PyObject *__pyx_v_code_point = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - Py_UCS4 __pyx_t_9; - int __pyx_t_10; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_starts_with_windows_drive_letter", 1); + __Pyx_RefNannySetupContext("_parse_host", 1); - /* "w3lib/_url.pyx":902 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter - * def _starts_with_windows_drive_letter(input: str) -> bool: - * input_length = len(input) # <<<<<<<<<<<<<< - * return ( - * input_length >= 2 + /* "w3lib/_url.pyx":873 + * url: _URL, + * ) -> _URL: + * if input.startswith("["): # <<<<<<<<<<<<<< + * if not input.endswith("]"): + * raise ValueError */ - __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 902, __pyx_L1_error) - __pyx_v_input_length = __pyx_t_1; + __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 873, __pyx_L1_error) + if (__pyx_t_1) { - /* "w3lib/_url.pyx":903 - * def _starts_with_windows_drive_letter(input: str) -> bool: - * input_length = len(input) - * return ( # <<<<<<<<<<<<<< - * input_length >= 2 - * and _is_windows_drive_letter(input[:2]) + /* "w3lib/_url.pyx":874 + * ) -> _URL: + * if input.startswith("["): + * if not input.endswith("]"): # <<<<<<<<<<<<<< + * raise ValueError + * url.ipv6 = _parse_ipv6(input[1:-1]) */ - __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__9, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 874, __pyx_L1_error) + __pyx_t_2 = (!__pyx_t_1); + if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":904 - * input_length = len(input) - * return ( - * input_length >= 2 # <<<<<<<<<<<<<< - * and _is_windows_drive_letter(input[:2]) - * and (input_length == 2 or input[2] in "/\\?#") + /* "w3lib/_url.pyx":875 + * if input.startswith("["): + * if not input.endswith("]"): + * raise ValueError # <<<<<<<<<<<<<< + * url.ipv6 = _parse_ipv6(input[1:-1]) + * url._host_type = IPV6 */ - __pyx_t_3 = (__pyx_v_input_length >= 2); - if (__pyx_t_3) { - } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 904, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L3_bool_binop_done; - } + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 875, __pyx_L1_error) - /* "w3lib/_url.pyx":905 - * return ( - * input_length >= 2 - * and _is_windows_drive_letter(input[:2]) # <<<<<<<<<<<<<< - * and (input_length == 2 or input[2] in "/\\?#") - * ) + /* "w3lib/_url.pyx":874 + * ) -> _URL: + * if input.startswith("["): + * if not input.endswith("]"): # <<<<<<<<<<<<<< + * raise ValueError + * url.ipv6 = _parse_ipv6(input[1:-1]) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 905, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 905, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_8 = 1; } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 905, __pyx_L1_error) - if (__pyx_t_3) { - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __Pyx_INCREF(__pyx_t_4); - __pyx_t_2 = __pyx_t_4; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L3_bool_binop_done; - } - /* "w3lib/_url.pyx":906 - * input_length >= 2 - * and _is_windows_drive_letter(input[:2]) - * and (input_length == 2 or input[2] in "/\\?#") # <<<<<<<<<<<<<< - * ) - * + /* "w3lib/_url.pyx":876 + * if not input.endswith("]"): + * raise ValueError + * url.ipv6 = _parse_ipv6(input[1:-1]) # <<<<<<<<<<<<<< + * url._host_type = IPV6 + * return url */ - __pyx_t_3 = (__pyx_v_input_length == 2); - if (!__pyx_t_3) { - } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_9 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == (Py_UCS4)-1)) __PYX_ERR(0, 906, __pyx_L1_error) - switch (__pyx_t_9) { - case 35: - case 47: - case 63: - case 92: - __pyx_t_3 = 1; - break; - default: - __pyx_t_3 = 0; - break; - } - __pyx_t_10 = __pyx_t_3; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_t_4; - __pyx_t_4 = 0; - __pyx_L3_bool_binop_done:; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "w3lib/_url.pyx":901 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter - * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< - * input_length = len(input) - * return ( - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("w3lib._url._starts_with_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "w3lib/_url.pyx":911 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment - * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< - * return input in ( - * "..", - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_31_is_double_dot_path_segment = {"_is_double_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_input = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_is_double_dot_path_segment (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 911, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_double_dot_path_segment") < 0)) __PYX_ERR(0, 911, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_input = ((PyObject*)values[0]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_double_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 911, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_ipv6, __pyx_t_3) < 0) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":877 + * raise ValueError + * url.ipv6 = _parse_ipv6(input[1:-1]) + * url._host_type = IPV6 # <<<<<<<<<<<<<< + * return url + * if url.scheme not in _SPECIAL_SCHEMES: + */ + __pyx_t_3 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_host_type, __pyx_t_3) < 0) __PYX_ERR(0, 877, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":878 + * url.ipv6 = _parse_ipv6(input[1:-1]) + * url._host_type = IPV6 + * return url # <<<<<<<<<<<<<< + * if url.scheme not in _SPECIAL_SCHEMES: + * url.hostname = _parse_opaque_host(input) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_url); + __pyx_r = __pyx_v_url; + goto __pyx_L0; + + /* "w3lib/_url.pyx":873 + * url: _URL, + * ) -> _URL: + * if input.startswith("["): # <<<<<<<<<<<<<< + * if not input.endswith("]"): + * raise ValueError + */ } - __Pyx_AddTraceback("w3lib._url._is_double_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 911, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(__pyx_self, __pyx_v_input); - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + /* "w3lib/_url.pyx":879 + * url._host_type = IPV6 + * return url + * if url.scheme not in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< + * url.hostname = _parse_opaque_host(input) + * url._host_type = HOSTNAME + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_t_4, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "w3lib/_url.pyx":880 + * return url + * if url.scheme not in _SPECIAL_SCHEMES: + * url.hostname = _parse_opaque_host(input) # <<<<<<<<<<<<<< + * url._host_type = HOSTNAME + * return url + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_parse_opaque_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; + } } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_is_double_dot_path_segment", 1); + /* "w3lib/_url.pyx":881 + * if url.scheme not in _SPECIAL_SCHEMES: + * url.hostname = _parse_opaque_host(input) + * url._host_type = HOSTNAME # <<<<<<<<<<<<<< + * return url + * domain = unquote(input) + */ + __pyx_t_4 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_HOSTNAME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_host_type, __pyx_t_4) < 0) __PYX_ERR(0, 881, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":912 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment - * def _is_double_dot_path_segment(input: str) -> bool: - * return input in ( # <<<<<<<<<<<<<< - * "..", - * ".%2e", + /* "w3lib/_url.pyx":882 + * url.hostname = _parse_opaque_host(input) + * url._host_type = HOSTNAME + * return url # <<<<<<<<<<<<<< + * domain = unquote(input) + * ascii_domain = _domain_to_ascii(domain) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_url); + __pyx_r = __pyx_v_url; + goto __pyx_L0; + + /* "w3lib/_url.pyx":879 + * url._host_type = IPV6 + * return url + * if url.scheme not in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< + * url.hostname = _parse_opaque_host(input) + * url._host_type = HOSTNAME */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_input); - __pyx_t_1 = __pyx_v_input; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; + + /* "w3lib/_url.pyx":883 + * url._host_type = HOSTNAME + * return url + * domain = unquote(input) # <<<<<<<<<<<<<< + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_unquote); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; + } } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 883, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; + __pyx_v_domain = __pyx_t_4; + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":884 + * return url + * domain = unquote(input) + * ascii_domain = _domain_to_ascii(domain) # <<<<<<<<<<<<<< + * for code_point in ascii_domain: + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_domain_to_ascii); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; + } } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_domain}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) - if (!__pyx_t_3) { + __pyx_v_ascii_domain = __pyx_t_4; + __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":885 + * domain = unquote(input) + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: # <<<<<<<<<<<<<< + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError + */ + if (likely(PyList_CheckExact(__pyx_v_ascii_domain)) || PyTuple_CheckExact(__pyx_v_ascii_domain)) { + __pyx_t_4 = __pyx_v_ascii_domain; __Pyx_INCREF(__pyx_t_4); + __pyx_t_8 = 0; + __pyx_t_9 = NULL; } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_ascii_domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 885, __pyx_L1_error) } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) - __pyx_t_2 = __pyx_t_3; - __pyx_L3_bool_binop_done:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 885, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 885, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_9(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 885, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_3); + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":911 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment - * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< - * return input in ( - * "..", + /* "w3lib/_url.pyx":886 + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< + * raise ValueError + * if _ends_in_number(ascii_domain): */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_code_point, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_t_2)) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("w3lib._url._is_double_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "w3lib/_url.pyx":887 + * for code_point in ascii_domain: + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError # <<<<<<<<<<<<<< + * if _ends_in_number(ascii_domain): + * url.ipv4 = _parse_ipv4(ascii_domain) + */ + __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); + __PYX_ERR(0, 887, __pyx_L1_error) -/* "w3lib/_url.pyx":926 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment - * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< - * return input in ( - * ".", + /* "w3lib/_url.pyx":886 + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< + * raise ValueError + * if _ends_in_number(ascii_domain): */ + } -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_33_is_single_dot_path_segment = {"_is_single_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_input = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_is_single_dot_path_segment (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 926, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_single_dot_path_segment") < 0)) __PYX_ERR(0, 926, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + /* "w3lib/_url.pyx":885 + * domain = unquote(input) + * ascii_domain = _domain_to_ascii(domain) + * for code_point in ascii_domain: # <<<<<<<<<<<<<< + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":888 + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError + * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< + * url.ipv4 = _parse_ipv4(ascii_domain) + * url._host_type = IPV4 + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ends_in_number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; } - __pyx_v_input = ((PyObject*)values[0]); } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_single_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 926, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; + #endif { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __Pyx_AddTraceback("w3lib._url._is_single_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 926, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(__pyx_self, __pyx_v_input); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 888, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + /* "w3lib/_url.pyx":889 + * raise ValueError + * if _ends_in_number(ascii_domain): + * url.ipv4 = _parse_ipv4(ascii_domain) # <<<<<<<<<<<<<< + * url._host_type = IPV4 + * return url + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_parse_ipv4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; + } } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_ipv4, __pyx_t_4) < 0) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_is_single_dot_path_segment", 1); + /* "w3lib/_url.pyx":890 + * if _ends_in_number(ascii_domain): + * url.ipv4 = _parse_ipv4(ascii_domain) + * url._host_type = IPV4 # <<<<<<<<<<<<<< + * return url + * url.hostname = ascii_domain + */ + __pyx_t_4 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_host_type, __pyx_t_4) < 0) __PYX_ERR(0, 890, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":927 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment - * def _is_single_dot_path_segment(input: str) -> bool: - * return input in ( # <<<<<<<<<<<<<< - * ".", - * "%2e", + /* "w3lib/_url.pyx":891 + * url.ipv4 = _parse_ipv4(ascii_domain) + * url._host_type = IPV4 + * return url # <<<<<<<<<<<<<< + * url.hostname = ascii_domain + * url._host_type = HOSTNAME + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_url); + __pyx_r = __pyx_v_url; + goto __pyx_L0; + + /* "w3lib/_url.pyx":888 + * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: + * raise ValueError + * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< + * url.ipv4 = _parse_ipv4(ascii_domain) + * url._host_type = IPV4 */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_input); - __pyx_t_1 = __pyx_v_input; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 927, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 927, __pyx_L1_error) - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 927, __pyx_L1_error) - __pyx_t_2 = __pyx_t_3; - __pyx_L3_bool_binop_done:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 927, __pyx_L1_error) + + /* "w3lib/_url.pyx":892 + * url._host_type = IPV4 + * return url + * url.hostname = ascii_domain # <<<<<<<<<<<<<< + * url._host_type = HOSTNAME + * return url + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_ascii_domain) < 0) __PYX_ERR(0, 892, __pyx_L1_error) + + /* "w3lib/_url.pyx":893 + * return url + * url.hostname = ascii_domain + * url._host_type = HOSTNAME # <<<<<<<<<<<<<< + * return url + * + */ + __pyx_t_4 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_HOSTNAME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_host_type, __pyx_t_4) < 0) __PYX_ERR(0, 893, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":926 + /* "w3lib/_url.pyx":894 + * url.hostname = ascii_domain + * url._host_type = HOSTNAME + * return url # <<<<<<<<<<<<<< * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment - * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< - * return input in ( - * ".", + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_url); + __pyx_r = __pyx_v_url; + goto __pyx_L0; + + /* "w3lib/_url.pyx":869 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser + * def _parse_host( # <<<<<<<<<<<<<< + * input: str, + * url: _URL, */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("w3lib._url._is_single_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("w3lib._url._parse_host", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_ascii_domain); + __Pyx_XDECREF(__pyx_v_code_point); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":937 - * # to be escaped, they are escaped in an idempotent way (i.e. if they are - * # already part of an escape sequence, they are not re-encoded). - * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< - * *, input: str, pointer: int, encode_set: _PercentEncodeSet - * ) -> str: +/* "w3lib/_url.pyx":898 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter + * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" + * */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_35_idempotent_utf_8_percent_encode = {"_idempotent_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_27_is_windows_drive_letter = {"_is_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -14005,19 +12864,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_input = 0; - PyObject *__pyx_v_pointer = 0; - PyObject *__pyx_v_encode_set = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_idempotent_utf_8_percent_encode (wrapper)", 0); + __Pyx_RefNannySetupContext("_is_windows_drive_letter (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -14027,53 +12884,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_pointer,&__pyx_n_s_encode_set,0}; - if (likely(__pyx_kwds)) { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 937, __pyx_L3_error) - else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 937, __pyx_L3_error) - } - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pointer)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 937, __pyx_L3_error) - else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_pointer); __PYX_ERR(0, 937, __pyx_L3_error) - } - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encode_set)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 937, __pyx_L3_error) - else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_encode_set); __PYX_ERR(0, 937, __pyx_L3_error) + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "_idempotent_utf_8_percent_encode") < 0)) __PYX_ERR(0, 937, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_windows_drive_letter") < 0)) __PYX_ERR(0, 898, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 0)) { + } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 937, __pyx_L3_error) + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_input = ((PyObject*)values[0]); - __pyx_v_pointer = ((PyObject*)values[1]); - __pyx_v_encode_set = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_idempotent_utf_8_percent_encode", 1, 0, 0, __pyx_nargs); __PYX_ERR(0, 937, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_is_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 898, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14083,13 +12926,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._idempotent_utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._is_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 938, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pointer), (&PyInt_Type), 0, "pointer", 1))) __PYX_ERR(0, 938, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_pointer, __pyx_v_encode_set); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 898, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -14106,254 +12948,121 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set) { - PyObject *__pyx_v_code_point = NULL; +static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + Py_ssize_t __pyx_t_2; int __pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_UCS4 __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_idempotent_utf_8_percent_encode", 1); - - /* "w3lib/_url.pyx":940 - * *, input: str, pointer: int, encode_set: _PercentEncodeSet - * ) -> str: - * code_point = input[pointer] # <<<<<<<<<<<<<< - * if code_point == "%" and "%" in encode_set: - * if ( - */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 940, __pyx_L1_error) - __pyx_v_code_point = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":941 - * ) -> str: - * code_point = input[pointer] - * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< - * if ( - * pointer + 2 >= len(input) - */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 941, __pyx_L1_error) - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__4, __pyx_v_encode_set, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 941, __pyx_L1_error) - __pyx_t_2 = __pyx_t_3; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "w3lib/_url.pyx":943 - * if code_point == "%" and "%" in encode_set: - * if ( - * pointer + 2 >= len(input) # <<<<<<<<<<<<<< - * or input[pointer + 1] not in _ASCII_HEX_DIGIT - * or input[pointer + 2] not in _ASCII_HEX_DIGIT - */ - __pyx_t_1 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 943, __pyx_L1_error) - __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 943, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 943, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 943, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L7_bool_binop_done; - } - - /* "w3lib/_url.pyx":944 - * if ( - * pointer + 2 >= len(input) - * or input[pointer + 1] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< - * or input[pointer + 2] not in _ASCII_HEX_DIGIT - * ): - */ - __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 944, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 944, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 944, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 944, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L7_bool_binop_done; - } - - /* "w3lib/_url.pyx":945 - * pointer + 2 >= len(input) - * or input[pointer + 1] not in _ASCII_HEX_DIGIT - * or input[pointer + 2] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< - * ): - * return "%25" - */ - __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 945, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 945, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 945, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 945, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_2 = __pyx_t_3; - __pyx_L7_bool_binop_done:; - - /* "w3lib/_url.pyx":942 - * code_point = input[pointer] - * if code_point == "%" and "%" in encode_set: - * if ( # <<<<<<<<<<<<<< - * pointer + 2 >= len(input) - * or input[pointer + 1] not in _ASCII_HEX_DIGIT - */ - if (__pyx_t_2) { - - /* "w3lib/_url.pyx":947 - * or input[pointer + 2] not in _ASCII_HEX_DIGIT - * ): - * return "%25" # <<<<<<<<<<<<<< - * return "%" - * return _utf_8_percent_encode(code_point, encode_set) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_kp_u_25); - __pyx_r = __pyx_kp_u_25; - goto __pyx_L0; - - /* "w3lib/_url.pyx":942 - * code_point = input[pointer] - * if code_point == "%" and "%" in encode_set: - * if ( # <<<<<<<<<<<<<< - * pointer + 2 >= len(input) - * or input[pointer + 1] not in _ASCII_HEX_DIGIT - */ - } - - /* "w3lib/_url.pyx":948 - * ): - * return "%25" - * return "%" # <<<<<<<<<<<<<< - * return _utf_8_percent_encode(code_point, encode_set) - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_kp_u__4); - __pyx_r = __pyx_kp_u__4; - goto __pyx_L0; - - /* "w3lib/_url.pyx":941 - * ) -> str: - * code_point = input[pointer] - * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< - * if ( - * pointer + 2 >= len(input) - */ - } + __Pyx_RefNannySetupContext("_is_windows_drive_letter", 1); - /* "w3lib/_url.pyx":949 - * return "%25" - * return "%" - * return _utf_8_percent_encode(code_point, encode_set) # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":899 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter + * def _is_windows_drive_letter(input: str) -> bool: + * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 == 2); + if (__pyx_t_3) { + } else { + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3_bool_binop_done; } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_code_point, __pyx_v_encode_set}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 949, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_3) { + } else { + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 899, __pyx_L1_error) + switch (__pyx_t_5) { + case 58: + case 0x7C: + __pyx_t_3 = 1; + break; + default: + __pyx_t_3 = 0; + break; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_6))) __PYX_ERR(0, 949, __pyx_L1_error) - __pyx_r = ((PyObject*)__pyx_t_6); + __pyx_t_7 = __pyx_t_3; + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":937 - * # to be escaped, they are escaped in an idempotent way (i.e. if they are - * # already part of an escape sequence, they are not re-encoded). - * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< - * *, input: str, pointer: int, encode_set: _PercentEncodeSet - * ) -> str: + /* "w3lib/_url.pyx":898 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter + * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" + * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("w3lib._url._idempotent_utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._is_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_code_point); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "w3lib/_url.pyx":952 - * - * - * def _preprocess_url(url: str) -> str: # <<<<<<<<<<<<<< - * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) +/* "w3lib/_url.pyx":903 * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter + * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * input_length = len(input) + * return ( */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_37_preprocess_url(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_37_preprocess_url = {"_preprocess_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_37_preprocess_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_37_preprocess_url(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_29_starts_with_windows_drive_letter = {"_starts_with_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_url = 0; + PyObject *__pyx_v_input = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -14364,7 +13073,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_preprocess_url (wrapper)", 0); + __Pyx_RefNannySetupContext("_starts_with_windows_drive_letter (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -14374,7 +13083,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -14386,27 +13095,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 952, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 903, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_preprocess_url") < 0)) __PYX_ERR(0, 952, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_starts_with_windows_drive_letter") < 0)) __PYX_ERR(0, 903, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_url = ((PyObject*)values[0]); + __pyx_v_input = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_preprocess_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 952, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_starts_with_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 903, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14416,12 +13125,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._preprocess_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._starts_with_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_url), (&PyUnicode_Type), 0, "url", 1))) __PYX_ERR(0, 952, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_36_preprocess_url(__pyx_self, __pyx_v_url); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 903, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -14438,147 +13147,159 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_36_preprocess_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { +static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + Py_ssize_t __pyx_v_input_length; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + int __pyx_t_3; PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + Py_UCS4 __pyx_t_9; + int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_preprocess_url", 1); + __Pyx_RefNannySetupContext("_starts_with_windows_drive_letter", 1); - /* "w3lib/_url.pyx":953 - * - * def _preprocess_url(url: str) -> str: - * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) # <<<<<<<<<<<<<< - * - * + /* "w3lib/_url.pyx":904 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter + * def _starts_with_windows_drive_letter(input: str) -> bool: + * input_length = len(input) # <<<<<<<<<<<<<< + * return ( + * input_length >= 2 + */ + __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 904, __pyx_L1_error) + __pyx_v_input_length = __pyx_t_1; + + /* "w3lib/_url.pyx":905 + * def _starts_with_windows_drive_letter(input: str) -> bool: + * input_length = len(input) + * return ( # <<<<<<<<<<<<<< + * input_length >= 2 + * and _is_windows_drive_letter(input[:2]) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_url, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_translate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":906 + * input_length = len(input) + * return ( + * input_length >= 2 # <<<<<<<<<<<<<< + * and _is_windows_drive_letter(input[:2]) + * and (input_length == 2 or input[2] in "/\\?#") + */ + __pyx_t_3 = (__pyx_v_input_length >= 2); + if (__pyx_t_3) { + } else { + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3_bool_binop_done; + } + + /* "w3lib/_url.pyx":907 + * return ( + * input_length >= 2 + * and _is_windows_drive_letter(input[:2]) # <<<<<<<<<<<<<< + * and (input_length == 2 or input[2] in "/\\?#") + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 907, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 907, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 907, __pyx_L1_error) + if (__pyx_t_3) { + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L3_bool_binop_done; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 953, __pyx_L1_error) - __pyx_r = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "w3lib/_url.pyx":952 - * - * - * def _preprocess_url(url: str) -> str: # <<<<<<<<<<<<<< - * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("w3lib._url._preprocess_url", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "w3lib/_url.pyx":956 - * - * - * def _parse_url( # <<<<<<<<<<<<<< - * input: str, - * *, - */ - -static PyObject *__pyx_pf_5w3lib_4_url_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - - /* "w3lib/_url.pyx":959 - * input: str, - * *, - * base_url: str = None, # <<<<<<<<<<<<<< - * encoding: str = "utf-8", - * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, - */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, Py_None) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, ((PyObject*)__pyx_kp_u_utf_8)) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - /* "w3lib/_url.pyx":956 - * + /* "w3lib/_url.pyx":908 + * input_length >= 2 + * and _is_windows_drive_letter(input[:2]) + * and (input_length == 2 or input[2] in "/\\?#") # <<<<<<<<<<<<<< + * ) * - * def _parse_url( # <<<<<<<<<<<<<< - * input: str, - * *, */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_userinfo_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_path_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_path_percent_encode_set) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_query_percent_encode_set) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_special_query_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_special_query_percent_encode_set) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fragment_percent_encode_set, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_fragment_percent_encode_set) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 956, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 956, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error); - __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_v_input_length == 2); + if (!__pyx_t_3) { + } else { + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_9 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == (Py_UCS4)-1)) __PYX_ERR(0, 908, __pyx_L1_error) + switch (__pyx_t_9) { + case 35: + case 47: + case 63: + case 92: + __pyx_t_3 = 1; + break; + default: + __pyx_t_3 = 0; + break; + } + __pyx_t_10 = __pyx_t_3; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; + /* "w3lib/_url.pyx":903 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter + * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * input_length = len(input) + * return ( + */ + /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("w3lib._url.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("w3lib._url._starts_with_windows_drive_letter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -14586,17 +13307,24 @@ static PyObject *__pyx_pf_5w3lib_4_url_54__defaults__(CYTHON_UNUSED PyObject *__ return __pyx_r; } +/* "w3lib/_url.pyx":913 + * + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment + * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * "..", + */ + /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_39_parse_url(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_38_parse_url, "Return a :class:`_URL` object built from *url*, *base_url* and\n *encoding*, following the URL parsing algorithm defined in the `URL living\n standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *userinfo_percent_encode_set* allows customizing which characters found\n in the user authroization part of the input URL need to be\n percent-encoded.\n "); -static PyMethodDef __pyx_mdef_5w3lib_4_url_39_parse_url = {"_parse_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_39_parse_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_38_parse_url}; -static PyObject *__pyx_pw_5w3lib_4_url_39_parse_url(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_31_is_double_dot_path_segment = {"_is_double_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -14604,24 +13332,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_input = 0; - PyObject *__pyx_v_base_url = 0; - PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_v_userinfo_percent_encode_set = 0; - PyObject *__pyx_v_path_percent_encode_set = 0; - PyObject *__pyx_v_query_percent_encode_set = 0; - PyObject *__pyx_v_special_query_percent_encode_set = 0; - PyObject *__pyx_v_fragment_percent_encode_set = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_parse_url (wrapper)", 0); + __Pyx_RefNannySetupContext("_is_double_dot_path_segment (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -14631,23 +13352,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_base_url,&__pyx_n_s_encoding,&__pyx_n_s_userinfo_percent_encode_set,&__pyx_n_s_path_percent_encode_set,&__pyx_n_s_query_percent_encode_set,&__pyx_n_s_special_query_percent_encode_set,&__pyx_n_s_fragment_percent_encode_set,0}; - __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); - - /* "w3lib/_url.pyx":959 - * input: str, - * *, - * base_url: str = None, # <<<<<<<<<<<<<< - * encoding: str = "utf-8", - * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, - */ - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None)); - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)((PyObject*)__pyx_kp_u_utf_8))); - values[3] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_userinfo_percent_encode_set); - values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_path_percent_encode_set); - values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_query_percent_encode_set); - values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_special_query_percent_encode_set); - values[7] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_fragment_percent_encode_set); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -14663,20 +13368,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 956, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 913, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } - if (kw_args > 0 && likely(kw_args <= 7)) { - Py_ssize_t index; - for (index = 1; index < 8 && kw_args > 0; index++) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); - if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 956, __pyx_L3_error) - } - } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_url") < 0)) __PYX_ERR(0, 956, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_double_dot_path_segment") < 0)) __PYX_ERR(0, 913, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -14684,17 +13381,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_input = ((PyObject*)values[0]); - __pyx_v_base_url = ((PyObject*)values[1]); - __pyx_v_encoding = ((PyObject*)values[2]); - __pyx_v_userinfo_percent_encode_set = values[3]; - __pyx_v_path_percent_encode_set = values[4]; - __pyx_v_query_percent_encode_set = values[5]; - __pyx_v_special_query_percent_encode_set = values[6]; - __pyx_v_fragment_percent_encode_set = values[7]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 956, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_is_double_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 913, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14704,22 +13394,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("w3lib._url._is_double_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 957, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_base_url), (&PyUnicode_Type), 1, "base_url", 1))) __PYX_ERR(0, 959, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 960, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_38_parse_url(__pyx_self, __pyx_v_input, __pyx_v_base_url, __pyx_v_encoding, __pyx_v_userinfo_percent_encode_set, __pyx_v_path_percent_encode_set, __pyx_v_query_percent_encode_set, __pyx_v_special_query_percent_encode_set, __pyx_v_fragment_percent_encode_set); - - /* "w3lib/_url.pyx":956 - * - * - * def _parse_url( # <<<<<<<<<<<<<< - * input: str, - * *, - */ + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -14736,1784 +13416,1895 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_base_url, PyObject *__pyx_v_encoding, PyObject *__pyx_v_userinfo_percent_encode_set, PyObject *__pyx_v_path_percent_encode_set, PyObject *__pyx_v_query_percent_encode_set, PyObject *__pyx_v_special_query_percent_encode_set, PyObject *__pyx_v_fragment_percent_encode_set) { - PyObject *__pyx_v_base = NULL; - PyObject *__pyx_v_url = NULL; - unsigned char __pyx_v_state; - PyObject *__pyx_v_buffer = NULL; - int __pyx_v_at_sign_seen; - int __pyx_v_inside_brackets; - int __pyx_v_skip_authority_shortcut; - PyObject *__pyx_v_pointer = NULL; - Py_ssize_t __pyx_v_input_length; - int __pyx_v_reached_end; - PyObject *__pyx_v_c = 0; - PyObject *__pyx_v_at_sign_index = NULL; - PyObject *__pyx_v_i = NULL; - PyObject *__pyx_v_code_point = NULL; - PyObject *__pyx_v_encoded_code_points = NULL; - PyObject *__pyx_v_host = NULL; - PyObject *__pyx_v_port = NULL; - PyObject *__pyx_v_encoded = NULL; - PyObject *__pyx_v_percent_encode_set = NULL; +static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - Py_ssize_t __pyx_t_7; - int __pyx_t_8; - Py_ssize_t __pyx_t_9; - PyObject *(*__pyx_t_10)(PyObject *); - int __pyx_t_11; - PyObject *__pyx_t_12 = NULL; - int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_url", 0); - __Pyx_INCREF(__pyx_v_input); - __Pyx_INCREF(__pyx_v_encoding); - - /* "w3lib/_url.pyx":992 - * # output can match the original parsed URL if desired. - * - * if base_url is not None: # <<<<<<<<<<<<<< - * base = _parse_url(base_url, encoding=encoding) - * else: - */ - __pyx_t_1 = (__pyx_v_base_url != ((PyObject*)Py_None)); - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":993 - * - * if base_url is not None: - * base = _parse_url(base_url, encoding=encoding) # <<<<<<<<<<<<<< - * else: - * base = None - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 993, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 993, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_base_url); - __Pyx_GIVEREF(__pyx_v_base_url); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_base_url)) __PYX_ERR(0, 993, __pyx_L1_error); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 993, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 993, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_base = __pyx_t_5; - __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":992 - * # output can match the original parsed URL if desired. - * - * if base_url is not None: # <<<<<<<<<<<<<< - * base = _parse_url(base_url, encoding=encoding) - * else: - */ - goto __pyx_L3; - } - - /* "w3lib/_url.pyx":995 - * base = _parse_url(base_url, encoding=encoding) - * else: - * base = None # <<<<<<<<<<<<<< - * encoding = _get_output_encoding(encoding) - * - */ - /*else*/ { - __Pyx_INCREF(Py_None); - __pyx_v_base = Py_None; - } - __pyx_L3:; - - /* "w3lib/_url.pyx":996 - * else: - * base = None - * encoding = _get_output_encoding(encoding) # <<<<<<<<<<<<<< - * - * url = _URL() - */ - __pyx_t_5 = __pyx_f_5w3lib_4_url__get_output_encoding(__pyx_v_encoding); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 996, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_encoding, ((PyObject*)__pyx_t_5)); - __pyx_t_5 = 0; + __Pyx_RefNannySetupContext("_is_double_dot_path_segment", 1); - /* "w3lib/_url.pyx":998 - * encoding = _get_output_encoding(encoding) - * - * url = _URL() # <<<<<<<<<<<<<< - * state = SCHEME_START - * buffer = "" + /* "w3lib/_url.pyx":914 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment + * def _is_double_dot_path_segment(input: str) -> bool: + * return input in ( # <<<<<<<<<<<<<< + * "..", + * ".%2e", */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_URL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 998, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_input); + __pyx_t_1 = __pyx_v_input; + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 998, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; } - __pyx_v_url = __pyx_t_5; - __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":999 - * - * url = _URL() - * state = SCHEME_START # <<<<<<<<<<<<<< - * buffer = "" - * at_sign_seen = inside_brackets = skip_authority_shortcut = False - */ - __pyx_v_state = __pyx_v_5w3lib_4_url_SCHEME_START; - - /* "w3lib/_url.pyx":1000 - * url = _URL() - * state = SCHEME_START - * buffer = "" # <<<<<<<<<<<<<< - * at_sign_seen = inside_brackets = skip_authority_shortcut = False - * pointer = 0 - */ - __Pyx_INCREF(__pyx_kp_u__2); - __pyx_v_buffer = __pyx_kp_u__2; - - /* "w3lib/_url.pyx":1001 - * state = SCHEME_START - * buffer = "" - * at_sign_seen = inside_brackets = skip_authority_shortcut = False # <<<<<<<<<<<<<< - * pointer = 0 - * - */ - __pyx_v_at_sign_seen = 0; - __pyx_v_inside_brackets = 0; - __pyx_v_skip_authority_shortcut = 0; - - /* "w3lib/_url.pyx":1002 - * buffer = "" - * at_sign_seen = inside_brackets = skip_authority_shortcut = False - * pointer = 0 # <<<<<<<<<<<<<< - * - * input = _preprocess_url(input) - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_pointer = __pyx_int_0; - - /* "w3lib/_url.pyx":1004 - * pointer = 0 - * - * input = _preprocess_url(input) # <<<<<<<<<<<<<< - * input_length = len(input) - * - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_preprocess_url); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_input}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 1004, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_5)); - __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":1005 - * - * input = _preprocess_url(input) - * input_length = len(input) # <<<<<<<<<<<<<< - * - * while True: - */ - if (unlikely(__pyx_v_input == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; } - __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1005, __pyx_L1_error) - __pyx_v_input_length = __pyx_t_7; - - /* "w3lib/_url.pyx":1007 - * input_length = len(input) - * - * while True: # <<<<<<<<<<<<<< - * reached_end: bint = pointer >= input_length - * if not reached_end: - */ - while (1) { - - /* "w3lib/_url.pyx":1008 - * - * while True: - * reached_end: bint = pointer >= input_length # <<<<<<<<<<<<<< - * if not reached_end: - * c: str = input[pointer] - */ - __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1008, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1008, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1008, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_reached_end = __pyx_t_1; - - /* "w3lib/_url.pyx":1009 - * while True: - * reached_end: bint = pointer >= input_length - * if not reached_end: # <<<<<<<<<<<<<< - * c: str = input[pointer] - * - */ - __pyx_t_1 = (!__pyx_v_reached_end); - if (__pyx_t_1) { + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_2 = __pyx_t_3; + __pyx_L3_bool_binop_done:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; - /* "w3lib/_url.pyx":1010 - * reached_end: bint = pointer >= input_length - * if not reached_end: - * c: str = input[pointer] # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":913 * - * if state == SCHEME_START: + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment + * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * "..", */ - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1010, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 1010, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_c, ((PyObject*)__pyx_t_4)); - __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1009 - * while True: - * reached_end: bint = pointer >= input_length - * if not reached_end: # <<<<<<<<<<<<<< - * c: str = input[pointer] - * - */ - } + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._url._is_double_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":1012 - * c: str = input[pointer] +/* "w3lib/_url.pyx":928 * - * if state == SCHEME_START: # <<<<<<<<<<<<<< - * if not reached_end and c in _ASCII_ALPHA: - * buffer += c + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment + * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * ".", */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SCHEME_START); - if (__pyx_t_1) { - /* "w3lib/_url.pyx":1013 - * - * if state == SCHEME_START: - * if not reached_end and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< - * buffer += c - * state = SCHEME - */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { - } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L9_bool_binop_done; +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_33_is_single_dot_path_segment = {"_is_single_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_is_single_dot_path_segment (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1013, __pyx_L1_error) } - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1013, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1013, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __pyx_t_8; - __pyx_L9_bool_binop_done:; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":1014 - * if state == SCHEME_START: - * if not reached_end and c in _ASCII_ALPHA: - * buffer += c # <<<<<<<<<<<<<< - * state = SCHEME - * else: - */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1014, __pyx_L1_error) } - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); - __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":1015 - * if not reached_end and c in _ASCII_ALPHA: - * buffer += c - * state = SCHEME # <<<<<<<<<<<<<< - * else: - * state = NO_SCHEME - */ - __pyx_v_state = __pyx_v_5w3lib_4_url_SCHEME; - - /* "w3lib/_url.pyx":1013 - * - * if state == SCHEME_START: - * if not reached_end and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< - * buffer += c - * state = SCHEME - */ - goto __pyx_L8; + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 928, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; } - - /* "w3lib/_url.pyx":1017 - * state = SCHEME - * else: - * state = NO_SCHEME # <<<<<<<<<<<<<< - * pointer -= 1 - * - */ - /*else*/ { - __pyx_v_state = __pyx_v_5w3lib_4_url_NO_SCHEME; - - /* "w3lib/_url.pyx":1018 - * else: - * state = NO_SCHEME - * pointer -= 1 # <<<<<<<<<<<<<< - * - * elif state == SCHEME: - */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1018, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_single_dot_path_segment") < 0)) __PYX_ERR(0, 928, __pyx_L3_error) } - __pyx_L8:; - - /* "w3lib/_url.pyx":1012 - * c: str = input[pointer] - * - * if state == SCHEME_START: # <<<<<<<<<<<<<< - * if not reached_end and c in _ASCII_ALPHA: - * buffer += c - */ - goto __pyx_L7; + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } + __pyx_v_input = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_is_single_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 928, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._is_single_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 928, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(__pyx_self, __pyx_v_input); - /* "w3lib/_url.pyx":1020 - * pointer -= 1 - * - * elif state == SCHEME: # <<<<<<<<<<<<<< - * if not reached_end and c in _SCHEME_CHARS: - * buffer += c - */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SCHEME); - if (__pyx_t_1) { + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":1021 - * - * elif state == SCHEME: - * if not reached_end and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< - * buffer += c - * elif not reached_end and c == ":": - */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { - } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L12_bool_binop_done; - } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1021, __pyx_L1_error) } - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SCHEME_CHARS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1021, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1021, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __pyx_t_8; - __pyx_L12_bool_binop_done:; - if (__pyx_t_1) { +static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_single_dot_path_segment", 1); - /* "w3lib/_url.pyx":1022 - * elif state == SCHEME: - * if not reached_end and c in _SCHEME_CHARS: - * buffer += c # <<<<<<<<<<<<<< - * elif not reached_end and c == ":": - * url.scheme = buffer.lower() + /* "w3lib/_url.pyx":929 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment + * def _is_single_dot_path_segment(input: str) -> bool: + * return input in ( # <<<<<<<<<<<<<< + * ".", + * "%2e", */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1022, __pyx_L1_error) } - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_input); + __pyx_t_1 = __pyx_v_input; + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 929, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 929, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_2 = __pyx_t_3; + __pyx_L3_bool_binop_done:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; - /* "w3lib/_url.pyx":1021 + /* "w3lib/_url.pyx":928 * - * elif state == SCHEME: - * if not reached_end and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< - * buffer += c - * elif not reached_end and c == ":": + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment + * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * return input in ( + * ".", */ - goto __pyx_L11; - } - /* "w3lib/_url.pyx":1023 - * if not reached_end and c in _SCHEME_CHARS: - * buffer += c - * elif not reached_end and c == ":": # <<<<<<<<<<<<<< - * url.scheme = buffer.lower() - * buffer = "" + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._url._is_single_dot_path_segment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "w3lib/_url.pyx":939 + * # to be escaped, they are escaped in an idempotent way (i.e. if they are + * # already part of an escape sequence, they are not re-encoded). + * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * *, input: str, pointer: int, encode_set: _PercentEncodeSet + * ) -> str: */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { - } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L14_bool_binop_done; + +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_35_idempotent_utf_8_percent_encode = {"_idempotent_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_pointer = 0; + PyObject *__pyx_v_encode_set = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_idempotent_utf_8_percent_encode (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_pointer,&__pyx_n_s_encode_set,0}; + if (likely(__pyx_kwds)) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 939, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 939, __pyx_L3_error) + } + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pointer)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 939, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_pointer); __PYX_ERR(0, 939, __pyx_L3_error) + } + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encode_set)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1023, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1023, __pyx_L1_error) - __pyx_t_1 = __pyx_t_8; - __pyx_L14_bool_binop_done:; - if (__pyx_t_1) { + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 939, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_encode_set); __PYX_ERR(0, 939, __pyx_L3_error) + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "_idempotent_utf_8_percent_encode") < 0)) __PYX_ERR(0, 939, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 0)) { + goto __pyx_L5_argtuple_error; + } else { + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 939, __pyx_L3_error) + } + __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_pointer = ((PyObject*)values[1]); + __pyx_v_encode_set = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_idempotent_utf_8_percent_encode", 1, 0, 0, __pyx_nargs); __PYX_ERR(0, 939, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._idempotent_utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 940, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pointer), (&PyInt_Type), 0, "pointer", 1))) __PYX_ERR(0, 940, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_pointer, __pyx_v_encode_set); - /* "w3lib/_url.pyx":1024 - * buffer += c - * elif not reached_end and c == ":": - * url.scheme = buffer.lower() # <<<<<<<<<<<<<< - * buffer = "" - * if url.scheme == "file": - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_buffer, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_4) < 0) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":1025 - * elif not reached_end and c == ":": - * url.scheme = buffer.lower() - * buffer = "" # <<<<<<<<<<<<<< - * if url.scheme == "file": - * state = FILE +static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set) { + PyObject *__pyx_v_code_point = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_idempotent_utf_8_percent_encode", 1); + + /* "w3lib/_url.pyx":942 + * *, input: str, pointer: int, encode_set: _PercentEncodeSet + * ) -> str: + * code_point = input[pointer] # <<<<<<<<<<<<<< + * if code_point == "%" and "%" in encode_set: + * if ( */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_v_code_point = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1026 - * url.scheme = buffer.lower() - * buffer = "" - * if url.scheme == "file": # <<<<<<<<<<<<<< - * state = FILE - * elif url.is_special: + /* "w3lib/_url.pyx":943 + * ) -> str: + * code_point = input[pointer] + * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< + * if ( + * pointer + 2 >= len(input) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_1) { + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 943, __pyx_L1_error) + if (__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__4, __pyx_v_encode_set, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { - /* "w3lib/_url.pyx":1027 - * buffer = "" - * if url.scheme == "file": - * state = FILE # <<<<<<<<<<<<<< - * elif url.is_special: - * if base is not None and base.scheme == url.scheme: + /* "w3lib/_url.pyx":945 + * if code_point == "%" and "%" in encode_set: + * if ( + * pointer + 2 >= len(input) # <<<<<<<<<<<<<< + * or input[pointer + 1] not in _ASCII_HEX_DIGIT + * or input[pointer + 2] not in _ASCII_HEX_DIGIT */ - __pyx_v_state = __pyx_v_5w3lib_4_url_FILE; + __pyx_t_1 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 945, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 945, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 945, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 945, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L7_bool_binop_done; + } - /* "w3lib/_url.pyx":1026 - * url.scheme = buffer.lower() - * buffer = "" - * if url.scheme == "file": # <<<<<<<<<<<<<< - * state = FILE - * elif url.is_special: + /* "w3lib/_url.pyx":946 + * if ( + * pointer + 2 >= len(input) + * or input[pointer + 1] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * or input[pointer + 2] not in _ASCII_HEX_DIGIT + * ): */ - goto __pyx_L16; - } + __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 946, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L7_bool_binop_done; + } - /* "w3lib/_url.pyx":1028 - * if url.scheme == "file": - * state = FILE - * elif url.is_special: # <<<<<<<<<<<<<< - * if base is not None and base.scheme == url.scheme: - * state = SPECIAL_RELATIVE_OR_AUTHORITY + /* "w3lib/_url.pyx":947 + * pointer + 2 >= len(input) + * or input[pointer + 1] not in _ASCII_HEX_DIGIT + * or input[pointer + 2] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * ): + * return "%25" */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1028, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1028, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_1) { + __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 947, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __pyx_t_3; + __pyx_L7_bool_binop_done:; - /* "w3lib/_url.pyx":1029 - * state = FILE - * elif url.is_special: - * if base is not None and base.scheme == url.scheme: # <<<<<<<<<<<<<< - * state = SPECIAL_RELATIVE_OR_AUTHORITY - * else: - */ - __pyx_t_8 = (__pyx_v_base != Py_None); - if (__pyx_t_8) { - } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L18_bool_binop_done; - } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_8; - __pyx_L18_bool_binop_done:; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":1030 - * elif url.is_special: - * if base is not None and base.scheme == url.scheme: - * state = SPECIAL_RELATIVE_OR_AUTHORITY # <<<<<<<<<<<<<< - * else: - * state = SPECIAL_AUTHORITY_SLASHES + /* "w3lib/_url.pyx":944 + * code_point = input[pointer] + * if code_point == "%" and "%" in encode_set: + * if ( # <<<<<<<<<<<<<< + * pointer + 2 >= len(input) + * or input[pointer + 1] not in _ASCII_HEX_DIGIT */ - __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_RELATIVE_OR_AUTHORITY; + if (__pyx_t_2) { - /* "w3lib/_url.pyx":1029 - * state = FILE - * elif url.is_special: - * if base is not None and base.scheme == url.scheme: # <<<<<<<<<<<<<< - * state = SPECIAL_RELATIVE_OR_AUTHORITY - * else: + /* "w3lib/_url.pyx":949 + * or input[pointer + 2] not in _ASCII_HEX_DIGIT + * ): + * return "%25" # <<<<<<<<<<<<<< + * return "%" + * return _utf_8_percent_encode(code_point, encode_set) */ - goto __pyx_L17; - } + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_u_25); + __pyx_r = __pyx_kp_u_25; + goto __pyx_L0; - /* "w3lib/_url.pyx":1032 - * state = SPECIAL_RELATIVE_OR_AUTHORITY - * else: - * state = SPECIAL_AUTHORITY_SLASHES # <<<<<<<<<<<<<< - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": - * state = PATH_OR_AUTHORITY + /* "w3lib/_url.pyx":944 + * code_point = input[pointer] + * if code_point == "%" and "%" in encode_set: + * if ( # <<<<<<<<<<<<<< + * pointer + 2 >= len(input) + * or input[pointer + 1] not in _ASCII_HEX_DIGIT */ - /*else*/ { - __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES; - } - __pyx_L17:; + } - /* "w3lib/_url.pyx":1028 - * if url.scheme == "file": - * state = FILE - * elif url.is_special: # <<<<<<<<<<<<<< - * if base is not None and base.scheme == url.scheme: - * state = SPECIAL_RELATIVE_OR_AUTHORITY + /* "w3lib/_url.pyx":950 + * ): + * return "%25" + * return "%" # <<<<<<<<<<<<<< + * return _utf_8_percent_encode(code_point, encode_set) + * */ - goto __pyx_L16; - } + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_u__4); + __pyx_r = __pyx_kp_u__4; + goto __pyx_L0; - /* "w3lib/_url.pyx":1033 - * else: - * state = SPECIAL_AUTHORITY_SLASHES - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< - * state = PATH_OR_AUTHORITY - * pointer += 1 + /* "w3lib/_url.pyx":943 + * ) -> str: + * code_point = input[pointer] + * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< + * if ( + * pointer + 2 >= len(input) */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__pyx_v_input == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1033, __pyx_L1_error) - } - __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1033, __pyx_L1_error) - __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L20_bool_binop_done; - } - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = __pyx_t_8; - __pyx_L20_bool_binop_done:; - if (__pyx_t_1) { + } - /* "w3lib/_url.pyx":1034 - * state = SPECIAL_AUTHORITY_SLASHES - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": - * state = PATH_OR_AUTHORITY # <<<<<<<<<<<<<< - * pointer += 1 - * else: + /* "w3lib/_url.pyx":951 + * return "%25" + * return "%" + * return _utf_8_percent_encode(code_point, encode_set) # <<<<<<<<<<<<<< + * + * */ - __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY; + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_code_point, __pyx_v_encode_set}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_6))) __PYX_ERR(0, 951, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L0; - /* "w3lib/_url.pyx":1035 - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": - * state = PATH_OR_AUTHORITY - * pointer += 1 # <<<<<<<<<<<<<< - * else: - * url.path = "" + /* "w3lib/_url.pyx":939 + * # to be escaped, they are escaped in an idempotent way (i.e. if they are + * # already part of an escape sequence, they are not re-encoded). + * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< + * *, input: str, pointer: int, encode_set: _PercentEncodeSet + * ) -> str: */ - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_5); - __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1033 - * else: - * state = SPECIAL_AUTHORITY_SLASHES - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< - * state = PATH_OR_AUTHORITY - * pointer += 1 - */ - goto __pyx_L16; - } + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("w3lib._url._idempotent_utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_code_point); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":1037 - * pointer += 1 - * else: - * url.path = "" # <<<<<<<<<<<<<< - * state = OPAQUE_PATH - * else: +/* "w3lib/_url.pyx":954 + * + * + * def _preprocess_url(url: str) -> str: # <<<<<<<<<<<<<< + * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) + * */ - /*else*/ { - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1037, __pyx_L1_error) - /* "w3lib/_url.pyx":1038 - * else: - * url.path = "" - * state = OPAQUE_PATH # <<<<<<<<<<<<<< - * else: - * buffer = "" - */ - __pyx_v_state = __pyx_v_5w3lib_4_url_OPAQUE_PATH; +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_37_preprocess_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_37_preprocess_url = {"_preprocess_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_37_preprocess_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_37_preprocess_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_url = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_preprocess_url (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; } - __pyx_L16:; - - /* "w3lib/_url.pyx":1023 - * if not reached_end and c in _SCHEME_CHARS: - * buffer += c - * elif not reached_end and c == ":": # <<<<<<<<<<<<<< - * url.scheme = buffer.lower() - * buffer = "" - */ - goto __pyx_L11; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 954, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_preprocess_url") < 0)) __PYX_ERR(0, 954, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_url = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_preprocess_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 954, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._preprocess_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_url), (&PyUnicode_Type), 0, "url", 1))) __PYX_ERR(0, 954, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_36_preprocess_url(__pyx_self, __pyx_v_url); - /* "w3lib/_url.pyx":1040 - * state = OPAQUE_PATH - * else: - * buffer = "" # <<<<<<<<<<<<<< - * state = NO_SCHEME - * pointer = -1 - */ - /*else*/ { - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":1041 - * else: - * buffer = "" - * state = NO_SCHEME # <<<<<<<<<<<<<< - * pointer = -1 - * - */ - __pyx_v_state = __pyx_v_5w3lib_4_url_NO_SCHEME; +static PyObject *__pyx_pf_5w3lib_4_url_36_preprocess_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_preprocess_url", 1); - /* "w3lib/_url.pyx":1042 - * buffer = "" - * state = NO_SCHEME - * pointer = -1 # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":955 + * + * def _preprocess_url(url: str) -> str: + * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) # <<<<<<<<<<<<<< * - * elif state == NO_SCHEME: - */ - __Pyx_INCREF(__pyx_int_neg_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_int_neg_1); - } - __pyx_L11:; - - /* "w3lib/_url.pyx":1020 - * pointer -= 1 * - * elif state == SCHEME: # <<<<<<<<<<<<<< - * if not reached_end and c in _SCHEME_CHARS: - * buffer += c */ - goto __pyx_L7; + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_url, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_translate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; - /* "w3lib/_url.pyx":1044 - * pointer = -1 + /* "w3lib/_url.pyx":954 * - * elif state == NO_SCHEME: # <<<<<<<<<<<<<< - * if base is None: - * raise ValueError - */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_NO_SCHEME); - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":1045 * - * elif state == NO_SCHEME: - * if base is None: # <<<<<<<<<<<<<< - * raise ValueError - * if base.has_opaque_path(): + * def _preprocess_url(url: str) -> str: # <<<<<<<<<<<<<< + * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) + * */ - __pyx_t_1 = (__pyx_v_base == Py_None); - if (unlikely(__pyx_t_1)) { - /* "w3lib/_url.pyx":1046 - * elif state == NO_SCHEME: - * if base is None: - * raise ValueError # <<<<<<<<<<<<<< - * if base.has_opaque_path(): - * if not reached_end and c != "#": - */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1046, __pyx_L1_error) + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("w3lib._url._preprocess_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":1045 +/* "w3lib/_url.pyx":958 * - * elif state == NO_SCHEME: - * if base is None: # <<<<<<<<<<<<<< - * raise ValueError - * if base.has_opaque_path(): + * + * def _parse_url( # <<<<<<<<<<<<<< + * input: str, + * encoding: str = "utf-8", */ - } - /* "w3lib/_url.pyx":1047 - * if base is None: - * raise ValueError - * if base.has_opaque_path(): # <<<<<<<<<<<<<< - * if not reached_end and c != "#": - * raise ValueError - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1047, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_39_parse_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_38_parse_url, "Return a :class:`_URL` object built from *url* and *encoding*, following\n the URL parsing algorithm defined in the `URL living standard`_, with\n additional logic to support older standards as well.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing\n "); +static PyMethodDef __pyx_mdef_5w3lib_4_url_39_parse_url = {"_parse_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_39_parse_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_38_parse_url}; +static PyObject *__pyx_pw_5w3lib_4_url_39_parse_url(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_encoding = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_parse_url (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_encoding,0}; + values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)((PyObject*)__pyx_kp_u_utf_8))); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 958, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding); + if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 958, __pyx_L3_error) } } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1047, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_url") < 0)) __PYX_ERR(0, 958, __pyx_L3_error) } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1047, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":1048 - * raise ValueError - * if base.has_opaque_path(): - * if not reached_end and c != "#": # <<<<<<<<<<<<<< - * raise ValueError - * url.scheme = base.scheme - */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { - } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L25_bool_binop_done; - } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1048, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1048, __pyx_L1_error) - __pyx_t_1 = __pyx_t_8; - __pyx_L25_bool_binop_done:; - if (unlikely(__pyx_t_1)) { - - /* "w3lib/_url.pyx":1049 - * if base.has_opaque_path(): - * if not reached_end and c != "#": - * raise ValueError # <<<<<<<<<<<<<< - * url.scheme = base.scheme - * url.path = base.path - */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1049, __pyx_L1_error) - - /* "w3lib/_url.pyx":1048 - * raise ValueError - * if base.has_opaque_path(): - * if not reached_end and c != "#": # <<<<<<<<<<<<<< - * raise ValueError - * url.scheme = base.scheme - */ - } - - /* "w3lib/_url.pyx":1050 - * if not reached_end and c != "#": - * raise ValueError - * url.scheme = base.scheme # <<<<<<<<<<<<<< - * url.path = base.path - * url.query = base.query - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1050, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_5) < 0) __PYX_ERR(0, 1050, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":1051 - * raise ValueError - * url.scheme = base.scheme - * url.path = base.path # <<<<<<<<<<<<<< - * url.query = base.query - * url.fragment = "" - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_5) < 0) __PYX_ERR(0, 1051, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_encoding = ((PyObject*)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_parse_url", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 958, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 959, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_38_parse_url(__pyx_self, __pyx_v_input, __pyx_v_encoding); - /* "w3lib/_url.pyx":1052 - * url.scheme = base.scheme - * url.path = base.path - * url.query = base.query # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_5) < 0) __PYX_ERR(0, 1052, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "w3lib/_url.pyx":1053 - * url.path = base.path - * url.query = base.query - * url.fragment = "" # <<<<<<<<<<<<<< - * state = FRAGMENT - * else: - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1053, __pyx_L1_error) +static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding) { + PyObject *__pyx_v_url = NULL; + unsigned char __pyx_v_state; + PyObject *__pyx_v_buffer = NULL; + int __pyx_v_at_sign_seen; + int __pyx_v_inside_brackets; + int __pyx_v_skip_authority_shortcut; + PyObject *__pyx_v_pointer = NULL; + Py_ssize_t __pyx_v_input_length; + int __pyx_v_reached_end; + PyObject *__pyx_v_c = 0; + PyObject *__pyx_v_at_sign_index = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_code_point = NULL; + PyObject *__pyx_v_encoded_code_points = NULL; + int __pyx_v_port; + PyObject *__pyx_v_encoded = NULL; + PyObject *__pyx_v_percent_encode_set = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_UCS4 __pyx_t_13; + int __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_url", 0); + __Pyx_INCREF(__pyx_v_input); + __Pyx_INCREF(__pyx_v_encoding); - /* "w3lib/_url.pyx":1054 - * url.query = base.query - * url.fragment = "" - * state = FRAGMENT # <<<<<<<<<<<<<< - * else: - * if base.scheme != "file": + /* "w3lib/_url.pyx":979 + * # explicitly an empty string (e.g. ``a://a:@example.com``), so that its + * # output can match the original parsed URL if desired. + * encoding = _get_output_encoding(encoding) # <<<<<<<<<<<<<< + * + * url = _URL() */ - __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; + __pyx_t_1 = __pyx_f_5w3lib_4_url__get_output_encoding(__pyx_v_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_encoding, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1047 - * if base is None: - * raise ValueError - * if base.has_opaque_path(): # <<<<<<<<<<<<<< - * if not reached_end and c != "#": - * raise ValueError + /* "w3lib/_url.pyx":981 + * encoding = _get_output_encoding(encoding) + * + * url = _URL() # <<<<<<<<<<<<<< + * url.path = [] + * state = SCHEME_START */ - goto __pyx_L23; - } + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_URL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_v_url = __pyx_t_1; + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1056 - * state = FRAGMENT - * else: - * if base.scheme != "file": # <<<<<<<<<<<<<< - * state = RELATIVE - * else: + /* "w3lib/_url.pyx":982 + * + * url = _URL() + * url.path = [] # <<<<<<<<<<<<<< + * state = SCHEME_START + * buffer = "" */ - /*else*/ { - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1056, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_n_u_file, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1056, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_1) { + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 982, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1057 - * else: - * if base.scheme != "file": - * state = RELATIVE # <<<<<<<<<<<<<< - * else: - * state = FILE + /* "w3lib/_url.pyx":983 + * url = _URL() + * url.path = [] + * state = SCHEME_START # <<<<<<<<<<<<<< + * buffer = "" + * at_sign_seen = inside_brackets = skip_authority_shortcut = False */ - __pyx_v_state = __pyx_v_5w3lib_4_url_RELATIVE; + __pyx_v_state = __pyx_v_5w3lib_4_url_SCHEME_START; - /* "w3lib/_url.pyx":1056 - * state = FRAGMENT - * else: - * if base.scheme != "file": # <<<<<<<<<<<<<< - * state = RELATIVE - * else: + /* "w3lib/_url.pyx":984 + * url.path = [] + * state = SCHEME_START + * buffer = "" # <<<<<<<<<<<<<< + * at_sign_seen = inside_brackets = skip_authority_shortcut = False + * pointer = 0 */ - goto __pyx_L27; - } + __Pyx_INCREF(__pyx_kp_u_); + __pyx_v_buffer = __pyx_kp_u_; - /* "w3lib/_url.pyx":1059 - * state = RELATIVE - * else: - * state = FILE # <<<<<<<<<<<<<< - * pointer -= 1 + /* "w3lib/_url.pyx":985 + * state = SCHEME_START + * buffer = "" + * at_sign_seen = inside_brackets = skip_authority_shortcut = False # <<<<<<<<<<<<<< + * pointer = 0 * */ - /*else*/ { - __pyx_v_state = __pyx_v_5w3lib_4_url_FILE; - } - __pyx_L27:; + __pyx_v_at_sign_seen = 0; + __pyx_v_inside_brackets = 0; + __pyx_v_skip_authority_shortcut = 0; - /* "w3lib/_url.pyx":1060 - * else: - * state = FILE - * pointer -= 1 # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":986 + * buffer = "" + * at_sign_seen = inside_brackets = skip_authority_shortcut = False + * pointer = 0 # <<<<<<<<<<<<<< * - * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: + * input = _preprocess_url(input) */ - __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1060, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_5); - __pyx_t_5 = 0; - } - __pyx_L23:; + __Pyx_INCREF(__pyx_int_0); + __pyx_v_pointer = __pyx_int_0; - /* "w3lib/_url.pyx":1044 - * pointer = -1 + /* "w3lib/_url.pyx":988 + * pointer = 0 + * + * input = _preprocess_url(input) # <<<<<<<<<<<<<< + * input_length = len(input) * - * elif state == NO_SCHEME: # <<<<<<<<<<<<<< - * if base is None: - * raise ValueError */ - goto __pyx_L7; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_preprocess_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 988, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_input}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 988, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1062 - * pointer -= 1 + /* "w3lib/_url.pyx":989 * - * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< - * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_RELATIVE_OR_AUTHORITY); - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":1063 + * input = _preprocess_url(input) + * input_length = len(input) # <<<<<<<<<<<<<< * - * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: - * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * pointer += 1 - */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { - } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L29_bool_binop_done; - } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1063, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1063, __pyx_L1_error) - if (__pyx_t_8) { - } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L29_bool_binop_done; - } - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1063, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1063, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1063, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_8) { - } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L29_bool_binop_done; - } - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1063, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1063, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __pyx_t_8; - __pyx_L29_bool_binop_done:; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":1064 - * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: - * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< - * pointer += 1 - * else: + * while True: */ - __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; + if (unlikely(__pyx_v_input == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 989, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 989, __pyx_L1_error) + __pyx_v_input_length = __pyx_t_5; - /* "w3lib/_url.pyx":1065 - * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * pointer += 1 # <<<<<<<<<<<<<< - * else: - * state = RELATIVE + /* "w3lib/_url.pyx":991 + * input_length = len(input) + * + * while True: # <<<<<<<<<<<<<< + * reached_end: bint = pointer >= input_length + * if not reached_end: */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1065, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + while (1) { - /* "w3lib/_url.pyx":1063 + /* "w3lib/_url.pyx":992 * - * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: - * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * pointer += 1 + * while True: + * reached_end: bint = pointer >= input_length # <<<<<<<<<<<<<< + * if not reached_end: + * c: str = input[pointer] */ - goto __pyx_L28; - } + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_reached_end = __pyx_t_6; - /* "w3lib/_url.pyx":1067 - * pointer += 1 - * else: - * state = RELATIVE # <<<<<<<<<<<<<< - * pointer -= 1 + /* "w3lib/_url.pyx":993 + * while True: + * reached_end: bint = pointer >= input_length + * if not reached_end: # <<<<<<<<<<<<<< + * c: str = input[pointer] * */ - /*else*/ { - __pyx_v_state = __pyx_v_5w3lib_4_url_RELATIVE; + __pyx_t_6 = (!__pyx_v_reached_end); + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1068 - * else: - * state = RELATIVE - * pointer -= 1 # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":994 + * reached_end: bint = pointer >= input_length + * if not reached_end: + * c: str = input[pointer] # <<<<<<<<<<<<<< * - * elif state == PATH_OR_AUTHORITY: + * if state == SCHEME_START: */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; - } - __pyx_L28:; + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 994, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_c, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1062 - * pointer -= 1 + /* "w3lib/_url.pyx":993 + * while True: + * reached_end: bint = pointer >= input_length + * if not reached_end: # <<<<<<<<<<<<<< + * c: str = input[pointer] * - * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< - * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - goto __pyx_L7; } - /* "w3lib/_url.pyx":1070 - * pointer -= 1 + /* "w3lib/_url.pyx":996 + * c: str = input[pointer] * - * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< - * if not reached_end and c == "/": - * state = AUTHORITY + * if state == SCHEME_START: # <<<<<<<<<<<<<< + * if not reached_end and c in _ASCII_ALPHA: + * buffer += c */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY); - if (__pyx_t_1) { + __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SCHEME_START); + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1071 + /* "w3lib/_url.pyx":997 * - * elif state == PATH_OR_AUTHORITY: - * if not reached_end and c == "/": # <<<<<<<<<<<<<< - * state = AUTHORITY - * else: + * if state == SCHEME_START: + * if not reached_end and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< + * buffer += c + * state = SCHEME */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { + __pyx_t_7 = (!__pyx_v_reached_end); + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L34_bool_binop_done; + __pyx_t_6 = __pyx_t_7; + goto __pyx_L8_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1071, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1071, __pyx_L1_error) - __pyx_t_1 = __pyx_t_8; - __pyx_L34_bool_binop_done:; - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 997, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 997, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 997, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __pyx_t_7; + __pyx_L8_bool_binop_done:; + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1072 - * elif state == PATH_OR_AUTHORITY: - * if not reached_end and c == "/": - * state = AUTHORITY # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":998 + * if state == SCHEME_START: + * if not reached_end and c in _ASCII_ALPHA: + * buffer += c # <<<<<<<<<<<<<< + * state = SCHEME * else: - * state = PATH */ - __pyx_v_state = __pyx_v_5w3lib_4_url_AUTHORITY; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 998, __pyx_L1_error) } + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_2); + __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1071 - * - * elif state == PATH_OR_AUTHORITY: - * if not reached_end and c == "/": # <<<<<<<<<<<<<< - * state = AUTHORITY + /* "w3lib/_url.pyx":999 + * if not reached_end and c in _ASCII_ALPHA: + * buffer += c + * state = SCHEME # <<<<<<<<<<<<<< * else: + * state = NO_SCHEME */ - goto __pyx_L33; + __pyx_v_state = __pyx_v_5w3lib_4_url_SCHEME; + + /* "w3lib/_url.pyx":997 + * + * if state == SCHEME_START: + * if not reached_end and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< + * buffer += c + * state = SCHEME + */ + goto __pyx_L7; } - /* "w3lib/_url.pyx":1074 - * state = AUTHORITY + /* "w3lib/_url.pyx":1001 + * state = SCHEME * else: - * state = PATH # <<<<<<<<<<<<<< + * state = NO_SCHEME # <<<<<<<<<<<<<< * pointer -= 1 * */ /*else*/ { - __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; + __pyx_v_state = __pyx_v_5w3lib_4_url_NO_SCHEME; - /* "w3lib/_url.pyx":1075 + /* "w3lib/_url.pyx":1002 * else: - * state = PATH + * state = NO_SCHEME * pointer -= 1 # <<<<<<<<<<<<<< * - * elif state == RELATIVE: + * elif state == SCHEME: */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1075, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); + __pyx_t_2 = 0; } - __pyx_L33:; + __pyx_L7:; - /* "w3lib/_url.pyx":1070 - * pointer -= 1 + /* "w3lib/_url.pyx":996 + * c: str = input[pointer] * - * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< - * if not reached_end and c == "/": - * state = AUTHORITY + * if state == SCHEME_START: # <<<<<<<<<<<<<< + * if not reached_end and c in _ASCII_ALPHA: + * buffer += c */ - goto __pyx_L7; + goto __pyx_L6; } - /* "w3lib/_url.pyx":1077 + /* "w3lib/_url.pyx":1004 * pointer -= 1 * - * elif state == RELATIVE: # <<<<<<<<<<<<<< - * url.scheme = base.scheme - * if not reached_end and (c == "/" or url.is_special and c == "\\"): + * elif state == SCHEME: # <<<<<<<<<<<<<< + * if not reached_end and c in _SCHEME_CHARS: + * buffer += c */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_RELATIVE); - if (__pyx_t_1) { + __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SCHEME); + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1078 + /* "w3lib/_url.pyx":1005 * - * elif state == RELATIVE: - * url.scheme = base.scheme # <<<<<<<<<<<<<< - * if not reached_end and (c == "/" or url.is_special and c == "\\"): - * state = RELATIVE_SLASH - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1078, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_t_4) < 0) __PYX_ERR(0, 1078, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":1079 - * elif state == RELATIVE: - * url.scheme = base.scheme - * if not reached_end and (c == "/" or url.is_special and c == "\\"): # <<<<<<<<<<<<<< - * state = RELATIVE_SLASH - * else: + * elif state == SCHEME: + * if not reached_end and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< + * buffer += c + * elif not reached_end and c == ":": */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { - } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L37_bool_binop_done; - } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1079, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) - if (!__pyx_t_8) { - } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L37_bool_binop_done; - } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1079, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { + __pyx_t_7 = (!__pyx_v_reached_end); + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L37_bool_binop_done; + __pyx_t_6 = __pyx_t_7; + goto __pyx_L11_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1079, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) - __pyx_t_1 = __pyx_t_8; - __pyx_L37_bool_binop_done:; - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1005, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SCHEME_CHARS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1005, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __pyx_t_7; + __pyx_L11_bool_binop_done:; + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1080 - * url.scheme = base.scheme - * if not reached_end and (c == "/" or url.is_special and c == "\\"): - * state = RELATIVE_SLASH # <<<<<<<<<<<<<< - * else: - * url.username = base.username + /* "w3lib/_url.pyx":1006 + * elif state == SCHEME: + * if not reached_end and c in _SCHEME_CHARS: + * buffer += c # <<<<<<<<<<<<<< + * elif not reached_end and c == ":": + * url.scheme = buffer.lower() */ - __pyx_v_state = __pyx_v_5w3lib_4_url_RELATIVE_SLASH; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1006, __pyx_L1_error) } + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_2); + __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1079 - * elif state == RELATIVE: - * url.scheme = base.scheme - * if not reached_end and (c == "/" or url.is_special and c == "\\"): # <<<<<<<<<<<<<< - * state = RELATIVE_SLASH - * else: + /* "w3lib/_url.pyx":1005 + * + * elif state == SCHEME: + * if not reached_end and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< + * buffer += c + * elif not reached_end and c == ":": */ - goto __pyx_L36; + goto __pyx_L10; } - /* "w3lib/_url.pyx":1082 - * state = RELATIVE_SLASH - * else: - * url.username = base.username # <<<<<<<<<<<<<< - * url.password = base.password - * url.hostname = base.hostname + /* "w3lib/_url.pyx":1007 + * if not reached_end and c in _SCHEME_CHARS: + * buffer += c + * elif not reached_end and c == ":": # <<<<<<<<<<<<<< + * url.scheme = buffer.lower() + * buffer = "" */ - /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_4) < 0) __PYX_ERR(0, 1082, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = (!__pyx_v_reached_end); + if (__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L13_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1007, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1007, __pyx_L1_error) + __pyx_t_6 = __pyx_t_7; + __pyx_L13_bool_binop_done:; + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1083 - * else: - * url.username = base.username - * url.password = base.password # <<<<<<<<<<<<<< - * url.hostname = base.hostname - * url.port = base.port + /* "w3lib/_url.pyx":1008 + * buffer += c + * elif not reached_end and c == ":": + * url.scheme = buffer.lower() # <<<<<<<<<<<<<< + * buffer = "" + * if url.scheme == "file": */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1083, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_4) < 0) __PYX_ERR(0, 1083, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_buffer, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme, __pyx_t_2) < 0) __PYX_ERR(0, 1008, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1084 - * url.username = base.username - * url.password = base.password - * url.hostname = base.hostname # <<<<<<<<<<<<<< - * url.port = base.port - * url.path = base.path + /* "w3lib/_url.pyx":1009 + * elif not reached_end and c == ":": + * url.scheme = buffer.lower() + * buffer = "" # <<<<<<<<<<<<<< + * if url.scheme == "file": + * state = FILE */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 1084, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_u_); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1085 - * url.password = base.password - * url.hostname = base.hostname - * url.port = base.port # <<<<<<<<<<<<<< - * url.path = base.path - * url.query = base.query + /* "w3lib/_url.pyx":1010 + * url.scheme = buffer.lower() + * buffer = "" + * if url.scheme == "file": # <<<<<<<<<<<<<< + * state = FILE + * elif url.scheme in _SPECIAL_SCHEMES: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1085, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_4) < 0) __PYX_ERR(0, 1085, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1010, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1086 - * url.hostname = base.hostname - * url.port = base.port - * url.path = base.path # <<<<<<<<<<<<<< - * url.query = base.query - * if not reached_end and c == "?": + /* "w3lib/_url.pyx":1011 + * buffer = "" + * if url.scheme == "file": + * state = FILE # <<<<<<<<<<<<<< + * elif url.scheme in _SPECIAL_SCHEMES: + * state = SPECIAL_AUTHORITY_SLASHES */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_4) < 0) __PYX_ERR(0, 1086, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_FILE; - /* "w3lib/_url.pyx":1087 - * url.port = base.port - * url.path = base.path - * url.query = base.query # <<<<<<<<<<<<<< - * if not reached_end and c == "?": - * url.query = "" - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_4) < 0) __PYX_ERR(0, 1087, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":1088 - * url.path = base.path - * url.query = base.query - * if not reached_end and c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY + /* "w3lib/_url.pyx":1010 + * url.scheme = buffer.lower() + * buffer = "" + * if url.scheme == "file": # <<<<<<<<<<<<<< + * state = FILE + * elif url.scheme in _SPECIAL_SCHEMES: */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { - } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L42_bool_binop_done; + goto __pyx_L15; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1088, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1088, __pyx_L1_error) - __pyx_t_1 = __pyx_t_8; - __pyx_L42_bool_binop_done:; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":1089 - * url.query = base.query - * if not reached_end and c == "?": - * url.query = "" # <<<<<<<<<<<<<< - * state = QUERY - * elif not reached_end and c == "#": + + /* "w3lib/_url.pyx":1012 + * if url.scheme == "file": + * state = FILE + * elif url.scheme in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< + * state = SPECIAL_AUTHORITY_SLASHES + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1012, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1090 - * if not reached_end and c == "?": - * url.query = "" - * state = QUERY # <<<<<<<<<<<<<< - * elif not reached_end and c == "#": - * url.fragment = "" + /* "w3lib/_url.pyx":1013 + * state = FILE + * elif url.scheme in _SPECIAL_SCHEMES: + * state = SPECIAL_AUTHORITY_SLASHES # <<<<<<<<<<<<<< + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": + * state = PATH_OR_AUTHORITY */ - __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; + __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES; - /* "w3lib/_url.pyx":1088 - * url.path = base.path - * url.query = base.query - * if not reached_end and c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY + /* "w3lib/_url.pyx":1012 + * if url.scheme == "file": + * state = FILE + * elif url.scheme in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< + * state = SPECIAL_AUTHORITY_SLASHES + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": */ - goto __pyx_L41; + goto __pyx_L15; } - /* "w3lib/_url.pyx":1091 - * url.query = "" - * state = QUERY - * elif not reached_end and c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":1014 + * elif url.scheme in _SPECIAL_SCHEMES: + * state = SPECIAL_AUTHORITY_SLASHES + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * state = PATH_OR_AUTHORITY + * pointer += 1 */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_input == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 1014, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1014, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1014, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L44_bool_binop_done; + __pyx_t_6 = __pyx_t_7; + goto __pyx_L16_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1091, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1091, __pyx_L1_error) - __pyx_t_1 = __pyx_t_8; - __pyx_L44_bool_binop_done:; - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1014, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __pyx_t_7; + __pyx_L16_bool_binop_done:; + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1092 - * state = QUERY - * elif not reached_end and c == "#": - * url.fragment = "" # <<<<<<<<<<<<<< - * state = FRAGMENT - * elif not reached_end: + /* "w3lib/_url.pyx":1015 + * state = SPECIAL_AUTHORITY_SLASHES + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": + * state = PATH_OR_AUTHORITY # <<<<<<<<<<<<<< + * pointer += 1 + * else: + */ + __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY; + + /* "w3lib/_url.pyx":1016 + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": + * state = PATH_OR_AUTHORITY + * pointer += 1 # <<<<<<<<<<<<<< + * else: + * url.opaque_path = "" + */ + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1014 + * elif url.scheme in _SPECIAL_SCHEMES: + * state = SPECIAL_AUTHORITY_SLASHES + * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * state = PATH_OR_AUTHORITY + * pointer += 1 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1092, __pyx_L1_error) + goto __pyx_L15; + } - /* "w3lib/_url.pyx":1093 - * elif not reached_end and c == "#": - * url.fragment = "" - * state = FRAGMENT # <<<<<<<<<<<<<< - * elif not reached_end: - * url.query = None + /* "w3lib/_url.pyx":1018 + * pointer += 1 + * else: + * url.opaque_path = "" # <<<<<<<<<<<<<< + * state = OPAQUE_PATH + * else: */ - __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; + /*else*/ { + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path, __pyx_kp_u_) < 0) __PYX_ERR(0, 1018, __pyx_L1_error) - /* "w3lib/_url.pyx":1091 - * url.query = "" - * state = QUERY - * elif not reached_end and c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT + /* "w3lib/_url.pyx":1019 + * else: + * url.opaque_path = "" + * state = OPAQUE_PATH # <<<<<<<<<<<<<< + * else: + * buffer = "" */ - goto __pyx_L41; + __pyx_v_state = __pyx_v_5w3lib_4_url_OPAQUE_PATH; } + __pyx_L15:; - /* "w3lib/_url.pyx":1094 - * url.fragment = "" - * state = FRAGMENT - * elif not reached_end: # <<<<<<<<<<<<<< - * url.query = None - * _shorten_path(url) + /* "w3lib/_url.pyx":1007 + * if not reached_end and c in _SCHEME_CHARS: + * buffer += c + * elif not reached_end and c == ":": # <<<<<<<<<<<<<< + * url.scheme = buffer.lower() + * buffer = "" */ - __pyx_t_1 = (!__pyx_v_reached_end); - if (__pyx_t_1) { + goto __pyx_L10; + } - /* "w3lib/_url.pyx":1095 - * state = FRAGMENT - * elif not reached_end: - * url.query = None # <<<<<<<<<<<<<< - * _shorten_path(url) - * state = PATH + /* "w3lib/_url.pyx":1021 + * state = OPAQUE_PATH + * else: + * buffer = "" # <<<<<<<<<<<<<< + * state = NO_SCHEME + * pointer = -1 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 1095, __pyx_L1_error) + /*else*/ { + __Pyx_INCREF(__pyx_kp_u_); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1096 - * elif not reached_end: - * url.query = None - * _shorten_path(url) # <<<<<<<<<<<<<< - * state = PATH - * pointer -= 1 + /* "w3lib/_url.pyx":1022 + * else: + * buffer = "" + * state = NO_SCHEME # <<<<<<<<<<<<<< + * pointer = -1 + * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_url}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_NO_SCHEME; - /* "w3lib/_url.pyx":1097 - * url.query = None - * _shorten_path(url) - * state = PATH # <<<<<<<<<<<<<< - * pointer -= 1 + /* "w3lib/_url.pyx":1023 + * buffer = "" + * state = NO_SCHEME + * pointer = -1 # <<<<<<<<<<<<<< * + * elif state == NO_SCHEME: */ - __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_int_neg_1); + } + __pyx_L10:; - /* "w3lib/_url.pyx":1098 - * _shorten_path(url) - * state = PATH - * pointer -= 1 # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1004 + * pointer -= 1 * - * elif state == RELATIVE_SLASH: + * elif state == SCHEME: # <<<<<<<<<<<<<< + * if not reached_end and c in _SCHEME_CHARS: + * buffer += c */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1098, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + goto __pyx_L6; + } - /* "w3lib/_url.pyx":1094 - * url.fragment = "" - * state = FRAGMENT - * elif not reached_end: # <<<<<<<<<<<<<< - * url.query = None - * _shorten_path(url) + /* "w3lib/_url.pyx":1025 + * pointer = -1 + * + * elif state == NO_SCHEME: # <<<<<<<<<<<<<< + * raise ValueError("No URL scheme") + * */ - } - __pyx_L41:; - } - __pyx_L36:; + __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_NO_SCHEME); + if (unlikely(__pyx_t_6)) { - /* "w3lib/_url.pyx":1077 - * pointer -= 1 + /* "w3lib/_url.pyx":1026 + * + * elif state == NO_SCHEME: + * raise ValueError("No URL scheme") # <<<<<<<<<<<<<< + * + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1026, __pyx_L1_error) + + /* "w3lib/_url.pyx":1025 + * pointer = -1 + * + * elif state == NO_SCHEME: # <<<<<<<<<<<<<< + * raise ValueError("No URL scheme") * - * elif state == RELATIVE: # <<<<<<<<<<<<<< - * url.scheme = base.scheme - * if not reached_end and (c == "/" or url.is_special and c == "\\"): */ - goto __pyx_L7; } - /* "w3lib/_url.pyx":1100 - * pointer -= 1 + /* "w3lib/_url.pyx":1028 + * raise ValueError("No URL scheme") * - * elif state == RELATIVE_SLASH: # <<<<<<<<<<<<<< - * if url.is_special and not reached_end and c in "/\\": + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_RELATIVE_SLASH); - if (__pyx_t_1) { + __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_RELATIVE_OR_AUTHORITY); + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1101 + /* "w3lib/_url.pyx":1029 * - * elif state == RELATIVE_SLASH: - * if url.is_special and not reached_end and c in "/\\": # <<<<<<<<<<<<<< + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * elif not reached_end and c == "/": + * pointer += 1 */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1101, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { + __pyx_t_7 = (!__pyx_v_reached_end); + if (__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L19_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1029, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L47_bool_binop_done; + __pyx_t_6 = __pyx_t_7; + goto __pyx_L19_bool_binop_done; } - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L47_bool_binop_done; + __pyx_t_6 = __pyx_t_7; + goto __pyx_L19_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1101, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1101, __pyx_L1_error) - __pyx_t_1 = __pyx_t_8; - __pyx_L47_bool_binop_done:; - if (__pyx_t_1) { + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __pyx_t_7; + __pyx_L19_bool_binop_done:; + if (likely(__pyx_t_6)) { - /* "w3lib/_url.pyx":1102 - * elif state == RELATIVE_SLASH: - * if url.is_special and not reached_end and c in "/\\": + /* "w3lib/_url.pyx":1030 + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< - * elif not reached_end and c == "/": - * state = AUTHORITY + * pointer += 1 + * else: */ __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":1101 + /* "w3lib/_url.pyx":1031 + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": + * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * pointer += 1 # <<<<<<<<<<<<<< + * else: + * raise ValueError("URL is relative") + */ + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1031, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; + + /* "w3lib/_url.pyx":1029 * - * elif state == RELATIVE_SLASH: - * if url.is_special and not reached_end and c in "/\\": # <<<<<<<<<<<<<< + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * elif not reached_end and c == "/": + * pointer += 1 */ - goto __pyx_L46; + goto __pyx_L18; } - /* "w3lib/_url.pyx":1103 - * if url.is_special and not reached_end and c in "/\\": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * elif not reached_end and c == "/": # <<<<<<<<<<<<<< - * state = AUTHORITY + /* "w3lib/_url.pyx":1033 + * pointer += 1 * else: + * raise ValueError("URL is relative") # <<<<<<<<<<<<<< + * + * elif state == PATH_OR_AUTHORITY: */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { - } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L50_bool_binop_done; + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 1033, __pyx_L1_error) } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1103, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1103, __pyx_L1_error) - __pyx_t_1 = __pyx_t_8; - __pyx_L50_bool_binop_done:; - if (__pyx_t_1) { + __pyx_L18:; - /* "w3lib/_url.pyx":1104 + /* "w3lib/_url.pyx":1028 + * raise ValueError("No URL scheme") + * + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< + * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * elif not reached_end and c == "/": - * state = AUTHORITY # <<<<<<<<<<<<<< - * else: - * url.username = base.username */ - __pyx_v_state = __pyx_v_5w3lib_4_url_AUTHORITY; + goto __pyx_L6; + } - /* "w3lib/_url.pyx":1103 - * if url.is_special and not reached_end and c in "/\\": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES - * elif not reached_end and c == "/": # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1035 + * raise ValueError("URL is relative") + * + * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< + * if not reached_end and c == "/": * state = AUTHORITY - * else: */ - goto __pyx_L46; - } + __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY); + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1106 + /* "w3lib/_url.pyx":1036 + * + * elif state == PATH_OR_AUTHORITY: + * if not reached_end and c == "/": # <<<<<<<<<<<<<< * state = AUTHORITY * else: - * url.username = base.username # <<<<<<<<<<<<<< - * url.password = base.password - * url.hostname = base.hostname */ - /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_username); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_4) < 0) __PYX_ERR(0, 1106, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = (!__pyx_v_reached_end); + if (__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L24_bool_binop_done; + } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1036, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1036, __pyx_L1_error) + __pyx_t_6 = __pyx_t_7; + __pyx_L24_bool_binop_done:; + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1107 + /* "w3lib/_url.pyx":1037 + * elif state == PATH_OR_AUTHORITY: + * if not reached_end and c == "/": + * state = AUTHORITY # <<<<<<<<<<<<<< * else: - * url.username = base.username - * url.password = base.password # <<<<<<<<<<<<<< - * url.hostname = base.hostname - * url.port = base.port - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_password); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_4) < 0) __PYX_ERR(0, 1107, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":1108 - * url.username = base.username - * url.password = base.password - * url.hostname = base.hostname # <<<<<<<<<<<<<< - * url.port = base.port * state = PATH */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 1108, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_state = __pyx_v_5w3lib_4_url_AUTHORITY; - /* "w3lib/_url.pyx":1109 - * url.password = base.password - * url.hostname = base.hostname - * url.port = base.port # <<<<<<<<<<<<<< - * state = PATH - * pointer -= 1 + /* "w3lib/_url.pyx":1036 + * + * elif state == PATH_OR_AUTHORITY: + * if not reached_end and c == "/": # <<<<<<<<<<<<<< + * state = AUTHORITY + * else: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_4) < 0) __PYX_ERR(0, 1109, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L23; + } - /* "w3lib/_url.pyx":1110 - * url.hostname = base.hostname - * url.port = base.port + /* "w3lib/_url.pyx":1039 + * state = AUTHORITY + * else: * state = PATH # <<<<<<<<<<<<<< * pointer -= 1 * */ + /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1111 - * url.port = base.port + /* "w3lib/_url.pyx":1040 + * else: * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == SPECIAL_AUTHORITY_SLASHES: */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); + __pyx_t_3 = 0; } - __pyx_L46:; + __pyx_L23:; - /* "w3lib/_url.pyx":1100 - * pointer -= 1 + /* "w3lib/_url.pyx":1035 + * raise ValueError("URL is relative") * - * elif state == RELATIVE_SLASH: # <<<<<<<<<<<<<< - * if url.is_special and not reached_end and c in "/\\": - * state = SPECIAL_AUTHORITY_IGNORE_SLASHES + * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< + * if not reached_end and c == "/": + * state = AUTHORITY */ - goto __pyx_L7; + goto __pyx_L6; } - /* "w3lib/_url.pyx":1113 + /* "w3lib/_url.pyx":1042 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES); - if (__pyx_t_1) { + __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES); + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1114 + /* "w3lib/_url.pyx":1043 * * elif state == SPECIAL_AUTHORITY_SLASHES: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { + __pyx_t_7 = (!__pyx_v_reached_end); + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L53_bool_binop_done; + __pyx_t_6 = __pyx_t_7; + goto __pyx_L27_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1114, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) - if (__pyx_t_8) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1043, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1043, __pyx_L1_error) + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L53_bool_binop_done; + __pyx_t_6 = __pyx_t_7; + goto __pyx_L27_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1114, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1114, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1043, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L53_bool_binop_done; + __pyx_t_6 = __pyx_t_7; + goto __pyx_L27_bool_binop_done; } - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_8; - __pyx_L53_bool_binop_done:; - if (__pyx_t_1) { + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1043, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_t_7; + __pyx_L27_bool_binop_done:; + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1115 + /* "w3lib/_url.pyx":1044 * elif state == SPECIAL_AUTHORITY_SLASHES: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< @@ -16522,29 +15313,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":1116 + /* "w3lib/_url.pyx":1045 * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 # <<<<<<<<<<<<<< * else: * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1114 + /* "w3lib/_url.pyx":1043 * * elif state == SPECIAL_AUTHORITY_SLASHES: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 */ - goto __pyx_L52; + goto __pyx_L26; } - /* "w3lib/_url.pyx":1118 + /* "w3lib/_url.pyx":1047 * pointer += 1 * else: * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< @@ -16554,41 +15345,41 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":1119 + /* "w3lib/_url.pyx":1048 * else: * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; } - __pyx_L52:; + __pyx_L26:; - /* "w3lib/_url.pyx":1113 + /* "w3lib/_url.pyx":1042 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - goto __pyx_L7; + goto __pyx_L6; } - /* "w3lib/_url.pyx":1121 + /* "w3lib/_url.pyx":1050 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< * if reached_end or c not in "/\\": * state = AUTHORITY */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES); - if (__pyx_t_1) { + __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES); + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1122 + /* "w3lib/_url.pyx":1051 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: * if reached_end or c not in "/\\": # <<<<<<<<<<<<<< @@ -16597,16 +15388,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ if (!__pyx_v_reached_end) { } else { - __pyx_t_1 = __pyx_v_reached_end; - goto __pyx_L58_bool_binop_done; + __pyx_t_6 = __pyx_v_reached_end; + goto __pyx_L32_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1122, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1122, __pyx_L1_error) - __pyx_t_1 = __pyx_t_8; - __pyx_L58_bool_binop_done:; - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1051, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__14, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1051, __pyx_L1_error) + __pyx_t_6 = __pyx_t_7; + __pyx_L32_bool_binop_done:; + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1123 + /* "w3lib/_url.pyx":1052 * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: * if reached_end or c not in "/\\": * state = AUTHORITY # <<<<<<<<<<<<<< @@ -16615,19 +15406,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_AUTHORITY; - /* "w3lib/_url.pyx":1124 + /* "w3lib/_url.pyx":1053 * if reached_end or c not in "/\\": * state = AUTHORITY * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == AUTHORITY: - */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + */ + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1122 + /* "w3lib/_url.pyx":1051 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: * if reached_end or c not in "/\\": # <<<<<<<<<<<<<< @@ -16636,37 +15427,37 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1121 + /* "w3lib/_url.pyx":1050 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< * if reached_end or c not in "/\\": * state = AUTHORITY */ - goto __pyx_L7; + goto __pyx_L6; } - /* "w3lib/_url.pyx":1126 + /* "w3lib/_url.pyx":1055 * pointer -= 1 * * elif state == AUTHORITY: # <<<<<<<<<<<<<< * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_AUTHORITY); - if (__pyx_t_1) { + __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_AUTHORITY); + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1127 + /* "w3lib/_url.pyx":1056 * * elif state == AUTHORITY: * if not skip_authority_shortcut: # <<<<<<<<<<<<<< * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: */ - __pyx_t_1 = (!__pyx_v_skip_authority_shortcut); - if (__pyx_t_1) { + __pyx_t_6 = (!__pyx_v_skip_authority_shortcut); + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1128 + /* "w3lib/_url.pyx":1057 * elif state == AUTHORITY: * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) # <<<<<<<<<<<<<< @@ -16675,26 +15466,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ if (unlikely(__pyx_v_input == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "find"); - __PYX_ERR(0, 1128, __pyx_L1_error) + __PYX_ERR(0, 1057, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_Py_IsNone(__pyx_v_pointer) ? (0) : (__Pyx_PyIndex_AsSsize_t(__pyx_v_pointer))); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1128, __pyx_L1_error) - __pyx_t_9 = PyUnicode_Find(__pyx_v_input, __pyx_kp_u__16, __pyx_t_7, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-2))) __PYX_ERR(0, 1128, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_at_sign_index, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_5 = (__Pyx_Py_IsNone(__pyx_v_pointer) ? (0) : (__Pyx_PyIndex_AsSsize_t(__pyx_v_pointer))); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1057, __pyx_L1_error) + __pyx_t_8 = PyUnicode_Find(__pyx_v_input, __pyx_kp_u__15, __pyx_t_5, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-2))) __PYX_ERR(0, 1057, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_at_sign_index, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1129 + /* "w3lib/_url.pyx":1058 * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: # <<<<<<<<<<<<<< * state = HOST * else: */ - __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_at_sign_index, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1129, __pyx_L1_error) - if (__pyx_t_1) { + __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_at_sign_index, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1058, __pyx_L1_error) + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1130 + /* "w3lib/_url.pyx":1059 * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: * state = HOST # <<<<<<<<<<<<<< @@ -16703,17 +15494,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_HOST; - /* "w3lib/_url.pyx":1129 + /* "w3lib/_url.pyx":1058 * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: # <<<<<<<<<<<<<< * state = HOST * else: */ - goto __pyx_L61; + goto __pyx_L35; } - /* "w3lib/_url.pyx":1132 + /* "w3lib/_url.pyx":1061 * state = HOST * else: * skip_authority_shortcut = True # <<<<<<<<<<<<<< @@ -16723,50 +15514,50 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_skip_authority_shortcut = 1; } - __pyx_L61:; + __pyx_L35:; - /* "w3lib/_url.pyx":1133 + /* "w3lib/_url.pyx":1062 * else: * skip_authority_shortcut = True * pointer -= 1 # <<<<<<<<<<<<<< * elif not reached_end and c == "@": * if at_sign_seen: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1062, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1127 + /* "w3lib/_url.pyx":1056 * * elif state == AUTHORITY: * if not skip_authority_shortcut: # <<<<<<<<<<<<<< * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: */ - goto __pyx_L60; + goto __pyx_L34; } - /* "w3lib/_url.pyx":1134 + /* "w3lib/_url.pyx":1063 * skip_authority_shortcut = True * pointer -= 1 * elif not reached_end and c == "@": # <<<<<<<<<<<<<< * if at_sign_seen: * buffer = "%40" + buffer */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { + __pyx_t_7 = (!__pyx_v_reached_end); + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L62_bool_binop_done; + __pyx_t_6 = __pyx_t_7; + goto __pyx_L36_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1134, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1134, __pyx_L1_error) - __pyx_t_1 = __pyx_t_8; - __pyx_L62_bool_binop_done:; - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1063, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1063, __pyx_L1_error) + __pyx_t_6 = __pyx_t_7; + __pyx_L36_bool_binop_done:; + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1135 + /* "w3lib/_url.pyx":1064 * pointer -= 1 * elif not reached_end and c == "@": * if at_sign_seen: # <<<<<<<<<<<<<< @@ -16775,19 +15566,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ if (__pyx_v_at_sign_seen) { - /* "w3lib/_url.pyx":1136 + /* "w3lib/_url.pyx":1065 * elif not reached_end and c == "@": * if at_sign_seen: * buffer = "%40" + buffer # <<<<<<<<<<<<<< * at_sign_seen = True * for i, code_point in enumerate(buffer): */ - __pyx_t_3 = PyNumber_Add(__pyx_kp_u_40, __pyx_v_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_kp_u_40, __pyx_v_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1135 + /* "w3lib/_url.pyx":1064 * pointer -= 1 * elif not reached_end and c == "@": * if at_sign_seen: # <<<<<<<<<<<<<< @@ -16796,7 +15587,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1137 + /* "w3lib/_url.pyx":1066 * if at_sign_seen: * buffer = "%40" + buffer * at_sign_seen = True # <<<<<<<<<<<<<< @@ -16805,7 +15596,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_at_sign_seen = 1; - /* "w3lib/_url.pyx":1138 + /* "w3lib/_url.pyx":1067 * buffer = "%40" + buffer * at_sign_seen = True * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< @@ -16813,110 +15604,110 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * url._password_token_seen = True */ __Pyx_INCREF(__pyx_int_0); - __pyx_t_3 = __pyx_int_0; + __pyx_t_1 = __pyx_int_0; if (likely(PyList_CheckExact(__pyx_v_buffer)) || PyTuple_CheckExact(__pyx_v_buffer)) { - __pyx_t_5 = __pyx_v_buffer; __Pyx_INCREF(__pyx_t_5); - __pyx_t_9 = 0; - __pyx_t_10 = NULL; + __pyx_t_2 = __pyx_v_buffer; __Pyx_INCREF(__pyx_t_2); + __pyx_t_8 = 0; + __pyx_t_9 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1138, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1067, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_10)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) #endif - if (__pyx_t_9 >= __pyx_temp) break; + if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) #endif - if (__pyx_t_9 >= __pyx_temp) break; + if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); #endif } } else { - __pyx_t_4 = __pyx_t_10(__pyx_t_5); - if (unlikely(!__pyx_t_4)) { + __pyx_t_3 = __pyx_t_9(__pyx_t_2); + if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1138, __pyx_L1_error) + else __PYX_ERR(0, 1067, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); - __pyx_t_3 = __pyx_t_4; - __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1139 + /* "w3lib/_url.pyx":1068 * at_sign_seen = True * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< * url._password_token_seen = True * continue */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1139, __pyx_L1_error) - if (__pyx_t_8) { + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L68_bool_binop_done; + __pyx_t_6 = __pyx_t_7; + goto __pyx_L42_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1139, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = (!__pyx_t_8); - __pyx_t_1 = __pyx_t_11; - __pyx_L68_bool_binop_done:; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":1140 + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = (!__pyx_t_7); + __pyx_t_6 = __pyx_t_10; + __pyx_L42_bool_binop_done:; + if (__pyx_t_6) { + + /* "w3lib/_url.pyx":1069 * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: * url._password_token_seen = True # <<<<<<<<<<<<<< * continue * encoded_code_points = _idempotent_utf_8_percent_encode( */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen, Py_True) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen, Py_True) < 0) __PYX_ERR(0, 1069, __pyx_L1_error) - /* "w3lib/_url.pyx":1141 + /* "w3lib/_url.pyx":1070 * if code_point == ":" and not url._password_token_seen: * url._password_token_seen = True * continue # <<<<<<<<<<<<<< * encoded_code_points = _idempotent_utf_8_percent_encode( * input=buffer, */ - goto __pyx_L65_continue; + goto __pyx_L39_continue; - /* "w3lib/_url.pyx":1139 + /* "w3lib/_url.pyx":1068 * at_sign_seen = True * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< @@ -16925,245 +15716,251 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1142 + /* "w3lib/_url.pyx":1071 * url._password_token_seen = True * continue * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=buffer, * pointer=i, */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":1143 + /* "w3lib/_url.pyx":1072 * continue * encoded_code_points = _idempotent_utf_8_percent_encode( * input=buffer, # <<<<<<<<<<<<<< * pointer=i, - * encode_set=userinfo_percent_encode_set, + * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_buffer) < 0) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1072, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_input, __pyx_v_buffer) < 0) __PYX_ERR(0, 1072, __pyx_L1_error) - /* "w3lib/_url.pyx":1144 + /* "w3lib/_url.pyx":1073 * encoded_code_points = _idempotent_utf_8_percent_encode( * input=buffer, * pointer=i, # <<<<<<<<<<<<<< - * encode_set=userinfo_percent_encode_set, + * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, * ) */ - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_i) < 0) __PYX_ERR(0, 1143, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_pointer, __pyx_v_i) < 0) __PYX_ERR(0, 1072, __pyx_L1_error) - /* "w3lib/_url.pyx":1145 + /* "w3lib/_url.pyx":1074 * input=buffer, * pointer=i, - * encode_set=userinfo_percent_encode_set, # <<<<<<<<<<<<<< + * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * ) * if url._password_token_seen: */ - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_userinfo_percent_encode_set) < 0) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_encode_set, __pyx_t_12) < 0) __PYX_ERR(0, 1072, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "w3lib/_url.pyx":1142 + /* "w3lib/_url.pyx":1071 * url._password_token_seen = True * continue * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=buffer, * pointer=i, */ - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1142, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF_SET(__pyx_v_encoded_code_points, __pyx_t_12); __pyx_t_12 = 0; - /* "w3lib/_url.pyx":1147 - * encode_set=userinfo_percent_encode_set, + /* "w3lib/_url.pyx":1076 + * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, * ) * if url._password_token_seen: # <<<<<<<<<<<<<< * url.password += encoded_code_points * else: */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1147, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1147, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1076, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__pyx_t_1) { + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1148 + /* "w3lib/_url.pyx":1077 * ) * if url._password_token_seen: * url.password += encoded_code_points # <<<<<<<<<<<<<< * else: * url.username += encoded_code_points */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1148, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_12, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_t_12, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_2) < 0) __PYX_ERR(0, 1148, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_11) < 0) __PYX_ERR(0, 1077, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "w3lib/_url.pyx":1147 - * encode_set=userinfo_percent_encode_set, + /* "w3lib/_url.pyx":1076 + * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, * ) * if url._password_token_seen: # <<<<<<<<<<<<<< * url.password += encoded_code_points * else: */ - goto __pyx_L70; + goto __pyx_L44; } - /* "w3lib/_url.pyx":1150 + /* "w3lib/_url.pyx":1079 * url.password += encoded_code_points * else: * url.username += encoded_code_points # <<<<<<<<<<<<<< * buffer = "" - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": */ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1150, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_t_11, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_12) < 0) __PYX_ERR(0, 1150, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_12) < 0) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } - __pyx_L70:; + __pyx_L44:; - /* "w3lib/_url.pyx":1138 + /* "w3lib/_url.pyx":1067 * buffer = "%40" + buffer * at_sign_seen = True * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< * if code_point == ":" and not url._password_token_seen: * url._password_token_seen = True */ - __pyx_L65_continue:; + __pyx_L39_continue:; } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1151 + /* "w3lib/_url.pyx":1080 * else: * url.username += encoded_code_points * buffer = "" # <<<<<<<<<<<<<< - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if at_sign_seen and not buffer: */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + __Pyx_INCREF(__pyx_kp_u_); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1134 + /* "w3lib/_url.pyx":1063 * skip_authority_shortcut = True * pointer -= 1 * elif not reached_end and c == "@": # <<<<<<<<<<<<<< * if at_sign_seen: * buffer = "%40" + buffer */ - goto __pyx_L60; + goto __pyx_L34; } - /* "w3lib/_url.pyx":1152 + /* "w3lib/_url.pyx":1081 * url.username += encoded_code_points * buffer = "" - * elif reached_end or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< * if at_sign_seen and not buffer: * raise ValueError */ if (!__pyx_v_reached_end) { } else { - __pyx_t_1 = __pyx_v_reached_end; - goto __pyx_L72_bool_binop_done; + __pyx_t_6 = __pyx_v_reached_end; + goto __pyx_L46_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1152, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1152, __pyx_L1_error) - if (!__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1081, __pyx_L1_error) } + __pyx_t_10 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) + if (!__pyx_t_10) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L72_bool_binop_done; + __pyx_t_6 = __pyx_t_10; + goto __pyx_L46_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1152, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_11) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1081, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_10) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L72_bool_binop_done; + __pyx_t_6 = __pyx_t_10; + goto __pyx_L46_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1152, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1152, __pyx_L1_error) - __pyx_t_1 = __pyx_t_11; - __pyx_L72_bool_binop_done:; - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1081, __pyx_L1_error) } + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_6 = __pyx_t_10; + __pyx_L46_bool_binop_done:; + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1153 + /* "w3lib/_url.pyx":1082 * buffer = "" - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< * raise ValueError * pointer -= len(buffer) + 1 */ if (__pyx_v_at_sign_seen) { } else { - __pyx_t_1 = __pyx_v_at_sign_seen; - goto __pyx_L77_bool_binop_done; + __pyx_t_6 = __pyx_v_at_sign_seen; + goto __pyx_L51_bool_binop_done; } - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1153, __pyx_L1_error) - __pyx_t_8 = (!__pyx_t_11); - __pyx_t_1 = __pyx_t_8; - __pyx_L77_bool_binop_done:; - if (unlikely(__pyx_t_1)) { + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1082, __pyx_L1_error) + __pyx_t_7 = (!__pyx_t_10); + __pyx_t_6 = __pyx_t_7; + __pyx_L51_bool_binop_done:; + if (unlikely(__pyx_t_6)) { - /* "w3lib/_url.pyx":1154 - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + /* "w3lib/_url.pyx":1083 + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if at_sign_seen and not buffer: * raise ValueError # <<<<<<<<<<<<<< * pointer -= len(buffer) + 1 * buffer = "" */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1154, __pyx_L1_error) + __PYX_ERR(0, 1083, __pyx_L1_error) - /* "w3lib/_url.pyx":1153 + /* "w3lib/_url.pyx":1082 * buffer = "" - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< * raise ValueError * pointer -= len(buffer) + 1 */ } - /* "w3lib/_url.pyx":1155 + /* "w3lib/_url.pyx":1084 * if at_sign_seen and not buffer: * raise ValueError * pointer -= len(buffer) + 1 # <<<<<<<<<<<<<< * buffer = "" * state = HOST */ - __pyx_t_9 = PyObject_Length(__pyx_v_buffer); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1155, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_9 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_8 = PyObject_Length(__pyx_v_buffer); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_8 + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1156 + /* "w3lib/_url.pyx":1085 * raise ValueError * pointer -= len(buffer) + 1 * buffer = "" # <<<<<<<<<<<<<< * state = HOST * else: */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + __Pyx_INCREF(__pyx_kp_u_); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1157 + /* "w3lib/_url.pyx":1086 * pointer -= len(buffer) + 1 * buffer = "" * state = HOST # <<<<<<<<<<<<<< @@ -17172,17 +15969,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_HOST; - /* "w3lib/_url.pyx":1152 + /* "w3lib/_url.pyx":1081 * url.username += encoded_code_points * buffer = "" - * elif reached_end or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< * if at_sign_seen and not buffer: * raise ValueError */ - goto __pyx_L60; + goto __pyx_L34; } - /* "w3lib/_url.pyx":1159 + /* "w3lib/_url.pyx":1088 * state = HOST * else: * buffer += c # <<<<<<<<<<<<<< @@ -17190,300 +15987,300 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * elif state == HOST: */ /*else*/ { - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1159, __pyx_L1_error) } - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_5); - __pyx_t_5 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1088, __pyx_L1_error) } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); + __pyx_t_1 = 0; } - __pyx_L60:; + __pyx_L34:; - /* "w3lib/_url.pyx":1126 + /* "w3lib/_url.pyx":1055 * pointer -= 1 * * elif state == AUTHORITY: # <<<<<<<<<<<<<< * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) */ - goto __pyx_L7; + goto __pyx_L6; } - /* "w3lib/_url.pyx":1161 + /* "w3lib/_url.pyx":1090 * buffer += c * * elif state == HOST: # <<<<<<<<<<<<<< * if not reached_end and c == ":" and not inside_brackets: * if not buffer: */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_HOST); - if (__pyx_t_1) { + __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_HOST); + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1162 + /* "w3lib/_url.pyx":1091 * * elif state == HOST: * if not reached_end and c == ":" and not inside_brackets: # <<<<<<<<<<<<<< * if not buffer: * raise ValueError */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { + __pyx_t_7 = (!__pyx_v_reached_end); + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L80_bool_binop_done; + __pyx_t_6 = __pyx_t_7; + goto __pyx_L54_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1162, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1162, __pyx_L1_error) - if (__pyx_t_8) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1091, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1091, __pyx_L1_error) + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L80_bool_binop_done; + __pyx_t_6 = __pyx_t_7; + goto __pyx_L54_bool_binop_done; } - __pyx_t_8 = (!__pyx_v_inside_brackets); - __pyx_t_1 = __pyx_t_8; - __pyx_L80_bool_binop_done:; - if (__pyx_t_1) { + __pyx_t_7 = (!__pyx_v_inside_brackets); + __pyx_t_6 = __pyx_t_7; + __pyx_L54_bool_binop_done:; + if (__pyx_t_6) { - /* "w3lib/_url.pyx":1163 + /* "w3lib/_url.pyx":1092 * elif state == HOST: * if not reached_end and c == ":" and not inside_brackets: * if not buffer: # <<<<<<<<<<<<<< * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) + * url = _parse_host(buffer, url) */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1163, __pyx_L1_error) - __pyx_t_8 = (!__pyx_t_1); - if (unlikely(__pyx_t_8)) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1092, __pyx_L1_error) + __pyx_t_7 = (!__pyx_t_6); + if (unlikely(__pyx_t_7)) { - /* "w3lib/_url.pyx":1164 + /* "w3lib/_url.pyx":1093 * if not reached_end and c == ":" and not inside_brackets: * if not buffer: * raise ValueError # <<<<<<<<<<<<<< - * host = _parse_host(buffer, is_special=url.is_special) - * url.hostname = host + * url = _parse_host(buffer, url) + * buffer = "" */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1164, __pyx_L1_error) + __PYX_ERR(0, 1093, __pyx_L1_error) - /* "w3lib/_url.pyx":1163 + /* "w3lib/_url.pyx":1092 * elif state == HOST: * if not reached_end and c == ":" and not inside_brackets: * if not buffer: # <<<<<<<<<<<<<< * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) + * url = _parse_host(buffer, url) */ } - /* "w3lib/_url.pyx":1165 + /* "w3lib/_url.pyx":1094 * if not buffer: * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< - * url.hostname = host + * url = _parse_host(buffer, url) # <<<<<<<<<<<<<< * buffer = "" + * state = PORT */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_buffer); - __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buffer)) __PYX_ERR(0, 1165, __pyx_L1_error); - __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_is_special, __pyx_t_2) < 0) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_12 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_buffer, __pyx_v_url}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1094, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF_SET(__pyx_v_url, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1166 + /* "w3lib/_url.pyx":1095 * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) - * url.hostname = host # <<<<<<<<<<<<<< - * buffer = "" - * state = PORT - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 1166, __pyx_L1_error) - - /* "w3lib/_url.pyx":1167 - * host = _parse_host(buffer, is_special=url.is_special) - * url.hostname = host + * url = _parse_host(buffer, url) * buffer = "" # <<<<<<<<<<<<<< * state = PORT * url._port_token_seen = True */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + __Pyx_INCREF(__pyx_kp_u_); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1168 - * url.hostname = host + /* "w3lib/_url.pyx":1096 + * url = _parse_host(buffer, url) * buffer = "" * state = PORT # <<<<<<<<<<<<<< * url._port_token_seen = True - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": */ __pyx_v_state = __pyx_v_5w3lib_4_url_PORT; - /* "w3lib/_url.pyx":1169 + /* "w3lib/_url.pyx":1097 * buffer = "" * state = PORT * url._port_token_seen = True # <<<<<<<<<<<<<< - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * pointer -= 1 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen, Py_True) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen, Py_True) < 0) __PYX_ERR(0, 1097, __pyx_L1_error) - /* "w3lib/_url.pyx":1162 + /* "w3lib/_url.pyx":1091 * * elif state == HOST: * if not reached_end and c == ":" and not inside_brackets: # <<<<<<<<<<<<<< * if not buffer: * raise ValueError */ - goto __pyx_L79; + goto __pyx_L53; } - /* "w3lib/_url.pyx":1170 + /* "w3lib/_url.pyx":1098 * state = PORT * url._port_token_seen = True - * elif reached_end or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< * pointer -= 1 - * if url.is_special and not buffer: + * if url.scheme in _SPECIAL_SCHEMES and not buffer: */ if (!__pyx_v_reached_end) { } else { - __pyx_t_8 = __pyx_v_reached_end; - goto __pyx_L84_bool_binop_done; + __pyx_t_7 = __pyx_v_reached_end; + goto __pyx_L58_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1170, __pyx_L1_error) } - __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) - if (!__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1098, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1098, __pyx_L1_error) + if (!__pyx_t_6) { } else { - __pyx_t_8 = __pyx_t_1; - goto __pyx_L84_bool_binop_done; + __pyx_t_7 = __pyx_t_6; + goto __pyx_L58_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1170, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1098, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_1) { + if (__pyx_t_6) { } else { - __pyx_t_8 = __pyx_t_1; - goto __pyx_L84_bool_binop_done; + __pyx_t_7 = __pyx_t_6; + goto __pyx_L58_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1170, __pyx_L1_error) } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) - __pyx_t_8 = __pyx_t_1; - __pyx_L84_bool_binop_done:; - if (__pyx_t_8) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1098, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1098, __pyx_L1_error) + __pyx_t_7 = __pyx_t_6; + __pyx_L58_bool_binop_done:; + if (__pyx_t_7) { - /* "w3lib/_url.pyx":1171 + /* "w3lib/_url.pyx":1099 * url._port_token_seen = True - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * pointer -= 1 # <<<<<<<<<<<<<< - * if url.is_special and not buffer: + * if url.scheme in _SPECIAL_SCHEMES and not buffer: * raise ValueError */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1172 - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + /* "w3lib/_url.pyx":1100 + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * pointer -= 1 - * if url.is_special and not buffer: # <<<<<<<<<<<<<< + * if url.scheme in _SPECIAL_SCHEMES and not buffer: # <<<<<<<<<<<<<< * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) + * url = _parse_host(buffer, url) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1172, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_1) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { } else { - __pyx_t_8 = __pyx_t_1; - goto __pyx_L89_bool_binop_done; + __pyx_t_7 = __pyx_t_6; + goto __pyx_L63_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1172, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_1); - __pyx_t_8 = __pyx_t_11; - __pyx_L89_bool_binop_done:; - if (unlikely(__pyx_t_8)) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1100, __pyx_L1_error) + __pyx_t_10 = (!__pyx_t_6); + __pyx_t_7 = __pyx_t_10; + __pyx_L63_bool_binop_done:; + if (unlikely(__pyx_t_7)) { - /* "w3lib/_url.pyx":1173 + /* "w3lib/_url.pyx":1101 * pointer -= 1 - * if url.is_special and not buffer: + * if url.scheme in _SPECIAL_SCHEMES and not buffer: * raise ValueError # <<<<<<<<<<<<<< - * host = _parse_host(buffer, is_special=url.is_special) - * url.hostname = host + * url = _parse_host(buffer, url) + * buffer = "" */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1173, __pyx_L1_error) + __PYX_ERR(0, 1101, __pyx_L1_error) - /* "w3lib/_url.pyx":1172 - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + /* "w3lib/_url.pyx":1100 + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * pointer -= 1 - * if url.is_special and not buffer: # <<<<<<<<<<<<<< + * if url.scheme in _SPECIAL_SCHEMES and not buffer: # <<<<<<<<<<<<<< * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) + * url = _parse_host(buffer, url) */ } - /* "w3lib/_url.pyx":1174 - * if url.is_special and not buffer: + /* "w3lib/_url.pyx":1102 + * if url.scheme in _SPECIAL_SCHEMES and not buffer: * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< - * url.hostname = host + * url = _parse_host(buffer, url) # <<<<<<<<<<<<<< * buffer = "" + * state = PATH_START */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_v_buffer); - __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_buffer)) __PYX_ERR(0, 1174, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_special, __pyx_t_5) < 0) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_12 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_buffer, __pyx_v_url}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF_SET(__pyx_v_url, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1175 + /* "w3lib/_url.pyx":1103 * raise ValueError - * host = _parse_host(buffer, is_special=url.is_special) - * url.hostname = host # <<<<<<<<<<<<<< - * buffer = "" - * state = PATH_START - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 1175, __pyx_L1_error) - - /* "w3lib/_url.pyx":1176 - * host = _parse_host(buffer, is_special=url.is_special) - * url.hostname = host + * url = _parse_host(buffer, url) * buffer = "" # <<<<<<<<<<<<<< * state = PATH_START * elif not reached_end: */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + __Pyx_INCREF(__pyx_kp_u_); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1177 - * url.hostname = host + /* "w3lib/_url.pyx":1104 + * url = _parse_host(buffer, url) * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< * elif not reached_end: @@ -17491,38 +16288,38 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":1170 + /* "w3lib/_url.pyx":1098 * state = PORT * url._port_token_seen = True - * elif reached_end or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< * pointer -= 1 - * if url.is_special and not buffer: + * if url.scheme in _SPECIAL_SCHEMES and not buffer: */ - goto __pyx_L79; + goto __pyx_L53; } - /* "w3lib/_url.pyx":1178 + /* "w3lib/_url.pyx":1105 * buffer = "" * state = PATH_START * elif not reached_end: # <<<<<<<<<<<<<< * if c == "[": * inside_brackets = True */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { + __pyx_t_7 = (!__pyx_v_reached_end); + if (__pyx_t_7) { - /* "w3lib/_url.pyx":1179 + /* "w3lib/_url.pyx":1106 * state = PATH_START * elif not reached_end: * if c == "[": # <<<<<<<<<<<<<< * inside_brackets = True * elif c == "]": */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1179, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1179, __pyx_L1_error) - if (__pyx_t_8) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1106, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1106, __pyx_L1_error) + if (__pyx_t_7) { - /* "w3lib/_url.pyx":1180 + /* "w3lib/_url.pyx":1107 * elif not reached_end: * if c == "[": * inside_brackets = True # <<<<<<<<<<<<<< @@ -17531,28 +16328,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_inside_brackets = 1; - /* "w3lib/_url.pyx":1179 + /* "w3lib/_url.pyx":1106 * state = PATH_START * elif not reached_end: * if c == "[": # <<<<<<<<<<<<<< * inside_brackets = True * elif c == "]": */ - goto __pyx_L91; + goto __pyx_L65; } - /* "w3lib/_url.pyx":1181 + /* "w3lib/_url.pyx":1108 * if c == "[": * inside_brackets = True * elif c == "]": # <<<<<<<<<<<<<< * inside_brackets = False * buffer += c */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1181, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1181, __pyx_L1_error) - if (__pyx_t_8) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1108, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) + if (__pyx_t_7) { - /* "w3lib/_url.pyx":1182 + /* "w3lib/_url.pyx":1109 * inside_brackets = True * elif c == "]": * inside_brackets = False # <<<<<<<<<<<<<< @@ -17561,7 +16358,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_inside_brackets = 0; - /* "w3lib/_url.pyx":1181 + /* "w3lib/_url.pyx":1108 * if c == "[": * inside_brackets = True * elif c == "]": # <<<<<<<<<<<<<< @@ -17569,22 +16366,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * buffer += c */ } - __pyx_L91:; + __pyx_L65:; - /* "w3lib/_url.pyx":1183 + /* "w3lib/_url.pyx":1110 * elif c == "]": * inside_brackets = False * buffer += c # <<<<<<<<<<<<<< * * elif state == PORT: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1183, __pyx_L1_error) } - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_5); - __pyx_t_5 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1110, __pyx_L1_error) } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1178 + /* "w3lib/_url.pyx":1105 * buffer = "" * state = PATH_START * elif not reached_end: # <<<<<<<<<<<<<< @@ -17592,248 +16389,220 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * inside_brackets = True */ } - __pyx_L79:; + __pyx_L53:; - /* "w3lib/_url.pyx":1161 + /* "w3lib/_url.pyx":1090 * buffer += c * * elif state == HOST: # <<<<<<<<<<<<<< * if not reached_end and c == ":" and not inside_brackets: * if not buffer: */ - goto __pyx_L7; + goto __pyx_L6; } - /* "w3lib/_url.pyx":1185 + /* "w3lib/_url.pyx":1112 * buffer += c * * elif state == PORT: # <<<<<<<<<<<<<< * if not reached_end and c in _ASCII_DIGIT: * buffer += c */ - __pyx_t_8 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PORT); - if (__pyx_t_8) { + __pyx_t_7 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PORT); + if (__pyx_t_7) { - /* "w3lib/_url.pyx":1186 + /* "w3lib/_url.pyx":1113 * * elif state == PORT: * if not reached_end and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< * buffer += c - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": */ - __pyx_t_11 = (!__pyx_v_reached_end); - if (__pyx_t_11) { + __pyx_t_10 = (!__pyx_v_reached_end); + if (__pyx_t_10) { } else { - __pyx_t_8 = __pyx_t_11; - goto __pyx_L93_bool_binop_done; + __pyx_t_7 = __pyx_t_10; + goto __pyx_L67_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1186, __pyx_L1_error) } - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_5, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1186, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __pyx_t_11; - __pyx_L93_bool_binop_done:; - if (__pyx_t_8) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1113, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1113, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __pyx_t_10; + __pyx_L67_bool_binop_done:; + if (__pyx_t_7) { - /* "w3lib/_url.pyx":1187 + /* "w3lib/_url.pyx":1114 * elif state == PORT: * if not reached_end and c in _ASCII_DIGIT: * buffer += c # <<<<<<<<<<<<<< - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if buffer: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1187, __pyx_L1_error) } - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_5); - __pyx_t_5 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1114, __pyx_L1_error) } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1186 + /* "w3lib/_url.pyx":1113 * * elif state == PORT: * if not reached_end and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< * buffer += c - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": */ - goto __pyx_L92; + goto __pyx_L66; } - /* "w3lib/_url.pyx":1188 + /* "w3lib/_url.pyx":1115 * if not reached_end and c in _ASCII_DIGIT: * buffer += c - * elif reached_end or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< * if buffer: - * port = int(buffer) + * port: cython.int = int(buffer) */ if (!__pyx_v_reached_end) { } else { - __pyx_t_8 = __pyx_v_reached_end; - goto __pyx_L95_bool_binop_done; + __pyx_t_7 = __pyx_v_reached_end; + goto __pyx_L69_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1188, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) - if (!__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1115, __pyx_L1_error) } + __pyx_t_10 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1115, __pyx_L1_error) + if (!__pyx_t_10) { } else { - __pyx_t_8 = __pyx_t_11; - goto __pyx_L95_bool_binop_done; + __pyx_t_7 = __pyx_t_10; + goto __pyx_L69_bool_binop_done; } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_11) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1115, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_10) { } else { - __pyx_t_8 = __pyx_t_11; - goto __pyx_L95_bool_binop_done; + __pyx_t_7 = __pyx_t_10; + goto __pyx_L69_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1188, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) - __pyx_t_8 = __pyx_t_11; - __pyx_L95_bool_binop_done:; - if (likely(__pyx_t_8)) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1115, __pyx_L1_error) } + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1115, __pyx_L1_error) + __pyx_t_7 = __pyx_t_10; + __pyx_L69_bool_binop_done:; + if (likely(__pyx_t_7)) { - /* "w3lib/_url.pyx":1189 + /* "w3lib/_url.pyx":1116 * buffer += c - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if buffer: # <<<<<<<<<<<<<< - * port = int(buffer) + * port: cython.int = int(buffer) * if port > 2**16 - 1: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1189, __pyx_L1_error) - if (__pyx_t_8) { + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1116, __pyx_L1_error) + if (__pyx_t_7) { - /* "w3lib/_url.pyx":1190 - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + /* "w3lib/_url.pyx":1117 + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if buffer: - * port = int(buffer) # <<<<<<<<<<<<<< + * port: cython.int = int(buffer) # <<<<<<<<<<<<<< * if port > 2**16 - 1: - * raise ValueError + * raise ValueError(f"Port {port} is too high.") */ - __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_v_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_v_port, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_port = __pyx_t_4; - /* "w3lib/_url.pyx":1191 + /* "w3lib/_url.pyx":1118 * if buffer: - * port = int(buffer) + * port: cython.int = int(buffer) * if port > 2**16 - 1: # <<<<<<<<<<<<<< - * raise ValueError - * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port + * raise ValueError(f"Port {port} is too high.") + * url.port = port */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_port, __pyx_int_65535, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1191, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1191, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(__pyx_t_8)) { + __pyx_t_7 = (__pyx_v_port > 0xffff); + if (unlikely(__pyx_t_7)) { - /* "w3lib/_url.pyx":1192 - * port = int(buffer) + /* "w3lib/_url.pyx":1119 + * port: cython.int = int(buffer) * if port > 2**16 - 1: - * raise ValueError # <<<<<<<<<<<<<< - * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port - * url._default_port_seen = url.port is None + * raise ValueError(f"Port {port} is too high.") # <<<<<<<<<<<<<< + * url.port = port + * buffer = "" */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1192, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = 0; + __pyx_t_13 = 127; + __Pyx_INCREF(__pyx_kp_u_Port); + __pyx_t_8 += 5; + __Pyx_GIVEREF(__pyx_kp_u_Port); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Port); + __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_port, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_kp_u_is_too_high); + __pyx_t_8 += 13; + __Pyx_GIVEREF(__pyx_kp_u_is_too_high); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_is_too_high); + __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1119, __pyx_L1_error) - /* "w3lib/_url.pyx":1191 + /* "w3lib/_url.pyx":1118 * if buffer: - * port = int(buffer) + * port: cython.int = int(buffer) * if port > 2**16 - 1: # <<<<<<<<<<<<<< - * raise ValueError - * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port - */ - } - - /* "w3lib/_url.pyx":1193 - * if port > 2**16 - 1: - * raise ValueError - * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port # <<<<<<<<<<<<<< - * url._default_port_seen = url.port is None - * buffer = "" + * raise ValueError(f"Port {port} is too high.") + * url.port = port */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_4 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_12}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_port, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_8) { - __Pyx_INCREF(Py_None); - __pyx_t_5 = Py_None; - } else { - __Pyx_INCREF(__pyx_v_port); - __pyx_t_5 = __pyx_v_port; } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_5) < 0) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":1194 - * raise ValueError - * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port - * url._default_port_seen = url.port is None # <<<<<<<<<<<<<< + + /* "w3lib/_url.pyx":1120 + * if port > 2**16 - 1: + * raise ValueError(f"Port {port} is too high.") + * url.port = port # <<<<<<<<<<<<<< * buffer = "" * state = PATH_START */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = (__pyx_t_5 == Py_None); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen, __pyx_t_5) < 0) __PYX_ERR(0, 1194, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_port); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_2) < 0) __PYX_ERR(0, 1120, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1195 - * url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port - * url._default_port_seen = url.port is None + /* "w3lib/_url.pyx":1121 + * raise ValueError(f"Port {port} is too high.") + * url.port = port * buffer = "" # <<<<<<<<<<<<<< * state = PATH_START * pointer -= 1 */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + __Pyx_INCREF(__pyx_kp_u_); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1189 + /* "w3lib/_url.pyx":1116 * buffer += c - * elif reached_end or c in "/?#" or url.is_special and c == "\\": + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if buffer: # <<<<<<<<<<<<<< - * port = int(buffer) + * port: cython.int = int(buffer) * if port > 2**16 - 1: */ } - /* "w3lib/_url.pyx":1196 - * url._default_port_seen = url.port is None + /* "w3lib/_url.pyx":1122 + * url.port = port * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< * pointer -= 1 @@ -17841,29 +16610,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":1197 + /* "w3lib/_url.pyx":1123 * buffer = "" * state = PATH_START * pointer -= 1 # <<<<<<<<<<<<<< * else: * raise ValueError */ - __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); + __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1188 + /* "w3lib/_url.pyx":1115 * if not reached_end and c in _ASCII_DIGIT: * buffer += c - * elif reached_end or c in "/?#" or url.is_special and c == "\\": # <<<<<<<<<<<<<< + * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< * if buffer: - * port = int(buffer) + * port: cython.int = int(buffer) */ - goto __pyx_L92; + goto __pyx_L66; } - /* "w3lib/_url.pyx":1199 + /* "w3lib/_url.pyx":1125 * pointer -= 1 * else: * raise ValueError # <<<<<<<<<<<<<< @@ -17872,410 +16641,88 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ /*else*/ { __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1199, __pyx_L1_error) + __PYX_ERR(0, 1125, __pyx_L1_error) } - __pyx_L92:; + __pyx_L66:; - /* "w3lib/_url.pyx":1185 + /* "w3lib/_url.pyx":1112 * buffer += c * * elif state == PORT: # <<<<<<<<<<<<<< * if not reached_end and c in _ASCII_DIGIT: * buffer += c */ - goto __pyx_L7; + goto __pyx_L6; } - /* "w3lib/_url.pyx":1201 + /* "w3lib/_url.pyx":1127 * raise ValueError * * elif state == FILE: # <<<<<<<<<<<<<< * url.scheme = "file" * url.hostname = "" */ - __pyx_t_8 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE); - if (__pyx_t_8) { + __pyx_t_7 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE); + if (__pyx_t_7) { - /* "w3lib/_url.pyx":1202 + /* "w3lib/_url.pyx":1128 * * elif state == FILE: * url.scheme = "file" # <<<<<<<<<<<<<< * url.hostname = "" * if not reached_end and c in "/\\": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2, __pyx_n_u_file) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme, __pyx_n_u_file) < 0) __PYX_ERR(0, 1128, __pyx_L1_error) - /* "w3lib/_url.pyx":1203 + /* "w3lib/_url.pyx":1129 * elif state == FILE: * url.scheme = "file" * url.hostname = "" # <<<<<<<<<<<<<< * if not reached_end and c in "/\\": * state = FILE_SLASH */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1203, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1129, __pyx_L1_error) - /* "w3lib/_url.pyx":1204 + /* "w3lib/_url.pyx":1130 * url.scheme = "file" * url.hostname = "" * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< * state = FILE_SLASH - * elif base is not None and base.scheme == "file": + * else: */ - __pyx_t_11 = (!__pyx_v_reached_end); - if (__pyx_t_11) { + __pyx_t_10 = (!__pyx_v_reached_end); + if (__pyx_t_10) { } else { - __pyx_t_8 = __pyx_t_11; - goto __pyx_L102_bool_binop_done; + __pyx_t_7 = __pyx_t_10; + goto __pyx_L76_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1204, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1204, __pyx_L1_error) - __pyx_t_8 = __pyx_t_11; - __pyx_L102_bool_binop_done:; - if (__pyx_t_8) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1130, __pyx_L1_error) } + __pyx_t_10 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1130, __pyx_L1_error) + __pyx_t_7 = __pyx_t_10; + __pyx_L76_bool_binop_done:; + if (__pyx_t_7) { - /* "w3lib/_url.pyx":1205 + /* "w3lib/_url.pyx":1131 * url.hostname = "" * if not reached_end and c in "/\\": * state = FILE_SLASH # <<<<<<<<<<<<<< - * elif base is not None and base.scheme == "file": - * url.hostname = base.hostname + * else: + * state = PATH */ __pyx_v_state = __pyx_v_5w3lib_4_url_FILE_SLASH; - /* "w3lib/_url.pyx":1204 + /* "w3lib/_url.pyx":1130 * url.scheme = "file" * url.hostname = "" * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< * state = FILE_SLASH - * elif base is not None and base.scheme == "file": - */ - goto __pyx_L101; - } - - /* "w3lib/_url.pyx":1206 - * if not reached_end and c in "/\\": - * state = FILE_SLASH - * elif base is not None and base.scheme == "file": # <<<<<<<<<<<<<< - * url.hostname = base.hostname - * url.path = base.path - */ - __pyx_t_11 = (__pyx_v_base != Py_None); - if (__pyx_t_11) { - } else { - __pyx_t_8 = __pyx_t_11; - goto __pyx_L104_bool_binop_done; - } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1206, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __pyx_t_11; - __pyx_L104_bool_binop_done:; - if (__pyx_t_8) { - - /* "w3lib/_url.pyx":1207 - * state = FILE_SLASH - * elif base is not None and base.scheme == "file": - * url.hostname = base.hostname # <<<<<<<<<<<<<< - * url.path = base.path - * url.query = base.query - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_5) < 0) __PYX_ERR(0, 1207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":1208 - * elif base is not None and base.scheme == "file": - * url.hostname = base.hostname - * url.path = base.path # <<<<<<<<<<<<<< - * url.query = base.query - * if not reached_end and c == "?": - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_5) < 0) __PYX_ERR(0, 1208, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":1209 - * url.hostname = base.hostname - * url.path = base.path - * url.query = base.query # <<<<<<<<<<<<<< - * if not reached_end and c == "?": - * url.query = "" - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_5) < 0) __PYX_ERR(0, 1209, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":1210 - * url.path = base.path - * url.query = base.query - * if not reached_end and c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY - */ - __pyx_t_11 = (!__pyx_v_reached_end); - if (__pyx_t_11) { - } else { - __pyx_t_8 = __pyx_t_11; - goto __pyx_L107_bool_binop_done; - } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1210, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1210, __pyx_L1_error) - __pyx_t_8 = __pyx_t_11; - __pyx_L107_bool_binop_done:; - if (__pyx_t_8) { - - /* "w3lib/_url.pyx":1211 - * url.query = base.query - * if not reached_end and c == "?": - * url.query = "" # <<<<<<<<<<<<<< - * state = QUERY - * elif not reached_end and c == "#": - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) - - /* "w3lib/_url.pyx":1212 - * if not reached_end and c == "?": - * url.query = "" - * state = QUERY # <<<<<<<<<<<<<< - * elif not reached_end and c == "#": - * url.fragment = "" - */ - __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - - /* "w3lib/_url.pyx":1210 - * url.path = base.path - * url.query = base.query - * if not reached_end and c == "?": # <<<<<<<<<<<<<< - * url.query = "" - * state = QUERY - */ - goto __pyx_L106; - } - - /* "w3lib/_url.pyx":1213 - * url.query = "" - * state = QUERY - * elif not reached_end and c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT - */ - __pyx_t_11 = (!__pyx_v_reached_end); - if (__pyx_t_11) { - } else { - __pyx_t_8 = __pyx_t_11; - goto __pyx_L109_bool_binop_done; - } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1213, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1213, __pyx_L1_error) - __pyx_t_8 = __pyx_t_11; - __pyx_L109_bool_binop_done:; - if (__pyx_t_8) { - - /* "w3lib/_url.pyx":1214 - * state = QUERY - * elif not reached_end and c == "#": - * url.fragment = "" # <<<<<<<<<<<<<< - * state = FRAGMENT - * elif not reached_end: - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1214, __pyx_L1_error) - - /* "w3lib/_url.pyx":1215 - * elif not reached_end and c == "#": - * url.fragment = "" - * state = FRAGMENT # <<<<<<<<<<<<<< - * elif not reached_end: - * url.query = None - */ - __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - - /* "w3lib/_url.pyx":1213 - * url.query = "" - * state = QUERY - * elif not reached_end and c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" - * state = FRAGMENT - */ - goto __pyx_L106; - } - - /* "w3lib/_url.pyx":1216 - * url.fragment = "" - * state = FRAGMENT - * elif not reached_end: # <<<<<<<<<<<<<< - * url.query = None - * if not _starts_with_windows_drive_letter(input[pointer:]): - */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { - - /* "w3lib/_url.pyx":1217 - * state = FRAGMENT - * elif not reached_end: - * url.query = None # <<<<<<<<<<<<<< - * if not _starts_with_windows_drive_letter(input[pointer:]): - * _shorten_path(url) - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 1217, __pyx_L1_error) - - /* "w3lib/_url.pyx":1218 - * elif not reached_end: - * url.query = None - * if not _starts_with_windows_drive_letter(input[pointer:]): # <<<<<<<<<<<<<< - * _shorten_path(url) - * else: - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__pyx_v_input == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1218, __pyx_L1_error) - } - __Pyx_INCREF(__pyx_v_pointer); - __pyx_t_3 = __pyx_v_pointer; - __pyx_t_8 = (__pyx_t_3 == Py_None); - if (__pyx_t_8) { - __pyx_t_9 = 0; - } else { - __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1218, __pyx_L1_error) - __pyx_t_9 = __pyx_t_7; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_9, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_3}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1218, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = (!__pyx_t_8); - if (__pyx_t_11) { - - /* "w3lib/_url.pyx":1219 - * url.query = None - * if not _starts_with_windows_drive_letter(input[pointer:]): - * _shorten_path(url) # <<<<<<<<<<<<<< - * else: - * url.path = [] - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_url}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":1218 - * elif not reached_end: - * url.query = None - * if not _starts_with_windows_drive_letter(input[pointer:]): # <<<<<<<<<<<<<< - * _shorten_path(url) - * else: - */ - goto __pyx_L111; - } - - /* "w3lib/_url.pyx":1221 - * _shorten_path(url) - * else: - * url.path = [] # <<<<<<<<<<<<<< - * state = PATH - * pointer -= 1 - */ - /*else*/ { - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_5) < 0) __PYX_ERR(0, 1221, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_L111:; - - /* "w3lib/_url.pyx":1222 - * else: - * url.path = [] - * state = PATH # <<<<<<<<<<<<<< - * pointer -= 1 * else: */ - __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - - /* "w3lib/_url.pyx":1223 - * url.path = [] - * state = PATH - * pointer -= 1 # <<<<<<<<<<<<<< - * else: - * state = PATH - */ - __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_5); - __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":1216 - * url.fragment = "" - * state = FRAGMENT - * elif not reached_end: # <<<<<<<<<<<<<< - * url.query = None - * if not _starts_with_windows_drive_letter(input[pointer:]): - */ - } - __pyx_L106:; - - /* "w3lib/_url.pyx":1206 - * if not reached_end and c in "/\\": - * state = FILE_SLASH - * elif base is not None and base.scheme == "file": # <<<<<<<<<<<<<< - * url.hostname = base.hostname - * url.path = base.path - */ - goto __pyx_L101; + goto __pyx_L75; } - /* "w3lib/_url.pyx":1225 - * pointer -= 1 + /* "w3lib/_url.pyx":1133 + * state = FILE_SLASH * else: * state = PATH # <<<<<<<<<<<<<< * pointer -= 1 @@ -18284,316 +16731,123 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1226 + /* "w3lib/_url.pyx":1134 * else: * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == FILE_SLASH: */ - __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); + __pyx_t_2 = 0; } - __pyx_L101:; + __pyx_L75:; - /* "w3lib/_url.pyx":1201 + /* "w3lib/_url.pyx":1127 * raise ValueError * * elif state == FILE: # <<<<<<<<<<<<<< * url.scheme = "file" * url.hostname = "" */ - goto __pyx_L7; + goto __pyx_L6; } - /* "w3lib/_url.pyx":1228 + /* "w3lib/_url.pyx":1136 * pointer -= 1 * * elif state == FILE_SLASH: # <<<<<<<<<<<<<< * if not reached_end and c in "/\\": * state = FILE_HOST */ - __pyx_t_11 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_SLASH); - if (__pyx_t_11) { + __pyx_t_7 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_SLASH); + if (__pyx_t_7) { - /* "w3lib/_url.pyx":1229 + /* "w3lib/_url.pyx":1137 * * elif state == FILE_SLASH: * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< * state = FILE_HOST * else: */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { + __pyx_t_10 = (!__pyx_v_reached_end); + if (__pyx_t_10) { } else { - __pyx_t_11 = __pyx_t_8; - goto __pyx_L113_bool_binop_done; + __pyx_t_7 = __pyx_t_10; + goto __pyx_L79_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1229, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) - __pyx_t_11 = __pyx_t_8; - __pyx_L113_bool_binop_done:; - if (__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1137, __pyx_L1_error) } + __pyx_t_10 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1137, __pyx_L1_error) + __pyx_t_7 = __pyx_t_10; + __pyx_L79_bool_binop_done:; + if (__pyx_t_7) { - /* "w3lib/_url.pyx":1230 + /* "w3lib/_url.pyx":1138 * elif state == FILE_SLASH: * if not reached_end and c in "/\\": * state = FILE_HOST # <<<<<<<<<<<<<< * else: - * if base is not None and base.scheme == "file": + * state = PATH */ __pyx_v_state = __pyx_v_5w3lib_4_url_FILE_HOST; - /* "w3lib/_url.pyx":1229 + /* "w3lib/_url.pyx":1137 * * elif state == FILE_SLASH: * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< * state = FILE_HOST * else: */ - goto __pyx_L112; + goto __pyx_L78; } - /* "w3lib/_url.pyx":1232 - * state = FILE_HOST - * else: - * if base is not None and base.scheme == "file": # <<<<<<<<<<<<<< - * url.hostname = base.hostname - * if not _starts_with_windows_drive_letter( - */ - /*else*/ { - __pyx_t_8 = (__pyx_v_base != Py_None); - if (__pyx_t_8) { - } else { - __pyx_t_11 = __pyx_t_8; - goto __pyx_L116_bool_binop_done; - } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1232, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __pyx_t_8; - __pyx_L116_bool_binop_done:; - if (__pyx_t_11) { - - /* "w3lib/_url.pyx":1233 - * else: - * if base is not None and base.scheme == "file": - * url.hostname = base.hostname # <<<<<<<<<<<<<< - * if not _starts_with_windows_drive_letter( - * input[pointer:] - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_hostname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_5) < 0) __PYX_ERR(0, 1233, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":1234 - * if base is not None and base.scheme == "file": - * url.hostname = base.hostname - * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< - * input[pointer:] - * ) and _is_windows_drive_letter(base.path[0]): - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_starts_with_windows_drive_lette); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "w3lib/_url.pyx":1235 - * url.hostname = base.hostname - * if not _starts_with_windows_drive_letter( - * input[pointer:] # <<<<<<<<<<<<<< - * ) and _is_windows_drive_letter(base.path[0]): - * url.path.append(base.path[0]) - */ - if (unlikely(__pyx_v_input == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1235, __pyx_L1_error) - } - __Pyx_INCREF(__pyx_v_pointer); - __pyx_t_3 = __pyx_v_pointer; - __pyx_t_8 = (__pyx_t_3 == Py_None); - if (__pyx_t_8) { - __pyx_t_9 = 0; - } else { - __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1235, __pyx_L1_error) - __pyx_t_9 = __pyx_t_7; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_input, __pyx_t_9, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_3}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - - /* "w3lib/_url.pyx":1234 - * if base is not None and base.scheme == "file": - * url.hostname = base.hostname - * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< - * input[pointer:] - * ) and _is_windows_drive_letter(base.path[0]): - */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = (!__pyx_t_8); - if (__pyx_t_1) { - } else { - __pyx_t_11 = __pyx_t_1; - goto __pyx_L119_bool_binop_done; - } - - /* "w3lib/_url.pyx":1236 - * if not _starts_with_windows_drive_letter( - * input[pointer:] - * ) and _is_windows_drive_letter(base.path[0]): # <<<<<<<<<<<<<< - * url.path.append(base.path[0]) - * state = PATH - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_12}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1236, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __pyx_t_1; - __pyx_L119_bool_binop_done:; - - /* "w3lib/_url.pyx":1234 - * if base is not None and base.scheme == "file": - * url.hostname = base.hostname - * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< - * input[pointer:] - * ) and _is_windows_drive_letter(base.path[0]): - */ - if (__pyx_t_11) { - - /* "w3lib/_url.pyx":1237 - * input[pointer:] - * ) and _is_windows_drive_letter(base.path[0]): - * url.path.append(base.path[0]) # <<<<<<<<<<<<<< - * state = PATH - * pointer -= 1 - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_5, __pyx_t_12); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 1237, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "w3lib/_url.pyx":1234 - * if base is not None and base.scheme == "file": - * url.hostname = base.hostname - * if not _starts_with_windows_drive_letter( # <<<<<<<<<<<<<< - * input[pointer:] - * ) and _is_windows_drive_letter(base.path[0]): - */ - } - - /* "w3lib/_url.pyx":1232 + /* "w3lib/_url.pyx":1140 * state = FILE_HOST * else: - * if base is not None and base.scheme == "file": # <<<<<<<<<<<<<< - * url.hostname = base.hostname - * if not _starts_with_windows_drive_letter( - */ - } - - /* "w3lib/_url.pyx":1238 - * ) and _is_windows_drive_letter(base.path[0]): - * url.path.append(base.path[0]) * state = PATH # <<<<<<<<<<<<<< * pointer -= 1 * */ + /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1239 - * url.path.append(base.path[0]) + /* "w3lib/_url.pyx":1141 + * else: * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == FILE_HOST: */ - __pyx_t_12 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_12); - __pyx_t_12 = 0; + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); + __pyx_t_2 = 0; } - __pyx_L112:; + __pyx_L78:; - /* "w3lib/_url.pyx":1228 + /* "w3lib/_url.pyx":1136 * pointer -= 1 * * elif state == FILE_SLASH: # <<<<<<<<<<<<<< * if not reached_end and c in "/\\": * state = FILE_HOST */ - goto __pyx_L7; + goto __pyx_L6; } - /* "w3lib/_url.pyx":1241 + /* "w3lib/_url.pyx":1143 * pointer -= 1 * * elif state == FILE_HOST: # <<<<<<<<<<<<<< * if reached_end or c in "/\\?#": * pointer -= 1 */ - __pyx_t_11 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_HOST); - if (__pyx_t_11) { + __pyx_t_7 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_HOST); + if (__pyx_t_7) { - /* "w3lib/_url.pyx":1242 + /* "w3lib/_url.pyx":1144 * * elif state == FILE_HOST: * if reached_end or c in "/\\?#": # <<<<<<<<<<<<<< @@ -18602,63 +16856,63 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ if (!__pyx_v_reached_end) { } else { - __pyx_t_11 = __pyx_v_reached_end; - goto __pyx_L122_bool_binop_done; + __pyx_t_7 = __pyx_v_reached_end; + goto __pyx_L82_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1242, __pyx_L1_error) } - __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1242, __pyx_L1_error) - __pyx_t_11 = __pyx_t_1; - __pyx_L122_bool_binop_done:; - if (__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1144, __pyx_L1_error) } + __pyx_t_10 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1144, __pyx_L1_error) + __pyx_t_7 = __pyx_t_10; + __pyx_L82_bool_binop_done:; + if (__pyx_t_7) { - /* "w3lib/_url.pyx":1243 + /* "w3lib/_url.pyx":1145 * elif state == FILE_HOST: * if reached_end or c in "/\\?#": * pointer -= 1 # <<<<<<<<<<<<<< * if _is_windows_drive_letter(buffer): * state = PATH */ - __pyx_t_12 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_12); - __pyx_t_12 = 0; + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); + __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1244 + /* "w3lib/_url.pyx":1146 * if reached_end or c in "/\\?#": * pointer -= 1 * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< * state = PATH * elif not buffer: */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = NULL; - __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = NULL; + __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_6 = 1; + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_buffer}; - __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_buffer}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1244, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__pyx_t_11) { + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_7) { - /* "w3lib/_url.pyx":1245 + /* "w3lib/_url.pyx":1147 * pointer -= 1 * if _is_windows_drive_letter(buffer): * state = PATH # <<<<<<<<<<<<<< @@ -18667,134 +16921,133 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1244 + /* "w3lib/_url.pyx":1146 * if reached_end or c in "/\\?#": * pointer -= 1 * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< * state = PATH * elif not buffer: */ - goto __pyx_L124; + goto __pyx_L84; } - /* "w3lib/_url.pyx":1246 + /* "w3lib/_url.pyx":1148 * if _is_windows_drive_letter(buffer): * state = PATH * elif not buffer: # <<<<<<<<<<<<<< * url.hostname = "" * state = PATH_START */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1246, __pyx_L1_error) - __pyx_t_1 = (!__pyx_t_11); - if (__pyx_t_1) { + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1148, __pyx_L1_error) + __pyx_t_10 = (!__pyx_t_7); + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1247 + /* "w3lib/_url.pyx":1149 * state = PATH * elif not buffer: * url.hostname = "" # <<<<<<<<<<<<<< * state = PATH_START * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1247, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1149, __pyx_L1_error) - /* "w3lib/_url.pyx":1248 + /* "w3lib/_url.pyx":1150 * elif not buffer: * url.hostname = "" * state = PATH_START # <<<<<<<<<<<<<< * else: - * host = _parse_host(buffer, is_special=url.is_special) + * url = _parse_host(buffer, url) */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":1246 + /* "w3lib/_url.pyx":1148 * if _is_windows_drive_letter(buffer): * state = PATH * elif not buffer: # <<<<<<<<<<<<<< * url.hostname = "" * state = PATH_START */ - goto __pyx_L124; + goto __pyx_L84; } - /* "w3lib/_url.pyx":1250 - * state = PATH_START + /* "w3lib/_url.pyx":1152 + * state = PATH_START + * else: + * url = _parse_host(buffer, url) # <<<<<<<<<<<<<< + * if url.hostname == "localhost": + * url.hostname = "" + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_buffer, __pyx_v_url}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF_SET(__pyx_v_url, __pyx_t_2); + __pyx_t_2 = 0; + + /* "w3lib/_url.pyx":1153 * else: - * host = _parse_host(buffer, is_special=url.is_special) # <<<<<<<<<<<<<< - * if host == "localhost": - * host = "" + * url = _parse_host(buffer, url) + * if url.hostname == "localhost": # <<<<<<<<<<<<<< + * url.hostname = "" + * buffer = "" */ - /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_v_buffer); - __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_buffer)) __PYX_ERR(0, 1250, __pyx_L1_error); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1250, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_special, __pyx_t_3) < 0) __PYX_ERR(0, 1250, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_localhost, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_3); - __pyx_t_3 = 0; + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1251 - * else: - * host = _parse_host(buffer, is_special=url.is_special) - * if host == "localhost": # <<<<<<<<<<<<<< - * host = "" - * url.hostname = host - */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_host, __pyx_n_u_localhost, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1251, __pyx_L1_error) - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":1252 - * host = _parse_host(buffer, is_special=url.is_special) - * if host == "localhost": - * host = "" # <<<<<<<<<<<<<< - * url.hostname = host + /* "w3lib/_url.pyx":1154 + * url = _parse_host(buffer, url) + * if url.hostname == "localhost": + * url.hostname = "" # <<<<<<<<<<<<<< * buffer = "" + * state = PATH_START */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_host, __pyx_kp_u__2); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1154, __pyx_L1_error) - /* "w3lib/_url.pyx":1251 + /* "w3lib/_url.pyx":1153 * else: - * host = _parse_host(buffer, is_special=url.is_special) - * if host == "localhost": # <<<<<<<<<<<<<< - * host = "" - * url.hostname = host - */ - } - - /* "w3lib/_url.pyx":1253 - * if host == "localhost": - * host = "" - * url.hostname = host # <<<<<<<<<<<<<< + * url = _parse_host(buffer, url) + * if url.hostname == "localhost": # <<<<<<<<<<<<<< + * url.hostname = "" * buffer = "" - * state = PATH_START */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_host) < 0) __PYX_ERR(0, 1253, __pyx_L1_error) + } - /* "w3lib/_url.pyx":1254 - * host = "" - * url.hostname = host + /* "w3lib/_url.pyx":1155 + * if url.hostname == "localhost": + * url.hostname = "" * buffer = "" # <<<<<<<<<<<<<< * state = PATH_START * elif not reached_end: */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + __Pyx_INCREF(__pyx_kp_u_); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1255 - * url.hostname = host + /* "w3lib/_url.pyx":1156 + * url.hostname = "" * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< * elif not reached_end: @@ -18802,42 +17055,42 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; } - __pyx_L124:; + __pyx_L84:; - /* "w3lib/_url.pyx":1242 + /* "w3lib/_url.pyx":1144 * * elif state == FILE_HOST: * if reached_end or c in "/\\?#": # <<<<<<<<<<<<<< * pointer -= 1 * if _is_windows_drive_letter(buffer): */ - goto __pyx_L121; + goto __pyx_L81; } - /* "w3lib/_url.pyx":1256 + /* "w3lib/_url.pyx":1157 * buffer = "" * state = PATH_START * elif not reached_end: # <<<<<<<<<<<<<< * buffer += c * */ - __pyx_t_1 = (!__pyx_v_reached_end); - if (__pyx_t_1) { + __pyx_t_10 = (!__pyx_v_reached_end); + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1257 + /* "w3lib/_url.pyx":1158 * state = PATH_START * elif not reached_end: * buffer += c # <<<<<<<<<<<<<< * * elif state == PATH_START: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1257, __pyx_L1_error) } - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_3); - __pyx_t_3 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1158, __pyx_L1_error) } + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_2); + __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1256 + /* "w3lib/_url.pyx":1157 * buffer = "" * state = PATH_START * elif not reached_end: # <<<<<<<<<<<<<< @@ -18845,83 +17098,86 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * */ } - __pyx_L121:; + __pyx_L81:; - /* "w3lib/_url.pyx":1241 + /* "w3lib/_url.pyx":1143 * pointer -= 1 * * elif state == FILE_HOST: # <<<<<<<<<<<<<< * if reached_end or c in "/\\?#": * pointer -= 1 */ - goto __pyx_L7; + goto __pyx_L6; } - /* "w3lib/_url.pyx":1259 + /* "w3lib/_url.pyx":1160 * buffer += c * * elif state == PATH_START: # <<<<<<<<<<<<<< - * if url.is_special: + * if url.scheme in _SPECIAL_SCHEMES: * state = PATH */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH_START); - if (__pyx_t_1) { + __pyx_t_10 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH_START); + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1260 + /* "w3lib/_url.pyx":1161 * * elif state == PATH_START: - * if url.is_special: # <<<<<<<<<<<<<< + * if url.scheme in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< * state = PATH * if not reached_end and c not in "/\\": */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1260, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1161, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1261 + /* "w3lib/_url.pyx":1162 * elif state == PATH_START: - * if url.is_special: + * if url.scheme in _SPECIAL_SCHEMES: * state = PATH # <<<<<<<<<<<<<< * if not reached_end and c not in "/\\": * pointer -= 1 */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1262 - * if url.is_special: + /* "w3lib/_url.pyx":1163 + * if url.scheme in _SPECIAL_SCHEMES: * state = PATH * if not reached_end and c not in "/\\": # <<<<<<<<<<<<<< * pointer -= 1 * elif not reached_end: */ - __pyx_t_11 = (!__pyx_v_reached_end); - if (__pyx_t_11) { + __pyx_t_7 = (!__pyx_v_reached_end); + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L128_bool_binop_done; + __pyx_t_10 = __pyx_t_7; + goto __pyx_L88_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1262, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1262, __pyx_L1_error) - __pyx_t_1 = __pyx_t_11; - __pyx_L128_bool_binop_done:; - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1163, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__14, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1163, __pyx_L1_error) + __pyx_t_10 = __pyx_t_7; + __pyx_L88_bool_binop_done:; + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1263 + /* "w3lib/_url.pyx":1164 * state = PATH * if not reached_end and c not in "/\\": * pointer -= 1 # <<<<<<<<<<<<<< * elif not reached_end: * if c == "?": */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1262 - * if url.is_special: + /* "w3lib/_url.pyx":1163 + * if url.scheme in _SPECIAL_SCHEMES: * state = PATH * if not reached_end and c not in "/\\": # <<<<<<<<<<<<<< * pointer -= 1 @@ -18929,105 +17185,105 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1260 + /* "w3lib/_url.pyx":1161 * * elif state == PATH_START: - * if url.is_special: # <<<<<<<<<<<<<< + * if url.scheme in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< * state = PATH * if not reached_end and c not in "/\\": */ - goto __pyx_L126; + goto __pyx_L86; } - /* "w3lib/_url.pyx":1264 + /* "w3lib/_url.pyx":1165 * if not reached_end and c not in "/\\": * pointer -= 1 * elif not reached_end: # <<<<<<<<<<<<<< * if c == "?": - * url.query = "" + * url._query_token_seen = True */ - __pyx_t_1 = (!__pyx_v_reached_end); - if (__pyx_t_1) { + __pyx_t_10 = (!__pyx_v_reached_end); + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1265 + /* "w3lib/_url.pyx":1166 * pointer -= 1 * elif not reached_end: * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" + * url._query_token_seen = True * state = QUERY */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1265, __pyx_L1_error) } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error) - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1166, __pyx_L1_error) } + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1166, __pyx_L1_error) + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1266 + /* "w3lib/_url.pyx":1167 * elif not reached_end: * if c == "?": - * url.query = "" # <<<<<<<<<<<<<< + * url._query_token_seen = True # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1266, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1167, __pyx_L1_error) - /* "w3lib/_url.pyx":1267 + /* "w3lib/_url.pyx":1168 * if c == "?": - * url.query = "" + * url._query_token_seen = True * state = QUERY # <<<<<<<<<<<<<< * elif c == "#": - * url.fragment = "" + * url._fragment_token_seen = True */ __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":1265 + /* "w3lib/_url.pyx":1166 * pointer -= 1 * elif not reached_end: * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" + * url._query_token_seen = True * state = QUERY */ - goto __pyx_L130; + goto __pyx_L90; } - /* "w3lib/_url.pyx":1268 - * url.query = "" + /* "w3lib/_url.pyx":1169 + * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" + * url._fragment_token_seen = True * state = FRAGMENT */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1268, __pyx_L1_error) } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1268, __pyx_L1_error) - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1169, __pyx_L1_error) } + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1169, __pyx_L1_error) + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1269 + /* "w3lib/_url.pyx":1170 * state = QUERY * elif c == "#": - * url.fragment = "" # <<<<<<<<<<<<<< + * url._fragment_token_seen = True # <<<<<<<<<<<<<< * state = FRAGMENT * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1269, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1170, __pyx_L1_error) - /* "w3lib/_url.pyx":1270 + /* "w3lib/_url.pyx":1171 * elif c == "#": - * url.fragment = "" + * url._fragment_token_seen = True * state = FRAGMENT # <<<<<<<<<<<<<< * else: * state = PATH */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1268 - * url.query = "" + /* "w3lib/_url.pyx":1169 + * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" + * url._fragment_token_seen = True * state = FRAGMENT */ - goto __pyx_L130; + goto __pyx_L90; } - /* "w3lib/_url.pyx":1272 + /* "w3lib/_url.pyx":1173 * state = FRAGMENT * else: * state = PATH # <<<<<<<<<<<<<< @@ -19037,30 +17293,30 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1273 + /* "w3lib/_url.pyx":1174 * else: * state = PATH * if c != "/": # <<<<<<<<<<<<<< * pointer -= 1 * */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1273, __pyx_L1_error) } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1273, __pyx_L1_error) - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1174, __pyx_L1_error) } + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1174, __pyx_L1_error) + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1274 + /* "w3lib/_url.pyx":1175 * state = PATH * if c != "/": * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == PATH: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1273 + /* "w3lib/_url.pyx":1174 * else: * state = PATH * if c != "/": # <<<<<<<<<<<<<< @@ -19069,309 +17325,318 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } } - __pyx_L130:; + __pyx_L90:; - /* "w3lib/_url.pyx":1264 + /* "w3lib/_url.pyx":1165 * if not reached_end and c not in "/\\": * pointer -= 1 * elif not reached_end: # <<<<<<<<<<<<<< * if c == "?": - * url.query = "" + * url._query_token_seen = True */ } - __pyx_L126:; + __pyx_L86:; - /* "w3lib/_url.pyx":1259 + /* "w3lib/_url.pyx":1160 * buffer += c * * elif state == PATH_START: # <<<<<<<<<<<<<< - * if url.is_special: + * if url.scheme in _SPECIAL_SCHEMES: * state = PATH */ - goto __pyx_L7; + goto __pyx_L6; } - /* "w3lib/_url.pyx":1276 + /* "w3lib/_url.pyx":1177 * pointer -= 1 * * elif state == PATH: # <<<<<<<<<<<<<< - * if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH); - if (__pyx_t_1) { + __pyx_t_10 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH); + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1277 + /* "w3lib/_url.pyx":1178 * * elif state == PATH: - * if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": # <<<<<<<<<<<<<< + * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": # <<<<<<<<<<<<<< * if _is_double_dot_path_segment(buffer): * _shorten_path(url) */ if (!__pyx_v_reached_end) { } else { - __pyx_t_1 = __pyx_v_reached_end; - goto __pyx_L133_bool_binop_done; + __pyx_t_10 = __pyx_v_reached_end; + goto __pyx_L93_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1277, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1277, __pyx_L1_error) - if (!__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1178, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) + if (!__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L133_bool_binop_done; + __pyx_t_10 = __pyx_t_7; + goto __pyx_L93_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1277, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!__pyx_t_11) { - goto __pyx_L136_next_or; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_7) { + goto __pyx_L96_next_or; } else { } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1277, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1277, __pyx_L1_error) - if (!__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1178, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) + if (!__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L133_bool_binop_done; + __pyx_t_10 = __pyx_t_7; + goto __pyx_L93_bool_binop_done; } - __pyx_L136_next_or:; - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1277, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1277, __pyx_L1_error) - __pyx_t_1 = __pyx_t_11; - __pyx_L133_bool_binop_done:; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":1278 + __pyx_L96_next_or:; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1178, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__21, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) + __pyx_t_10 = __pyx_t_7; + __pyx_L93_bool_binop_done:; + if (__pyx_t_10) { + + /* "w3lib/_url.pyx":1179 * elif state == PATH: - * if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< * _shorten_path(url) - * if c != "/" and not (url.is_special and c == "\\"): + * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_double_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_double_dot_path_segment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = NULL; + __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_buffer}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_buffer}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1278, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1179, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1279 - * if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": + /* "w3lib/_url.pyx":1180 + * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): * _shorten_path(url) # <<<<<<<<<<<<<< - * if c != "/" and not (url.is_special and c == "\\"): + * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = NULL; + __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_url}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_url}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1280 + /* "w3lib/_url.pyx":1181 * if _is_double_dot_path_segment(buffer): * _shorten_path(url) - * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< + * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): # <<<<<<<<<<<<<< * url.path.append("") * elif _is_single_dot_path_segment(buffer): */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1280, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1280, __pyx_L1_error) - if (__pyx_t_11) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1181, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1181, __pyx_L1_error) + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L140_bool_binop_done; + __pyx_t_10 = __pyx_t_7; + goto __pyx_L100_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1280, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_8) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1181, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { } else { - __pyx_t_11 = __pyx_t_8; - goto __pyx_L142_bool_binop_done; + __pyx_t_7 = __pyx_t_6; + goto __pyx_L102_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1280, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1280, __pyx_L1_error) - __pyx_t_11 = __pyx_t_8; - __pyx_L142_bool_binop_done:; - __pyx_t_8 = (!__pyx_t_11); - __pyx_t_1 = __pyx_t_8; - __pyx_L140_bool_binop_done:; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":1281 + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1181, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_7 = __pyx_t_6; + __pyx_L102_bool_binop_done:; + __pyx_t_6 = (!__pyx_t_7); + __pyx_t_10 = __pyx_t_6; + __pyx_L100_bool_binop_done:; + if (__pyx_t_10) { + + /* "w3lib/_url.pyx":1182 * _shorten_path(url) - * if c != "/" and not (url.is_special and c == "\\"): + * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") # <<<<<<<<<<<<<< * elif _is_single_dot_path_segment(buffer): - * if c != "/" and not (url.is_special and c == "\\"): + * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 1281, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_kp_u_); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1182, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1280 + /* "w3lib/_url.pyx":1181 * if _is_double_dot_path_segment(buffer): * _shorten_path(url) - * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< + * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): # <<<<<<<<<<<<<< * url.path.append("") * elif _is_single_dot_path_segment(buffer): */ } - /* "w3lib/_url.pyx":1278 + /* "w3lib/_url.pyx":1179 * elif state == PATH: - * if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< * _shorten_path(url) - * if c != "/" and not (url.is_special and c == "\\"): + * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): */ - goto __pyx_L138; + goto __pyx_L98; } - /* "w3lib/_url.pyx":1282 - * if c != "/" and not (url.is_special and c == "\\"): + /* "w3lib/_url.pyx":1183 + * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< - * if c != "/" and not (url.is_special and c == "\\"): + * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_single_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1282, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_single_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; + __pyx_t_12 = NULL; + __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; + __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_buffer}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_buffer}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1282, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1183, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1283 + /* "w3lib/_url.pyx":1184 * url.path.append("") * elif _is_single_dot_path_segment(buffer): - * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< + * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): # <<<<<<<<<<<<<< * url.path.append("") * else: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1283, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1283, __pyx_L1_error) - if (__pyx_t_8) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1184, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1184, __pyx_L1_error) + if (__pyx_t_6) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L145_bool_binop_done; + __pyx_t_10 = __pyx_t_6; + goto __pyx_L105_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1283, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_11) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1184, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_7) { } else { - __pyx_t_8 = __pyx_t_11; - goto __pyx_L147_bool_binop_done; + __pyx_t_6 = __pyx_t_7; + goto __pyx_L107_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1283, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1283, __pyx_L1_error) - __pyx_t_8 = __pyx_t_11; - __pyx_L147_bool_binop_done:; - __pyx_t_11 = (!__pyx_t_8); - __pyx_t_1 = __pyx_t_11; - __pyx_L145_bool_binop_done:; - if (__pyx_t_1) { - - /* "w3lib/_url.pyx":1284 + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1184, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_6 = __pyx_t_7; + __pyx_L107_bool_binop_done:; + __pyx_t_7 = (!__pyx_t_6); + __pyx_t_10 = __pyx_t_7; + __pyx_L105_bool_binop_done:; + if (__pyx_t_10) { + + /* "w3lib/_url.pyx":1185 * elif _is_single_dot_path_segment(buffer): - * if c != "/" and not (url.is_special and c == "\\"): + * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") # <<<<<<<<<<<<<< * else: * if ( */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_kp_u__2); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 1284, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_kp_u_); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1185, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1283 + /* "w3lib/_url.pyx":1184 * url.path.append("") * elif _is_single_dot_path_segment(buffer): - * if c != "/" and not (url.is_special and c == "\\"): # <<<<<<<<<<<<<< + * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): # <<<<<<<<<<<<<< * url.path.append("") * else: */ } - /* "w3lib/_url.pyx":1282 - * if c != "/" and not (url.is_special and c == "\\"): + /* "w3lib/_url.pyx":1183 + * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< - * if c != "/" and not (url.is_special and c == "\\"): + * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") */ - goto __pyx_L138; + goto __pyx_L98; } - /* "w3lib/_url.pyx":1286 + /* "w3lib/_url.pyx":1187 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< @@ -19380,108 +17645,108 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ /*else*/ { - /* "w3lib/_url.pyx":1287 + /* "w3lib/_url.pyx":1188 * else: * if ( * url.scheme == "file" # <<<<<<<<<<<<<< * and not url.path * and _is_windows_drive_letter(buffer) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1287, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_11) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L150_bool_binop_done; + __pyx_t_10 = __pyx_t_7; + goto __pyx_L110_bool_binop_done; } - /* "w3lib/_url.pyx":1288 + /* "w3lib/_url.pyx":1189 * if ( * url.scheme == "file" * and not url.path # <<<<<<<<<<<<<< * and _is_windows_drive_letter(buffer) * ): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1288, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = (!__pyx_t_11); - if (__pyx_t_8) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = (!__pyx_t_7); + if (__pyx_t_6) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L150_bool_binop_done; + __pyx_t_10 = __pyx_t_6; + goto __pyx_L110_bool_binop_done; } - /* "w3lib/_url.pyx":1289 + /* "w3lib/_url.pyx":1190 * url.scheme == "file" * and not url.path * and _is_windows_drive_letter(buffer) # <<<<<<<<<<<<<< * ): * buffer = buffer[0] + ":" + buffer[2:] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = NULL; + __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_buffer}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_buffer}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1289, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_8; - __pyx_L150_bool_binop_done:; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __pyx_t_6; + __pyx_L110_bool_binop_done:; - /* "w3lib/_url.pyx":1286 + /* "w3lib/_url.pyx":1187 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< * url.scheme == "file" * and not url.path */ - if (__pyx_t_1) { + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1291 + /* "w3lib/_url.pyx":1192 * and _is_windows_drive_letter(buffer) * ): * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< * if ( * not url.path */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_buffer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_buffer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_buffer, 2, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_buffer, 2, 0, NULL, NULL, &__pyx_slice__22, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_12); + __pyx_t_12 = 0; - /* "w3lib/_url.pyx":1286 + /* "w3lib/_url.pyx":1187 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< @@ -19490,104 +17755,104 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1293 + /* "w3lib/_url.pyx":1194 * buffer = buffer[0] + ":" + buffer[2:] * if ( * not url.path # <<<<<<<<<<<<<< * and not buffer * and not reached_end */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1293, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1293, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = (!__pyx_t_8); - if (__pyx_t_11) { + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_7 = (!__pyx_t_6); + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L154_bool_binop_done; + __pyx_t_10 = __pyx_t_7; + goto __pyx_L114_bool_binop_done; } - /* "w3lib/_url.pyx":1294 + /* "w3lib/_url.pyx":1195 * if ( * not url.path * and not buffer # <<<<<<<<<<<<<< * and not reached_end * and c in "?#" */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1294, __pyx_L1_error) - __pyx_t_8 = (!__pyx_t_11); - if (__pyx_t_8) { + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1195, __pyx_L1_error) + __pyx_t_6 = (!__pyx_t_7); + if (__pyx_t_6) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L154_bool_binop_done; + __pyx_t_10 = __pyx_t_6; + goto __pyx_L114_bool_binop_done; } - /* "w3lib/_url.pyx":1295 + /* "w3lib/_url.pyx":1196 * not url.path * and not buffer * and not reached_end # <<<<<<<<<<<<<< * and c in "?#" * and input[pointer - 1] not in "/\\" */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { + __pyx_t_6 = (!__pyx_v_reached_end); + if (__pyx_t_6) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L154_bool_binop_done; + __pyx_t_10 = __pyx_t_6; + goto __pyx_L114_bool_binop_done; } - /* "w3lib/_url.pyx":1296 + /* "w3lib/_url.pyx":1197 * and not buffer * and not reached_end * and c in "?#" # <<<<<<<<<<<<<< * and input[pointer - 1] not in "/\\" * ): */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1296, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1296, __pyx_L1_error) - if (__pyx_t_8) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1197, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__21, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1197, __pyx_L1_error) + if (__pyx_t_6) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L154_bool_binop_done; + __pyx_t_10 = __pyx_t_6; + goto __pyx_L114_bool_binop_done; } - /* "w3lib/_url.pyx":1297 + /* "w3lib/_url.pyx":1198 * and not reached_end * and c in "?#" * and input[pointer - 1] not in "/\\" # <<<<<<<<<<<<<< * ): * url._path_token_seen = True */ - __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1297, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1297, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_t_3, __pyx_kp_u__15, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1297, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_8; - __pyx_L154_bool_binop_done:; + __pyx_t_12 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_t_2, __pyx_kp_u__14, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __pyx_t_6; + __pyx_L114_bool_binop_done:; - /* "w3lib/_url.pyx":1292 + /* "w3lib/_url.pyx":1193 * ): * buffer = buffer[0] + ":" + buffer[2:] * if ( # <<<<<<<<<<<<<< * not url.path * and not buffer */ - if (__pyx_t_1) { + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1299 + /* "w3lib/_url.pyx":1200 * and input[pointer - 1] not in "/\\" * ): * url._path_token_seen = True # <<<<<<<<<<<<<< * url.path.append(buffer) * buffer = "" */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen, Py_True) < 0) __PYX_ERR(0, 1299, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen, Py_True) < 0) __PYX_ERR(0, 1200, __pyx_L1_error) - /* "w3lib/_url.pyx":1292 + /* "w3lib/_url.pyx":1193 * ): * buffer = buffer[0] + ":" + buffer[2:] * if ( # <<<<<<<<<<<<<< @@ -19596,138 +17861,138 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1300 + /* "w3lib/_url.pyx":1201 * ): * url._path_token_seen = True * url.path.append(buffer) # <<<<<<<<<<<<<< * buffer = "" * if not reached_end: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_buffer); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 1300, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_v_buffer); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_L138:; + __pyx_L98:; - /* "w3lib/_url.pyx":1301 + /* "w3lib/_url.pyx":1202 * url._path_token_seen = True * url.path.append(buffer) * buffer = "" # <<<<<<<<<<<<<< * if not reached_end: * if c == "?": */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + __Pyx_INCREF(__pyx_kp_u_); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1302 + /* "w3lib/_url.pyx":1203 * url.path.append(buffer) * buffer = "" * if not reached_end: # <<<<<<<<<<<<<< * if c == "?": - * url.query = "" + * url._query_token_seen = True */ - __pyx_t_1 = (!__pyx_v_reached_end); - if (__pyx_t_1) { + __pyx_t_10 = (!__pyx_v_reached_end); + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1303 + /* "w3lib/_url.pyx":1204 * buffer = "" * if not reached_end: * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" + * url._query_token_seen = True * state = QUERY */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1303, __pyx_L1_error) } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1303, __pyx_L1_error) - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1204, __pyx_L1_error) } + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1204, __pyx_L1_error) + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1304 + /* "w3lib/_url.pyx":1205 * if not reached_end: * if c == "?": - * url.query = "" # <<<<<<<<<<<<<< + * url._query_token_seen = True # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1304, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1205, __pyx_L1_error) - /* "w3lib/_url.pyx":1305 + /* "w3lib/_url.pyx":1206 * if c == "?": - * url.query = "" + * url._query_token_seen = True * state = QUERY # <<<<<<<<<<<<<< * elif c == "#": - * url.fragment = "" + * url._fragment_token_seen = True */ __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":1303 + /* "w3lib/_url.pyx":1204 * buffer = "" * if not reached_end: * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" + * url._query_token_seen = True * state = QUERY */ - goto __pyx_L160; + goto __pyx_L120; } - /* "w3lib/_url.pyx":1306 - * url.query = "" + /* "w3lib/_url.pyx":1207 + * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" + * url._fragment_token_seen = True * state = FRAGMENT */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1306, __pyx_L1_error) } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1306, __pyx_L1_error) - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1207, __pyx_L1_error) } + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1207, __pyx_L1_error) + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1307 + /* "w3lib/_url.pyx":1208 * state = QUERY * elif c == "#": - * url.fragment = "" # <<<<<<<<<<<<<< + * url._fragment_token_seen = True # <<<<<<<<<<<<<< * state = FRAGMENT * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1307, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1208, __pyx_L1_error) - /* "w3lib/_url.pyx":1308 + /* "w3lib/_url.pyx":1209 * elif c == "#": - * url.fragment = "" + * url._fragment_token_seen = True * state = FRAGMENT # <<<<<<<<<<<<<< * else: * buffer += _idempotent_utf_8_percent_encode( */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1306 - * url.query = "" + /* "w3lib/_url.pyx":1207 + * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" + * url._fragment_token_seen = True * state = FRAGMENT */ } - __pyx_L160:; + __pyx_L120:; - /* "w3lib/_url.pyx":1302 + /* "w3lib/_url.pyx":1203 * url.path.append(buffer) * buffer = "" * if not reached_end: # <<<<<<<<<<<<<< * if c == "?": - * url.query = "" + * url._query_token_seen = True */ } - /* "w3lib/_url.pyx":1277 + /* "w3lib/_url.pyx":1178 * * elif state == PATH: - * if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": # <<<<<<<<<<<<<< + * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": # <<<<<<<<<<<<<< * if _is_double_dot_path_segment(buffer): * _shorten_path(url) */ - goto __pyx_L132; + goto __pyx_L92; } - /* "w3lib/_url.pyx":1310 + /* "w3lib/_url.pyx":1211 * state = FRAGMENT * else: * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -19735,166 +18000,169 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * pointer=pointer, */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":1311 + /* "w3lib/_url.pyx":1212 * else: * buffer += _idempotent_utf_8_percent_encode( * input=input, # <<<<<<<<<<<<<< * pointer=pointer, - * encode_set=path_percent_encode_set, + * encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1311, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1311, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1212, __pyx_L1_error) - /* "w3lib/_url.pyx":1312 + /* "w3lib/_url.pyx":1213 * buffer += _idempotent_utf_8_percent_encode( * input=input, * pointer=pointer, # <<<<<<<<<<<<<< - * encode_set=path_percent_encode_set, + * encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, * ) */ - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 1311, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 1212, __pyx_L1_error) - /* "w3lib/_url.pyx":1313 + /* "w3lib/_url.pyx":1214 * input=input, * pointer=pointer, - * encode_set=path_percent_encode_set, # <<<<<<<<<<<<<< + * encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * ) * */ - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encode_set, __pyx_v_path_percent_encode_set) < 0) __PYX_ERR(0, 1311, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_encode_set, __pyx_t_1) < 0) __PYX_ERR(0, 1212, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1310 + /* "w3lib/_url.pyx":1211 * state = FRAGMENT * else: * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, * pointer=pointer, */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_12); + __pyx_t_12 = 0; } - __pyx_L132:; + __pyx_L92:; - /* "w3lib/_url.pyx":1276 + /* "w3lib/_url.pyx":1177 * pointer -= 1 * * elif state == PATH: # <<<<<<<<<<<<<< - * if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": + * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): */ - goto __pyx_L7; + goto __pyx_L6; } - /* "w3lib/_url.pyx":1316 + /* "w3lib/_url.pyx":1217 * ) * * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< * if not reached_end: * if c == "?": */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_OPAQUE_PATH); - if (__pyx_t_1) { + __pyx_t_10 = (__pyx_v_state == __pyx_v_5w3lib_4_url_OPAQUE_PATH); + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1317 + /* "w3lib/_url.pyx":1218 * * elif state == OPAQUE_PATH: * if not reached_end: # <<<<<<<<<<<<<< * if c == "?": - * url.query = "" + * url._query_token_seen = True */ - __pyx_t_1 = (!__pyx_v_reached_end); - if (__pyx_t_1) { + __pyx_t_10 = (!__pyx_v_reached_end); + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1318 + /* "w3lib/_url.pyx":1219 * elif state == OPAQUE_PATH: * if not reached_end: * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" + * url._query_token_seen = True * state = QUERY */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1318, __pyx_L1_error) } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1318, __pyx_L1_error) - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1219, __pyx_L1_error) } + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1219, __pyx_L1_error) + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1319 + /* "w3lib/_url.pyx":1220 * if not reached_end: * if c == "?": - * url.query = "" # <<<<<<<<<<<<<< + * url._query_token_seen = True # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1319, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1220, __pyx_L1_error) - /* "w3lib/_url.pyx":1320 + /* "w3lib/_url.pyx":1221 * if c == "?": - * url.query = "" + * url._query_token_seen = True * state = QUERY # <<<<<<<<<<<<<< * elif c == "#": - * url.fragment = "" + * url._fragment_token_seen = True */ __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":1318 + /* "w3lib/_url.pyx":1219 * elif state == OPAQUE_PATH: * if not reached_end: * if c == "?": # <<<<<<<<<<<<<< - * url.query = "" + * url._query_token_seen = True * state = QUERY */ - goto __pyx_L162; + goto __pyx_L122; } - /* "w3lib/_url.pyx":1321 - * url.query = "" + /* "w3lib/_url.pyx":1222 + * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" + * url._fragment_token_seen = True * state = FRAGMENT */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1321, __pyx_L1_error) } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1321, __pyx_L1_error) - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1222, __pyx_L1_error) } + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1222, __pyx_L1_error) + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1322 + /* "w3lib/_url.pyx":1223 * state = QUERY * elif c == "#": - * url.fragment = "" # <<<<<<<<<<<<<< + * url._fragment_token_seen = True # <<<<<<<<<<<<<< * state = FRAGMENT * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1322, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1223, __pyx_L1_error) - /* "w3lib/_url.pyx":1323 + /* "w3lib/_url.pyx":1224 * elif c == "#": - * url.fragment = "" + * url._fragment_token_seen = True * state = FRAGMENT # <<<<<<<<<<<<<< * else: * encoded = _utf_8_percent_encode( */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1321 - * url.query = "" + /* "w3lib/_url.pyx":1222 + * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" + * url._fragment_token_seen = True * state = FRAGMENT */ - goto __pyx_L162; + goto __pyx_L122; } - /* "w3lib/_url.pyx":1325 + /* "w3lib/_url.pyx":1226 * state = FRAGMENT * else: * encoded = _utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -19902,157 +18170,159 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * _C0_CONTROL_PERCENT_ENCODE_SET, */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":1326 + /* "w3lib/_url.pyx":1227 * else: * encoded = _utf_8_percent_encode( * c, # <<<<<<<<<<<<<< * _C0_CONTROL_PERCENT_ENCODE_SET, * ) */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1326, __pyx_L1_error) } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1227, __pyx_L1_error) } - /* "w3lib/_url.pyx":1327 + /* "w3lib/_url.pyx":1228 * encoded = _utf_8_percent_encode( * c, * _C0_CONTROL_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * ) - * url.path += encoded + * url.opaque_path += encoded */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = NULL; - __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = NULL; + __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_12); + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_c, __pyx_t_3}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_v_c, __pyx_t_2}; + __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_XDECREF_SET(__pyx_v_encoded, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_encoded, __pyx_t_12); + __pyx_t_12 = 0; - /* "w3lib/_url.pyx":1329 + /* "w3lib/_url.pyx":1230 * _C0_CONTROL_PERCENT_ENCODE_SET, * ) - * url.path += encoded # <<<<<<<<<<<<<< + * url.opaque_path += encoded # <<<<<<<<<<<<<< * * elif state == QUERY: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1329, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_v_encoded); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1329, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_2) < 0) __PYX_ERR(0, 1329, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_12, __pyx_v_encoded); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path, __pyx_t_1) < 0) __PYX_ERR(0, 1230, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_L162:; + __pyx_L122:; - /* "w3lib/_url.pyx":1317 + /* "w3lib/_url.pyx":1218 * * elif state == OPAQUE_PATH: * if not reached_end: # <<<<<<<<<<<<<< * if c == "?": - * url.query = "" + * url._query_token_seen = True */ } - /* "w3lib/_url.pyx":1316 + /* "w3lib/_url.pyx":1217 * ) * * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< * if not reached_end: * if c == "?": */ - goto __pyx_L7; + goto __pyx_L6; } - /* "w3lib/_url.pyx":1331 - * url.path += encoded + /* "w3lib/_url.pyx":1232 + * url.opaque_path += encoded * * elif state == QUERY: # <<<<<<<<<<<<<< * if encoding != "utf-8" and ( - * not url.is_special or url.scheme in ("ws", "wss") + * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_QUERY); - if (__pyx_t_1) { + __pyx_t_10 = (__pyx_v_state == __pyx_v_5w3lib_4_url_QUERY); + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1332 + /* "w3lib/_url.pyx":1233 * * elif state == QUERY: * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< - * not url.is_special or url.scheme in ("ws", "wss") + * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") * ): */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_kp_u_utf_8, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1332, __pyx_L1_error) - if (__pyx_t_8) { + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_kp_u_utf_8, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) + if (__pyx_t_6) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L164_bool_binop_done; + __pyx_t_10 = __pyx_t_6; + goto __pyx_L124_bool_binop_done; } - /* "w3lib/_url.pyx":1333 + /* "w3lib/_url.pyx":1234 * elif state == QUERY: * if encoding != "utf-8" and ( - * not url.is_special or url.scheme in ("ws", "wss") # <<<<<<<<<<<<<< + * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") # <<<<<<<<<<<<<< * ): * encoding = "utf-8" */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1333, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = (!__pyx_t_8); - if (!__pyx_t_11) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_12, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!__pyx_t_6) { } else { - __pyx_t_1 = __pyx_t_11; - goto __pyx_L164_bool_binop_done; + __pyx_t_10 = __pyx_t_6; + goto __pyx_L124_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_ws, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1333, __pyx_L1_error) - if (!__pyx_t_8) { + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_12, __pyx_n_u_ws, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error) + if (!__pyx_t_7) { } else { - __pyx_t_11 = __pyx_t_8; - goto __pyx_L167_bool_binop_done; + __pyx_t_6 = __pyx_t_7; + goto __pyx_L127_bool_binop_done; } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_wss, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1333, __pyx_L1_error) - __pyx_t_11 = __pyx_t_8; - __pyx_L167_bool_binop_done:; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __pyx_t_11; - __pyx_t_1 = __pyx_t_8; - __pyx_L164_bool_binop_done:; + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_12, __pyx_n_u_wss, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error) + __pyx_t_6 = __pyx_t_7; + __pyx_L127_bool_binop_done:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_7 = __pyx_t_6; + __pyx_t_10 = __pyx_t_7; + __pyx_L124_bool_binop_done:; - /* "w3lib/_url.pyx":1332 + /* "w3lib/_url.pyx":1233 * * elif state == QUERY: * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< - * not url.is_special or url.scheme in ("ws", "wss") + * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") * ): */ - if (__pyx_t_1) { + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1335 - * not url.is_special or url.scheme in ("ws", "wss") + /* "w3lib/_url.pyx":1236 + * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") * ): * encoding = "utf-8" # <<<<<<<<<<<<<< * if reached_end or c == "#": @@ -20061,316 +18331,326 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_utf_8); __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_kp_u_utf_8); - /* "w3lib/_url.pyx":1332 + /* "w3lib/_url.pyx":1233 * * elif state == QUERY: * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< - * not url.is_special or url.scheme in ("ws", "wss") + * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") * ): */ } - /* "w3lib/_url.pyx":1336 + /* "w3lib/_url.pyx":1237 * ): * encoding = "utf-8" * if reached_end or c == "#": # <<<<<<<<<<<<<< * percent_encode_set = ( - * special_query_percent_encode_set + * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET */ if (!__pyx_v_reached_end) { } else { - __pyx_t_1 = __pyx_v_reached_end; - goto __pyx_L170_bool_binop_done; + __pyx_t_10 = __pyx_v_reached_end; + goto __pyx_L130_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1336, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1336, __pyx_L1_error) - __pyx_t_1 = __pyx_t_8; - __pyx_L170_bool_binop_done:; - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1237, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_10 = __pyx_t_7; + __pyx_L130_bool_binop_done:; + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1339 + /* "w3lib/_url.pyx":1240 * percent_encode_set = ( - * special_query_percent_encode_set - * if url.is_special # <<<<<<<<<<<<<< - * else query_percent_encode_set + * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET + * if url.scheme in _SPECIAL_SCHEMES # <<<<<<<<<<<<<< + * else _SAFE_QUERY_PERCENT_ENCODE_SET * ) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_is_special); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1339, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_1) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1240, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1338 + /* "w3lib/_url.pyx":1239 * if reached_end or c == "#": * percent_encode_set = ( - * special_query_percent_encode_set # <<<<<<<<<<<<<< - * if url.is_special - * else query_percent_encode_set + * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< + * if url.scheme in _SPECIAL_SCHEMES + * else _SAFE_QUERY_PERCENT_ENCODE_SET */ - __Pyx_INCREF(__pyx_v_special_query_percent_encode_set); - __pyx_t_2 = __pyx_v_special_query_percent_encode_set; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __pyx_t_2; + __pyx_t_2 = 0; } else { - /* "w3lib/_url.pyx":1340 - * special_query_percent_encode_set - * if url.is_special - * else query_percent_encode_set # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1241 + * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET + * if url.scheme in _SPECIAL_SCHEMES + * else _SAFE_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * url.query += _percent_encode_after_encoding( */ - __Pyx_INCREF(__pyx_v_query_percent_encode_set); - __pyx_t_2 = __pyx_v_query_percent_encode_set; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __pyx_t_2; + __pyx_t_2 = 0; } - __Pyx_XDECREF_SET(__pyx_v_percent_encode_set, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_percent_encode_set, __pyx_t_12); + __pyx_t_12 = 0; - /* "w3lib/_url.pyx":1342 - * else query_percent_encode_set + /* "w3lib/_url.pyx":1243 + * else _SAFE_QUERY_PERCENT_ENCODE_SET * ) * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< * buffer, * encoding=encoding, */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - /* "w3lib/_url.pyx":1343 + /* "w3lib/_url.pyx":1244 * ) * url.query += _percent_encode_after_encoding( * buffer, # <<<<<<<<<<<<<< * encoding=encoding, * percent_encode_set=percent_encode_set, */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buffer)) __PYX_ERR(0, 1342, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_buffer)) __PYX_ERR(0, 1243, __pyx_L1_error); - /* "w3lib/_url.pyx":1344 + /* "w3lib/_url.pyx":1245 * url.query += _percent_encode_after_encoding( * buffer, * encoding=encoding, # <<<<<<<<<<<<<< * percent_encode_set=percent_encode_set, * ) */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 1344, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 1245, __pyx_L1_error) - /* "w3lib/_url.pyx":1345 + /* "w3lib/_url.pyx":1246 * buffer, * encoding=encoding, * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< * ) * buffer = "" */ - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 1344, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 1245, __pyx_L1_error) - /* "w3lib/_url.pyx":1342 - * else query_percent_encode_set + /* "w3lib/_url.pyx":1243 + * else _SAFE_QUERY_PERCENT_ENCODE_SET * ) * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< * buffer, - * encoding=encoding, - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + * encoding=encoding, + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_12) < 0) __PYX_ERR(0, 1342, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_t_12, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_11) < 0) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "w3lib/_url.pyx":1347 + /* "w3lib/_url.pyx":1248 * percent_encode_set=percent_encode_set, * ) * buffer = "" # <<<<<<<<<<<<<< * if not reached_end and c == "#": - * url.fragment = "" + * url._fragment_token_seen = True */ - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u__2); + __Pyx_INCREF(__pyx_kp_u_); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1348 + /* "w3lib/_url.pyx":1249 * ) * buffer = "" * if not reached_end and c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" + * url._fragment_token_seen = True * state = FRAGMENT */ - __pyx_t_8 = (!__pyx_v_reached_end); - if (__pyx_t_8) { + __pyx_t_7 = (!__pyx_v_reached_end); + if (__pyx_t_7) { } else { - __pyx_t_1 = __pyx_t_8; - goto __pyx_L173_bool_binop_done; + __pyx_t_10 = __pyx_t_7; + goto __pyx_L133_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1348, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1348, __pyx_L1_error) - __pyx_t_1 = __pyx_t_8; - __pyx_L173_bool_binop_done:; - if (__pyx_t_1) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1249, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1249, __pyx_L1_error) + __pyx_t_10 = __pyx_t_7; + __pyx_L133_bool_binop_done:; + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1349 + /* "w3lib/_url.pyx":1250 * buffer = "" * if not reached_end and c == "#": - * url.fragment = "" # <<<<<<<<<<<<<< + * url._fragment_token_seen = True # <<<<<<<<<<<<<< * state = FRAGMENT * elif not reached_end: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_kp_u__2) < 0) __PYX_ERR(0, 1349, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1250, __pyx_L1_error) - /* "w3lib/_url.pyx":1350 + /* "w3lib/_url.pyx":1251 * if not reached_end and c == "#": - * url.fragment = "" + * url._fragment_token_seen = True * state = FRAGMENT # <<<<<<<<<<<<<< * elif not reached_end: * buffer += c */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1348 + /* "w3lib/_url.pyx":1249 * ) * buffer = "" * if not reached_end and c == "#": # <<<<<<<<<<<<<< - * url.fragment = "" + * url._fragment_token_seen = True * state = FRAGMENT */ } - /* "w3lib/_url.pyx":1336 + /* "w3lib/_url.pyx":1237 * ): * encoding = "utf-8" * if reached_end or c == "#": # <<<<<<<<<<<<<< * percent_encode_set = ( - * special_query_percent_encode_set + * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET */ - goto __pyx_L169; + goto __pyx_L129; } - /* "w3lib/_url.pyx":1351 - * url.fragment = "" + /* "w3lib/_url.pyx":1252 + * url._fragment_token_seen = True * state = FRAGMENT * elif not reached_end: # <<<<<<<<<<<<<< * buffer += c * */ - __pyx_t_1 = (!__pyx_v_reached_end); - if (__pyx_t_1) { + __pyx_t_10 = (!__pyx_v_reached_end); + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1352 + /* "w3lib/_url.pyx":1253 * state = FRAGMENT * elif not reached_end: * buffer += c # <<<<<<<<<<<<<< * * elif state == FRAGMENT: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1352, __pyx_L1_error) } - __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_12); - __pyx_t_12 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1253, __pyx_L1_error) } + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_11); + __pyx_t_11 = 0; - /* "w3lib/_url.pyx":1351 - * url.fragment = "" + /* "w3lib/_url.pyx":1252 + * url._fragment_token_seen = True * state = FRAGMENT * elif not reached_end: # <<<<<<<<<<<<<< * buffer += c * */ } - __pyx_L169:; + __pyx_L129:; - /* "w3lib/_url.pyx":1331 - * url.path += encoded + /* "w3lib/_url.pyx":1232 + * url.opaque_path += encoded * * elif state == QUERY: # <<<<<<<<<<<<<< * if encoding != "utf-8" and ( - * not url.is_special or url.scheme in ("ws", "wss") + * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") */ - goto __pyx_L7; + goto __pyx_L6; } - /* "w3lib/_url.pyx":1354 + /* "w3lib/_url.pyx":1255 * buffer += c * * elif state == FRAGMENT: # <<<<<<<<<<<<<< * if not reached_end: * url.fragment += _idempotent_utf_8_percent_encode( */ - __pyx_t_1 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FRAGMENT); - if (__pyx_t_1) { + __pyx_t_10 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FRAGMENT); + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1355 + /* "w3lib/_url.pyx":1256 * * elif state == FRAGMENT: * if not reached_end: # <<<<<<<<<<<<<< * url.fragment += _idempotent_utf_8_percent_encode( - * input=input, pointer=pointer, encode_set=fragment_percent_encode_set + * input=input, pointer=pointer, encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET */ - __pyx_t_1 = (!__pyx_v_reached_end); - if (__pyx_t_1) { + __pyx_t_10 = (!__pyx_v_reached_end); + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1356 + /* "w3lib/_url.pyx":1257 * elif state == FRAGMENT: * if not reached_end: * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< - * input=input, pointer=pointer, encode_set=fragment_percent_encode_set + * input=input, pointer=pointer, encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET * ) */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":1357 + /* "w3lib/_url.pyx":1258 * if not reached_end: * url.fragment += _idempotent_utf_8_percent_encode( - * input=input, pointer=pointer, encode_set=fragment_percent_encode_set # <<<<<<<<<<<<<< + * input=input, pointer=pointer, encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1357, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 1357, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_v_fragment_percent_encode_set) < 0) __PYX_ERR(0, 1357, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1258, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 1258, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_encode_set, __pyx_t_1) < 0) __PYX_ERR(0, 1258, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1356 + /* "w3lib/_url.pyx":1257 * elif state == FRAGMENT: * if not reached_end: * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< - * input=input, pointer=pointer, encode_set=fragment_percent_encode_set + * input=input, pointer=pointer, encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET * ) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_12, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_t_2) < 0) __PYX_ERR(0, 1356, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_t_11, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_t_12) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "w3lib/_url.pyx":1355 + /* "w3lib/_url.pyx":1256 * * elif state == FRAGMENT: * if not reached_end: # <<<<<<<<<<<<<< * url.fragment += _idempotent_utf_8_percent_encode( - * input=input, pointer=pointer, encode_set=fragment_percent_encode_set + * input=input, pointer=pointer, encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET */ } - /* "w3lib/_url.pyx":1354 + /* "w3lib/_url.pyx":1255 * buffer += c * * elif state == FRAGMENT: # <<<<<<<<<<<<<< @@ -20378,33 +18658,33 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * url.fragment += _idempotent_utf_8_percent_encode( */ } - __pyx_L7:; + __pyx_L6:; - /* "w3lib/_url.pyx":1360 + /* "w3lib/_url.pyx":1261 * ) * * if pointer >= input_length: # <<<<<<<<<<<<<< * break * pointer += 1 */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1360, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1360, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_12, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1261, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_10) { - /* "w3lib/_url.pyx":1361 + /* "w3lib/_url.pyx":1262 * * if pointer >= input_length: * break # <<<<<<<<<<<<<< * pointer += 1 * */ - goto __pyx_L5_break; + goto __pyx_L4_break; - /* "w3lib/_url.pyx":1360 + /* "w3lib/_url.pyx":1261 * ) * * if pointer >= input_length: # <<<<<<<<<<<<<< @@ -20413,21 +18693,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1362 + /* "w3lib/_url.pyx":1263 * if pointer >= input_length: * break * pointer += 1 # <<<<<<<<<<<<<< * * return url */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); + __pyx_t_1 = 0; } - __pyx_L5_break:; + __pyx_L4_break:; - /* "w3lib/_url.pyx":1364 + /* "w3lib/_url.pyx":1265 * pointer += 1 * * return url # <<<<<<<<<<<<<< @@ -20439,25 +18719,24 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_url; goto __pyx_L0; - /* "w3lib/_url.pyx":956 + /* "w3lib/_url.pyx":958 * * * def _parse_url( # <<<<<<<<<<<<<< * input: str, - * *, + * encoding: str = "utf-8", */ /* function exit code */ __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_base); __Pyx_XDECREF(__pyx_v_url); __Pyx_XDECREF(__pyx_v_buffer); __Pyx_XDECREF(__pyx_v_pointer); @@ -20466,8 +18745,6 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_code_point); __Pyx_XDECREF(__pyx_v_encoded_code_points); - __Pyx_XDECREF(__pyx_v_host); - __Pyx_XDECREF(__pyx_v_port); __Pyx_XDECREF(__pyx_v_encoded); __Pyx_XDECREF(__pyx_v_percent_encode_set); __Pyx_XDECREF(__pyx_v_input); @@ -20477,7 +18754,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "w3lib/_url.pyx":1368 +/* "w3lib/_url.pyx":1269 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< @@ -20538,12 +18815,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1368, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1269, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv4") < 0)) __PYX_ERR(0, 1368, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv4") < 0)) __PYX_ERR(0, 1269, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -20554,7 +18831,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1368, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1269, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20568,7 +18845,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyInt_Type), 0, "address", 1))) __PYX_ERR(0, 1368, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyInt_Type), 0, "address", 1))) __PYX_ERR(0, 1269, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_40_serialize_ipv4(__pyx_self, __pyx_v_address); /* function exit code */ @@ -20604,17 +18881,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_ipv4", 1); - /* "w3lib/_url.pyx":1369 + /* "w3lib/_url.pyx":1270 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: * output = "" # <<<<<<<<<<<<<< * n = address * for i in range(1, 5): */ - __Pyx_INCREF(__pyx_kp_u__2); - __pyx_v_output = __pyx_kp_u__2; + __Pyx_INCREF(__pyx_kp_u_); + __pyx_v_output = __pyx_kp_u_; - /* "w3lib/_url.pyx":1370 + /* "w3lib/_url.pyx":1271 * def _serialize_ipv4(address: int) -> str: * output = "" * n = address # <<<<<<<<<<<<<< @@ -20624,7 +18901,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_v_address); __pyx_v_n = __pyx_v_address; - /* "w3lib/_url.pyx":1371 + /* "w3lib/_url.pyx":1272 * output = "" * n = address * for i in range(1, 5): # <<<<<<<<<<<<<< @@ -20634,25 +18911,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject for (__pyx_t_1 = 1; __pyx_t_1 < 5; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "w3lib/_url.pyx":1372 + /* "w3lib/_url.pyx":1273 * n = address * for i in range(1, 5): * output = str(n % 256) + output # <<<<<<<<<<<<<< * if i != 4: * output = "." + output */ - __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1372, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1372, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1372, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1373 + /* "w3lib/_url.pyx":1274 * for i in range(1, 5): * output = str(n % 256) + output * if i != 4: # <<<<<<<<<<<<<< @@ -20662,19 +18939,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_4 = (__pyx_v_i != 4); if (__pyx_t_4) { - /* "w3lib/_url.pyx":1374 + /* "w3lib/_url.pyx":1275 * output = str(n % 256) + output * if i != 4: * output = "." + output # <<<<<<<<<<<<<< * n = floor(n / 256) * return output */ - __pyx_t_2 = PyNumber_Add(__pyx_kp_u__6, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1374, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_kp_u__6, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1373 + /* "w3lib/_url.pyx":1274 * for i in range(1, 5): * output = str(n % 256) + output * if i != 4: # <<<<<<<<<<<<<< @@ -20683,16 +18960,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1375 + /* "w3lib/_url.pyx":1276 * if i != 4: * output = "." + output * n = floor(n / 256) # <<<<<<<<<<<<<< * return output * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1375, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1375, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -20713,7 +18990,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -20721,7 +18998,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_2 = 0; } - /* "w3lib/_url.pyx":1376 + /* "w3lib/_url.pyx":1277 * output = "." + output * n = floor(n / 256) * return output # <<<<<<<<<<<<<< @@ -20729,12 +19006,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1376, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1277, __pyx_L1_error) __Pyx_INCREF(__pyx_v_output); __pyx_r = ((PyObject*)__pyx_v_output); goto __pyx_L0; - /* "w3lib/_url.pyx":1368 + /* "w3lib/_url.pyx":1269 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< @@ -20758,7 +19035,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":1379 +/* "w3lib/_url.pyx":1280 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< @@ -20766,7 +19043,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject * ) -> Optional[int]: */ -static PyObject *__pyx_pf_5w3lib_4_url_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_5w3lib_4_url_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -20776,16 +19053,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_56__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_length, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_min_length) < 0) __PYX_ERR(0, 1379, __pyx_L1_error) - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_length, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_min_length) < 0) __PYX_ERR(0, 1280, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 1379, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 1280, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1280, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -20842,7 +19119,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_address,&__pyx_n_s_min_length,0}; - __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self); + __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); values[1] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_min_length); if (__pyx_kwds) { Py_ssize_t kw_args; @@ -20859,18 +19136,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1379, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1280, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1379, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1280, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_ipv6_first_longest_0_piece_index") < 0)) __PYX_ERR(0, 1379, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_ipv6_first_longest_0_piece_index") < 0)) __PYX_ERR(0, 1280, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -20882,7 +19159,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_ipv6_first_longest_0_piece_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1379, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_ipv6_first_longest_0_piece_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1280, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20896,8 +19173,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1380, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_min_length), (&PyInt_Type), 0, "min_length", 1))) __PYX_ERR(0, 1380, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1281, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_min_length), (&PyInt_Type), 0, "min_length", 1))) __PYX_ERR(0, 1281, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(__pyx_self, __pyx_v_address, __pyx_v_min_length); /* function exit code */ @@ -20935,7 +19212,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_ipv6_first_longest_0_piece_index", 1); - /* "w3lib/_url.pyx":1382 + /* "w3lib/_url.pyx":1283 * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: * index = None # <<<<<<<<<<<<<< @@ -20945,7 +19222,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(Py_None); __pyx_v_index = Py_None; - /* "w3lib/_url.pyx":1383 + /* "w3lib/_url.pyx":1284 * ) -> Optional[int]: * index = None * index_length = 0 # <<<<<<<<<<<<<< @@ -20955,7 +19232,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __pyx_v_index_length = __pyx_int_0; - /* "w3lib/_url.pyx":1384 + /* "w3lib/_url.pyx":1285 * index = None * index_length = 0 * current_length = 0 # <<<<<<<<<<<<<< @@ -20965,7 +19242,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __pyx_v_current_length = __pyx_int_0; - /* "w3lib/_url.pyx":1385 + /* "w3lib/_url.pyx":1286 * index_length = 0 * current_length = 0 * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< @@ -20980,37 +19257,37 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1385, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1286, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1286, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_piece, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_current_index, __pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1386 + /* "w3lib/_url.pyx":1287 * current_length = 0 * for current_index, piece in enumerate(address): * if piece != 0: # <<<<<<<<<<<<<< * current_length = 0 * continue */ - __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1386, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1287, __pyx_L1_error) if (__pyx_t_5) { - /* "w3lib/_url.pyx":1387 + /* "w3lib/_url.pyx":1288 * for current_index, piece in enumerate(address): * if piece != 0: * current_length = 0 # <<<<<<<<<<<<<< @@ -21020,7 +19297,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_int_0); - /* "w3lib/_url.pyx":1388 + /* "w3lib/_url.pyx":1289 * if piece != 0: * current_length = 0 * continue # <<<<<<<<<<<<<< @@ -21029,7 +19306,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":1386 + /* "w3lib/_url.pyx":1287 * current_length = 0 * for current_index, piece in enumerate(address): * if piece != 0: # <<<<<<<<<<<<<< @@ -21038,56 +19315,56 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C */ } - /* "w3lib/_url.pyx":1389 + /* "w3lib/_url.pyx":1290 * current_length = 0 * continue * current_length += 1 # <<<<<<<<<<<<<< * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1389, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1390 + /* "w3lib/_url.pyx":1291 * continue * current_length += 1 * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< * index = current_index + 1 - current_length * index_length = current_length */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_index_length, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1390, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_index_length, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L7_bool_binop_done; } - __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_min_length, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1390, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_min_length, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L7_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":1391 + /* "w3lib/_url.pyx":1292 * current_length += 1 * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length # <<<<<<<<<<<<<< * index_length = current_length * return index */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1391, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_v_current_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1391, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_v_current_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":1392 + /* "w3lib/_url.pyx":1293 * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length * index_length = current_length # <<<<<<<<<<<<<< @@ -21097,7 +19374,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_v_current_length); __Pyx_DECREF_SET(__pyx_v_index_length, __pyx_v_current_length); - /* "w3lib/_url.pyx":1390 + /* "w3lib/_url.pyx":1291 * continue * current_length += 1 * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< @@ -21106,7 +19383,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C */ } - /* "w3lib/_url.pyx":1385 + /* "w3lib/_url.pyx":1286 * index_length = 0 * current_length = 0 * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< @@ -21118,7 +19395,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1393 + /* "w3lib/_url.pyx":1294 * index = current_index + 1 - current_length * index_length = current_length * return index # <<<<<<<<<<<<<< @@ -21126,12 +19403,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_index))||((__pyx_v_index) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_index))) __PYX_ERR(0, 1393, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_index))||((__pyx_v_index) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_index))) __PYX_ERR(0, 1294, __pyx_L1_error) __Pyx_INCREF(__pyx_v_index); __pyx_r = ((PyObject*)__pyx_v_index); goto __pyx_L0; - /* "w3lib/_url.pyx":1379 + /* "w3lib/_url.pyx":1280 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< @@ -21158,7 +19435,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C return __pyx_r; } -/* "w3lib/_url.pyx":1397 +/* "w3lib/_url.pyx":1298 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< @@ -21219,12 +19496,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1397, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1298, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv6") < 0)) __PYX_ERR(0, 1397, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv6") < 0)) __PYX_ERR(0, 1298, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -21235,7 +19512,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1397, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1298, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21249,7 +19526,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1397, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1298, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_44_serialize_ipv6(__pyx_self, __pyx_v_address); /* function exit code */ @@ -21287,24 +19564,24 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_ipv6", 1); - /* "w3lib/_url.pyx":1398 + /* "w3lib/_url.pyx":1299 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: * output = "" # <<<<<<<<<<<<<< * compress = _get_ipv6_first_longest_0_piece_index(address) * ignore0 = False */ - __Pyx_INCREF(__pyx_kp_u__2); - __pyx_v_output = __pyx_kp_u__2; + __Pyx_INCREF(__pyx_kp_u_); + __pyx_v_output = __pyx_kp_u_; - /* "w3lib/_url.pyx":1399 + /* "w3lib/_url.pyx":1300 * def _serialize_ipv6(address: List[int]) -> str: * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) # <<<<<<<<<<<<<< * ignore0 = False * for piece_index in range(8): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_ipv6_first_longest_0_piece); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1399, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_ipv6_first_longest_0_piece); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -21324,14 +19601,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_address}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1399, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_compress = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1400 + /* "w3lib/_url.pyx":1301 * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) * ignore0 = False # <<<<<<<<<<<<<< @@ -21340,7 +19617,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 0; - /* "w3lib/_url.pyx":1401 + /* "w3lib/_url.pyx":1302 * compress = _get_ipv6_first_longest_0_piece_index(address) * ignore0 = False * for piece_index in range(8): # <<<<<<<<<<<<<< @@ -21350,7 +19627,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject for (__pyx_t_5 = 0; __pyx_t_5 < 8; __pyx_t_5+=1) { __pyx_v_piece_index = __pyx_t_5; - /* "w3lib/_url.pyx":1402 + /* "w3lib/_url.pyx":1303 * ignore0 = False * for piece_index in range(8): * if ignore0: # <<<<<<<<<<<<<< @@ -21359,21 +19636,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ if (__pyx_v_ignore0) { - /* "w3lib/_url.pyx":1403 + /* "w3lib/_url.pyx":1304 * for piece_index in range(8): * if ignore0: * if not address[piece_index]: # <<<<<<<<<<<<<< * continue * ignore0 = False */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1403, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "w3lib/_url.pyx":1404 + /* "w3lib/_url.pyx":1305 * if ignore0: * if not address[piece_index]: * continue # <<<<<<<<<<<<<< @@ -21382,7 +19659,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":1403 + /* "w3lib/_url.pyx":1304 * for piece_index in range(8): * if ignore0: * if not address[piece_index]: # <<<<<<<<<<<<<< @@ -21391,7 +19668,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1405 + /* "w3lib/_url.pyx":1306 * if not address[piece_index]: * continue * ignore0 = False # <<<<<<<<<<<<<< @@ -21400,7 +19677,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 0; - /* "w3lib/_url.pyx":1402 + /* "w3lib/_url.pyx":1303 * ignore0 = False * for piece_index in range(8): * if ignore0: # <<<<<<<<<<<<<< @@ -21409,22 +19686,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1406 + /* "w3lib/_url.pyx":1307 * continue * ignore0 = False * if compress == piece_index: # <<<<<<<<<<<<<< * separator = "::" if piece_index == 0 else ":" * output += separator */ - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_compress, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1406, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_compress, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1406, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_7) { - /* "w3lib/_url.pyx":1407 + /* "w3lib/_url.pyx":1308 * ignore0 = False * if compress == piece_index: * separator = "::" if piece_index == 0 else ":" # <<<<<<<<<<<<<< @@ -21433,8 +19710,8 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_t_7 = (__pyx_v_piece_index == 0); if (__pyx_t_7) { - __Pyx_INCREF(__pyx_kp_u__21); - __pyx_t_2 = __pyx_kp_u__21; + __Pyx_INCREF(__pyx_kp_u__23); + __pyx_t_2 = __pyx_kp_u__23; } else { __Pyx_INCREF(__pyx_kp_u__5); __pyx_t_2 = __pyx_kp_u__5; @@ -21442,19 +19719,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject __Pyx_XDECREF_SET(__pyx_v_separator, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1408 + /* "w3lib/_url.pyx":1309 * if compress == piece_index: * separator = "::" if piece_index == 0 else ":" * output += separator # <<<<<<<<<<<<<< * ignore0 = True * continue */ - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_output, __pyx_v_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1408, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_output, __pyx_v_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1409 + /* "w3lib/_url.pyx":1310 * separator = "::" if piece_index == 0 else ":" * output += separator * ignore0 = True # <<<<<<<<<<<<<< @@ -21463,7 +19740,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 1; - /* "w3lib/_url.pyx":1410 + /* "w3lib/_url.pyx":1311 * output += separator * ignore0 = True * continue # <<<<<<<<<<<<<< @@ -21472,7 +19749,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":1406 + /* "w3lib/_url.pyx":1307 * continue * ignore0 = False * if compress == piece_index: # <<<<<<<<<<<<<< @@ -21481,25 +19758,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1411 + /* "w3lib/_url.pyx":1312 * ignore0 = True * continue * output += f"{address[piece_index]:x}" # <<<<<<<<<<<<<< * if piece_index != 7: * output += ":" */ - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1412 + /* "w3lib/_url.pyx":1313 * continue * output += f"{address[piece_index]:x}" * if piece_index != 7: # <<<<<<<<<<<<<< @@ -21509,19 +19786,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_t_7 = (__pyx_v_piece_index != 7); if (__pyx_t_7) { - /* "w3lib/_url.pyx":1413 + /* "w3lib/_url.pyx":1314 * output += f"{address[piece_index]:x}" * if piece_index != 7: * output += ":" # <<<<<<<<<<<<<< * return output * */ - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1413, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1412 + /* "w3lib/_url.pyx":1313 * continue * output += f"{address[piece_index]:x}" * if piece_index != 7: # <<<<<<<<<<<<<< @@ -21532,7 +19809,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_L3_continue:; } - /* "w3lib/_url.pyx":1414 + /* "w3lib/_url.pyx":1315 * if piece_index != 7: * output += ":" * return output # <<<<<<<<<<<<<< @@ -21544,7 +19821,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "w3lib/_url.pyx":1397 + /* "w3lib/_url.pyx":1298 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< @@ -21568,12 +19845,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":1418 +/* "w3lib/_url.pyx":1319 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer - * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< - * if isinstance(host, int): - * return _serialize_ipv4(host) + * def _serialize_host(url: _URL) -> str: # <<<<<<<<<<<<<< + * if url._host_type == IPV4: + * return _serialize_ipv4(url.ipv4) */ /* Python wrapper */ @@ -21592,7 +19869,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_host = 0; + PyObject *__pyx_v_url = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -21613,7 +19890,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -21625,27 +19902,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_host)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_url)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1418, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1319, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_host") < 0)) __PYX_ERR(0, 1418, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_host") < 0)) __PYX_ERR(0, 1319, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_host = values[0]; + __pyx_v_url = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1418, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1319, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21659,7 +19936,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_46_serialize_host(__pyx_self, __pyx_v_host); + __pyx_r = __pyx_pf_5w3lib_4_url_46_serialize_host(__pyx_self, __pyx_v_url); /* function exit code */ { @@ -21672,183 +19949,209 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host) { +static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - Py_UCS4 __pyx_t_7; - PyObject *__pyx_t_8 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_UCS4 __pyx_t_8; + PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_host", 1); - /* "w3lib/_url.pyx":1419 + /* "w3lib/_url.pyx":1320 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer - * def _serialize_host(host: Union[str, int, List[int]]) -> str: - * if isinstance(host, int): # <<<<<<<<<<<<<< - * return _serialize_ipv4(host) - * if isinstance(host, list): + * def _serialize_host(url: _URL) -> str: + * if url._host_type == IPV4: # <<<<<<<<<<<<<< + * return _serialize_ipv4(url.ipv4) + * if url._host_type == IPV6: */ - __pyx_t_1 = PyInt_Check(__pyx_v_host); - if (__pyx_t_1) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1320, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { - /* "w3lib/_url.pyx":1420 - * def _serialize_host(host: Union[str, int, List[int]]) -> str: - * if isinstance(host, int): - * return _serialize_ipv4(host) # <<<<<<<<<<<<<< - * if isinstance(host, list): - * return f"[{_serialize_ipv6(host)}]" + /* "w3lib/_url.pyx":1321 + * def _serialize_host(url: _URL) -> str: + * if url._host_type == IPV4: + * return _serialize_ipv4(url.ipv4) # <<<<<<<<<<<<<< + * if url._host_type == IPV6: + * return f"[{_serialize_ipv6(url.ipv6)}]" */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_serialize_ipv4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_serialize_ipv4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_ipv4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_host}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 1420, __pyx_L1_error) - __pyx_r = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 1321, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1419 + /* "w3lib/_url.pyx":1320 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer - * def _serialize_host(host: Union[str, int, List[int]]) -> str: - * if isinstance(host, int): # <<<<<<<<<<<<<< - * return _serialize_ipv4(host) - * if isinstance(host, list): + * def _serialize_host(url: _URL) -> str: + * if url._host_type == IPV4: # <<<<<<<<<<<<<< + * return _serialize_ipv4(url.ipv4) + * if url._host_type == IPV6: */ } - /* "w3lib/_url.pyx":1421 - * if isinstance(host, int): - * return _serialize_ipv4(host) - * if isinstance(host, list): # <<<<<<<<<<<<<< - * return f"[{_serialize_ipv6(host)}]" - * return host + /* "w3lib/_url.pyx":1322 + * if url._host_type == IPV4: + * return _serialize_ipv4(url.ipv4) + * if url._host_type == IPV6: # <<<<<<<<<<<<<< + * return f"[{_serialize_ipv6(url.ipv6)}]" + * return url.hostname */ - __pyx_t_1 = PyList_Check(__pyx_v_host); - if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1322, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { - /* "w3lib/_url.pyx":1422 - * return _serialize_ipv4(host) - * if isinstance(host, list): - * return f"[{_serialize_ipv6(host)}]" # <<<<<<<<<<<<<< - * return host + /* "w3lib/_url.pyx":1323 + * return _serialize_ipv4(url.ipv4) + * if url._host_type == IPV6: + * return f"[{_serialize_ipv6(url.ipv6)}]" # <<<<<<<<<<<<<< + * return url.hostname * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = 0; - __pyx_t_7 = 127; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = 0; + __pyx_t_8 = 127; __Pyx_INCREF(__pyx_kp_u__8); - __pyx_t_6 += 1; + __pyx_t_7 += 1; __Pyx_GIVEREF(__pyx_kp_u__8); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__8); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_serialize_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = NULL; - __pyx_t_5 = 0; + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__8); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_serialize_ipv6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_ipv6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = NULL; + __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_8); + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_host}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_5}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7; - __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8; + __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __pyx_t_3 = 0; __Pyx_INCREF(__pyx_kp_u__9); - __pyx_t_6 += 1; + __pyx_t_7 += 1; __Pyx_GIVEREF(__pyx_kp_u__9); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__9); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__9); + __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1421 - * if isinstance(host, int): - * return _serialize_ipv4(host) - * if isinstance(host, list): # <<<<<<<<<<<<<< - * return f"[{_serialize_ipv6(host)}]" - * return host + /* "w3lib/_url.pyx":1322 + * if url._host_type == IPV4: + * return _serialize_ipv4(url.ipv4) + * if url._host_type == IPV6: # <<<<<<<<<<<<<< + * return f"[{_serialize_ipv6(url.ipv6)}]" + * return url.hostname */ } - /* "w3lib/_url.pyx":1423 - * if isinstance(host, list): - * return f"[{_serialize_ipv6(host)}]" - * return host # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1324 + * if url._host_type == IPV6: + * return f"[{_serialize_ipv6(url.ipv6)}]" + * return url.hostname # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_host))||((__pyx_v_host) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_host))) __PYX_ERR(0, 1423, __pyx_L1_error) - __Pyx_INCREF(__pyx_v_host); - __pyx_r = ((PyObject*)__pyx_v_host); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 1324, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1418 + /* "w3lib/_url.pyx":1319 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer - * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< - * if isinstance(host, int): - * return _serialize_ipv4(host) + * def _serialize_host(url: _URL) -> str: # <<<<<<<<<<<<<< + * if url._host_type == IPV4: + * return _serialize_ipv4(url.ipv4) */ /* function exit code */ __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("w3lib._url._serialize_host", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -21857,11 +20160,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":1427 +/* "w3lib/_url.pyx":1328 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer - * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< - * if url.has_opaque_path(): + * def _serialize_url_path(url: _URL) -> str: # <<<<<<<<<<<<<< + * if url.opaque_path: * assert isinstance(url.path, str) */ @@ -21882,12 +20185,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_url = 0; - PyObject *__pyx_v_canonicalize = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -21903,8 +20205,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,&__pyx_n_s_canonicalize,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -21920,18 +20221,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1328, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } - if (kw_args == 1) { - const Py_ssize_t index = 1; - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); - if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L3_error) - } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url_path") < 0)) __PYX_ERR(0, 1427, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url_path") < 0)) __PYX_ERR(0, 1328, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -21939,11 +20234,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_url = values[0]; - __pyx_v_canonicalize = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_url_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1427, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_url_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1328, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21957,7 +20251,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_48_serialize_url_path(__pyx_self, __pyx_v_url, __pyx_v_canonicalize); + __pyx_r = __pyx_pf_5w3lib_4_url_48_serialize_url_path(__pyx_self, __pyx_v_url); /* function exit code */ { @@ -21970,226 +20264,195 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_canonicalize) { +static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { PyObject *__pyx_v_output = NULL; PyObject *__pyx_v_segment = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; int __pyx_t_4; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_url_path", 1); - /* "w3lib/_url.pyx":1428 + /* "w3lib/_url.pyx":1329 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer - * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: - * if url.has_opaque_path(): # <<<<<<<<<<<<<< + * def _serialize_url_path(url: _URL) -> str: + * if url.opaque_path: # <<<<<<<<<<<<<< * assert isinstance(url.path, str) * return url.path */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1428, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { + if (__pyx_t_2) { - /* "w3lib/_url.pyx":1429 - * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: - * if url.has_opaque_path(): + /* "w3lib/_url.pyx":1330 + * def _serialize_url_path(url: _URL) -> str: + * if url.opaque_path: * assert isinstance(url.path, str) # <<<<<<<<<<<<<< * return url.path - * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: + * if len(url.path) <= 1 and url._path_token_seen: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyUnicode_Check(__pyx_t_1); + __pyx_t_2 = PyUnicode_Check(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_5)) { + if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1429, __pyx_L1_error) + __PYX_ERR(0, 1330, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 1429, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 1330, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":1430 - * if url.has_opaque_path(): + /* "w3lib/_url.pyx":1331 + * if url.opaque_path: * assert isinstance(url.path, str) * return url.path # <<<<<<<<<<<<<< - * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: + * if len(url.path) <= 1 and url._path_token_seen: * return "" */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1430, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1430, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1331, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1428 + /* "w3lib/_url.pyx":1329 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer - * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: - * if url.has_opaque_path(): # <<<<<<<<<<<<<< + * def _serialize_url_path(url: _URL) -> str: + * if url.opaque_path: # <<<<<<<<<<<<<< * assert isinstance(url.path, str) * return url.path */ } - /* "w3lib/_url.pyx":1431 + /* "w3lib/_url.pyx":1332 * assert isinstance(url.path, str) * return url.path - * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: # <<<<<<<<<<<<<< + * if len(url.path) <= 1 and url._path_token_seen: # <<<<<<<<<<<<<< * return "" * output = "" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = (__pyx_t_6 <= 1); - if (__pyx_t_7) { + __pyx_t_4 = (__pyx_t_3 <= 1); + if (__pyx_t_4) { } else { - __pyx_t_5 = __pyx_t_7; + __pyx_t_2 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_7) { - } else { - __pyx_t_5 = __pyx_t_7; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1431, __pyx_L1_error) - __pyx_t_8 = (!__pyx_t_7); - __pyx_t_5 = __pyx_t_8; + __pyx_t_2 = __pyx_t_4; __pyx_L5_bool_binop_done:; - if (__pyx_t_5) { + if (__pyx_t_2) { - /* "w3lib/_url.pyx":1432 + /* "w3lib/_url.pyx":1333 * return url.path - * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: + * if len(url.path) <= 1 and url._path_token_seen: * return "" # <<<<<<<<<<<<<< * output = "" * for segment in url.path: */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_kp_u__2); - __pyx_r = __pyx_kp_u__2; + __Pyx_INCREF(__pyx_kp_u_); + __pyx_r = __pyx_kp_u_; goto __pyx_L0; - /* "w3lib/_url.pyx":1431 + /* "w3lib/_url.pyx":1332 * assert isinstance(url.path, str) * return url.path - * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: # <<<<<<<<<<<<<< + * if len(url.path) <= 1 and url._path_token_seen: # <<<<<<<<<<<<<< * return "" * output = "" */ } - /* "w3lib/_url.pyx":1433 - * if len(url.path) <= 1 and url._path_token_seen and not canonicalize: + /* "w3lib/_url.pyx":1334 + * if len(url.path) <= 1 and url._path_token_seen: * return "" * output = "" # <<<<<<<<<<<<<< * for segment in url.path: * output += f"/{segment}" */ - __Pyx_INCREF(__pyx_kp_u__2); - __pyx_v_output = __pyx_kp_u__2; + __Pyx_INCREF(__pyx_kp_u_); + __pyx_v_output = __pyx_kp_u_; - /* "w3lib/_url.pyx":1434 + /* "w3lib/_url.pyx":1335 * return "" * output = "" * for segment in url.path: # <<<<<<<<<<<<<< * output += f"/{segment}" * return output */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = 0; - __pyx_t_9 = NULL; + __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); + __pyx_t_3 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1434, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1335, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_5))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1434, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1335, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1434, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1335, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1434, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1335, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1434, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1335, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { - __pyx_t_1 = __pyx_t_9(__pyx_t_2); + __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1434, __pyx_L1_error) + else __PYX_ERR(0, 1335, __pyx_L1_error) } break; } @@ -22198,25 +20461,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj __Pyx_XDECREF_SET(__pyx_v_segment, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1435 + /* "w3lib/_url.pyx":1336 * output = "" * for segment in url.path: * output += f"/{segment}" # <<<<<<<<<<<<<< * return output * */ - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_segment, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_segment, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1434 + /* "w3lib/_url.pyx":1335 * return "" * output = "" * for segment in url.path: # <<<<<<<<<<<<<< @@ -22224,9 +20487,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj * return output */ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1436 + /* "w3lib/_url.pyx":1337 * for segment in url.path: * output += f"/{segment}" * return output # <<<<<<<<<<<<<< @@ -22238,19 +20501,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "w3lib/_url.pyx":1427 + /* "w3lib/_url.pyx":1328 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer - * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< - * if url.has_opaque_path(): + * def _serialize_url_path(url: _URL) -> str: # <<<<<<<<<<<<<< + * if url.opaque_path: * assert isinstance(url.path, str) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("w3lib._url._serialize_url_path", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -22261,12 +20524,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj return __pyx_r; } -/* "w3lib/_url.pyx":1440 +/* "w3lib/_url.pyx":1341 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing - * def _serialize_url( # <<<<<<<<<<<<<< - * url: _URL, - * *, + * def _serialize_url(url: _URL) -> str: # <<<<<<<<<<<<<< + * """Return a string representation of *url* following the URL serialization + * algorithm defined in the `URL living standard`_. */ /* Python wrapper */ @@ -22277,7 +20540,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_50_serialize_url, "Return a string representation of *url* following the URL serialization\n algorithm defined in the `URL living standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer\n\n If *exclude_fragment* is ``True``, the returned URL does not include\n :attr:`_URL.fragment`.\n\n Additional parameters allow to deviate from the standard for specific use\n cases:\n\n - *canonicalize*:\n\n - ``None``: Do not deviate from the standard algorithm to apply or\n prevent URL canonicalization.\n\n - ``True``: Deviate from the standard as needed to make sure that\n functionally-equivalent URLs are always rendered the same way.\n\n This value has no effect at the moment, i.e. it applies the same\n level of canonicalization as the standard algorithm.\n\n - ``False``: Deviate from the standard as needed to make sure that\n the returned URL string is as close as possible to the original URL\n string that was parsed into *url*, as long as the returned URL\n string is still a valid URL.\n\n At the moment, this ensures that the password separator (:) is\n included into the returned URL string as long as it was present on\n the original URL string, even if :attr:`_URL.password` is an empty\n string.\n "); +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_50_serialize_url, "Return a string representation of *url* following the URL serialization\n algorithm defined in the `URL living standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer\n "); static PyMethodDef __pyx_mdef_5w3lib_4_url_51_serialize_url = {"_serialize_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_51_serialize_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_50_serialize_url}; static PyObject *__pyx_pw_5w3lib_4_url_51_serialize_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -22287,13 +20550,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_url = 0; - PyObject *__pyx_v_exclude_fragment = 0; - PyObject *__pyx_v_canonicalize = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -22308,26 +20569,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,&__pyx_n_s_exclude_fragment,&__pyx_n_s_canonicalize,0}; - - /* "w3lib/_url.pyx":1443 - * url: _URL, - * *, - * exclude_fragment: bool = False, # <<<<<<<<<<<<<< - * canonicalize: Optional[bool] = None, - * ) -> str: - */ - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - - /* "w3lib/_url.pyx":1444 - * *, - * exclude_fragment: bool = False, - * canonicalize: Optional[bool] = None, # <<<<<<<<<<<<<< - * ) -> str: - * """Return a string representation of *url* following the URL serialization - */ - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -22343,20 +20586,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1440, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1341, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } - if (kw_args > 0 && likely(kw_args <= 2)) { - Py_ssize_t index; - for (index = 1; index < 3 && kw_args > 0; index++) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); - if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1440, __pyx_L3_error) - } - } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url") < 0)) __PYX_ERR(0, 1440, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url") < 0)) __PYX_ERR(0, 1341, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -22364,12 +20599,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_url = values[0]; - __pyx_v_exclude_fragment = values[1]; - __pyx_v_canonicalize = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1440, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1341, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22383,15 +20616,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_50_serialize_url(__pyx_self, __pyx_v_url, __pyx_v_exclude_fragment, __pyx_v_canonicalize); - - /* "w3lib/_url.pyx":1440 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing - * def _serialize_url( # <<<<<<<<<<<<<< - * url: _URL, - * *, - */ + __pyx_r = __pyx_pf_5w3lib_4_url_50_serialize_url(__pyx_self, __pyx_v_url); /* function exit code */ { @@ -22404,7 +20629,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_exclude_fragment, PyObject *__pyx_v_canonicalize) { +static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { PyObject *__pyx_v_output = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -22412,197 +20637,203 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_url", 1); - /* "w3lib/_url.pyx":1478 - * string. + /* "w3lib/_url.pyx":1347 + * .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer * """ * output = url.scheme + ":" # <<<<<<<<<<<<<< - * if url.hostname is not None: + * if url.hostname or url._host_type != HOSTNAME: * output += "//" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1478, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1478, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_output = __pyx_t_2; __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1479 + /* "w3lib/_url.pyx":1348 * """ * output = url.scheme + ":" - * if url.hostname is not None: # <<<<<<<<<<<<<< + * if url.hostname or url._host_type != HOSTNAME: # <<<<<<<<<<<<<< * output += "//" * if url.username or url.password: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1479, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1348, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = (__pyx_t_2 != Py_None); + __pyx_t_1 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_HOSTNAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1348, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1348, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __pyx_t_4; + __pyx_L4_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1480 + /* "w3lib/_url.pyx":1349 * output = url.scheme + ":" - * if url.hostname is not None: + * if url.hostname or url._host_type != HOSTNAME: * output += "//" # <<<<<<<<<<<<<< * if url.username or url.password: * output += url.username */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__24); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1481 - * if url.hostname is not None: + /* "w3lib/_url.pyx":1350 + * if url.hostname or url._host_type != HOSTNAME: * output += "//" * if url.username or url.password: # <<<<<<<<<<<<<< * output += url.username * if url.password: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1481, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1350, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; - goto __pyx_L5_bool_binop_done; + goto __pyx_L7_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1481, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1350, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __pyx_t_4; - __pyx_L5_bool_binop_done:; + __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1482 + /* "w3lib/_url.pyx":1351 * output += "//" * if url.username or url.password: * output += url.username # <<<<<<<<<<<<<< * if url.password: * output += f":{url.password}" */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1483 + /* "w3lib/_url.pyx":1352 * if url.username or url.password: * output += url.username * if url.password: # <<<<<<<<<<<<<< * output += f":{url.password}" - * elif not canonicalize and url._password_token_seen: + * elif url._password_token_seen: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1483, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1483, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1484 + /* "w3lib/_url.pyx":1353 * output += url.username * if url.password: * output += f":{url.password}" # <<<<<<<<<<<<<< - * elif not canonicalize and url._password_token_seen: + * elif url._password_token_seen: * output += ":" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1483 + /* "w3lib/_url.pyx":1352 * if url.username or url.password: * output += url.username * if url.password: # <<<<<<<<<<<<<< * output += f":{url.password}" - * elif not canonicalize and url._password_token_seen: + * elif url._password_token_seen: */ - goto __pyx_L7; + goto __pyx_L9; } - /* "w3lib/_url.pyx":1485 + /* "w3lib/_url.pyx":1354 * if url.password: * output += f":{url.password}" - * elif not canonicalize and url._password_token_seen: # <<<<<<<<<<<<<< + * elif url._password_token_seen: # <<<<<<<<<<<<<< * output += ":" * output += "@" */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1485, __pyx_L1_error) - __pyx_t_5 = (!__pyx_t_4); - if (__pyx_t_5) { - } else { - __pyx_t_3 = __pyx_t_5; - goto __pyx_L8_bool_binop_done; - } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1485, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __pyx_t_5; - __pyx_L8_bool_binop_done:; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1354, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1486 + /* "w3lib/_url.pyx":1355 * output += f":{url.password}" - * elif not canonicalize and url._password_token_seen: + * elif url._password_token_seen: * output += ":" # <<<<<<<<<<<<<< * output += "@" - * output += _serialize_host(url.hostname) + * output += _serialize_host(url) */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1485 + /* "w3lib/_url.pyx":1354 * if url.password: * output += f":{url.password}" - * elif not canonicalize and url._password_token_seen: # <<<<<<<<<<<<<< + * elif url._password_token_seen: # <<<<<<<<<<<<<< * output += ":" * output += "@" */ } - __pyx_L7:; + __pyx_L9:; - /* "w3lib/_url.pyx":1487 - * elif not canonicalize and url._password_token_seen: + /* "w3lib/_url.pyx":1356 + * elif url._password_token_seen: * output += ":" * output += "@" # <<<<<<<<<<<<<< - * output += _serialize_host(url.hostname) - * if url.port is not None: + * output += _serialize_host(url) + * if url.port > -1: */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__15); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1481 - * if url.hostname is not None: + /* "w3lib/_url.pyx":1350 + * if url.hostname or url._host_type != HOSTNAME: * output += "//" * if url.username or url.password: # <<<<<<<<<<<<<< * output += url.username @@ -22610,439 +20841,416 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * */ } - /* "w3lib/_url.pyx":1488 + /* "w3lib/_url.pyx":1357 * output += ":" * output += "@" - * output += _serialize_host(url.hostname) # <<<<<<<<<<<<<< - * if url.port is not None: + * output += _serialize_host(url) # <<<<<<<<<<<<<< + * if url.port > -1: * output += f":{url.port}" */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1488, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1488, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; + __pyx_t_2 = NULL; + __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_7)) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_8 = 1; + __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1488, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_url}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1488, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1489 + /* "w3lib/_url.pyx":1358 * output += "@" - * output += _serialize_host(url.hostname) - * if url.port is not None: # <<<<<<<<<<<<<< + * output += _serialize_host(url) + * if url.port > -1: # <<<<<<<<<<<<<< * output += f":{url.port}" - * elif not canonicalize: + * elif url._port_token_seen: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1489, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__pyx_t_1 != Py_None); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_neg_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1358, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1490 - * output += _serialize_host(url.hostname) - * if url.port is not None: + /* "w3lib/_url.pyx":1359 + * output += _serialize_host(url) + * if url.port > -1: * output += f":{url.port}" # <<<<<<<<<<<<<< - * elif not canonicalize: - * if url._default_port_seen: + * elif url._port_token_seen: + * output += ":" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1490, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1490, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1489 + /* "w3lib/_url.pyx":1358 * output += "@" - * output += _serialize_host(url.hostname) - * if url.port is not None: # <<<<<<<<<<<<<< + * output += _serialize_host(url) + * if url.port > -1: # <<<<<<<<<<<<<< * output += f":{url.port}" - * elif not canonicalize: + * elif url._port_token_seen: */ goto __pyx_L10; } - /* "w3lib/_url.pyx":1491 - * if url.port is not None: - * output += f":{url.port}" - * elif not canonicalize: # <<<<<<<<<<<<<< - * if url._default_port_seen: - * output += f":{_DEFAULT_PORTS[url.scheme]}" - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_canonicalize); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1491, __pyx_L1_error) - __pyx_t_5 = (!__pyx_t_3); - if (__pyx_t_5) { - - /* "w3lib/_url.pyx":1492 + /* "w3lib/_url.pyx":1360 + * if url.port > -1: * output += f":{url.port}" - * elif not canonicalize: - * if url._default_port_seen: # <<<<<<<<<<<<<< - * output += f":{_DEFAULT_PORTS[url.scheme]}" - * elif url._port_token_seen: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_default_port_seen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1492, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_5) { - - /* "w3lib/_url.pyx":1493 - * elif not canonicalize: - * if url._default_port_seen: - * output += f":{_DEFAULT_PORTS[url.scheme]}" # <<<<<<<<<<<<<< - * elif url._port_token_seen: - * output += ":" + * elif url._port_token_seen: # <<<<<<<<<<<<<< + * output += ":" + * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1360, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { - /* "w3lib/_url.pyx":1492 + /* "w3lib/_url.pyx":1361 * output += f":{url.port}" - * elif not canonicalize: - * if url._default_port_seen: # <<<<<<<<<<<<<< - * output += f":{_DEFAULT_PORTS[url.scheme]}" - * elif url._port_token_seen: - */ - goto __pyx_L11; - } - - /* "w3lib/_url.pyx":1494 - * if url._default_port_seen: - * output += f":{_DEFAULT_PORTS[url.scheme]}" - * elif url._port_token_seen: # <<<<<<<<<<<<<< - * output += ":" - * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1494, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "w3lib/_url.pyx":1495 - * output += f":{_DEFAULT_PORTS[url.scheme]}" - * elif url._port_token_seen: - * output += ":" # <<<<<<<<<<<<<< - * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + * elif url._port_token_seen: + * output += ":" # <<<<<<<<<<<<<< + * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: * output += "/." */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); - __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":1494 - * if url._default_port_seen: - * output += f":{_DEFAULT_PORTS[url.scheme]}" - * elif url._port_token_seen: # <<<<<<<<<<<<<< - * output += ":" - * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: - */ - } - __pyx_L11:; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1491 - * if url.port is not None: + /* "w3lib/_url.pyx":1360 + * if url.port > -1: * output += f":{url.port}" - * elif not canonicalize: # <<<<<<<<<<<<<< - * if url._default_port_seen: - * output += f":{_DEFAULT_PORTS[url.scheme]}" + * elif url._port_token_seen: # <<<<<<<<<<<<<< + * output += ":" + * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: */ } __pyx_L10:; - /* "w3lib/_url.pyx":1479 + /* "w3lib/_url.pyx":1348 * """ * output = url.scheme + ":" - * if url.hostname is not None: # <<<<<<<<<<<<<< + * if url.hostname or url._host_type != HOSTNAME: # <<<<<<<<<<<<<< * output += "//" * if url.username or url.password: */ goto __pyx_L3; } - /* "w3lib/_url.pyx":1496 - * elif url._port_token_seen: - * output += ":" - * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1362 + * elif url._port_token_seen: + * output += ":" + * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< * output += "/." - * output += _serialize_url_path(url, canonicalize=canonicalize) + * output += _serialize_url_path(url) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_has_opaque_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1496, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = (!__pyx_t_3); - if (__pyx_t_4) { + __pyx_t_7 = (!__pyx_t_4); + if (__pyx_t_7) { } else { - __pyx_t_5 = __pyx_t_4; - goto __pyx_L12_bool_binop_done; + __pyx_t_3 = __pyx_t_7; + goto __pyx_L11_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1496, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1496, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = (__pyx_t_9 > 1); - if (__pyx_t_4) { + __pyx_t_7 = (__pyx_t_8 > 1); + if (__pyx_t_7) { } else { - __pyx_t_5 = __pyx_t_4; - goto __pyx_L12_bool_binop_done; + __pyx_t_3 = __pyx_t_7; + goto __pyx_L11_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1496, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1496, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = (!__pyx_t_4); - __pyx_t_5 = __pyx_t_3; - __pyx_L12_bool_binop_done:; - if (__pyx_t_5) { + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1362, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = (!__pyx_t_7); + __pyx_t_3 = __pyx_t_4; + __pyx_L11_bool_binop_done:; + if (__pyx_t_3) { - /* "w3lib/_url.pyx":1497 - * output += ":" - * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + /* "w3lib/_url.pyx":1363 + * output += ":" + * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: * output += "/." # <<<<<<<<<<<<<< - * output += _serialize_url_path(url, canonicalize=canonicalize) - * if url.query is not None: + * output += _serialize_url_path(url) + * if url.query: */ - __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__23); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1497, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_6); - __pyx_t_6 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__25); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1496 - * elif url._port_token_seen: - * output += ":" - * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1362 + * elif url._port_token_seen: + * output += ":" + * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< * output += "/." - * output += _serialize_url_path(url, canonicalize=canonicalize) + * output += _serialize_url_path(url) */ } __pyx_L3:; - /* "w3lib/_url.pyx":1498 - * elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + /* "w3lib/_url.pyx":1364 + * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: * output += "/." - * output += _serialize_url_path(url, canonicalize=canonicalize) # <<<<<<<<<<<<<< - * if url.query is not None: + * output += _serialize_url_path(url) # <<<<<<<<<<<<<< + * if url.query: * output += f"?{url.query}" */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_serialize_url_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1498, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_url_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_url); - __Pyx_GIVEREF(__pyx_v_url); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_url)) __PYX_ERR(0, 1498, __pyx_L1_error); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_canonicalize, __pyx_v_canonicalize) < 0) __PYX_ERR(0, 1498, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_url}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":1365 + * output += "/." + * output += _serialize_url_path(url) + * if url.query: # <<<<<<<<<<<<<< + * output += f"?{url.query}" + * elif url._query_token_seen: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1365, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; + if (__pyx_t_3) { + + /* "w3lib/_url.pyx":1366 + * output += _serialize_url_path(url) + * if url.query: + * output += f"?{url.query}" # <<<<<<<<<<<<<< + * elif url._query_token_seen: + * output += "?" + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__19, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; + + /* "w3lib/_url.pyx":1365 + * output += "/." + * output += _serialize_url_path(url) + * if url.query: # <<<<<<<<<<<<<< + * output += f"?{url.query}" + * elif url._query_token_seen: + */ + goto __pyx_L14; + } + + /* "w3lib/_url.pyx":1367 + * if url.query: + * output += f"?{url.query}" + * elif url._query_token_seen: # <<<<<<<<<<<<<< + * output += "?" + * if url.fragment: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1367, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "w3lib/_url.pyx":1368 + * output += f"?{url.query}" + * elif url._query_token_seen: + * output += "?" # <<<<<<<<<<<<<< + * if url.fragment: + * output += f"#{url.fragment}" + */ + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__19); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); + __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1499 - * output += "/." - * output += _serialize_url_path(url, canonicalize=canonicalize) - * if url.query is not None: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1367 + * if url.query: * output += f"?{url.query}" - * if not exclude_fragment and url.fragment is not None: + * elif url._query_token_seen: # <<<<<<<<<<<<<< + * output += "?" + * if url.fragment: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = (__pyx_t_2 != Py_None); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_5) { + } + __pyx_L14:; - /* "w3lib/_url.pyx":1500 - * output += _serialize_url_path(url, canonicalize=canonicalize) - * if url.query is not None: - * output += f"?{url.query}" # <<<<<<<<<<<<<< - * if not exclude_fragment and url.fragment is not None: + /* "w3lib/_url.pyx":1369 + * elif url._query_token_seen: + * output += "?" + * if url.fragment: # <<<<<<<<<<<<<< * output += f"#{url.fragment}" + * elif url._fragment_token_seen: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__14, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_7); - __pyx_t_7 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1369, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { - /* "w3lib/_url.pyx":1499 - * output += "/." - * output += _serialize_url_path(url, canonicalize=canonicalize) - * if url.query is not None: # <<<<<<<<<<<<<< - * output += f"?{url.query}" - * if not exclude_fragment and url.fragment is not None: + /* "w3lib/_url.pyx":1370 + * output += "?" + * if url.fragment: + * output += f"#{url.fragment}" # <<<<<<<<<<<<<< + * elif url._fragment_token_seen: + * output += "#" + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u__20, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; + + /* "w3lib/_url.pyx":1369 + * elif url._query_token_seen: + * output += "?" + * if url.fragment: # <<<<<<<<<<<<<< + * output += f"#{url.fragment}" + * elif url._fragment_token_seen: */ + goto __pyx_L15; } - /* "w3lib/_url.pyx":1501 - * if url.query is not None: - * output += f"?{url.query}" - * if not exclude_fragment and url.fragment is not None: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1371 + * if url.fragment: * output += f"#{url.fragment}" + * elif url._fragment_token_seen: # <<<<<<<<<<<<<< + * output += "#" * return output */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_exclude_fragment); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1501, __pyx_L1_error) - __pyx_t_4 = (!__pyx_t_3); - if (__pyx_t_4) { - } else { - __pyx_t_5 = __pyx_t_4; - goto __pyx_L17_bool_binop_done; - } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = (__pyx_t_7 != Py_None); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __pyx_t_4; - __pyx_L17_bool_binop_done:; - if (__pyx_t_5) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1371, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { - /* "w3lib/_url.pyx":1502 - * output += f"?{url.query}" - * if not exclude_fragment and url.fragment is not None: - * output += f"#{url.fragment}" # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1372 + * output += f"#{url.fragment}" + * elif url._fragment_token_seen: + * output += "#" # <<<<<<<<<<<<<< * return output * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__12, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1501 - * if url.query is not None: - * output += f"?{url.query}" - * if not exclude_fragment and url.fragment is not None: # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1371 + * if url.fragment: * output += f"#{url.fragment}" + * elif url._fragment_token_seen: # <<<<<<<<<<<<<< + * output += "#" * return output */ } + __pyx_L15:; - /* "w3lib/_url.pyx":1503 - * if not exclude_fragment and url.fragment is not None: - * output += f"#{url.fragment}" + /* "w3lib/_url.pyx":1373 + * elif url._fragment_token_seen: + * output += "#" * return output # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1503, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1373, __pyx_L1_error) __Pyx_INCREF(__pyx_v_output); __pyx_r = ((PyObject*)__pyx_v_output); goto __pyx_L0; - /* "w3lib/_url.pyx":1440 + /* "w3lib/_url.pyx":1341 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing - * def _serialize_url( # <<<<<<<<<<<<<< - * url: _URL, - * *, + * def _serialize_url(url: _URL) -> str: # <<<<<<<<<<<<<< + * """Return a string representation of *url* following the URL serialization + * algorithm defined in the `URL living standard`_. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("w3lib._url._serialize_url", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -23052,12 +21260,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "w3lib/_url.pyx":1506 +/* "w3lib/_url.pyx":1376 * * * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< - * url = _parse_url( - * input, + * url = _parse_url(input, encoding) + * return _serialize_url(url) */ /* Python wrapper */ @@ -23116,7 +21324,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1506, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -23124,14 +21332,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1506, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_safe_url", 1, 2, 2, 1); __PYX_ERR(0, 1506, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_url", 1, 2, 2, 1); __PYX_ERR(0, 1376, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_safe_url") < 0)) __PYX_ERR(0, 1506, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_safe_url") < 0)) __PYX_ERR(0, 1376, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -23144,7 +21352,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_safe_url", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1506, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_url", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1376, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23158,8 +21366,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 1506, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 1506, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 1376, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 1376, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_4_url_52_safe_url(__pyx_self, __pyx_v_input, __pyx_v_encoding); /* function exit code */ @@ -23184,153 +21392,86 @@ static PyObject *__pyx_pf_5w3lib_4_url_52_safe_url(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; + int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_url", 1); - /* "w3lib/_url.pyx":1507 + /* "w3lib/_url.pyx":1377 * * def _safe_url(input: str, encoding: str) -> str: - * url = _parse_url( # <<<<<<<<<<<<<< - * input, - * encoding=encoding, - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - - /* "w3lib/_url.pyx":1508 - * def _safe_url(input: str, encoding: str) -> str: - * url = _parse_url( - * input, # <<<<<<<<<<<<<< - * encoding=encoding, - * userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, + * url = _parse_url(input, encoding) # <<<<<<<<<<<<<< + * return _serialize_url(url) */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1507, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_input); - __Pyx_GIVEREF(__pyx_v_input); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input)) __PYX_ERR(0, 1507, __pyx_L1_error); - - /* "w3lib/_url.pyx":1509 - * url = _parse_url( - * input, - * encoding=encoding, # <<<<<<<<<<<<<< - * userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, - * path_percent_encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) - - /* "w3lib/_url.pyx":1510 - * input, - * encoding=encoding, - * userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< - * path_percent_encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, - * query_percent_encode_set=_SAFE_QUERY_PERCENT_ENCODE_SET, - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_userinfo_percent_encode_set, __pyx_t_4) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":1511 - * encoding=encoding, - * userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, - * path_percent_encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< - * query_percent_encode_set=_SAFE_QUERY_PERCENT_ENCODE_SET, - * special_query_percent_encode_set=_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET, - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_path_percent_encode_set, __pyx_t_4) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":1512 - * userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, - * path_percent_encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, - * query_percent_encode_set=_SAFE_QUERY_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< - * special_query_percent_encode_set=_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET, - * fragment_percent_encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET, - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_query_percent_encode_set, __pyx_t_4) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":1513 - * path_percent_encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, - * query_percent_encode_set=_SAFE_QUERY_PERCENT_ENCODE_SET, - * special_query_percent_encode_set=_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< - * fragment_percent_encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET, - * ) - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_special_query_percent_encode_set, __pyx_t_4) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":1514 - * query_percent_encode_set=_SAFE_QUERY_PERCENT_ENCODE_SET, - * special_query_percent_encode_set=_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET, - * fragment_percent_encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< - * ) - * return _serialize_url(url, canonicalize=False) - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fragment_percent_encode_set, __pyx_t_4) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":1507 - * - * def _safe_url(input: str, encoding: str) -> str: - * url = _parse_url( # <<<<<<<<<<<<<< - * input, - * encoding=encoding, - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_url = __pyx_t_4; + __pyx_t_3 = NULL; __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_input, __pyx_v_encoding}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_v_url = __pyx_t_1; + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1516 - * fragment_percent_encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET, - * ) - * return _serialize_url(url, canonicalize=False) # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":1378 + * def _safe_url(input: str, encoding: str) -> str: + * url = _parse_url(input, encoding) + * return _serialize_url(url) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_serialize_url); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_url); - __Pyx_GIVEREF(__pyx_v_url); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_url)) __PYX_ERR(0, 1516, __pyx_L1_error); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1516, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_serialize_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_canonicalize, Py_False) < 0) __PYX_ERR(0, 1516, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1516, __pyx_L1_error) + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_url}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1378, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1506 + /* "w3lib/_url.pyx":1376 * * * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< - * url = _parse_url( - * input, + * url = _parse_url(input, encoding) + * return _serialize_url(url) */ /* function exit code */ @@ -23338,7 +21479,6 @@ static PyObject *__pyx_pf_5w3lib_4_url_52_safe_url(CYTHON_UNUSED PyObject *__pyx __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("w3lib._url._safe_url", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -23690,6 +21830,9 @@ static PyMethodDef __pyx_methods[] = { static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, + {&__pyx_kp_b_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 0, 0}, + {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_kp_u_02X, __pyx_k_02X, sizeof(__pyx_k_02X), 0, 1, 0, 0}, {&__pyx_kp_u_0X, __pyx_k_0X, sizeof(__pyx_k_0X), 0, 1, 0, 0}, {&__pyx_kp_u_0x, __pyx_k_0x, sizeof(__pyx_k_0x), 0, 1, 0, 0}, @@ -23735,15 +21878,16 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_LABEL_ENCODINGS, __pyx_k_LABEL_ENCODINGS, sizeof(__pyx_k_LABEL_ENCODINGS), 0, 0, 1, 1}, {&__pyx_n_s_List, __pyx_k_List, sizeof(__pyx_k_List), 0, 0, 1, 1}, {&__pyx_kp_s_List_int, __pyx_k_List_int, sizeof(__pyx_k_List_int), 0, 0, 1, 0}, + {&__pyx_kp_s_List_str, __pyx_k_List_str, sizeof(__pyx_k_List_str), 0, 0, 1, 0}, + {&__pyx_kp_u_No_URL_scheme, __pyx_k_No_URL_scheme, sizeof(__pyx_k_No_URL_scheme), 0, 1, 0, 0}, {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1}, {&__pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS, __pyx_k_OUTPUT_ENCODING_UTF8_ENCODINGS, sizeof(__pyx_k_OUTPUT_ENCODING_UTF8_ENCODINGS), 0, 0, 1, 1}, {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1}, - {&__pyx_kp_s_Optional_bool, __pyx_k_Optional_bool, sizeof(__pyx_k_Optional_bool), 0, 0, 1, 0}, {&__pyx_kp_s_Optional_int, __pyx_k_Optional_int, sizeof(__pyx_k_Optional_int), 0, 0, 1, 0}, - {&__pyx_kp_s_Optional_str, __pyx_k_Optional_str, sizeof(__pyx_k_Optional_str), 0, 0, 1, 0}, {&__pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_k_PATH_PERCENT_ENCODE_SET, sizeof(__pyx_k_PATH_PERCENT_ENCODE_SET), 0, 0, 1, 1}, {&__pyx_n_s_PATH_SAFEST_CHARS, __pyx_k_PATH_SAFEST_CHARS, sizeof(__pyx_k_PATH_SAFEST_CHARS), 0, 0, 1, 1}, {&__pyx_n_s_PercentEncodeSet, __pyx_k_PercentEncodeSet, sizeof(__pyx_k_PercentEncodeSet), 0, 0, 1, 1}, + {&__pyx_kp_u_Port, __pyx_k_Port, sizeof(__pyx_k_Port), 0, 1, 0, 0}, {&__pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_k_QUERY_PERCENT_ENCODE_SET, sizeof(__pyx_k_QUERY_PERCENT_ENCODE_SET), 0, 0, 1, 1}, {&__pyx_n_s_QUERY_SAFEST_CHARS, __pyx_k_QUERY_SAFEST_CHARS, sizeof(__pyx_k_QUERY_SAFEST_CHARS), 0, 0, 1, 1}, {&__pyx_n_s_REPLACEMENT_ENCODING, __pyx_k_REPLACEMENT_ENCODING, sizeof(__pyx_k_REPLACEMENT_ENCODING), 0, 0, 1, 1}, @@ -23773,8 +21917,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_s_Tuple_int_bool, __pyx_k_Tuple_int_bool, sizeof(__pyx_k_Tuple_int_bool), 0, 0, 1, 0}, {&__pyx_n_s_URL, __pyx_k_URL, sizeof(__pyx_k_URL), 0, 0, 1, 1}, {&__pyx_n_s_URL___init, __pyx_k_URL___init, sizeof(__pyx_k_URL___init), 0, 0, 1, 1}, - {&__pyx_n_s_URL_has_opaque_path, __pyx_k_URL_has_opaque_path, sizeof(__pyx_k_URL_has_opaque_path), 0, 0, 1, 1}, - {&__pyx_n_s_URL_scheme, __pyx_k_URL_scheme, sizeof(__pyx_k_URL_scheme), 0, 0, 1, 1}, + {&__pyx_kp_u_URL_is_relative, __pyx_k_URL_is_relative, sizeof(__pyx_k_URL_is_relative), 0, 1, 0, 0}, {&__pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_k_USERINFO_PERCENT_ENCODE_SET, sizeof(__pyx_k_USERINFO_PERCENT_ENCODE_SET), 0, 0, 1, 1}, {&__pyx_n_s_USERINFO_SAFEST_CHARS, __pyx_k_USERINFO_SAFEST_CHARS, sizeof(__pyx_k_USERINFO_SAFEST_CHARS), 0, 0, 1, 1}, {&__pyx_n_s_UTF_16BE_ENCODING, __pyx_k_UTF_16BE_ENCODING, sizeof(__pyx_k_UTF_16BE_ENCODING), 0, 0, 1, 1}, @@ -23782,54 +21925,48 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_UTF_8_ENCODER, __pyx_k_UTF_8_ENCODER, sizeof(__pyx_k_UTF_8_ENCODER), 0, 0, 1, 1}, {&__pyx_n_s_UTF_8_ENCODING, __pyx_k_UTF_8_ENCODING, sizeof(__pyx_k_UTF_8_ENCODING), 0, 0, 1, 1}, {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, - {&__pyx_kp_s_Union_int_List_int_str, __pyx_k_Union_int_List_int_str, sizeof(__pyx_k_Union_int_List_int_str), 0, 0, 1, 0}, - {&__pyx_kp_s_Union_str_List_str, __pyx_k_Union_str_List_str, sizeof(__pyx_k_Union_str_List_str), 0, 0, 1, 0}, - {&__pyx_kp_s_Union_str_int_List_int, __pyx_k_Union_str_int_List_int, sizeof(__pyx_k_Union_str_int_List_int), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0}, {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, - {&__pyx_kp_b__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 0, 0}, - {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0}, - {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0}, - {&__pyx_n_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 1}, {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0}, {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0}, {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0}, {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0}, {&__pyx_kp_u__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0}, + {&__pyx_n_s__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 0, 1, 1}, {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0}, - {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, - {&__pyx_kp_b__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 0, 0}, - {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, + {&__pyx_kp_b__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 0, 0}, + {&__pyx_kp_u__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 1, 0, 0}, {&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0}, - {&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0}, {&__pyx_kp_u__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0, 0}, - {&__pyx_n_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 1}, + {&__pyx_kp_u__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 1, 0, 0}, + {&__pyx_kp_u__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 1, 0, 0}, + {&__pyx_n_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 1}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0}, {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, {&__pyx_kp_b__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 0, 0}, {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, - {&__pyx_kp_u__75, __pyx_k__75, sizeof(__pyx_k__75), 0, 1, 0, 0}, - {&__pyx_n_s__78, __pyx_k__78, sizeof(__pyx_k__78), 0, 0, 1, 1}, + {&__pyx_kp_u__73, __pyx_k__73, sizeof(__pyx_k__73), 0, 1, 0, 0}, + {&__pyx_n_s__76, __pyx_k__76, sizeof(__pyx_k__76), 0, 0, 1, 1}, + {&__pyx_kp_u__79, __pyx_k__79, sizeof(__pyx_k__79), 0, 1, 0, 0}, {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, + {&__pyx_kp_u__80, __pyx_k__80, sizeof(__pyx_k__80), 0, 1, 0, 0}, {&__pyx_kp_u__81, __pyx_k__81, sizeof(__pyx_k__81), 0, 1, 0, 0}, + {&__pyx_kp_b__82, __pyx_k__82, sizeof(__pyx_k__82), 0, 0, 0, 0}, {&__pyx_kp_u__82, __pyx_k__82, sizeof(__pyx_k__82), 0, 1, 0, 0}, {&__pyx_kp_u__83, __pyx_k__83, sizeof(__pyx_k__83), 0, 1, 0, 0}, - {&__pyx_kp_b__84, __pyx_k__84, sizeof(__pyx_k__84), 0, 0, 0, 0}, {&__pyx_kp_u__84, __pyx_k__84, sizeof(__pyx_k__84), 0, 1, 0, 0}, - {&__pyx_kp_u__85, __pyx_k__85, sizeof(__pyx_k__85), 0, 1, 0, 0}, - {&__pyx_kp_u__86, __pyx_k__86, sizeof(__pyx_k__86), 0, 1, 0, 0}, - {&__pyx_kp_b__87, __pyx_k__87, sizeof(__pyx_k__87), 0, 0, 0, 0}, - {&__pyx_kp_b__88, __pyx_k__88, sizeof(__pyx_k__88), 0, 0, 0, 0}, - {&__pyx_kp_u__89, __pyx_k__89, sizeof(__pyx_k__89), 0, 1, 0, 0}, + {&__pyx_kp_b__85, __pyx_k__85, sizeof(__pyx_k__85), 0, 0, 0, 0}, + {&__pyx_kp_b__86, __pyx_k__86, sizeof(__pyx_k__86), 0, 0, 0, 0}, + {&__pyx_kp_u__87, __pyx_k__87, sizeof(__pyx_k__87), 0, 1, 0, 0}, + {&__pyx_kp_b__89, __pyx_k__89, sizeof(__pyx_k__89), 0, 0, 0, 0}, {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, - {&__pyx_kp_b__91, __pyx_k__91, sizeof(__pyx_k__91), 0, 0, 0, 0}, - {&__pyx_kp_b__94, __pyx_k__94, sizeof(__pyx_k__94), 0, 0, 0, 0}, - {&__pyx_kp_b__95, __pyx_k__95, sizeof(__pyx_k__95), 0, 0, 0, 0}, - {&__pyx_kp_u__96, __pyx_k__96, sizeof(__pyx_k__96), 0, 1, 0, 0}, - {&__pyx_kp_u__97, __pyx_k__97, sizeof(__pyx_k__97), 0, 1, 0, 0}, + {&__pyx_kp_b__92, __pyx_k__92, sizeof(__pyx_k__92), 0, 0, 0, 0}, + {&__pyx_kp_b__93, __pyx_k__93, sizeof(__pyx_k__93), 0, 0, 0, 0}, + {&__pyx_kp_u__94, __pyx_k__94, sizeof(__pyx_k__94), 0, 1, 0, 0}, + {&__pyx_kp_u__95, __pyx_k__95, sizeof(__pyx_k__95), 0, 1, 0, 0}, {&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1}, {&__pyx_n_s_annotations, __pyx_k_annotations, sizeof(__pyx_k_annotations), 0, 0, 1, 1}, {&__pyx_kp_u_ansi_x3_4_1968, __pyx_k_ansi_x3_4_1968, sizeof(__pyx_k_ansi_x3_4_1968), 0, 1, 0, 0}, @@ -23844,7 +21981,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_at_sign_index, __pyx_k_at_sign_index, sizeof(__pyx_k_at_sign_index), 0, 0, 1, 1}, {&__pyx_n_s_at_sign_seen, __pyx_k_at_sign_seen, sizeof(__pyx_k_at_sign_seen), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, - {&__pyx_n_s_base_url, __pyx_k_base_url, sizeof(__pyx_k_base_url), 0, 0, 1, 1}, {&__pyx_n_s_be_strict, __pyx_k_be_strict, sizeof(__pyx_k_be_strict), 0, 0, 1, 1}, {&__pyx_n_u_big5, __pyx_k_big5, sizeof(__pyx_k_big5), 0, 1, 0, 1}, {&__pyx_kp_u_big5_hkscs, __pyx_k_big5_hkscs, sizeof(__pyx_k_big5_hkscs), 0, 1, 0, 0}, @@ -23852,7 +21988,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, {&__pyx_n_s_byte, __pyx_k_byte, sizeof(__pyx_k_byte), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, - {&__pyx_n_s_canonicalize, __pyx_k_canonicalize, sizeof(__pyx_k_canonicalize), 0, 0, 1, 1}, {&__pyx_n_s_check_bidi, __pyx_k_check_bidi, sizeof(__pyx_k_check_bidi), 0, 0, 1, 1}, {&__pyx_n_s_check_hyphens, __pyx_k_check_hyphens, sizeof(__pyx_k_check_hyphens), 0, 0, 1, 1}, {&__pyx_n_s_check_joiners, __pyx_k_check_joiners, sizeof(__pyx_k_check_joiners), 0, 0, 1, 1}, @@ -23904,7 +22039,8 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_current_index, __pyx_k_current_index, sizeof(__pyx_k_current_index), 0, 0, 1, 1}, {&__pyx_n_s_current_length, __pyx_k_current_length, sizeof(__pyx_k_current_length), 0, 0, 1, 1}, {&__pyx_n_u_cyrillic, __pyx_k_cyrillic, sizeof(__pyx_k_cyrillic), 0, 1, 0, 1}, - {&__pyx_n_s_default_port_seen, __pyx_k_default_port_seen, sizeof(__pyx_k_default_port_seen), 0, 0, 1, 1}, + {&__pyx_kp_s_cython_int, __pyx_k_cython_int, sizeof(__pyx_k_cython_int), 0, 0, 1, 0}, + {&__pyx_kp_s_cython_int_8, __pyx_k_cython_int_8, sizeof(__pyx_k_cython_int_8), 0, 0, 1, 0}, {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_digits, __pyx_k_digits, sizeof(__pyx_k_digits), 0, 0, 1, 1}, @@ -23930,11 +22066,10 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, {&__pyx_kp_u_euc_jp, __pyx_k_euc_jp, sizeof(__pyx_k_euc_jp), 0, 1, 0, 0}, {&__pyx_kp_u_euc_kr, __pyx_k_euc_kr, sizeof(__pyx_k_euc_kr), 0, 1, 0, 0}, - {&__pyx_n_s_exclude_fragment, __pyx_k_exclude_fragment, sizeof(__pyx_k_exclude_fragment), 0, 0, 1, 1}, {&__pyx_n_u_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 1, 0, 1}, {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1}, {&__pyx_n_s_fragment, __pyx_k_fragment, sizeof(__pyx_k_fragment), 0, 0, 1, 1}, - {&__pyx_n_s_fragment_percent_encode_set, __pyx_k_fragment_percent_encode_set, sizeof(__pyx_k_fragment_percent_encode_set), 0, 0, 1, 1}, + {&__pyx_n_s_fragment_token_seen, __pyx_k_fragment_token_seen, sizeof(__pyx_k_fragment_token_seen), 0, 0, 1, 1}, {&__pyx_n_u_ftp, __pyx_k_ftp, sizeof(__pyx_k_ftp), 0, 1, 0, 1}, {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, {&__pyx_n_u_gb18030, __pyx_k_gb18030, sizeof(__pyx_k_gb18030), 0, 1, 0, 1}, @@ -23944,16 +22079,14 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_u_gbk, __pyx_k_gbk, sizeof(__pyx_k_gbk), 0, 1, 0, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_encoder, __pyx_k_get_encoder, sizeof(__pyx_k_get_encoder), 0, 0, 1, 1}, {&__pyx_n_s_get_encoding, __pyx_k_get_encoding, sizeof(__pyx_k_get_encoding), 0, 0, 1, 1}, {&__pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_k_get_ipv6_first_longest_0_piece, sizeof(__pyx_k_get_ipv6_first_longest_0_piece), 0, 0, 1, 1}, {&__pyx_n_s_greater_than, __pyx_k_greater_than, sizeof(__pyx_k_greater_than), 0, 0, 1, 1}, {&__pyx_n_u_greek, __pyx_k_greek, sizeof(__pyx_k_greek), 0, 1, 0, 1}, {&__pyx_n_u_greek8, __pyx_k_greek8, sizeof(__pyx_k_greek8), 0, 1, 0, 1}, - {&__pyx_n_s_has_opaque_path, __pyx_k_has_opaque_path, sizeof(__pyx_k_has_opaque_path), 0, 0, 1, 1}, {&__pyx_n_u_hebrew, __pyx_k_hebrew, sizeof(__pyx_k_hebrew), 0, 1, 0, 1}, - {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1}, + {&__pyx_n_s_host_type, __pyx_k_host_type, sizeof(__pyx_k_host_type), 0, 0, 1, 1}, {&__pyx_n_s_hostname, __pyx_k_hostname, sizeof(__pyx_k_hostname), 0, 0, 1, 1}, {&__pyx_n_u_http, __pyx_k_http, sizeof(__pyx_k_http), 0, 1, 0, 1}, {&__pyx_n_u_https, __pyx_k_https, sizeof(__pyx_k_https), 0, 1, 0, 1}, @@ -23976,11 +22109,12 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, {&__pyx_n_s_ipv4, __pyx_k_ipv4, sizeof(__pyx_k_ipv4), 0, 0, 1, 1}, {&__pyx_n_s_ipv4_piece, __pyx_k_ipv4_piece, sizeof(__pyx_k_ipv4_piece), 0, 0, 1, 1}, + {&__pyx_n_s_ipv6, __pyx_k_ipv6, sizeof(__pyx_k_ipv6), 0, 0, 1, 1}, {&__pyx_kp_u_is_an_empty_string_after_conver, __pyx_k_is_an_empty_string_after_conver, sizeof(__pyx_k_is_an_empty_string_after_conver), 0, 1, 0, 0}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_is_double_dot_path_segment, __pyx_k_is_double_dot_path_segment, sizeof(__pyx_k_is_double_dot_path_segment), 0, 0, 1, 1}, {&__pyx_n_s_is_single_dot_path_segment, __pyx_k_is_single_dot_path_segment, sizeof(__pyx_k_is_single_dot_path_segment), 0, 0, 1, 1}, - {&__pyx_n_s_is_special, __pyx_k_is_special, sizeof(__pyx_k_is_special), 0, 0, 1, 1}, + {&__pyx_kp_u_is_too_high, __pyx_k_is_too_high, sizeof(__pyx_k_is_too_high), 0, 1, 0, 0}, {&__pyx_n_s_is_windows_drive_letter, __pyx_k_is_windows_drive_letter, sizeof(__pyx_k_is_windows_drive_letter), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_u_iso88591, __pyx_k_iso88591, sizeof(__pyx_k_iso88591), 0, 1, 0, 1}, @@ -24117,6 +22251,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_number, __pyx_k_number, sizeof(__pyx_k_number), 0, 0, 1, 1}, {&__pyx_n_s_numbers, __pyx_k_numbers, sizeof(__pyx_k_numbers), 0, 0, 1, 1}, {&__pyx_n_s_numbers_seen, __pyx_k_numbers_seen, sizeof(__pyx_k_numbers_seen), 0, 0, 1, 1}, + {&__pyx_n_s_opaque_path, __pyx_k_opaque_path, sizeof(__pyx_k_opaque_path), 0, 0, 1, 1}, {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, {&__pyx_n_s_parse_host, __pyx_k_parse_host, sizeof(__pyx_k_parse_host), 0, 0, 1, 1}, {&__pyx_n_s_parse_ipv4, __pyx_k_parse_ipv4, sizeof(__pyx_k_parse_ipv4), 0, 0, 1, 1}, @@ -24130,7 +22265,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_password, __pyx_k_password, sizeof(__pyx_k_password), 0, 0, 1, 1}, {&__pyx_n_s_password_token_seen, __pyx_k_password_token_seen, sizeof(__pyx_k_password_token_seen), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, - {&__pyx_n_s_path_percent_encode_set, __pyx_k_path_percent_encode_set, sizeof(__pyx_k_path_percent_encode_set), 0, 0, 1, 1}, {&__pyx_n_s_path_safe_chars, __pyx_k_path_safe_chars, sizeof(__pyx_k_path_safe_chars), 0, 0, 1, 1}, {&__pyx_n_s_path_token_seen, __pyx_k_path_token_seen, sizeof(__pyx_k_path_token_seen), 0, 0, 1, 1}, {&__pyx_n_s_percent_encode_after_encoding, __pyx_k_percent_encode_after_encoding, sizeof(__pyx_k_percent_encode_after_encoding), 0, 0, 1, 1}, @@ -24142,10 +22276,9 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_port_token_seen, __pyx_k_port_token_seen, sizeof(__pyx_k_port_token_seen), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_preprocess_url, __pyx_k_preprocess_url, sizeof(__pyx_k_preprocess_url), 0, 0, 1, 1}, - {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1}, - {&__pyx_n_s_query_percent_encode_set, __pyx_k_query_percent_encode_set, sizeof(__pyx_k_query_percent_encode_set), 0, 0, 1, 1}, + {&__pyx_n_s_query_token_seen, __pyx_k_query_token_seen, sizeof(__pyx_k_query_token_seen), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_reached_end, __pyx_k_reached_end, sizeof(__pyx_k_reached_end), 0, 0, 1, 1}, @@ -24158,7 +22291,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_safe_chars, __pyx_k_safe_chars, sizeof(__pyx_k_safe_chars), 0, 0, 1, 1}, {&__pyx_n_s_safe_url, __pyx_k_safe_url, sizeof(__pyx_k_safe_url), 0, 0, 1, 1}, {&__pyx_n_s_scheme, __pyx_k_scheme, sizeof(__pyx_k_scheme), 0, 0, 1, 1}, - {&__pyx_n_s_scheme_2, __pyx_k_scheme_2, sizeof(__pyx_k_scheme_2), 0, 0, 1, 1}, {&__pyx_n_s_segment, __pyx_k_segment, sizeof(__pyx_k_segment), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, @@ -24169,7 +22301,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_serialize_url, __pyx_k_serialize_url, sizeof(__pyx_k_serialize_url), 0, 0, 1, 1}, {&__pyx_n_s_serialize_url_path, __pyx_k_serialize_url_path, sizeof(__pyx_k_serialize_url_path), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, - {&__pyx_n_s_setter, __pyx_k_setter, sizeof(__pyx_k_setter), 0, 0, 1, 1}, {&__pyx_kp_u_shift_jis, __pyx_k_shift_jis, sizeof(__pyx_k_shift_jis), 0, 1, 0, 0}, {&__pyx_n_u_shift_jis_2, __pyx_k_shift_jis_2, sizeof(__pyx_k_shift_jis_2), 0, 1, 0, 1}, {&__pyx_n_s_short_windows_125, __pyx_k_short_windows_125, sizeof(__pyx_k_short_windows_125), 0, 0, 1, 1}, @@ -24178,7 +22309,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_skip_authority_shortcut, __pyx_k_skip_authority_shortcut, sizeof(__pyx_k_skip_authority_shortcut), 0, 0, 1, 1}, {&__pyx_n_s_space_as_plus, __pyx_k_space_as_plus, sizeof(__pyx_k_space_as_plus), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, - {&__pyx_n_s_special_query_percent_encode_set, __pyx_k_special_query_percent_encode_set, sizeof(__pyx_k_special_query_percent_encode_set), 0, 0, 1, 1}, {&__pyx_n_s_starts_with_windows_drive_lette, __pyx_k_starts_with_windows_drive_lette, sizeof(__pyx_k_starts_with_windows_drive_lette), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, @@ -24194,6 +22324,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_transitional_processing, __pyx_k_transitional_processing, sizeof(__pyx_k_transitional_processing), 0, 0, 1, 1}, {&__pyx_n_s_translate, __pyx_k_translate, sizeof(__pyx_k_translate), 0, 0, 1, 1}, {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, + {&__pyx_n_s_uchar, __pyx_k_uchar, sizeof(__pyx_k_uchar), 0, 0, 1, 1}, {&__pyx_kp_u_ucs_2, __pyx_k_ucs_2, sizeof(__pyx_k_ucs_2), 0, 1, 0, 0}, {&__pyx_n_u_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 1, 0, 1}, {&__pyx_n_u_unicode11utf8, __pyx_k_unicode11utf8, sizeof(__pyx_k_unicode11utf8), 0, 1, 0, 1}, @@ -24206,7 +22337,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_urllib_parse, __pyx_k_urllib_parse, sizeof(__pyx_k_urllib_parse), 0, 0, 1, 1}, {&__pyx_kp_u_us_ascii, __pyx_k_us_ascii, sizeof(__pyx_k_us_ascii), 0, 1, 0, 0}, {&__pyx_n_s_use_std3_ascii_rules, __pyx_k_use_std3_ascii_rules, sizeof(__pyx_k_use_std3_ascii_rules), 0, 0, 1, 1}, - {&__pyx_n_s_userinfo_percent_encode_set, __pyx_k_userinfo_percent_encode_set, sizeof(__pyx_k_userinfo_percent_encode_set), 0, 0, 1, 1}, {&__pyx_n_s_username, __pyx_k_username, sizeof(__pyx_k_username), 0, 0, 1, 1}, {&__pyx_n_u_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 1, 0, 1}, {&__pyx_kp_u_utf_16, __pyx_k_utf_16, sizeof(__pyx_k_utf_16), 0, 1, 0, 0}, @@ -24250,13 +22380,12 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 562, __pyx_L1_error) - __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 460, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 461, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 597, __pyx_L1_error) - __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 602, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 744, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1138, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 461, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 739, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1067, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -24267,849 +22396,838 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "w3lib/_url.pyx":580 + /* "w3lib/_url.pyx":575 * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): * return * url.path = path[:-1] # <<<<<<<<<<<<<< * * */ - __pyx_slice_ = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice_); - __Pyx_GIVEREF(__pyx_slice_); + __pyx_slice__2 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__2); + __Pyx_GIVEREF(__pyx_slice__2); - /* "w3lib/_url.pyx":810 + /* "w3lib/_url.pyx":805 * r = 8 * if not input: * return (0, True) # <<<<<<<<<<<<<< * return (int(input, base=r), validation_error) * */ - __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, Py_True); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 810, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, Py_True); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "w3lib/_url.pyx":1291 + /* "w3lib/_url.pyx":1026 + * + * elif state == NO_SCHEME: + * raise ValueError("No URL scheme") # <<<<<<<<<<<<<< + * + * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_No_URL_scheme); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "w3lib/_url.pyx":1033 + * pointer += 1 + * else: + * raise ValueError("URL is relative") # <<<<<<<<<<<<<< + * + * elif state == PATH_OR_AUTHORITY: + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_URL_is_relative); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "w3lib/_url.pyx":1192 * and _is_windows_drive_letter(buffer) * ): * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< * if ( * not url.path */ - __pyx_slice__20 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 1291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__20); - __Pyx_GIVEREF(__pyx_slice__20); + __pyx_slice__22 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(0, 1192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__22); + __Pyx_GIVEREF(__pyx_slice__22); - /* "w3lib/_url.pyx":44 + /* "w3lib/_url.pyx":45 * * * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< * return { * label: f"windows-125{last_digit}" */ - __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_last_digit, __pyx_n_s_label); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_short_windows_125, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_last_digit, __pyx_n_s_label); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_short_windows_125, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 45, __pyx_L1_error) - /* "w3lib/_url.pyx":68 + /* "w3lib/_url.pyx":69 * label: _UTF_8_ENCODING * for label in ( * "unicode-1-1-utf-8", # <<<<<<<<<<<<<< * "unicode11utf8", * "unicode20utf8", */ - __pyx_tuple__27 = PyTuple_Pack(6, __pyx_kp_u_unicode_1_1_utf_8, __pyx_n_u_unicode11utf8, __pyx_n_u_unicode20utf8, __pyx_kp_u_utf_8, __pyx_n_u_utf8, __pyx_kp_u_x_unicode20utf8); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__29 = PyTuple_Pack(6, __pyx_kp_u_unicode_1_1_utf_8, __pyx_n_u_unicode11utf8, __pyx_n_u_unicode20utf8, __pyx_kp_u_utf_8, __pyx_n_u_utf8, __pyx_kp_u_x_unicode20utf8); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); - /* "w3lib/_url.pyx":79 + /* "w3lib/_url.pyx":80 * label: "ibm866" * for label in ( * "866", # <<<<<<<<<<<<<< * "cp866", * "csibm866", */ - __pyx_tuple__28 = PyTuple_Pack(4, __pyx_kp_u_866, __pyx_n_u_cp866, __pyx_n_u_csibm866, __pyx_n_u_ibm866); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 79, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__30 = PyTuple_Pack(4, __pyx_kp_u_866, __pyx_n_u_cp866, __pyx_n_u_csibm866, __pyx_n_u_ibm866); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); - /* "w3lib/_url.pyx":88 + /* "w3lib/_url.pyx":89 * label: "iso-8859-2" * for label in ( * "csisolatin2", # <<<<<<<<<<<<<< * "iso-8859-2", * "iso-ir-101", */ - __pyx_tuple__29 = PyTuple_Pack(9, __pyx_n_u_csisolatin2, __pyx_kp_u_iso_8859_2, __pyx_kp_u_iso_ir_101, __pyx_kp_u_iso8859_2, __pyx_n_u_iso88592, __pyx_kp_u_iso_8859_2_2, __pyx_kp_u_iso_8859_2_1987, __pyx_n_u_l2, __pyx_n_u_latin2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__31 = PyTuple_Pack(9, __pyx_n_u_csisolatin2, __pyx_kp_u_iso_8859_2, __pyx_kp_u_iso_ir_101, __pyx_kp_u_iso8859_2, __pyx_n_u_iso88592, __pyx_kp_u_iso_8859_2_2, __pyx_kp_u_iso_8859_2_1987, __pyx_n_u_l2, __pyx_n_u_latin2); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); - /* "w3lib/_url.pyx":102 + /* "w3lib/_url.pyx":103 * label: "iso-8859-3" * for label in ( * "csisolatin3", # <<<<<<<<<<<<<< * "iso-8859-3", * "iso-ir-109", */ - __pyx_tuple__30 = PyTuple_Pack(9, __pyx_n_u_csisolatin3, __pyx_kp_u_iso_8859_3, __pyx_kp_u_iso_ir_109, __pyx_kp_u_iso8859_3, __pyx_n_u_iso88593, __pyx_kp_u_iso_8859_3_2, __pyx_kp_u_iso_8859_3_1988, __pyx_n_u_l3, __pyx_n_u_latin3); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__32 = PyTuple_Pack(9, __pyx_n_u_csisolatin3, __pyx_kp_u_iso_8859_3, __pyx_kp_u_iso_ir_109, __pyx_kp_u_iso8859_3, __pyx_n_u_iso88593, __pyx_kp_u_iso_8859_3_2, __pyx_kp_u_iso_8859_3_1988, __pyx_n_u_l3, __pyx_n_u_latin3); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); - /* "w3lib/_url.pyx":116 + /* "w3lib/_url.pyx":117 * label: "iso-8859-4" * for label in ( * "csisolatin4", # <<<<<<<<<<<<<< * "iso-8859-4", * "iso-ir-110", */ - __pyx_tuple__31 = PyTuple_Pack(9, __pyx_n_u_csisolatin4, __pyx_kp_u_iso_8859_4, __pyx_kp_u_iso_ir_110, __pyx_kp_u_iso8859_4, __pyx_n_u_iso88594, __pyx_kp_u_iso_8859_4_2, __pyx_kp_u_iso_8859_4_1988, __pyx_n_u_l4, __pyx_n_u_latin4); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_tuple__33 = PyTuple_Pack(9, __pyx_n_u_csisolatin4, __pyx_kp_u_iso_8859_4, __pyx_kp_u_iso_ir_110, __pyx_kp_u_iso8859_4, __pyx_n_u_iso88594, __pyx_kp_u_iso_8859_4_2, __pyx_kp_u_iso_8859_4_1988, __pyx_n_u_l4, __pyx_n_u_latin4); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); - /* "w3lib/_url.pyx":130 + /* "w3lib/_url.pyx":131 * label: "iso-8859-5" * for label in ( * "csisolatincyrillic", # <<<<<<<<<<<<<< * "cyrillic", * "iso-8859-5", */ - __pyx_tuple__32 = PyTuple_Pack(8, __pyx_n_u_csisolatincyrillic, __pyx_n_u_cyrillic, __pyx_kp_u_iso_8859_5, __pyx_kp_u_iso_ir_144, __pyx_kp_u_iso8859_5, __pyx_n_u_iso88595, __pyx_kp_u_iso_8859_5_2, __pyx_kp_u_iso_8859_5_1988); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_tuple__34 = PyTuple_Pack(8, __pyx_n_u_csisolatincyrillic, __pyx_n_u_cyrillic, __pyx_kp_u_iso_8859_5, __pyx_kp_u_iso_ir_144, __pyx_kp_u_iso8859_5, __pyx_n_u_iso88595, __pyx_kp_u_iso_8859_5_2, __pyx_kp_u_iso_8859_5_1988); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); - /* "w3lib/_url.pyx":143 + /* "w3lib/_url.pyx":144 * label: "iso-8859-6" * for label in ( * "arabic", # <<<<<<<<<<<<<< * "asmo-708", * "csiso88596e", */ - __pyx_tuple__33 = PyTuple_Pack(14, __pyx_n_u_arabic, __pyx_kp_u_asmo_708, __pyx_n_u_csiso88596e, __pyx_n_u_csiso88596i, __pyx_n_u_csisolatinarabic, __pyx_kp_u_ecma_114, __pyx_kp_u_iso_8859_6, __pyx_kp_u_iso_8859_6_e, __pyx_kp_u_iso_8859_6_i, __pyx_kp_u_iso_ir_127, __pyx_kp_u_iso8859_6, __pyx_n_u_iso88596, __pyx_kp_u_iso_8859_6_2, __pyx_kp_u_iso_8859_6_1987); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_tuple__35 = PyTuple_Pack(14, __pyx_n_u_arabic, __pyx_kp_u_asmo_708, __pyx_n_u_csiso88596e, __pyx_n_u_csiso88596i, __pyx_n_u_csisolatinarabic, __pyx_kp_u_ecma_114, __pyx_kp_u_iso_8859_6, __pyx_kp_u_iso_8859_6_e, __pyx_kp_u_iso_8859_6_i, __pyx_kp_u_iso_ir_127, __pyx_kp_u_iso8859_6, __pyx_n_u_iso88596, __pyx_kp_u_iso_8859_6_2, __pyx_kp_u_iso_8859_6_1987); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); - /* "w3lib/_url.pyx":162 + /* "w3lib/_url.pyx":163 * label: "iso-8859-7" * for label in ( * "csisolatingreek", # <<<<<<<<<<<<<< * "ecma-118", * "elot_928", */ - __pyx_tuple__34 = PyTuple_Pack(12, __pyx_n_u_csisolatingreek, __pyx_kp_u_ecma_118, __pyx_n_u_elot_928, __pyx_n_u_greek, __pyx_n_u_greek8, __pyx_kp_u_iso_8859_7, __pyx_kp_u_iso_ir_126, __pyx_kp_u_iso8859_7, __pyx_n_u_iso88597, __pyx_kp_u_iso_8859_7_2, __pyx_kp_u_iso_8859_7_1987, __pyx_n_u_sun_eu_greek); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_tuple__36 = PyTuple_Pack(12, __pyx_n_u_csisolatingreek, __pyx_kp_u_ecma_118, __pyx_n_u_elot_928, __pyx_n_u_greek, __pyx_n_u_greek8, __pyx_kp_u_iso_8859_7, __pyx_kp_u_iso_ir_126, __pyx_kp_u_iso8859_7, __pyx_n_u_iso88597, __pyx_kp_u_iso_8859_7_2, __pyx_kp_u_iso_8859_7_1987, __pyx_n_u_sun_eu_greek); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); - /* "w3lib/_url.pyx":179 + /* "w3lib/_url.pyx":180 * label: "iso-8859-8" * for label in ( * "csiso88598e", # <<<<<<<<<<<<<< * "csisolatinhebrew", * "hebrew", */ - __pyx_tuple__35 = PyTuple_Pack(11, __pyx_n_u_csiso88598e, __pyx_n_u_csisolatinhebrew, __pyx_n_u_hebrew, __pyx_kp_u_iso_8859_8, __pyx_kp_u_iso_8859_8_e, __pyx_kp_u_iso_ir_138, __pyx_kp_u_iso8859_8, __pyx_n_u_iso88598, __pyx_kp_u_iso_8859_8_2, __pyx_kp_u_iso_8859_8_1988, __pyx_n_u_visual); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_tuple__37 = PyTuple_Pack(11, __pyx_n_u_csiso88598e, __pyx_n_u_csisolatinhebrew, __pyx_n_u_hebrew, __pyx_kp_u_iso_8859_8, __pyx_kp_u_iso_8859_8_e, __pyx_kp_u_iso_ir_138, __pyx_kp_u_iso8859_8, __pyx_n_u_iso88598, __pyx_kp_u_iso_8859_8_2, __pyx_kp_u_iso_8859_8_1988, __pyx_n_u_visual); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); - /* "w3lib/_url.pyx":195 + /* "w3lib/_url.pyx":196 * label: "iso-8859-8-i" * for label in ( * "csiso88598i", # <<<<<<<<<<<<<< * "iso-8859-8-i", * "logical", */ - __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_u_csiso88598i, __pyx_kp_u_iso_8859_8_i, __pyx_n_u_logical); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_tuple__38 = PyTuple_Pack(3, __pyx_n_u_csiso88598i, __pyx_kp_u_iso_8859_8_i, __pyx_n_u_logical); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 196, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); - /* "w3lib/_url.pyx":203 + /* "w3lib/_url.pyx":204 * label: "iso-8859-10" * for label in ( * "csisolatin6", # <<<<<<<<<<<<<< * "iso-8859-10", * "iso-ir-157", */ - __pyx_tuple__37 = PyTuple_Pack(7, __pyx_n_u_csisolatin6, __pyx_kp_u_iso_8859_10, __pyx_kp_u_iso_ir_157, __pyx_kp_u_iso8859_10, __pyx_n_u_iso885910, __pyx_n_u_l6, __pyx_n_u_latin6); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_tuple__39 = PyTuple_Pack(7, __pyx_n_u_csisolatin6, __pyx_kp_u_iso_8859_10, __pyx_kp_u_iso_ir_157, __pyx_kp_u_iso8859_10, __pyx_n_u_iso885910, __pyx_n_u_l6, __pyx_n_u_latin6); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); - /* "w3lib/_url.pyx":227 + /* "w3lib/_url.pyx":228 * label: "iso-8859-13" * for label in ( * "iso-8859-13", # <<<<<<<<<<<<<< * "iso8859-13", * "iso885913", */ - __pyx_tuple__38 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_13, __pyx_kp_u_iso8859_13, __pyx_n_u_iso885913); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 227, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_tuple__40 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_13, __pyx_kp_u_iso8859_13, __pyx_n_u_iso885913); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); - /* "w3lib/_url.pyx":235 + /* "w3lib/_url.pyx":236 * label: "iso-8859-14" * for label in ( * "iso-8859-14", # <<<<<<<<<<<<<< * "iso8859-14", * "iso885914", */ - __pyx_tuple__39 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_14, __pyx_kp_u_iso8859_14, __pyx_n_u_iso885914); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_tuple__41 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_14, __pyx_kp_u_iso8859_14, __pyx_n_u_iso885914); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); - /* "w3lib/_url.pyx":243 + /* "w3lib/_url.pyx":244 * label: "iso-8859-15" * for label in ( * "csisolatin9", # <<<<<<<<<<<<<< * "iso-8859-15", * "iso8859-15", */ - __pyx_tuple__40 = PyTuple_Pack(6, __pyx_n_u_csisolatin9, __pyx_kp_u_iso_8859_15, __pyx_kp_u_iso8859_15, __pyx_n_u_iso885915, __pyx_kp_u_iso_8859_15_2, __pyx_n_u_l9); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_tuple__42 = PyTuple_Pack(6, __pyx_n_u_csisolatin9, __pyx_kp_u_iso_8859_15, __pyx_kp_u_iso8859_15, __pyx_n_u_iso885915, __pyx_kp_u_iso_8859_15_2, __pyx_n_u_l9); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); - /* "w3lib/_url.pyx":255 + /* "w3lib/_url.pyx":256 * label: "koi8-r" * for label in ( * "cskoi8r", # <<<<<<<<<<<<<< * "koi", * "koi8", */ - __pyx_tuple__41 = PyTuple_Pack(5, __pyx_n_u_cskoi8r, __pyx_n_u_koi, __pyx_n_u_koi8, __pyx_kp_u_koi8_r, __pyx_n_u_koi8_r_2); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_tuple__43 = PyTuple_Pack(5, __pyx_n_u_cskoi8r, __pyx_n_u_koi, __pyx_n_u_koi8, __pyx_kp_u_koi8_r, __pyx_n_u_koi8_r_2); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); - /* "w3lib/_url.pyx":265 + /* "w3lib/_url.pyx":266 * label: "koi8-u" * for label in ( * "koi8-ru", # <<<<<<<<<<<<<< * "koi8-u", * ) */ - __pyx_tuple__42 = PyTuple_Pack(2, __pyx_kp_u_koi8_ru, __pyx_kp_u_koi8_u); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_tuple__44 = PyTuple_Pack(2, __pyx_kp_u_koi8_ru, __pyx_kp_u_koi8_u); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); - /* "w3lib/_url.pyx":272 + /* "w3lib/_url.pyx":273 * label: "macintosh" * for label in ( * "csmacintosh", # <<<<<<<<<<<<<< * "mac", * "macintosh", */ - __pyx_tuple__43 = PyTuple_Pack(4, __pyx_n_u_csmacintosh, __pyx_n_u_mac, __pyx_n_u_macintosh, __pyx_kp_u_x_mac_roman); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_u_csmacintosh, __pyx_n_u_mac, __pyx_n_u_macintosh, __pyx_kp_u_x_mac_roman); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); - /* "w3lib/_url.pyx":281 + /* "w3lib/_url.pyx":282 * label: "cp874" * for label in ( * "dos-874", # <<<<<<<<<<<<<< * "iso-8859-11", * "iso8859-11", */ - __pyx_tuple__44 = PyTuple_Pack(6, __pyx_kp_u_dos_874, __pyx_kp_u_iso_8859_11, __pyx_kp_u_iso8859_11, __pyx_n_u_iso885911, __pyx_kp_u_tis_620, __pyx_kp_u_windows_874); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_tuple__46 = PyTuple_Pack(6, __pyx_kp_u_dos_874, __pyx_kp_u_iso_8859_11, __pyx_kp_u_iso8859_11, __pyx_n_u_iso885911, __pyx_kp_u_tis_620, __pyx_kp_u_windows_874); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); - /* "w3lib/_url.pyx":289 + /* "w3lib/_url.pyx":290 * ) * }, * **_short_windows_125(0), # <<<<<<<<<<<<<< * **_short_windows_125(1), * **{ */ - __pyx_tuple__45 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); - /* "w3lib/_url.pyx":290 + /* "w3lib/_url.pyx":291 * }, * **_short_windows_125(0), * **_short_windows_125(1), # <<<<<<<<<<<<<< * **{ * label: "windows-1252" */ - __pyx_tuple__46 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); - /* "w3lib/_url.pyx":294 + /* "w3lib/_url.pyx":295 * label: "windows-1252" * for label in ( * "ansi_x3.4-1968", # <<<<<<<<<<<<<< * "ascii", * "cp1252", */ - __pyx_tuple__47 = PyTuple_Pack(17, __pyx_kp_u_ansi_x3_4_1968, __pyx_n_u_ascii, __pyx_n_u_cp1252, __pyx_n_u_cp819, __pyx_n_u_csisolatin1, __pyx_n_u_ibm819, __pyx_kp_u_iso_8859_1, __pyx_kp_u_iso_ir_100, __pyx_kp_u_iso8859_1, __pyx_n_u_iso88591, __pyx_kp_u_iso_8859_1_2, __pyx_kp_u_iso_8859_1_1987, __pyx_n_u_l1, __pyx_n_u_latin1, __pyx_kp_u_us_ascii, __pyx_kp_u_windows_1252, __pyx_kp_u_x_cp1252); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_tuple__49 = PyTuple_Pack(17, __pyx_kp_u_ansi_x3_4_1968, __pyx_n_u_ascii, __pyx_n_u_cp1252, __pyx_n_u_cp819, __pyx_n_u_csisolatin1, __pyx_n_u_ibm819, __pyx_kp_u_iso_8859_1, __pyx_kp_u_iso_ir_100, __pyx_kp_u_iso8859_1, __pyx_n_u_iso88591, __pyx_kp_u_iso_8859_1_2, __pyx_kp_u_iso_8859_1_1987, __pyx_n_u_l1, __pyx_n_u_latin1, __pyx_kp_u_us_ascii, __pyx_kp_u_windows_1252, __pyx_kp_u_x_cp1252); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); - /* "w3lib/_url.pyx":313 + /* "w3lib/_url.pyx":314 * ) * }, * **_short_windows_125(3), # <<<<<<<<<<<<<< * **{ * label: "windows-1254" */ - __pyx_tuple__48 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 313, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); - /* "w3lib/_url.pyx":317 + /* "w3lib/_url.pyx":318 * label: "windows-1254" * for label in ( * "cp1254", # <<<<<<<<<<<<<< * "csisolatin5", * "iso-8859-9", */ - __pyx_tuple__49 = PyTuple_Pack(12, __pyx_n_u_cp1254, __pyx_n_u_csisolatin5, __pyx_kp_u_iso_8859_9, __pyx_kp_u_iso_ir_148, __pyx_kp_u_iso8859_9, __pyx_n_u_iso88599, __pyx_kp_u_iso_8859_9_2, __pyx_kp_u_iso_8859_9_1989, __pyx_n_u_l5, __pyx_n_u_latin5, __pyx_kp_u_windows_1254, __pyx_kp_u_x_cp1254); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_tuple__51 = PyTuple_Pack(12, __pyx_n_u_cp1254, __pyx_n_u_csisolatin5, __pyx_kp_u_iso_8859_9, __pyx_kp_u_iso_ir_148, __pyx_kp_u_iso8859_9, __pyx_n_u_iso88599, __pyx_kp_u_iso_8859_9_2, __pyx_kp_u_iso_8859_9_1989, __pyx_n_u_l5, __pyx_n_u_latin5, __pyx_kp_u_windows_1254, __pyx_kp_u_x_cp1254); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); - /* "w3lib/_url.pyx":331 + /* "w3lib/_url.pyx":332 * ) * }, * **_short_windows_125(5), # <<<<<<<<<<<<<< * **_short_windows_125(6), * **_short_windows_125(7), */ - __pyx_tuple__50 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__50); - __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); - /* "w3lib/_url.pyx":332 + /* "w3lib/_url.pyx":333 * }, * **_short_windows_125(5), * **_short_windows_125(6), # <<<<<<<<<<<<<< * **_short_windows_125(7), * **_short_windows_125(8), */ - __pyx_tuple__51 = PyTuple_Pack(1, __pyx_int_6); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 332, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_int_6); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); - /* "w3lib/_url.pyx":333 + /* "w3lib/_url.pyx":334 * **_short_windows_125(5), * **_short_windows_125(6), * **_short_windows_125(7), # <<<<<<<<<<<<<< * **_short_windows_125(8), * **{ */ - __pyx_tuple__52 = PyTuple_Pack(1, __pyx_int_7); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__52); - __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_int_7); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); - /* "w3lib/_url.pyx":334 + /* "w3lib/_url.pyx":335 * **_short_windows_125(6), * **_short_windows_125(7), * **_short_windows_125(8), # <<<<<<<<<<<<<< * **{ * label: "mac-cyrillic" */ - __pyx_tuple__53 = PyTuple_Pack(1, __pyx_int_8); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__53); - __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_int_8); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); - /* "w3lib/_url.pyx":338 + /* "w3lib/_url.pyx":339 * label: "mac-cyrillic" * for label in ( * "x-mac-cyrillic", # <<<<<<<<<<<<<< * "x-mac-ukrainian", * ) */ - __pyx_tuple__54 = PyTuple_Pack(2, __pyx_kp_u_x_mac_cyrillic, __pyx_kp_u_x_mac_ukrainian); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__54); - __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_tuple__56 = PyTuple_Pack(2, __pyx_kp_u_x_mac_cyrillic, __pyx_kp_u_x_mac_ukrainian); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); - /* "w3lib/_url.pyx":345 + /* "w3lib/_url.pyx":346 * label: "gbk" * for label in ( * "chinese", # <<<<<<<<<<<<<< * "csgb2312", * "csiso58gb231280", */ - __pyx_tuple__55 = PyTuple_Pack(9, __pyx_n_u_chinese, __pyx_n_u_csgb2312, __pyx_n_u_csiso58gb231280, __pyx_n_u_gb2312, __pyx_n_u_gb_2312, __pyx_kp_u_gb_2312_80, __pyx_n_u_gbk, __pyx_kp_u_iso_ir_58, __pyx_kp_u_x_gbk); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 345, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__55); - __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_tuple__57 = PyTuple_Pack(9, __pyx_n_u_chinese, __pyx_n_u_csgb2312, __pyx_n_u_csiso58gb231280, __pyx_n_u_gb2312, __pyx_n_u_gb_2312, __pyx_kp_u_gb_2312_80, __pyx_n_u_gbk, __pyx_kp_u_iso_ir_58, __pyx_kp_u_x_gbk); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); - /* "w3lib/_url.pyx":360 + /* "w3lib/_url.pyx":361 * label: "big5" * for label in ( * "big5", # <<<<<<<<<<<<<< * "big5-hkscs", * "cn-big5", */ - __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_u_big5, __pyx_kp_u_big5_hkscs, __pyx_kp_u_cn_big5, __pyx_n_u_csbig5, __pyx_kp_u_x_x_big5); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_u_big5, __pyx_kp_u_big5_hkscs, __pyx_kp_u_cn_big5, __pyx_n_u_csbig5, __pyx_kp_u_x_x_big5); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); - /* "w3lib/_url.pyx":370 + /* "w3lib/_url.pyx":371 * label: "euc-jp" * for label in ( * "cseucpkdfmtjapanese", # <<<<<<<<<<<<<< * "euc-jp", * "x-euc-jp", */ - __pyx_tuple__57 = PyTuple_Pack(3, __pyx_n_u_cseucpkdfmtjapanese, __pyx_kp_u_euc_jp, __pyx_kp_u_x_euc_jp); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 370, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__57); - __Pyx_GIVEREF(__pyx_tuple__57); + __pyx_tuple__59 = PyTuple_Pack(3, __pyx_n_u_cseucpkdfmtjapanese, __pyx_kp_u_euc_jp, __pyx_kp_u_x_euc_jp); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); - /* "w3lib/_url.pyx":378 + /* "w3lib/_url.pyx":379 * label: "iso-2022-jp" * for label in ( * "csiso2022jp", # <<<<<<<<<<<<<< * "iso-2022-jp", * ) */ - __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_u_csiso2022jp, __pyx_kp_u_iso_2022_jp); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__58); - __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_u_csiso2022jp, __pyx_kp_u_iso_2022_jp); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); - /* "w3lib/_url.pyx":385 + /* "w3lib/_url.pyx":386 * label: "shift_jis" * for label in ( * "csshiftjis", # <<<<<<<<<<<<<< * "ms932", * "ms_kanji", */ - __pyx_tuple__59 = PyTuple_Pack(8, __pyx_n_u_csshiftjis, __pyx_n_u_ms932, __pyx_n_u_ms_kanji, __pyx_kp_u_shift_jis, __pyx_n_u_shift_jis_2, __pyx_n_u_sjis, __pyx_kp_u_windows_31j, __pyx_kp_u_x_sjis); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__59); - __Pyx_GIVEREF(__pyx_tuple__59); + __pyx_tuple__61 = PyTuple_Pack(8, __pyx_n_u_csshiftjis, __pyx_n_u_ms932, __pyx_n_u_ms_kanji, __pyx_kp_u_shift_jis, __pyx_n_u_shift_jis_2, __pyx_n_u_sjis, __pyx_kp_u_windows_31j, __pyx_kp_u_x_sjis); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); - /* "w3lib/_url.pyx":398 + /* "w3lib/_url.pyx":399 * label: "euc-kr" * for label in ( * "cseuckr", # <<<<<<<<<<<<<< * "csksc56011987", * "euc-kr", */ - __pyx_tuple__60 = PyTuple_Pack(10, __pyx_n_u_cseuckr, __pyx_n_u_csksc56011987, __pyx_kp_u_euc_kr, __pyx_kp_u_iso_ir_149, __pyx_n_u_korean, __pyx_kp_u_ks_c_5601_1987, __pyx_kp_u_ks_c_5601_1989, __pyx_n_u_ksc5601, __pyx_n_u_ksc_5601, __pyx_kp_u_windows_949); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 398, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__60); - __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_tuple__62 = PyTuple_Pack(10, __pyx_n_u_cseuckr, __pyx_n_u_csksc56011987, __pyx_kp_u_euc_kr, __pyx_kp_u_iso_ir_149, __pyx_n_u_korean, __pyx_kp_u_ks_c_5601_1987, __pyx_kp_u_ks_c_5601_1989, __pyx_n_u_ksc5601, __pyx_n_u_ksc_5601, __pyx_kp_u_windows_949); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); - /* "w3lib/_url.pyx":413 + /* "w3lib/_url.pyx":414 * label: _REPLACEMENT_ENCODING * for label in ( * "csiso2022kr", # <<<<<<<<<<<<<< * "hz-gb-2312", * "iso-2022-cn", */ - __pyx_tuple__61 = PyTuple_Pack(6, __pyx_n_u_csiso2022kr, __pyx_kp_u_hz_gb_2312, __pyx_kp_u_iso_2022_cn, __pyx_kp_u_iso_2022_cn_ext, __pyx_kp_u_iso_2022_kr, __pyx_n_u_replacement); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__61); - __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_tuple__63 = PyTuple_Pack(6, __pyx_n_u_csiso2022kr, __pyx_kp_u_hz_gb_2312, __pyx_kp_u_iso_2022_cn, __pyx_kp_u_iso_2022_cn_ext, __pyx_kp_u_iso_2022_kr, __pyx_n_u_replacement); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); - /* "w3lib/_url.pyx":424 + /* "w3lib/_url.pyx":425 * label: _UTF_16BE_ENCODING * for label in ( * "unicodefffe", # <<<<<<<<<<<<<< * "utf-16be", * ) */ - __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_u_unicodefffe, __pyx_kp_u_utf_16be); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__62); - __Pyx_GIVEREF(__pyx_tuple__62); + __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_u_unicodefffe, __pyx_kp_u_utf_16be); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); - /* "w3lib/_url.pyx":431 + /* "w3lib/_url.pyx":432 * label: _UTF_16LE_ENCODING * for label in ( * "csunicode", # <<<<<<<<<<<<<< * "iso-10646-ucs-2", * "ucs-2", */ - __pyx_tuple__63 = PyTuple_Pack(7, __pyx_n_u_csunicode, __pyx_kp_u_iso_10646_ucs_2, __pyx_kp_u_ucs_2, __pyx_n_u_unicode, __pyx_n_u_unicodefeff, __pyx_kp_u_utf_16, __pyx_kp_u_utf_16le); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 431, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__63); - __Pyx_GIVEREF(__pyx_tuple__63); + __pyx_tuple__65 = PyTuple_Pack(7, __pyx_n_u_csunicode, __pyx_kp_u_iso_10646_ucs_2, __pyx_kp_u_ucs_2, __pyx_n_u_unicode, __pyx_n_u_unicodefeff, __pyx_kp_u_utf_16, __pyx_kp_u_utf_16le); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); - /* "w3lib/_url.pyx":445 + /* "w3lib/_url.pyx":446 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def _get_encoder(encoding: str) -> EncodeFunction: * codec_info = codecs.lookup(encoding) */ - __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_encoding, __pyx_n_s_codec_info); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__64); - __Pyx_GIVEREF(__pyx_tuple__64); - __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_encoder, 445, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_tuple__66 = PyTuple_Pack(2, __pyx_n_s_encoding, __pyx_n_s_codec_info); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_encoder, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 446, __pyx_L1_error) - /* "w3lib/_url.pyx":451 + /* "w3lib/_url.pyx":452 * * * _UTF_8_ENCODER = _get_encoder("utf-8") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__66); - __Pyx_GIVEREF(__pyx_tuple__66); + __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); - /* "w3lib/_url.pyx":455 + /* "w3lib/_url.pyx":456 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def _get_encoding(label: str) -> str: * label = label.strip(_ASCII_WHITESPACE).lower() */ - __pyx_tuple__67 = PyTuple_Pack(2, __pyx_n_s_label, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__67); - __Pyx_GIVEREF(__pyx_tuple__67); - __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_encoding, 455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 455, __pyx_L1_error) - - /* "w3lib/_url.pyx":555 - * _path_token_seen: bool = False - * - * def __init__(self) -> None: # <<<<<<<<<<<<<< - * self.path = [] - * self.is_special = False - */ - __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_label, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); - __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_init, 555, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 555, __pyx_L1_error) - - /* "w3lib/_url.pyx":559 - * self.is_special = False - * - * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< - * return isinstance(self.path, str) - * - */ - __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_has_opaque_path, 559, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 559, __pyx_L1_error) - - /* "w3lib/_url.pyx":562 - * return isinstance(self.path, str) - * - * @property # <<<<<<<<<<<<<< - * def scheme(self) -> str: - * return self._scheme - */ - __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_encoding, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 456, __pyx_L1_error) - /* "w3lib/_url.pyx":566 - * return self._scheme + /* "w3lib/_url.pyx":547 + * _fragment_token_seen: bool * - * @scheme.setter # <<<<<<<<<<<<<< - * def scheme(self, value: str) -> None: - * self._scheme = value + * def __init__(self): # <<<<<<<<<<<<<< + * self.scheme = "" + * self.username = "" */ - __pyx_tuple__73 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__73); - __Pyx_GIVEREF(__pyx_tuple__73); - __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_scheme_2, 566, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_init, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 547, __pyx_L1_error) - /* "w3lib/_url.pyx":576 + /* "w3lib/_url.pyx":571 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< * path = url.path * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): */ - __pyx_tuple__76 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_path); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 576, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__76); - __Pyx_GIVEREF(__pyx_tuple__76); - __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_shorten_path, 576, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_tuple__74 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_path); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); + __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_shorten_path, 571, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 571, __pyx_L1_error) - /* "w3lib/_url.pyx":585 + /* "w3lib/_url.pyx":580 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_tuple__79 = PyTuple_Pack(11, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_percent_encode_set, __pyx_n_s_space_as_plus, __pyx_n_s_encoder, __pyx_n_s_output, __pyx_n_s_encode_output, __pyx_n_s__78, __pyx_n_s_i, __pyx_n_s_byte, __pyx_n_s_isomorph); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__79); - __Pyx_GIVEREF(__pyx_tuple__79); - __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_percent_encode_after_encoding, 585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_tuple__77 = PyTuple_Pack(11, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_percent_encode_set, __pyx_n_s_space_as_plus, __pyx_n_s_encoder, __pyx_n_s_output, __pyx_n_s_encode_output, __pyx_n_s__76, __pyx_n_s_i, __pyx_n_s_byte, __pyx_n_s_isomorph); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_percent_encode_after_encoding, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 580, __pyx_L1_error) - /* "w3lib/_url.pyx":634 + /* "w3lib/_url.pyx":629 * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") # <<<<<<<<<<<<<< * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 * */ - __pyx_tuple__90 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__90); - __Pyx_GIVEREF(__pyx_tuple__90); + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); - /* "w3lib/_url.pyx":639 + /* "w3lib/_url.pyx":634 * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" * _safe_chars = RFC3986_RESERVED + RFC3986_UNRESERVED + EXTRA_SAFE_CHARS + b"%" * _path_safe_chars = _safe_chars.replace(b"#", b"") # <<<<<<<<<<<<<< * * # Characters that are safe in all of: */ - __pyx_tuple__92 = PyTuple_Pack(2, __pyx_kp_b__12, __pyx_kp_b__2); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__92); - __Pyx_GIVEREF(__pyx_tuple__92); + __pyx_tuple__90 = PyTuple_Pack(2, __pyx_kp_b__20, __pyx_kp_b_); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); - /* "w3lib/_url.pyx":651 + /* "w3lib/_url.pyx":646 * # be escaped as %25 when it is not already being used as part of an escape * # character. * _USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") # <<<<<<<<<<<<<< * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS */ - __pyx_tuple__93 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__93); - __Pyx_GIVEREF(__pyx_tuple__93); + __pyx_tuple__91 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); - /* "w3lib/_url.pyx":688 + /* "w3lib/_url.pyx":683 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< * address = [0] * 8 * piece_index = 0 */ - __pyx_tuple__98 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_address, __pyx_n_s_piece_index, __pyx_n_s_compress, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_value, __pyx_n_s_length, __pyx_n_s_numbers_seen, __pyx_n_s_ipv4_piece, __pyx_n_s_number, __pyx_n_s_swaps); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 688, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__98); - __Pyx_GIVEREF(__pyx_tuple__98); - __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv6, 688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_tuple__96 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_address, __pyx_n_s_piece_index, __pyx_n_s_compress, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_value, __pyx_n_s_length, __pyx_n_s_numbers_seen, __pyx_n_s_ipv4_piece, __pyx_n_s_number, __pyx_n_s_swaps); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv6, 683, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 683, __pyx_L1_error) - /* "w3lib/_url.pyx":775 + /* "w3lib/_url.pyx":770 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< * input: str, * percent_encode_set: _PercentEncodeSet, */ - __pyx_tuple__100 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__100); - __Pyx_GIVEREF(__pyx_tuple__100); - __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_utf_8_percent_encode, 775, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_tuple__98 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); + __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_utf_8_percent_encode, 770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 770, __pyx_L1_error) - /* "w3lib/_url.pyx":787 + /* "w3lib/_url.pyx":782 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: */ - __pyx_tuple__102 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 787, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__102); - __Pyx_GIVEREF(__pyx_tuple__102); - __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_opaque_host, 787, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 787, __pyx_L1_error) + __pyx_tuple__100 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); + __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_opaque_host, 782, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 782, __pyx_L1_error) - /* "w3lib/_url.pyx":795 + /* "w3lib/_url.pyx":790 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< * if not input: * raise ValueError */ - __pyx_tuple__104 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_validation_error, __pyx_n_s_r); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__104); - __Pyx_GIVEREF(__pyx_tuple__104); - __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4_number, 795, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_tuple__102 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_validation_error, __pyx_n_s_r); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__102); + __Pyx_GIVEREF(__pyx_tuple__102); + __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4_number, 790, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 790, __pyx_L1_error) - /* "w3lib/_url.pyx":815 + /* "w3lib/_url.pyx":810 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and parts[-1] == "": */ - __pyx_tuple__106 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_last, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 815, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__106); - __Pyx_GIVEREF(__pyx_tuple__106); - __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_ends_in_number, 815, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 815, __pyx_L1_error) + __pyx_tuple__104 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_last, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 810, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__104); + __Pyx_GIVEREF(__pyx_tuple__104); + __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_ends_in_number, 810, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 810, __pyx_L1_error) - /* "w3lib/_url.pyx":832 + /* "w3lib/_url.pyx":827 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and not parts[-1]: */ - __pyx_tuple__108 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_numbers, __pyx_n_s_part, __pyx_n_s_result, __pyx_n_s_ipv4, __pyx_n_s_counter, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__108); - __Pyx_GIVEREF(__pyx_tuple__108); - __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4, 832, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_tuple__106 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_numbers, __pyx_n_s_part, __pyx_n_s_result, __pyx_n_s_ipv4, __pyx_n_s_counter, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__106); + __Pyx_GIVEREF(__pyx_tuple__106); + __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4, 827, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 827, __pyx_L1_error) - /* "w3lib/_url.pyx":855 + /* "w3lib/_url.pyx":850 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< * result = _utr46._to_ascii( * domain, */ - __pyx_tuple__110 = PyTuple_Pack(3, __pyx_n_s_domain, __pyx_n_s_be_strict, __pyx_n_s_result); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 855, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__110); - __Pyx_GIVEREF(__pyx_tuple__110); - __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_domain_to_ascii, 855, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_tuple__108 = PyTuple_Pack(3, __pyx_n_s_domain, __pyx_n_s_be_strict, __pyx_n_s_result); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__108); + __Pyx_GIVEREF(__pyx_tuple__108); + __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_domain_to_ascii, 850, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 850, __pyx_L1_error) - /* "w3lib/_url.pyx":874 + /* "w3lib/_url.pyx":869 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< * input: str, - * *, + * url: _URL, */ - __pyx_tuple__112 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_is_special, __pyx_n_s_domain, __pyx_n_s_ascii_domain, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__112); - __Pyx_GIVEREF(__pyx_tuple__112); - __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_host, 874, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 874, __pyx_L1_error) + __pyx_tuple__110 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_url, __pyx_n_s_domain, __pyx_n_s_ascii_domain, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 869, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__110); + __Pyx_GIVEREF(__pyx_tuple__110); + __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_host, 869, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 869, __pyx_L1_error) - /* "w3lib/_url.pyx":896 + /* "w3lib/_url.pyx":898 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * */ - __pyx_tuple__114 = PyTuple_Pack(1, __pyx_n_s_input); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 896, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__114); - __Pyx_GIVEREF(__pyx_tuple__114); - __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_windows_drive_letter, 896, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 896, __pyx_L1_error) + __pyx_tuple__112 = PyTuple_Pack(1, __pyx_n_s_input); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__112); + __Pyx_GIVEREF(__pyx_tuple__112); + __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_windows_drive_letter, 898, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 898, __pyx_L1_error) - /* "w3lib/_url.pyx":901 + /* "w3lib/_url.pyx":903 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< * input_length = len(input) * return ( */ - __pyx_tuple__116 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_input_length); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 901, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__116); - __Pyx_GIVEREF(__pyx_tuple__116); - __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_starts_with_windows_drive_lette, 901, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 901, __pyx_L1_error) + __pyx_tuple__114 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_input_length); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__114); + __Pyx_GIVEREF(__pyx_tuple__114); + __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_starts_with_windows_drive_lette, 903, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 903, __pyx_L1_error) - /* "w3lib/_url.pyx":911 + /* "w3lib/_url.pyx":913 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< * return input in ( * "..", */ - __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_double_dot_path_segment, 911, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 911, __pyx_L1_error) + __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_double_dot_path_segment, 913, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 913, __pyx_L1_error) - /* "w3lib/_url.pyx":926 + /* "w3lib/_url.pyx":928 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< * return input in ( * ".", */ - __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_single_dot_path_segment, 926, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 926, __pyx_L1_error) + __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_single_dot_path_segment, 928, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 928, __pyx_L1_error) - /* "w3lib/_url.pyx":937 + /* "w3lib/_url.pyx":939 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * *, input: str, pointer: int, encode_set: _PercentEncodeSet * ) -> str: */ - __pyx_tuple__120 = PyTuple_Pack(4, __pyx_n_s_input, __pyx_n_s_pointer, __pyx_n_s_encode_set, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__120); - __Pyx_GIVEREF(__pyx_tuple__120); - __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_idempotent_utf_8_percent_encode, 937, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_tuple__118 = PyTuple_Pack(4, __pyx_n_s_input, __pyx_n_s_pointer, __pyx_n_s_encode_set, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 939, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__118); + __Pyx_GIVEREF(__pyx_tuple__118); + __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_idempotent_utf_8_percent_encode, 939, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 939, __pyx_L1_error) - /* "w3lib/_url.pyx":952 + /* "w3lib/_url.pyx":954 * * * def _preprocess_url(url: str) -> str: # <<<<<<<<<<<<<< * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) * */ - __pyx_tuple__122 = PyTuple_Pack(1, __pyx_n_s_url); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__122); - __Pyx_GIVEREF(__pyx_tuple__122); - __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_preprocess_url, 952, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 952, __pyx_L1_error) + __pyx_tuple__120 = PyTuple_Pack(1, __pyx_n_s_url); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 954, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__120); + __Pyx_GIVEREF(__pyx_tuple__120); + __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_preprocess_url, 954, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 954, __pyx_L1_error) - /* "w3lib/_url.pyx":956 + /* "w3lib/_url.pyx":958 * * * def _parse_url( # <<<<<<<<<<<<<< * input: str, - * *, + * encoding: str = "utf-8", */ - __pyx_tuple__124 = PyTuple_Pack(27, __pyx_n_s_input, __pyx_n_s_base_url, __pyx_n_s_encoding, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_path_percent_encode_set, __pyx_n_s_query_percent_encode_set, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_base, __pyx_n_s_url, __pyx_n_s_state, __pyx_n_s_buffer, __pyx_n_s_at_sign_seen, __pyx_n_s_inside_brackets, __pyx_n_s_skip_authority_shortcut, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_reached_end, __pyx_n_s_c, __pyx_n_s_at_sign_index, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_encoded_code_points, __pyx_n_s_host, __pyx_n_s_port, __pyx_n_s_encoded, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 956, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__124); - __Pyx_GIVEREF(__pyx_tuple__124); - __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 27, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_url, 956, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 956, __pyx_L1_error) + __pyx_tuple__122 = PyTuple_Pack(19, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_url, __pyx_n_s_state, __pyx_n_s_buffer, __pyx_n_s_at_sign_seen, __pyx_n_s_inside_brackets, __pyx_n_s_skip_authority_shortcut, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_reached_end, __pyx_n_s_c, __pyx_n_s_at_sign_index, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_encoded_code_points, __pyx_n_s_port, __pyx_n_s_encoded, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 958, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__122); + __Pyx_GIVEREF(__pyx_tuple__122); + __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_url, 958, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 958, __pyx_L1_error) - /* "w3lib/_url.pyx":1368 + /* "w3lib/_url.pyx":1269 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< * output = "" * n = address */ - __pyx_tuple__126 = PyTuple_Pack(4, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 1368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__126); - __Pyx_GIVEREF(__pyx_tuple__126); - __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv4, 1368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 1368, __pyx_L1_error) + __pyx_tuple__124 = PyTuple_Pack(4, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 1269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__124); + __Pyx_GIVEREF(__pyx_tuple__124); + __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv4, 1269, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 1269, __pyx_L1_error) - /* "w3lib/_url.pyx":1379 + /* "w3lib/_url.pyx":1280 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: */ - __pyx_tuple__128 = PyTuple_Pack(7, __pyx_n_s_address, __pyx_n_s_min_length, __pyx_n_s_index, __pyx_n_s_index_length, __pyx_n_s_current_length, __pyx_n_s_current_index, __pyx_n_s_piece); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 1379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__128); - __Pyx_GIVEREF(__pyx_tuple__128); - __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_ipv6_first_longest_0_piece, 1379, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 1379, __pyx_L1_error) + __pyx_tuple__126 = PyTuple_Pack(7, __pyx_n_s_address, __pyx_n_s_min_length, __pyx_n_s_index, __pyx_n_s_index_length, __pyx_n_s_current_length, __pyx_n_s_current_index, __pyx_n_s_piece); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 1280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__126); + __Pyx_GIVEREF(__pyx_tuple__126); + __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_ipv6_first_longest_0_piece, 1280, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 1280, __pyx_L1_error) - /* "w3lib/_url.pyx":1397 + /* "w3lib/_url.pyx":1298 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) */ - __pyx_tuple__130 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_compress, __pyx_n_s_ignore0, __pyx_n_s_piece_index, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 1397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__130); - __Pyx_GIVEREF(__pyx_tuple__130); - __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv6, 1397, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 1397, __pyx_L1_error) + __pyx_tuple__128 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_compress, __pyx_n_s_ignore0, __pyx_n_s_piece_index, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 1298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__128); + __Pyx_GIVEREF(__pyx_tuple__128); + __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv6, 1298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 1298, __pyx_L1_error) - /* "w3lib/_url.pyx":1418 + /* "w3lib/_url.pyx":1319 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer - * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< - * if isinstance(host, int): - * return _serialize_ipv4(host) + * def _serialize_host(url: _URL) -> str: # <<<<<<<<<<<<<< + * if url._host_type == IPV4: + * return _serialize_ipv4(url.ipv4) */ - __pyx_tuple__132 = PyTuple_Pack(1, __pyx_n_s_host); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 1418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__132); - __Pyx_GIVEREF(__pyx_tuple__132); - __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_host, 1418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 1418, __pyx_L1_error) + __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_host, 1319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 1319, __pyx_L1_error) - /* "w3lib/_url.pyx":1427 + /* "w3lib/_url.pyx":1328 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer - * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< - * if url.has_opaque_path(): + * def _serialize_url_path(url: _URL) -> str: # <<<<<<<<<<<<<< + * if url.opaque_path: * assert isinstance(url.path, str) */ - __pyx_tuple__134 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_canonicalize, __pyx_n_s_output, __pyx_n_s_segment); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 1427, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__134); - __Pyx_GIVEREF(__pyx_tuple__134); - __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url_path, 1427, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_tuple__131 = PyTuple_Pack(3, __pyx_n_s_url, __pyx_n_s_output, __pyx_n_s_segment); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 1328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__131); + __Pyx_GIVEREF(__pyx_tuple__131); + __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url_path, 1328, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 1328, __pyx_L1_error) - /* "w3lib/_url.pyx":1440 + /* "w3lib/_url.pyx":1341 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing - * def _serialize_url( # <<<<<<<<<<<<<< - * url: _URL, - * *, + * def _serialize_url(url: _URL) -> str: # <<<<<<<<<<<<<< + * """Return a string representation of *url* following the URL serialization + * algorithm defined in the `URL living standard`_. */ - __pyx_tuple__136 = PyTuple_Pack(4, __pyx_n_s_url, __pyx_n_s_exclude_fragment, __pyx_n_s_canonicalize, __pyx_n_s_output); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(0, 1440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__136); - __Pyx_GIVEREF(__pyx_tuple__136); - __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url, 1440, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(0, 1440, __pyx_L1_error) + __pyx_tuple__133 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_output); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 1341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__133); + __Pyx_GIVEREF(__pyx_tuple__133); + __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url, 1341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 1341, __pyx_L1_error) - /* "w3lib/_url.pyx":1506 + /* "w3lib/_url.pyx":1376 * * * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< - * url = _parse_url( - * input, + * url = _parse_url(input, encoding) + * return _serialize_url(url) */ - __pyx_tuple__138 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_url); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 1506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__138); - __Pyx_GIVEREF(__pyx_tuple__138); - __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_safe_url, 1506, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(0, 1506, __pyx_L1_error) + __pyx_tuple__135 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_url); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 1376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__135); + __Pyx_GIVEREF(__pyx_tuple__135); + __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_safe_url, 1376, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -25139,7 +23257,6 @@ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_443 = PyInt_FromLong(443); if (unlikely(!__pyx_int_443)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_65535 = PyInt_FromLong(65535L); if (unlikely(!__pyx_int_65535)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -25231,15 +23348,15 @@ static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr)) __PYX_ERR(0, 822, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 822, __pyx_L1_error) + __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr)) __PYX_ERR(0, 817, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 817, __pyx_L1_error) #else __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 822, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 817, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_print = 0; @@ -25250,15 +23367,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 842, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 837, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 837, __pyx_L1_error) #else __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 842, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 837, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_print = 0; @@ -25469,7 +23586,6 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__url(PyObject *__pyx_pyinit_module Py_ssize_t __pyx_t_7; PyObject *(*__pyx_t_8)(PyObject *); long __pyx_t_9; - int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -25719,7 +23835,7 @@ if (!__Pyx_RefNanny) { * from typing import AnyStr, Callable, Dict, List, Optional, Tuple, Union * from urllib.parse import unquote # <<<<<<<<<<<<<< * - * from cython import bint, cfunc, declare, uchar + * import cython */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -25735,417 +23851,417 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":12 + /* "w3lib/_url.pyx":13 * from cython import bint, cfunc, declare, uchar * * from . import _utr46 # <<<<<<<<<<<<<< * from ._infra import ( * _ASCII_ALPHA, */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_utr46); __Pyx_GIVEREF(__pyx_n_s_utr46); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_utr46)) __PYX_ERR(0, 12, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s__2, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_utr46)) __PYX_ERR(0, 13, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_utr46); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_utr46); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_utr46, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utr46, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":14 + /* "w3lib/_url.pyx":15 * from . import _utr46 * from ._infra import ( * _ASCII_ALPHA, # <<<<<<<<<<<<<< * _ASCII_ALPHANUMERIC, * _ASCII_DIGIT, */ - __pyx_t_3 = PyList_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) + __pyx_t_3 = PyList_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_ASCII_ALPHA); __Pyx_GIVEREF(__pyx_n_s_ASCII_ALPHA); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ASCII_ALPHA)) __PYX_ERR(0, 14, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ASCII_ALPHA)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ASCII_ALPHANUMERIC); __Pyx_GIVEREF(__pyx_n_s_ASCII_ALPHANUMERIC); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_ASCII_ALPHANUMERIC)) __PYX_ERR(0, 14, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_ASCII_ALPHANUMERIC)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ASCII_DIGIT); __Pyx_GIVEREF(__pyx_n_s_ASCII_DIGIT); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ASCII_DIGIT)) __PYX_ERR(0, 14, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ASCII_DIGIT)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ASCII_HEX_DIGIT); __Pyx_GIVEREF(__pyx_n_s_ASCII_HEX_DIGIT); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_ASCII_HEX_DIGIT)) __PYX_ERR(0, 14, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_ASCII_HEX_DIGIT)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ASCII_TAB_OR_NEWLINE); __Pyx_GIVEREF(__pyx_n_s_ASCII_TAB_OR_NEWLINE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_ASCII_TAB_OR_NEWLINE)) __PYX_ERR(0, 14, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_ASCII_TAB_OR_NEWLINE)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ASCII_WHITESPACE); __Pyx_GIVEREF(__pyx_n_s_ASCII_WHITESPACE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_ASCII_WHITESPACE)) __PYX_ERR(0, 14, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_ASCII_WHITESPACE)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_C0_CONTROL); __Pyx_GIVEREF(__pyx_n_s_C0_CONTROL); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_C0_CONTROL)) __PYX_ERR(0, 14, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_C0_CONTROL)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_C0_CONTROL_OR_SPACE); __Pyx_GIVEREF(__pyx_n_s_C0_CONTROL_OR_SPACE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 7, __pyx_n_s_C0_CONTROL_OR_SPACE)) __PYX_ERR(0, 14, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 7, __pyx_n_s_C0_CONTROL_OR_SPACE)) __PYX_ERR(0, 15, __pyx_L1_error); - /* "w3lib/_url.pyx":13 + /* "w3lib/_url.pyx":14 * * from . import _utr46 * from ._infra import ( # <<<<<<<<<<<<<< * _ASCII_ALPHA, * _ASCII_ALPHANUMERIC, */ - __pyx_t_2 = __Pyx_Import(__pyx_n_s_infra, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_n_s_infra, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHA, __pyx_t_3) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHA, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHANUMERIC, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_ALPHANUMERIC, __pyx_t_3) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_HEX_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_HEX_DIGIT, __pyx_t_3) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE, __pyx_t_3) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_WHITESPACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ASCII_WHITESPACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_WHITESPACE, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_WHITESPACE, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_OR_SPACE, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_OR_SPACE, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":24 + /* "w3lib/_url.pyx":25 * ) * from ._rfc2396 import ( * _RFC2396_ABS_PATH_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * _RFC2396_FRAGMENT_PERCENT_ENCODE_SET, * _RFC2396_QUERY_PERCENT_ENCODE_SET, */ - __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); __Pyx_GIVEREF(__pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE)) __PYX_ERR(0, 24, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE)) __PYX_ERR(0, 25, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); __Pyx_GIVEREF(__pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE)) __PYX_ERR(0, 24, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE)) __PYX_ERR(0, 25, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); __Pyx_GIVEREF(__pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE)) __PYX_ERR(0, 24, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE)) __PYX_ERR(0, 25, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); __Pyx_GIVEREF(__pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE)) __PYX_ERR(0, 24, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE)) __PYX_ERR(0, 25, __pyx_L1_error); - /* "w3lib/_url.pyx":23 + /* "w3lib/_url.pyx":24 * _C0_CONTROL_OR_SPACE, * ) * from ._rfc2396 import ( # <<<<<<<<<<<<<< * _RFC2396_ABS_PATH_PERCENT_ENCODE_SET, * _RFC2396_FRAGMENT_PERCENT_ENCODE_SET, */ - __pyx_t_3 = __Pyx_Import(__pyx_n_s_rfc2396, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_n_s_rfc2396, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":30 + /* "w3lib/_url.pyx":31 * ) * from ._rfc3986 import ( * _RFC3986_FRAGMENT_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * _RFC3986_PATH_PERCENT_ENCODE_SET, * _RFC3986_QUERY_PERCENT_ENCODE_SET, */ - __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); __Pyx_GIVEREF(__pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE)) __PYX_ERR(0, 30, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE)) __PYX_ERR(0, 31, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); __Pyx_GIVEREF(__pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET)) __PYX_ERR(0, 30, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET)) __PYX_ERR(0, 31, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); __Pyx_GIVEREF(__pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE)) __PYX_ERR(0, 30, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE)) __PYX_ERR(0, 31, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); __Pyx_GIVEREF(__pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE)) __PYX_ERR(0, 30, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE)) __PYX_ERR(0, 31, __pyx_L1_error); - /* "w3lib/_url.pyx":29 + /* "w3lib/_url.pyx":30 * _RFC2396_USERINFO_PERCENT_ENCODE_SET, * ) * from ._rfc3986 import ( # <<<<<<<<<<<<<< * _RFC3986_FRAGMENT_PERCENT_ENCODE_SET, * _RFC3986_PATH_PERCENT_ENCODE_SET, */ - __pyx_t_2 = __Pyx_Import(__pyx_n_s_rfc3986, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_n_s_rfc3986, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET, __pyx_t_3) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE, __pyx_t_3) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":35 + /* "w3lib/_url.pyx":36 * _RFC3986_USERINFO_PERCENT_ENCODE_SET, * ) * from ._util import _PercentEncodeSet # <<<<<<<<<<<<<< * * # https://encoding.spec.whatwg.org/ */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PercentEncodeSet); __Pyx_GIVEREF(__pyx_n_s_PercentEncodeSet); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PercentEncodeSet)) __PYX_ERR(0, 35, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_util, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PercentEncodeSet)) __PYX_ERR(0, 36, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_util, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PercentEncodeSet, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PercentEncodeSet, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":39 + /* "w3lib/_url.pyx":40 * # https://encoding.spec.whatwg.org/ * * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] # <<<<<<<<<<<<<< * DecodeFunction = Callable[[bytes], Tuple[str, int]] * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_AnyStr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyInt_Type)); __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 39, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 40, __pyx_L1_error); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CodecFunction, __pyx_t_5) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CodecFunction, __pyx_t_5) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":40 + /* "w3lib/_url.pyx":41 * * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] * DecodeFunction = Callable[[bytes], Tuple[str, int]] # <<<<<<<<<<<<<< * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] * */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Callable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Callable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)(&PyBytes_Type)); __Pyx_GIVEREF((PyObject *)(&PyBytes_Type)); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 40, __pyx_L1_error); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 41, __pyx_L1_error); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 40, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 41, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyInt_Type)); __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 40, __pyx_L1_error); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 41, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(0, 40, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DecodeFunction, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DecodeFunction, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":41 + /* "w3lib/_url.pyx":42 * CodecFunction = Callable[[AnyStr], Tuple[AnyStr, int]] * DecodeFunction = Callable[[bytes], Tuple[str, int]] * EncodeFunction = Callable[[str, str], Tuple[bytes, int]] # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 41, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 42, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 41, __pyx_L1_error); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 42, __pyx_L1_error); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)(&PyBytes_Type)); __Pyx_GIVEREF((PyObject *)(&PyBytes_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 41, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)))) __PYX_ERR(0, 42, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyInt_Type)); __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 41, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 42, __pyx_L1_error); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_EncodeFunction, __pyx_t_3) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EncodeFunction, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":44 + /* "w3lib/_url.pyx":45 * * * def _short_windows_125(last_digit: int) -> Dict[str, str]: # <<<<<<<<<<<<<< * return { * label: f"windows-125{last_digit}" */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_last_digit, __pyx_n_s_int) < 0) __PYX_ERR(0, 44, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Dict_str_str) < 0) __PYX_ERR(0, 44, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_1_short_windows_125, 0, __pyx_n_s_short_windows_125, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_last_digit, __pyx_n_s_int) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Dict_str_str) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_1_short_windows_125, 0, __pyx_n_s_short_windows_125, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_short_windows_125, __pyx_t_6) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_short_windows_125, __pyx_t_6) < 0) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":55 + /* "w3lib/_url.pyx":56 * * * _REPLACEMENT_ENCODING = "replacement" # <<<<<<<<<<<<<< * _UTF_8_ENCODING = "utf-8" * _UTF_16BE_ENCODING = "utf-16be" */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_REPLACEMENT_ENCODING, __pyx_n_u_replacement) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_REPLACEMENT_ENCODING, __pyx_n_u_replacement) < 0) __PYX_ERR(0, 56, __pyx_L1_error) - /* "w3lib/_url.pyx":56 + /* "w3lib/_url.pyx":57 * * _REPLACEMENT_ENCODING = "replacement" * _UTF_8_ENCODING = "utf-8" # <<<<<<<<<<<<<< * _UTF_16BE_ENCODING = "utf-16be" * _UTF_16LE_ENCODING = "utf-16le" */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODING, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODING, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 57, __pyx_L1_error) - /* "w3lib/_url.pyx":57 + /* "w3lib/_url.pyx":58 * _REPLACEMENT_ENCODING = "replacement" * _UTF_8_ENCODING = "utf-8" * _UTF_16BE_ENCODING = "utf-16be" # <<<<<<<<<<<<<< * _UTF_16LE_ENCODING = "utf-16le" * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_16BE_ENCODING, __pyx_kp_u_utf_16be) < 0) __PYX_ERR(0, 57, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_16BE_ENCODING, __pyx_kp_u_utf_16be) < 0) __PYX_ERR(0, 58, __pyx_L1_error) - /* "w3lib/_url.pyx":58 + /* "w3lib/_url.pyx":59 * _UTF_8_ENCODING = "utf-8" * _UTF_16BE_ENCODING = "utf-16be" * _UTF_16LE_ENCODING = "utf-16le" # <<<<<<<<<<<<<< * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_16LE_ENCODING, __pyx_kp_u_utf_16le) < 0) __PYX_ERR(0, 58, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_16LE_ENCODING, __pyx_kp_u_utf_16le) < 0) __PYX_ERR(0, 59, __pyx_L1_error) - /* "w3lib/_url.pyx":64 + /* "w3lib/_url.pyx":65 * # Maps the labels defined in the standard to an encoding label that Python * # understands. * _LABEL_ENCODINGS = { # <<<<<<<<<<<<<< @@ -26154,31 +24270,31 @@ if (!__Pyx_RefNanny) { */ { /* enter inner scope */ - /* "w3lib/_url.pyx":65 + /* "w3lib/_url.pyx":66 * # understands. * _LABEL_ENCODINGS = { * **{ # <<<<<<<<<<<<<< * label: _UTF_8_ENCODING * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L4_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":67 + /* "w3lib/_url.pyx":68 * **{ * label: _UTF_8_ENCODING * for label in ( # <<<<<<<<<<<<<< * "unicode-1-1-utf-8", * "unicode11utf8", */ - __pyx_t_2 = __pyx_tuple__27; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__29; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 6) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 67, __pyx_L4_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 68, __pyx_L4_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L4_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_5w3lib_4_url_label); @@ -26186,19 +24302,19 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":66 + /* "w3lib/_url.pyx":67 * _LABEL_ENCODINGS = { * **{ * label: _UTF_8_ENCODING # <<<<<<<<<<<<<< * for label in ( * "unicode-1-1-utf-8", */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_8_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L4_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_8_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr1__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 66, __pyx_L4_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr1__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 67, __pyx_L4_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":67 + /* "w3lib/_url.pyx":68 * **{ * label: _UTF_8_ENCODING * for label in ( # <<<<<<<<<<<<<< @@ -26216,36 +24332,36 @@ if (!__Pyx_RefNanny) { goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ - __pyx_t_6 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_6 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":76 + /* "w3lib/_url.pyx":77 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "ibm866" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L11_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":78 + /* "w3lib/_url.pyx":79 * **{ * label: "ibm866" * for label in ( # <<<<<<<<<<<<<< * "866", * "cp866", */ - __pyx_t_2 = __pyx_tuple__28; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__30; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 4) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 78, __pyx_L11_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 79, __pyx_L11_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L11_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr2__pyx_v_5w3lib_4_url_label); @@ -26253,16 +24369,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":77 + /* "w3lib/_url.pyx":78 * }, * **{ * label: "ibm866" # <<<<<<<<<<<<<< * for label in ( * "866", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr2__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_ibm866))) __PYX_ERR(0, 77, __pyx_L11_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr2__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_ibm866))) __PYX_ERR(0, 78, __pyx_L11_error) - /* "w3lib/_url.pyx":78 + /* "w3lib/_url.pyx":79 * **{ * label: "ibm866" * for label in ( # <<<<<<<<<<<<<< @@ -26282,36 +24398,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 76, __pyx_L1_error) + __PYX_ERR(0, 77, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":85 + /* "w3lib/_url.pyx":86 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-2" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L18_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":87 + /* "w3lib/_url.pyx":88 * **{ * label: "iso-8859-2" * for label in ( # <<<<<<<<<<<<<< * "csisolatin2", * "iso-8859-2", */ - __pyx_t_2 = __pyx_tuple__29; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__31; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 9) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 87, __pyx_L18_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 88, __pyx_L18_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L18_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr3__pyx_v_5w3lib_4_url_label); @@ -26319,16 +24435,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":86 + /* "w3lib/_url.pyx":87 * }, * **{ * label: "iso-8859-2" # <<<<<<<<<<<<<< * for label in ( * "csisolatin2", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr3__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_2))) __PYX_ERR(0, 86, __pyx_L18_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr3__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_2))) __PYX_ERR(0, 87, __pyx_L18_error) - /* "w3lib/_url.pyx":87 + /* "w3lib/_url.pyx":88 * **{ * label: "iso-8859-2" * for label in ( # <<<<<<<<<<<<<< @@ -26348,36 +24464,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 85, __pyx_L1_error) + __PYX_ERR(0, 86, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":99 + /* "w3lib/_url.pyx":100 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-3" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L25_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":101 + /* "w3lib/_url.pyx":102 * **{ * label: "iso-8859-3" * for label in ( # <<<<<<<<<<<<<< * "csisolatin3", * "iso-8859-3", */ - __pyx_t_2 = __pyx_tuple__30; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__32; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 9) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 101, __pyx_L25_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 102, __pyx_L25_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L25_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr4__pyx_v_5w3lib_4_url_label); @@ -26385,16 +24501,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":100 + /* "w3lib/_url.pyx":101 * }, * **{ * label: "iso-8859-3" # <<<<<<<<<<<<<< * for label in ( * "csisolatin3", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr4__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_3))) __PYX_ERR(0, 100, __pyx_L25_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr4__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_3))) __PYX_ERR(0, 101, __pyx_L25_error) - /* "w3lib/_url.pyx":101 + /* "w3lib/_url.pyx":102 * **{ * label: "iso-8859-3" * for label in ( # <<<<<<<<<<<<<< @@ -26414,36 +24530,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 99, __pyx_L1_error) + __PYX_ERR(0, 100, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":113 + /* "w3lib/_url.pyx":114 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-4" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L32_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":115 + /* "w3lib/_url.pyx":116 * **{ * label: "iso-8859-4" * for label in ( # <<<<<<<<<<<<<< * "csisolatin4", * "iso-8859-4", */ - __pyx_t_2 = __pyx_tuple__31; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__33; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 9) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 115, __pyx_L32_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 116, __pyx_L32_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L32_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr5__pyx_v_5w3lib_4_url_label); @@ -26451,16 +24567,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":114 + /* "w3lib/_url.pyx":115 * }, * **{ * label: "iso-8859-4" # <<<<<<<<<<<<<< * for label in ( * "csisolatin4", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr5__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_4))) __PYX_ERR(0, 114, __pyx_L32_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr5__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_4))) __PYX_ERR(0, 115, __pyx_L32_error) - /* "w3lib/_url.pyx":115 + /* "w3lib/_url.pyx":116 * **{ * label: "iso-8859-4" * for label in ( # <<<<<<<<<<<<<< @@ -26480,36 +24596,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 113, __pyx_L1_error) + __PYX_ERR(0, 114, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":127 + /* "w3lib/_url.pyx":128 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-5" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L39_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L39_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":129 + /* "w3lib/_url.pyx":130 * **{ * label: "iso-8859-5" * for label in ( # <<<<<<<<<<<<<< * "csisolatincyrillic", * "cyrillic", */ - __pyx_t_2 = __pyx_tuple__32; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__34; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 8) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 129, __pyx_L39_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 130, __pyx_L39_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L39_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L39_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr6__pyx_v_5w3lib_4_url_label); @@ -26517,16 +24633,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":128 + /* "w3lib/_url.pyx":129 * }, * **{ * label: "iso-8859-5" # <<<<<<<<<<<<<< * for label in ( * "csisolatincyrillic", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr6__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_5))) __PYX_ERR(0, 128, __pyx_L39_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr6__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_5))) __PYX_ERR(0, 129, __pyx_L39_error) - /* "w3lib/_url.pyx":129 + /* "w3lib/_url.pyx":130 * **{ * label: "iso-8859-5" * for label in ( # <<<<<<<<<<<<<< @@ -26546,36 +24662,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 127, __pyx_L1_error) + __PYX_ERR(0, 128, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":140 + /* "w3lib/_url.pyx":141 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-6" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L46_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L46_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":142 + /* "w3lib/_url.pyx":143 * **{ * label: "iso-8859-6" * for label in ( # <<<<<<<<<<<<<< * "arabic", * "asmo-708", */ - __pyx_t_2 = __pyx_tuple__33; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__35; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 14) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 142, __pyx_L46_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 143, __pyx_L46_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L46_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L46_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr7__pyx_v_5w3lib_4_url_label); @@ -26583,16 +24699,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":141 + /* "w3lib/_url.pyx":142 * }, * **{ * label: "iso-8859-6" # <<<<<<<<<<<<<< * for label in ( * "arabic", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr7__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_6))) __PYX_ERR(0, 141, __pyx_L46_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr7__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_6))) __PYX_ERR(0, 142, __pyx_L46_error) - /* "w3lib/_url.pyx":142 + /* "w3lib/_url.pyx":143 * **{ * label: "iso-8859-6" * for label in ( # <<<<<<<<<<<<<< @@ -26612,36 +24728,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 140, __pyx_L1_error) + __PYX_ERR(0, 141, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":159 + /* "w3lib/_url.pyx":160 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-7" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L53_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":161 + /* "w3lib/_url.pyx":162 * **{ * label: "iso-8859-7" * for label in ( # <<<<<<<<<<<<<< * "csisolatingreek", * "ecma-118", */ - __pyx_t_2 = __pyx_tuple__34; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__36; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 12) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 161, __pyx_L53_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 162, __pyx_L53_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L53_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr8__pyx_v_5w3lib_4_url_label); @@ -26649,16 +24765,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":160 + /* "w3lib/_url.pyx":161 * }, * **{ * label: "iso-8859-7" # <<<<<<<<<<<<<< * for label in ( * "csisolatingreek", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr8__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_7))) __PYX_ERR(0, 160, __pyx_L53_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr8__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_7))) __PYX_ERR(0, 161, __pyx_L53_error) - /* "w3lib/_url.pyx":161 + /* "w3lib/_url.pyx":162 * **{ * label: "iso-8859-7" * for label in ( # <<<<<<<<<<<<<< @@ -26678,36 +24794,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 159, __pyx_L1_error) + __PYX_ERR(0, 160, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":176 + /* "w3lib/_url.pyx":177 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-8" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L60_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":178 + /* "w3lib/_url.pyx":179 * **{ * label: "iso-8859-8" * for label in ( # <<<<<<<<<<<<<< * "csiso88598e", * "csisolatinhebrew", */ - __pyx_t_2 = __pyx_tuple__35; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__37; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 11) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 178, __pyx_L60_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 179, __pyx_L60_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L60_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_8genexpr9__pyx_v_5w3lib_4_url_label); @@ -26715,16 +24831,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":177 + /* "w3lib/_url.pyx":178 * }, * **{ * label: "iso-8859-8" # <<<<<<<<<<<<<< * for label in ( * "csiso88598e", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr9__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_8))) __PYX_ERR(0, 177, __pyx_L60_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr9__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_8))) __PYX_ERR(0, 178, __pyx_L60_error) - /* "w3lib/_url.pyx":178 + /* "w3lib/_url.pyx":179 * **{ * label: "iso-8859-8" * for label in ( # <<<<<<<<<<<<<< @@ -26744,36 +24860,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 176, __pyx_L1_error) + __PYX_ERR(0, 177, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":192 + /* "w3lib/_url.pyx":193 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-8-i" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L67_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":194 + /* "w3lib/_url.pyx":195 * **{ * label: "iso-8859-8-i" * for label in ( # <<<<<<<<<<<<<< * "csiso88598i", * "iso-8859-8-i", */ - __pyx_t_2 = __pyx_tuple__36; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__38; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 3) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 194, __pyx_L67_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 195, __pyx_L67_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L67_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr10__pyx_v_5w3lib_4_url_label); @@ -26781,16 +24897,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":193 + /* "w3lib/_url.pyx":194 * }, * **{ * label: "iso-8859-8-i" # <<<<<<<<<<<<<< * for label in ( * "csiso88598i", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr10__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_8_i))) __PYX_ERR(0, 193, __pyx_L67_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr10__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_8_i))) __PYX_ERR(0, 194, __pyx_L67_error) - /* "w3lib/_url.pyx":194 + /* "w3lib/_url.pyx":195 * **{ * label: "iso-8859-8-i" * for label in ( # <<<<<<<<<<<<<< @@ -26810,36 +24926,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 192, __pyx_L1_error) + __PYX_ERR(0, 193, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":200 + /* "w3lib/_url.pyx":201 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-10" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L74_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L74_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":202 + /* "w3lib/_url.pyx":203 * **{ * label: "iso-8859-10" * for label in ( # <<<<<<<<<<<<<< * "csisolatin6", * "iso-8859-10", */ - __pyx_t_2 = __pyx_tuple__37; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__39; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 7) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 202, __pyx_L74_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 203, __pyx_L74_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L74_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L74_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr11__pyx_v_5w3lib_4_url_label); @@ -26847,16 +24963,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":201 + /* "w3lib/_url.pyx":202 * }, * **{ * label: "iso-8859-10" # <<<<<<<<<<<<<< * for label in ( * "csisolatin6", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr11__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_10))) __PYX_ERR(0, 201, __pyx_L74_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr11__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_10))) __PYX_ERR(0, 202, __pyx_L74_error) - /* "w3lib/_url.pyx":202 + /* "w3lib/_url.pyx":203 * **{ * label: "iso-8859-10" * for label in ( # <<<<<<<<<<<<<< @@ -26876,36 +24992,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 200, __pyx_L1_error) + __PYX_ERR(0, 201, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":212 + /* "w3lib/_url.pyx":213 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-10" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L81_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L81_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":214 + /* "w3lib/_url.pyx":215 * **{ * label: "iso-8859-10" * for label in ( # <<<<<<<<<<<<<< * "csisolatin6", * "iso-8859-10", */ - __pyx_t_2 = __pyx_tuple__37; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__39; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 7) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 214, __pyx_L81_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 215, __pyx_L81_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L81_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L81_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr12__pyx_v_5w3lib_4_url_label); @@ -26913,16 +25029,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":213 + /* "w3lib/_url.pyx":214 * }, * **{ * label: "iso-8859-10" # <<<<<<<<<<<<<< * for label in ( * "csisolatin6", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr12__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_10))) __PYX_ERR(0, 213, __pyx_L81_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr12__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_10))) __PYX_ERR(0, 214, __pyx_L81_error) - /* "w3lib/_url.pyx":214 + /* "w3lib/_url.pyx":215 * **{ * label: "iso-8859-10" * for label in ( # <<<<<<<<<<<<<< @@ -26942,36 +25058,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 212, __pyx_L1_error) + __PYX_ERR(0, 213, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":224 + /* "w3lib/_url.pyx":225 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-13" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L88_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L88_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":226 + /* "w3lib/_url.pyx":227 * **{ * label: "iso-8859-13" * for label in ( # <<<<<<<<<<<<<< * "iso-8859-13", * "iso8859-13", */ - __pyx_t_2 = __pyx_tuple__38; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__40; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 3) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 226, __pyx_L88_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 227, __pyx_L88_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L88_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L88_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr13__pyx_v_5w3lib_4_url_label); @@ -26979,16 +25095,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":225 + /* "w3lib/_url.pyx":226 * }, * **{ * label: "iso-8859-13" # <<<<<<<<<<<<<< * for label in ( * "iso-8859-13", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr13__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_13))) __PYX_ERR(0, 225, __pyx_L88_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr13__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_13))) __PYX_ERR(0, 226, __pyx_L88_error) - /* "w3lib/_url.pyx":226 + /* "w3lib/_url.pyx":227 * **{ * label: "iso-8859-13" * for label in ( # <<<<<<<<<<<<<< @@ -27008,36 +25124,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 224, __pyx_L1_error) + __PYX_ERR(0, 225, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":232 + /* "w3lib/_url.pyx":233 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-14" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L95_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L95_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":234 + /* "w3lib/_url.pyx":235 * **{ * label: "iso-8859-14" * for label in ( # <<<<<<<<<<<<<< * "iso-8859-14", * "iso8859-14", */ - __pyx_t_2 = __pyx_tuple__39; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__41; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 3) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 234, __pyx_L95_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 235, __pyx_L95_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L95_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L95_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr14__pyx_v_5w3lib_4_url_label); @@ -27045,16 +25161,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":233 + /* "w3lib/_url.pyx":234 * }, * **{ * label: "iso-8859-14" # <<<<<<<<<<<<<< * for label in ( * "iso-8859-14", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr14__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_14))) __PYX_ERR(0, 233, __pyx_L95_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr14__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_14))) __PYX_ERR(0, 234, __pyx_L95_error) - /* "w3lib/_url.pyx":234 + /* "w3lib/_url.pyx":235 * **{ * label: "iso-8859-14" * for label in ( # <<<<<<<<<<<<<< @@ -27074,36 +25190,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 232, __pyx_L1_error) + __PYX_ERR(0, 233, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":240 + /* "w3lib/_url.pyx":241 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-8859-15" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L102_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L102_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":242 + /* "w3lib/_url.pyx":243 * **{ * label: "iso-8859-15" * for label in ( # <<<<<<<<<<<<<< * "csisolatin9", * "iso-8859-15", */ - __pyx_t_2 = __pyx_tuple__40; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__42; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 6) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 242, __pyx_L102_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 243, __pyx_L102_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L102_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L102_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr15__pyx_v_5w3lib_4_url_label); @@ -27111,16 +25227,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":241 + /* "w3lib/_url.pyx":242 * }, * **{ * label: "iso-8859-15" # <<<<<<<<<<<<<< * for label in ( * "csisolatin9", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr15__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_15))) __PYX_ERR(0, 241, __pyx_L102_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr15__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_8859_15))) __PYX_ERR(0, 242, __pyx_L102_error) - /* "w3lib/_url.pyx":242 + /* "w3lib/_url.pyx":243 * **{ * label: "iso-8859-15" * for label in ( # <<<<<<<<<<<<<< @@ -27140,37 +25256,37 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 240, __pyx_L1_error) + __PYX_ERR(0, 241, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_kp_u_iso_8859_16, __pyx_kp_u_iso_8859_16) < 0) __PYX_ERR(0, 251, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_kp_u_iso_8859_16, __pyx_kp_u_iso_8859_16) < 0) __PYX_ERR(0, 252, __pyx_L1_error) { /* enter inner scope */ - /* "w3lib/_url.pyx":252 + /* "w3lib/_url.pyx":253 * }, * "iso-8859-16": "iso-8859-16", * **{ # <<<<<<<<<<<<<< * label: "koi8-r" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L109_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L109_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":254 + /* "w3lib/_url.pyx":255 * **{ * label: "koi8-r" * for label in ( # <<<<<<<<<<<<<< * "cskoi8r", * "koi", */ - __pyx_t_2 = __pyx_tuple__41; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__43; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 5) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 254, __pyx_L109_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 255, __pyx_L109_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L109_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L109_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr16__pyx_v_5w3lib_4_url_label); @@ -27178,16 +25294,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":253 + /* "w3lib/_url.pyx":254 * "iso-8859-16": "iso-8859-16", * **{ * label: "koi8-r" # <<<<<<<<<<<<<< * for label in ( * "cskoi8r", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr16__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_koi8_r))) __PYX_ERR(0, 253, __pyx_L109_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr16__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_koi8_r))) __PYX_ERR(0, 254, __pyx_L109_error) - /* "w3lib/_url.pyx":254 + /* "w3lib/_url.pyx":255 * **{ * label: "koi8-r" * for label in ( # <<<<<<<<<<<<<< @@ -27207,36 +25323,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 252, __pyx_L1_error) + __PYX_ERR(0, 253, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":262 + /* "w3lib/_url.pyx":263 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "koi8-u" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L116_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":264 + /* "w3lib/_url.pyx":265 * **{ * label: "koi8-u" * for label in ( # <<<<<<<<<<<<<< * "koi8-ru", * "koi8-u", */ - __pyx_t_2 = __pyx_tuple__42; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__44; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 2) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 264, __pyx_L116_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 265, __pyx_L116_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L116_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr17__pyx_v_5w3lib_4_url_label); @@ -27244,16 +25360,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":263 + /* "w3lib/_url.pyx":264 * }, * **{ * label: "koi8-u" # <<<<<<<<<<<<<< * for label in ( * "koi8-ru", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr17__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_koi8_u))) __PYX_ERR(0, 263, __pyx_L116_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr17__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_koi8_u))) __PYX_ERR(0, 264, __pyx_L116_error) - /* "w3lib/_url.pyx":264 + /* "w3lib/_url.pyx":265 * **{ * label: "koi8-u" * for label in ( # <<<<<<<<<<<<<< @@ -27273,36 +25389,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 262, __pyx_L1_error) + __PYX_ERR(0, 263, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":269 + /* "w3lib/_url.pyx":270 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "macintosh" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L123_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L123_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":271 + /* "w3lib/_url.pyx":272 * **{ * label: "macintosh" * for label in ( # <<<<<<<<<<<<<< * "csmacintosh", * "mac", */ - __pyx_t_2 = __pyx_tuple__43; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__45; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 4) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 271, __pyx_L123_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 272, __pyx_L123_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L123_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L123_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr18__pyx_v_5w3lib_4_url_label); @@ -27310,16 +25426,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":270 + /* "w3lib/_url.pyx":271 * }, * **{ * label: "macintosh" # <<<<<<<<<<<<<< * for label in ( * "csmacintosh", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr18__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_macintosh))) __PYX_ERR(0, 270, __pyx_L123_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr18__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_macintosh))) __PYX_ERR(0, 271, __pyx_L123_error) - /* "w3lib/_url.pyx":271 + /* "w3lib/_url.pyx":272 * **{ * label: "macintosh" * for label in ( # <<<<<<<<<<<<<< @@ -27339,36 +25455,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 269, __pyx_L1_error) + __PYX_ERR(0, 270, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":278 + /* "w3lib/_url.pyx":279 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "cp874" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L130_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L130_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":280 + /* "w3lib/_url.pyx":281 * **{ * label: "cp874" * for label in ( # <<<<<<<<<<<<<< * "dos-874", * "iso-8859-11", */ - __pyx_t_2 = __pyx_tuple__44; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__46; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 6) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 280, __pyx_L130_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 281, __pyx_L130_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L130_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L130_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr19__pyx_v_5w3lib_4_url_label); @@ -27376,16 +25492,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":279 + /* "w3lib/_url.pyx":280 * }, * **{ * label: "cp874" # <<<<<<<<<<<<<< * for label in ( * "dos-874", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr19__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_cp874))) __PYX_ERR(0, 279, __pyx_L130_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr19__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_cp874))) __PYX_ERR(0, 280, __pyx_L130_error) - /* "w3lib/_url.pyx":280 + /* "w3lib/_url.pyx":281 * **{ * label: "cp874" * for label in ( # <<<<<<<<<<<<<< @@ -27405,80 +25521,80 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 278, __pyx_L1_error) + __PYX_ERR(0, 279, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":289 + /* "w3lib/_url.pyx":290 * ) * }, * **_short_windows_125(0), # <<<<<<<<<<<<<< * **_short_windows_125(1), * **{ */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 289, __pyx_L1_error) + __PYX_ERR(0, 290, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 289, __pyx_L1_error) + __PYX_ERR(0, 290, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":290 + /* "w3lib/_url.pyx":291 * }, * **_short_windows_125(0), * **_short_windows_125(1), # <<<<<<<<<<<<<< * **{ * label: "windows-1252" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 290, __pyx_L1_error) + __PYX_ERR(0, 291, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 290, __pyx_L1_error) + __PYX_ERR(0, 291, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":291 + /* "w3lib/_url.pyx":292 * **_short_windows_125(0), * **_short_windows_125(1), * **{ # <<<<<<<<<<<<<< * label: "windows-1252" * for label in ( */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L137_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L137_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":293 + /* "w3lib/_url.pyx":294 * **{ * label: "windows-1252" * for label in ( # <<<<<<<<<<<<<< * "ansi_x3.4-1968", * "ascii", */ - __pyx_t_2 = __pyx_tuple__47; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__49; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 17) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 293, __pyx_L137_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 294, __pyx_L137_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L137_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L137_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr20__pyx_v_5w3lib_4_url_label); @@ -27486,16 +25602,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":292 + /* "w3lib/_url.pyx":293 * **_short_windows_125(1), * **{ * label: "windows-1252" # <<<<<<<<<<<<<< * for label in ( * "ansi_x3.4-1968", */ - if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr20__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_windows_1252))) __PYX_ERR(0, 292, __pyx_L137_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_9genexpr20__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_windows_1252))) __PYX_ERR(0, 293, __pyx_L137_error) - /* "w3lib/_url.pyx":293 + /* "w3lib/_url.pyx":294 * **{ * label: "windows-1252" * for label in ( # <<<<<<<<<<<<<< @@ -27515,58 +25631,58 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 291, __pyx_L1_error) + __PYX_ERR(0, 292, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":313 + /* "w3lib/_url.pyx":314 * ) * }, * **_short_windows_125(3), # <<<<<<<<<<<<<< * **{ * label: "windows-1254" */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 313, __pyx_L1_error) + __PYX_ERR(0, 314, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 313, __pyx_L1_error) + __PYX_ERR(0, 314, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":314 + /* "w3lib/_url.pyx":315 * }, * **_short_windows_125(3), * **{ # <<<<<<<<<<<<<< * label: "windows-1254" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L144_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L144_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":316 + /* "w3lib/_url.pyx":317 * **{ * label: "windows-1254" * for label in ( # <<<<<<<<<<<<<< * "cp1254", * "csisolatin5", */ - __pyx_t_3 = __pyx_tuple__49; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__51; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 12) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 316, __pyx_L144_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 317, __pyx_L144_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L144_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L144_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr21__pyx_v_5w3lib_4_url_label); @@ -27574,16 +25690,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":315 + /* "w3lib/_url.pyx":316 * **_short_windows_125(3), * **{ * label: "windows-1254" # <<<<<<<<<<<<<< * for label in ( * "cp1254", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr21__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_windows_1254))) __PYX_ERR(0, 315, __pyx_L144_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr21__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_windows_1254))) __PYX_ERR(0, 316, __pyx_L144_error) - /* "w3lib/_url.pyx":316 + /* "w3lib/_url.pyx":317 * **{ * label: "windows-1254" * for label in ( # <<<<<<<<<<<<<< @@ -27603,124 +25719,124 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 314, __pyx_L1_error) + __PYX_ERR(0, 315, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":331 + /* "w3lib/_url.pyx":332 * ) * }, * **_short_windows_125(5), # <<<<<<<<<<<<<< * **_short_windows_125(6), * **_short_windows_125(7), */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 331, __pyx_L1_error) + __PYX_ERR(0, 332, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 331, __pyx_L1_error) + __PYX_ERR(0, 332, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":332 + /* "w3lib/_url.pyx":333 * }, * **_short_windows_125(5), * **_short_windows_125(6), # <<<<<<<<<<<<<< * **_short_windows_125(7), * **_short_windows_125(8), */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 332, __pyx_L1_error) + __PYX_ERR(0, 333, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 332, __pyx_L1_error) + __PYX_ERR(0, 333, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":333 + /* "w3lib/_url.pyx":334 * **_short_windows_125(5), * **_short_windows_125(6), * **_short_windows_125(7), # <<<<<<<<<<<<<< * **_short_windows_125(8), * **{ */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 333, __pyx_L1_error) + __PYX_ERR(0, 334, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_3) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_3); - __PYX_ERR(0, 333, __pyx_L1_error) + __PYX_ERR(0, 334, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":334 + /* "w3lib/_url.pyx":335 * **_short_windows_125(6), * **_short_windows_125(7), * **_short_windows_125(8), # <<<<<<<<<<<<<< * **{ * label: "mac-cyrillic" */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 334, __pyx_L1_error) + __PYX_ERR(0, 335, __pyx_L1_error) } if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 334, __pyx_L1_error) + __PYX_ERR(0, 335, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":335 + /* "w3lib/_url.pyx":336 * **_short_windows_125(7), * **_short_windows_125(8), * **{ # <<<<<<<<<<<<<< * label: "mac-cyrillic" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L151_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L151_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":337 + /* "w3lib/_url.pyx":338 * **{ * label: "mac-cyrillic" * for label in ( # <<<<<<<<<<<<<< * "x-mac-cyrillic", * "x-mac-ukrainian", */ - __pyx_t_3 = __pyx_tuple__54; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__56; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 2) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 337, __pyx_L151_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 338, __pyx_L151_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L151_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L151_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr22__pyx_v_5w3lib_4_url_label); @@ -27728,16 +25844,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":336 + /* "w3lib/_url.pyx":337 * **_short_windows_125(8), * **{ * label: "mac-cyrillic" # <<<<<<<<<<<<<< * for label in ( * "x-mac-cyrillic", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr22__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_mac_cyrillic))) __PYX_ERR(0, 336, __pyx_L151_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr22__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_mac_cyrillic))) __PYX_ERR(0, 337, __pyx_L151_error) - /* "w3lib/_url.pyx":337 + /* "w3lib/_url.pyx":338 * **{ * label: "mac-cyrillic" * for label in ( # <<<<<<<<<<<<<< @@ -27757,36 +25873,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 335, __pyx_L1_error) + __PYX_ERR(0, 336, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":342 + /* "w3lib/_url.pyx":343 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "gbk" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L158_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L158_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":344 + /* "w3lib/_url.pyx":345 * **{ * label: "gbk" * for label in ( # <<<<<<<<<<<<<< * "chinese", * "csgb2312", */ - __pyx_t_3 = __pyx_tuple__55; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__57; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 9) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 344, __pyx_L158_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 345, __pyx_L158_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L158_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L158_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr23__pyx_v_5w3lib_4_url_label); @@ -27794,16 +25910,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":343 + /* "w3lib/_url.pyx":344 * }, * **{ * label: "gbk" # <<<<<<<<<<<<<< * for label in ( * "chinese", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr23__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_gbk))) __PYX_ERR(0, 343, __pyx_L158_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr23__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_gbk))) __PYX_ERR(0, 344, __pyx_L158_error) - /* "w3lib/_url.pyx":344 + /* "w3lib/_url.pyx":345 * **{ * label: "gbk" * for label in ( # <<<<<<<<<<<<<< @@ -27823,37 +25939,37 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 342, __pyx_L1_error) + __PYX_ERR(0, 343, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_gb18030, __pyx_n_u_gb18030) < 0) __PYX_ERR(0, 356, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_gb18030, __pyx_n_u_gb18030) < 0) __PYX_ERR(0, 357, __pyx_L1_error) { /* enter inner scope */ - /* "w3lib/_url.pyx":357 + /* "w3lib/_url.pyx":358 * }, * "gb18030": "gb18030", * **{ # <<<<<<<<<<<<<< * label: "big5" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L165_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L165_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":359 + /* "w3lib/_url.pyx":360 * **{ * label: "big5" * for label in ( # <<<<<<<<<<<<<< * "big5", * "big5-hkscs", */ - __pyx_t_3 = __pyx_tuple__56; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__58; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 5) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 359, __pyx_L165_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 360, __pyx_L165_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L165_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L165_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr24__pyx_v_5w3lib_4_url_label); @@ -27861,16 +25977,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":358 + /* "w3lib/_url.pyx":359 * "gb18030": "gb18030", * **{ * label: "big5" # <<<<<<<<<<<<<< * for label in ( * "big5", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr24__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_big5))) __PYX_ERR(0, 358, __pyx_L165_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr24__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_big5))) __PYX_ERR(0, 359, __pyx_L165_error) - /* "w3lib/_url.pyx":359 + /* "w3lib/_url.pyx":360 * **{ * label: "big5" * for label in ( # <<<<<<<<<<<<<< @@ -27890,36 +26006,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 357, __pyx_L1_error) + __PYX_ERR(0, 358, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":367 + /* "w3lib/_url.pyx":368 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "euc-jp" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L172_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L172_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":369 + /* "w3lib/_url.pyx":370 * **{ * label: "euc-jp" * for label in ( # <<<<<<<<<<<<<< * "cseucpkdfmtjapanese", * "euc-jp", */ - __pyx_t_3 = __pyx_tuple__57; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__59; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 3) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 369, __pyx_L172_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 370, __pyx_L172_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L172_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L172_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr25__pyx_v_5w3lib_4_url_label); @@ -27927,16 +26043,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":368 + /* "w3lib/_url.pyx":369 * }, * **{ * label: "euc-jp" # <<<<<<<<<<<<<< * for label in ( * "cseucpkdfmtjapanese", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr25__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_euc_jp))) __PYX_ERR(0, 368, __pyx_L172_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr25__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_euc_jp))) __PYX_ERR(0, 369, __pyx_L172_error) - /* "w3lib/_url.pyx":369 + /* "w3lib/_url.pyx":370 * **{ * label: "euc-jp" * for label in ( # <<<<<<<<<<<<<< @@ -27956,36 +26072,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 367, __pyx_L1_error) + __PYX_ERR(0, 368, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":375 + /* "w3lib/_url.pyx":376 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "iso-2022-jp" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L179_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L179_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":377 + /* "w3lib/_url.pyx":378 * **{ * label: "iso-2022-jp" * for label in ( # <<<<<<<<<<<<<< * "csiso2022jp", * "iso-2022-jp", */ - __pyx_t_3 = __pyx_tuple__58; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__60; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 2) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 377, __pyx_L179_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 378, __pyx_L179_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L179_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L179_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr26__pyx_v_5w3lib_4_url_label); @@ -27993,16 +26109,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":376 + /* "w3lib/_url.pyx":377 * }, * **{ * label: "iso-2022-jp" # <<<<<<<<<<<<<< * for label in ( * "csiso2022jp", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr26__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_2022_jp))) __PYX_ERR(0, 376, __pyx_L179_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr26__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_iso_2022_jp))) __PYX_ERR(0, 377, __pyx_L179_error) - /* "w3lib/_url.pyx":377 + /* "w3lib/_url.pyx":378 * **{ * label: "iso-2022-jp" * for label in ( # <<<<<<<<<<<<<< @@ -28022,36 +26138,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 375, __pyx_L1_error) + __PYX_ERR(0, 376, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":382 + /* "w3lib/_url.pyx":383 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "shift_jis" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L186_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L186_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":384 + /* "w3lib/_url.pyx":385 * **{ * label: "shift_jis" * for label in ( # <<<<<<<<<<<<<< * "csshiftjis", * "ms932", */ - __pyx_t_3 = __pyx_tuple__59; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__61; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 8) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 384, __pyx_L186_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 385, __pyx_L186_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L186_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L186_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr27__pyx_v_5w3lib_4_url_label); @@ -28059,16 +26175,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":383 + /* "w3lib/_url.pyx":384 * }, * **{ * label: "shift_jis" # <<<<<<<<<<<<<< * for label in ( * "csshiftjis", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr27__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_shift_jis_2))) __PYX_ERR(0, 383, __pyx_L186_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr27__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_n_u_shift_jis_2))) __PYX_ERR(0, 384, __pyx_L186_error) - /* "w3lib/_url.pyx":384 + /* "w3lib/_url.pyx":385 * **{ * label: "shift_jis" * for label in ( # <<<<<<<<<<<<<< @@ -28088,36 +26204,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 382, __pyx_L1_error) + __PYX_ERR(0, 383, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":395 + /* "w3lib/_url.pyx":396 * ) * }, * **{ # <<<<<<<<<<<<<< * label: "euc-kr" * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L193_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L193_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":397 + /* "w3lib/_url.pyx":398 * **{ * label: "euc-kr" * for label in ( # <<<<<<<<<<<<<< * "cseuckr", * "csksc56011987", */ - __pyx_t_3 = __pyx_tuple__60; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__62; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 10) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 397, __pyx_L193_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 398, __pyx_L193_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L193_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L193_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr28__pyx_v_5w3lib_4_url_label); @@ -28125,16 +26241,16 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":396 + /* "w3lib/_url.pyx":397 * }, * **{ * label: "euc-kr" # <<<<<<<<<<<<<< * for label in ( * "cseuckr", */ - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr28__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_euc_kr))) __PYX_ERR(0, 396, __pyx_L193_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr28__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_kp_u_euc_kr))) __PYX_ERR(0, 397, __pyx_L193_error) - /* "w3lib/_url.pyx":397 + /* "w3lib/_url.pyx":398 * **{ * label: "euc-kr" * for label in ( # <<<<<<<<<<<<<< @@ -28154,36 +26270,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 395, __pyx_L1_error) + __PYX_ERR(0, 396, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":410 + /* "w3lib/_url.pyx":411 * ) * }, * **{ # <<<<<<<<<<<<<< * label: _REPLACEMENT_ENCODING * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L200_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L200_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":412 + /* "w3lib/_url.pyx":413 * **{ * label: _REPLACEMENT_ENCODING * for label in ( # <<<<<<<<<<<<<< * "csiso2022kr", * "hz-gb-2312", */ - __pyx_t_3 = __pyx_tuple__61; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__63; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 6) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 412, __pyx_L200_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 413, __pyx_L200_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L200_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L200_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr29__pyx_v_5w3lib_4_url_label); @@ -28191,19 +26307,19 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":411 + /* "w3lib/_url.pyx":412 * }, * **{ * label: _REPLACEMENT_ENCODING # <<<<<<<<<<<<<< * for label in ( * "csiso2022kr", */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_REPLACEMENT_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 411, __pyx_L200_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_REPLACEMENT_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L200_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr29__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 411, __pyx_L200_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr29__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 412, __pyx_L200_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":412 + /* "w3lib/_url.pyx":413 * **{ * label: _REPLACEMENT_ENCODING * for label in ( # <<<<<<<<<<<<<< @@ -28223,36 +26339,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 410, __pyx_L1_error) + __PYX_ERR(0, 411, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":421 + /* "w3lib/_url.pyx":422 * ) * }, * **{ # <<<<<<<<<<<<<< * label: _UTF_16BE_ENCODING * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L207_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L207_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":423 + /* "w3lib/_url.pyx":424 * **{ * label: _UTF_16BE_ENCODING * for label in ( # <<<<<<<<<<<<<< * "unicodefffe", * "utf-16be", */ - __pyx_t_3 = __pyx_tuple__62; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__64; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 2) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 423, __pyx_L207_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 424, __pyx_L207_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L207_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L207_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr30__pyx_v_5w3lib_4_url_label); @@ -28260,19 +26376,19 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":422 + /* "w3lib/_url.pyx":423 * }, * **{ * label: _UTF_16BE_ENCODING # <<<<<<<<<<<<<< * for label in ( * "unicodefffe", */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_16BE_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L207_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_16BE_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L207_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr30__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 422, __pyx_L207_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr30__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 423, __pyx_L207_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":423 + /* "w3lib/_url.pyx":424 * **{ * label: _UTF_16BE_ENCODING * for label in ( # <<<<<<<<<<<<<< @@ -28292,36 +26408,36 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 421, __pyx_L1_error) + __PYX_ERR(0, 422, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "w3lib/_url.pyx":428 + /* "w3lib/_url.pyx":429 * ) * }, * **{ # <<<<<<<<<<<<<< * label: _UTF_16LE_ENCODING * for label in ( */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L214_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L214_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":430 + /* "w3lib/_url.pyx":431 * **{ * label: _UTF_16LE_ENCODING * for label in ( # <<<<<<<<<<<<<< * "csunicode", * "iso-10646-ucs-2", */ - __pyx_t_3 = __pyx_tuple__63; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__65; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 7) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 430, __pyx_L214_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 431, __pyx_L214_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L214_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L214_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XGOTREF(__pyx_9genexpr31__pyx_v_5w3lib_4_url_label); @@ -28329,19 +26445,19 @@ if (!__Pyx_RefNanny) { __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":429 + /* "w3lib/_url.pyx":430 * }, * **{ * label: _UTF_16LE_ENCODING # <<<<<<<<<<<<<< * for label in ( * "csunicode", */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_16LE_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L214_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UTF_16LE_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L214_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr31__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 429, __pyx_L214_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr31__pyx_v_5w3lib_4_url_label, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 430, __pyx_L214_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":430 + /* "w3lib/_url.pyx":431 * **{ * label: _UTF_16LE_ENCODING * for label in ( # <<<<<<<<<<<<<< @@ -28361,142 +26477,142 @@ if (!__Pyx_RefNanny) { } /* exit inner scope */ if (unlikely(PyDict_Update(__pyx_t_6, __pyx_t_2) < 0)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_2); - __PYX_ERR(0, 428, __pyx_L1_error) + __PYX_ERR(0, 429, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_kp_u_x_user_defined, __pyx_kp_u_x_user_defined) < 0) __PYX_ERR(0, 440, __pyx_L1_error) - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LABEL_ENCODINGS, __pyx_t_6) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_kp_u_x_user_defined, __pyx_kp_u_x_user_defined) < 0) __PYX_ERR(0, 441, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LABEL_ENCODINGS, __pyx_t_6) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":445 + /* "w3lib/_url.pyx":446 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#get-an-encoder * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def _get_encoder(encoding: str) -> EncodeFunction: * codec_info = codecs.lookup(encoding) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 445, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 446, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 445, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_EncodeFunction) < 0) __PYX_ERR(0, 445, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_3_get_encoder, 0, __pyx_n_s_get_encoder, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 445, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 446, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_EncodeFunction) < 0) __PYX_ERR(0, 446, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_3_get_encoder, 0, __pyx_n_s_get_encoder, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoder, __pyx_t_2) < 0) __PYX_ERR(0, 445, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoder, __pyx_t_2) < 0) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":451 + /* "w3lib/_url.pyx":452 * * * _UTF_8_ENCODER = _get_encoder("utf-8") # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODER, __pyx_t_6) < 0) __PYX_ERR(0, 451, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODER, __pyx_t_6) < 0) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":455 + /* "w3lib/_url.pyx":456 * * # https://encoding.spec.whatwg.org/commit-snapshots/3721bec25c59f5506744dfeb8e3af7783e2f0f52/#concept-encoding-get * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def _get_encoding(label: str) -> str: * label = label.strip(_ASCII_WHITESPACE).lower() */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 455, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 455, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 455, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 455, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_5_get_encoding, 0, __pyx_n_s_get_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 455, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_5_get_encoding, 0, __pyx_n_s_get_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 455, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":470 + /* "w3lib/_url.pyx":471 * * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( * _REPLACEMENT_ENCODING, # <<<<<<<<<<<<<< * _UTF_16BE_ENCODING, * _UTF_16LE_ENCODING, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_REPLACEMENT_ENCODING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_REPLACEMENT_ENCODING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":471 + /* "w3lib/_url.pyx":472 * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( * _REPLACEMENT_ENCODING, * _UTF_16BE_ENCODING, # <<<<<<<<<<<<<< * _UTF_16LE_ENCODING, * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_UTF_16BE_ENCODING); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_UTF_16BE_ENCODING); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "w3lib/_url.pyx":472 + /* "w3lib/_url.pyx":473 * _REPLACEMENT_ENCODING, * _UTF_16BE_ENCODING, * _UTF_16LE_ENCODING, # <<<<<<<<<<<<<< * ) * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_UTF_16LE_ENCODING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_UTF_16LE_ENCODING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":470 + /* "w3lib/_url.pyx":471 * * _OUTPUT_ENCODING_UTF8_ENCODINGS = ( * _REPLACEMENT_ENCODING, # <<<<<<<<<<<<<< * _UTF_16BE_ENCODING, * _UTF_16LE_ENCODING, */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS, __pyx_t_4) < 0) __PYX_ERR(0, 469, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OUTPUT_ENCODING_UTF8_ENCODINGS, __pyx_t_4) < 0) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":487 + /* "w3lib/_url.pyx":488 * # https://url.spec.whatwg.org/ * * _ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { # <<<<<<<<<<<<<< @@ -28504,26 +26620,26 @@ if (!__Pyx_RefNanny) { * } */ { /* enter inner scope */ - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L221_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L221_error) __Pyx_GOTREF(__pyx_t_4); - /* "w3lib/_url.pyx":488 + /* "w3lib/_url.pyx":489 * * _ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = { * ord(char): None for char in _ASCII_TAB_OR_NEWLINE # <<<<<<<<<<<<<< * } * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L221_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_TAB_OR_NEWLINE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L221_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 488, __pyx_L221_error) + __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 489, __pyx_L221_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 488, __pyx_L221_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 489, __pyx_L221_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -28532,28 +26648,28 @@ if (!__Pyx_RefNanny) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 488, __pyx_L221_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 489, __pyx_L221_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 488, __pyx_L221_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 489, __pyx_L221_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L221_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L221_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 488, __pyx_L221_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 489, __pyx_L221_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 488, __pyx_L221_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 489, __pyx_L221_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L221_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L221_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -28563,7 +26679,7 @@ if (!__Pyx_RefNanny) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 488, __pyx_L221_error) + else __PYX_ERR(0, 489, __pyx_L221_error) } break; } @@ -28575,11 +26691,11 @@ if (!__Pyx_RefNanny) { __pyx_t_3 = 0; __pyx_t_3 = __pyx_9genexpr32__pyx_v_5w3lib_4_url_char; __Pyx_INCREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_Ord(__pyx_t_3); if (unlikely(__pyx_t_9 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 488, __pyx_L221_error) + __pyx_t_9 = __Pyx_PyObject_Ord(__pyx_t_3); if (unlikely(__pyx_t_9 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 489, __pyx_L221_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L221_error) + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L221_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_t_3, (PyObject*)Py_None))) __PYX_ERR(0, 488, __pyx_L221_error) + if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_t_3, (PyObject*)Py_None))) __PYX_ERR(0, 489, __pyx_L221_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -28592,10 +26708,10 @@ if (!__Pyx_RefNanny) { goto __pyx_L1_error; __pyx_L225_exit_scope:; } /* exit inner scope */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO, __pyx_t_4) < 0) __PYX_ERR(0, 487, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO, __pyx_t_4) < 0) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":491 + /* "w3lib/_url.pyx":492 * } * * SCHEME_START = declare(uchar, 0) # <<<<<<<<<<<<<< @@ -28604,7 +26720,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_SCHEME_START = 0; - /* "w3lib/_url.pyx":492 + /* "w3lib/_url.pyx":493 * * SCHEME_START = declare(uchar, 0) * SCHEME = declare(uchar, 1) # <<<<<<<<<<<<<< @@ -28613,7 +26729,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_SCHEME = 1; - /* "w3lib/_url.pyx":493 + /* "w3lib/_url.pyx":494 * SCHEME_START = declare(uchar, 0) * SCHEME = declare(uchar, 1) * NO_SCHEME = declare(uchar, 2) # <<<<<<<<<<<<<< @@ -28622,1646 +26738,1361 @@ if (!__Pyx_RefNanny) { */ __pyx_v_5w3lib_4_url_NO_SCHEME = 2; - /* "w3lib/_url.pyx":494 + /* "w3lib/_url.pyx":495 * SCHEME = declare(uchar, 1) * NO_SCHEME = declare(uchar, 2) * SPECIAL_RELATIVE_OR_AUTHORITY = declare(uchar, 3) # <<<<<<<<<<<<<< * PATH_OR_AUTHORITY = declare(uchar, 4) - * RELATIVE = declare(uchar, 5) + * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 5) */ __pyx_v_5w3lib_4_url_SPECIAL_RELATIVE_OR_AUTHORITY = 3; - /* "w3lib/_url.pyx":495 + /* "w3lib/_url.pyx":496 * NO_SCHEME = declare(uchar, 2) * SPECIAL_RELATIVE_OR_AUTHORITY = declare(uchar, 3) * PATH_OR_AUTHORITY = declare(uchar, 4) # <<<<<<<<<<<<<< - * RELATIVE = declare(uchar, 5) - * RELATIVE_SLASH = declare(uchar, 6) + * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 5) + * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 6) */ __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY = 4; - /* "w3lib/_url.pyx":496 - * SPECIAL_RELATIVE_OR_AUTHORITY = declare(uchar, 3) - * PATH_OR_AUTHORITY = declare(uchar, 4) - * RELATIVE = declare(uchar, 5) # <<<<<<<<<<<<<< - * RELATIVE_SLASH = declare(uchar, 6) - * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) - */ - __pyx_v_5w3lib_4_url_RELATIVE = 5; - /* "w3lib/_url.pyx":497 + * SPECIAL_RELATIVE_OR_AUTHORITY = declare(uchar, 3) * PATH_OR_AUTHORITY = declare(uchar, 4) - * RELATIVE = declare(uchar, 5) - * RELATIVE_SLASH = declare(uchar, 6) # <<<<<<<<<<<<<< - * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) - * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) + * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 5) # <<<<<<<<<<<<<< + * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 6) + * AUTHORITY = declare(uchar, 7) */ - __pyx_v_5w3lib_4_url_RELATIVE_SLASH = 6; + __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES = 5; /* "w3lib/_url.pyx":498 - * RELATIVE = declare(uchar, 5) - * RELATIVE_SLASH = declare(uchar, 6) - * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) # <<<<<<<<<<<<<< - * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) - * AUTHORITY = declare(uchar, 9) + * PATH_OR_AUTHORITY = declare(uchar, 4) + * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 5) + * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 6) # <<<<<<<<<<<<<< + * AUTHORITY = declare(uchar, 7) + * HOST = declare(uchar, 8) */ - __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES = 7; + __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES = 6; /* "w3lib/_url.pyx":499 - * RELATIVE_SLASH = declare(uchar, 6) - * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) - * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) # <<<<<<<<<<<<<< - * AUTHORITY = declare(uchar, 9) - * HOST = declare(uchar, 10) + * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 5) + * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 6) + * AUTHORITY = declare(uchar, 7) # <<<<<<<<<<<<<< + * HOST = declare(uchar, 8) + * PORT = declare(uchar, 9) */ - __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES = 8; + __pyx_v_5w3lib_4_url_AUTHORITY = 7; /* "w3lib/_url.pyx":500 - * SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) - * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) - * AUTHORITY = declare(uchar, 9) # <<<<<<<<<<<<<< - * HOST = declare(uchar, 10) - * PORT = declare(uchar, 11) + * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 6) + * AUTHORITY = declare(uchar, 7) + * HOST = declare(uchar, 8) # <<<<<<<<<<<<<< + * PORT = declare(uchar, 9) + * FILE = declare(uchar, 10) */ - __pyx_v_5w3lib_4_url_AUTHORITY = 9; + __pyx_v_5w3lib_4_url_HOST = 8; /* "w3lib/_url.pyx":501 - * SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) - * AUTHORITY = declare(uchar, 9) - * HOST = declare(uchar, 10) # <<<<<<<<<<<<<< - * PORT = declare(uchar, 11) - * FILE = declare(uchar, 12) + * AUTHORITY = declare(uchar, 7) + * HOST = declare(uchar, 8) + * PORT = declare(uchar, 9) # <<<<<<<<<<<<<< + * FILE = declare(uchar, 10) + * FILE_SLASH = declare(uchar, 11) */ - __pyx_v_5w3lib_4_url_HOST = 10; + __pyx_v_5w3lib_4_url_PORT = 9; /* "w3lib/_url.pyx":502 - * AUTHORITY = declare(uchar, 9) - * HOST = declare(uchar, 10) - * PORT = declare(uchar, 11) # <<<<<<<<<<<<<< - * FILE = declare(uchar, 12) - * FILE_SLASH = declare(uchar, 13) + * HOST = declare(uchar, 8) + * PORT = declare(uchar, 9) + * FILE = declare(uchar, 10) # <<<<<<<<<<<<<< + * FILE_SLASH = declare(uchar, 11) + * FILE_HOST = declare(uchar, 12) */ - __pyx_v_5w3lib_4_url_PORT = 11; + __pyx_v_5w3lib_4_url_FILE = 10; /* "w3lib/_url.pyx":503 - * HOST = declare(uchar, 10) - * PORT = declare(uchar, 11) - * FILE = declare(uchar, 12) # <<<<<<<<<<<<<< - * FILE_SLASH = declare(uchar, 13) - * FILE_HOST = declare(uchar, 14) + * PORT = declare(uchar, 9) + * FILE = declare(uchar, 10) + * FILE_SLASH = declare(uchar, 11) # <<<<<<<<<<<<<< + * FILE_HOST = declare(uchar, 12) + * PATH_START = declare(uchar, 13) */ - __pyx_v_5w3lib_4_url_FILE = 12; + __pyx_v_5w3lib_4_url_FILE_SLASH = 11; /* "w3lib/_url.pyx":504 - * PORT = declare(uchar, 11) - * FILE = declare(uchar, 12) - * FILE_SLASH = declare(uchar, 13) # <<<<<<<<<<<<<< - * FILE_HOST = declare(uchar, 14) - * PATH_START = declare(uchar, 15) + * FILE = declare(uchar, 10) + * FILE_SLASH = declare(uchar, 11) + * FILE_HOST = declare(uchar, 12) # <<<<<<<<<<<<<< + * PATH_START = declare(uchar, 13) + * PATH = declare(uchar, 14) */ - __pyx_v_5w3lib_4_url_FILE_SLASH = 13; + __pyx_v_5w3lib_4_url_FILE_HOST = 12; /* "w3lib/_url.pyx":505 - * FILE = declare(uchar, 12) - * FILE_SLASH = declare(uchar, 13) - * FILE_HOST = declare(uchar, 14) # <<<<<<<<<<<<<< - * PATH_START = declare(uchar, 15) - * PATH = declare(uchar, 16) + * FILE_SLASH = declare(uchar, 11) + * FILE_HOST = declare(uchar, 12) + * PATH_START = declare(uchar, 13) # <<<<<<<<<<<<<< + * PATH = declare(uchar, 14) + * OPAQUE_PATH = declare(uchar, 15) */ - __pyx_v_5w3lib_4_url_FILE_HOST = 14; + __pyx_v_5w3lib_4_url_PATH_START = 13; /* "w3lib/_url.pyx":506 - * FILE_SLASH = declare(uchar, 13) - * FILE_HOST = declare(uchar, 14) - * PATH_START = declare(uchar, 15) # <<<<<<<<<<<<<< - * PATH = declare(uchar, 16) - * OPAQUE_PATH = declare(uchar, 17) + * FILE_HOST = declare(uchar, 12) + * PATH_START = declare(uchar, 13) + * PATH = declare(uchar, 14) # <<<<<<<<<<<<<< + * OPAQUE_PATH = declare(uchar, 15) + * QUERY = declare(uchar, 16) */ - __pyx_v_5w3lib_4_url_PATH_START = 15; + __pyx_v_5w3lib_4_url_PATH = 14; /* "w3lib/_url.pyx":507 - * FILE_HOST = declare(uchar, 14) - * PATH_START = declare(uchar, 15) - * PATH = declare(uchar, 16) # <<<<<<<<<<<<<< - * OPAQUE_PATH = declare(uchar, 17) - * QUERY = declare(uchar, 18) + * PATH_START = declare(uchar, 13) + * PATH = declare(uchar, 14) + * OPAQUE_PATH = declare(uchar, 15) # <<<<<<<<<<<<<< + * QUERY = declare(uchar, 16) + * FRAGMENT = declare(uchar, 17) */ - __pyx_v_5w3lib_4_url_PATH = 16; + __pyx_v_5w3lib_4_url_OPAQUE_PATH = 15; /* "w3lib/_url.pyx":508 - * PATH_START = declare(uchar, 15) - * PATH = declare(uchar, 16) - * OPAQUE_PATH = declare(uchar, 17) # <<<<<<<<<<<<<< - * QUERY = declare(uchar, 18) - * FRAGMENT = declare(uchar, 19) + * PATH = declare(uchar, 14) + * OPAQUE_PATH = declare(uchar, 15) + * QUERY = declare(uchar, 16) # <<<<<<<<<<<<<< + * FRAGMENT = declare(uchar, 17) + * */ - __pyx_v_5w3lib_4_url_OPAQUE_PATH = 17; + __pyx_v_5w3lib_4_url_QUERY = 16; /* "w3lib/_url.pyx":509 - * PATH = declare(uchar, 16) - * OPAQUE_PATH = declare(uchar, 17) - * QUERY = declare(uchar, 18) # <<<<<<<<<<<<<< - * FRAGMENT = declare(uchar, 19) + * OPAQUE_PATH = declare(uchar, 15) + * QUERY = declare(uchar, 16) + * FRAGMENT = declare(uchar, 17) # <<<<<<<<<<<<<< + * + * HOSTNAME = declare(uchar, 0) + */ + __pyx_v_5w3lib_4_url_FRAGMENT = 17; + + /* "w3lib/_url.pyx":511 + * FRAGMENT = declare(uchar, 17) + * + * HOSTNAME = declare(uchar, 0) # <<<<<<<<<<<<<< + * IPV4 = declare(uchar, 1) + * IPV6 = declare(uchar, 2) + */ + __pyx_v_5w3lib_4_url_HOSTNAME = 0; + + /* "w3lib/_url.pyx":512 + * + * HOSTNAME = declare(uchar, 0) + * IPV4 = declare(uchar, 1) # <<<<<<<<<<<<<< + * IPV6 = declare(uchar, 2) * */ - __pyx_v_5w3lib_4_url_QUERY = 18; + __pyx_v_5w3lib_4_url_IPV4 = 1; - /* "w3lib/_url.pyx":510 - * OPAQUE_PATH = declare(uchar, 17) - * QUERY = declare(uchar, 18) - * FRAGMENT = declare(uchar, 19) # <<<<<<<<<<<<<< + /* "w3lib/_url.pyx":513 + * HOSTNAME = declare(uchar, 0) + * IPV4 = declare(uchar, 1) + * IPV6 = declare(uchar, 2) # <<<<<<<<<<<<<< * * */ - __pyx_v_5w3lib_4_url_FRAGMENT = 19; + __pyx_v_5w3lib_4_url_IPV6 = 2; - /* "w3lib/_url.pyx":515 + /* "w3lib/_url.pyx":518 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#default-port * _DEFAULT_PORTS = { * "ftp": 21, # <<<<<<<<<<<<<< * "file": None, * "http": 80, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_ftp, __pyx_int_21) < 0) __PYX_ERR(0, 515, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_ftp, __pyx_int_21) < 0) __PYX_ERR(0, 518, __pyx_L1_error) - /* "w3lib/_url.pyx":516 + /* "w3lib/_url.pyx":519 * _DEFAULT_PORTS = { * "ftp": 21, * "file": None, # <<<<<<<<<<<<<< * "http": 80, * "https": 443, */ - if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_file, Py_None) < 0) __PYX_ERR(0, 515, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_http, __pyx_int_80) < 0) __PYX_ERR(0, 515, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_https, __pyx_int_443) < 0) __PYX_ERR(0, 515, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_ws, __pyx_int_80) < 0) __PYX_ERR(0, 515, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_wss, __pyx_int_443) < 0) __PYX_ERR(0, 515, __pyx_L1_error) - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_PORTS, __pyx_t_4) < 0) __PYX_ERR(0, 514, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_file, Py_None) < 0) __PYX_ERR(0, 518, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_http, __pyx_int_80) < 0) __PYX_ERR(0, 518, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_https, __pyx_int_443) < 0) __PYX_ERR(0, 518, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_ws, __pyx_int_80) < 0) __PYX_ERR(0, 518, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_wss, __pyx_int_443) < 0) __PYX_ERR(0, 518, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_PORTS, __pyx_t_4) < 0) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":522 + /* "w3lib/_url.pyx":525 * "wss": 443, * } * _SPECIAL_SCHEMES = set(_DEFAULT_PORTS.keys()) # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DEFAULT_PORTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_keys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_keys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_6 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_SCHEMES, __pyx_t_6) < 0) __PYX_ERR(0, 522, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_SCHEMES, __pyx_t_6) < 0) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":525 + /* "w3lib/_url.pyx":528 * * * class _URL: # <<<<<<<<<<<<<< - * _scheme: str = "" - * username: str = "" + * scheme: str + * username: str */ - __pyx_t_6 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_URL, __pyx_n_s_URL, (PyObject *) NULL, __pyx_n_s_w3lib__url, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_URL, __pyx_n_s_URL, (PyObject *) NULL, __pyx_n_s_w3lib__url, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_scheme, __pyx_n_s_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_username, __pyx_n_s_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_password, __pyx_n_s_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hostname, __pyx_kp_s_Union_int_List_int_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_port, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path, __pyx_kp_s_Union_str_List_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fragment, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_password_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_port_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_default_port_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_annotations, __pyx_t_4) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":526 - * - * class _URL: - * _scheme: str = "" # <<<<<<<<<<<<<< - * username: str = "" - * password: str = "" - */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_scheme, __pyx_kp_u__2) < 0) __PYX_ERR(0, 526, __pyx_L1_error) - - /* "w3lib/_url.pyx":527 - * class _URL: - * _scheme: str = "" - * username: str = "" # <<<<<<<<<<<<<< - * password: str = "" - * hostname: Union[int, List[int], str] = "" - */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_username, __pyx_kp_u__2) < 0) __PYX_ERR(0, 527, __pyx_L1_error) - - /* "w3lib/_url.pyx":528 - * _scheme: str = "" - * username: str = "" - * password: str = "" # <<<<<<<<<<<<<< - * hostname: Union[int, List[int], str] = "" - * port: Optional[int] = None - */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_password, __pyx_kp_u__2) < 0) __PYX_ERR(0, 528, __pyx_L1_error) - - /* "w3lib/_url.pyx":529 - * username: str = "" - * password: str = "" - * hostname: Union[int, List[int], str] = "" # <<<<<<<<<<<<<< - * port: Optional[int] = None - * path: Union[str, List[str]] - */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_hostname, __pyx_kp_u__2) < 0) __PYX_ERR(0, 529, __pyx_L1_error) - - /* "w3lib/_url.pyx":530 - * password: str = "" - * hostname: Union[int, List[int], str] = "" - * port: Optional[int] = None # <<<<<<<<<<<<<< - * path: Union[str, List[str]] - * query: Optional[str] = None - */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_port, Py_None) < 0) __PYX_ERR(0, 530, __pyx_L1_error) - - /* "w3lib/_url.pyx":532 - * port: Optional[int] = None - * path: Union[str, List[str]] - * query: Optional[str] = None # <<<<<<<<<<<<<< - * fragment: Optional[str] = None - * - */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 532, __pyx_L1_error) - - /* "w3lib/_url.pyx":533 - * path: Union[str, List[str]] - * query: Optional[str] = None - * fragment: Optional[str] = None # <<<<<<<<<<<<<< - * - * # Indicates whether a color (:) separating a username from a password - */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fragment, Py_None) < 0) __PYX_ERR(0, 533, __pyx_L1_error) - - /* "w3lib/_url.pyx":538 - * # existed in the parsed URL. This enables :func:`_serialize_url` to - * # generate a URL that matches the input URL, if desired. - * _password_token_seen: bool = False # <<<<<<<<<<<<<< - * - * # Indicates, for an empty port component, whether or not a colon (:) - */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_password_token_seen, Py_False) < 0) __PYX_ERR(0, 538, __pyx_L1_error) - - /* "w3lib/_url.pyx":543 - * # character was used. This enables :func:`_serialize_url` to - * # generate a URL that matches the input URL, if desired. - * _port_token_seen: bool = False # <<<<<<<<<<<<<< - * - * # Indicates whether or not a default port was specified in the input URL. - */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_port_token_seen, Py_False) < 0) __PYX_ERR(0, 543, __pyx_L1_error) - - /* "w3lib/_url.pyx":548 - * # This enables :func:`_serialize_url` to generate a URL that matches the - * # input URL, if desired. - * _default_port_seen: bool = False # <<<<<<<<<<<<<< - * - * # Indicates, for an empty path component, whether or not a slash (/) - */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_default_port_seen, Py_False) < 0) __PYX_ERR(0, 548, __pyx_L1_error) - - /* "w3lib/_url.pyx":553 - * # character was used. This enables :func:`_serialize_url` to - * # generate a URL that matches the input URL, if desired. - * _path_token_seen: bool = False # <<<<<<<<<<<<<< - * - * def __init__(self) -> None: - */ - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_path_token_seen, Py_False) < 0) __PYX_ERR(0, 553, __pyx_L1_error) - - /* "w3lib/_url.pyx":555 - * _path_token_seen: bool = False - * - * def __init__(self) -> None: # <<<<<<<<<<<<<< - * self.path = [] - * self.is_special = False - */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 555, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_1__init__, 0, __pyx_n_s_URL___init, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 555, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":559 - * self.is_special = False - * - * def has_opaque_path(self) -> bool: # <<<<<<<<<<<<<< - * return isinstance(self.path, str) - * - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 559, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_3has_opaque_path, 0, __pyx_n_s_URL_has_opaque_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(17); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_has_opaque_path, __pyx_t_4) < 0) __PYX_ERR(0, 559, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_scheme, __pyx_n_s_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_username, __pyx_n_s_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_password, __pyx_n_s_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_password_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_host_type, __pyx_n_s_uchar) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hostname, __pyx_n_s_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ipv4, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ipv6, __pyx_kp_s_cython_int_8) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_port, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_port_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path, __pyx_kp_s_List_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_opaque_path, __pyx_n_s_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query, __pyx_n_s_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fragment, __pyx_n_s_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fragment_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_annotations, __pyx_t_4) < 0) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":562 - * return isinstance(self.path, str) + /* "w3lib/_url.pyx":547 + * _fragment_token_seen: bool * - * @property # <<<<<<<<<<<<<< - * def scheme(self) -> str: - * return self._scheme + * def __init__(self): # <<<<<<<<<<<<<< + * self.scheme = "" + * self.username = "" */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_1__init__, 0, __pyx_n_s_URL___init, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 562, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_5scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_scheme_2, __pyx_t_4) < 0) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "w3lib/_url.pyx":566 - * return self._scheme - * - * @scheme.setter # <<<<<<<<<<<<<< - * def scheme(self, value: str) -> None: - * self._scheme = value - */ - __pyx_t_3 = PyObject_GetItem(__pyx_t_6, __pyx_n_s_scheme_2); - if (unlikely(!__pyx_t_3)) { - PyErr_Clear(); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_scheme_2); - } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_setter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_value, __pyx_n_s_str) < 0) __PYX_ERR(0, 566, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 566, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_7scheme, 0, __pyx_n_s_URL_scheme, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_10 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_scheme_2, __pyx_t_4) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":525 + /* "w3lib/_url.pyx":528 * * * class _URL: # <<<<<<<<<<<<<< - * _scheme: str = "" - * username: str = "" + * scheme: str + * username: str */ - __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_URL, __pyx_empty_tuple, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_URL, __pyx_empty_tuple, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_URL, __pyx_t_4) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_URL, __pyx_t_4) < 0) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":572 + /* "w3lib/_url.pyx":567 * * * _SCHEME_CHARS = _ASCII_ALPHANUMERIC + "+-." # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__75); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__73); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME_CHARS, __pyx_t_4) < 0) __PYX_ERR(0, 572, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME_CHARS, __pyx_t_4) < 0) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":576 + /* "w3lib/_url.pyx":571 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#shorten-a-urls-path * def _shorten_path(url: _URL) -> None: # <<<<<<<<<<<<<< * path = url.path * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 576, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 576, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_7_shorten_path, 0, __pyx_n_s_shorten_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 576, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 571, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_7_shorten_path, 0, __pyx_n_s_shorten_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_shorten_path, __pyx_t_6) < 0) __PYX_ERR(0, 576, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_shorten_path, __pyx_t_6) < 0) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":585 + /* "w3lib/_url.pyx":580 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< * input: str, * *, */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_space_as_plus, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 585, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_space_as_plus, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 585, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 585, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 585, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_space_as_plus, __pyx_n_s_bool) < 0) __PYX_ERR(0, 585, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 585, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_9_percent_encode_after_encoding, 0, __pyx_n_s_percent_encode_after_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_space_as_plus, __pyx_n_s_bool) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_9_percent_encode_after_encoding, 0, __pyx_n_s_percent_encode_after_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_3, __pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_percent_encode_after_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 585, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_percent_encode_after_encoding, __pyx_t_3) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":620 + /* "w3lib/_url.pyx":615 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":621 + /* "w3lib/_url.pyx":616 * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( * _C0_CONTROL, # <<<<<<<<<<<<<< * greater_than="~", * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "w3lib/_url.pyx":620 + /* "w3lib/_url.pyx":615 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 620, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":622 + /* "w3lib/_url.pyx":617 * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( * _C0_CONTROL, * greater_than="~", # <<<<<<<<<<<<<< * ) * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_greater_than, __pyx_kp_u__81) < 0) __PYX_ERR(0, 622, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_greater_than, __pyx_kp_u__79) < 0) __PYX_ERR(0, 617, __pyx_L1_error) - /* "w3lib/_url.pyx":620 + /* "w3lib/_url.pyx":615 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":624 + /* "w3lib/_url.pyx":619 * greater_than="~", * ) * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' # <<<<<<<<<<<<<< * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_u__82); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__80); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 624, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":625 + /* "w3lib/_url.pyx":620 * ) * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' # <<<<<<<<<<<<<< * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__83); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__81); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 625, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":626 + /* "w3lib/_url.pyx":621 * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" # <<<<<<<<<<<<<< * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_u__84); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__82); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_t_4) < 0) __PYX_ERR(0, 626, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_t_4) < 0) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":627 + /* "w3lib/_url.pyx":622 * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" # <<<<<<<<<<<<<< * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__85); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__83); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 627, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 622, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":628 + /* "w3lib/_url.pyx":623 * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" # <<<<<<<<<<<<<< * * # constants from RFC 3986, Section 2.2 and 2.3 */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_u__86); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__84); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":631 + /* "w3lib/_url.pyx":626 * * # constants from RFC 3986, Section 2.2 and 2.3 * RFC3986_GEN_DELIMS = b":/?#[]@" # <<<<<<<<<<<<<< * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_GEN_DELIMS, __pyx_kp_b__87) < 0) __PYX_ERR(0, 631, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_GEN_DELIMS, __pyx_kp_b__85) < 0) __PYX_ERR(0, 626, __pyx_L1_error) - /* "w3lib/_url.pyx":632 + /* "w3lib/_url.pyx":627 * # constants from RFC 3986, Section 2.2 and 2.3 * RFC3986_GEN_DELIMS = b":/?#[]@" * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" # <<<<<<<<<<<<<< * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_SUB_DELIMS, __pyx_kp_b__88) < 0) __PYX_ERR(0, 632, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_SUB_DELIMS, __pyx_kp_b__86) < 0) __PYX_ERR(0, 627, __pyx_L1_error) - /* "w3lib/_url.pyx":633 + /* "w3lib/_url.pyx":628 * RFC3986_GEN_DELIMS = b":/?#[]@" * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS # <<<<<<<<<<<<<< * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RFC3986_GEN_DELIMS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RFC3986_GEN_DELIMS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RFC3986_SUB_DELIMS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RFC3986_SUB_DELIMS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_RESERVED, __pyx_t_6) < 0) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_RESERVED, __pyx_t_6) < 0) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":634 + /* "w3lib/_url.pyx":629 * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") # <<<<<<<<<<<<<< * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_string); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_string); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascii_letters); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascii_letters); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_string); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_string); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_digits); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_digits); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__89); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__87); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_UNRESERVED, __pyx_t_4) < 0) __PYX_ERR(0, 634, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_UNRESERVED, __pyx_t_4) < 0) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":635 + /* "w3lib/_url.pyx":630 * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 # <<<<<<<<<<<<<< * * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRA_SAFE_CHARS, __pyx_kp_b__91) < 0) __PYX_ERR(0, 635, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRA_SAFE_CHARS, __pyx_kp_b__89) < 0) __PYX_ERR(0, 630, __pyx_L1_error) - /* "w3lib/_url.pyx":637 + /* "w3lib/_url.pyx":632 * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 * * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" # <<<<<<<<<<<<<< * _safe_chars = RFC3986_RESERVED + RFC3986_UNRESERVED + EXTRA_SAFE_CHARS + b"%" * _path_safe_chars = _safe_chars.replace(b"#", b"") */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RFC3986_UNRESERVED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RFC3986_UNRESERVED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_SUB_DELIMS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_SUB_DELIMS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_kp_b__5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_USERINFO_SAFE_CHARS, __pyx_t_6) < 0) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_USERINFO_SAFE_CHARS, __pyx_t_6) < 0) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":638 + /* "w3lib/_url.pyx":633 * * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" * _safe_chars = RFC3986_RESERVED + RFC3986_UNRESERVED + EXTRA_SAFE_CHARS + b"%" # <<<<<<<<<<<<<< * _path_safe_chars = _safe_chars.replace(b"#", b"") * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_RESERVED); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_RESERVED); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RFC3986_UNRESERVED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RFC3986_UNRESERVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_EXTRA_SAFE_CHARS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EXTRA_SAFE_CHARS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_chars, __pyx_t_5) < 0) __PYX_ERR(0, 638, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_chars, __pyx_t_2) < 0) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":639 + /* "w3lib/_url.pyx":634 * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" * _safe_chars = RFC3986_RESERVED + RFC3986_UNRESERVED + EXTRA_SAFE_CHARS + b"%" * _path_safe_chars = _safe_chars.replace(b"#", b"") # <<<<<<<<<<<<<< * * # Characters that are safe in all of: */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_safe_chars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_safe_chars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_path_safe_chars, __pyx_t_5) < 0) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_path_safe_chars, __pyx_t_2) < 0) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":651 + /* "w3lib/_url.pyx":646 * # be escaped as %25 when it is not already being used as part of an escape * # character. * _USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") # <<<<<<<<<<<<<< * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RFC3986_USERINFO_SAFE_CHARS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_translate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RFC3986_USERINFO_SAFE_CHARS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_translate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_delete, __pyx_kp_b__94) < 0) __PYX_ERR(0, 651, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__93, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_delete, __pyx_kp_b__92) < 0) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__91, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_SAFEST_CHARS, __pyx_t_4) < 0) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_SAFEST_CHARS, __pyx_t_4) < 0) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":652 + /* "w3lib/_url.pyx":647 * # character. * _USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") # <<<<<<<<<<<<<< * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS * _SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_safe_chars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_safe_chars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_translate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 652, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_translate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_delete, __pyx_kp_b__95) < 0) __PYX_ERR(0, 652, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__93, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 652, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_delete, __pyx_kp_b__93) < 0) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__91, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_SAFEST_CHARS, __pyx_t_6) < 0) __PYX_ERR(0, 652, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_SAFEST_CHARS, __pyx_t_6) < 0) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":653 + /* "w3lib/_url.pyx":648 * _USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS # <<<<<<<<<<<<<< * _SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") * _FRAGMENT_SAFEST_CHARS = _PATH_SAFEST_CHARS */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 653, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_SAFEST_CHARS, __pyx_t_6) < 0) __PYX_ERR(0, 653, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_SAFEST_CHARS, __pyx_t_6) < 0) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":654 + /* "w3lib/_url.pyx":649 * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS * _SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") # <<<<<<<<<<<<<< * _FRAGMENT_SAFEST_CHARS = _PATH_SAFEST_CHARS * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_translate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_translate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_delete, __pyx_kp_b__84) < 0) __PYX_ERR(0, 654, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__93, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_delete, __pyx_kp_b__82) < 0) __PYX_ERR(0, 649, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__91, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS, __pyx_t_5) < 0) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS, __pyx_t_2) < 0) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":655 + /* "w3lib/_url.pyx":650 * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS * _SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") * _FRAGMENT_SAFEST_CHARS = _PATH_SAFEST_CHARS # <<<<<<<<<<<<<< * * _SAFE_USERINFO_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_SAFEST_CHARS, __pyx_t_5) < 0) __PYX_ERR(0, 655, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_SAFEST_CHARS, __pyx_t_2) < 0) __PYX_ERR(0, 650, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":658 + /* "w3lib/_url.pyx":653 * * _SAFE_USERINFO_PERCENT_ENCODE_SET = ( * _USERINFO_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC3986_USERINFO_PERCENT_ENCODE_SET * | _RFC2396_USERINFO_PERCENT_ENCODE_SET */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":659 + /* "w3lib/_url.pyx":654 * _SAFE_USERINFO_PERCENT_ENCODE_SET = ( * _USERINFO_PERCENT_ENCODE_SET * | _RFC3986_USERINFO_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC2396_USERINFO_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Or(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":660 + /* "w3lib/_url.pyx":655 * _USERINFO_PERCENT_ENCODE_SET * | _RFC3986_USERINFO_PERCENT_ENCODE_SET * | _RFC2396_USERINFO_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * _SAFE_PATH_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE, __pyx_t_5) < 0) __PYX_ERR(0, 657, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":663 + /* "w3lib/_url.pyx":658 * ) * _SAFE_PATH_PERCENT_ENCODE_SET = ( * _PATH_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC3986_PATH_PERCENT_ENCODE_SET * | _RFC2396_ABS_PATH_PERCENT_ENCODE_SET */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":664 + /* "w3lib/_url.pyx":659 * _SAFE_PATH_PERCENT_ENCODE_SET = ( * _PATH_PERCENT_ENCODE_SET * | _RFC3986_PATH_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC2396_ABS_PATH_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Or(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) + __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":665 + /* "w3lib/_url.pyx":660 * _PATH_PERCENT_ENCODE_SET * | _RFC3986_PATH_PERCENT_ENCODE_SET * | _RFC2396_ABS_PATH_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * _SAFE_QUERY_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 662, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 657, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":668 + /* "w3lib/_url.pyx":663 * ) * _SAFE_QUERY_PERCENT_ENCODE_SET = ( * _QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC3986_QUERY_PERCENT_ENCODE_SET * | _RFC2396_QUERY_PERCENT_ENCODE_SET */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":669 + /* "w3lib/_url.pyx":664 * _SAFE_QUERY_PERCENT_ENCODE_SET = ( * _QUERY_PERCENT_ENCODE_SET * | _RFC3986_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC2396_QUERY_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Or(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) + __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":670 + /* "w3lib/_url.pyx":665 * _QUERY_PERCENT_ENCODE_SET * | _RFC3986_QUERY_PERCENT_ENCODE_SET * | _RFC2396_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET, __pyx_t_5) < 0) __PYX_ERR(0, 667, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":673 + /* "w3lib/_url.pyx":668 * ) * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET = ( * _SPECIAL_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC3986_QUERY_PERCENT_ENCODE_SET * | _RFC2396_QUERY_PERCENT_ENCODE_SET */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 673, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":674 + /* "w3lib/_url.pyx":669 * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET = ( * _SPECIAL_QUERY_PERCENT_ENCODE_SET * | _RFC3986_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC2396_QUERY_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 674, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Or(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":675 + /* "w3lib/_url.pyx":670 * _SPECIAL_QUERY_PERCENT_ENCODE_SET * | _RFC3986_QUERY_PERCENT_ENCODE_SET * | _RFC2396_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * _SAFE_FRAGMENT_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO, __pyx_t_5) < 0) __PYX_ERR(0, 672, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO, __pyx_t_2) < 0) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":678 + /* "w3lib/_url.pyx":673 * ) * _SAFE_FRAGMENT_PERCENT_ENCODE_SET = ( * _FRAGMENT_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC3986_FRAGMENT_PERCENT_ENCODE_SET * | _RFC2396_FRAGMENT_PERCENT_ENCODE_SET */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 678, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":679 + /* "w3lib/_url.pyx":674 * _SAFE_FRAGMENT_PERCENT_ENCODE_SET = ( * _FRAGMENT_PERCENT_ENCODE_SET * | _RFC3986_FRAGMENT_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC2396_FRAGMENT_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 679, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Or(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":680 + /* "w3lib/_url.pyx":675 * _FRAGMENT_PERCENT_ENCODE_SET * | _RFC3986_FRAGMENT_PERCENT_ENCODE_SET * | _RFC2396_FRAGMENT_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE, __pyx_t_5) < 0) __PYX_ERR(0, 677, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE, __pyx_t_2) < 0) __PYX_ERR(0, 672, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":684 + /* "w3lib/_url.pyx":679 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point * _FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" # <<<<<<<<<<<<<< * _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_kp_u__96) < 0) __PYX_ERR(0, 684, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_kp_u__94) < 0) __PYX_ERR(0, 679, __pyx_L1_error) - /* "w3lib/_url.pyx":685 + /* "w3lib/_url.pyx":680 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point * _FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" * _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__97); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__95); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_t_6) < 0) __PYX_ERR(0, 685, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_t_6) < 0) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":688 + /* "w3lib/_url.pyx":683 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< * address = [0] * 8 * piece_index = 0 */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 688, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 688, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_11_parse_ipv6, 0, __pyx_n_s_parse_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 683, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_11_parse_ipv6, 0, __pyx_n_s_parse_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 688, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":775 + /* "w3lib/_url.pyx":770 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< * input: str, * percent_encode_set: _PercentEncodeSet, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 775, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 775, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 775, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_13_utf_8_percent_encode, 0, __pyx_n_s_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 775, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 770, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 770, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_13_utf_8_percent_encode, 0, __pyx_n_s_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf_8_percent_encode, __pyx_t_6) < 0) __PYX_ERR(0, 775, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf_8_percent_encode, __pyx_t_6) < 0) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":787 + /* "w3lib/_url.pyx":782 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 787, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 787, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 787, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_15_parse_opaque_host, 0, __pyx_n_s_parse_opaque_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 787, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 782, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_15_parse_opaque_host, 0, __pyx_n_s_parse_opaque_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_opaque_host, __pyx_t_4) < 0) __PYX_ERR(0, 787, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_opaque_host, __pyx_t_4) < 0) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":795 + /* "w3lib/_url.pyx":790 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< * if not input: * raise ValueError */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 795, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Tuple_int_bool) < 0) __PYX_ERR(0, 795, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_17_parse_ipv4_number, 0, __pyx_n_s_parse_ipv4_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 795, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 790, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Tuple_int_bool) < 0) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_17_parse_ipv4_number, 0, __pyx_n_s_parse_ipv4_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4_number, __pyx_t_6) < 0) __PYX_ERR(0, 795, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4_number, __pyx_t_6) < 0) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":815 + /* "w3lib/_url.pyx":810 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and parts[-1] == "": */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 815, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 815, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 815, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_19_ends_in_number, 0, __pyx_n_s_ends_in_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 815, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 810, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 810, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_19_ends_in_number, 0, __pyx_n_s_ends_in_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ends_in_number, __pyx_t_4) < 0) __PYX_ERR(0, 815, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ends_in_number, __pyx_t_4) < 0) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":832 + /* "w3lib/_url.pyx":827 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and not parts[-1]: */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 832, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 832, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_21_parse_ipv4, 0, __pyx_n_s_parse_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 832, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 827, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_21_parse_ipv4, 0, __pyx_n_s_parse_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4, __pyx_t_6) < 0) __PYX_ERR(0, 832, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4, __pyx_t_6) < 0) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":855 + /* "w3lib/_url.pyx":850 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< * result = _utr46._to_ascii( * domain, */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_be_strict, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 855, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_be_strict, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domain, __pyx_n_s_str) < 0) __PYX_ERR(0, 855, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_be_strict, __pyx_n_s_bool) < 0) __PYX_ERR(0, 855, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 855, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_23_domain_to_ascii, 0, __pyx_n_s_domain_to_ascii, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_5, __pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domain, __pyx_n_s_str) < 0) __PYX_ERR(0, 850, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_be_strict, __pyx_n_s_bool) < 0) __PYX_ERR(0, 850, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_23_domain_to_ascii, 0, __pyx_n_s_domain_to_ascii, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_domain_to_ascii, __pyx_t_5) < 0) __PYX_ERR(0, 855, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_domain_to_ascii, __pyx_t_2) < 0) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":874 + /* "w3lib/_url.pyx":869 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< * input: str, - * *, + * url: _URL, */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_is_special, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 874, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 869, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 869, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 869, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_25_parse_host, 0, __pyx_n_s_parse_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 874, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_is_special, __pyx_n_s_bool) < 0) __PYX_ERR(0, 874, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 874, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_25_parse_host, 0, __pyx_n_s_parse_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 874, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_6, __pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_host, __pyx_t_4) < 0) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_host, __pyx_t_6) < 0) __PYX_ERR(0, 874, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":896 + /* "w3lib/_url.pyx":898 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 896, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 896, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 896, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_27_is_windows_drive_letter, 0, __pyx_n_s_is_windows_drive_letter, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 896, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_windows_drive_letter, __pyx_t_4) < 0) __PYX_ERR(0, 896, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 898, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 898, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_27_is_windows_drive_letter, 0, __pyx_n_s_is_windows_drive_letter, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_windows_drive_letter, __pyx_t_2) < 0) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":901 + /* "w3lib/_url.pyx":903 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< * input_length = len(input) * return ( */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 901, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 903, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 903, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_29_starts_with_windows_drive_letter, 0, __pyx_n_s_starts_with_windows_drive_lette, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 901, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 901, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_29_starts_with_windows_drive_letter, 0, __pyx_n_s_starts_with_windows_drive_lette, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 901, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_starts_with_windows_drive_lette, __pyx_t_4) < 0) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_starts_with_windows_drive_lette, __pyx_t_6) < 0) __PYX_ERR(0, 901, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":911 + /* "w3lib/_url.pyx":913 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< * return input in ( * "..", */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 911, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 911, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 911, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_31_is_double_dot_path_segment, 0, __pyx_n_s_is_double_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 911, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_double_dot_path_segment, __pyx_t_4) < 0) __PYX_ERR(0, 911, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 913, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_31_is_double_dot_path_segment, 0, __pyx_n_s_is_double_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_double_dot_path_segment, __pyx_t_2) < 0) __PYX_ERR(0, 913, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":926 + /* "w3lib/_url.pyx":928 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< * return input in ( * ".", */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 926, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 928, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 928, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 928, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_33_is_single_dot_path_segment, 0, __pyx_n_s_is_single_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 926, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 926, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_33_is_single_dot_path_segment, 0, __pyx_n_s_is_single_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 926, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_single_dot_path_segment, __pyx_t_4) < 0) __PYX_ERR(0, 928, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_single_dot_path_segment, __pyx_t_6) < 0) __PYX_ERR(0, 926, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":937 + /* "w3lib/_url.pyx":939 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * *, input: str, pointer: int, encode_set: _PercentEncodeSet * ) -> str: */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 937, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pointer, __pyx_n_s_int) < 0) __PYX_ERR(0, 937, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 937, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 937, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_35_idempotent_utf_8_percent_encode, 0, __pyx_n_s_idempotent_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_idempotent_utf_8_percent_encode, __pyx_t_4) < 0) __PYX_ERR(0, 937, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 939, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pointer, __pyx_n_s_int) < 0) __PYX_ERR(0, 939, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 939, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_35_idempotent_utf_8_percent_encode, 0, __pyx_n_s_idempotent_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_idempotent_utf_8_percent_encode, __pyx_t_2) < 0) __PYX_ERR(0, 939, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":952 + /* "w3lib/_url.pyx":954 * * * def _preprocess_url(url: str) -> str: # <<<<<<<<<<<<<< * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 952, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_url, __pyx_n_s_str) < 0) __PYX_ERR(0, 954, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 954, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_37_preprocess_url, 0, __pyx_n_s_preprocess_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_str) < 0) __PYX_ERR(0, 952, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 952, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_37_preprocess_url, 0, __pyx_n_s_preprocess_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_preprocess_url, __pyx_t_4) < 0) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_preprocess_url, __pyx_t_6) < 0) __PYX_ERR(0, 952, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":956 + /* "w3lib/_url.pyx":958 * * * def _parse_url( # <<<<<<<<<<<<<< * input: str, - * *, - */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 956, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base_url, __pyx_n_s_str) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_userinfo_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_path_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_special_query_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fragment_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 956, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_39_parse_url, 0, __pyx_n_s_parse_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 956, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults), 5)) __PYX_ERR(0, 956, __pyx_L1_error) - - /* "w3lib/_url.pyx":961 - * base_url: str = None, - * encoding: str = "utf-8", - * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< - * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, - * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_userinfo_percent_encode_set = __pyx_t_5; - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":962 * encoding: str = "utf-8", - * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, - * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< - * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, - * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 962, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_path_percent_encode_set = __pyx_t_5; - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":963 - * userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, - * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, - * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< - * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, - * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 963, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_query_percent_encode_set = __pyx_t_5; - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":964 - * path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, - * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, - * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< - * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, - * ) -> _URL: - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 964, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_special_query_percent_encode_set = __pyx_t_5; - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - - /* "w3lib/_url.pyx":965 - * query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, - * special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, - * fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< - * ) -> _URL: - * """Return a :class:`_URL` object built from *url*, *base_url* and */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 965, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_fragment_percent_encode_set = __pyx_t_5; - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_5w3lib_4_url_54__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_url, __pyx_t_4) < 0) __PYX_ERR(0, 956, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 958, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 958, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 958, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_39_parse_url, 0, __pyx_n_s_parse_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__68); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_url, __pyx_t_2) < 0) __PYX_ERR(0, 958, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1368 + /* "w3lib/_url.pyx":1269 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< * output = "" * n = address */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_address, __pyx_n_s_int) < 0) __PYX_ERR(0, 1269, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1269, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_41_serialize_ipv4, 0, __pyx_n_s_serialize_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_address, __pyx_n_s_int) < 0) __PYX_ERR(0, 1368, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1368, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_41_serialize_ipv4, 0, __pyx_n_s_serialize_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv4, __pyx_t_4) < 0) __PYX_ERR(0, 1269, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv4, __pyx_t_6) < 0) __PYX_ERR(0, 1368, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":1379 + /* "w3lib/_url.pyx":1280 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1379, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_min_length, __pyx_n_s_int) < 0) __PYX_ERR(0, 1379, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 1379, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index, 0, __pyx_n_s_get_ipv6_first_longest_0_piece, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1379, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 1379, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1280, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_min_length, __pyx_n_s_int) < 0) __PYX_ERR(0, 1280, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 1280, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index, 0, __pyx_n_s_get_ipv6_first_longest_0_piece, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 1280, __pyx_L1_error) - /* "w3lib/_url.pyx":1380 + /* "w3lib/_url.pyx":1281 * * def _get_ipv6_first_longest_0_piece_index( * address: List[int], *, min_length: int = 2 # <<<<<<<<<<<<<< * ) -> Optional[int]: * index = None */ - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_2))) __PYX_ERR(0, 1380, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_2))) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_INCREF(__pyx_int_2); - __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_4)->__pyx_arg_min_length = ((PyObject*)__pyx_int_2); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_2)->__pyx_arg_min_length = ((PyObject*)__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_5w3lib_4_url_56__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_t_4) < 0) __PYX_ERR(0, 1379, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_5w3lib_4_url_54__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_t_2) < 0) __PYX_ERR(0, 1280, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1397 + /* "w3lib/_url.pyx":1298 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1397, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1298, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1298, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_45_serialize_ipv6, 0, __pyx_n_s_serialize_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1397, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1397, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_45_serialize_ipv6, 0, __pyx_n_s_serialize_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv6, __pyx_t_6) < 0) __PYX_ERR(0, 1397, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":1418 + /* "w3lib/_url.pyx":1319 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer - * def _serialize_host(host: Union[str, int, List[int]]) -> str: # <<<<<<<<<<<<<< - * if isinstance(host, int): - * return _serialize_ipv4(host) + * def _serialize_host(url: _URL) -> str: # <<<<<<<<<<<<<< + * if url._host_type == IPV4: + * return _serialize_ipv4(url.ipv4) */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_host, __pyx_kp_s_Union_str_int_List_int) < 0) __PYX_ERR(0, 1418, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1418, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_47_serialize_host, 0, __pyx_n_s_serialize_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1418, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_host, __pyx_t_4) < 0) __PYX_ERR(0, 1418, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1319, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_47_serialize_host, 0, __pyx_n_s_serialize_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_host, __pyx_t_2) < 0) __PYX_ERR(0, 1319, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1427 + /* "w3lib/_url.pyx":1328 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer - * def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # <<<<<<<<<<<<<< - * if url.has_opaque_path(): + * def _serialize_url_path(url: _URL) -> str: # <<<<<<<<<<<<<< + * if url.opaque_path: * assert isinstance(url.path, str) */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1328, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_49_serialize_url_path, 0, __pyx_n_s_serialize_url_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 1427, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1427, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1427, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_canonicalize, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1427, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1427, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_49_serialize_url_path, 0, __pyx_n_s_serialize_url_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1427, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_5, __pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url_path, __pyx_t_4) < 0) __PYX_ERR(0, 1328, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url_path, __pyx_t_5) < 0) __PYX_ERR(0, 1427, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1440 + /* "w3lib/_url.pyx":1341 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing - * def _serialize_url( # <<<<<<<<<<<<<< - * url: _URL, - * *, - */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_exclude_fragment, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) - - /* "w3lib/_url.pyx":1444 - * *, - * exclude_fragment: bool = False, - * canonicalize: Optional[bool] = None, # <<<<<<<<<<<<<< - * ) -> str: + * def _serialize_url(url: _URL) -> str: # <<<<<<<<<<<<<< * """Return a string representation of *url* following the URL serialization + * algorithm defined in the `URL living standard`_. */ - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_canonicalize, Py_None) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) - - /* "w3lib/_url.pyx":1440 - * - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing - * def _serialize_url( # <<<<<<<<<<<<<< - * url: _URL, - * *, - */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_exclude_fragment, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_canonicalize, __pyx_kp_s_Optional_bool) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_51_serialize_url, 0, __pyx_n_s_serialize_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1440, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_4, __pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url, __pyx_t_4) < 0) __PYX_ERR(0, 1440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1341, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1341, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_51_serialize_url, 0, __pyx_n_s_serialize_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url, __pyx_t_2) < 0) __PYX_ERR(0, 1341, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1506 + /* "w3lib/_url.pyx":1376 * * * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< - * url = _parse_url( - * input, + * url = _parse_url(input, encoding) + * return _serialize_url(url) */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1506, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 1376, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 1376, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1376, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_53_safe_url, 0, __pyx_n_s_safe_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 1506, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 1506, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1506, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_53_safe_url, 0, __pyx_n_s_safe_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_url, __pyx_t_4) < 0) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_url, __pyx_t_6) < 0) __PYX_ERR(0, 1506, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "w3lib/_url.pyx":1 * # pylint: disable=protected-access,too-many-instance-attributes,too-many-locals,too-many-nested-blocks,too-many-statements # <<<<<<<<<<<<<< * * import codecs */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*--- Wrapped vars code ---*/ @@ -33111,6 +30942,181 @@ static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr, return (int) PyUnicode_Tailmatch(s, substr, start, end, direction); } +/* CIntToDigits */ +static const char DIGIT_PAIRS_10[2*10*10+1] = { + "00010203040506070809" + "10111213141516171819" + "20212223242526272829" + "30313233343536373839" + "40414243444546474849" + "50515253545556575859" + "60616263646566676869" + "70717273747576777879" + "80818283848586878889" + "90919293949596979899" +}; +static const char DIGIT_PAIRS_8[2*8*8+1] = { + "0001020304050607" + "1011121314151617" + "2021222324252627" + "3031323334353637" + "4041424344454647" + "5051525354555657" + "6061626364656667" + "7071727374757677" +}; +static const char DIGITS_HEX[2*16+1] = { + "0123456789abcdef" + "0123456789ABCDEF" +}; + +/* BuildPyUnicode */ +static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, + int prepend_sign, char padding_char) { + PyObject *uval; + Py_ssize_t uoffset = ulength - clength; +#if CYTHON_USE_UNICODE_INTERNALS + Py_ssize_t i; +#if CYTHON_PEP393_ENABLED + void *udata; + uval = PyUnicode_New(ulength, 127); + if (unlikely(!uval)) return NULL; + udata = PyUnicode_DATA(uval); +#else + Py_UNICODE *udata; + uval = PyUnicode_FromUnicode(NULL, ulength); + if (unlikely(!uval)) return NULL; + udata = PyUnicode_AS_UNICODE(uval); +#endif + if (uoffset > 0) { + i = 0; + if (prepend_sign) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); + i++; + } + for (; i < uoffset; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); + } + } + for (i=0; i < clength; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); + } +#else + { + PyObject *sign = NULL, *padding = NULL; + uval = NULL; + if (uoffset > 0) { + prepend_sign = !!prepend_sign; + if (uoffset > prepend_sign) { + padding = PyUnicode_FromOrdinal(padding_char); + if (likely(padding) && uoffset > prepend_sign + 1) { + PyObject *tmp; + PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign); + if (unlikely(!repeat)) goto done_or_error; + tmp = PyNumber_Multiply(padding, repeat); + Py_DECREF(repeat); + Py_DECREF(padding); + padding = tmp; + } + if (unlikely(!padding)) goto done_or_error; + } + if (prepend_sign) { + sign = PyUnicode_FromOrdinal('-'); + if (unlikely(!sign)) goto done_or_error; + } + } + uval = PyUnicode_DecodeASCII(chars, clength, NULL); + if (likely(uval) && padding) { + PyObject *tmp = PyNumber_Add(padding, uval); + Py_DECREF(uval); + uval = tmp; + } + if (likely(uval) && sign) { + PyObject *tmp = PyNumber_Add(sign, uval); + Py_DECREF(uval); + uval = tmp; + } +done_or_error: + Py_XDECREF(padding); + Py_XDECREF(sign); + } +#endif + return uval; +} + +/* CIntToPyUnicode */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) { + char digits[sizeof(int)*3+2]; + char *dpos, *end = digits + sizeof(int)*3+2; + const char *hex_digits = DIGITS_HEX; + Py_ssize_t length, ulength; + int prepend_sign, last_one_off; + int remaining; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (format_char == 'X') { + hex_digits += 16; + format_char = 'x'; + } + remaining = value; + last_one_off = 0; + dpos = end; + do { + int digit_pos; + switch (format_char) { + case 'o': + digit_pos = abs((int)(remaining % (8*8))); + remaining = (int) (remaining / (8*8)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); + last_one_off = (digit_pos < 8); + break; + case 'd': + digit_pos = abs((int)(remaining % (10*10))); + remaining = (int) (remaining / (10*10)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); + last_one_off = (digit_pos < 10); + break; + case 'x': + *(--dpos) = hex_digits[abs((int)(remaining % 16))]; + remaining = (int) (remaining / 16); + break; + default: + assert(0); + break; + } + } while (unlikely(remaining != 0)); + assert(!last_one_off || *dpos == '0'); + dpos += last_one_off; + length = end - dpos; + ulength = length; + prepend_sign = 0; + if (!is_unsigned && value <= neg_one) { + if (padding_char == ' ' || width <= length + 1) { + *(--dpos) = '-'; + ++length; + } else { + prepend_sign = 1; + } + ++ulength; + } + if (width > ulength) { + ulength = width; + } + if (ulength == 1) { + return PyUnicode_FromOrdinal(*dpos); + } + return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); +} + /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; @@ -33914,7 +31920,7 @@ static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject * #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__24; + PyObject *module, *from_list, *star = __pyx_n_s__26; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) @@ -36008,27 +34014,91 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } } +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(unsigned char) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned char) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(unsigned char) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(unsigned char), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned char)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + /* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif - const long neg_one = (long) -1, const_zero = (long) 0; + const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (long) val; + return (int) val; } } else #endif @@ -36038,35 +34108,35 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; @@ -36081,93 +34151,93 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (long) -1; + return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif - if ((sizeof(long) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: - if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: - if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: - if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif - if ((sizeof(long) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { - long val; + int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -36194,17 +34264,17 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); - if (unlikely(!v)) return (long) -1; + if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) - return (long) 0; + return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (long) -1; + return (int) -1; is_negative = result == 1; } #endif @@ -36213,14 +34283,14 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) - return (long) -1; + return (int) -1; } else { stepval = __Pyx_NewRef(v); } - val = (long) 0; + val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; @@ -36230,7 +34300,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; - val |= ((long) idigit) << bits; + val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; @@ -36238,15 +34308,15 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; - val |= ((long) idigit) << bits; + val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { - if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; @@ -36261,63 +34331,111 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { if (likely(!ret)) return val; } - return (long) -1; + return (int) -1; } } else { - long val; + int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; + "value too large to convert to int"); + return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; + "can't convert negative value to int"); + return (int) -1; } -/* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API -static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) -{ - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__14); +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } } - return name; -} + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; #endif + } +} /* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif - const int neg_one = (int) -1, const_zero = (int) 0; + const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (int) val; + return (long) val; } } else #endif @@ -36327,35 +34445,35 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; @@ -36370,93 +34488,93 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (int) -1; + return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif - if ((sizeof(int) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: - if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: - if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: - if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif - if ((sizeof(int) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { - int val; + long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -36483,17 +34601,17 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); - if (unlikely(!v)) return (int) -1; + if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) - return (int) 0; + return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (int) -1; + return (long) -1; is_negative = result == 1; } #endif @@ -36502,14 +34620,14 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) - return (int) -1; + return (long) -1; } else { stepval = __Pyx_NewRef(v); } - val = (int) 0; + val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; @@ -36519,7 +34637,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; - val |= ((int) idigit) << bits; + val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; @@ -36527,15 +34645,15 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; - val |= ((int) idigit) << bits; + val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { - if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; @@ -36550,25 +34668,41 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { if (likely(!ret)) return val; } - return (int) -1; + return (long) -1; } } else { - int val; + long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; + "value too large to convert to long"); + return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; + "can't convert negative value to long"); + return (long) -1; +} + +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__19); + } + return name; } +#endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON diff --git a/w3lib/_url.pyx b/w3lib/_url.pyx index b6773592..5c25fe95 100644 --- a/w3lib/_url.pyx +++ b/w3lib/_url.pyx @@ -7,6 +7,7 @@ from math import floor from typing import AnyStr, Callable, Dict, List, Optional, Tuple, Union from urllib.parse import unquote +import cython from cython import bint, cfunc, declare, uchar from . import _utr46 @@ -493,21 +494,23 @@ SCHEME = declare(uchar, 1) NO_SCHEME = declare(uchar, 2) SPECIAL_RELATIVE_OR_AUTHORITY = declare(uchar, 3) PATH_OR_AUTHORITY = declare(uchar, 4) -RELATIVE = declare(uchar, 5) -RELATIVE_SLASH = declare(uchar, 6) -SPECIAL_AUTHORITY_SLASHES = declare(uchar, 7) -SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 8) -AUTHORITY = declare(uchar, 9) -HOST = declare(uchar, 10) -PORT = declare(uchar, 11) -FILE = declare(uchar, 12) -FILE_SLASH = declare(uchar, 13) -FILE_HOST = declare(uchar, 14) -PATH_START = declare(uchar, 15) -PATH = declare(uchar, 16) -OPAQUE_PATH = declare(uchar, 17) -QUERY = declare(uchar, 18) -FRAGMENT = declare(uchar, 19) +SPECIAL_AUTHORITY_SLASHES = declare(uchar, 5) +SPECIAL_AUTHORITY_IGNORE_SLASHES = declare(uchar, 6) +AUTHORITY = declare(uchar, 7) +HOST = declare(uchar, 8) +PORT = declare(uchar, 9) +FILE = declare(uchar, 10) +FILE_SLASH = declare(uchar, 11) +FILE_HOST = declare(uchar, 12) +PATH_START = declare(uchar, 13) +PATH = declare(uchar, 14) +OPAQUE_PATH = declare(uchar, 15) +QUERY = declare(uchar, 16) +FRAGMENT = declare(uchar, 17) + +HOSTNAME = declare(uchar, 0) +IPV4 = declare(uchar, 1) +IPV6 = declare(uchar, 2) # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#default-port @@ -523,50 +526,42 @@ _SPECIAL_SCHEMES = set(_DEFAULT_PORTS.keys()) class _URL: - _scheme: str = "" - username: str = "" - password: str = "" - hostname: Union[int, List[int], str] = "" - port: Optional[int] = None - path: Union[str, List[str]] - query: Optional[str] = None - fragment: Optional[str] = None - - # Indicates whether a color (:) separating a username from a password - # existed in the parsed URL. This enables :func:`_serialize_url` to - # generate a URL that matches the input URL, if desired. - _password_token_seen: bool = False - - # Indicates, for an empty port component, whether or not a colon (:) - # character was used. This enables :func:`_serialize_url` to - # generate a URL that matches the input URL, if desired. - _port_token_seen: bool = False - - # Indicates whether or not a default port was specified in the input URL. - # This enables :func:`_serialize_url` to generate a URL that matches the - # input URL, if desired. - _default_port_seen: bool = False - - # Indicates, for an empty path component, whether or not a slash (/) - # character was used. This enables :func:`_serialize_url` to - # generate a URL that matches the input URL, if desired. - _path_token_seen: bool = False - - def __init__(self) -> None: + scheme: str + username: str + password: str + _password_token_seen: bool + _host_type: uchar + hostname: str + ipv4: cython.int + ipv6: cython.int[8] + port: cython.int + _port_token_seen: bool + path: List[str] + _path_token_seen: bool + opaque_path: str + query: str + _query_token_seen: bool + fragment: str + _fragment_token_seen: bool + + def __init__(self): + self.scheme = "" + self.username = "" + self.password = "" + self._password_token_seen = False + self._host_type = HOSTNAME + self.hostname = "" + self.ipv4 = -1 + self.ipv6 = [0, 0, 0, 0, 0, 0, 0, 0] + self.port = -1 + self._port_token_seen = False self.path = [] - self.is_special = False - - def has_opaque_path(self) -> bool: - return isinstance(self.path, str) - - @property - def scheme(self) -> str: - return self._scheme - - @scheme.setter - def scheme(self, value: str) -> None: - self._scheme = value - self.is_special = value in _SPECIAL_SCHEMES + self._path_token_seen = False + self.opaque_path = "" + self.query = "" + self._query_token_seen = False + self.fragment = "" + self._fragment_token_seen = False _SCHEME_CHARS = _ASCII_ALPHANUMERIC + "+-." @@ -873,23 +868,30 @@ def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser def _parse_host( input: str, - *, - is_special: bool = True, -) -> Union[str, int, List[int]]: + url: _URL, +) -> _URL: if input.startswith("["): if not input.endswith("]"): raise ValueError - return _parse_ipv6(input[1:-1]) - if not is_special: - return _parse_opaque_host(input) + url.ipv6 = _parse_ipv6(input[1:-1]) + url._host_type = IPV6 + return url + if url.scheme not in _SPECIAL_SCHEMES: + url.hostname = _parse_opaque_host(input) + url._host_type = HOSTNAME + return url domain = unquote(input) ascii_domain = _domain_to_ascii(domain) for code_point in ascii_domain: if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: raise ValueError if _ends_in_number(ascii_domain): - return _parse_ipv4(ascii_domain) - return ascii_domain + url.ipv4 = _parse_ipv4(ascii_domain) + url._host_type = IPV4 + return url + url.hostname = ascii_domain + url._host_type = HOSTNAME + return url # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter @@ -955,27 +957,13 @@ def _preprocess_url(url: str) -> str: def _parse_url( input: str, - *, - base_url: str = None, encoding: str = "utf-8", - userinfo_percent_encode_set: _PercentEncodeSet = _USERINFO_PERCENT_ENCODE_SET, - path_percent_encode_set: _PercentEncodeSet = _PATH_PERCENT_ENCODE_SET, - query_percent_encode_set: _PercentEncodeSet = _QUERY_PERCENT_ENCODE_SET, - special_query_percent_encode_set: _PercentEncodeSet = _SPECIAL_QUERY_PERCENT_ENCODE_SET, - fragment_percent_encode_set: _PercentEncodeSet = _FRAGMENT_PERCENT_ENCODE_SET, ) -> _URL: - """Return a :class:`_URL` object built from *url*, *base_url* and - *encoding*, following the URL parsing algorithm defined in the `URL living - standard`_. + """Return a :class:`_URL` object built from *url* and *encoding*, following + the URL parsing algorithm defined in the `URL living standard`_, with + additional logic to support older standards as well. .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing - - Additional parameters allow to deviate from the standard for specific use - cases: - - - *userinfo_percent_encode_set* allows customizing which characters found - in the user authroization part of the input URL need to be - percent-encoded. """ # Additional deviations from the standard are implemented but not covered @@ -988,14 +976,10 @@ def _parse_url( # from the parsed URL (e.g. ``a://a@example.com``) and when it was # explicitly an empty string (e.g. ``a://a:@example.com``), so that its # output can match the original parsed URL if desired. - - if base_url is not None: - base = _parse_url(base_url, encoding=encoding) - else: - base = None encoding = _get_output_encoding(encoding) url = _URL() + url.path = [] state = SCHEME_START buffer = "" at_sign_seen = inside_brackets = skip_authority_shortcut = False @@ -1025,16 +1009,13 @@ def _parse_url( buffer = "" if url.scheme == "file": state = FILE - elif url.is_special: - if base is not None and base.scheme == url.scheme: - state = SPECIAL_RELATIVE_OR_AUTHORITY - else: - state = SPECIAL_AUTHORITY_SLASHES + elif url.scheme in _SPECIAL_SCHEMES: + state = SPECIAL_AUTHORITY_SLASHES elif pointer + 1 < len(input) and input[pointer + 1] == "/": state = PATH_OR_AUTHORITY pointer += 1 else: - url.path = "" + url.opaque_path = "" state = OPAQUE_PATH else: buffer = "" @@ -1042,30 +1023,14 @@ def _parse_url( pointer = -1 elif state == NO_SCHEME: - if base is None: - raise ValueError - if base.has_opaque_path(): - if not reached_end and c != "#": - raise ValueError - url.scheme = base.scheme - url.path = base.path - url.query = base.query - url.fragment = "" - state = FRAGMENT - else: - if base.scheme != "file": - state = RELATIVE - else: - state = FILE - pointer -= 1 + raise ValueError("No URL scheme") elif state == SPECIAL_RELATIVE_OR_AUTHORITY: if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": state = SPECIAL_AUTHORITY_IGNORE_SLASHES pointer += 1 else: - state = RELATIVE - pointer -= 1 + raise ValueError("URL is relative") elif state == PATH_OR_AUTHORITY: if not reached_end and c == "/": @@ -1074,42 +1039,6 @@ def _parse_url( state = PATH pointer -= 1 - elif state == RELATIVE: - url.scheme = base.scheme - if not reached_end and (c == "/" or url.is_special and c == "\\"): - state = RELATIVE_SLASH - else: - url.username = base.username - url.password = base.password - url.hostname = base.hostname - url.port = base.port - url.path = base.path - url.query = base.query - if not reached_end and c == "?": - url.query = "" - state = QUERY - elif not reached_end and c == "#": - url.fragment = "" - state = FRAGMENT - elif not reached_end: - url.query = None - _shorten_path(url) - state = PATH - pointer -= 1 - - elif state == RELATIVE_SLASH: - if url.is_special and not reached_end and c in "/\\": - state = SPECIAL_AUTHORITY_IGNORE_SLASHES - elif not reached_end and c == "/": - state = AUTHORITY - else: - url.username = base.username - url.password = base.password - url.hostname = base.hostname - url.port = base.port - state = PATH - pointer -= 1 - elif state == SPECIAL_AUTHORITY_SLASHES: if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": state = SPECIAL_AUTHORITY_IGNORE_SLASHES @@ -1142,14 +1071,14 @@ def _parse_url( encoded_code_points = _idempotent_utf_8_percent_encode( input=buffer, pointer=i, - encode_set=userinfo_percent_encode_set, + encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, ) if url._password_token_seen: url.password += encoded_code_points else: url.username += encoded_code_points buffer = "" - elif reached_end or c in "/?#" or url.is_special and c == "\\": + elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": if at_sign_seen and not buffer: raise ValueError pointer -= len(buffer) + 1 @@ -1162,17 +1091,15 @@ def _parse_url( if not reached_end and c == ":" and not inside_brackets: if not buffer: raise ValueError - host = _parse_host(buffer, is_special=url.is_special) - url.hostname = host + url = _parse_host(buffer, url) buffer = "" state = PORT url._port_token_seen = True - elif reached_end or c in "/?#" or url.is_special and c == "\\": + elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": pointer -= 1 - if url.is_special and not buffer: + if url.scheme in _SPECIAL_SCHEMES and not buffer: raise ValueError - host = _parse_host(buffer, is_special=url.is_special) - url.hostname = host + url = _parse_host(buffer, url) buffer = "" state = PATH_START elif not reached_end: @@ -1185,13 +1112,12 @@ def _parse_url( elif state == PORT: if not reached_end and c in _ASCII_DIGIT: buffer += c - elif reached_end or c in "/?#" or url.is_special and c == "\\": + elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": if buffer: - port = int(buffer) + port: cython.int = int(buffer) if port > 2**16 - 1: - raise ValueError - url.port = None if _DEFAULT_PORTS.get(url.scheme) == port else port - url._default_port_seen = url.port is None + raise ValueError(f"Port {port} is too high.") + url.port = port buffer = "" state = PATH_START pointer -= 1 @@ -1203,24 +1129,6 @@ def _parse_url( url.hostname = "" if not reached_end and c in "/\\": state = FILE_SLASH - elif base is not None and base.scheme == "file": - url.hostname = base.hostname - url.path = base.path - url.query = base.query - if not reached_end and c == "?": - url.query = "" - state = QUERY - elif not reached_end and c == "#": - url.fragment = "" - state = FRAGMENT - elif not reached_end: - url.query = None - if not _starts_with_windows_drive_letter(input[pointer:]): - _shorten_path(url) - else: - url.path = [] - state = PATH - pointer -= 1 else: state = PATH pointer -= 1 @@ -1229,12 +1137,6 @@ def _parse_url( if not reached_end and c in "/\\": state = FILE_HOST else: - if base is not None and base.scheme == "file": - url.hostname = base.hostname - if not _starts_with_windows_drive_letter( - input[pointer:] - ) and _is_windows_drive_letter(base.path[0]): - url.path.append(base.path[0]) state = PATH pointer -= 1 @@ -1247,26 +1149,25 @@ def _parse_url( url.hostname = "" state = PATH_START else: - host = _parse_host(buffer, is_special=url.is_special) - if host == "localhost": - host = "" - url.hostname = host + url = _parse_host(buffer, url) + if url.hostname == "localhost": + url.hostname = "" buffer = "" state = PATH_START elif not reached_end: buffer += c elif state == PATH_START: - if url.is_special: + if url.scheme in _SPECIAL_SCHEMES: state = PATH if not reached_end and c not in "/\\": pointer -= 1 elif not reached_end: if c == "?": - url.query = "" + url._query_token_seen = True state = QUERY elif c == "#": - url.fragment = "" + url._fragment_token_seen = True state = FRAGMENT else: state = PATH @@ -1274,13 +1175,13 @@ def _parse_url( pointer -= 1 elif state == PATH: - if reached_end or c == "/" or (url.is_special and c == "\\") or c in "?#": + if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": if _is_double_dot_path_segment(buffer): _shorten_path(url) - if c != "/" and not (url.is_special and c == "\\"): + if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): url.path.append("") elif _is_single_dot_path_segment(buffer): - if c != "/" and not (url.is_special and c == "\\"): + if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): url.path.append("") else: if ( @@ -1301,43 +1202,43 @@ def _parse_url( buffer = "" if not reached_end: if c == "?": - url.query = "" + url._query_token_seen = True state = QUERY elif c == "#": - url.fragment = "" + url._fragment_token_seen = True state = FRAGMENT else: buffer += _idempotent_utf_8_percent_encode( input=input, pointer=pointer, - encode_set=path_percent_encode_set, + encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, ) elif state == OPAQUE_PATH: if not reached_end: if c == "?": - url.query = "" + url._query_token_seen = True state = QUERY elif c == "#": - url.fragment = "" + url._fragment_token_seen = True state = FRAGMENT else: encoded = _utf_8_percent_encode( c, _C0_CONTROL_PERCENT_ENCODE_SET, ) - url.path += encoded + url.opaque_path += encoded elif state == QUERY: if encoding != "utf-8" and ( - not url.is_special or url.scheme in ("ws", "wss") + not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") ): encoding = "utf-8" if reached_end or c == "#": percent_encode_set = ( - special_query_percent_encode_set - if url.is_special - else query_percent_encode_set + _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET + if url.scheme in _SPECIAL_SCHEMES + else _SAFE_QUERY_PERCENT_ENCODE_SET ) url.query += _percent_encode_after_encoding( buffer, @@ -1346,7 +1247,7 @@ def _parse_url( ) buffer = "" if not reached_end and c == "#": - url.fragment = "" + url._fragment_token_seen = True state = FRAGMENT elif not reached_end: buffer += c @@ -1354,7 +1255,7 @@ def _parse_url( elif state == FRAGMENT: if not reached_end: url.fragment += _idempotent_utf_8_percent_encode( - input=input, pointer=pointer, encode_set=fragment_percent_encode_set + input=input, pointer=pointer, encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET ) if pointer >= input_length: @@ -1415,20 +1316,20 @@ def _serialize_ipv6(address: List[int]) -> str: # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer -def _serialize_host(host: Union[str, int, List[int]]) -> str: - if isinstance(host, int): - return _serialize_ipv4(host) - if isinstance(host, list): - return f"[{_serialize_ipv6(host)}]" - return host +def _serialize_host(url: _URL) -> str: + if url._host_type == IPV4: + return _serialize_ipv4(url.ipv4) + if url._host_type == IPV6: + return f"[{_serialize_ipv6(url.ipv6)}]" + return url.hostname # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer -def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: - if url.has_opaque_path(): +def _serialize_url_path(url: _URL) -> str: + if url.opaque_path: assert isinstance(url.path, str) return url.path - if len(url.path) <= 1 and url._path_token_seen and not canonicalize: + if len(url.path) <= 1 and url._path_token_seen: return "" output = "" for segment in url.path: @@ -1437,80 +1338,41 @@ def _serialize_url_path(url: _URL, *, canonicalize: bool = None) -> str: # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing -def _serialize_url( - url: _URL, - *, - exclude_fragment: bool = False, - canonicalize: Optional[bool] = None, -) -> str: +def _serialize_url(url: _URL) -> str: """Return a string representation of *url* following the URL serialization algorithm defined in the `URL living standard`_. .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer - - If *exclude_fragment* is ``True``, the returned URL does not include - :attr:`_URL.fragment`. - - Additional parameters allow to deviate from the standard for specific use - cases: - - - *canonicalize*: - - - ``None``: Do not deviate from the standard algorithm to apply or - prevent URL canonicalization. - - - ``True``: Deviate from the standard as needed to make sure that - functionally-equivalent URLs are always rendered the same way. - - This value has no effect at the moment, i.e. it applies the same - level of canonicalization as the standard algorithm. - - - ``False``: Deviate from the standard as needed to make sure that - the returned URL string is as close as possible to the original URL - string that was parsed into *url*, as long as the returned URL - string is still a valid URL. - - At the moment, this ensures that the password separator (:) is - included into the returned URL string as long as it was present on - the original URL string, even if :attr:`_URL.password` is an empty - string. """ output = url.scheme + ":" - if url.hostname is not None: + if url.hostname or url._host_type != HOSTNAME: output += "//" if url.username or url.password: output += url.username if url.password: output += f":{url.password}" - elif not canonicalize and url._password_token_seen: + elif url._password_token_seen: output += ":" output += "@" - output += _serialize_host(url.hostname) - if url.port is not None: + output += _serialize_host(url) + if url.port > -1: output += f":{url.port}" - elif not canonicalize: - if url._default_port_seen: - output += f":{_DEFAULT_PORTS[url.scheme]}" - elif url._port_token_seen: - output += ":" - elif not url.has_opaque_path() and len(url.path) > 1 and not url.path[0]: + elif url._port_token_seen: + output += ":" + elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: output += "/." - output += _serialize_url_path(url, canonicalize=canonicalize) - if url.query is not None: + output += _serialize_url_path(url) + if url.query: output += f"?{url.query}" - if not exclude_fragment and url.fragment is not None: + elif url._query_token_seen: + output += "?" + if url.fragment: output += f"#{url.fragment}" + elif url._fragment_token_seen: + output += "#" return output def _safe_url(input: str, encoding: str) -> str: - url = _parse_url( - input, - encoding=encoding, - userinfo_percent_encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, - path_percent_encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, - query_percent_encode_set=_SAFE_QUERY_PERCENT_ENCODE_SET, - special_query_percent_encode_set=_SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET, - fragment_percent_encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET, - ) - return _serialize_url(url, canonicalize=False) + url = _parse_url(input, encoding) + return _serialize_url(url) diff --git a/w3lib/_util.c b/w3lib/_util.c index 1f9b3750..61401780 100644 --- a/w3lib/_util.c +++ b/w3lib/_util.c @@ -1733,244 +1733,6 @@ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); -/* Profile.proto */ -#ifndef CYTHON_PROFILE -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - #define CYTHON_PROFILE 0 -#else - #define CYTHON_PROFILE 1 -#endif -#endif -#ifndef CYTHON_TRACE_NOGIL - #define CYTHON_TRACE_NOGIL 0 -#else - #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) - #define CYTHON_TRACE 1 - #endif -#endif -#ifndef CYTHON_TRACE - #define CYTHON_TRACE 0 -#endif -#if CYTHON_TRACE - #undef CYTHON_PROFILE_REUSE_FRAME -#endif -#ifndef CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_PROFILE_REUSE_FRAME 0 -#endif -#if CYTHON_PROFILE || CYTHON_TRACE - #include "compile.h" - #include "frameobject.h" - #include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #if CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_FRAME_MODIFIER static - #define CYTHON_FRAME_DEL(frame) - #else - #define CYTHON_FRAME_MODIFIER - #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) - #endif - #define __Pyx_TraceDeclarations\ - static PyCodeObject *__pyx_frame_code = NULL;\ - CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ - int __Pyx_use_tracing = 0; - #define __Pyx_TraceFrameInit(codeobj)\ - if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; -#if PY_VERSION_HEX >= 0x030b00a2 - #if PY_VERSION_HEX >= 0x030C00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - ((!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #endif - #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) - #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) -#elif PY_VERSION_HEX >= 0x030a00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#endif - #ifdef WITH_THREAD - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - }\ - PyGILState_Release(state);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #else - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - { PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #endif - #define __Pyx_TraceException()\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 1)) {\ - __Pyx_EnterTracing(tstate);\ - PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ - if (exc_info) {\ - if (CYTHON_TRACE && tstate->c_tracefunc)\ - tstate->c_tracefunc(\ - tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - tstate->c_profilefunc(\ - tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - Py_DECREF(exc_info);\ - }\ - __Pyx_LeaveTracing(tstate);\ - }\ - } - static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_EnterTracing(tstate); - if (CYTHON_TRACE && tstate->c_tracefunc) - tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); - if (tstate->c_profilefunc) - tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); - CYTHON_FRAME_DEL(frame); - __Pyx_LeaveTracing(tstate); - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } - #ifdef WITH_THREAD - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - PyGILState_Release(state);\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - }\ - } - #else - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - } - #endif - static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); - static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); -#else - #define __Pyx_TraceDeclarations - #define __Pyx_TraceFrameInit(codeobj) - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; - #define __Pyx_TraceException() - #define __Pyx_TraceReturn(result, nogil) -#endif -#if CYTHON_TRACE - static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { - int ret; - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_PyFrame_SetLineNumber(frame, lineno); - __Pyx_EnterTracing(tstate); - ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); - __Pyx_LeaveTracing(tstate); - if (likely(!ret)) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - } - return ret; - } - #ifdef WITH_THREAD - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - int ret = 0;\ - PyThreadState *tstate;\ - PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - }\ - __Pyx_PyGILState_Release(state);\ - if (unlikely(ret)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - }\ - } - #else - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - } - #endif -#else - #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; -#endif - /* RaiseUnboundLocalError.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); @@ -2575,13 +2337,13 @@ static PyObject *__pyx_builtin_chr; static PyObject *__pyx_builtin_sorted; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = ""; -static const char __pyx_k__3[] = ""; +static const char __pyx_k__2[] = ""; +static const char __pyx_k__3[] = ")"; +static const char __pyx_k__4[] = "."; static const char __pyx_k_cp[] = "cp"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_gt[] = "gt"; static const char __pyx_k_or[] = "__or__"; -static const char __pyx_k__10[] = ")"; -static const char __pyx_k__11[] = "."; static const char __pyx_k__18[] = "?"; static const char __pyx_k_add[] = "__add__"; static const char __pyx_k_and[] = "__and__"; @@ -2708,10 +2470,10 @@ typedef struct { PyObject *__pyx_kp_s_Set_of_code_points_that_require; PyObject *__pyx_n_s_Union; PyObject *__pyx_kp_s_Union_int_str; - PyObject *__pyx_kp_u__10; - PyObject *__pyx_kp_u__11; PyObject *__pyx_n_s__18; + PyObject *__pyx_kp_u__2; PyObject *__pyx_kp_u__3; + PyObject *__pyx_kp_u__4; PyObject *__pyx_n_s_add; PyObject *__pyx_n_s_and; PyObject *__pyx_n_s_args; @@ -2769,19 +2531,19 @@ typedef struct { PyObject *__pyx_n_s_w3lib__util; PyObject *__pyx_kp_s_w3lib__util_pyx; PyObject *__pyx_int_1; - PyObject *__pyx_tuple__12; + PyObject *__pyx_tuple__5; + PyObject *__pyx_tuple__7; + PyObject *__pyx_tuple__9; + PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__13; - PyObject *__pyx_tuple__14; - PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__16; - PyObject *__pyx_tuple__17; - PyObject *__pyx_codeobj__2; - PyObject *__pyx_codeobj__4; - PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__6; - PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__8; - PyObject *__pyx_codeobj__9; + PyObject *__pyx_codeobj__10; + PyObject *__pyx_codeobj__12; + PyObject *__pyx_codeobj__14; + PyObject *__pyx_codeobj__15; + PyObject *__pyx_codeobj__17; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -2843,10 +2605,10 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_s_Set_of_code_points_that_require); Py_CLEAR(clear_module_state->__pyx_n_s_Union); Py_CLEAR(clear_module_state->__pyx_kp_s_Union_int_str); - Py_CLEAR(clear_module_state->__pyx_kp_u__10); - Py_CLEAR(clear_module_state->__pyx_kp_u__11); Py_CLEAR(clear_module_state->__pyx_n_s__18); + Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_kp_u__3); + Py_CLEAR(clear_module_state->__pyx_kp_u__4); Py_CLEAR(clear_module_state->__pyx_n_s_add); Py_CLEAR(clear_module_state->__pyx_n_s_and); Py_CLEAR(clear_module_state->__pyx_n_s_args); @@ -2904,19 +2666,19 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_w3lib__util); Py_CLEAR(clear_module_state->__pyx_kp_s_w3lib__util_pyx); Py_CLEAR(clear_module_state->__pyx_int_1); - Py_CLEAR(clear_module_state->__pyx_tuple__12); + Py_CLEAR(clear_module_state->__pyx_tuple__5); + Py_CLEAR(clear_module_state->__pyx_tuple__7); + Py_CLEAR(clear_module_state->__pyx_tuple__9); + Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__13); - Py_CLEAR(clear_module_state->__pyx_tuple__14); - Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__16); - Py_CLEAR(clear_module_state->__pyx_tuple__17); - Py_CLEAR(clear_module_state->__pyx_codeobj__2); - Py_CLEAR(clear_module_state->__pyx_codeobj__4); - Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__6); - Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__8); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); + Py_CLEAR(clear_module_state->__pyx_codeobj__10); + Py_CLEAR(clear_module_state->__pyx_codeobj__12); + Py_CLEAR(clear_module_state->__pyx_codeobj__14); + Py_CLEAR(clear_module_state->__pyx_codeobj__15); + Py_CLEAR(clear_module_state->__pyx_codeobj__17); return 0; } #endif @@ -2956,10 +2718,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_s_Set_of_code_points_that_require); Py_VISIT(traverse_module_state->__pyx_n_s_Union); Py_VISIT(traverse_module_state->__pyx_kp_s_Union_int_str); - Py_VISIT(traverse_module_state->__pyx_kp_u__10); - Py_VISIT(traverse_module_state->__pyx_kp_u__11); Py_VISIT(traverse_module_state->__pyx_n_s__18); + Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_kp_u__3); + Py_VISIT(traverse_module_state->__pyx_kp_u__4); Py_VISIT(traverse_module_state->__pyx_n_s_add); Py_VISIT(traverse_module_state->__pyx_n_s_and); Py_VISIT(traverse_module_state->__pyx_n_s_args); @@ -3017,19 +2779,19 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_w3lib__util); Py_VISIT(traverse_module_state->__pyx_kp_s_w3lib__util_pyx); Py_VISIT(traverse_module_state->__pyx_int_1); - Py_VISIT(traverse_module_state->__pyx_tuple__12); + Py_VISIT(traverse_module_state->__pyx_tuple__5); + Py_VISIT(traverse_module_state->__pyx_tuple__7); + Py_VISIT(traverse_module_state->__pyx_tuple__9); + Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__13); - Py_VISIT(traverse_module_state->__pyx_tuple__14); - Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__16); - Py_VISIT(traverse_module_state->__pyx_tuple__17); - Py_VISIT(traverse_module_state->__pyx_codeobj__2); - Py_VISIT(traverse_module_state->__pyx_codeobj__4); - Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__6); - Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__8); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); + Py_VISIT(traverse_module_state->__pyx_codeobj__10); + Py_VISIT(traverse_module_state->__pyx_codeobj__12); + Py_VISIT(traverse_module_state->__pyx_codeobj__14); + Py_VISIT(traverse_module_state->__pyx_codeobj__15); + Py_VISIT(traverse_module_state->__pyx_codeobj__17); return 0; } #endif @@ -3079,10 +2841,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_s_Set_of_code_points_that_require __pyx_mstate_global->__pyx_kp_s_Set_of_code_points_that_require #define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union #define __pyx_kp_s_Union_int_str __pyx_mstate_global->__pyx_kp_s_Union_int_str -#define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10 -#define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11 #define __pyx_n_s__18 __pyx_mstate_global->__pyx_n_s__18 +#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 +#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 #define __pyx_n_s_add __pyx_mstate_global->__pyx_n_s_add #define __pyx_n_s_and __pyx_mstate_global->__pyx_n_s_and #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args @@ -3140,19 +2902,19 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_w3lib__util __pyx_mstate_global->__pyx_n_s_w3lib__util #define __pyx_kp_s_w3lib__util_pyx __pyx_mstate_global->__pyx_kp_s_w3lib__util_pyx #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 -#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 +#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 +#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 +#define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 +#define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 -#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 -#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 -#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 -#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 -#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 -#define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 -#define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 +#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 +#define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 +#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 +#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 +#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 /* #### Code section: module_code ### */ /* "w3lib/_util.pyx":18 @@ -3361,7 +3123,6 @@ static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator { struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); @@ -3372,11 +3133,9 @@ static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); - __Pyx_TraceCall("genexpr", __pyx_f[0], 30, 0, __PYX_ERR(0, 30, __pyx_L1_error)); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ - __Pyx_TraceReturn(Py_None, 0); __Pyx_RefNannyFinishContext(); return NULL; } @@ -3523,7 +3282,6 @@ static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3540,7 +3298,6 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ *__pyx_cur_scope; PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator = 0; PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations int __pyx_t_1; long __pyx_t_2; @@ -3549,7 +3306,6 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__2) __Pyx_RefNannySetupContext("__init__", 0); __pyx_cur_scope = (struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ *)__pyx_tp_new_5w3lib_5_util___pyx_scope_struct____init__(__pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { @@ -3559,7 +3315,6 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __Pyx_TraceCall("__init__", __pyx_f[0], 18, 0, __PYX_ERR(0, 18, __pyx_L1_error)); __pyx_cur_scope->__pyx_v_code_points = __pyx_v_code_points; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_code_points); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_code_points); @@ -3653,7 +3408,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__3, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_code_points); @@ -3700,7 +3455,6 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS __Pyx_XDECREF(__pyx_v_greater_than); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3831,7 +3585,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_point) { PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -3842,9 +3595,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(CYTHON int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__4) __Pyx_RefNannySetupContext("__contains__", 1); - __Pyx_TraceCall("__contains__", __pyx_f[0], 36, 0, __PYX_ERR(0, 36, __pyx_L1_error)); /* "w3lib/_util.pyx":37 * @@ -3900,7 +3651,6 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(CYTHON __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4031,7 +3781,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_points) { PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -4040,9 +3789,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(CYTHON_UNUS int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__5) __Pyx_RefNannySetupContext("__add__", 1); - __Pyx_TraceCall("__add__", __pyx_f[0], 39, 0, __PYX_ERR(0, 39, __pyx_L1_error)); /* "w3lib/_util.pyx":40 * @@ -4129,7 +3876,6 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(CYTHON_UNUS __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4262,7 +4008,6 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS PyObject *__pyx_v_new_code_points = NULL; Py_UCS4 __pyx_v_code_point; PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -4278,9 +4023,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__6) __Pyx_RefNannySetupContext("__sub__", 1); - __Pyx_TraceCall("__sub__", __pyx_f[0], 45, 0, __PYX_ERR(0, 45, __pyx_L1_error)); /* "w3lib/_util.pyx":46 * @@ -4334,7 +4077,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_10, __pyx_kp_u__3}; + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_10, __pyx_kp_u__2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -4421,7 +4164,6 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS __pyx_L0:; __Pyx_XDECREF(__pyx_v_new_code_points); __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4549,7 +4291,6 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSE PyObject *__pyx_v_greater_than = NULL; PyObject *__pyx_v_code_points = NULL; PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -4559,9 +4300,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSE int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__7) __Pyx_RefNannySetupContext("__or__", 1); - __Pyx_TraceCall("__or__", __pyx_f[0], 54, 0, __PYX_ERR(0, 54, __pyx_L1_error)); /* "w3lib/_util.pyx":55 * @@ -4613,7 +4352,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSE __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_code_points = ((PyObject*)__pyx_t_2); @@ -4690,7 +4429,6 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSE __Pyx_XDECREF(__pyx_v_greater_than); __Pyx_XDECREF(__pyx_v_code_points); __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4818,7 +4556,6 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNU PyObject *__pyx_v_greater_than = NULL; PyObject *__pyx_v_code_points = NULL; PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -4828,9 +4565,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNU int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__8) __Pyx_RefNannySetupContext("__and__", 1); - __Pyx_TraceCall("__and__", __pyx_f[0], 62, 0, __PYX_ERR(0, 62, __pyx_L1_error)); /* "w3lib/_util.pyx":63 * @@ -4882,7 +4617,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNU __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_code_points = ((PyObject*)__pyx_t_2); @@ -4959,7 +4694,6 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNU __Pyx_XDECREF(__pyx_v_greater_than); __Pyx_XDECREF(__pyx_v_code_points); __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5072,7 +4806,6 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UN PyObject *__pyx_v_cp = NULL; PyObject *__pyx_v_gt = NULL; PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -5082,9 +4815,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UN int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__9) __Pyx_RefNannySetupContext("__repr__", 1); - __Pyx_TraceCall("__repr__", __pyx_f[0], 70, 0, __PYX_ERR(0, 70, __pyx_L1_error)); /* "w3lib/_util.pyx":71 * @@ -5113,7 +4844,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UN __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__3, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_cp = ((PyObject*)__pyx_t_2); @@ -5165,10 +4896,10 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UN __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2); __pyx_t_2 = 0; - __Pyx_INCREF(__pyx_kp_u__10); + __Pyx_INCREF(__pyx_kp_u__3); __pyx_t_4 += 1; - __Pyx_GIVEREF(__pyx_kp_u__10); - PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__10); + __Pyx_GIVEREF(__pyx_kp_u__3); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__3); __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5195,7 +4926,6 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UN __Pyx_XDECREF(__pyx_v_cp); __Pyx_XDECREF(__pyx_v_gt); __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5545,10 +5275,10 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_s_Set_of_code_points_that_require, __pyx_k_Set_of_code_points_that_require, sizeof(__pyx_k_Set_of_code_points_that_require), 0, 0, 1, 0}, {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, {&__pyx_kp_s_Union_int_str, __pyx_k_Union_int_str, sizeof(__pyx_k_Union_int_str), 0, 0, 1, 0}, - {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0}, - {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, {&__pyx_n_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 1}, + {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, + {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, {&__pyx_n_s_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, @@ -5631,10 +5361,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * self, * code_points: str, */ - __pyx_tuple__12 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_code_points, __pyx_n_s_greater_than, __pyx_n_s_exclude, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_init, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_code_points, __pyx_n_s_greater_than, __pyx_n_s_exclude, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_init, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 18, __pyx_L1_error) /* "w3lib/_util.pyx":36 * self._code_points = code_points @@ -5643,10 +5373,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * return code_point in self._code_points or ord(code_point) > self._greater_than * */ - __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 36, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_contains, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_contains, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 36, __pyx_L1_error) /* "w3lib/_util.pyx":39 * return code_point in self._code_points or ord(code_point) > self._greater_than @@ -5655,10 +5385,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * return _PercentEncodeSet( * self._code_points + code_points, */ - __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_code_points); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_add, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_code_points); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_add, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 39, __pyx_L1_error) /* "w3lib/_util.pyx":45 * ) @@ -5667,10 +5397,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * new_code_points = self._code_points * for code_point in code_points: */ - __pyx_tuple__15 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_code_points, __pyx_n_s_new_code_points, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_sub, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_code_points, __pyx_n_s_new_code_points, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_sub, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 45, __pyx_L1_error) /* "w3lib/_util.pyx":54 * ) @@ -5679,10 +5409,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * greater_than = min(self._greater_than, other._greater_than) * code_points = "".join(set(self._code_points) | set(other._code_points)) */ - __pyx_tuple__16 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_greater_than, __pyx_n_s_code_points); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_or, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_greater_than, __pyx_n_s_code_points); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_or, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 54, __pyx_L1_error) /* "w3lib/_util.pyx":62 * ) @@ -5691,7 +5421,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * greater_than = max(self._greater_than, other._greater_than) * code_points = "".join(set(self._code_points) & set(other._code_points)) */ - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_and, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_and, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 62, __pyx_L1_error) /* "w3lib/_util.pyx":70 * ) @@ -5700,10 +5430,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cp = "".join(sorted(tuple(self._code_points), key=ord)) * gt = chr(self._greater_than) */ - __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_cp, __pyx_n_s_gt); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 70, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_repr, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_cp, __pyx_n_s_gt); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_repr, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -5995,7 +5725,6 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__util(PyObject *__pyx_pyinit_modul #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif - __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -6115,7 +5844,6 @@ if (!__Pyx_RefNanny) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__util(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); /* "w3lib/_util.pyx":1 * from typing import Union # <<<<<<<<<<<<<< @@ -6162,7 +5890,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 18, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_greater_than, __pyx_kp_s_Union_int_str) < 0) __PYX_ERR(0, 18, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_exclude, __pyx_n_s_bool) < 0) __PYX_ERR(0, 18, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_1__init__, 0, __pyx_n_s_PercentEncodeSet___init, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_1__init__, 0, __pyx_n_s_PercentEncodeSet___init, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_5, __pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); @@ -6182,7 +5910,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_code_point, __pyx_n_s_str) < 0) __PYX_ERR(0, 36, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_3__contains__, 0, __pyx_n_s_PercentEncodeSet___contains, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_3__contains__, 0, __pyx_n_s_PercentEncodeSet___contains, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -6200,7 +5928,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 39, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 39, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_5__add__, 0, __pyx_n_s_PercentEncodeSet___add, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_5__add__, 0, __pyx_n_s_PercentEncodeSet___add, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -6218,7 +5946,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 45, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_7__sub__, 0, __pyx_n_s_PercentEncodeSet___sub, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_7__sub__, 0, __pyx_n_s_PercentEncodeSet___sub, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -6236,7 +5964,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_other, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_9__or__, 0, __pyx_n_s_PercentEncodeSet___or, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_9__or__, 0, __pyx_n_s_PercentEncodeSet___or, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -6254,7 +5982,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_other, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_11__and__, 0, __pyx_n_s_PercentEncodeSet___and, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_11__and__, 0, __pyx_n_s_PercentEncodeSet___and, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -6271,7 +5999,7 @@ if (!__Pyx_RefNanny) { __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 70, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_13__repr__, 0, __pyx_n_s_PercentEncodeSet___repr, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_13__repr__, 0, __pyx_n_s_PercentEncodeSet___repr, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -6300,7 +6028,6 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_TraceReturn(Py_None, 0); /*--- Wrapped vars code ---*/ @@ -6980,96 +6707,6 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam return 0; } -/* Profile */ -#if CYTHON_PROFILE -static int __Pyx_TraceSetupAndCall(PyCodeObject** code, - PyFrameObject** frame, - PyThreadState* tstate, - const char *funcname, - const char *srcfile, - int firstlineno) { - PyObject *type, *value, *traceback; - int retval; - if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { - if (*code == NULL) { - *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); - if (*code == NULL) return 0; - } - *frame = PyFrame_New( - tstate, /*PyThreadState *tstate*/ - *code, /*PyCodeObject *code*/ - __pyx_d, /*PyObject *globals*/ - 0 /*PyObject *locals*/ - ); - if (*frame == NULL) return 0; - if (CYTHON_TRACE && (*frame)->f_trace == NULL) { - Py_INCREF(Py_None); - (*frame)->f_trace = Py_None; - } -#if PY_VERSION_HEX < 0x030400B1 - } else { - (*frame)->f_tstate = tstate; -#endif - } - __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); - retval = 1; - __Pyx_EnterTracing(tstate); - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - #if CYTHON_TRACE - if (tstate->c_tracefunc) - retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; - if (retval && tstate->c_profilefunc) - #endif - retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; - __Pyx_LeaveTracing(tstate); - if (retval) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - return __Pyx_IsTracing(tstate, 0, 0) && retval; - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - return -1; - } -} -static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { - PyCodeObject *py_code = 0; -#if PY_MAJOR_VERSION >= 3 - py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); - if (likely(py_code)) { - py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; - } -#else - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - py_funcname = PyString_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - py_srcfile = PyString_FromString(srcfile); - if (unlikely(!py_srcfile)) goto bad; - py_code = PyCode_New( - 0, - 0, - 0, - CO_OPTIMIZED | CO_NEWLOCALS, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - firstlineno, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); -#endif - return py_code; -} -#endif - /* RaiseUnboundLocalError */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); @@ -8327,7 +7964,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__11); + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__4); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } diff --git a/w3lib/_utr46.c b/w3lib/_utr46.c index 5de800b9..012d5bce 100644 --- a/w3lib/_utr46.c +++ b/w3lib/_utr46.c @@ -1733,244 +1733,6 @@ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); -/* Profile.proto */ -#ifndef CYTHON_PROFILE -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - #define CYTHON_PROFILE 0 -#else - #define CYTHON_PROFILE 1 -#endif -#endif -#ifndef CYTHON_TRACE_NOGIL - #define CYTHON_TRACE_NOGIL 0 -#else - #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) - #define CYTHON_TRACE 1 - #endif -#endif -#ifndef CYTHON_TRACE - #define CYTHON_TRACE 0 -#endif -#if CYTHON_TRACE - #undef CYTHON_PROFILE_REUSE_FRAME -#endif -#ifndef CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_PROFILE_REUSE_FRAME 0 -#endif -#if CYTHON_PROFILE || CYTHON_TRACE - #include "compile.h" - #include "frameobject.h" - #include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #if CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_FRAME_MODIFIER static - #define CYTHON_FRAME_DEL(frame) - #else - #define CYTHON_FRAME_MODIFIER - #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) - #endif - #define __Pyx_TraceDeclarations\ - static PyCodeObject *__pyx_frame_code = NULL;\ - CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ - int __Pyx_use_tracing = 0; - #define __Pyx_TraceFrameInit(codeobj)\ - if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; -#if PY_VERSION_HEX >= 0x030b00a2 - #if PY_VERSION_HEX >= 0x030C00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - ((!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #endif - #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) - #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) -#elif PY_VERSION_HEX >= 0x030a00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#endif - #ifdef WITH_THREAD - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - }\ - PyGILState_Release(state);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #else - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - { PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #endif - #define __Pyx_TraceException()\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 1)) {\ - __Pyx_EnterTracing(tstate);\ - PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ - if (exc_info) {\ - if (CYTHON_TRACE && tstate->c_tracefunc)\ - tstate->c_tracefunc(\ - tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - tstate->c_profilefunc(\ - tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - Py_DECREF(exc_info);\ - }\ - __Pyx_LeaveTracing(tstate);\ - }\ - } - static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_EnterTracing(tstate); - if (CYTHON_TRACE && tstate->c_tracefunc) - tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); - if (tstate->c_profilefunc) - tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); - CYTHON_FRAME_DEL(frame); - __Pyx_LeaveTracing(tstate); - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } - #ifdef WITH_THREAD - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - PyGILState_Release(state);\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - }\ - } - #else - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - } - #endif - static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); - static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); -#else - #define __Pyx_TraceDeclarations - #define __Pyx_TraceFrameInit(codeobj) - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; - #define __Pyx_TraceException() - #define __Pyx_TraceReturn(result, nogil) -#endif -#if CYTHON_TRACE - static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { - int ret; - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_PyFrame_SetLineNumber(frame, lineno); - __Pyx_EnterTracing(tstate); - ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); - __Pyx_LeaveTracing(tstate); - if (likely(!ret)) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - } - return ret; - } - #ifdef WITH_THREAD - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - int ret = 0;\ - PyThreadState *tstate;\ - PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - }\ - __Pyx_PyGILState_Release(state);\ - if (unlikely(ret)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - }\ - } - #else - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - } - #endif -#else - #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; -#endif - /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) @@ -2799,14 +2561,19 @@ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_enumerate; /* #### Code section: string_decls ### */ +static const char __pyx_k_[] = ""; static const char __pyx_k_M[] = "M"; static const char __pyx_k_R[] = "R"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_AL[] = "AL"; static const char __pyx_k_AN[] = "AN"; -static const char __pyx_k__3[] = ""; -static const char __pyx_k__4[] = " "; -static const char __pyx_k__7[] = "#"; +static const char __pyx_k__2[] = " "; +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__9[] = ")."; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_is[] = " is "; @@ -2814,12 +2581,7 @@ static const char __pyx_k_re[] = "re"; static const char __pyx_k_xn[] = "xn--"; static const char __pyx_k_04X[] = "04X"; static const char __pyx_k_NFC[] = "NFC"; -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__14[] = ")."; -static const char __pyx_k__20[] = "*"; +static const char __pyx_k__11[] = "*"; static const char __pyx_k__30[] = "?"; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_cls[] = "cls"; @@ -3030,6 +2792,7 @@ typedef struct { #endif PyTypeObject *__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr; PyTypeObject *__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr; + PyObject *__pyx_kp_u_; PyObject *__pyx_kp_u_04X; PyObject *__pyx_n_u_AL; PyObject *__pyx_n_u_AN; @@ -3070,16 +2833,15 @@ typedef struct { PyObject *__pyx_kp_u_Unknown_IDNA_mapping_table_statu; PyObject *__pyx_n_s_VALID; PyObject *__pyx_n_s_ValueError; - PyObject *__pyx_kp_u__10; - PyObject *__pyx_kp_u__11; - PyObject *__pyx_kp_u__12; - PyObject *__pyx_kp_u__13; - PyObject *__pyx_kp_u__14; - PyObject *__pyx_n_s__20; + PyObject *__pyx_n_s__11; + PyObject *__pyx_kp_u__2; PyObject *__pyx_kp_u__3; PyObject *__pyx_n_s__30; - PyObject *__pyx_kp_u__4; + PyObject *__pyx_kp_u__5; + PyObject *__pyx_kp_u__6; PyObject *__pyx_kp_u__7; + PyObject *__pyx_kp_u__8; + PyObject *__pyx_kp_u__9; PyObject *__pyx_n_s_args; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_auto; @@ -3222,26 +2984,26 @@ typedef struct { PyObject *__pyx_int_1; PyObject *__pyx_int_4; PyObject *__pyx_int_16; - PyObject *__pyx_codeobj_; - PyObject *__pyx_tuple__8; - PyObject *__pyx_slice__17; - PyObject *__pyx_tuple__21; + PyObject *__pyx_tuple__4; + PyObject *__pyx_slice__10; + PyObject *__pyx_tuple__12; + PyObject *__pyx_tuple__14; + PyObject *__pyx_tuple__16; + PyObject *__pyx_tuple__18; + PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__22; - PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__24; - PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__26; - PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__28; - PyObject *__pyx_tuple__29; - PyObject *__pyx_codeobj__2; - PyObject *__pyx_codeobj__5; - PyObject *__pyx_codeobj__6; - PyObject *__pyx_codeobj__9; + PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; - PyObject *__pyx_codeobj__16; - PyObject *__pyx_codeobj__18; + PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__19; + PyObject *__pyx_codeobj__21; + PyObject *__pyx_codeobj__23; + PyObject *__pyx_codeobj__25; + PyObject *__pyx_codeobj__27; + PyObject *__pyx_codeobj__29; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -3288,6 +3050,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr); Py_CLEAR(clear_module_state->__pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr); + Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_kp_u_04X); Py_CLEAR(clear_module_state->__pyx_n_u_AL); Py_CLEAR(clear_module_state->__pyx_n_u_AN); @@ -3328,16 +3091,15 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_u_Unknown_IDNA_mapping_table_statu); Py_CLEAR(clear_module_state->__pyx_n_s_VALID); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); - Py_CLEAR(clear_module_state->__pyx_kp_u__10); - Py_CLEAR(clear_module_state->__pyx_kp_u__11); - Py_CLEAR(clear_module_state->__pyx_kp_u__12); - Py_CLEAR(clear_module_state->__pyx_kp_u__13); - Py_CLEAR(clear_module_state->__pyx_kp_u__14); - Py_CLEAR(clear_module_state->__pyx_n_s__20); + Py_CLEAR(clear_module_state->__pyx_n_s__11); + Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_kp_u__3); Py_CLEAR(clear_module_state->__pyx_n_s__30); - Py_CLEAR(clear_module_state->__pyx_kp_u__4); + Py_CLEAR(clear_module_state->__pyx_kp_u__5); + Py_CLEAR(clear_module_state->__pyx_kp_u__6); Py_CLEAR(clear_module_state->__pyx_kp_u__7); + Py_CLEAR(clear_module_state->__pyx_kp_u__8); + Py_CLEAR(clear_module_state->__pyx_kp_u__9); Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_auto); @@ -3480,26 +3242,26 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_4); Py_CLEAR(clear_module_state->__pyx_int_16); - Py_CLEAR(clear_module_state->__pyx_codeobj_); - Py_CLEAR(clear_module_state->__pyx_tuple__8); - Py_CLEAR(clear_module_state->__pyx_slice__17); - Py_CLEAR(clear_module_state->__pyx_tuple__21); + Py_CLEAR(clear_module_state->__pyx_tuple__4); + Py_CLEAR(clear_module_state->__pyx_slice__10); + Py_CLEAR(clear_module_state->__pyx_tuple__12); + Py_CLEAR(clear_module_state->__pyx_tuple__14); + Py_CLEAR(clear_module_state->__pyx_tuple__16); + Py_CLEAR(clear_module_state->__pyx_tuple__18); + Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__22); - Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__24); - Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__26); - Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__28); - Py_CLEAR(clear_module_state->__pyx_tuple__29); - Py_CLEAR(clear_module_state->__pyx_codeobj__2); - Py_CLEAR(clear_module_state->__pyx_codeobj__5); - Py_CLEAR(clear_module_state->__pyx_codeobj__6); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); + Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); - Py_CLEAR(clear_module_state->__pyx_codeobj__16); - Py_CLEAR(clear_module_state->__pyx_codeobj__18); + Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__19); + Py_CLEAR(clear_module_state->__pyx_codeobj__21); + Py_CLEAR(clear_module_state->__pyx_codeobj__23); + Py_CLEAR(clear_module_state->__pyx_codeobj__25); + Py_CLEAR(clear_module_state->__pyx_codeobj__27); + Py_CLEAR(clear_module_state->__pyx_codeobj__29); return 0; } #endif @@ -3524,6 +3286,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_type_5w3lib_6_utr46___pyx_scope_struct__genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr); Py_VISIT(traverse_module_state->__pyx_type_5w3lib_6_utr46___pyx_scope_struct_1_genexpr); + Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_kp_u_04X); Py_VISIT(traverse_module_state->__pyx_n_u_AL); Py_VISIT(traverse_module_state->__pyx_n_u_AN); @@ -3564,16 +3327,15 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_u_Unknown_IDNA_mapping_table_statu); Py_VISIT(traverse_module_state->__pyx_n_s_VALID); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); - Py_VISIT(traverse_module_state->__pyx_kp_u__10); - Py_VISIT(traverse_module_state->__pyx_kp_u__11); - Py_VISIT(traverse_module_state->__pyx_kp_u__12); - Py_VISIT(traverse_module_state->__pyx_kp_u__13); - Py_VISIT(traverse_module_state->__pyx_kp_u__14); - Py_VISIT(traverse_module_state->__pyx_n_s__20); + Py_VISIT(traverse_module_state->__pyx_n_s__11); + Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_kp_u__3); Py_VISIT(traverse_module_state->__pyx_n_s__30); - Py_VISIT(traverse_module_state->__pyx_kp_u__4); + Py_VISIT(traverse_module_state->__pyx_kp_u__5); + Py_VISIT(traverse_module_state->__pyx_kp_u__6); Py_VISIT(traverse_module_state->__pyx_kp_u__7); + Py_VISIT(traverse_module_state->__pyx_kp_u__8); + Py_VISIT(traverse_module_state->__pyx_kp_u__9); Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_auto); @@ -3716,26 +3478,26 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_4); Py_VISIT(traverse_module_state->__pyx_int_16); - Py_VISIT(traverse_module_state->__pyx_codeobj_); - Py_VISIT(traverse_module_state->__pyx_tuple__8); - Py_VISIT(traverse_module_state->__pyx_slice__17); - Py_VISIT(traverse_module_state->__pyx_tuple__21); + Py_VISIT(traverse_module_state->__pyx_tuple__4); + Py_VISIT(traverse_module_state->__pyx_slice__10); + Py_VISIT(traverse_module_state->__pyx_tuple__12); + Py_VISIT(traverse_module_state->__pyx_tuple__14); + Py_VISIT(traverse_module_state->__pyx_tuple__16); + Py_VISIT(traverse_module_state->__pyx_tuple__18); + Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__22); - Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__24); - Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__26); - Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__28); - Py_VISIT(traverse_module_state->__pyx_tuple__29); - Py_VISIT(traverse_module_state->__pyx_codeobj__2); - Py_VISIT(traverse_module_state->__pyx_codeobj__5); - Py_VISIT(traverse_module_state->__pyx_codeobj__6); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); + Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); - Py_VISIT(traverse_module_state->__pyx_codeobj__16); - Py_VISIT(traverse_module_state->__pyx_codeobj__18); + Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__19); + Py_VISIT(traverse_module_state->__pyx_codeobj__21); + Py_VISIT(traverse_module_state->__pyx_codeobj__23); + Py_VISIT(traverse_module_state->__pyx_codeobj__25); + Py_VISIT(traverse_module_state->__pyx_codeobj__27); + Py_VISIT(traverse_module_state->__pyx_codeobj__29); return 0; } #endif @@ -3770,6 +3532,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #endif #define __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct__genexpr #define __pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_ptype_5w3lib_6_utr46___pyx_scope_struct_1_genexpr +#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_kp_u_04X __pyx_mstate_global->__pyx_kp_u_04X #define __pyx_n_u_AL __pyx_mstate_global->__pyx_n_u_AL #define __pyx_n_u_AN __pyx_mstate_global->__pyx_n_u_AN @@ -3810,16 +3573,15 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_u_Unknown_IDNA_mapping_table_statu __pyx_mstate_global->__pyx_kp_u_Unknown_IDNA_mapping_table_statu #define __pyx_n_s_VALID __pyx_mstate_global->__pyx_n_s_VALID #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError -#define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10 -#define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11 -#define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12 -#define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13 -#define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14 -#define __pyx_n_s__20 __pyx_mstate_global->__pyx_n_s__20 +#define __pyx_n_s__11 __pyx_mstate_global->__pyx_n_s__11 +#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 #define __pyx_n_s__30 __pyx_mstate_global->__pyx_n_s__30 -#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 +#define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 +#define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 +#define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8 +#define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9 #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_auto __pyx_mstate_global->__pyx_n_s_auto @@ -3962,26 +3724,26 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 #define __pyx_int_16 __pyx_mstate_global->__pyx_int_16 -#define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_ -#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 -#define __pyx_slice__17 __pyx_mstate_global->__pyx_slice__17 -#define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 +#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 +#define __pyx_slice__10 __pyx_mstate_global->__pyx_slice__10 +#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 +#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 +#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 +#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 +#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 -#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 -#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 -#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 -#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 -#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 -#define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 -#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 +#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 -#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 -#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 +#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 +#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 +#define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 +#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 +#define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 +#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 /* #### Code section: module_code ### */ /* "w3lib/_utr46.pyx":17 @@ -4111,7 +3873,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_5w3lib_6_utr46__is_normalized(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_form, PyObject *__pyx_v_unistr) { PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -4120,9 +3881,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46__is_normalized(CYTHON_UNUSED PyObject * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj_) __Pyx_RefNannySetupContext("_is_normalized", 1); - __Pyx_TraceCall("_is_normalized", __pyx_f[0], 17, 0, __PYX_ERR(0, 17, __pyx_L1_error)); /* "w3lib/_utr46.pyx":18 * @@ -4182,7 +3941,6 @@ static PyObject *__pyx_pf_5w3lib_6_utr46__is_normalized(CYTHON_UNUSED PyObject * __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4355,7 +4113,6 @@ static PyObject *__pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator(__pyx_C { struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct__genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); @@ -4367,11 +4124,9 @@ static PyObject *__pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator(__pyx_C int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); - __Pyx_TraceCall("genexpr", __pyx_f[0], 57, 0, __PYX_ERR(0, 57, __pyx_L1_error)); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ - __Pyx_TraceReturn(Py_None, 0); __Pyx_RefNannyFinishContext(); return NULL; } @@ -4474,7 +4229,6 @@ static PyObject *__pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator(__pyx_C #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4492,7 +4246,6 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_from_match(CYTHON_UNUSED PyObje PyObject *__pyx_v_mapping = NULL; PyObject *__pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator = 0; PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; @@ -4502,9 +4255,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_from_match(CYTHON_UNUSED PyObje int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__2) __Pyx_RefNannySetupContext("from_match", 1); - __Pyx_TraceCall("from_match", __pyx_f[0], 32, 0, __PYX_ERR(0, 32, __pyx_L1_error)); /* "w3lib/_utr46.pyx":34 * @classmethod @@ -4890,7 +4641,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_from_match(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__4}; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) @@ -4911,7 +4662,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_from_match(CYTHON_UNUSED PyObje __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Join(__pyx_kp_u_, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_mapping = ((PyObject*)__pyx_t_4); @@ -4982,7 +4733,6 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_from_match(CYTHON_UNUSED PyObje __Pyx_XDECREF(__pyx_v_mapping); __Pyx_XDECREF(__pyx_gb_5w3lib_6_utr46_6_Entry_10from_match_2generator); __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5120,14 +4870,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_2__init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mapping, PyObject *__pyx_v_status) { PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__5) __Pyx_RefNannySetupContext("__init__", 1); - __Pyx_TraceCall("__init__", __pyx_f[0], 64, 0, __PYX_ERR(0, 64, __pyx_L1_error)); /* "w3lib/_utr46.pyx":65 * @@ -5163,7 +4910,6 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_Entry_2__init__(CYTHON_UNUSED PyObjec __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5205,7 +4951,6 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_2_load_idna_mapping_table(CYTHON_UNUSED PyObject *__pyx_v_end = NULL; PyObject *__pyx_v_id = NULL; PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -5228,9 +4973,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_2_load_idna_mapping_table(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__6) __Pyx_RefNannySetupContext("_load_idna_mapping_table", 1); - __Pyx_TraceCall("_load_idna_mapping_table", __pyx_f[0], 69, 0, __PYX_ERR(0, 69, __pyx_L1_error)); /* "w3lib/_utr46.pyx":70 * @@ -5444,7 +5187,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_2_load_idna_mapping_table(CYTHON_UNUSED } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u__7}; + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u__3}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L7_error) @@ -5953,7 +5696,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_2_load_idna_mapping_table(CYTHON_UNUSED /*finally:*/ { /*normal exit:*/{ if (__pyx_t_6) { - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__8, NULL); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__4, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -6011,7 +5754,6 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_2_load_idna_mapping_table(CYTHON_UNUSED __Pyx_XDECREF(__pyx_v_end); __Pyx_XDECREF(__pyx_v_id); __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6183,7 +5925,6 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject PyObject *__pyx_v_code_point = NULL; PyObject *__pyx_v_entry = NULL; PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -6203,9 +5944,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__9) __Pyx_RefNannySetupContext("_validate_label", 1); - __Pyx_TraceCall("_validate_label", __pyx_f[0], 121, 0, __PYX_ERR(0, 121, __pyx_L1_error)); /* "w3lib/_utr46.pyx":136 * Database with Bidi_Class R, AL, or AN. @@ -6331,7 +6070,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject } __pyx_t_1 = __Pyx_PyUnicode_Substring(__pyx_v_label, 3, 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_5; __pyx_L6_bool_binop_done:; @@ -6397,7 +6136,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject * raise ValueError(f"Domain name label {label!r} starts with '-'.") * if label.endswith("-"): */ - __pyx_t_6 = __Pyx_PyUnicode_Tailmatch(__pyx_v_label, __pyx_kp_u__11, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Tailmatch(__pyx_v_label, __pyx_kp_u__6, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 147, __pyx_L1_error) if (unlikely(__pyx_t_6)) { /* "w3lib/_utr46.pyx":148 @@ -6452,7 +6191,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject * raise ValueError(f"Domain name label {label!r} ends with '-'.") * if "." in label: */ - __pyx_t_6 = __Pyx_PyUnicode_Tailmatch(__pyx_v_label, __pyx_kp_u__11, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Tailmatch(__pyx_v_label, __pyx_kp_u__6, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error) if (unlikely(__pyx_t_6)) { /* "w3lib/_utr46.pyx":150 @@ -6516,7 +6255,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject * raise ValueError(f"Domain name label {label!r} contains a '.'.") * if length >= 1 and unicodedata.category(label[0])[0] == "M": */ - __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__12, __pyx_v_label, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__7, __pyx_v_label, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) if (unlikely(__pyx_t_6)) { /* "w3lib/_utr46.pyx":152 @@ -6813,10 +6552,10 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_9); __pyx_t_9 = 0; - __Pyx_INCREF(__pyx_kp_u__13); + __Pyx_INCREF(__pyx_kp_u__8); __pyx_t_13 += 2; - __Pyx_GIVEREF(__pyx_kp_u__13); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__13); + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__8); __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_code_point, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8; @@ -6824,10 +6563,10 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_9); __pyx_t_9 = 0; - __Pyx_INCREF(__pyx_kp_u__14); + __Pyx_INCREF(__pyx_kp_u__9); __pyx_t_13 += 2; - __Pyx_GIVEREF(__pyx_kp_u__14); - PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__14); + __Pyx_GIVEREF(__pyx_kp_u__9); + PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__9); /* "w3lib/_utr46.pyx":163 * if entry is None: @@ -7010,10 +6749,10 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_9); __pyx_t_9 = 0; - __Pyx_INCREF(__pyx_kp_u__13); + __Pyx_INCREF(__pyx_kp_u__8); __pyx_t_13 += 2; - __Pyx_GIVEREF(__pyx_kp_u__13); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__13); + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__8); __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_code_point, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8; @@ -7188,7 +6927,6 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_4_validate_label(CYTHON_UNUSED PyObject __Pyx_XDECREF(__pyx_v_code_point); __Pyx_XDECREF(__pyx_v_entry); __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -7351,7 +7089,6 @@ static PyObject *__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1(__py { struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5w3lib_6_utr46___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; @@ -7367,11 +7104,9 @@ static PyObject *__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1(__py int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); - __Pyx_TraceCall("genexpr", __pyx_f[0], 187, 0, __PYX_ERR(0, 187, __pyx_L1_error)); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ - __Pyx_TraceReturn(Py_None, 0); __Pyx_RefNannyFinishContext(); return NULL; } @@ -7522,7 +7257,6 @@ static PyObject *__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1(__py #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -7538,16 +7272,13 @@ static PyObject *__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1(__py static PyObject *__pyx_pf_5w3lib_6_utr46_6_is_bidi_domain_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain_name) { PyObject *__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1 = 0; PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__15) __Pyx_RefNannySetupContext("_is_bidi_domain_name", 1); - __Pyx_TraceCall("_is_bidi_domain_name", __pyx_f[0], 185, 0, __PYX_ERR(0, 185, __pyx_L1_error)); /* "w3lib/_utr46.pyx":186 * # https://www.unicode.org/reports/tr46/#Notation @@ -7591,7 +7322,6 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_6_is_bidi_domain_name(CYTHON_UNUSED PyO __pyx_L0:; __Pyx_XDECREF(__pyx_gb_5w3lib_6_utr46_20_is_bidi_domain_name_2generator1); __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -7765,7 +7495,6 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_v_label = NULL; PyObject *__pyx_v_new_label = NULL; PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -7787,9 +7516,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__16) __Pyx_RefNannySetupContext("_process", 0); - __Pyx_TraceCall("_process", __pyx_f[0], 193, 0, __PYX_ERR(0, 193, __pyx_L1_error)); __Pyx_INCREF(__pyx_v_domain_name); __Pyx_INCREF(__pyx_v_check_bidi); @@ -7905,10 +7632,10 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_8); __pyx_t_8 = 0; - __Pyx_INCREF(__pyx_kp_u__13); + __Pyx_INCREF(__pyx_kp_u__8); __pyx_t_10 += 2; - __Pyx_GIVEREF(__pyx_kp_u__13); - PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u__13); + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u__8); __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_code_point, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_11; @@ -7916,10 +7643,10 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_8); __pyx_t_8 = 0; - __Pyx_INCREF(__pyx_kp_u__14); + __Pyx_INCREF(__pyx_kp_u__9); __pyx_t_10 += 2; - __Pyx_GIVEREF(__pyx_kp_u__14); - PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_kp_u__14); + __Pyx_GIVEREF(__pyx_kp_u__9); + PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_kp_u__9); /* "w3lib/_utr46.pyx":206 * if entry is None: @@ -8113,10 +7840,10 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6); __pyx_t_6 = 0; - __Pyx_INCREF(__pyx_kp_u__13); + __Pyx_INCREF(__pyx_kp_u__8); __pyx_t_10 += 2; - __Pyx_GIVEREF(__pyx_kp_u__13); - PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__13); + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__8); __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_code_point, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_11; @@ -8124,10 +7851,10 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_6); __pyx_t_6 = 0; - __Pyx_INCREF(__pyx_kp_u__14); + __Pyx_INCREF(__pyx_kp_u__9); __pyx_t_10 += 2; - __Pyx_GIVEREF(__pyx_kp_u__14); - PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_kp_u__14); + __Pyx_GIVEREF(__pyx_kp_u__9); + PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_kp_u__9); /* "w3lib/_utr46.pyx":218 * ): @@ -8193,7 +7920,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace"); __PYX_ERR(0, 222, __pyx_L1_error) } - __pyx_t_8 = PyUnicode_Replace(__pyx_v_domain_name, __pyx_v_code_point, __pyx_kp_u__3, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_8 = PyUnicode_Replace(__pyx_v_domain_name, __pyx_v_code_point, __pyx_kp_u_, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_domain_name, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; @@ -8447,7 +8174,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "split"); __PYX_ERR(0, 232, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_Split(__pyx_v_domain_name, __Pyx_NoneAsNull(__pyx_kp_u__12), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Split(__pyx_v_domain_name, __Pyx_NoneAsNull(__pyx_kp_u__7), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_labels = __pyx_t_1; __pyx_t_1 = 0; @@ -8610,7 +8337,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx * _validate_label( * new_label, */ - __pyx_t_16 = __Pyx_PyObject_GetSlice(__pyx_v_label, 4, 0, NULL, NULL, &__pyx_slice__17, 1, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_GetSlice(__pyx_v_label, 4, 0, NULL, NULL, &__pyx_slice__10, 1, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_encode); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); @@ -8874,7 +8601,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__12, __pyx_v_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__7, __pyx_v_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -8908,7 +8635,6 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_8_process(CYTHON_UNUSED PyObject *__pyx __Pyx_XDECREF(__pyx_v_domain_name); __Pyx_XDECREF(__pyx_v_check_bidi); __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -9024,7 +8750,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_5w3lib_6_utr46_10_convert_label(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label) { PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; @@ -9032,9 +8757,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_10_convert_label(CYTHON_UNUSED PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__18) __Pyx_RefNannySetupContext("_convert_label", 1); - __Pyx_TraceCall("_convert_label", __pyx_f[0], 258, 0, __PYX_ERR(0, 258, __pyx_L1_error)); /* "w3lib/_utr46.pyx":259 * @@ -9106,7 +8829,6 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_10_convert_label(CYTHON_UNUSED PyObject __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -9288,7 +9010,6 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_12_to_ascii(CYTHON_UNUSED PyObject *__p PyObject *__pyx_v_label = NULL; PyObject *__pyx_8genexpr2__pyx_v_label = NULL; PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -9304,9 +9025,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_12_to_ascii(CYTHON_UNUSED PyObject *__p int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__19) __Pyx_RefNannySetupContext("_to_ascii", 0); - __Pyx_TraceCall("_to_ascii", __pyx_f[0], 265, 0, __PYX_ERR(0, 265, __pyx_L1_error)); __Pyx_INCREF(__pyx_v_domain_name); /* "w3lib/_utr46.pyx":275 @@ -9409,7 +9128,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_12_to_ascii(CYTHON_UNUSED PyObject *__p PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "split"); __PYX_ERR(0, 283, __pyx_L5_error) } - __pyx_t_3 = PyUnicode_Split(__pyx_v_domain_name, __Pyx_NoneAsNull(__pyx_kp_u__12), -1L); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L5_error) + __pyx_t_3 = PyUnicode_Split(__pyx_v_domain_name, __Pyx_NoneAsNull(__pyx_kp_u__7), -1L); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; @@ -9475,7 +9194,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_12_to_ascii(CYTHON_UNUSED PyObject *__p * if verify_dns_length: * length = len(domain_name.rstrip(".")) */ - __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__12, __pyx_v_labels); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__7, __pyx_v_labels); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_domain_name, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; @@ -9497,7 +9216,7 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_12_to_ascii(CYTHON_UNUSED PyObject *__p * if not 1 <= length <= 253: * raise ValueError( */ - __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_rstrip, __pyx_v_domain_name, __pyx_kp_u__12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_rstrip, __pyx_v_domain_name, __pyx_kp_u__7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -9788,7 +9507,6 @@ static PyObject *__pyx_pf_5w3lib_6_utr46_12_to_ascii(CYTHON_UNUSED PyObject *__p __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_label); __Pyx_XDECREF(__pyx_v_domain_name); __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10132,6 +9850,7 @@ static PyMethodDef __pyx_methods[] = { static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_kp_u_04X, __pyx_k_04X, sizeof(__pyx_k_04X), 0, 1, 0, 0}, {&__pyx_n_u_AL, __pyx_k_AL, sizeof(__pyx_k_AL), 0, 1, 0, 1}, {&__pyx_n_u_AN, __pyx_k_AN, sizeof(__pyx_k_AN), 0, 1, 0, 1}, @@ -10172,16 +9891,15 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_u_Unknown_IDNA_mapping_table_statu, __pyx_k_Unknown_IDNA_mapping_table_statu, sizeof(__pyx_k_Unknown_IDNA_mapping_table_statu), 0, 1, 0, 0}, {&__pyx_n_s_VALID, __pyx_k_VALID, sizeof(__pyx_k_VALID), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0}, - {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, - {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0}, - {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0}, - {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0}, - {&__pyx_n_s__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 1}, + {&__pyx_n_s__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 1, 1}, + {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, {&__pyx_n_s__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 0, 1, 1}, - {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, + {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, + {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, + {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, + {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_auto, __pyx_k_auto, sizeof(__pyx_k_auto), 0, 0, 1, 1}, @@ -10349,9 +10067,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * for line in input: * if line.startswith("#") or not line.strip(): */ - __pyx_tuple__8 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__4 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); /* "w3lib/_utr46.pyx":236 * for i, label in enumerate(labels): @@ -10360,9 +10078,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * _validate_label( * new_label, */ - __pyx_slice__17 = PySlice_New(__pyx_int_4, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(0, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__17); - __Pyx_GIVEREF(__pyx_slice__17); + __pyx_slice__10 = PySlice_New(__pyx_int_4, Py_None, Py_None); if (unlikely(!__pyx_slice__10)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__10); + __Pyx_GIVEREF(__pyx_slice__10); /* "w3lib/_utr46.pyx":17 * else: @@ -10371,10 +10089,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * return unicodedata.normalize(form, unistr) == unistr * */ - __pyx_tuple__21 = PyTuple_Pack(2, __pyx_n_s_form, __pyx_n_s_unistr); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_is_normalized, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 17, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_form, __pyx_n_s_unistr); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_is_normalized, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 17, __pyx_L1_error) /* "w3lib/_utr46.pyx":32 * @@ -10383,10 +10101,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def from_match(cls: Type["_Entry"], match: Match) -> "_Entry": * if match["status"] == "disallowed": */ - __pyx_tuple__22 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_match, __pyx_n_s_status, __pyx_n_s_mapping, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_from_match, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_match, __pyx_n_s_status, __pyx_n_s_mapping, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_from_match, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 32, __pyx_L1_error) /* "w3lib/_utr46.pyx":64 * ) @@ -10395,10 +10113,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * self.mapping = mapping * self.status = status */ - __pyx_tuple__23 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_mapping, __pyx_n_s_status); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_init, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_mapping, __pyx_n_s_status); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_init, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 64, __pyx_L1_error) /* "w3lib/_utr46.pyx":69 * @@ -10407,10 +10125,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * file_name = Path(__file__).parent / "idna.txt" * pattern = r"""(?x) */ - __pyx_tuple__24 = PyTuple_Pack(11, __pyx_n_s_file_name, __pyx_n_s_pattern, __pyx_n_s_mapping, __pyx_n_s_input, __pyx_n_s_line, __pyx_n_s_match, __pyx_n_s_entry, __pyx_n_s_code_point, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_id); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_load_idna_mapping_table, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_tuple__18 = PyTuple_Pack(11, __pyx_n_s_file_name, __pyx_n_s_pattern, __pyx_n_s_mapping, __pyx_n_s_input, __pyx_n_s_line, __pyx_n_s_match, __pyx_n_s_entry, __pyx_n_s_code_point, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_id); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_load_idna_mapping_table, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 69, __pyx_L1_error) /* "w3lib/_utr46.pyx":121 * @@ -10419,10 +10137,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * label: str, * *, */ - __pyx_tuple__25 = PyTuple_Pack(9, __pyx_n_s_label, __pyx_n_s_check_hyphens, __pyx_n_s_check_joiners, __pyx_n_s_check_bidi, __pyx_n_s_transitional_processing, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_length, __pyx_n_s_code_point, __pyx_n_s_entry); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_validate_label, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_tuple__20 = PyTuple_Pack(9, __pyx_n_s_label, __pyx_n_s_check_hyphens, __pyx_n_s_check_joiners, __pyx_n_s_check_bidi, __pyx_n_s_transitional_processing, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_length, __pyx_n_s_code_point, __pyx_n_s_entry); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_validate_label, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 121, __pyx_L1_error) /* "w3lib/_utr46.pyx":185 * @@ -10431,10 +10149,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * return any( * unicodedata.bidirectional(code_point) in {"AL", "AN", "R"} */ - __pyx_tuple__26 = PyTuple_Pack(3, __pyx_n_s_domain_name, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_is_bidi_domain_name, 185, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_domain_name, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_is_bidi_domain_name, 185, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 185, __pyx_L1_error) /* "w3lib/_utr46.pyx":193 * @@ -10443,10 +10161,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * domain_name: str, * *, */ - __pyx_tuple__27 = PyTuple_Pack(12, __pyx_n_s_domain_name, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_check_hyphens, __pyx_n_s_check_bidi, __pyx_n_s_check_joiners, __pyx_n_s_transitional_processing, __pyx_n_s_code_point, __pyx_n_s_entry, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_label, __pyx_n_s_new_label); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_process, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_tuple__24 = PyTuple_Pack(12, __pyx_n_s_domain_name, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_check_hyphens, __pyx_n_s_check_bidi, __pyx_n_s_check_joiners, __pyx_n_s_transitional_processing, __pyx_n_s_code_point, __pyx_n_s_entry, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_label, __pyx_n_s_new_label); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_process, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 193, __pyx_L1_error) /* "w3lib/_utr46.pyx":258 * @@ -10455,10 +10173,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * if label.isascii(): * return label */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_label); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_convert_label, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_label); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_convert_label, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 258, __pyx_L1_error) /* "w3lib/_utr46.pyx":265 * @@ -10467,10 +10185,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * domain_name: str, * *, */ - __pyx_tuple__29 = PyTuple_Pack(11, __pyx_n_s_domain_name, __pyx_n_s_check_hyphens, __pyx_n_s_check_bidi, __pyx_n_s_check_joiners, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_transitional_processing, __pyx_n_s_verify_dns_length, __pyx_n_s_labels, __pyx_n_s_length, __pyx_n_s_label, __pyx_n_s_label); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_to_ascii, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_tuple__28 = PyTuple_Pack(11, __pyx_n_s_domain_name, __pyx_n_s_check_hyphens, __pyx_n_s_check_bidi, __pyx_n_s_check_joiners, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_transitional_processing, __pyx_n_s_verify_dns_length, __pyx_n_s_labels, __pyx_n_s_length, __pyx_n_s_label, __pyx_n_s_label); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__utr46_pyx, __pyx_n_s_to_ascii, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -10776,7 +10494,6 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__utr46(PyObject *__pyx_pyinit_modu #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif - __Pyx_TraceDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -10900,7 +10617,6 @@ if (!__Pyx_RefNanny) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__utr46(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); /* "w3lib/_utr46.pyx":3 * # https://www.unicode.org/reports/tr46/ @@ -11110,7 +10826,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_form, __pyx_n_s_str) < 0) __PYX_ERR(0, 17, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_unistr, __pyx_n_s_str) < 0) __PYX_ERR(0, 17, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 17, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_1_is_normalized, 0, __pyx_n_s_is_normalized, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_1_is_normalized, 0, __pyx_n_s_is_normalized, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11419,7 +11135,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_cls, __pyx_kp_s_Type__Entry) < 0) __PYX_ERR(0, 32, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_match, __pyx_n_s_Match) < 0) __PYX_ERR(0, 32, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_Entry_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_6_Entry_1from_match, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Entry_from_match, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_6_Entry_1from_match, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Entry_from_match, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -11442,7 +11158,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mapping, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 64, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_status, __pyx_n_s_Status) < 0) __PYX_ERR(0, 64, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_6_Entry_3__init__, 0, __pyx_n_s_Entry___init, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_6_Entry_3__init__, 0, __pyx_n_s_Entry___init, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -11472,7 +11188,7 @@ if (!__Pyx_RefNanny) { __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Dict_str__Entry) < 0) __PYX_ERR(0, 69, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_3_load_idna_mapping_table, 0, __pyx_n_s_load_idna_mapping_table, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_3_load_idna_mapping_table, 0, __pyx_n_s_load_idna_mapping_table, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11510,7 +11226,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, __pyx_n_s_bool) < 0) __PYX_ERR(0, 121, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_n_s_bool) < 0) __PYX_ERR(0, 121, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 121, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_5_validate_label, 0, __pyx_n_s_validate_label, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_5_validate_label, 0, __pyx_n_s_validate_label, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11528,7 +11244,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domain_name, __pyx_n_s_str) < 0) __PYX_ERR(0, 185, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 185, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_7_is_bidi_domain_name, 0, __pyx_n_s_is_bidi_domain_name, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_7_is_bidi_domain_name, 0, __pyx_n_s_is_bidi_domain_name, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -11551,7 +11267,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, __pyx_n_s_bool) < 0) __PYX_ERR(0, 193, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, __pyx_n_s_bool) < 0) __PYX_ERR(0, 193, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 193, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_9_process, 0, __pyx_n_s_process, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_9_process, 0, __pyx_n_s_process, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11569,7 +11285,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 258, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 258, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_11_convert_label, 0, __pyx_n_s_convert_label, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_11_convert_label, 0, __pyx_n_s_convert_label, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -11593,7 +11309,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, __pyx_n_s_bool) < 0) __PYX_ERR(0, 265, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_n_s_bool) < 0) __PYX_ERR(0, 265, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 265, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_13_to_ascii, 0, __pyx_n_s_to_ascii, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_6_utr46_13_to_ascii, 0, __pyx_n_s_to_ascii, NULL, __pyx_n_s_w3lib__utr46, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11609,7 +11325,6 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_TraceReturn(Py_None, 0); /*--- Wrapped vars code ---*/ @@ -12291,96 +12006,6 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam return 0; } -/* Profile */ -#if CYTHON_PROFILE -static int __Pyx_TraceSetupAndCall(PyCodeObject** code, - PyFrameObject** frame, - PyThreadState* tstate, - const char *funcname, - const char *srcfile, - int firstlineno) { - PyObject *type, *value, *traceback; - int retval; - if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { - if (*code == NULL) { - *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); - if (*code == NULL) return 0; - } - *frame = PyFrame_New( - tstate, /*PyThreadState *tstate*/ - *code, /*PyCodeObject *code*/ - __pyx_d, /*PyObject *globals*/ - 0 /*PyObject *locals*/ - ); - if (*frame == NULL) return 0; - if (CYTHON_TRACE && (*frame)->f_trace == NULL) { - Py_INCREF(Py_None); - (*frame)->f_trace = Py_None; - } -#if PY_VERSION_HEX < 0x030400B1 - } else { - (*frame)->f_tstate = tstate; -#endif - } - __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); - retval = 1; - __Pyx_EnterTracing(tstate); - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - #if CYTHON_TRACE - if (tstate->c_tracefunc) - retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; - if (retval && tstate->c_profilefunc) - #endif - retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; - __Pyx_LeaveTracing(tstate); - if (retval) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - return __Pyx_IsTracing(tstate, 0, 0) && retval; - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - return -1; - } -} -static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { - PyCodeObject *py_code = 0; -#if PY_MAJOR_VERSION >= 3 - py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); - if (likely(py_code)) { - py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; - } -#else - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - py_funcname = PyString_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - py_srcfile = PyString_FromString(srcfile); - if (unlikely(!py_srcfile)) goto bad; - py_code = PyCode_New( - 0, - 0, - 0, - CO_OPTIMIZED | CO_NEWLOCALS, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - firstlineno, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); -#endif - return py_code; -} -#endif - /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { @@ -14739,7 +14364,7 @@ static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject * #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__20; + PyObject *module, *from_list, *star = __pyx_n_s__11; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) @@ -14802,7 +14427,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__12); + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__7); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } From 66b91542de7a023d5349a7a55b6b85e4dd343621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 13 Feb 2024 18:40:01 +0100 Subject: [PATCH 33/34] Minor improvements --- tests/test_url.py | 1 - w3lib/_url.c | 5867 +++++++++++++++++++++------------------------ w3lib/_url.pyx | 49 +- 3 files changed, 2736 insertions(+), 3181 deletions(-) diff --git a/tests/test_url.py b/tests/test_url.py index 9f37f6e4..e25be6a2 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -23,7 +23,6 @@ _parse_url, _percent_encode_after_encoding, _serialize_host, - # _serialize_url, _serialize_url_path, _SPECIAL_QUERY_PERCENT_ENCODE_SET, _SPECIAL_SCHEMES, diff --git a/w3lib/_url.c b/w3lib/_url.c index 60ebdd12..8b795321 100644 --- a/w3lib/_url.c +++ b/w3lib/_url.c @@ -1984,9 +1984,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); -/* RaiseKeywordRequired.proto */ -static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name); - /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); @@ -2006,9 +2003,6 @@ static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *k #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif -/* PyIntCompare.proto */ -static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); - /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); @@ -2024,6 +2018,9 @@ static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f); #define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f) #endif +/* PyIntCompare.proto */ +static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); @@ -2142,6 +2139,9 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co static int __Pyx_PyUnicode_Tailmatch( PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction); +/* RaiseKeywordRequired.proto */ +static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name); + /* PyUnicodeContains.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_ContainsTF(PyObject* substring, PyObject* text, int eq) { int result = PyUnicode_Contains(text, substring); @@ -2455,12 +2455,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value); -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); @@ -2644,6 +2644,7 @@ static PyObject *__pyx_9genexpr30__pyx_v_5w3lib_4_url_label; static PyObject *__pyx_9genexpr31__pyx_v_5w3lib_4_url_label; static PyObject *__pyx_9genexpr32__pyx_v_5w3lib_4_url_char; static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *); /*proto*/ +static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *, PyObject *, PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "w3lib._url" @@ -2671,12 +2672,12 @@ static const char __pyx_k_25[] = "%25"; static const char __pyx_k_2E[] = ".%2E"; static const char __pyx_k_2e[] = ".%2e"; static const char __pyx_k_40[] = "%40"; -static const char __pyx_k__3[] = "+"; -static const char __pyx_k__4[] = "%"; -static const char __pyx_k__5[] = ":"; -static const char __pyx_k__6[] = "."; -static const char __pyx_k__8[] = "["; -static const char __pyx_k__9[] = "]"; +static const char __pyx_k__3[] = "%"; +static const char __pyx_k__4[] = ":"; +static const char __pyx_k__5[] = "."; +static const char __pyx_k__7[] = "["; +static const char __pyx_k__8[] = "]"; +static const char __pyx_k__9[] = ".."; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_l1[] = "l1"; static const char __pyx_k_l2[] = "l2"; @@ -2689,36 +2690,34 @@ static const char __pyx_k_ws[] = "ws"; static const char __pyx_k_02X[] = "02X"; static const char __pyx_k_866[] = "866"; static const char __pyx_k_URL[] = "_URL"; -static const char __pyx_k__10[] = ".."; static const char __pyx_k__11[] = "/"; -static const char __pyx_k__14[] = "/\\"; -static const char __pyx_k__15[] = "@"; -static const char __pyx_k__16[] = "/?#"; -static const char __pyx_k__17[] = "\\"; -static const char __pyx_k__18[] = "/\\?#"; -static const char __pyx_k__19[] = "?"; -static const char __pyx_k__20[] = "#"; -static const char __pyx_k__21[] = "?#"; -static const char __pyx_k__23[] = "::"; -static const char __pyx_k__24[] = "//"; -static const char __pyx_k__25[] = "/."; -static const char __pyx_k__26[] = "*"; -static const char __pyx_k__73[] = "+-."; -static const char __pyx_k__76[] = "_"; -static const char __pyx_k__79[] = "~"; -static const char __pyx_k__80[] = " \"<>`"; -static const char __pyx_k__81[] = " \"#<>"; -static const char __pyx_k__82[] = "'"; -static const char __pyx_k__83[] = "?`{}"; -static const char __pyx_k__84[] = "/:;=@[\\]^|"; -static const char __pyx_k__85[] = ":/?#[]@"; -static const char __pyx_k__86[] = "!$&'()*+,;="; -static const char __pyx_k__87[] = "-._~"; -static const char __pyx_k__89[] = "|"; -static const char __pyx_k__92[] = ":;="; -static const char __pyx_k__93[] = "#[]|"; -static const char __pyx_k__94[] = "\000\t\n\r #/:<>?@[\\]^|"; -static const char __pyx_k__95[] = "%"; +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__17[] = "/\\?#"; +static const char __pyx_k__18[] = "?"; +static const char __pyx_k__19[] = "#"; +static const char __pyx_k__20[] = "?#"; +static const char __pyx_k__22[] = "::"; +static const char __pyx_k__23[] = "//"; +static const char __pyx_k__24[] = "/."; +static const char __pyx_k__25[] = "*"; +static const char __pyx_k__72[] = "+-."; +static const char __pyx_k__75[] = "~"; +static const char __pyx_k__76[] = " \"<>`"; +static const char __pyx_k__77[] = " \"#<>"; +static const char __pyx_k__78[] = "'"; +static const char __pyx_k__79[] = "?`{}"; +static const char __pyx_k__80[] = "/:;=@[\\]^|"; +static const char __pyx_k__81[] = ":/?#[]@"; +static const char __pyx_k__82[] = "!$&'()*+,;="; +static const char __pyx_k__83[] = "-._~"; +static const char __pyx_k__85[] = "|"; +static const char __pyx_k__88[] = ":;="; +static const char __pyx_k__89[] = "#[]|"; +static const char __pyx_k__90[] = "\000\t\n\r #/:<>?@[\\]^|"; +static const char __pyx_k__91[] = "%"; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_ftp[] = "ftp"; @@ -2740,8 +2739,7 @@ static const char __pyx_k_Port[] = "Port "; static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_big5[] = "big5"; -static const char __pyx_k_bool[] = "bool"; -static const char __pyx_k_byte[] = "byte"; +static const char __pyx_k_bint[] = "bint"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_file[] = "file"; static const char __pyx_k_http[] = "http"; @@ -2852,7 +2850,6 @@ static const char __pyx_k_cskoi8r[] = "cskoi8r"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_dos_874[] = "dos-874"; static const char __pyx_k_encoded[] = "encoded"; -static const char __pyx_k_encoder[] = "encoder"; static const char __pyx_k_gb18030[] = "gb18030"; static const char __pyx_k_gb_2312[] = "gb_2312"; static const char __pyx_k_genexpr[] = "genexpr"; @@ -2897,7 +2894,6 @@ static const char __pyx_k_iso88596[] = "iso88596"; static const char __pyx_k_iso88597[] = "iso88597"; static const char __pyx_k_iso88598[] = "iso88598"; static const char __pyx_k_iso88599[] = "iso88599"; -static const char __pyx_k_isomorph[] = "isomorph"; static const char __pyx_k_koi8_r_2[] = "koi8_r"; static const char __pyx_k_ksc_5601[] = "ksc_5601"; static const char __pyx_k_ms_kanji[] = "ms_kanji"; @@ -3072,17 +3068,15 @@ static const char __pyx_k_check_joiners[] = "check_joiners"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_csksc56011987[] = "csksc56011987"; static const char __pyx_k_current_index[] = "current_index"; -static const char __pyx_k_encode_output[] = "encode_output"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_iso_8859_15_2[] = "iso_8859-15"; static const char __pyx_k_serialize_url[] = "_serialize_url"; -static const char __pyx_k_space_as_plus[] = "space_as_plus"; static const char __pyx_k_unicode11utf8[] = "unicode11utf8"; static const char __pyx_k_unicode20utf8[] = "unicode20utf8"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_DecodeFunction[] = "DecodeFunction"; static const char __pyx_k_EncodeFunction[] = "EncodeFunction"; -static const char __pyx_k_Tuple_int_bool[] = "Tuple[int, bool]"; +static const char __pyx_k_Tuple_int_bint[] = "Tuple[int, bint]"; static const char __pyx_k_UTF_8_ENCODING[] = "_UTF_8_ENCODING"; static const char __pyx_k_ansi_x3_4_1968[] = "ansi_x3.4-1968"; static const char __pyx_k_current_length[] = "current_length"; @@ -3176,7 +3170,6 @@ static const char __pyx_k_SAFE_PATH_PERCENT_ENCODE_SET[] = "_SAFE_PATH_PERCENT_E static const char __pyx_k_C0_CONTROL_PERCENT_ENCODE_SET[] = "_C0_CONTROL_PERCENT_ENCODE_SET"; static const char __pyx_k_SAFE_QUERY_PERCENT_ENCODE_SET[] = "_SAFE_QUERY_PERCENT_ENCODE_SET"; static const char __pyx_k_ends_in_number_locals_genexpr[] = "_ends_in_number..genexpr"; -static const char __pyx_k_percent_encode_after_encoding[] = "_percent_encode_after_encoding"; static const char __pyx_k_OUTPUT_ENCODING_UTF8_ENCODINGS[] = "_OUTPUT_ENCODING_UTF8_ENCODINGS"; static const char __pyx_k_get_ipv6_first_longest_0_piece[] = "_get_ipv6_first_longest_0_piece_index"; static const char __pyx_k_ASCII_TAB_OR_NEWLINE_TRANSLATIO[] = "_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE"; @@ -3202,32 +3195,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_get_encoder(CYTHON_UNUSED PyObject *__p static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_6_shorten_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set, PyObject *__pyx_v_space_as_plus); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_10_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_12_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, PyObject *__pyx_v_be_strict); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_url); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_36_preprocess_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_52_safe_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_20_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, int __pyx_v_be_strict); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_24_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_28_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_30_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_34_preprocess_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_50_safe_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding); /* proto */ static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_strip = {0, 0, 0, 0, 0}; @@ -3350,7 +3342,7 @@ typedef struct { PyObject *__pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS; PyObject *__pyx_n_s_SPECIAL_SCHEMES; PyObject *__pyx_n_s_Tuple; - PyObject *__pyx_kp_s_Tuple_int_bool; + PyObject *__pyx_kp_s_Tuple_int_bint; PyObject *__pyx_n_s_URL; PyObject *__pyx_n_s_URL___init; PyObject *__pyx_kp_u_URL_is_relative; @@ -3362,47 +3354,45 @@ typedef struct { PyObject *__pyx_n_s_UTF_8_ENCODING; PyObject *__pyx_n_s_Union; PyObject *__pyx_n_s_ValueError; - PyObject *__pyx_kp_u__10; PyObject *__pyx_kp_u__11; + PyObject *__pyx_kp_u__13; PyObject *__pyx_kp_u__14; PyObject *__pyx_kp_u__15; PyObject *__pyx_kp_u__16; PyObject *__pyx_kp_u__17; + PyObject *__pyx_n_s__18; PyObject *__pyx_kp_u__18; - PyObject *__pyx_n_s__19; + PyObject *__pyx_kp_b__19; PyObject *__pyx_kp_u__19; - PyObject *__pyx_kp_b__20; PyObject *__pyx_kp_u__20; - PyObject *__pyx_kp_u__21; + PyObject *__pyx_kp_u__22; PyObject *__pyx_kp_u__23; PyObject *__pyx_kp_u__24; - PyObject *__pyx_kp_u__25; - PyObject *__pyx_n_s__26; + PyObject *__pyx_n_s__25; + PyObject *__pyx_kp_b__3; PyObject *__pyx_kp_u__3; PyObject *__pyx_kp_b__4; PyObject *__pyx_kp_u__4; - PyObject *__pyx_kp_b__5; PyObject *__pyx_kp_u__5; - PyObject *__pyx_kp_u__6; - PyObject *__pyx_kp_u__73; - PyObject *__pyx_n_s__76; + PyObject *__pyx_kp_u__7; + PyObject *__pyx_kp_u__72; + PyObject *__pyx_kp_u__75; + PyObject *__pyx_kp_u__76; + PyObject *__pyx_kp_u__77; + PyObject *__pyx_kp_b__78; + PyObject *__pyx_kp_u__78; PyObject *__pyx_kp_u__79; PyObject *__pyx_kp_u__8; PyObject *__pyx_kp_u__80; - PyObject *__pyx_kp_u__81; + PyObject *__pyx_kp_b__81; PyObject *__pyx_kp_b__82; - PyObject *__pyx_kp_u__82; PyObject *__pyx_kp_u__83; - PyObject *__pyx_kp_u__84; PyObject *__pyx_kp_b__85; - PyObject *__pyx_kp_b__86; - PyObject *__pyx_kp_u__87; + PyObject *__pyx_kp_b__88; PyObject *__pyx_kp_b__89; PyObject *__pyx_kp_u__9; - PyObject *__pyx_kp_b__92; - PyObject *__pyx_kp_b__93; - PyObject *__pyx_kp_u__94; - PyObject *__pyx_kp_u__95; + PyObject *__pyx_kp_u__90; + PyObject *__pyx_kp_u__91; PyObject *__pyx_n_s_address; PyObject *__pyx_n_s_annotations; PyObject *__pyx_kp_u_ansi_x3_4_1968; @@ -3420,9 +3410,8 @@ typedef struct { PyObject *__pyx_n_s_be_strict; PyObject *__pyx_n_u_big5; PyObject *__pyx_kp_u_big5_hkscs; - PyObject *__pyx_n_s_bool; + PyObject *__pyx_n_s_bint; PyObject *__pyx_n_s_buffer; - PyObject *__pyx_n_s_byte; PyObject *__pyx_n_s_c; PyObject *__pyx_n_s_check_bidi; PyObject *__pyx_n_s_check_hyphens; @@ -3491,11 +3480,9 @@ typedef struct { PyObject *__pyx_n_u_elot_928; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_encode; - PyObject *__pyx_n_s_encode_output; PyObject *__pyx_n_s_encode_set; PyObject *__pyx_n_s_encoded; PyObject *__pyx_n_s_encoded_code_points; - PyObject *__pyx_n_s_encoder; PyObject *__pyx_n_s_encoding; PyObject *__pyx_n_s_ends_in_number; PyObject *__pyx_n_s_ends_in_number_locals_genexpr; @@ -3636,7 +3623,6 @@ typedef struct { PyObject *__pyx_kp_u_iso_ir_149; PyObject *__pyx_kp_u_iso_ir_157; PyObject *__pyx_kp_u_iso_ir_58; - PyObject *__pyx_n_s_isomorph; PyObject *__pyx_n_s_keys; PyObject *__pyx_n_u_koi; PyObject *__pyx_n_u_koi8; @@ -3703,7 +3689,6 @@ typedef struct { PyObject *__pyx_n_s_path; PyObject *__pyx_n_s_path_safe_chars; PyObject *__pyx_n_s_path_token_seen; - PyObject *__pyx_n_s_percent_encode_after_encoding; PyObject *__pyx_n_s_percent_encode_set; PyObject *__pyx_n_s_piece; PyObject *__pyx_n_s_piece_index; @@ -3743,7 +3728,6 @@ typedef struct { PyObject *__pyx_n_s_shorten_path; PyObject *__pyx_n_u_sjis; PyObject *__pyx_n_s_skip_authority_shortcut; - PyObject *__pyx_n_s_space_as_plus; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_starts_with_windows_drive_lette; PyObject *__pyx_n_s_state; @@ -3822,18 +3806,18 @@ typedef struct { PyObject *__pyx_int_10; PyObject *__pyx_int_16; PyObject *__pyx_int_21; - PyObject *__pyx_int_32; PyObject *__pyx_int_80; PyObject *__pyx_int_255; PyObject *__pyx_int_256; PyObject *__pyx_int_443; PyObject *__pyx_int_neg_1; PyObject *__pyx_slice__2; - PyObject *__pyx_tuple__7; - PyObject *__pyx_slice__22; + PyObject *__pyx_tuple__6; + PyObject *__pyx_slice__21; + PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__12; - PyObject *__pyx_tuple__13; - PyObject *__pyx_tuple__27; + PyObject *__pyx_tuple__26; + PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__31; @@ -3871,15 +3855,15 @@ typedef struct { PyObject *__pyx_tuple__63; PyObject *__pyx_tuple__64; PyObject *__pyx_tuple__65; - PyObject *__pyx_tuple__66; + PyObject *__pyx_tuple__67; PyObject *__pyx_tuple__68; - PyObject *__pyx_tuple__69; - PyObject *__pyx_tuple__71; - PyObject *__pyx_tuple__74; - PyObject *__pyx_tuple__77; - PyObject *__pyx_tuple__88; - PyObject *__pyx_tuple__90; - PyObject *__pyx_tuple__91; + PyObject *__pyx_tuple__70; + PyObject *__pyx_tuple__73; + PyObject *__pyx_tuple__84; + PyObject *__pyx_tuple__86; + PyObject *__pyx_tuple__87; + PyObject *__pyx_tuple__92; + PyObject *__pyx_tuple__94; PyObject *__pyx_tuple__96; PyObject *__pyx_tuple__98; PyObject *__pyx_tuple__100; @@ -3888,23 +3872,22 @@ typedef struct { PyObject *__pyx_tuple__106; PyObject *__pyx_tuple__108; PyObject *__pyx_tuple__110; - PyObject *__pyx_tuple__112; PyObject *__pyx_tuple__114; + PyObject *__pyx_tuple__116; PyObject *__pyx_tuple__118; PyObject *__pyx_tuple__120; PyObject *__pyx_tuple__122; PyObject *__pyx_tuple__124; - PyObject *__pyx_tuple__126; - PyObject *__pyx_tuple__128; + PyObject *__pyx_tuple__127; + PyObject *__pyx_tuple__129; PyObject *__pyx_tuple__131; - PyObject *__pyx_tuple__133; - PyObject *__pyx_tuple__135; - PyObject *__pyx_codeobj__28; - PyObject *__pyx_codeobj__67; - PyObject *__pyx_codeobj__70; - PyObject *__pyx_codeobj__72; - PyObject *__pyx_codeobj__75; - PyObject *__pyx_codeobj__78; + PyObject *__pyx_codeobj__27; + PyObject *__pyx_codeobj__66; + PyObject *__pyx_codeobj__69; + PyObject *__pyx_codeobj__71; + PyObject *__pyx_codeobj__74; + PyObject *__pyx_codeobj__93; + PyObject *__pyx_codeobj__95; PyObject *__pyx_codeobj__97; PyObject *__pyx_codeobj__99; PyObject *__pyx_codeobj__101; @@ -3913,20 +3896,18 @@ typedef struct { PyObject *__pyx_codeobj__107; PyObject *__pyx_codeobj__109; PyObject *__pyx_codeobj__111; + PyObject *__pyx_codeobj__112; PyObject *__pyx_codeobj__113; PyObject *__pyx_codeobj__115; - PyObject *__pyx_codeobj__116; PyObject *__pyx_codeobj__117; PyObject *__pyx_codeobj__119; PyObject *__pyx_codeobj__121; PyObject *__pyx_codeobj__123; PyObject *__pyx_codeobj__125; - PyObject *__pyx_codeobj__127; - PyObject *__pyx_codeobj__129; + PyObject *__pyx_codeobj__126; + PyObject *__pyx_codeobj__128; PyObject *__pyx_codeobj__130; PyObject *__pyx_codeobj__132; - PyObject *__pyx_codeobj__134; - PyObject *__pyx_codeobj__136; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -4057,7 +4038,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS); Py_CLEAR(clear_module_state->__pyx_n_s_SPECIAL_SCHEMES); Py_CLEAR(clear_module_state->__pyx_n_s_Tuple); - Py_CLEAR(clear_module_state->__pyx_kp_s_Tuple_int_bool); + Py_CLEAR(clear_module_state->__pyx_kp_s_Tuple_int_bint); Py_CLEAR(clear_module_state->__pyx_n_s_URL); Py_CLEAR(clear_module_state->__pyx_n_s_URL___init); Py_CLEAR(clear_module_state->__pyx_kp_u_URL_is_relative); @@ -4069,47 +4050,45 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_UTF_8_ENCODING); Py_CLEAR(clear_module_state->__pyx_n_s_Union); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); - Py_CLEAR(clear_module_state->__pyx_kp_u__10); Py_CLEAR(clear_module_state->__pyx_kp_u__11); + Py_CLEAR(clear_module_state->__pyx_kp_u__13); Py_CLEAR(clear_module_state->__pyx_kp_u__14); Py_CLEAR(clear_module_state->__pyx_kp_u__15); Py_CLEAR(clear_module_state->__pyx_kp_u__16); Py_CLEAR(clear_module_state->__pyx_kp_u__17); + Py_CLEAR(clear_module_state->__pyx_n_s__18); Py_CLEAR(clear_module_state->__pyx_kp_u__18); - Py_CLEAR(clear_module_state->__pyx_n_s__19); + Py_CLEAR(clear_module_state->__pyx_kp_b__19); Py_CLEAR(clear_module_state->__pyx_kp_u__19); - Py_CLEAR(clear_module_state->__pyx_kp_b__20); Py_CLEAR(clear_module_state->__pyx_kp_u__20); - Py_CLEAR(clear_module_state->__pyx_kp_u__21); + Py_CLEAR(clear_module_state->__pyx_kp_u__22); Py_CLEAR(clear_module_state->__pyx_kp_u__23); Py_CLEAR(clear_module_state->__pyx_kp_u__24); - Py_CLEAR(clear_module_state->__pyx_kp_u__25); - Py_CLEAR(clear_module_state->__pyx_n_s__26); + Py_CLEAR(clear_module_state->__pyx_n_s__25); + Py_CLEAR(clear_module_state->__pyx_kp_b__3); Py_CLEAR(clear_module_state->__pyx_kp_u__3); Py_CLEAR(clear_module_state->__pyx_kp_b__4); Py_CLEAR(clear_module_state->__pyx_kp_u__4); - Py_CLEAR(clear_module_state->__pyx_kp_b__5); Py_CLEAR(clear_module_state->__pyx_kp_u__5); - Py_CLEAR(clear_module_state->__pyx_kp_u__6); - Py_CLEAR(clear_module_state->__pyx_kp_u__73); - Py_CLEAR(clear_module_state->__pyx_n_s__76); + Py_CLEAR(clear_module_state->__pyx_kp_u__7); + Py_CLEAR(clear_module_state->__pyx_kp_u__72); + Py_CLEAR(clear_module_state->__pyx_kp_u__75); + Py_CLEAR(clear_module_state->__pyx_kp_u__76); + Py_CLEAR(clear_module_state->__pyx_kp_u__77); + Py_CLEAR(clear_module_state->__pyx_kp_b__78); + Py_CLEAR(clear_module_state->__pyx_kp_u__78); Py_CLEAR(clear_module_state->__pyx_kp_u__79); Py_CLEAR(clear_module_state->__pyx_kp_u__8); Py_CLEAR(clear_module_state->__pyx_kp_u__80); - Py_CLEAR(clear_module_state->__pyx_kp_u__81); + Py_CLEAR(clear_module_state->__pyx_kp_b__81); Py_CLEAR(clear_module_state->__pyx_kp_b__82); - Py_CLEAR(clear_module_state->__pyx_kp_u__82); Py_CLEAR(clear_module_state->__pyx_kp_u__83); - Py_CLEAR(clear_module_state->__pyx_kp_u__84); Py_CLEAR(clear_module_state->__pyx_kp_b__85); - Py_CLEAR(clear_module_state->__pyx_kp_b__86); - Py_CLEAR(clear_module_state->__pyx_kp_u__87); + Py_CLEAR(clear_module_state->__pyx_kp_b__88); Py_CLEAR(clear_module_state->__pyx_kp_b__89); Py_CLEAR(clear_module_state->__pyx_kp_u__9); - Py_CLEAR(clear_module_state->__pyx_kp_b__92); - Py_CLEAR(clear_module_state->__pyx_kp_b__93); - Py_CLEAR(clear_module_state->__pyx_kp_u__94); - Py_CLEAR(clear_module_state->__pyx_kp_u__95); + Py_CLEAR(clear_module_state->__pyx_kp_u__90); + Py_CLEAR(clear_module_state->__pyx_kp_u__91); Py_CLEAR(clear_module_state->__pyx_n_s_address); Py_CLEAR(clear_module_state->__pyx_n_s_annotations); Py_CLEAR(clear_module_state->__pyx_kp_u_ansi_x3_4_1968); @@ -4127,9 +4106,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_be_strict); Py_CLEAR(clear_module_state->__pyx_n_u_big5); Py_CLEAR(clear_module_state->__pyx_kp_u_big5_hkscs); - Py_CLEAR(clear_module_state->__pyx_n_s_bool); + Py_CLEAR(clear_module_state->__pyx_n_s_bint); Py_CLEAR(clear_module_state->__pyx_n_s_buffer); - Py_CLEAR(clear_module_state->__pyx_n_s_byte); Py_CLEAR(clear_module_state->__pyx_n_s_c); Py_CLEAR(clear_module_state->__pyx_n_s_check_bidi); Py_CLEAR(clear_module_state->__pyx_n_s_check_hyphens); @@ -4198,11 +4176,9 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_u_elot_928); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_encode); - Py_CLEAR(clear_module_state->__pyx_n_s_encode_output); Py_CLEAR(clear_module_state->__pyx_n_s_encode_set); Py_CLEAR(clear_module_state->__pyx_n_s_encoded); Py_CLEAR(clear_module_state->__pyx_n_s_encoded_code_points); - Py_CLEAR(clear_module_state->__pyx_n_s_encoder); Py_CLEAR(clear_module_state->__pyx_n_s_encoding); Py_CLEAR(clear_module_state->__pyx_n_s_ends_in_number); Py_CLEAR(clear_module_state->__pyx_n_s_ends_in_number_locals_genexpr); @@ -4343,7 +4319,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_149); Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_157); Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_58); - Py_CLEAR(clear_module_state->__pyx_n_s_isomorph); Py_CLEAR(clear_module_state->__pyx_n_s_keys); Py_CLEAR(clear_module_state->__pyx_n_u_koi); Py_CLEAR(clear_module_state->__pyx_n_u_koi8); @@ -4410,7 +4385,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_path); Py_CLEAR(clear_module_state->__pyx_n_s_path_safe_chars); Py_CLEAR(clear_module_state->__pyx_n_s_path_token_seen); - Py_CLEAR(clear_module_state->__pyx_n_s_percent_encode_after_encoding); Py_CLEAR(clear_module_state->__pyx_n_s_percent_encode_set); Py_CLEAR(clear_module_state->__pyx_n_s_piece); Py_CLEAR(clear_module_state->__pyx_n_s_piece_index); @@ -4450,7 +4424,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_shorten_path); Py_CLEAR(clear_module_state->__pyx_n_u_sjis); Py_CLEAR(clear_module_state->__pyx_n_s_skip_authority_shortcut); - Py_CLEAR(clear_module_state->__pyx_n_s_space_as_plus); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_starts_with_windows_drive_lette); Py_CLEAR(clear_module_state->__pyx_n_s_state); @@ -4529,18 +4502,18 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_int_10); Py_CLEAR(clear_module_state->__pyx_int_16); Py_CLEAR(clear_module_state->__pyx_int_21); - Py_CLEAR(clear_module_state->__pyx_int_32); Py_CLEAR(clear_module_state->__pyx_int_80); Py_CLEAR(clear_module_state->__pyx_int_255); Py_CLEAR(clear_module_state->__pyx_int_256); Py_CLEAR(clear_module_state->__pyx_int_443); Py_CLEAR(clear_module_state->__pyx_int_neg_1); Py_CLEAR(clear_module_state->__pyx_slice__2); - Py_CLEAR(clear_module_state->__pyx_tuple__7); - Py_CLEAR(clear_module_state->__pyx_slice__22); + Py_CLEAR(clear_module_state->__pyx_tuple__6); + Py_CLEAR(clear_module_state->__pyx_slice__21); + Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__12); - Py_CLEAR(clear_module_state->__pyx_tuple__13); - Py_CLEAR(clear_module_state->__pyx_tuple__27); + Py_CLEAR(clear_module_state->__pyx_tuple__26); + Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__31); @@ -4578,15 +4551,15 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_tuple__63); Py_CLEAR(clear_module_state->__pyx_tuple__64); Py_CLEAR(clear_module_state->__pyx_tuple__65); - Py_CLEAR(clear_module_state->__pyx_tuple__66); + Py_CLEAR(clear_module_state->__pyx_tuple__67); Py_CLEAR(clear_module_state->__pyx_tuple__68); - Py_CLEAR(clear_module_state->__pyx_tuple__69); - Py_CLEAR(clear_module_state->__pyx_tuple__71); - Py_CLEAR(clear_module_state->__pyx_tuple__74); - Py_CLEAR(clear_module_state->__pyx_tuple__77); - Py_CLEAR(clear_module_state->__pyx_tuple__88); - Py_CLEAR(clear_module_state->__pyx_tuple__90); - Py_CLEAR(clear_module_state->__pyx_tuple__91); + Py_CLEAR(clear_module_state->__pyx_tuple__70); + Py_CLEAR(clear_module_state->__pyx_tuple__73); + Py_CLEAR(clear_module_state->__pyx_tuple__84); + Py_CLEAR(clear_module_state->__pyx_tuple__86); + Py_CLEAR(clear_module_state->__pyx_tuple__87); + Py_CLEAR(clear_module_state->__pyx_tuple__92); + Py_CLEAR(clear_module_state->__pyx_tuple__94); Py_CLEAR(clear_module_state->__pyx_tuple__96); Py_CLEAR(clear_module_state->__pyx_tuple__98); Py_CLEAR(clear_module_state->__pyx_tuple__100); @@ -4595,23 +4568,22 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_tuple__106); Py_CLEAR(clear_module_state->__pyx_tuple__108); Py_CLEAR(clear_module_state->__pyx_tuple__110); - Py_CLEAR(clear_module_state->__pyx_tuple__112); Py_CLEAR(clear_module_state->__pyx_tuple__114); + Py_CLEAR(clear_module_state->__pyx_tuple__116); Py_CLEAR(clear_module_state->__pyx_tuple__118); Py_CLEAR(clear_module_state->__pyx_tuple__120); Py_CLEAR(clear_module_state->__pyx_tuple__122); Py_CLEAR(clear_module_state->__pyx_tuple__124); - Py_CLEAR(clear_module_state->__pyx_tuple__126); - Py_CLEAR(clear_module_state->__pyx_tuple__128); + Py_CLEAR(clear_module_state->__pyx_tuple__127); + Py_CLEAR(clear_module_state->__pyx_tuple__129); Py_CLEAR(clear_module_state->__pyx_tuple__131); - Py_CLEAR(clear_module_state->__pyx_tuple__133); - Py_CLEAR(clear_module_state->__pyx_tuple__135); - Py_CLEAR(clear_module_state->__pyx_codeobj__28); - Py_CLEAR(clear_module_state->__pyx_codeobj__67); - Py_CLEAR(clear_module_state->__pyx_codeobj__70); - Py_CLEAR(clear_module_state->__pyx_codeobj__72); - Py_CLEAR(clear_module_state->__pyx_codeobj__75); - Py_CLEAR(clear_module_state->__pyx_codeobj__78); + Py_CLEAR(clear_module_state->__pyx_codeobj__27); + Py_CLEAR(clear_module_state->__pyx_codeobj__66); + Py_CLEAR(clear_module_state->__pyx_codeobj__69); + Py_CLEAR(clear_module_state->__pyx_codeobj__71); + Py_CLEAR(clear_module_state->__pyx_codeobj__74); + Py_CLEAR(clear_module_state->__pyx_codeobj__93); + Py_CLEAR(clear_module_state->__pyx_codeobj__95); Py_CLEAR(clear_module_state->__pyx_codeobj__97); Py_CLEAR(clear_module_state->__pyx_codeobj__99); Py_CLEAR(clear_module_state->__pyx_codeobj__101); @@ -4620,20 +4592,18 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_codeobj__107); Py_CLEAR(clear_module_state->__pyx_codeobj__109); Py_CLEAR(clear_module_state->__pyx_codeobj__111); + Py_CLEAR(clear_module_state->__pyx_codeobj__112); Py_CLEAR(clear_module_state->__pyx_codeobj__113); Py_CLEAR(clear_module_state->__pyx_codeobj__115); - Py_CLEAR(clear_module_state->__pyx_codeobj__116); Py_CLEAR(clear_module_state->__pyx_codeobj__117); Py_CLEAR(clear_module_state->__pyx_codeobj__119); Py_CLEAR(clear_module_state->__pyx_codeobj__121); Py_CLEAR(clear_module_state->__pyx_codeobj__123); Py_CLEAR(clear_module_state->__pyx_codeobj__125); - Py_CLEAR(clear_module_state->__pyx_codeobj__127); - Py_CLEAR(clear_module_state->__pyx_codeobj__129); + Py_CLEAR(clear_module_state->__pyx_codeobj__126); + Py_CLEAR(clear_module_state->__pyx_codeobj__128); Py_CLEAR(clear_module_state->__pyx_codeobj__130); Py_CLEAR(clear_module_state->__pyx_codeobj__132); - Py_CLEAR(clear_module_state->__pyx_codeobj__134); - Py_CLEAR(clear_module_state->__pyx_codeobj__136); return 0; } #endif @@ -4742,7 +4712,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS); Py_VISIT(traverse_module_state->__pyx_n_s_SPECIAL_SCHEMES); Py_VISIT(traverse_module_state->__pyx_n_s_Tuple); - Py_VISIT(traverse_module_state->__pyx_kp_s_Tuple_int_bool); + Py_VISIT(traverse_module_state->__pyx_kp_s_Tuple_int_bint); Py_VISIT(traverse_module_state->__pyx_n_s_URL); Py_VISIT(traverse_module_state->__pyx_n_s_URL___init); Py_VISIT(traverse_module_state->__pyx_kp_u_URL_is_relative); @@ -4754,47 +4724,45 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_UTF_8_ENCODING); Py_VISIT(traverse_module_state->__pyx_n_s_Union); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); - Py_VISIT(traverse_module_state->__pyx_kp_u__10); Py_VISIT(traverse_module_state->__pyx_kp_u__11); + Py_VISIT(traverse_module_state->__pyx_kp_u__13); Py_VISIT(traverse_module_state->__pyx_kp_u__14); Py_VISIT(traverse_module_state->__pyx_kp_u__15); Py_VISIT(traverse_module_state->__pyx_kp_u__16); Py_VISIT(traverse_module_state->__pyx_kp_u__17); + Py_VISIT(traverse_module_state->__pyx_n_s__18); Py_VISIT(traverse_module_state->__pyx_kp_u__18); - Py_VISIT(traverse_module_state->__pyx_n_s__19); + Py_VISIT(traverse_module_state->__pyx_kp_b__19); Py_VISIT(traverse_module_state->__pyx_kp_u__19); - Py_VISIT(traverse_module_state->__pyx_kp_b__20); Py_VISIT(traverse_module_state->__pyx_kp_u__20); - Py_VISIT(traverse_module_state->__pyx_kp_u__21); + Py_VISIT(traverse_module_state->__pyx_kp_u__22); Py_VISIT(traverse_module_state->__pyx_kp_u__23); Py_VISIT(traverse_module_state->__pyx_kp_u__24); - Py_VISIT(traverse_module_state->__pyx_kp_u__25); - Py_VISIT(traverse_module_state->__pyx_n_s__26); + Py_VISIT(traverse_module_state->__pyx_n_s__25); + Py_VISIT(traverse_module_state->__pyx_kp_b__3); Py_VISIT(traverse_module_state->__pyx_kp_u__3); Py_VISIT(traverse_module_state->__pyx_kp_b__4); Py_VISIT(traverse_module_state->__pyx_kp_u__4); - Py_VISIT(traverse_module_state->__pyx_kp_b__5); Py_VISIT(traverse_module_state->__pyx_kp_u__5); - Py_VISIT(traverse_module_state->__pyx_kp_u__6); - Py_VISIT(traverse_module_state->__pyx_kp_u__73); - Py_VISIT(traverse_module_state->__pyx_n_s__76); + Py_VISIT(traverse_module_state->__pyx_kp_u__7); + Py_VISIT(traverse_module_state->__pyx_kp_u__72); + Py_VISIT(traverse_module_state->__pyx_kp_u__75); + Py_VISIT(traverse_module_state->__pyx_kp_u__76); + Py_VISIT(traverse_module_state->__pyx_kp_u__77); + Py_VISIT(traverse_module_state->__pyx_kp_b__78); + Py_VISIT(traverse_module_state->__pyx_kp_u__78); Py_VISIT(traverse_module_state->__pyx_kp_u__79); Py_VISIT(traverse_module_state->__pyx_kp_u__8); Py_VISIT(traverse_module_state->__pyx_kp_u__80); - Py_VISIT(traverse_module_state->__pyx_kp_u__81); + Py_VISIT(traverse_module_state->__pyx_kp_b__81); Py_VISIT(traverse_module_state->__pyx_kp_b__82); - Py_VISIT(traverse_module_state->__pyx_kp_u__82); Py_VISIT(traverse_module_state->__pyx_kp_u__83); - Py_VISIT(traverse_module_state->__pyx_kp_u__84); Py_VISIT(traverse_module_state->__pyx_kp_b__85); - Py_VISIT(traverse_module_state->__pyx_kp_b__86); - Py_VISIT(traverse_module_state->__pyx_kp_u__87); + Py_VISIT(traverse_module_state->__pyx_kp_b__88); Py_VISIT(traverse_module_state->__pyx_kp_b__89); Py_VISIT(traverse_module_state->__pyx_kp_u__9); - Py_VISIT(traverse_module_state->__pyx_kp_b__92); - Py_VISIT(traverse_module_state->__pyx_kp_b__93); - Py_VISIT(traverse_module_state->__pyx_kp_u__94); - Py_VISIT(traverse_module_state->__pyx_kp_u__95); + Py_VISIT(traverse_module_state->__pyx_kp_u__90); + Py_VISIT(traverse_module_state->__pyx_kp_u__91); Py_VISIT(traverse_module_state->__pyx_n_s_address); Py_VISIT(traverse_module_state->__pyx_n_s_annotations); Py_VISIT(traverse_module_state->__pyx_kp_u_ansi_x3_4_1968); @@ -4812,9 +4780,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_be_strict); Py_VISIT(traverse_module_state->__pyx_n_u_big5); Py_VISIT(traverse_module_state->__pyx_kp_u_big5_hkscs); - Py_VISIT(traverse_module_state->__pyx_n_s_bool); + Py_VISIT(traverse_module_state->__pyx_n_s_bint); Py_VISIT(traverse_module_state->__pyx_n_s_buffer); - Py_VISIT(traverse_module_state->__pyx_n_s_byte); Py_VISIT(traverse_module_state->__pyx_n_s_c); Py_VISIT(traverse_module_state->__pyx_n_s_check_bidi); Py_VISIT(traverse_module_state->__pyx_n_s_check_hyphens); @@ -4883,11 +4850,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_u_elot_928); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_encode); - Py_VISIT(traverse_module_state->__pyx_n_s_encode_output); Py_VISIT(traverse_module_state->__pyx_n_s_encode_set); Py_VISIT(traverse_module_state->__pyx_n_s_encoded); Py_VISIT(traverse_module_state->__pyx_n_s_encoded_code_points); - Py_VISIT(traverse_module_state->__pyx_n_s_encoder); Py_VISIT(traverse_module_state->__pyx_n_s_encoding); Py_VISIT(traverse_module_state->__pyx_n_s_ends_in_number); Py_VISIT(traverse_module_state->__pyx_n_s_ends_in_number_locals_genexpr); @@ -5028,7 +4993,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_149); Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_157); Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_58); - Py_VISIT(traverse_module_state->__pyx_n_s_isomorph); Py_VISIT(traverse_module_state->__pyx_n_s_keys); Py_VISIT(traverse_module_state->__pyx_n_u_koi); Py_VISIT(traverse_module_state->__pyx_n_u_koi8); @@ -5095,7 +5059,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_path); Py_VISIT(traverse_module_state->__pyx_n_s_path_safe_chars); Py_VISIT(traverse_module_state->__pyx_n_s_path_token_seen); - Py_VISIT(traverse_module_state->__pyx_n_s_percent_encode_after_encoding); Py_VISIT(traverse_module_state->__pyx_n_s_percent_encode_set); Py_VISIT(traverse_module_state->__pyx_n_s_piece); Py_VISIT(traverse_module_state->__pyx_n_s_piece_index); @@ -5135,7 +5098,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_shorten_path); Py_VISIT(traverse_module_state->__pyx_n_u_sjis); Py_VISIT(traverse_module_state->__pyx_n_s_skip_authority_shortcut); - Py_VISIT(traverse_module_state->__pyx_n_s_space_as_plus); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_starts_with_windows_drive_lette); Py_VISIT(traverse_module_state->__pyx_n_s_state); @@ -5214,18 +5176,18 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_int_10); Py_VISIT(traverse_module_state->__pyx_int_16); Py_VISIT(traverse_module_state->__pyx_int_21); - Py_VISIT(traverse_module_state->__pyx_int_32); Py_VISIT(traverse_module_state->__pyx_int_80); Py_VISIT(traverse_module_state->__pyx_int_255); Py_VISIT(traverse_module_state->__pyx_int_256); Py_VISIT(traverse_module_state->__pyx_int_443); Py_VISIT(traverse_module_state->__pyx_int_neg_1); Py_VISIT(traverse_module_state->__pyx_slice__2); - Py_VISIT(traverse_module_state->__pyx_tuple__7); - Py_VISIT(traverse_module_state->__pyx_slice__22); + Py_VISIT(traverse_module_state->__pyx_tuple__6); + Py_VISIT(traverse_module_state->__pyx_slice__21); + Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__12); - Py_VISIT(traverse_module_state->__pyx_tuple__13); - Py_VISIT(traverse_module_state->__pyx_tuple__27); + Py_VISIT(traverse_module_state->__pyx_tuple__26); + Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__31); @@ -5263,15 +5225,15 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_tuple__63); Py_VISIT(traverse_module_state->__pyx_tuple__64); Py_VISIT(traverse_module_state->__pyx_tuple__65); - Py_VISIT(traverse_module_state->__pyx_tuple__66); + Py_VISIT(traverse_module_state->__pyx_tuple__67); Py_VISIT(traverse_module_state->__pyx_tuple__68); - Py_VISIT(traverse_module_state->__pyx_tuple__69); - Py_VISIT(traverse_module_state->__pyx_tuple__71); - Py_VISIT(traverse_module_state->__pyx_tuple__74); - Py_VISIT(traverse_module_state->__pyx_tuple__77); - Py_VISIT(traverse_module_state->__pyx_tuple__88); - Py_VISIT(traverse_module_state->__pyx_tuple__90); - Py_VISIT(traverse_module_state->__pyx_tuple__91); + Py_VISIT(traverse_module_state->__pyx_tuple__70); + Py_VISIT(traverse_module_state->__pyx_tuple__73); + Py_VISIT(traverse_module_state->__pyx_tuple__84); + Py_VISIT(traverse_module_state->__pyx_tuple__86); + Py_VISIT(traverse_module_state->__pyx_tuple__87); + Py_VISIT(traverse_module_state->__pyx_tuple__92); + Py_VISIT(traverse_module_state->__pyx_tuple__94); Py_VISIT(traverse_module_state->__pyx_tuple__96); Py_VISIT(traverse_module_state->__pyx_tuple__98); Py_VISIT(traverse_module_state->__pyx_tuple__100); @@ -5280,23 +5242,22 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_tuple__106); Py_VISIT(traverse_module_state->__pyx_tuple__108); Py_VISIT(traverse_module_state->__pyx_tuple__110); - Py_VISIT(traverse_module_state->__pyx_tuple__112); Py_VISIT(traverse_module_state->__pyx_tuple__114); + Py_VISIT(traverse_module_state->__pyx_tuple__116); Py_VISIT(traverse_module_state->__pyx_tuple__118); Py_VISIT(traverse_module_state->__pyx_tuple__120); Py_VISIT(traverse_module_state->__pyx_tuple__122); Py_VISIT(traverse_module_state->__pyx_tuple__124); - Py_VISIT(traverse_module_state->__pyx_tuple__126); - Py_VISIT(traverse_module_state->__pyx_tuple__128); + Py_VISIT(traverse_module_state->__pyx_tuple__127); + Py_VISIT(traverse_module_state->__pyx_tuple__129); Py_VISIT(traverse_module_state->__pyx_tuple__131); - Py_VISIT(traverse_module_state->__pyx_tuple__133); - Py_VISIT(traverse_module_state->__pyx_tuple__135); - Py_VISIT(traverse_module_state->__pyx_codeobj__28); - Py_VISIT(traverse_module_state->__pyx_codeobj__67); - Py_VISIT(traverse_module_state->__pyx_codeobj__70); - Py_VISIT(traverse_module_state->__pyx_codeobj__72); - Py_VISIT(traverse_module_state->__pyx_codeobj__75); - Py_VISIT(traverse_module_state->__pyx_codeobj__78); + Py_VISIT(traverse_module_state->__pyx_codeobj__27); + Py_VISIT(traverse_module_state->__pyx_codeobj__66); + Py_VISIT(traverse_module_state->__pyx_codeobj__69); + Py_VISIT(traverse_module_state->__pyx_codeobj__71); + Py_VISIT(traverse_module_state->__pyx_codeobj__74); + Py_VISIT(traverse_module_state->__pyx_codeobj__93); + Py_VISIT(traverse_module_state->__pyx_codeobj__95); Py_VISIT(traverse_module_state->__pyx_codeobj__97); Py_VISIT(traverse_module_state->__pyx_codeobj__99); Py_VISIT(traverse_module_state->__pyx_codeobj__101); @@ -5305,20 +5266,18 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_codeobj__107); Py_VISIT(traverse_module_state->__pyx_codeobj__109); Py_VISIT(traverse_module_state->__pyx_codeobj__111); + Py_VISIT(traverse_module_state->__pyx_codeobj__112); Py_VISIT(traverse_module_state->__pyx_codeobj__113); Py_VISIT(traverse_module_state->__pyx_codeobj__115); - Py_VISIT(traverse_module_state->__pyx_codeobj__116); Py_VISIT(traverse_module_state->__pyx_codeobj__117); Py_VISIT(traverse_module_state->__pyx_codeobj__119); Py_VISIT(traverse_module_state->__pyx_codeobj__121); Py_VISIT(traverse_module_state->__pyx_codeobj__123); Py_VISIT(traverse_module_state->__pyx_codeobj__125); - Py_VISIT(traverse_module_state->__pyx_codeobj__127); - Py_VISIT(traverse_module_state->__pyx_codeobj__129); + Py_VISIT(traverse_module_state->__pyx_codeobj__126); + Py_VISIT(traverse_module_state->__pyx_codeobj__128); Py_VISIT(traverse_module_state->__pyx_codeobj__130); Py_VISIT(traverse_module_state->__pyx_codeobj__132); - Py_VISIT(traverse_module_state->__pyx_codeobj__134); - Py_VISIT(traverse_module_state->__pyx_codeobj__136); return 0; } #endif @@ -5439,7 +5398,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS __pyx_mstate_global->__pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS #define __pyx_n_s_SPECIAL_SCHEMES __pyx_mstate_global->__pyx_n_s_SPECIAL_SCHEMES #define __pyx_n_s_Tuple __pyx_mstate_global->__pyx_n_s_Tuple -#define __pyx_kp_s_Tuple_int_bool __pyx_mstate_global->__pyx_kp_s_Tuple_int_bool +#define __pyx_kp_s_Tuple_int_bint __pyx_mstate_global->__pyx_kp_s_Tuple_int_bint #define __pyx_n_s_URL __pyx_mstate_global->__pyx_n_s_URL #define __pyx_n_s_URL___init __pyx_mstate_global->__pyx_n_s_URL___init #define __pyx_kp_u_URL_is_relative __pyx_mstate_global->__pyx_kp_u_URL_is_relative @@ -5451,47 +5410,45 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_UTF_8_ENCODING __pyx_mstate_global->__pyx_n_s_UTF_8_ENCODING #define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError -#define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10 #define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11 +#define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13 #define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14 #define __pyx_kp_u__15 __pyx_mstate_global->__pyx_kp_u__15 #define __pyx_kp_u__16 __pyx_mstate_global->__pyx_kp_u__16 #define __pyx_kp_u__17 __pyx_mstate_global->__pyx_kp_u__17 +#define __pyx_n_s__18 __pyx_mstate_global->__pyx_n_s__18 #define __pyx_kp_u__18 __pyx_mstate_global->__pyx_kp_u__18 -#define __pyx_n_s__19 __pyx_mstate_global->__pyx_n_s__19 +#define __pyx_kp_b__19 __pyx_mstate_global->__pyx_kp_b__19 #define __pyx_kp_u__19 __pyx_mstate_global->__pyx_kp_u__19 -#define __pyx_kp_b__20 __pyx_mstate_global->__pyx_kp_b__20 #define __pyx_kp_u__20 __pyx_mstate_global->__pyx_kp_u__20 -#define __pyx_kp_u__21 __pyx_mstate_global->__pyx_kp_u__21 +#define __pyx_kp_u__22 __pyx_mstate_global->__pyx_kp_u__22 #define __pyx_kp_u__23 __pyx_mstate_global->__pyx_kp_u__23 #define __pyx_kp_u__24 __pyx_mstate_global->__pyx_kp_u__24 -#define __pyx_kp_u__25 __pyx_mstate_global->__pyx_kp_u__25 -#define __pyx_n_s__26 __pyx_mstate_global->__pyx_n_s__26 +#define __pyx_n_s__25 __pyx_mstate_global->__pyx_n_s__25 +#define __pyx_kp_b__3 __pyx_mstate_global->__pyx_kp_b__3 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 #define __pyx_kp_b__4 __pyx_mstate_global->__pyx_kp_b__4 #define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 -#define __pyx_kp_b__5 __pyx_mstate_global->__pyx_kp_b__5 #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 -#define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 -#define __pyx_kp_u__73 __pyx_mstate_global->__pyx_kp_u__73 -#define __pyx_n_s__76 __pyx_mstate_global->__pyx_n_s__76 +#define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 +#define __pyx_kp_u__72 __pyx_mstate_global->__pyx_kp_u__72 +#define __pyx_kp_u__75 __pyx_mstate_global->__pyx_kp_u__75 +#define __pyx_kp_u__76 __pyx_mstate_global->__pyx_kp_u__76 +#define __pyx_kp_u__77 __pyx_mstate_global->__pyx_kp_u__77 +#define __pyx_kp_b__78 __pyx_mstate_global->__pyx_kp_b__78 +#define __pyx_kp_u__78 __pyx_mstate_global->__pyx_kp_u__78 #define __pyx_kp_u__79 __pyx_mstate_global->__pyx_kp_u__79 #define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8 #define __pyx_kp_u__80 __pyx_mstate_global->__pyx_kp_u__80 -#define __pyx_kp_u__81 __pyx_mstate_global->__pyx_kp_u__81 +#define __pyx_kp_b__81 __pyx_mstate_global->__pyx_kp_b__81 #define __pyx_kp_b__82 __pyx_mstate_global->__pyx_kp_b__82 -#define __pyx_kp_u__82 __pyx_mstate_global->__pyx_kp_u__82 #define __pyx_kp_u__83 __pyx_mstate_global->__pyx_kp_u__83 -#define __pyx_kp_u__84 __pyx_mstate_global->__pyx_kp_u__84 #define __pyx_kp_b__85 __pyx_mstate_global->__pyx_kp_b__85 -#define __pyx_kp_b__86 __pyx_mstate_global->__pyx_kp_b__86 -#define __pyx_kp_u__87 __pyx_mstate_global->__pyx_kp_u__87 +#define __pyx_kp_b__88 __pyx_mstate_global->__pyx_kp_b__88 #define __pyx_kp_b__89 __pyx_mstate_global->__pyx_kp_b__89 #define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9 -#define __pyx_kp_b__92 __pyx_mstate_global->__pyx_kp_b__92 -#define __pyx_kp_b__93 __pyx_mstate_global->__pyx_kp_b__93 -#define __pyx_kp_u__94 __pyx_mstate_global->__pyx_kp_u__94 -#define __pyx_kp_u__95 __pyx_mstate_global->__pyx_kp_u__95 +#define __pyx_kp_u__90 __pyx_mstate_global->__pyx_kp_u__90 +#define __pyx_kp_u__91 __pyx_mstate_global->__pyx_kp_u__91 #define __pyx_n_s_address __pyx_mstate_global->__pyx_n_s_address #define __pyx_n_s_annotations __pyx_mstate_global->__pyx_n_s_annotations #define __pyx_kp_u_ansi_x3_4_1968 __pyx_mstate_global->__pyx_kp_u_ansi_x3_4_1968 @@ -5509,9 +5466,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_be_strict __pyx_mstate_global->__pyx_n_s_be_strict #define __pyx_n_u_big5 __pyx_mstate_global->__pyx_n_u_big5 #define __pyx_kp_u_big5_hkscs __pyx_mstate_global->__pyx_kp_u_big5_hkscs -#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool +#define __pyx_n_s_bint __pyx_mstate_global->__pyx_n_s_bint #define __pyx_n_s_buffer __pyx_mstate_global->__pyx_n_s_buffer -#define __pyx_n_s_byte __pyx_mstate_global->__pyx_n_s_byte #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c #define __pyx_n_s_check_bidi __pyx_mstate_global->__pyx_n_s_check_bidi #define __pyx_n_s_check_hyphens __pyx_mstate_global->__pyx_n_s_check_hyphens @@ -5580,11 +5536,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_u_elot_928 __pyx_mstate_global->__pyx_n_u_elot_928 #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode -#define __pyx_n_s_encode_output __pyx_mstate_global->__pyx_n_s_encode_output #define __pyx_n_s_encode_set __pyx_mstate_global->__pyx_n_s_encode_set #define __pyx_n_s_encoded __pyx_mstate_global->__pyx_n_s_encoded #define __pyx_n_s_encoded_code_points __pyx_mstate_global->__pyx_n_s_encoded_code_points -#define __pyx_n_s_encoder __pyx_mstate_global->__pyx_n_s_encoder #define __pyx_n_s_encoding __pyx_mstate_global->__pyx_n_s_encoding #define __pyx_n_s_ends_in_number __pyx_mstate_global->__pyx_n_s_ends_in_number #define __pyx_n_s_ends_in_number_locals_genexpr __pyx_mstate_global->__pyx_n_s_ends_in_number_locals_genexpr @@ -5725,7 +5679,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_u_iso_ir_149 __pyx_mstate_global->__pyx_kp_u_iso_ir_149 #define __pyx_kp_u_iso_ir_157 __pyx_mstate_global->__pyx_kp_u_iso_ir_157 #define __pyx_kp_u_iso_ir_58 __pyx_mstate_global->__pyx_kp_u_iso_ir_58 -#define __pyx_n_s_isomorph __pyx_mstate_global->__pyx_n_s_isomorph #define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys #define __pyx_n_u_koi __pyx_mstate_global->__pyx_n_u_koi #define __pyx_n_u_koi8 __pyx_mstate_global->__pyx_n_u_koi8 @@ -5792,7 +5745,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path #define __pyx_n_s_path_safe_chars __pyx_mstate_global->__pyx_n_s_path_safe_chars #define __pyx_n_s_path_token_seen __pyx_mstate_global->__pyx_n_s_path_token_seen -#define __pyx_n_s_percent_encode_after_encoding __pyx_mstate_global->__pyx_n_s_percent_encode_after_encoding #define __pyx_n_s_percent_encode_set __pyx_mstate_global->__pyx_n_s_percent_encode_set #define __pyx_n_s_piece __pyx_mstate_global->__pyx_n_s_piece #define __pyx_n_s_piece_index __pyx_mstate_global->__pyx_n_s_piece_index @@ -5832,7 +5784,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_shorten_path __pyx_mstate_global->__pyx_n_s_shorten_path #define __pyx_n_u_sjis __pyx_mstate_global->__pyx_n_u_sjis #define __pyx_n_s_skip_authority_shortcut __pyx_mstate_global->__pyx_n_s_skip_authority_shortcut -#define __pyx_n_s_space_as_plus __pyx_mstate_global->__pyx_n_s_space_as_plus #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_starts_with_windows_drive_lette __pyx_mstate_global->__pyx_n_s_starts_with_windows_drive_lette #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state @@ -5911,18 +5862,18 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_int_10 __pyx_mstate_global->__pyx_int_10 #define __pyx_int_16 __pyx_mstate_global->__pyx_int_16 #define __pyx_int_21 __pyx_mstate_global->__pyx_int_21 -#define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 #define __pyx_int_80 __pyx_mstate_global->__pyx_int_80 #define __pyx_int_255 __pyx_mstate_global->__pyx_int_255 #define __pyx_int_256 __pyx_mstate_global->__pyx_int_256 #define __pyx_int_443 __pyx_mstate_global->__pyx_int_443 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 #define __pyx_slice__2 __pyx_mstate_global->__pyx_slice__2 -#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 -#define __pyx_slice__22 __pyx_mstate_global->__pyx_slice__22 +#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 +#define __pyx_slice__21 __pyx_mstate_global->__pyx_slice__21 +#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 -#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 -#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 +#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 +#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 @@ -5960,15 +5911,15 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63 #define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 #define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 -#define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 +#define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 #define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 -#define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 -#define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 -#define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74 -#define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77 -#define __pyx_tuple__88 __pyx_mstate_global->__pyx_tuple__88 -#define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90 -#define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91 +#define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70 +#define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 +#define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84 +#define __pyx_tuple__86 __pyx_mstate_global->__pyx_tuple__86 +#define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87 +#define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92 +#define __pyx_tuple__94 __pyx_mstate_global->__pyx_tuple__94 #define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96 #define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98 #define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100 @@ -5977,23 +5928,22 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_tuple__106 __pyx_mstate_global->__pyx_tuple__106 #define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108 #define __pyx_tuple__110 __pyx_mstate_global->__pyx_tuple__110 -#define __pyx_tuple__112 __pyx_mstate_global->__pyx_tuple__112 #define __pyx_tuple__114 __pyx_mstate_global->__pyx_tuple__114 +#define __pyx_tuple__116 __pyx_mstate_global->__pyx_tuple__116 #define __pyx_tuple__118 __pyx_mstate_global->__pyx_tuple__118 #define __pyx_tuple__120 __pyx_mstate_global->__pyx_tuple__120 #define __pyx_tuple__122 __pyx_mstate_global->__pyx_tuple__122 #define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124 -#define __pyx_tuple__126 __pyx_mstate_global->__pyx_tuple__126 -#define __pyx_tuple__128 __pyx_mstate_global->__pyx_tuple__128 +#define __pyx_tuple__127 __pyx_mstate_global->__pyx_tuple__127 +#define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129 #define __pyx_tuple__131 __pyx_mstate_global->__pyx_tuple__131 -#define __pyx_tuple__133 __pyx_mstate_global->__pyx_tuple__133 -#define __pyx_tuple__135 __pyx_mstate_global->__pyx_tuple__135 -#define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 -#define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67 -#define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 -#define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72 -#define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75 -#define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78 +#define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 +#define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 +#define __pyx_codeobj__69 __pyx_mstate_global->__pyx_codeobj__69 +#define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71 +#define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74 +#define __pyx_codeobj__93 __pyx_mstate_global->__pyx_codeobj__93 +#define __pyx_codeobj__95 __pyx_mstate_global->__pyx_codeobj__95 #define __pyx_codeobj__97 __pyx_mstate_global->__pyx_codeobj__97 #define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99 #define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101 @@ -6002,20 +5952,18 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_codeobj__107 __pyx_mstate_global->__pyx_codeobj__107 #define __pyx_codeobj__109 __pyx_mstate_global->__pyx_codeobj__109 #define __pyx_codeobj__111 __pyx_mstate_global->__pyx_codeobj__111 +#define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112 #define __pyx_codeobj__113 __pyx_mstate_global->__pyx_codeobj__113 #define __pyx_codeobj__115 __pyx_mstate_global->__pyx_codeobj__115 -#define __pyx_codeobj__116 __pyx_mstate_global->__pyx_codeobj__116 #define __pyx_codeobj__117 __pyx_mstate_global->__pyx_codeobj__117 #define __pyx_codeobj__119 __pyx_mstate_global->__pyx_codeobj__119 #define __pyx_codeobj__121 __pyx_mstate_global->__pyx_codeobj__121 #define __pyx_codeobj__123 __pyx_mstate_global->__pyx_codeobj__123 #define __pyx_codeobj__125 __pyx_mstate_global->__pyx_codeobj__125 -#define __pyx_codeobj__127 __pyx_mstate_global->__pyx_codeobj__127 -#define __pyx_codeobj__129 __pyx_mstate_global->__pyx_codeobj__129 +#define __pyx_codeobj__126 __pyx_mstate_global->__pyx_codeobj__126 +#define __pyx_codeobj__128 __pyx_mstate_global->__pyx_codeobj__128 #define __pyx_codeobj__130 __pyx_mstate_global->__pyx_codeobj__130 #define __pyx_codeobj__132 __pyx_mstate_global->__pyx_codeobj__132 -#define __pyx_codeobj__134 __pyx_mstate_global->__pyx_codeobj__134 -#define __pyx_codeobj__136 __pyx_mstate_global->__pyx_codeobj__136 /* #### Code section: module_code ### */ /* "w3lib/_url.pyx":45 @@ -6931,7 +6879,7 @@ static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *__pyx_v_enc } /* "w3lib/_url.pyx":547 - * _fragment_token_seen: bool + * _fragment_token_seen: bint * * def __init__(self): # <<<<<<<<<<<<<< * self.scheme = "" @@ -7230,7 +7178,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_fragment_token_seen, Py_False) < 0) __PYX_ERR(0, 564, __pyx_L1_error) /* "w3lib/_url.pyx":547 - * _fragment_token_seen: bool + * _fragment_token_seen: bint * * def __init__(self): # <<<<<<<<<<<<<< * self.scheme = "" @@ -7499,168 +7447,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_6_shorten_path(CYTHON_UNUSED PyObject *__ /* "w3lib/_url.pyx":580 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. - * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input: str, - * *, - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_9_percent_encode_after_encoding = {"_percent_encode_after_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_input = 0; - PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_v_percent_encode_set = 0; - PyObject *__pyx_v_space_as_plus = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[4] = {0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_percent_encode_after_encoding (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_encoding,&__pyx_n_s_percent_encode_set,&__pyx_n_s_space_as_plus,0}; - - /* "w3lib/_url.pyx":585 - * encoding: str, - * percent_encode_set: _PercentEncodeSet, - * space_as_plus: bool = False, # <<<<<<<<<<<<<< - * ) -> str: - * encoder = _get_encoder(encoding) - */ - values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (likely(__pyx_kwds)) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) - else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 580, __pyx_L3_error) - } - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_percent_encode_set)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) - else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_percent_encode_set); __PYX_ERR(0, 580, __pyx_L3_error) - } - } - if (kw_args == 1) { - const Py_ssize_t index = 3; - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); - if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_percent_encode_after_encoding") < 0)) __PYX_ERR(0, 580, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 580, __pyx_L3_error) - } - __pyx_v_input = ((PyObject*)values[0]); - __pyx_v_encoding = ((PyObject*)values[1]); - __pyx_v_percent_encode_set = values[2]; - __pyx_v_space_as_plus = values[3]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_percent_encode_after_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 580, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("w3lib._url._percent_encode_after_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 581, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 583, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(__pyx_self, __pyx_v_input, __pyx_v_encoding, __pyx_v_percent_encode_set, __pyx_v_space_as_plus); - - /* "w3lib/_url.pyx":580 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode - * # Extended to handled cases where % is to be percent-encoded. - * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * @cfunc # <<<<<<<<<<<<<< + * def _percent_encode_after_encoding( * input: str, - * *, */ - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set, PyObject *__pyx_v_space_as_plus) { +static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set) { PyObject *__pyx_v_encoder = NULL; PyObject *__pyx_v_output = NULL; PyObject *__pyx_v_encode_output = NULL; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; + int __pyx_v_encode_output_length; PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_byte = NULL; PyObject *__pyx_v_isomorph = NULL; + int __pyx_v_next; + int __pyx_v_next_next; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -7673,14 +7475,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; int __pyx_t_10; - Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_percent_encode_after_encoding", 1); /* "w3lib/_url.pyx":587 - * space_as_plus: bool = False, + * percent_encode_set: _PercentEncodeSet, * ) -> str: * encoder = _get_encoder(encoding) # <<<<<<<<<<<<<< * output = "" @@ -7727,8 +7528,8 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B * # instead of &#NNN; * encode_output, _ = encoder(input, "xmlcharrefreplace") # <<<<<<<<<<<<<< - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate - * byte = encode_output[i] + * encode_output_length: cython.int = len(encode_output) + * for i in range(encode_output_length): # pylint: disable=consider-using-enumerate */ __Pyx_INCREF(__pyx_v_encoder); __pyx_t_2 = __pyx_v_encoder; __pyx_t_3 = NULL; @@ -7807,14 +7608,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN /* "w3lib/_url.pyx":592 * # instead of &#NNN; * encode_output, _ = encoder(input, "xmlcharrefreplace") - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< + * encode_output_length: cython.int = len(encode_output) # <<<<<<<<<<<<<< + * for i in range(encode_output_length): # pylint: disable=consider-using-enumerate * byte = encode_output[i] - * if space_as_plus and byte == 0x20: */ __pyx_t_7 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 592, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_v_encode_output_length = __pyx_t_7; + + /* "w3lib/_url.pyx":593 + * encode_output, _ = encoder(input, "xmlcharrefreplace") + * encode_output_length: cython.int = len(encode_output) + * for i in range(encode_output_length): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< + * byte = encode_output[i] + * isomorph = chr(byte) + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_encode_output_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -7822,9 +7632,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -7833,28 +7643,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 592, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 593, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 593, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 592, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 593, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 593, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -7864,7 +7674,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 592, __pyx_L1_error) + else __PYX_ERR(0, 593, __pyx_L1_error) } break; } @@ -7873,221 +7683,184 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":593 - * encode_output, _ = encoder(input, "xmlcharrefreplace") - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + /* "w3lib/_url.pyx":594 + * encode_output_length: cython.int = len(encode_output) + * for i in range(encode_output_length): # pylint: disable=consider-using-enumerate * byte = encode_output[i] # <<<<<<<<<<<<<< - * if space_as_plus and byte == 0x20: - * output += "+" + * isomorph = chr(byte) + * if isomorph not in percent_encode_set: */ - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_byte, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":594 - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate - * byte = encode_output[i] - * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< - * output += "+" - * continue - */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_space_as_plus); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 594, __pyx_L1_error) - if (__pyx_t_10) { - } else { - __pyx_t_9 = __pyx_t_10; - goto __pyx_L8_bool_binop_done; - } - __pyx_t_10 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_byte, __pyx_int_32, 0x20, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_9 = __pyx_t_10; - __pyx_L8_bool_binop_done:; - if (__pyx_t_9) { - - /* "w3lib/_url.pyx":595 + /* "w3lib/_url.pyx":595 + * for i in range(encode_output_length): # pylint: disable=consider-using-enumerate * byte = encode_output[i] - * if space_as_plus and byte == 0x20: - * output += "+" # <<<<<<<<<<<<<< - * continue - * isomorph = chr(byte) - */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); - __pyx_t_3 = 0; - - /* "w3lib/_url.pyx":596 - * if space_as_plus and byte == 0x20: - * output += "+" - * continue # <<<<<<<<<<<<<< - * isomorph = chr(byte) - * if isomorph not in percent_encode_set: - */ - goto __pyx_L5_continue; - - /* "w3lib/_url.pyx":594 - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate - * byte = encode_output[i] - * if space_as_plus and byte == 0x20: # <<<<<<<<<<<<<< - * output += "+" - * continue - */ - } - - /* "w3lib/_url.pyx":597 - * output += "+" - * continue * isomorph = chr(byte) # <<<<<<<<<<<<<< * if isomorph not in percent_encode_set: * output += isomorph */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_isomorph, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":598 - * continue + /* "w3lib/_url.pyx":596 + * byte = encode_output[i] * isomorph = chr(byte) * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< * output += isomorph * elif isomorph == "%": */ - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_isomorph, __pyx_v_percent_encode_set, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 598, __pyx_L1_error) + __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_isomorph, __pyx_v_percent_encode_set, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 596, __pyx_L1_error) if (__pyx_t_9) { - /* "w3lib/_url.pyx":599 + /* "w3lib/_url.pyx":597 * isomorph = chr(byte) * if isomorph not in percent_encode_set: * output += isomorph # <<<<<<<<<<<<<< * elif isomorph == "%": - * if ( + * next: cython.int = i + 1 */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_v_isomorph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_v_isomorph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":598 - * continue + /* "w3lib/_url.pyx":596 + * byte = encode_output[i] * isomorph = chr(byte) * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< * output += isomorph * elif isomorph == "%": */ - goto __pyx_L10; + goto __pyx_L7; } - /* "w3lib/_url.pyx":600 + /* "w3lib/_url.pyx":598 * if isomorph not in percent_encode_set: * output += isomorph * elif isomorph == "%": # <<<<<<<<<<<<<< - * if ( - * len(encode_output) <= i + 2 + * next: cython.int = i + 1 + * next_next: cython.int = i + 2 */ - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_isomorph, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_isomorph, __pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 598, __pyx_L1_error) if (__pyx_t_9) { - /* "w3lib/_url.pyx":602 + /* "w3lib/_url.pyx":599 + * output += isomorph * elif isomorph == "%": + * next: cython.int = i + 1 # <<<<<<<<<<<<<< + * next_next: cython.int = i + 2 * if ( - * len(encode_output) <= i + 2 # <<<<<<<<<<<<<< - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT - * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT */ - __pyx_t_11 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 602, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_next = __pyx_t_4; + + /* "w3lib/_url.pyx":600 + * elif isomorph == "%": + * next: cython.int = i + 1 + * next_next: cython.int = i + 2 # <<<<<<<<<<<<<< + * if ( + * encode_output_length <= next_next + */ + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_next_next = __pyx_t_4; + + /* "w3lib/_url.pyx":602 + * next_next: cython.int = i + 2 + * if ( + * encode_output_length <= next_next # <<<<<<<<<<<<<< + * or chr(encode_output[next]) not in _ASCII_HEX_DIGIT + * or chr(encode_output[next_next]) not in _ASCII_HEX_DIGIT + */ + __pyx_t_10 = (__pyx_v_encode_output_length <= __pyx_v_next_next); if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; - goto __pyx_L12_bool_binop_done; + goto __pyx_L9_bool_binop_done; } /* "w3lib/_url.pyx":603 * if ( - * len(encode_output) <= i + 2 - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< - * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT + * encode_output_length <= next_next + * or chr(encode_output[next]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * or chr(encode_output[next_next]) not in _ASCII_HEX_DIGIT * ): */ - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_encode_output, __pyx_v_next, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_3, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; - goto __pyx_L12_bool_binop_done; + goto __pyx_L9_bool_binop_done; } /* "w3lib/_url.pyx":604 - * len(encode_output) <= i + 2 - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT - * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< + * encode_output_length <= next_next + * or chr(encode_output[next]) not in _ASCII_HEX_DIGIT + * or chr(encode_output[next_next]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * ): * output += "%25" */ - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_encode_output, __pyx_v_next_next, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_3, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_t_10; - __pyx_L12_bool_binop_done:; + __pyx_L9_bool_binop_done:; /* "w3lib/_url.pyx":601 - * output += isomorph - * elif isomorph == "%": + * next: cython.int = i + 1 + * next_next: cython.int = i + 2 * if ( # <<<<<<<<<<<<<< - * len(encode_output) <= i + 2 - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT + * encode_output_length <= next_next + * or chr(encode_output[next]) not in _ASCII_HEX_DIGIT */ if (__pyx_t_9) { /* "w3lib/_url.pyx":606 - * or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT + * or chr(encode_output[next_next]) not in _ASCII_HEX_DIGIT * ): * output += "%25" # <<<<<<<<<<<<<< * else: * output += "%" */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u_25); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u_25); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); + __pyx_t_3 = 0; /* "w3lib/_url.pyx":601 - * output += isomorph - * elif isomorph == "%": + * next: cython.int = i + 1 + * next_next: cython.int = i + 2 * if ( # <<<<<<<<<<<<<< - * len(encode_output) <= i + 2 - * or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT + * encode_output_length <= next_next + * or chr(encode_output[next]) not in _ASCII_HEX_DIGIT */ - goto __pyx_L11; + goto __pyx_L8; } /* "w3lib/_url.pyx":608 @@ -8098,21 +7871,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN * output += f"%{byte:02X}" */ /*else*/ { - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); + __pyx_t_3 = 0; } - __pyx_L11:; + __pyx_L8:; - /* "w3lib/_url.pyx":600 + /* "w3lib/_url.pyx":598 * if isomorph not in percent_encode_set: * output += isomorph * elif isomorph == "%": # <<<<<<<<<<<<<< - * if ( - * len(encode_output) <= i + 2 + * next: cython.int = i + 1 + * next_next: cython.int = i + 2 */ - goto __pyx_L10; + goto __pyx_L7; } /* "w3lib/_url.pyx":610 @@ -8123,27 +7896,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN * return output */ /*else*/ { - __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_byte, __pyx_kp_u_02X); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Format(__pyx_v_byte, __pyx_kp_u_02X); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__3, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); + __pyx_t_3 = 0; } - __pyx_L10:; + __pyx_L7:; - /* "w3lib/_url.pyx":592 - * # instead of &#NNN; + /* "w3lib/_url.pyx":593 * encode_output, _ = encoder(input, "xmlcharrefreplace") - * for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< + * encode_output_length: cython.int = len(encode_output) + * for i in range(encode_output_length): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< * byte = encode_output[i] - * if space_as_plus and byte == 0x20: + * isomorph = chr(byte) */ - __pyx_L5_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8163,9 +7935,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN /* "w3lib/_url.pyx":580 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. - * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * @cfunc # <<<<<<<<<<<<<< + * def _percent_encode_after_encoding( * input: str, - * *, */ /* function exit code */ @@ -8175,7 +7947,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("w3lib._url._percent_encode_after_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_encoder); __Pyx_XDECREF(__pyx_v_output); @@ -8198,15 +7970,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UN */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv6(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_9_parse_ipv6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_11_parse_ipv6 = {"_parse_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_11_parse_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv6(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_9_parse_ipv6 = {"_parse_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_9_parse_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_9_parse_ipv6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -8281,7 +8053,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 683, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_10_parse_ipv6(__pyx_self, __pyx_v_input); + __pyx_r = __pyx_pf_5w3lib_4_url_8_parse_ipv6(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -8298,7 +8070,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_v_address = NULL; PyObject *__pyx_v_piece_index = NULL; PyObject *__pyx_v_compress = NULL; @@ -8403,7 +8175,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p } __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; @@ -8435,7 +8207,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 690, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__4, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L7_bool_binop_done:; @@ -8557,7 +8329,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p */ __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { @@ -8775,7 +8547,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p } __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L20_bool_binop_done:; @@ -8910,7 +8682,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { } else { @@ -9342,7 +9114,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p } __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = __pyx_t_3; __pyx_L44_bool_binop_done:; @@ -9686,15 +9458,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__p */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_11_utf_8_percent_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_13_utf_8_percent_encode = {"_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_11_utf_8_percent_encode = {"_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_11_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_11_utf_8_percent_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -9784,7 +9556,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 771, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_percent_encode_set); + __pyx_r = __pyx_pf_5w3lib_4_url_10_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_percent_encode_set); /* function exit code */ goto __pyx_L0; @@ -9801,13 +9573,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set) { +static PyObject *__pyx_pf_5w3lib_4_url_10_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -9821,32 +9590,6 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyO * encoding="utf-8", */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - - /* "w3lib/_url.pyx":775 - * ) -> str: - * return _percent_encode_after_encoding( - * input, # <<<<<<<<<<<<<< - * encoding="utf-8", - * percent_encode_set=percent_encode_set, - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_input); - __Pyx_GIVEREF(__pyx_v_input); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input)) __PYX_ERR(0, 774, __pyx_L1_error); - - /* "w3lib/_url.pyx":776 - * return _percent_encode_after_encoding( - * input, - * encoding="utf-8", # <<<<<<<<<<<<<< - * percent_encode_set=percent_encode_set, - * ) - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 776, __pyx_L1_error) /* "w3lib/_url.pyx":777 * input, @@ -9855,23 +9598,10 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyO * ) * */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 776, __pyx_L1_error) - - /* "w3lib/_url.pyx":774 - * percent_encode_set: _PercentEncodeSet, - * ) -> str: - * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input, - * encoding="utf-8", - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 774, __pyx_L1_error) - __pyx_r = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_1 = __pyx_f_5w3lib_4_url__percent_encode_after_encoding(__pyx_v_input, __pyx_kp_u_utf_8, __pyx_v_percent_encode_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; goto __pyx_L0; /* "w3lib/_url.pyx":770 @@ -9885,9 +9615,6 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyO /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("w3lib._url._utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -9905,15 +9632,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyO */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_15_parse_opaque_host(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_13_parse_opaque_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_15_parse_opaque_host = {"_parse_opaque_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_15_parse_opaque_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_15_parse_opaque_host(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_13_parse_opaque_host = {"_parse_opaque_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_13_parse_opaque_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_13_parse_opaque_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -9988,7 +9715,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 782, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_14_parse_opaque_host(__pyx_self, __pyx_v_input); + __pyx_r = __pyx_pf_5w3lib_4_url_12_parse_opaque_host(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -10005,7 +9732,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_12_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { Py_UCS4 __pyx_v_code_point; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -10143,21 +9870,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObje /* "w3lib/_url.pyx":790 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< + * def _parse_ipv4_number(input: str) -> Tuple[int, bint]: # <<<<<<<<<<<<<< * if not input: * raise ValueError */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_17_parse_ipv4_number(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_15_parse_ipv4_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_17_parse_ipv4_number = {"_parse_ipv4_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_17_parse_ipv4_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_17_parse_ipv4_number(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_15_parse_ipv4_number = {"_parse_ipv4_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_15_parse_ipv4_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_15_parse_ipv4_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10232,7 +9959,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 790, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_16_parse_ipv4_number(__pyx_self, __pyx_v_input); + __pyx_r = __pyx_pf_5w3lib_4_url_14_parse_ipv4_number(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -10249,7 +9976,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { int __pyx_v_validation_error; long __pyx_v_r; PyObject *__pyx_r = NULL; @@ -10269,7 +9996,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje /* "w3lib/_url.pyx":791 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: + * def _parse_ipv4_number(input: str) -> Tuple[int, bint]: * if not input: # <<<<<<<<<<<<<< * raise ValueError * validation_error = False @@ -10279,7 +10006,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje if (unlikely(__pyx_t_2)) { /* "w3lib/_url.pyx":792 - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: + * def _parse_ipv4_number(input: str) -> Tuple[int, bint]: * if not input: * raise ValueError # <<<<<<<<<<<<<< * validation_error = False @@ -10290,7 +10017,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje /* "w3lib/_url.pyx":791 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: + * def _parse_ipv4_number(input: str) -> Tuple[int, bint]: * if not input: # <<<<<<<<<<<<<< * raise ValueError * validation_error = False @@ -10467,8 +10194,8 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_tuple__7); - __pyx_r = __pyx_tuple__7; + __Pyx_INCREF(__pyx_tuple__6); + __pyx_r = __pyx_tuple__6; goto __pyx_L0; /* "w3lib/_url.pyx":804 @@ -10520,7 +10247,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje /* "w3lib/_url.pyx":790 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< + * def _parse_ipv4_number(input: str) -> Tuple[int, bint]: # <<<<<<<<<<<<<< * if not input: * raise ValueError */ @@ -10542,21 +10269,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObje /* "w3lib/_url.pyx":810 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< + * def _ends_in_number(input: str) -> bint: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and parts[-1] == "": */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_19_ends_in_number(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_17_ends_in_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_19_ends_in_number = {"_ends_in_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_19_ends_in_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_19_ends_in_number(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_17_ends_in_number = {"_ends_in_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_17_ends_in_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_17_ends_in_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10631,7 +10358,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 810, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_18_ends_in_number(__pyx_self, __pyx_v_input); + __pyx_r = __pyx_pf_5w3lib_4_url_16_ends_in_number(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -10816,12 +10543,12 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout /* "w3lib/_url.pyx":810 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< + * def _ends_in_number(input: str) -> bint: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and parts[-1] == "": */ -static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_v_parts = NULL; PyObject *__pyx_v_last = NULL; PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator = 0; @@ -10844,18 +10571,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject /* "w3lib/_url.pyx":811 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: + * def _ends_in_number(input: str) -> bint: * parts = input.split(".") # <<<<<<<<<<<<<< * if parts and parts[-1] == "": * if len(parts) == 1: */ - __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__5), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parts = __pyx_t_1; __pyx_t_1 = 0; /* "w3lib/_url.pyx":812 - * def _ends_in_number(input: str) -> bool: + * def _ends_in_number(input: str) -> bint: * parts = input.split(".") * if parts and parts[-1] == "": # <<<<<<<<<<<<<< * if len(parts) == 1: @@ -10920,7 +10647,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject __pyx_t_1 = 0; /* "w3lib/_url.pyx":812 - * def _ends_in_number(input: str) -> bool: + * def _ends_in_number(input: str) -> bint: * parts = input.split(".") * if parts and parts[-1] == "": # <<<<<<<<<<<<<< * if len(parts) == 1: @@ -11120,7 +10847,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject /* "w3lib/_url.pyx":810 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< + * def _ends_in_number(input: str) -> bint: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and parts[-1] == "": */ @@ -11150,15 +10877,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_21_parse_ipv4(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_19_parse_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_21_parse_ipv4 = {"_parse_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_21_parse_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_21_parse_ipv4(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_19_parse_ipv4 = {"_parse_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_19_parse_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_19_parse_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11233,7 +10960,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 827, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_20_parse_ipv4(__pyx_self, __pyx_v_input); + __pyx_r = __pyx_pf_5w3lib_4_url_18_parse_ipv4(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -11383,7 +11110,7 @@ static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_Coroutine * if parts and not parts[-1]: */ -static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_v_parts = NULL; PyObject *__pyx_v_numbers = NULL; PyObject *__pyx_v_part = NULL; @@ -11417,7 +11144,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p * if parts and not parts[-1]: * parts = parts[:-1] */ - __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__6), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__5), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parts = __pyx_t_1; __pyx_t_1 = 0; @@ -11841,21 +11568,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__p /* "w3lib/_url.pyx":850 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< + * def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: # <<<<<<<<<<<<<< * result = _utr46._to_ascii( * domain, */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_23_domain_to_ascii(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_21_domain_to_ascii(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_23_domain_to_ascii = {"_domain_to_ascii", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_23_domain_to_ascii, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_23_domain_to_ascii(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_21_domain_to_ascii = {"_domain_to_ascii", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_21_domain_to_ascii, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_21_domain_to_ascii(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11863,7 +11590,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_domain = 0; - PyObject *__pyx_v_be_strict = 0; + int __pyx_v_be_strict; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -11885,7 +11612,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain,&__pyx_n_s_be_strict,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -11920,7 +11646,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_domain = ((PyObject*)values[0]); - __pyx_v_be_strict = values[1]; + if (values[1]) { + __pyx_v_be_strict = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_be_strict == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 850, __pyx_L3_error) + } else { + __pyx_v_be_strict = ((int)((int)0)); + } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; @@ -11939,7 +11669,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain), (&PyUnicode_Type), 0, "domain", 1))) __PYX_ERR(0, 850, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_22_domain_to_ascii(__pyx_self, __pyx_v_domain, __pyx_v_be_strict); + __pyx_r = __pyx_pf_5w3lib_4_url_20_domain_to_ascii(__pyx_self, __pyx_v_domain, __pyx_v_be_strict); /* function exit code */ goto __pyx_L0; @@ -11956,7 +11686,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, PyObject *__pyx_v_be_strict) { +static PyObject *__pyx_pf_5w3lib_4_url_20_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, int __pyx_v_be_strict) { PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -11975,7 +11705,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject /* "w3lib/_url.pyx":851 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: + * def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: * result = _utr46._to_ascii( # <<<<<<<<<<<<<< * domain, * use_std3_ascii_rules=be_strict, @@ -11987,7 +11717,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "w3lib/_url.pyx":852 - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: + * def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: * result = _utr46._to_ascii( * domain, # <<<<<<<<<<<<<< * use_std3_ascii_rules=be_strict, @@ -12008,7 +11738,10 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject */ __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_v_be_strict) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_be_strict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_t_4) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "w3lib/_url.pyx":854 * domain, @@ -12053,11 +11786,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject * ) * if not result: */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_v_be_strict) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_be_strict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_t_4) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "w3lib/_url.pyx":851 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: + * def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: * result = _utr46._to_ascii( # <<<<<<<<<<<<<< * domain, * use_std3_ascii_rules=be_strict, @@ -12150,7 +11886,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject /* "w3lib/_url.pyx":850 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< + * def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: # <<<<<<<<<<<<<< * result = _utr46._to_ascii( * domain, */ @@ -12179,15 +11915,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_25_parse_host(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_23_parse_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_25_parse_host = {"_parse_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_25_parse_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_25_parse_host(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_23_parse_host = {"_parse_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_23_parse_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_23_parse_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -12277,7 +12013,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 870, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_24_parse_host(__pyx_self, __pyx_v_input, __pyx_v_url); + __pyx_r = __pyx_pf_5w3lib_4_url_22_parse_host(__pyx_self, __pyx_v_input, __pyx_v_url); /* function exit code */ goto __pyx_L0; @@ -12294,7 +12030,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_url) { +static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_url) { PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_ascii_domain = NULL; PyObject *__pyx_v_code_point = NULL; @@ -12321,7 +12057,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p * if not input.endswith("]"): * raise ValueError */ - __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__7, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 873, __pyx_L1_error) if (__pyx_t_1) { /* "w3lib/_url.pyx":874 @@ -12331,7 +12067,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p * raise ValueError * url.ipv6 = _parse_ipv6(input[1:-1]) */ - __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__9, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 874, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 874, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { @@ -12842,21 +12578,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__p /* "w3lib/_url.pyx":898 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter - * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * def _is_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_25_is_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_27_is_windows_drive_letter = {"_is_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_25_is_windows_drive_letter = {"_is_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_25_is_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_25_is_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -12931,7 +12667,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 898, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(__pyx_self, __pyx_v_input); + __pyx_r = __pyx_pf_5w3lib_4_url_24_is_windows_drive_letter(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -12948,7 +12684,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_24_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -12965,7 +12701,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED /* "w3lib/_url.pyx":899 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter - * def _is_windows_drive_letter(input: str) -> bool: + * def _is_windows_drive_letter(input: str) -> bint: * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" # <<<<<<<<<<<<<< * * @@ -13020,7 +12756,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED /* "w3lib/_url.pyx":898 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter - * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * def _is_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * */ @@ -13041,21 +12777,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED /* "w3lib/_url.pyx":903 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter - * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * def _starts_with_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< * input_length = len(input) * return ( */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_27_starts_with_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_29_starts_with_windows_drive_letter = {"_starts_with_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_27_starts_with_windows_drive_letter = {"_starts_with_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_27_starts_with_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_27_starts_with_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13130,7 +12866,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 903, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(__pyx_self, __pyx_v_input); + __pyx_r = __pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -13147,7 +12883,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { Py_ssize_t __pyx_v_input_length; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -13168,7 +12904,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHO /* "w3lib/_url.pyx":904 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter - * def _starts_with_windows_drive_letter(input: str) -> bool: + * def _starts_with_windows_drive_letter(input: str) -> bint: * input_length = len(input) # <<<<<<<<<<<<<< * return ( * input_length >= 2 @@ -13177,7 +12913,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHO __pyx_v_input_length = __pyx_t_1; /* "w3lib/_url.pyx":905 - * def _starts_with_windows_drive_letter(input: str) -> bool: + * def _starts_with_windows_drive_letter(input: str) -> bint: * input_length = len(input) * return ( # <<<<<<<<<<<<<< * input_length >= 2 @@ -13287,7 +13023,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHO /* "w3lib/_url.pyx":903 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter - * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * def _starts_with_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< * input_length = len(input) * return ( */ @@ -13310,21 +13046,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHO /* "w3lib/_url.pyx":913 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment - * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * def _is_double_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< * return input in ( * "..", */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_29_is_double_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_31_is_double_dot_path_segment = {"_is_double_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_29_is_double_dot_path_segment = {"_is_double_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_29_is_double_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_29_is_double_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13399,7 +13135,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 913, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(__pyx_self, __pyx_v_input); + __pyx_r = __pyx_pf_5w3lib_4_url_28_is_double_dot_path_segment(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -13416,7 +13152,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_28_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -13430,7 +13166,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUS /* "w3lib/_url.pyx":914 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment - * def _is_double_dot_path_segment(input: str) -> bool: + * def _is_double_dot_path_segment(input: str) -> bint: * return input in ( # <<<<<<<<<<<<<< * "..", * ".%2e", @@ -13438,7 +13174,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUS __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_input); __pyx_t_1 = __pyx_v_input; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; @@ -13499,7 +13235,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUS /* "w3lib/_url.pyx":913 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment - * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * def _is_double_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< * return input in ( * "..", */ @@ -13519,21 +13255,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUS /* "w3lib/_url.pyx":928 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment - * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * def _is_single_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< * return input in ( * ".", */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_31_is_single_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_33_is_single_dot_path_segment = {"_is_single_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_31_is_single_dot_path_segment = {"_is_single_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_31_is_single_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_31_is_single_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13608,7 +13344,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 928, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(__pyx_self, __pyx_v_input); + __pyx_r = __pyx_pf_5w3lib_4_url_30_is_single_dot_path_segment(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -13625,7 +13361,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_30_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -13639,7 +13375,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUS /* "w3lib/_url.pyx":929 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment - * def _is_single_dot_path_segment(input: str) -> bool: + * def _is_single_dot_path_segment(input: str) -> bint: * return input in ( # <<<<<<<<<<<<<< * ".", * "%2e", @@ -13647,7 +13383,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUS __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_input); __pyx_t_1 = __pyx_v_input; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 929, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; @@ -13672,7 +13408,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUS /* "w3lib/_url.pyx":928 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment - * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * def _is_single_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< * return input in ( * ".", */ @@ -13698,15 +13434,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUS */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_33_idempotent_utf_8_percent_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_35_idempotent_utf_8_percent_encode = {"_idempotent_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_33_idempotent_utf_8_percent_encode = {"_idempotent_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_33_idempotent_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_33_idempotent_utf_8_percent_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13798,7 +13534,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 940, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pointer), (&PyInt_Type), 0, "pointer", 1))) __PYX_ERR(0, 940, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_pointer, __pyx_v_encode_set); + __pyx_r = __pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_pointer, __pyx_v_encode_set); /* function exit code */ goto __pyx_L0; @@ -13815,7 +13551,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set) { +static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set) { PyObject *__pyx_v_code_point = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -13851,13 +13587,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON * if ( * pointer + 2 >= len(input) */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 943, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__4, __pyx_v_encode_set, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__3, __pyx_v_encode_set, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 943, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { @@ -13966,8 +13702,8 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_kp_u__4); - __pyx_r = __pyx_kp_u__4; + __Pyx_INCREF(__pyx_kp_u__3); + __pyx_r = __pyx_kp_u__3; goto __pyx_L0; /* "w3lib/_url.pyx":943 @@ -14047,15 +13783,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_37_preprocess_url(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_35_preprocess_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_37_preprocess_url = {"_preprocess_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_37_preprocess_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_37_preprocess_url(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_35_preprocess_url = {"_preprocess_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_35_preprocess_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_35_preprocess_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -14130,7 +13866,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_url), (&PyUnicode_Type), 0, "url", 1))) __PYX_ERR(0, 954, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_36_preprocess_url(__pyx_self, __pyx_v_url); + __pyx_r = __pyx_pf_5w3lib_4_url_34_preprocess_url(__pyx_self, __pyx_v_url); /* function exit code */ goto __pyx_L0; @@ -14147,7 +13883,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_36_preprocess_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { +static PyObject *__pyx_pf_5w3lib_4_url_34_preprocess_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -14237,16 +13973,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_preprocess_url(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_39_parse_url(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_37_parse_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_38_parse_url, "Return a :class:`_URL` object built from *url* and *encoding*, following\n the URL parsing algorithm defined in the `URL living standard`_, with\n additional logic to support older standards as well.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing\n "); -static PyMethodDef __pyx_mdef_5w3lib_4_url_39_parse_url = {"_parse_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_39_parse_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_38_parse_url}; -static PyObject *__pyx_pw_5w3lib_4_url_39_parse_url(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_36_parse_url, "Return a :class:`_URL` object built from *url* and *encoding*, following\n the URL parsing algorithm defined in the `URL living standard`_, with\n additional logic to support older standards as well.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing\n "); +static PyMethodDef __pyx_mdef_5w3lib_4_url_37_parse_url = {"_parse_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_37_parse_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_36_parse_url}; +static PyObject *__pyx_pw_5w3lib_4_url_37_parse_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -14338,7 +14074,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 959, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 960, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_38_parse_url(__pyx_self, __pyx_v_input, __pyx_v_encoding); + __pyx_r = __pyx_pf_5w3lib_4_url_36_parse_url(__pyx_self, __pyx_v_input, __pyx_v_encoding); /* function exit code */ goto __pyx_L0; @@ -14355,17 +14091,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding) { +static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding) { PyObject *__pyx_v_url = NULL; unsigned char __pyx_v_state; PyObject *__pyx_v_buffer = NULL; int __pyx_v_at_sign_seen; int __pyx_v_inside_brackets; int __pyx_v_skip_authority_shortcut; - PyObject *__pyx_v_pointer = NULL; - Py_ssize_t __pyx_v_input_length; + int __pyx_v_pointer; + int __pyx_v_input_length; int __pyx_v_reached_end; - PyObject *__pyx_v_c = 0; + PyObject *__pyx_v_c = NULL; PyObject *__pyx_v_at_sign_index = NULL; PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_code_point = NULL; @@ -14381,14 +14117,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py int __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; - int __pyx_t_7; - Py_ssize_t __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); - int __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - Py_UCS4 __pyx_t_13; - int __pyx_t_14; + Py_UCS4 __pyx_t_7; + int __pyx_t_8; + long __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -14412,8 +14149,8 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * encoding = _get_output_encoding(encoding) * * url = _URL() # <<<<<<<<<<<<<< - * url.path = [] * state = SCHEME_START + * buffer = "" */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_URL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -14445,63 +14182,50 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py /* "w3lib/_url.pyx":982 * * url = _URL() - * url.path = [] # <<<<<<<<<<<<<< - * state = SCHEME_START - * buffer = "" - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 982, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "w3lib/_url.pyx":983 - * url = _URL() - * url.path = [] * state = SCHEME_START # <<<<<<<<<<<<<< * buffer = "" * at_sign_seen = inside_brackets = skip_authority_shortcut = False */ __pyx_v_state = __pyx_v_5w3lib_4_url_SCHEME_START; - /* "w3lib/_url.pyx":984 - * url.path = [] + /* "w3lib/_url.pyx":983 + * url = _URL() * state = SCHEME_START * buffer = "" # <<<<<<<<<<<<<< * at_sign_seen = inside_brackets = skip_authority_shortcut = False - * pointer = 0 + * pointer: cython.int = 0 */ __Pyx_INCREF(__pyx_kp_u_); __pyx_v_buffer = __pyx_kp_u_; - /* "w3lib/_url.pyx":985 + /* "w3lib/_url.pyx":984 * state = SCHEME_START * buffer = "" * at_sign_seen = inside_brackets = skip_authority_shortcut = False # <<<<<<<<<<<<<< - * pointer = 0 + * pointer: cython.int = 0 * */ __pyx_v_at_sign_seen = 0; __pyx_v_inside_brackets = 0; __pyx_v_skip_authority_shortcut = 0; - /* "w3lib/_url.pyx":986 + /* "w3lib/_url.pyx":985 * buffer = "" * at_sign_seen = inside_brackets = skip_authority_shortcut = False - * pointer = 0 # <<<<<<<<<<<<<< + * pointer: cython.int = 0 # <<<<<<<<<<<<<< * * input = _preprocess_url(input) */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_pointer = __pyx_int_0; + __pyx_v_pointer = 0; - /* "w3lib/_url.pyx":988 - * pointer = 0 + /* "w3lib/_url.pyx":987 + * pointer: cython.int = 0 * * input = _preprocess_url(input) # <<<<<<<<<<<<<< - * input_length = len(input) + * input_length: cython.int = len(input) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_preprocess_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 988, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_preprocess_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -14521,30 +14245,30 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_input}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 988, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 987, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":989 + /* "w3lib/_url.pyx":988 * * input = _preprocess_url(input) - * input_length = len(input) # <<<<<<<<<<<<<< + * input_length: cython.int = len(input) # <<<<<<<<<<<<<< * * while True: */ if (unlikely(__pyx_v_input == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 989, __pyx_L1_error) + __PYX_ERR(0, 988, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 989, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 988, __pyx_L1_error) __pyx_v_input_length = __pyx_t_5; - /* "w3lib/_url.pyx":991 - * input_length = len(input) + /* "w3lib/_url.pyx":990 + * input_length: cython.int = len(input) * * while True: # <<<<<<<<<<<<<< * reached_end: bint = pointer >= input_length @@ -14552,55 +14276,49 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ while (1) { - /* "w3lib/_url.pyx":992 + /* "w3lib/_url.pyx":991 * * while True: * reached_end: bint = pointer >= input_length # <<<<<<<<<<<<<< * if not reached_end: - * c: str = input[pointer] + * c = input[pointer] */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 992, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_reached_end = __pyx_t_6; + __pyx_v_reached_end = (__pyx_v_pointer >= __pyx_v_input_length); - /* "w3lib/_url.pyx":993 + /* "w3lib/_url.pyx":992 * while True: * reached_end: bint = pointer >= input_length * if not reached_end: # <<<<<<<<<<<<<< - * c: str = input[pointer] + * c = input[pointer] * */ __pyx_t_6 = (!__pyx_v_reached_end); if (__pyx_t_6) { - /* "w3lib/_url.pyx":994 + /* "w3lib/_url.pyx":993 * reached_end: bint = pointer >= input_length * if not reached_end: - * c: str = input[pointer] # <<<<<<<<<<<<<< + * c = input[pointer] # <<<<<<<<<<<<<< * * if state == SCHEME_START: */ - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 994, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_c, ((PyObject*)__pyx_t_2)); - __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_v_pointer, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 993, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":993 + /* "w3lib/_url.pyx":992 * while True: * reached_end: bint = pointer >= input_length * if not reached_end: # <<<<<<<<<<<<<< - * c: str = input[pointer] + * c = input[pointer] * */ } - /* "w3lib/_url.pyx":996 - * c: str = input[pointer] + /* "w3lib/_url.pyx":995 + * c = input[pointer] * * if state == SCHEME_START: # <<<<<<<<<<<<<< * if not reached_end and c in _ASCII_ALPHA: @@ -14609,42 +14327,42 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SCHEME_START); if (__pyx_t_6) { - /* "w3lib/_url.pyx":997 + /* "w3lib/_url.pyx":996 * * if state == SCHEME_START: * if not reached_end and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< * buffer += c * state = SCHEME */ - __pyx_t_7 = (!__pyx_v_reached_end); - if (__pyx_t_7) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L8_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 997, __pyx_L1_error) } - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 997, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 997, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __pyx_t_7; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 996, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 996, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_t_8; __pyx_L8_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":998 + /* "w3lib/_url.pyx":997 * if state == SCHEME_START: * if not reached_end and c in _ASCII_ALPHA: * buffer += c # <<<<<<<<<<<<<< * state = SCHEME * else: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 998, __pyx_L1_error) } - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_2); - __pyx_t_2 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 997, __pyx_L1_error) } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":999 + /* "w3lib/_url.pyx":998 * if not reached_end and c in _ASCII_ALPHA: * buffer += c * state = SCHEME # <<<<<<<<<<<<<< @@ -14653,7 +14371,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_SCHEME; - /* "w3lib/_url.pyx":997 + /* "w3lib/_url.pyx":996 * * if state == SCHEME_START: * if not reached_end and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< @@ -14663,7 +14381,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L7; } - /* "w3lib/_url.pyx":1001 + /* "w3lib/_url.pyx":1000 * state = SCHEME * else: * state = NO_SCHEME # <<<<<<<<<<<<<< @@ -14673,22 +14391,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_NO_SCHEME; - /* "w3lib/_url.pyx":1002 + /* "w3lib/_url.pyx":1001 * else: * state = NO_SCHEME * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == SCHEME: */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_pointer = (__pyx_v_pointer - 1); } __pyx_L7:; - /* "w3lib/_url.pyx":996 - * c: str = input[pointer] + /* "w3lib/_url.pyx":995 + * c = input[pointer] * * if state == SCHEME_START: # <<<<<<<<<<<<<< * if not reached_end and c in _ASCII_ALPHA: @@ -14697,7 +14412,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1004 + /* "w3lib/_url.pyx":1003 * pointer -= 1 * * elif state == SCHEME: # <<<<<<<<<<<<<< @@ -14707,42 +14422,42 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SCHEME); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1005 + /* "w3lib/_url.pyx":1004 * * elif state == SCHEME: * if not reached_end and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< * buffer += c * elif not reached_end and c == ":": */ - __pyx_t_7 = (!__pyx_v_reached_end); - if (__pyx_t_7) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L11_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1005, __pyx_L1_error) } - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SCHEME_CHARS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1005, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __pyx_t_7; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1004, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SCHEME_CHARS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1004, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_t_8; __pyx_L11_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1006 + /* "w3lib/_url.pyx":1005 * elif state == SCHEME: * if not reached_end and c in _SCHEME_CHARS: * buffer += c # <<<<<<<<<<<<<< * elif not reached_end and c == ":": * url.scheme = buffer.lower() */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1006, __pyx_L1_error) } - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_2); - __pyx_t_2 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1005, __pyx_L1_error) } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1005 + /* "w3lib/_url.pyx":1004 * * elif state == SCHEME: * if not reached_end and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< @@ -14752,60 +14467,60 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L10; } - /* "w3lib/_url.pyx":1007 + /* "w3lib/_url.pyx":1006 * if not reached_end and c in _SCHEME_CHARS: * buffer += c * elif not reached_end and c == ":": # <<<<<<<<<<<<<< * url.scheme = buffer.lower() * buffer = "" */ - __pyx_t_7 = (!__pyx_v_reached_end); - if (__pyx_t_7) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L13_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1007, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1007, __pyx_L1_error) - __pyx_t_6 = __pyx_t_7; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1006, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1006, __pyx_L1_error) + __pyx_t_6 = __pyx_t_8; __pyx_L13_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1008 + /* "w3lib/_url.pyx":1007 * buffer += c * elif not reached_end and c == ":": * url.scheme = buffer.lower() # <<<<<<<<<<<<<< * buffer = "" * if url.scheme == "file": */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_buffer, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_buffer, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1007, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1007, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme, __pyx_t_2) < 0) __PYX_ERR(0, 1008, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme, __pyx_t_1) < 0) __PYX_ERR(0, 1007, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1009 + /* "w3lib/_url.pyx":1008 * elif not reached_end and c == ":": * url.scheme = buffer.lower() * buffer = "" # <<<<<<<<<<<<<< @@ -14815,20 +14530,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1010 + /* "w3lib/_url.pyx":1009 * url.scheme = buffer.lower() * buffer = "" * if url.scheme == "file": # <<<<<<<<<<<<<< * state = FILE * elif url.scheme in _SPECIAL_SCHEMES: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1010, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1011 + /* "w3lib/_url.pyx":1010 * buffer = "" * if url.scheme == "file": * state = FILE # <<<<<<<<<<<<<< @@ -14837,7 +14552,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FILE; - /* "w3lib/_url.pyx":1010 + /* "w3lib/_url.pyx":1009 * url.scheme = buffer.lower() * buffer = "" * if url.scheme == "file": # <<<<<<<<<<<<<< @@ -14847,110 +14562,90 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L15; } - /* "w3lib/_url.pyx":1012 + /* "w3lib/_url.pyx":1011 * if url.scheme == "file": * state = FILE * elif url.scheme in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_SLASHES - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": + * elif pointer + 1 < input_length and input[pointer + 1] == "/": */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1012, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1011, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1013 + /* "w3lib/_url.pyx":1012 * state = FILE * elif url.scheme in _SPECIAL_SCHEMES: * state = SPECIAL_AUTHORITY_SLASHES # <<<<<<<<<<<<<< - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": + * elif pointer + 1 < input_length and input[pointer + 1] == "/": * state = PATH_OR_AUTHORITY */ __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES; - /* "w3lib/_url.pyx":1012 + /* "w3lib/_url.pyx":1011 * if url.scheme == "file": * state = FILE * elif url.scheme in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_SLASHES - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": + * elif pointer + 1 < input_length and input[pointer + 1] == "/": */ goto __pyx_L15; } - /* "w3lib/_url.pyx":1014 + /* "w3lib/_url.pyx":1013 * elif url.scheme in _SPECIAL_SCHEMES: * state = SPECIAL_AUTHORITY_SLASHES - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * elif pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = PATH_OR_AUTHORITY * pointer += 1 */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__pyx_v_input == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1014, __pyx_L1_error) - } - __pyx_t_5 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1014, __pyx_L1_error) - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_7) { + __pyx_t_8 = ((__pyx_v_pointer + 1) < __pyx_v_input_length); + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L16_bool_binop_done; } - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __pyx_t_7; + __pyx_t_9 = (__pyx_v_pointer + 1); + __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 1013, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_7 == 47); + __pyx_t_6 = __pyx_t_8; __pyx_L16_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1015 + /* "w3lib/_url.pyx":1014 * state = SPECIAL_AUTHORITY_SLASHES - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": + * elif pointer + 1 < input_length and input[pointer + 1] == "/": * state = PATH_OR_AUTHORITY # <<<<<<<<<<<<<< * pointer += 1 * else: */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY; - /* "w3lib/_url.pyx":1016 - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": + /* "w3lib/_url.pyx":1015 + * elif pointer + 1 < input_length and input[pointer + 1] == "/": * state = PATH_OR_AUTHORITY * pointer += 1 # <<<<<<<<<<<<<< * else: * url.opaque_path = "" */ - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_pointer = (__pyx_v_pointer + 1); - /* "w3lib/_url.pyx":1014 + /* "w3lib/_url.pyx":1013 * elif url.scheme in _SPECIAL_SCHEMES: * state = SPECIAL_AUTHORITY_SLASHES - * elif pointer + 1 < len(input) and input[pointer + 1] == "/": # <<<<<<<<<<<<<< + * elif pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = PATH_OR_AUTHORITY * pointer += 1 */ goto __pyx_L15; } - /* "w3lib/_url.pyx":1018 + /* "w3lib/_url.pyx":1017 * pointer += 1 * else: * url.opaque_path = "" # <<<<<<<<<<<<<< @@ -14958,9 +14653,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * else: */ /*else*/ { - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path, __pyx_kp_u_) < 0) __PYX_ERR(0, 1018, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path, __pyx_kp_u_) < 0) __PYX_ERR(0, 1017, __pyx_L1_error) - /* "w3lib/_url.pyx":1019 + /* "w3lib/_url.pyx":1018 * else: * url.opaque_path = "" * state = OPAQUE_PATH # <<<<<<<<<<<<<< @@ -14971,7 +14666,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L15:; - /* "w3lib/_url.pyx":1007 + /* "w3lib/_url.pyx":1006 * if not reached_end and c in _SCHEME_CHARS: * buffer += c * elif not reached_end and c == ":": # <<<<<<<<<<<<<< @@ -14981,7 +14676,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L10; } - /* "w3lib/_url.pyx":1021 + /* "w3lib/_url.pyx":1020 * state = OPAQUE_PATH * else: * buffer = "" # <<<<<<<<<<<<<< @@ -14992,7 +14687,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1022 + /* "w3lib/_url.pyx":1021 * else: * buffer = "" * state = NO_SCHEME # <<<<<<<<<<<<<< @@ -15001,19 +14696,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_NO_SCHEME; - /* "w3lib/_url.pyx":1023 + /* "w3lib/_url.pyx":1022 * buffer = "" * state = NO_SCHEME * pointer = -1 # <<<<<<<<<<<<<< * * elif state == NO_SCHEME: */ - __Pyx_INCREF(__pyx_int_neg_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_int_neg_1); + __pyx_v_pointer = -1; } __pyx_L10:; - /* "w3lib/_url.pyx":1004 + /* "w3lib/_url.pyx":1003 * pointer -= 1 * * elif state == SCHEME: # <<<<<<<<<<<<<< @@ -15023,7 +14717,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1025 + /* "w3lib/_url.pyx":1024 * pointer = -1 * * elif state == NO_SCHEME: # <<<<<<<<<<<<<< @@ -15033,20 +14727,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_NO_SCHEME); if (unlikely(__pyx_t_6)) { - /* "w3lib/_url.pyx":1026 + /* "w3lib/_url.pyx":1025 * * elif state == NO_SCHEME: * raise ValueError("No URL scheme") # <<<<<<<<<<<<<< * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1026, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1026, __pyx_L1_error) + __PYX_ERR(0, 1025, __pyx_L1_error) - /* "w3lib/_url.pyx":1025 + /* "w3lib/_url.pyx":1024 * pointer = -1 * * elif state == NO_SCHEME: # <<<<<<<<<<<<<< @@ -15055,7 +14749,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1028 + /* "w3lib/_url.pyx":1027 * raise ValueError("No URL scheme") * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< @@ -15065,52 +14759,40 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_RELATIVE_OR_AUTHORITY); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1029 + /* "w3lib/_url.pyx":1028 * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 */ - __pyx_t_7 = (!__pyx_v_reached_end); - if (__pyx_t_7) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L19_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1029, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) - if (__pyx_t_7) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1028, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1028, __pyx_L1_error) + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L19_bool_binop_done; } - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_7) { + __pyx_t_8 = ((__pyx_v_pointer + 1) < __pyx_v_input_length); + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L19_bool_binop_done; } - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __pyx_t_7; + __pyx_t_9 = (__pyx_v_pointer + 1); + __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 1028, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_7 == 47); + __pyx_t_6 = __pyx_t_8; __pyx_L19_bool_binop_done:; if (likely(__pyx_t_6)) { - /* "w3lib/_url.pyx":1030 + /* "w3lib/_url.pyx":1029 * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< @@ -15119,19 +14801,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":1031 + /* "w3lib/_url.pyx":1030 * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 # <<<<<<<<<<<<<< * else: * raise ValueError("URL is relative") */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1031, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_v_pointer = (__pyx_v_pointer + 1); - /* "w3lib/_url.pyx":1029 + /* "w3lib/_url.pyx":1028 * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< @@ -15141,7 +14820,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L18; } - /* "w3lib/_url.pyx":1033 + /* "w3lib/_url.pyx":1032 * pointer += 1 * else: * raise ValueError("URL is relative") # <<<<<<<<<<<<<< @@ -15149,15 +14828,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * elif state == PATH_OR_AUTHORITY: */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 1033, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1032, __pyx_L1_error) } __pyx_L18:; - /* "w3lib/_url.pyx":1028 + /* "w3lib/_url.pyx":1027 * raise ValueError("No URL scheme") * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< @@ -15167,7 +14846,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1035 + /* "w3lib/_url.pyx":1034 * raise ValueError("URL is relative") * * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< @@ -15177,26 +14856,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1036 + /* "w3lib/_url.pyx":1035 * * elif state == PATH_OR_AUTHORITY: * if not reached_end and c == "/": # <<<<<<<<<<<<<< * state = AUTHORITY * else: */ - __pyx_t_7 = (!__pyx_v_reached_end); - if (__pyx_t_7) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L24_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1036, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1036, __pyx_L1_error) - __pyx_t_6 = __pyx_t_7; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1035, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1035, __pyx_L1_error) + __pyx_t_6 = __pyx_t_8; __pyx_L24_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1037 + /* "w3lib/_url.pyx":1036 * elif state == PATH_OR_AUTHORITY: * if not reached_end and c == "/": * state = AUTHORITY # <<<<<<<<<<<<<< @@ -15205,7 +14884,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_AUTHORITY; - /* "w3lib/_url.pyx":1036 + /* "w3lib/_url.pyx":1035 * * elif state == PATH_OR_AUTHORITY: * if not reached_end and c == "/": # <<<<<<<<<<<<<< @@ -15215,7 +14894,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L23; } - /* "w3lib/_url.pyx":1039 + /* "w3lib/_url.pyx":1038 * state = AUTHORITY * else: * state = PATH # <<<<<<<<<<<<<< @@ -15225,21 +14904,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1040 + /* "w3lib/_url.pyx":1039 * else: * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == SPECIAL_AUTHORITY_SLASHES: */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_v_pointer = (__pyx_v_pointer - 1); } __pyx_L23:; - /* "w3lib/_url.pyx":1035 + /* "w3lib/_url.pyx":1034 * raise ValueError("URL is relative") * * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< @@ -15249,7 +14925,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1042 + /* "w3lib/_url.pyx":1041 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< @@ -15259,52 +14935,40 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1043 + /* "w3lib/_url.pyx":1042 * * elif state == SPECIAL_AUTHORITY_SLASHES: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 */ - __pyx_t_7 = (!__pyx_v_reached_end); - if (__pyx_t_7) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L27_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1043, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1043, __pyx_L1_error) - if (__pyx_t_7) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1042, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1042, __pyx_L1_error) + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L27_bool_binop_done; } - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1043, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_7) { + __pyx_t_8 = ((__pyx_v_pointer + 1) < __pyx_v_input_length); + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L27_bool_binop_done; } - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1043, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __pyx_t_7; + __pyx_t_9 = (__pyx_v_pointer + 1); + __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 1042, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_7 == 47); + __pyx_t_6 = __pyx_t_8; __pyx_L27_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1044 + /* "w3lib/_url.pyx":1043 * elif state == SPECIAL_AUTHORITY_SLASHES: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< @@ -15313,19 +14977,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":1045 + /* "w3lib/_url.pyx":1044 * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 # <<<<<<<<<<<<<< * else: * state = SPECIAL_AUTHORITY_IGNORE_SLASHES */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_pointer = (__pyx_v_pointer + 1); - /* "w3lib/_url.pyx":1043 + /* "w3lib/_url.pyx":1042 * * elif state == SPECIAL_AUTHORITY_SLASHES: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< @@ -15335,7 +14996,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L26; } - /* "w3lib/_url.pyx":1047 + /* "w3lib/_url.pyx":1046 * pointer += 1 * else: * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< @@ -15345,21 +15006,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":1048 + /* "w3lib/_url.pyx":1047 * else: * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_pointer = (__pyx_v_pointer - 1); } __pyx_L26:; - /* "w3lib/_url.pyx":1042 + /* "w3lib/_url.pyx":1041 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< @@ -15369,7 +15027,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1050 + /* "w3lib/_url.pyx":1049 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< @@ -15379,7 +15037,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1051 + /* "w3lib/_url.pyx":1050 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: * if reached_end or c not in "/\\": # <<<<<<<<<<<<<< @@ -15391,13 +15049,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_v_reached_end; goto __pyx_L32_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1051, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__14, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1051, __pyx_L1_error) - __pyx_t_6 = __pyx_t_7; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1050, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__13, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1050, __pyx_L1_error) + __pyx_t_6 = __pyx_t_8; __pyx_L32_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1052 + /* "w3lib/_url.pyx":1051 * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: * if reached_end or c not in "/\\": * state = AUTHORITY # <<<<<<<<<<<<<< @@ -15406,19 +15064,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_AUTHORITY; - /* "w3lib/_url.pyx":1053 + /* "w3lib/_url.pyx":1052 * if reached_end or c not in "/\\": * state = AUTHORITY * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == AUTHORITY: */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_pointer = (__pyx_v_pointer - 1); - /* "w3lib/_url.pyx":1051 + /* "w3lib/_url.pyx":1050 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: * if reached_end or c not in "/\\": # <<<<<<<<<<<<<< @@ -15427,7 +15082,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1050 + /* "w3lib/_url.pyx":1049 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< @@ -15437,7 +15092,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1055 + /* "w3lib/_url.pyx":1054 * pointer -= 1 * * elif state == AUTHORITY: # <<<<<<<<<<<<<< @@ -15447,7 +15102,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_AUTHORITY); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1056 + /* "w3lib/_url.pyx":1055 * * elif state == AUTHORITY: * if not skip_authority_shortcut: # <<<<<<<<<<<<<< @@ -15457,7 +15112,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (!__pyx_v_skip_authority_shortcut); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1057 + /* "w3lib/_url.pyx":1056 * elif state == AUTHORITY: * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) # <<<<<<<<<<<<<< @@ -15466,26 +15121,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ if (unlikely(__pyx_v_input == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "find"); - __PYX_ERR(0, 1057, __pyx_L1_error) + __PYX_ERR(0, 1056, __pyx_L1_error) } - __pyx_t_5 = (__Pyx_Py_IsNone(__pyx_v_pointer) ? (0) : (__Pyx_PyIndex_AsSsize_t(__pyx_v_pointer))); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1057, __pyx_L1_error) - __pyx_t_8 = PyUnicode_Find(__pyx_v_input, __pyx_kp_u__15, __pyx_t_5, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-2))) __PYX_ERR(0, 1057, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_at_sign_index, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_pointer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1056, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = (__Pyx_Py_IsNone(__pyx_t_2) ? (0) : (__Pyx_PyIndex_AsSsize_t(__pyx_t_2))); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = PyUnicode_Find(__pyx_v_input, __pyx_kp_u__14, __pyx_t_5, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-2))) __PYX_ERR(0, 1056, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1056, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_at_sign_index, __pyx_t_2); + __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1058 + /* "w3lib/_url.pyx":1057 * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: # <<<<<<<<<<<<<< * state = HOST * else: */ - __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_at_sign_index, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1058, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_at_sign_index, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1057, __pyx_L1_error) if (__pyx_t_6) { - /* "w3lib/_url.pyx":1059 + /* "w3lib/_url.pyx":1058 * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: * state = HOST # <<<<<<<<<<<<<< @@ -15494,7 +15152,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_HOST; - /* "w3lib/_url.pyx":1058 + /* "w3lib/_url.pyx":1057 * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: # <<<<<<<<<<<<<< @@ -15504,7 +15162,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L35; } - /* "w3lib/_url.pyx":1061 + /* "w3lib/_url.pyx":1060 * state = HOST * else: * skip_authority_shortcut = True # <<<<<<<<<<<<<< @@ -15516,19 +15174,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L35:; - /* "w3lib/_url.pyx":1062 + /* "w3lib/_url.pyx":1061 * else: * skip_authority_shortcut = True * pointer -= 1 # <<<<<<<<<<<<<< * elif not reached_end and c == "@": * if at_sign_seen: */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1062, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_pointer = (__pyx_v_pointer - 1); - /* "w3lib/_url.pyx":1056 + /* "w3lib/_url.pyx":1055 * * elif state == AUTHORITY: * if not skip_authority_shortcut: # <<<<<<<<<<<<<< @@ -15538,26 +15193,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L34; } - /* "w3lib/_url.pyx":1063 + /* "w3lib/_url.pyx":1062 * skip_authority_shortcut = True * pointer -= 1 * elif not reached_end and c == "@": # <<<<<<<<<<<<<< * if at_sign_seen: * buffer = "%40" + buffer */ - __pyx_t_7 = (!__pyx_v_reached_end); - if (__pyx_t_7) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L36_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1063, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1063, __pyx_L1_error) - __pyx_t_6 = __pyx_t_7; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1062, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1062, __pyx_L1_error) + __pyx_t_6 = __pyx_t_8; __pyx_L36_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1064 + /* "w3lib/_url.pyx":1063 * pointer -= 1 * elif not reached_end and c == "@": * if at_sign_seen: # <<<<<<<<<<<<<< @@ -15566,19 +15221,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ if (__pyx_v_at_sign_seen) { - /* "w3lib/_url.pyx":1065 + /* "w3lib/_url.pyx":1064 * elif not reached_end and c == "@": * if at_sign_seen: * buffer = "%40" + buffer # <<<<<<<<<<<<<< * at_sign_seen = True * for i, code_point in enumerate(buffer): */ - __pyx_t_1 = PyNumber_Add(__pyx_kp_u_40, __pyx_v_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_u_40, __pyx_v_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_2); + __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1064 + /* "w3lib/_url.pyx":1063 * pointer -= 1 * elif not reached_end and c == "@": * if at_sign_seen: # <<<<<<<<<<<<<< @@ -15587,7 +15242,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1066 + /* "w3lib/_url.pyx":1065 * if at_sign_seen: * buffer = "%40" + buffer * at_sign_seen = True # <<<<<<<<<<<<<< @@ -15596,7 +15251,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_at_sign_seen = 1; - /* "w3lib/_url.pyx":1067 + /* "w3lib/_url.pyx":1066 * buffer = "%40" + buffer * at_sign_seen = True * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< @@ -15604,54 +15259,54 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * url._password_token_seen = True */ __Pyx_INCREF(__pyx_int_0); - __pyx_t_1 = __pyx_int_0; + __pyx_t_2 = __pyx_int_0; if (likely(PyList_CheckExact(__pyx_v_buffer)) || PyTuple_CheckExact(__pyx_v_buffer)) { - __pyx_t_2 = __pyx_v_buffer; __Pyx_INCREF(__pyx_t_2); - __pyx_t_8 = 0; - __pyx_t_9 = NULL; + __pyx_t_1 = __pyx_v_buffer; __Pyx_INCREF(__pyx_t_1); + __pyx_t_10 = 0; + __pyx_t_11 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1067, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1066, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(!__pyx_t_11)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { - __pyx_t_3 = __pyx_t_9(__pyx_t_2); + __pyx_t_3 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1067, __pyx_L1_error) + else __PYX_ERR(0, 1066, __pyx_L1_error) } break; } @@ -15659,46 +15314,46 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_3); __pyx_t_3 = 0; - __Pyx_INCREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); - __pyx_t_1 = __pyx_t_3; + __Pyx_DECREF(__pyx_t_2); + __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1068 + /* "w3lib/_url.pyx":1067 * at_sign_seen = True * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< * url._password_token_seen = True * continue */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) - if (__pyx_t_7) { + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L42_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_10 = (!__pyx_t_7); - __pyx_t_6 = __pyx_t_10; + __pyx_t_12 = (!__pyx_t_8); + __pyx_t_6 = __pyx_t_12; __pyx_L42_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1069 + /* "w3lib/_url.pyx":1068 * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: * url._password_token_seen = True # <<<<<<<<<<<<<< * continue * encoded_code_points = _idempotent_utf_8_percent_encode( */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen, Py_True) < 0) __PYX_ERR(0, 1069, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen, Py_True) < 0) __PYX_ERR(0, 1068, __pyx_L1_error) - /* "w3lib/_url.pyx":1070 + /* "w3lib/_url.pyx":1069 * if code_point == ":" and not url._password_token_seen: * url._password_token_seen = True * continue # <<<<<<<<<<<<<< @@ -15707,7 +15362,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ goto __pyx_L39_continue; - /* "w3lib/_url.pyx":1068 + /* "w3lib/_url.pyx":1067 * at_sign_seen = True * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< @@ -15716,91 +15371,91 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1071 + /* "w3lib/_url.pyx":1070 * url._password_token_seen = True * continue * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=buffer, * pointer=i, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":1072 + /* "w3lib/_url.pyx":1071 * continue * encoded_code_points = _idempotent_utf_8_percent_encode( * input=buffer, # <<<<<<<<<<<<<< * pointer=i, * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1072, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_input, __pyx_v_buffer) < 0) __PYX_ERR(0, 1072, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1071, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_input, __pyx_v_buffer) < 0) __PYX_ERR(0, 1071, __pyx_L1_error) - /* "w3lib/_url.pyx":1073 + /* "w3lib/_url.pyx":1072 * encoded_code_points = _idempotent_utf_8_percent_encode( * input=buffer, * pointer=i, # <<<<<<<<<<<<<< * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, * ) */ - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_pointer, __pyx_v_i) < 0) __PYX_ERR(0, 1072, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_pointer, __pyx_v_i) < 0) __PYX_ERR(0, 1071, __pyx_L1_error) - /* "w3lib/_url.pyx":1074 + /* "w3lib/_url.pyx":1073 * input=buffer, * pointer=i, * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * ) * if url._password_token_seen: */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1074, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_encode_set, __pyx_t_12) < 0) __PYX_ERR(0, 1072, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_encode_set, __pyx_t_14) < 0) __PYX_ERR(0, 1071, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "w3lib/_url.pyx":1071 + /* "w3lib/_url.pyx":1070 * url._password_token_seen = True * continue * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=buffer, * pointer=i, */ - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1070, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF_SET(__pyx_v_encoded_code_points, __pyx_t_12); - __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF_SET(__pyx_v_encoded_code_points, __pyx_t_14); + __pyx_t_14 = 0; - /* "w3lib/_url.pyx":1076 + /* "w3lib/_url.pyx":1075 * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, * ) * if url._password_token_seen: # <<<<<<<<<<<<<< * url.password += encoded_code_points * else: */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1076, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1076, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1075, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1075, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1077 + /* "w3lib/_url.pyx":1076 * ) * if url._password_token_seen: * url.password += encoded_code_points # <<<<<<<<<<<<<< * else: * url.username += encoded_code_points */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_t_12, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_11) < 0) __PYX_ERR(0, 1077, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_14, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_13) < 0) __PYX_ERR(0, 1076, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "w3lib/_url.pyx":1076 + /* "w3lib/_url.pyx":1075 * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, * ) * if url._password_token_seen: # <<<<<<<<<<<<<< @@ -15810,7 +15465,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L44; } - /* "w3lib/_url.pyx":1079 + /* "w3lib/_url.pyx":1078 * url.password += encoded_code_points * else: * url.username += encoded_code_points # <<<<<<<<<<<<<< @@ -15818,17 +15473,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": */ /*else*/ { - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1079, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_t_11, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1079, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_12) < 0) __PYX_ERR(0, 1079, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_14) < 0) __PYX_ERR(0, 1078, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __pyx_L44:; - /* "w3lib/_url.pyx":1067 + /* "w3lib/_url.pyx":1066 * buffer = "%40" + buffer * at_sign_seen = True * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< @@ -15837,10 +15492,10 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_L39_continue:; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1080 + /* "w3lib/_url.pyx":1079 * else: * url.username += encoded_code_points * buffer = "" # <<<<<<<<<<<<<< @@ -15850,7 +15505,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1063 + /* "w3lib/_url.pyx":1062 * skip_authority_shortcut = True * pointer -= 1 * elif not reached_end and c == "@": # <<<<<<<<<<<<<< @@ -15860,7 +15515,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L34; } - /* "w3lib/_url.pyx":1081 + /* "w3lib/_url.pyx":1080 * url.username += encoded_code_points * buffer = "" * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< @@ -15872,32 +15527,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_v_reached_end; goto __pyx_L46_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1081, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) - if (!__pyx_t_10) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1080, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (!__pyx_t_12) { } else { - __pyx_t_6 = __pyx_t_10; + __pyx_t_6 = __pyx_t_12; goto __pyx_L46_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1080, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_10) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_12) { } else { - __pyx_t_6 = __pyx_t_10; + __pyx_t_6 = __pyx_t_12; goto __pyx_L46_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1081, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) - __pyx_t_6 = __pyx_t_10; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1080, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __pyx_t_12; __pyx_L46_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1082 + /* "w3lib/_url.pyx":1081 * buffer = "" * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< @@ -15909,13 +15564,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_v_at_sign_seen; goto __pyx_L51_bool_binop_done; } - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1082, __pyx_L1_error) - __pyx_t_7 = (!__pyx_t_10); - __pyx_t_6 = __pyx_t_7; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_8 = (!__pyx_t_12); + __pyx_t_6 = __pyx_t_8; __pyx_L51_bool_binop_done:; if (unlikely(__pyx_t_6)) { - /* "w3lib/_url.pyx":1083 + /* "w3lib/_url.pyx":1082 * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if at_sign_seen and not buffer: * raise ValueError # <<<<<<<<<<<<<< @@ -15923,9 +15578,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * buffer = "" */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1083, __pyx_L1_error) + __PYX_ERR(0, 1082, __pyx_L1_error) - /* "w3lib/_url.pyx":1082 + /* "w3lib/_url.pyx":1081 * buffer = "" * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< @@ -15934,23 +15589,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1084 + /* "w3lib/_url.pyx":1083 * if at_sign_seen and not buffer: * raise ValueError * pointer -= len(buffer) + 1 # <<<<<<<<<<<<<< * buffer = "" * state = HOST */ - __pyx_t_8 = PyObject_Length(__pyx_v_buffer); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1084, __pyx_L1_error) - __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_8 + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_10 = PyObject_Length(__pyx_v_buffer); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1083, __pyx_L1_error) + __pyx_v_pointer = (__pyx_v_pointer - (__pyx_t_10 + 1)); - /* "w3lib/_url.pyx":1085 + /* "w3lib/_url.pyx":1084 * raise ValueError * pointer -= len(buffer) + 1 * buffer = "" # <<<<<<<<<<<<<< @@ -15960,7 +15609,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1086 + /* "w3lib/_url.pyx":1085 * pointer -= len(buffer) + 1 * buffer = "" * state = HOST # <<<<<<<<<<<<<< @@ -15969,7 +15618,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_HOST; - /* "w3lib/_url.pyx":1081 + /* "w3lib/_url.pyx":1080 * url.username += encoded_code_points * buffer = "" * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< @@ -15979,7 +15628,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L34; } - /* "w3lib/_url.pyx":1088 + /* "w3lib/_url.pyx":1087 * state = HOST * else: * buffer += c # <<<<<<<<<<<<<< @@ -15987,15 +15636,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * elif state == HOST: */ /*else*/ { - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1088, __pyx_L1_error) } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1088, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1087, __pyx_L1_error) } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L34:; - /* "w3lib/_url.pyx":1055 + /* "w3lib/_url.pyx":1054 * pointer -= 1 * * elif state == AUTHORITY: # <<<<<<<<<<<<<< @@ -16005,7 +15654,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1090 + /* "w3lib/_url.pyx":1089 * buffer += c * * elif state == HOST: # <<<<<<<<<<<<<< @@ -16015,43 +15664,43 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_HOST); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1091 + /* "w3lib/_url.pyx":1090 * * elif state == HOST: * if not reached_end and c == ":" and not inside_brackets: # <<<<<<<<<<<<<< * if not buffer: * raise ValueError */ - __pyx_t_7 = (!__pyx_v_reached_end); - if (__pyx_t_7) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L54_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1091, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1091, __pyx_L1_error) - if (__pyx_t_7) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1090, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1090, __pyx_L1_error) + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L54_bool_binop_done; } - __pyx_t_7 = (!__pyx_v_inside_brackets); - __pyx_t_6 = __pyx_t_7; + __pyx_t_8 = (!__pyx_v_inside_brackets); + __pyx_t_6 = __pyx_t_8; __pyx_L54_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1092 + /* "w3lib/_url.pyx":1091 * elif state == HOST: * if not reached_end and c == ":" and not inside_brackets: * if not buffer: # <<<<<<<<<<<<<< * raise ValueError * url = _parse_host(buffer, url) */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1092, __pyx_L1_error) - __pyx_t_7 = (!__pyx_t_6); - if (unlikely(__pyx_t_7)) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1091, __pyx_L1_error) + __pyx_t_8 = (!__pyx_t_6); + if (unlikely(__pyx_t_8)) { - /* "w3lib/_url.pyx":1093 + /* "w3lib/_url.pyx":1092 * if not reached_end and c == ":" and not inside_brackets: * if not buffer: * raise ValueError # <<<<<<<<<<<<<< @@ -16059,9 +15708,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * buffer = "" */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1093, __pyx_L1_error) + __PYX_ERR(0, 1092, __pyx_L1_error) - /* "w3lib/_url.pyx":1092 + /* "w3lib/_url.pyx":1091 * elif state == HOST: * if not reached_end and c == ":" and not inside_brackets: * if not buffer: # <<<<<<<<<<<<<< @@ -16070,23 +15719,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1094 + /* "w3lib/_url.pyx":1093 * if not buffer: * raise ValueError * url = _parse_host(buffer, url) # <<<<<<<<<<<<<< * buffer = "" * state = PORT */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = NULL; + __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_12)) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; @@ -16094,17 +15743,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_buffer, __pyx_v_url}; + PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_v_buffer, __pyx_v_url}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1094, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_url, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1095 + /* "w3lib/_url.pyx":1094 * raise ValueError * url = _parse_host(buffer, url) * buffer = "" # <<<<<<<<<<<<<< @@ -16114,7 +15763,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1096 + /* "w3lib/_url.pyx":1095 * url = _parse_host(buffer, url) * buffer = "" * state = PORT # <<<<<<<<<<<<<< @@ -16123,16 +15772,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PORT; - /* "w3lib/_url.pyx":1097 + /* "w3lib/_url.pyx":1096 * buffer = "" * state = PORT * url._port_token_seen = True # <<<<<<<<<<<<<< * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * pointer -= 1 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen, Py_True) < 0) __PYX_ERR(0, 1097, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen, Py_True) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) - /* "w3lib/_url.pyx":1091 + /* "w3lib/_url.pyx":1090 * * elif state == HOST: * if not reached_end and c == ":" and not inside_brackets: # <<<<<<<<<<<<<< @@ -16142,7 +15791,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L53; } - /* "w3lib/_url.pyx":1098 + /* "w3lib/_url.pyx":1097 * state = PORT * url._port_token_seen = True * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< @@ -16151,72 +15800,69 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ if (!__pyx_v_reached_end) { } else { - __pyx_t_7 = __pyx_v_reached_end; + __pyx_t_8 = __pyx_v_reached_end; goto __pyx_L58_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1098, __pyx_L1_error) } - __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1098, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1097, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1097, __pyx_L1_error) if (!__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_6; + __pyx_t_8 = __pyx_t_6; goto __pyx_L58_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1098, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1097, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_6; + __pyx_t_8 = __pyx_t_6; goto __pyx_L58_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1098, __pyx_L1_error) } - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1098, __pyx_L1_error) - __pyx_t_7 = __pyx_t_6; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1097, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1097, __pyx_L1_error) + __pyx_t_8 = __pyx_t_6; __pyx_L58_bool_binop_done:; - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1099 + /* "w3lib/_url.pyx":1098 * url._port_token_seen = True * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * pointer -= 1 # <<<<<<<<<<<<<< * if url.scheme in _SPECIAL_SCHEMES and not buffer: * raise ValueError */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_pointer = (__pyx_v_pointer - 1); - /* "w3lib/_url.pyx":1100 + /* "w3lib/_url.pyx":1099 * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * pointer -= 1 * if url.scheme in _SPECIAL_SCHEMES and not buffer: # <<<<<<<<<<<<<< * raise ValueError * url = _parse_host(buffer, url) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1100, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_6; + __pyx_t_8 = __pyx_t_6; goto __pyx_L63_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1100, __pyx_L1_error) - __pyx_t_10 = (!__pyx_t_6); - __pyx_t_7 = __pyx_t_10; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1099, __pyx_L1_error) + __pyx_t_12 = (!__pyx_t_6); + __pyx_t_8 = __pyx_t_12; __pyx_L63_bool_binop_done:; - if (unlikely(__pyx_t_7)) { + if (unlikely(__pyx_t_8)) { - /* "w3lib/_url.pyx":1101 + /* "w3lib/_url.pyx":1100 * pointer -= 1 * if url.scheme in _SPECIAL_SCHEMES and not buffer: * raise ValueError # <<<<<<<<<<<<<< @@ -16224,9 +15870,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * buffer = "" */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1101, __pyx_L1_error) + __PYX_ERR(0, 1100, __pyx_L1_error) - /* "w3lib/_url.pyx":1100 + /* "w3lib/_url.pyx":1099 * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * pointer -= 1 * if url.scheme in _SPECIAL_SCHEMES and not buffer: # <<<<<<<<<<<<<< @@ -16235,23 +15881,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1102 + /* "w3lib/_url.pyx":1101 * if url.scheme in _SPECIAL_SCHEMES and not buffer: * raise ValueError * url = _parse_host(buffer, url) # <<<<<<<<<<<<<< * buffer = "" * state = PATH_START */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = NULL; + __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_12)) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; @@ -16259,17 +15905,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_buffer, __pyx_v_url}; + PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_v_buffer, __pyx_v_url}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_url, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1103 + /* "w3lib/_url.pyx":1102 * raise ValueError * url = _parse_host(buffer, url) * buffer = "" # <<<<<<<<<<<<<< @@ -16279,7 +15925,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1104 + /* "w3lib/_url.pyx":1103 * url = _parse_host(buffer, url) * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< @@ -16288,7 +15934,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":1098 + /* "w3lib/_url.pyx":1097 * state = PORT * url._port_token_seen = True * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< @@ -16298,28 +15944,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L53; } - /* "w3lib/_url.pyx":1105 + /* "w3lib/_url.pyx":1104 * buffer = "" * state = PATH_START * elif not reached_end: # <<<<<<<<<<<<<< * if c == "[": * inside_brackets = True */ - __pyx_t_7 = (!__pyx_v_reached_end); - if (__pyx_t_7) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1106 + /* "w3lib/_url.pyx":1105 * state = PATH_START * elif not reached_end: * if c == "[": # <<<<<<<<<<<<<< * inside_brackets = True * elif c == "]": */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1106, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1106, __pyx_L1_error) - if (__pyx_t_7) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1105, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1105, __pyx_L1_error) + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1107 + /* "w3lib/_url.pyx":1106 * elif not reached_end: * if c == "[": * inside_brackets = True # <<<<<<<<<<<<<< @@ -16328,7 +15974,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_inside_brackets = 1; - /* "w3lib/_url.pyx":1106 + /* "w3lib/_url.pyx":1105 * state = PATH_START * elif not reached_end: * if c == "[": # <<<<<<<<<<<<<< @@ -16338,18 +15984,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L65; } - /* "w3lib/_url.pyx":1108 + /* "w3lib/_url.pyx":1107 * if c == "[": * inside_brackets = True * elif c == "]": # <<<<<<<<<<<<<< * inside_brackets = False * buffer += c */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1108, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) - if (__pyx_t_7) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1107, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1107, __pyx_L1_error) + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1109 + /* "w3lib/_url.pyx":1108 * inside_brackets = True * elif c == "]": * inside_brackets = False # <<<<<<<<<<<<<< @@ -16358,7 +16004,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_inside_brackets = 0; - /* "w3lib/_url.pyx":1108 + /* "w3lib/_url.pyx":1107 * if c == "[": * inside_brackets = True * elif c == "]": # <<<<<<<<<<<<<< @@ -16368,20 +16014,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L65:; - /* "w3lib/_url.pyx":1110 + /* "w3lib/_url.pyx":1109 * elif c == "]": * inside_brackets = False * buffer += c # <<<<<<<<<<<<<< * * elif state == PORT: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1110, __pyx_L1_error) } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1109, __pyx_L1_error) } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1105 + /* "w3lib/_url.pyx":1104 * buffer = "" * state = PATH_START * elif not reached_end: # <<<<<<<<<<<<<< @@ -16391,7 +16037,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L53:; - /* "w3lib/_url.pyx":1090 + /* "w3lib/_url.pyx":1089 * buffer += c * * elif state == HOST: # <<<<<<<<<<<<<< @@ -16401,52 +16047,52 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1112 + /* "w3lib/_url.pyx":1111 * buffer += c * * elif state == PORT: # <<<<<<<<<<<<<< * if not reached_end and c in _ASCII_DIGIT: * buffer += c */ - __pyx_t_7 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PORT); - if (__pyx_t_7) { + __pyx_t_8 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PORT); + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1113 + /* "w3lib/_url.pyx":1112 * * elif state == PORT: * if not reached_end and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< * buffer += c * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": */ - __pyx_t_10 = (!__pyx_v_reached_end); - if (__pyx_t_10) { + __pyx_t_12 = (!__pyx_v_reached_end); + if (__pyx_t_12) { } else { - __pyx_t_7 = __pyx_t_10; + __pyx_t_8 = __pyx_t_12; goto __pyx_L67_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1113, __pyx_L1_error) } - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1113, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1112, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1113, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __pyx_t_10; + __pyx_t_8 = __pyx_t_12; __pyx_L67_bool_binop_done:; - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1114 + /* "w3lib/_url.pyx":1113 * elif state == PORT: * if not reached_end and c in _ASCII_DIGIT: * buffer += c # <<<<<<<<<<<<<< * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if buffer: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1114, __pyx_L1_error) } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1113, __pyx_L1_error) } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1113 + /* "w3lib/_url.pyx":1112 * * elif state == PORT: * if not reached_end and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< @@ -16456,7 +16102,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L66; } - /* "w3lib/_url.pyx":1115 + /* "w3lib/_url.pyx":1114 * if not reached_end and c in _ASCII_DIGIT: * buffer += c * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< @@ -16465,103 +16111,103 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ if (!__pyx_v_reached_end) { } else { - __pyx_t_7 = __pyx_v_reached_end; + __pyx_t_8 = __pyx_v_reached_end; goto __pyx_L69_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1115, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1115, __pyx_L1_error) - if (!__pyx_t_10) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1114, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) + if (!__pyx_t_12) { } else { - __pyx_t_7 = __pyx_t_10; + __pyx_t_8 = __pyx_t_12; goto __pyx_L69_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1115, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_10) { + if (__pyx_t_12) { } else { - __pyx_t_7 = __pyx_t_10; + __pyx_t_8 = __pyx_t_12; goto __pyx_L69_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1115, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1115, __pyx_L1_error) - __pyx_t_7 = __pyx_t_10; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1114, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) + __pyx_t_8 = __pyx_t_12; __pyx_L69_bool_binop_done:; - if (likely(__pyx_t_7)) { + if (likely(__pyx_t_8)) { - /* "w3lib/_url.pyx":1116 + /* "w3lib/_url.pyx":1115 * buffer += c * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if buffer: # <<<<<<<<<<<<<< * port: cython.int = int(buffer) * if port > 2**16 - 1: */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1116, __pyx_L1_error) - if (__pyx_t_7) { + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1115, __pyx_L1_error) + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1117 + /* "w3lib/_url.pyx":1116 * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if buffer: * port: cython.int = int(buffer) # <<<<<<<<<<<<<< * if port > 2**16 - 1: * raise ValueError(f"Port {port} is too high.") */ - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1117, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_port = __pyx_t_4; - /* "w3lib/_url.pyx":1118 + /* "w3lib/_url.pyx":1117 * if buffer: * port: cython.int = int(buffer) * if port > 2**16 - 1: # <<<<<<<<<<<<<< * raise ValueError(f"Port {port} is too high.") * url.port = port */ - __pyx_t_7 = (__pyx_v_port > 0xffff); - if (unlikely(__pyx_t_7)) { + __pyx_t_8 = (__pyx_v_port > 0xffff); + if (unlikely(__pyx_t_8)) { - /* "w3lib/_url.pyx":1119 + /* "w3lib/_url.pyx":1118 * port: cython.int = int(buffer) * if port > 2**16 - 1: * raise ValueError(f"Port {port} is too high.") # <<<<<<<<<<<<<< * url.port = port * buffer = "" */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = 0; - __pyx_t_13 = 127; + __pyx_t_10 = 0; + __pyx_t_7 = 127; __Pyx_INCREF(__pyx_kp_u_Port); - __pyx_t_8 += 5; + __pyx_t_10 += 5; __Pyx_GIVEREF(__pyx_kp_u_Port); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Port); - __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_port, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_port, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); + __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_kp_u_is_too_high); - __pyx_t_8 += 13; + __pyx_t_10 += 13; __Pyx_GIVEREF(__pyx_kp_u_is_too_high); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_is_too_high); - __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1119, __pyx_L1_error) + __PYX_ERR(0, 1118, __pyx_L1_error) - /* "w3lib/_url.pyx":1118 + /* "w3lib/_url.pyx":1117 * if buffer: * port: cython.int = int(buffer) * if port > 2**16 - 1: # <<<<<<<<<<<<<< @@ -16570,19 +16216,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1120 + /* "w3lib/_url.pyx":1119 * if port > 2**16 - 1: * raise ValueError(f"Port {port} is too high.") * url.port = port # <<<<<<<<<<<<<< * buffer = "" * state = PATH_START */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_port); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1120, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_port); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_2) < 0) __PYX_ERR(0, 1120, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_2) < 0) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1121 + /* "w3lib/_url.pyx":1120 * raise ValueError(f"Port {port} is too high.") * url.port = port * buffer = "" # <<<<<<<<<<<<<< @@ -16592,7 +16238,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1116 + /* "w3lib/_url.pyx":1115 * buffer += c * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if buffer: # <<<<<<<<<<<<<< @@ -16601,7 +16247,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1122 + /* "w3lib/_url.pyx":1121 * url.port = port * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< @@ -16610,19 +16256,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":1123 + /* "w3lib/_url.pyx":1122 * buffer = "" * state = PATH_START * pointer -= 1 # <<<<<<<<<<<<<< * else: * raise ValueError */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_pointer = (__pyx_v_pointer - 1); - /* "w3lib/_url.pyx":1115 + /* "w3lib/_url.pyx":1114 * if not reached_end and c in _ASCII_DIGIT: * buffer += c * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< @@ -16632,7 +16275,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L66; } - /* "w3lib/_url.pyx":1125 + /* "w3lib/_url.pyx":1124 * pointer -= 1 * else: * raise ValueError # <<<<<<<<<<<<<< @@ -16641,11 +16284,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ /*else*/ { __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1125, __pyx_L1_error) + __PYX_ERR(0, 1124, __pyx_L1_error) } __pyx_L66:; - /* "w3lib/_url.pyx":1112 + /* "w3lib/_url.pyx":1111 * buffer += c * * elif state == PORT: # <<<<<<<<<<<<<< @@ -16655,54 +16298,54 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1127 + /* "w3lib/_url.pyx":1126 * raise ValueError * * elif state == FILE: # <<<<<<<<<<<<<< * url.scheme = "file" * url.hostname = "" */ - __pyx_t_7 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE); - if (__pyx_t_7) { + __pyx_t_8 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE); + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1128 + /* "w3lib/_url.pyx":1127 * * elif state == FILE: * url.scheme = "file" # <<<<<<<<<<<<<< * url.hostname = "" * if not reached_end and c in "/\\": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme, __pyx_n_u_file) < 0) __PYX_ERR(0, 1128, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme, __pyx_n_u_file) < 0) __PYX_ERR(0, 1127, __pyx_L1_error) - /* "w3lib/_url.pyx":1129 + /* "w3lib/_url.pyx":1128 * elif state == FILE: * url.scheme = "file" * url.hostname = "" # <<<<<<<<<<<<<< * if not reached_end and c in "/\\": * state = FILE_SLASH */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1129, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1128, __pyx_L1_error) - /* "w3lib/_url.pyx":1130 + /* "w3lib/_url.pyx":1129 * url.scheme = "file" * url.hostname = "" * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< * state = FILE_SLASH * else: */ - __pyx_t_10 = (!__pyx_v_reached_end); - if (__pyx_t_10) { + __pyx_t_12 = (!__pyx_v_reached_end); + if (__pyx_t_12) { } else { - __pyx_t_7 = __pyx_t_10; + __pyx_t_8 = __pyx_t_12; goto __pyx_L76_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1130, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1130, __pyx_L1_error) - __pyx_t_7 = __pyx_t_10; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1129, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1129, __pyx_L1_error) + __pyx_t_8 = __pyx_t_12; __pyx_L76_bool_binop_done:; - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1131 + /* "w3lib/_url.pyx":1130 * url.hostname = "" * if not reached_end and c in "/\\": * state = FILE_SLASH # <<<<<<<<<<<<<< @@ -16711,7 +16354,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FILE_SLASH; - /* "w3lib/_url.pyx":1130 + /* "w3lib/_url.pyx":1129 * url.scheme = "file" * url.hostname = "" * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< @@ -16721,7 +16364,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L75; } - /* "w3lib/_url.pyx":1133 + /* "w3lib/_url.pyx":1132 * state = FILE_SLASH * else: * state = PATH # <<<<<<<<<<<<<< @@ -16731,21 +16374,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1134 + /* "w3lib/_url.pyx":1133 * else: * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == FILE_SLASH: */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_pointer = (__pyx_v_pointer - 1); } __pyx_L75:; - /* "w3lib/_url.pyx":1127 + /* "w3lib/_url.pyx":1126 * raise ValueError * * elif state == FILE: # <<<<<<<<<<<<<< @@ -16755,36 +16395,36 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1136 + /* "w3lib/_url.pyx":1135 * pointer -= 1 * * elif state == FILE_SLASH: # <<<<<<<<<<<<<< * if not reached_end and c in "/\\": * state = FILE_HOST */ - __pyx_t_7 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_SLASH); - if (__pyx_t_7) { + __pyx_t_8 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_SLASH); + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1137 + /* "w3lib/_url.pyx":1136 * * elif state == FILE_SLASH: * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< * state = FILE_HOST * else: */ - __pyx_t_10 = (!__pyx_v_reached_end); - if (__pyx_t_10) { + __pyx_t_12 = (!__pyx_v_reached_end); + if (__pyx_t_12) { } else { - __pyx_t_7 = __pyx_t_10; + __pyx_t_8 = __pyx_t_12; goto __pyx_L79_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1137, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1137, __pyx_L1_error) - __pyx_t_7 = __pyx_t_10; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1136, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1136, __pyx_L1_error) + __pyx_t_8 = __pyx_t_12; __pyx_L79_bool_binop_done:; - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1138 + /* "w3lib/_url.pyx":1137 * elif state == FILE_SLASH: * if not reached_end and c in "/\\": * state = FILE_HOST # <<<<<<<<<<<<<< @@ -16793,7 +16433,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FILE_HOST; - /* "w3lib/_url.pyx":1137 + /* "w3lib/_url.pyx":1136 * * elif state == FILE_SLASH: * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< @@ -16803,7 +16443,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L78; } - /* "w3lib/_url.pyx":1140 + /* "w3lib/_url.pyx":1139 * state = FILE_HOST * else: * state = PATH # <<<<<<<<<<<<<< @@ -16813,21 +16453,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1141 + /* "w3lib/_url.pyx":1140 * else: * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == FILE_HOST: */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_pointer = (__pyx_v_pointer - 1); } __pyx_L78:; - /* "w3lib/_url.pyx":1136 + /* "w3lib/_url.pyx":1135 * pointer -= 1 * * elif state == FILE_SLASH: # <<<<<<<<<<<<<< @@ -16837,17 +16474,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1143 + /* "w3lib/_url.pyx":1142 * pointer -= 1 * * elif state == FILE_HOST: # <<<<<<<<<<<<<< * if reached_end or c in "/\\?#": * pointer -= 1 */ - __pyx_t_7 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_HOST); - if (__pyx_t_7) { + __pyx_t_8 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_HOST); + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1144 + /* "w3lib/_url.pyx":1143 * * elif state == FILE_HOST: * if reached_end or c in "/\\?#": # <<<<<<<<<<<<<< @@ -16856,44 +16493,41 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ if (!__pyx_v_reached_end) { } else { - __pyx_t_7 = __pyx_v_reached_end; + __pyx_t_8 = __pyx_v_reached_end; goto __pyx_L82_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1144, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1144, __pyx_L1_error) - __pyx_t_7 = __pyx_t_10; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1143, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_8 = __pyx_t_12; __pyx_L82_bool_binop_done:; - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1145 + /* "w3lib/_url.pyx":1144 * elif state == FILE_HOST: * if reached_end or c in "/\\?#": * pointer -= 1 # <<<<<<<<<<<<<< * if _is_windows_drive_letter(buffer): * state = PATH */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_pointer = (__pyx_v_pointer - 1); - /* "w3lib/_url.pyx":1146 + /* "w3lib/_url.pyx":1145 * if reached_end or c in "/\\?#": * pointer -= 1 * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< * state = PATH * elif not buffer: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = NULL; + __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_12)) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -16901,18 +16535,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_buffer}; + PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_buffer}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1146, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_7) { + if (__pyx_t_8) { - /* "w3lib/_url.pyx":1147 + /* "w3lib/_url.pyx":1146 * pointer -= 1 * if _is_windows_drive_letter(buffer): * state = PATH # <<<<<<<<<<<<<< @@ -16921,7 +16555,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1146 + /* "w3lib/_url.pyx":1145 * if reached_end or c in "/\\?#": * pointer -= 1 * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< @@ -16931,27 +16565,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L84; } - /* "w3lib/_url.pyx":1148 + /* "w3lib/_url.pyx":1147 * if _is_windows_drive_letter(buffer): * state = PATH * elif not buffer: # <<<<<<<<<<<<<< * url.hostname = "" * state = PATH_START */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1148, __pyx_L1_error) - __pyx_t_10 = (!__pyx_t_7); - if (__pyx_t_10) { + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1147, __pyx_L1_error) + __pyx_t_12 = (!__pyx_t_8); + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1149 + /* "w3lib/_url.pyx":1148 * state = PATH * elif not buffer: * url.hostname = "" # <<<<<<<<<<<<<< * state = PATH_START * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1149, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1148, __pyx_L1_error) - /* "w3lib/_url.pyx":1150 + /* "w3lib/_url.pyx":1149 * elif not buffer: * url.hostname = "" * state = PATH_START # <<<<<<<<<<<<<< @@ -16960,7 +16594,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":1148 + /* "w3lib/_url.pyx":1147 * if _is_windows_drive_letter(buffer): * state = PATH * elif not buffer: # <<<<<<<<<<<<<< @@ -16970,7 +16604,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L84; } - /* "w3lib/_url.pyx":1152 + /* "w3lib/_url.pyx":1151 * state = PATH_START * else: * url = _parse_host(buffer, url) # <<<<<<<<<<<<<< @@ -16978,16 +16612,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * url.hostname = "" */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = NULL; + __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_12)) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -16995,39 +16629,39 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_buffer, __pyx_v_url}; + PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_v_buffer, __pyx_v_url}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1152, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF_SET(__pyx_v_url, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1153 + /* "w3lib/_url.pyx":1152 * else: * url = _parse_host(buffer, url) * if url.hostname == "localhost": # <<<<<<<<<<<<<< * url.hostname = "" * buffer = "" */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_localhost, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_localhost, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_10) { + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1154 + /* "w3lib/_url.pyx":1153 * url = _parse_host(buffer, url) * if url.hostname == "localhost": * url.hostname = "" # <<<<<<<<<<<<<< * buffer = "" * state = PATH_START */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1154, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1153, __pyx_L1_error) - /* "w3lib/_url.pyx":1153 + /* "w3lib/_url.pyx":1152 * else: * url = _parse_host(buffer, url) * if url.hostname == "localhost": # <<<<<<<<<<<<<< @@ -17036,7 +16670,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1155 + /* "w3lib/_url.pyx":1154 * if url.hostname == "localhost": * url.hostname = "" * buffer = "" # <<<<<<<<<<<<<< @@ -17046,7 +16680,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1156 + /* "w3lib/_url.pyx":1155 * url.hostname = "" * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< @@ -17057,7 +16691,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L84:; - /* "w3lib/_url.pyx":1144 + /* "w3lib/_url.pyx":1143 * * elif state == FILE_HOST: * if reached_end or c in "/\\?#": # <<<<<<<<<<<<<< @@ -17067,30 +16701,30 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L81; } - /* "w3lib/_url.pyx":1157 + /* "w3lib/_url.pyx":1156 * buffer = "" * state = PATH_START * elif not reached_end: # <<<<<<<<<<<<<< * buffer += c * */ - __pyx_t_10 = (!__pyx_v_reached_end); - if (__pyx_t_10) { + __pyx_t_12 = (!__pyx_v_reached_end); + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1158 + /* "w3lib/_url.pyx":1157 * state = PATH_START * elif not reached_end: * buffer += c # <<<<<<<<<<<<<< * * elif state == PATH_START: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1158, __pyx_L1_error) } - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1157, __pyx_L1_error) } + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1157 + /* "w3lib/_url.pyx":1156 * buffer = "" * state = PATH_START * elif not reached_end: # <<<<<<<<<<<<<< @@ -17100,7 +16734,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L81:; - /* "w3lib/_url.pyx":1143 + /* "w3lib/_url.pyx":1142 * pointer -= 1 * * elif state == FILE_HOST: # <<<<<<<<<<<<<< @@ -17110,33 +16744,33 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1160 + /* "w3lib/_url.pyx":1159 * buffer += c * * elif state == PATH_START: # <<<<<<<<<<<<<< * if url.scheme in _SPECIAL_SCHEMES: * state = PATH */ - __pyx_t_10 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH_START); - if (__pyx_t_10) { + __pyx_t_12 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH_START); + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1161 + /* "w3lib/_url.pyx":1160 * * elif state == PATH_START: * if url.scheme in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< * state = PATH * if not reached_end and c not in "/\\": */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1161, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1161, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_10) { + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1162 + /* "w3lib/_url.pyx":1161 * elif state == PATH_START: * if url.scheme in _SPECIAL_SCHEMES: * state = PATH # <<<<<<<<<<<<<< @@ -17145,38 +16779,35 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1163 + /* "w3lib/_url.pyx":1162 * if url.scheme in _SPECIAL_SCHEMES: * state = PATH * if not reached_end and c not in "/\\": # <<<<<<<<<<<<<< * pointer -= 1 * elif not reached_end: */ - __pyx_t_7 = (!__pyx_v_reached_end); - if (__pyx_t_7) { + __pyx_t_8 = (!__pyx_v_reached_end); + if (__pyx_t_8) { } else { - __pyx_t_10 = __pyx_t_7; + __pyx_t_12 = __pyx_t_8; goto __pyx_L88_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1163, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__14, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1163, __pyx_L1_error) - __pyx_t_10 = __pyx_t_7; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1162, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__13, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1162, __pyx_L1_error) + __pyx_t_12 = __pyx_t_8; __pyx_L88_bool_binop_done:; - if (__pyx_t_10) { + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1164 + /* "w3lib/_url.pyx":1163 * state = PATH * if not reached_end and c not in "/\\": * pointer -= 1 # <<<<<<<<<<<<<< * elif not reached_end: * if c == "?": */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_pointer = (__pyx_v_pointer - 1); - /* "w3lib/_url.pyx":1163 + /* "w3lib/_url.pyx":1162 * if url.scheme in _SPECIAL_SCHEMES: * state = PATH * if not reached_end and c not in "/\\": # <<<<<<<<<<<<<< @@ -17185,7 +16816,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1161 + /* "w3lib/_url.pyx":1160 * * elif state == PATH_START: * if url.scheme in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< @@ -17195,37 +16826,37 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L86; } - /* "w3lib/_url.pyx":1165 + /* "w3lib/_url.pyx":1164 * if not reached_end and c not in "/\\": * pointer -= 1 * elif not reached_end: # <<<<<<<<<<<<<< * if c == "?": * url._query_token_seen = True */ - __pyx_t_10 = (!__pyx_v_reached_end); - if (__pyx_t_10) { + __pyx_t_12 = (!__pyx_v_reached_end); + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1166 + /* "w3lib/_url.pyx":1165 * pointer -= 1 * elif not reached_end: * if c == "?": # <<<<<<<<<<<<<< * url._query_token_seen = True * state = QUERY */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1166, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1166, __pyx_L1_error) - if (__pyx_t_10) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1165, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1165, __pyx_L1_error) + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1167 + /* "w3lib/_url.pyx":1166 * elif not reached_end: * if c == "?": * url._query_token_seen = True # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1167, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1166, __pyx_L1_error) - /* "w3lib/_url.pyx":1168 + /* "w3lib/_url.pyx":1167 * if c == "?": * url._query_token_seen = True * state = QUERY # <<<<<<<<<<<<<< @@ -17234,7 +16865,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":1166 + /* "w3lib/_url.pyx":1165 * pointer -= 1 * elif not reached_end: * if c == "?": # <<<<<<<<<<<<<< @@ -17244,27 +16875,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L90; } - /* "w3lib/_url.pyx":1169 + /* "w3lib/_url.pyx":1168 * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< * url._fragment_token_seen = True * state = FRAGMENT */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1169, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1169, __pyx_L1_error) - if (__pyx_t_10) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1168, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1168, __pyx_L1_error) + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1170 + /* "w3lib/_url.pyx":1169 * state = QUERY * elif c == "#": * url._fragment_token_seen = True # <<<<<<<<<<<<<< * state = FRAGMENT * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1170, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) - /* "w3lib/_url.pyx":1171 + /* "w3lib/_url.pyx":1170 * elif c == "#": * url._fragment_token_seen = True * state = FRAGMENT # <<<<<<<<<<<<<< @@ -17273,7 +16904,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1169 + /* "w3lib/_url.pyx":1168 * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< @@ -17283,7 +16914,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L90; } - /* "w3lib/_url.pyx":1173 + /* "w3lib/_url.pyx":1172 * state = FRAGMENT * else: * state = PATH # <<<<<<<<<<<<<< @@ -17293,30 +16924,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1174 + /* "w3lib/_url.pyx":1173 * else: * state = PATH * if c != "/": # <<<<<<<<<<<<<< * pointer -= 1 * */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1174, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1174, __pyx_L1_error) - if (__pyx_t_10) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1173, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1173, __pyx_L1_error) + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1175 + /* "w3lib/_url.pyx":1174 * state = PATH * if c != "/": * pointer -= 1 # <<<<<<<<<<<<<< * * elif state == PATH: */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_pointer = (__pyx_v_pointer - 1); - /* "w3lib/_url.pyx":1174 + /* "w3lib/_url.pyx":1173 * else: * state = PATH * if c != "/": # <<<<<<<<<<<<<< @@ -17327,7 +16955,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L90:; - /* "w3lib/_url.pyx":1165 + /* "w3lib/_url.pyx":1164 * if not reached_end and c not in "/\\": * pointer -= 1 * elif not reached_end: # <<<<<<<<<<<<<< @@ -17337,7 +16965,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L86:; - /* "w3lib/_url.pyx":1160 + /* "w3lib/_url.pyx":1159 * buffer += c * * elif state == PATH_START: # <<<<<<<<<<<<<< @@ -17347,17 +16975,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1177 + /* "w3lib/_url.pyx":1176 * pointer -= 1 * * elif state == PATH: # <<<<<<<<<<<<<< * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): */ - __pyx_t_10 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH); - if (__pyx_t_10) { + __pyx_t_12 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH); + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1178 + /* "w3lib/_url.pyx":1177 * * elif state == PATH: * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": # <<<<<<<<<<<<<< @@ -17366,58 +16994,58 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ if (!__pyx_v_reached_end) { } else { - __pyx_t_10 = __pyx_v_reached_end; + __pyx_t_12 = __pyx_v_reached_end; goto __pyx_L93_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1178, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) - if (!__pyx_t_7) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1177, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1177, __pyx_L1_error) + if (!__pyx_t_8) { } else { - __pyx_t_10 = __pyx_t_7; + __pyx_t_12 = __pyx_t_8; goto __pyx_L93_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_7) { + if (!__pyx_t_8) { goto __pyx_L96_next_or; } else { } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1178, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) - if (!__pyx_t_7) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1177, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1177, __pyx_L1_error) + if (!__pyx_t_8) { } else { - __pyx_t_10 = __pyx_t_7; + __pyx_t_12 = __pyx_t_8; goto __pyx_L93_bool_binop_done; } __pyx_L96_next_or:; - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1178, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__21, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) - __pyx_t_10 = __pyx_t_7; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1177, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1177, __pyx_L1_error) + __pyx_t_12 = __pyx_t_8; __pyx_L93_bool_binop_done:; - if (__pyx_t_10) { + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1179 + /* "w3lib/_url.pyx":1178 * elif state == PATH: * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< * _shorten_path(url) * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_double_dot_path_segment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_double_dot_path_segment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = NULL; + __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_12)) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -17425,34 +17053,34 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_buffer}; + PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_buffer}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_10) { + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1180 + /* "w3lib/_url.pyx":1179 * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): * _shorten_path(url) # <<<<<<<<<<<<<< * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = NULL; + __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_12)) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -17460,63 +17088,63 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_url}; + PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_url}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1181 + /* "w3lib/_url.pyx":1180 * if _is_double_dot_path_segment(buffer): * _shorten_path(url) * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): # <<<<<<<<<<<<<< * url.path.append("") * elif _is_single_dot_path_segment(buffer): */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1181, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1181, __pyx_L1_error) - if (__pyx_t_7) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1180, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) + if (__pyx_t_8) { } else { - __pyx_t_10 = __pyx_t_7; + __pyx_t_12 = __pyx_t_8; goto __pyx_L100_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_6; + __pyx_t_8 = __pyx_t_6; goto __pyx_L102_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1181, __pyx_L1_error) } - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1181, __pyx_L1_error) - __pyx_t_7 = __pyx_t_6; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1180, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) + __pyx_t_8 = __pyx_t_6; __pyx_L102_bool_binop_done:; - __pyx_t_6 = (!__pyx_t_7); - __pyx_t_10 = __pyx_t_6; + __pyx_t_6 = (!__pyx_t_8); + __pyx_t_12 = __pyx_t_6; __pyx_L100_bool_binop_done:; - if (__pyx_t_10) { + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1182 + /* "w3lib/_url.pyx":1181 * _shorten_path(url) * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") # <<<<<<<<<<<<<< * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_kp_u_); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_kp_u_); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1181 + /* "w3lib/_url.pyx":1180 * if _is_double_dot_path_segment(buffer): * _shorten_path(url) * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): # <<<<<<<<<<<<<< @@ -17525,7 +17153,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1179 + /* "w3lib/_url.pyx":1178 * elif state == PATH: * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< @@ -17535,23 +17163,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L98; } - /* "w3lib/_url.pyx":1183 + /* "w3lib/_url.pyx":1182 * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_single_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1183, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_single_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = NULL; + __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_12)) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; @@ -17559,65 +17187,65 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_buffer}; + PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_buffer}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1183, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1183, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_10) { + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1184 + /* "w3lib/_url.pyx":1183 * url.path.append("") * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): # <<<<<<<<<<<<<< * url.path.append("") * else: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1184, __pyx_L1_error) } - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1184, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1183, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1183, __pyx_L1_error) if (__pyx_t_6) { } else { - __pyx_t_10 = __pyx_t_6; + __pyx_t_12 = __pyx_t_6; goto __pyx_L105_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_7) { + if (__pyx_t_8) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = __pyx_t_8; goto __pyx_L107_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1184, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1184, __pyx_L1_error) - __pyx_t_6 = __pyx_t_7; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1183, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1183, __pyx_L1_error) + __pyx_t_6 = __pyx_t_8; __pyx_L107_bool_binop_done:; - __pyx_t_7 = (!__pyx_t_6); - __pyx_t_10 = __pyx_t_7; + __pyx_t_8 = (!__pyx_t_6); + __pyx_t_12 = __pyx_t_8; __pyx_L105_bool_binop_done:; - if (__pyx_t_10) { + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1185 + /* "w3lib/_url.pyx":1184 * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") # <<<<<<<<<<<<<< * else: * if ( */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1185, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_kp_u_); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1185, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_kp_u_); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1184 + /* "w3lib/_url.pyx":1183 * url.path.append("") * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): # <<<<<<<<<<<<<< @@ -17626,7 +17254,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1183 + /* "w3lib/_url.pyx":1182 * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< @@ -17636,7 +17264,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L98; } - /* "w3lib/_url.pyx":1187 + /* "w3lib/_url.pyx":1186 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< @@ -17645,58 +17273,58 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ /*else*/ { - /* "w3lib/_url.pyx":1188 + /* "w3lib/_url.pyx":1187 * else: * if ( * url.scheme == "file" # <<<<<<<<<<<<<< * and not url.path * and _is_windows_drive_letter(buffer) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_7) { + if (__pyx_t_8) { } else { - __pyx_t_10 = __pyx_t_7; + __pyx_t_12 = __pyx_t_8; goto __pyx_L110_bool_binop_done; } - /* "w3lib/_url.pyx":1189 + /* "w3lib/_url.pyx":1188 * if ( * url.scheme == "file" * and not url.path # <<<<<<<<<<<<<< * and _is_windows_drive_letter(buffer) * ): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1189, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = (!__pyx_t_7); + __pyx_t_6 = (!__pyx_t_8); if (__pyx_t_6) { } else { - __pyx_t_10 = __pyx_t_6; + __pyx_t_12 = __pyx_t_6; goto __pyx_L110_bool_binop_done; } - /* "w3lib/_url.pyx":1190 + /* "w3lib/_url.pyx":1189 * url.scheme == "file" * and not url.path * and _is_windows_drive_letter(buffer) # <<<<<<<<<<<<<< * ): * buffer = buffer[0] + ":" + buffer[2:] */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = NULL; + __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_12)) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -17704,49 +17332,49 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_buffer}; + PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_buffer}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_10 = __pyx_t_6; + __pyx_t_12 = __pyx_t_6; __pyx_L110_bool_binop_done:; - /* "w3lib/_url.pyx":1187 + /* "w3lib/_url.pyx":1186 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< * url.scheme == "file" * and not url.path */ - if (__pyx_t_10) { + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1192 + /* "w3lib/_url.pyx":1191 * and _is_windows_drive_letter(buffer) * ): * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< * if ( * not url.path */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_buffer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_buffer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_buffer, 2, 0, NULL, NULL, &__pyx_slice__22, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_buffer, 2, 0, NULL, NULL, &__pyx_slice__21, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_12); - __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_14); + __pyx_t_14 = 0; - /* "w3lib/_url.pyx":1187 + /* "w3lib/_url.pyx":1186 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< @@ -17755,40 +17383,40 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1194 + /* "w3lib/_url.pyx":1193 * buffer = buffer[0] + ":" + buffer[2:] * if ( * not url.path # <<<<<<<<<<<<<< * and not buffer * and not reached_end */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_7 = (!__pyx_t_6); - if (__pyx_t_7) { + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1193, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_8 = (!__pyx_t_6); + if (__pyx_t_8) { } else { - __pyx_t_10 = __pyx_t_7; + __pyx_t_12 = __pyx_t_8; goto __pyx_L114_bool_binop_done; } - /* "w3lib/_url.pyx":1195 + /* "w3lib/_url.pyx":1194 * if ( * not url.path * and not buffer # <<<<<<<<<<<<<< * and not reached_end * and c in "?#" */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1195, __pyx_L1_error) - __pyx_t_6 = (!__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_6 = (!__pyx_t_8); if (__pyx_t_6) { } else { - __pyx_t_10 = __pyx_t_6; + __pyx_t_12 = __pyx_t_6; goto __pyx_L114_bool_binop_done; } - /* "w3lib/_url.pyx":1196 + /* "w3lib/_url.pyx":1195 * not url.path * and not buffer * and not reached_end # <<<<<<<<<<<<<< @@ -17798,61 +17426,66 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (!__pyx_v_reached_end); if (__pyx_t_6) { } else { - __pyx_t_10 = __pyx_t_6; + __pyx_t_12 = __pyx_t_6; goto __pyx_L114_bool_binop_done; } - /* "w3lib/_url.pyx":1197 + /* "w3lib/_url.pyx":1196 * and not buffer * and not reached_end * and c in "?#" # <<<<<<<<<<<<<< * and input[pointer - 1] not in "/\\" * ): */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1197, __pyx_L1_error) } - __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__21, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1197, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1196, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1196, __pyx_L1_error) if (__pyx_t_6) { } else { - __pyx_t_10 = __pyx_t_6; + __pyx_t_12 = __pyx_t_6; goto __pyx_L114_bool_binop_done; } - /* "w3lib/_url.pyx":1198 + /* "w3lib/_url.pyx":1197 * and not reached_end * and c in "?#" * and input[pointer - 1] not in "/\\" # <<<<<<<<<<<<<< * ): * url._path_token_seen = True */ - __pyx_t_12 = __Pyx_PyInt_SubtractObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_t_2, __pyx_kp_u__14, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1198, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_10 = __pyx_t_6; + __pyx_t_9 = (__pyx_v_pointer - 1); + __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 1197, __pyx_L1_error) + switch (__pyx_t_7) { + case 47: + case 92: + __pyx_t_6 = 0; + break; + default: + __pyx_t_6 = 1; + break; + } + __pyx_t_8 = __pyx_t_6; + __pyx_t_12 = __pyx_t_8; __pyx_L114_bool_binop_done:; - /* "w3lib/_url.pyx":1193 + /* "w3lib/_url.pyx":1192 * ): * buffer = buffer[0] + ":" + buffer[2:] * if ( # <<<<<<<<<<<<<< * not url.path * and not buffer */ - if (__pyx_t_10) { + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1200 + /* "w3lib/_url.pyx":1199 * and input[pointer - 1] not in "/\\" * ): * url._path_token_seen = True # <<<<<<<<<<<<<< * url.path.append(buffer) * buffer = "" */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen, Py_True) < 0) __PYX_ERR(0, 1200, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen, Py_True) < 0) __PYX_ERR(0, 1199, __pyx_L1_error) - /* "w3lib/_url.pyx":1193 + /* "w3lib/_url.pyx":1192 * ): * buffer = buffer[0] + ":" + buffer[2:] * if ( # <<<<<<<<<<<<<< @@ -17861,21 +17494,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1201 + /* "w3lib/_url.pyx":1200 * ): * url._path_token_seen = True * url.path.append(buffer) # <<<<<<<<<<<<<< * buffer = "" * if not reached_end: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_v_buffer); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1201, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_14, __pyx_v_buffer); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1200, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __pyx_L98:; - /* "w3lib/_url.pyx":1202 + /* "w3lib/_url.pyx":1201 * url._path_token_seen = True * url.path.append(buffer) * buffer = "" # <<<<<<<<<<<<<< @@ -17885,37 +17518,37 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1203 + /* "w3lib/_url.pyx":1202 * url.path.append(buffer) * buffer = "" * if not reached_end: # <<<<<<<<<<<<<< * if c == "?": * url._query_token_seen = True */ - __pyx_t_10 = (!__pyx_v_reached_end); - if (__pyx_t_10) { + __pyx_t_12 = (!__pyx_v_reached_end); + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1204 + /* "w3lib/_url.pyx":1203 * buffer = "" * if not reached_end: * if c == "?": # <<<<<<<<<<<<<< * url._query_token_seen = True * state = QUERY */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1204, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1204, __pyx_L1_error) - if (__pyx_t_10) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1203, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1203, __pyx_L1_error) + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1205 + /* "w3lib/_url.pyx":1204 * if not reached_end: * if c == "?": * url._query_token_seen = True # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1205, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1204, __pyx_L1_error) - /* "w3lib/_url.pyx":1206 + /* "w3lib/_url.pyx":1205 * if c == "?": * url._query_token_seen = True * state = QUERY # <<<<<<<<<<<<<< @@ -17924,7 +17557,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":1204 + /* "w3lib/_url.pyx":1203 * buffer = "" * if not reached_end: * if c == "?": # <<<<<<<<<<<<<< @@ -17934,27 +17567,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L120; } - /* "w3lib/_url.pyx":1207 + /* "w3lib/_url.pyx":1206 * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< * url._fragment_token_seen = True * state = FRAGMENT */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1207, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1207, __pyx_L1_error) - if (__pyx_t_10) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1206, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1206, __pyx_L1_error) + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1208 + /* "w3lib/_url.pyx":1207 * state = QUERY * elif c == "#": * url._fragment_token_seen = True # <<<<<<<<<<<<<< * state = FRAGMENT * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1208, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1207, __pyx_L1_error) - /* "w3lib/_url.pyx":1209 + /* "w3lib/_url.pyx":1208 * elif c == "#": * url._fragment_token_seen = True * state = FRAGMENT # <<<<<<<<<<<<<< @@ -17963,7 +17596,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1207 + /* "w3lib/_url.pyx":1206 * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< @@ -17973,7 +17606,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L120:; - /* "w3lib/_url.pyx":1203 + /* "w3lib/_url.pyx":1202 * url.path.append(buffer) * buffer = "" * if not reached_end: # <<<<<<<<<<<<<< @@ -17982,7 +17615,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1178 + /* "w3lib/_url.pyx":1177 * * elif state == PATH: * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": # <<<<<<<<<<<<<< @@ -17992,7 +17625,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L92; } - /* "w3lib/_url.pyx":1211 + /* "w3lib/_url.pyx":1210 * state = FRAGMENT * else: * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -18000,61 +17633,64 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * pointer=pointer, */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); - /* "w3lib/_url.pyx":1212 + /* "w3lib/_url.pyx":1211 * else: * buffer += _idempotent_utf_8_percent_encode( * input=input, # <<<<<<<<<<<<<< * pointer=pointer, * encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1212, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) - /* "w3lib/_url.pyx":1213 + /* "w3lib/_url.pyx":1212 * buffer += _idempotent_utf_8_percent_encode( * input=input, * pointer=pointer, # <<<<<<<<<<<<<< * encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, * ) */ - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 1212, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_t_1) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1214 + /* "w3lib/_url.pyx":1213 * input=input, * pointer=pointer, * encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * ) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1214, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_encode_set, __pyx_t_1) < 0) __PYX_ERR(0, 1212, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_t_1) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1211 + /* "w3lib/_url.pyx":1210 * state = FRAGMENT * else: * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, * pointer=pointer, */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_12); - __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_2); + __pyx_t_2 = 0; } __pyx_L92:; - /* "w3lib/_url.pyx":1177 + /* "w3lib/_url.pyx":1176 * pointer -= 1 * * elif state == PATH: # <<<<<<<<<<<<<< @@ -18064,47 +17700,47 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1217 + /* "w3lib/_url.pyx":1216 * ) * * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< * if not reached_end: * if c == "?": */ - __pyx_t_10 = (__pyx_v_state == __pyx_v_5w3lib_4_url_OPAQUE_PATH); - if (__pyx_t_10) { + __pyx_t_12 = (__pyx_v_state == __pyx_v_5w3lib_4_url_OPAQUE_PATH); + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1218 + /* "w3lib/_url.pyx":1217 * * elif state == OPAQUE_PATH: * if not reached_end: # <<<<<<<<<<<<<< * if c == "?": * url._query_token_seen = True */ - __pyx_t_10 = (!__pyx_v_reached_end); - if (__pyx_t_10) { + __pyx_t_12 = (!__pyx_v_reached_end); + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1219 + /* "w3lib/_url.pyx":1218 * elif state == OPAQUE_PATH: * if not reached_end: * if c == "?": # <<<<<<<<<<<<<< * url._query_token_seen = True * state = QUERY */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1219, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1219, __pyx_L1_error) - if (__pyx_t_10) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1218, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1218, __pyx_L1_error) + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1220 + /* "w3lib/_url.pyx":1219 * if not reached_end: * if c == "?": * url._query_token_seen = True # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1220, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1219, __pyx_L1_error) - /* "w3lib/_url.pyx":1221 + /* "w3lib/_url.pyx":1220 * if c == "?": * url._query_token_seen = True * state = QUERY # <<<<<<<<<<<<<< @@ -18113,7 +17749,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":1219 + /* "w3lib/_url.pyx":1218 * elif state == OPAQUE_PATH: * if not reached_end: * if c == "?": # <<<<<<<<<<<<<< @@ -18123,27 +17759,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L122; } - /* "w3lib/_url.pyx":1222 + /* "w3lib/_url.pyx":1221 * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< * url._fragment_token_seen = True * state = FRAGMENT */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1222, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1222, __pyx_L1_error) - if (__pyx_t_10) { + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1221, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1221, __pyx_L1_error) + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1223 + /* "w3lib/_url.pyx":1222 * state = QUERY * elif c == "#": * url._fragment_token_seen = True # <<<<<<<<<<<<<< * state = FRAGMENT * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1223, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1222, __pyx_L1_error) - /* "w3lib/_url.pyx":1224 + /* "w3lib/_url.pyx":1223 * elif c == "#": * url._fragment_token_seen = True * state = FRAGMENT # <<<<<<<<<<<<<< @@ -18152,7 +17788,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1222 + /* "w3lib/_url.pyx":1221 * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< @@ -18162,7 +17798,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L122; } - /* "w3lib/_url.pyx":1226 + /* "w3lib/_url.pyx":1225 * state = FRAGMENT * else: * encoded = _utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -18170,35 +17806,35 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py * _C0_CONTROL_PERCENT_ENCODE_SET, */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":1227 + /* "w3lib/_url.pyx":1226 * else: * encoded = _utf_8_percent_encode( * c, # <<<<<<<<<<<<<< * _C0_CONTROL_PERCENT_ENCODE_SET, * ) */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1227, __pyx_L1_error) } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1226, __pyx_L1_error) } - /* "w3lib/_url.pyx":1228 + /* "w3lib/_url.pyx":1227 * encoded = _utf_8_percent_encode( * c, * _C0_CONTROL_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * ) * url.opaque_path += encoded */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_13 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_11)) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -18206,35 +17842,35 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_v_c, __pyx_t_2}; - __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_v_c, __pyx_t_14}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_XDECREF_SET(__pyx_v_encoded, __pyx_t_12); - __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_encoded, __pyx_t_2); + __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1230 + /* "w3lib/_url.pyx":1229 * _C0_CONTROL_PERCENT_ENCODE_SET, * ) * url.opaque_path += encoded # <<<<<<<<<<<<<< * * elif state == QUERY: */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_12, __pyx_v_encoded); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path, __pyx_t_1) < 0) __PYX_ERR(0, 1230, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path, __pyx_t_1) < 0) __PYX_ERR(0, 1229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L122:; - /* "w3lib/_url.pyx":1218 + /* "w3lib/_url.pyx":1217 * * elif state == OPAQUE_PATH: * if not reached_end: # <<<<<<<<<<<<<< @@ -18243,7 +17879,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1217 + /* "w3lib/_url.pyx":1216 * ) * * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< @@ -18253,75 +17889,75 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1232 + /* "w3lib/_url.pyx":1231 * url.opaque_path += encoded * * elif state == QUERY: # <<<<<<<<<<<<<< * if encoding != "utf-8" and ( * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") */ - __pyx_t_10 = (__pyx_v_state == __pyx_v_5w3lib_4_url_QUERY); - if (__pyx_t_10) { + __pyx_t_12 = (__pyx_v_state == __pyx_v_5w3lib_4_url_QUERY); + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1233 + /* "w3lib/_url.pyx":1232 * * elif state == QUERY: * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") * ): */ - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_kp_u_utf_8, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) - if (__pyx_t_6) { + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_kp_u_utf_8, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1232, __pyx_L1_error) + if (__pyx_t_8) { } else { - __pyx_t_10 = __pyx_t_6; + __pyx_t_12 = __pyx_t_8; goto __pyx_L124_bool_binop_done; } - /* "w3lib/_url.pyx":1234 + /* "w3lib/_url.pyx":1233 * elif state == QUERY: * if encoding != "utf-8" and ( * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") # <<<<<<<<<<<<<< * ): * encoding = "utf-8" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_12, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_8) { } else { - __pyx_t_10 = __pyx_t_6; + __pyx_t_12 = __pyx_t_8; goto __pyx_L124_bool_binop_done; } - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_12, __pyx_n_u_ws, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error) - if (!__pyx_t_7) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_ws, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) + if (!__pyx_t_6) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_8 = __pyx_t_6; goto __pyx_L127_bool_binop_done; } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_12, __pyx_n_u_wss, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error) - __pyx_t_6 = __pyx_t_7; + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_wss, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_8 = __pyx_t_6; __pyx_L127_bool_binop_done:; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_7 = __pyx_t_6; - __pyx_t_10 = __pyx_t_7; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __pyx_t_8; + __pyx_t_12 = __pyx_t_6; __pyx_L124_bool_binop_done:; - /* "w3lib/_url.pyx":1233 + /* "w3lib/_url.pyx":1232 * * elif state == QUERY: * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") * ): */ - if (__pyx_t_10) { + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1236 + /* "w3lib/_url.pyx":1235 * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") * ): * encoding = "utf-8" # <<<<<<<<<<<<<< @@ -18331,7 +17967,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_utf_8); __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_kp_u_utf_8); - /* "w3lib/_url.pyx":1233 + /* "w3lib/_url.pyx":1232 * * elif state == QUERY: * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< @@ -18340,7 +17976,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1237 + /* "w3lib/_url.pyx":1236 * ): * encoding = "utf-8" * if reached_end or c == "#": # <<<<<<<<<<<<<< @@ -18349,124 +17985,95 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ if (!__pyx_v_reached_end) { } else { - __pyx_t_10 = __pyx_v_reached_end; + __pyx_t_12 = __pyx_v_reached_end; goto __pyx_L130_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1237, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1237, __pyx_L1_error) - __pyx_t_10 = __pyx_t_7; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1236, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1236, __pyx_L1_error) + __pyx_t_12 = __pyx_t_6; __pyx_L130_bool_binop_done:; - if (__pyx_t_10) { + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1240 + /* "w3lib/_url.pyx":1239 * percent_encode_set = ( * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET * if url.scheme in _SPECIAL_SCHEMES # <<<<<<<<<<<<<< * else _SAFE_QUERY_PERCENT_ENCODE_SET * ) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_14, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_10) { + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1239 + /* "w3lib/_url.pyx":1238 * if reached_end or c == "#": * percent_encode_set = ( * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * if url.scheme in _SPECIAL_SCHEMES * else _SAFE_QUERY_PERCENT_ENCODE_SET */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = __pyx_t_14; + __pyx_t_14 = 0; } else { - /* "w3lib/_url.pyx":1241 + /* "w3lib/_url.pyx":1240 * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET * if url.scheme in _SPECIAL_SCHEMES * else _SAFE_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * url.query += _percent_encode_after_encoding( */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = __pyx_t_14; + __pyx_t_14 = 0; } - __Pyx_XDECREF_SET(__pyx_v_percent_encode_set, __pyx_t_12); - __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_percent_encode_set, __pyx_t_2); + __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1243 + /* "w3lib/_url.pyx":1242 * else _SAFE_QUERY_PERCENT_ENCODE_SET * ) * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< * buffer, * encoding=encoding, */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1243, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":1244 + /* "w3lib/_url.pyx":1243 * ) * url.query += _percent_encode_after_encoding( * buffer, # <<<<<<<<<<<<<< * encoding=encoding, * percent_encode_set=percent_encode_set, */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_buffer); - __Pyx_GIVEREF(__pyx_v_buffer); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_buffer)) __PYX_ERR(0, 1243, __pyx_L1_error); - - /* "w3lib/_url.pyx":1245 - * url.query += _percent_encode_after_encoding( - * buffer, - * encoding=encoding, # <<<<<<<<<<<<<< - * percent_encode_set=percent_encode_set, - * ) - */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 1245, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_buffer))||((__pyx_v_buffer) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_buffer))) __PYX_ERR(0, 1243, __pyx_L1_error) - /* "w3lib/_url.pyx":1246 - * buffer, - * encoding=encoding, - * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< - * ) - * buffer = "" - */ - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 1245, __pyx_L1_error) - - /* "w3lib/_url.pyx":1243 + /* "w3lib/_url.pyx":1242 * else _SAFE_QUERY_PERCENT_ENCODE_SET * ) * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< * buffer, * encoding=encoding, */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __pyx_f_5w3lib_4_url__percent_encode_after_encoding(((PyObject*)__pyx_v_buffer), __pyx_v_encoding, __pyx_v_percent_encode_set); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_1) < 0) __PYX_ERR(0, 1242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_t_12, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_11) < 0) __PYX_ERR(0, 1243, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "w3lib/_url.pyx":1248 + /* "w3lib/_url.pyx":1247 * percent_encode_set=percent_encode_set, * ) * buffer = "" # <<<<<<<<<<<<<< @@ -18476,35 +18083,35 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1249 + /* "w3lib/_url.pyx":1248 * ) * buffer = "" * if not reached_end and c == "#": # <<<<<<<<<<<<<< * url._fragment_token_seen = True * state = FRAGMENT */ - __pyx_t_7 = (!__pyx_v_reached_end); - if (__pyx_t_7) { + __pyx_t_6 = (!__pyx_v_reached_end); + if (__pyx_t_6) { } else { - __pyx_t_10 = __pyx_t_7; + __pyx_t_12 = __pyx_t_6; goto __pyx_L133_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1249, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1249, __pyx_L1_error) - __pyx_t_10 = __pyx_t_7; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1248, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_12 = __pyx_t_6; __pyx_L133_bool_binop_done:; - if (__pyx_t_10) { + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1250 + /* "w3lib/_url.pyx":1249 * buffer = "" * if not reached_end and c == "#": * url._fragment_token_seen = True # <<<<<<<<<<<<<< * state = FRAGMENT * elif not reached_end: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1250, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1249, __pyx_L1_error) - /* "w3lib/_url.pyx":1251 + /* "w3lib/_url.pyx":1250 * if not reached_end and c == "#": * url._fragment_token_seen = True * state = FRAGMENT # <<<<<<<<<<<<<< @@ -18513,7 +18120,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1249 + /* "w3lib/_url.pyx":1248 * ) * buffer = "" * if not reached_end and c == "#": # <<<<<<<<<<<<<< @@ -18522,7 +18129,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1237 + /* "w3lib/_url.pyx":1236 * ): * encoding = "utf-8" * if reached_end or c == "#": # <<<<<<<<<<<<<< @@ -18532,30 +18139,30 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L129; } - /* "w3lib/_url.pyx":1252 + /* "w3lib/_url.pyx":1251 * url._fragment_token_seen = True * state = FRAGMENT * elif not reached_end: # <<<<<<<<<<<<<< * buffer += c * */ - __pyx_t_10 = (!__pyx_v_reached_end); - if (__pyx_t_10) { + __pyx_t_12 = (!__pyx_v_reached_end); + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1253 + /* "w3lib/_url.pyx":1252 * state = FRAGMENT * elif not reached_end: * buffer += c # <<<<<<<<<<<<<< * * elif state == FRAGMENT: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1253, __pyx_L1_error) } - __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_11); - __pyx_t_11 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1252, __pyx_L1_error) } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); + __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1252 + /* "w3lib/_url.pyx":1251 * url._fragment_token_seen = True * state = FRAGMENT * elif not reached_end: # <<<<<<<<<<<<<< @@ -18565,7 +18172,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L129:; - /* "w3lib/_url.pyx":1232 + /* "w3lib/_url.pyx":1231 * url.opaque_path += encoded * * elif state == QUERY: # <<<<<<<<<<<<<< @@ -18575,73 +18182,76 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1255 + /* "w3lib/_url.pyx":1254 * buffer += c * * elif state == FRAGMENT: # <<<<<<<<<<<<<< * if not reached_end: * url.fragment += _idempotent_utf_8_percent_encode( */ - __pyx_t_10 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FRAGMENT); - if (__pyx_t_10) { + __pyx_t_12 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FRAGMENT); + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1256 + /* "w3lib/_url.pyx":1255 * * elif state == FRAGMENT: * if not reached_end: # <<<<<<<<<<<<<< * url.fragment += _idempotent_utf_8_percent_encode( * input=input, pointer=pointer, encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET */ - __pyx_t_10 = (!__pyx_v_reached_end); - if (__pyx_t_10) { + __pyx_t_12 = (!__pyx_v_reached_end); + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1257 + /* "w3lib/_url.pyx":1256 * elif state == FRAGMENT: * if not reached_end: * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, pointer=pointer, encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET * ) */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); - /* "w3lib/_url.pyx":1258 + /* "w3lib/_url.pyx":1257 * if not reached_end: * url.fragment += _idempotent_utf_8_percent_encode( * input=input, pointer=pointer, encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1258, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_pointer, __pyx_v_pointer) < 0) __PYX_ERR(0, 1258, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_encode_set, __pyx_t_1) < 0) __PYX_ERR(0, 1258, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_pointer); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_t_13) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_t_13) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "w3lib/_url.pyx":1257 + /* "w3lib/_url.pyx":1256 * elif state == FRAGMENT: * if not reached_end: * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, pointer=pointer, encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET * ) */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_t_11, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_t_12) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_t_2) < 0) __PYX_ERR(0, 1256, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1256 + /* "w3lib/_url.pyx":1255 * * elif state == FRAGMENT: * if not reached_end: # <<<<<<<<<<<<<< @@ -18650,7 +18260,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1255 + /* "w3lib/_url.pyx":1254 * buffer += c * * elif state == FRAGMENT: # <<<<<<<<<<<<<< @@ -18660,22 +18270,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L6:; - /* "w3lib/_url.pyx":1261 + /* "w3lib/_url.pyx":1260 * ) * * if pointer >= input_length: # <<<<<<<<<<<<<< * break * pointer += 1 */ - __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1261, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_12, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1261, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_10) { + __pyx_t_12 = (__pyx_v_pointer >= __pyx_v_input_length); + if (__pyx_t_12) { - /* "w3lib/_url.pyx":1262 + /* "w3lib/_url.pyx":1261 * * if pointer >= input_length: * break # <<<<<<<<<<<<<< @@ -18684,7 +18289,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ goto __pyx_L4_break; - /* "w3lib/_url.pyx":1261 + /* "w3lib/_url.pyx":1260 * ) * * if pointer >= input_length: # <<<<<<<<<<<<<< @@ -18693,21 +18298,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1263 + /* "w3lib/_url.pyx":1262 * if pointer >= input_length: * break * pointer += 1 # <<<<<<<<<<<<<< * * return url */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_pointer = (__pyx_v_pointer + 1); } __pyx_L4_break:; - /* "w3lib/_url.pyx":1265 + /* "w3lib/_url.pyx":1264 * pointer += 1 * * return url # <<<<<<<<<<<<<< @@ -18732,14 +18334,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("w3lib._url._parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_url); __Pyx_XDECREF(__pyx_v_buffer); - __Pyx_XDECREF(__pyx_v_pointer); __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF(__pyx_v_at_sign_index); __Pyx_XDECREF(__pyx_v_i); @@ -18754,7 +18355,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "w3lib/_url.pyx":1269 +/* "w3lib/_url.pyx":1268 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< @@ -18763,15 +18364,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__py */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_41_serialize_ipv4(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_39_serialize_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_41_serialize_ipv4 = {"_serialize_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_41_serialize_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_41_serialize_ipv4(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_39_serialize_ipv4 = {"_serialize_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_39_serialize_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_39_serialize_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18815,12 +18416,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1269, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1268, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv4") < 0)) __PYX_ERR(0, 1269, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv4") < 0)) __PYX_ERR(0, 1268, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18831,7 +18432,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1269, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1268, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18845,8 +18446,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyInt_Type), 0, "address", 1))) __PYX_ERR(0, 1269, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_40_serialize_ipv4(__pyx_self, __pyx_v_address); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyInt_Type), 0, "address", 1))) __PYX_ERR(0, 1268, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_38_serialize_ipv4(__pyx_self, __pyx_v_address); /* function exit code */ goto __pyx_L0; @@ -18863,7 +18464,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { +static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { PyObject *__pyx_v_output = NULL; PyObject *__pyx_v_n = NULL; long __pyx_v_i; @@ -18881,7 +18482,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_ipv4", 1); - /* "w3lib/_url.pyx":1270 + /* "w3lib/_url.pyx":1269 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: * output = "" # <<<<<<<<<<<<<< @@ -18891,7 +18492,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_kp_u_); __pyx_v_output = __pyx_kp_u_; - /* "w3lib/_url.pyx":1271 + /* "w3lib/_url.pyx":1270 * def _serialize_ipv4(address: int) -> str: * output = "" * n = address # <<<<<<<<<<<<<< @@ -18901,7 +18502,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_v_address); __pyx_v_n = __pyx_v_address; - /* "w3lib/_url.pyx":1272 + /* "w3lib/_url.pyx":1271 * output = "" * n = address * for i in range(1, 5): # <<<<<<<<<<<<<< @@ -18911,25 +18512,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject for (__pyx_t_1 = 1; __pyx_t_1 < 5; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "w3lib/_url.pyx":1273 + /* "w3lib/_url.pyx":1272 * n = address * for i in range(1, 5): * output = str(n % 256) + output # <<<<<<<<<<<<<< * if i != 4: * output = "." + output */ - __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1273, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1273, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1273, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1274 + /* "w3lib/_url.pyx":1273 * for i in range(1, 5): * output = str(n % 256) + output * if i != 4: # <<<<<<<<<<<<<< @@ -18939,19 +18540,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_4 = (__pyx_v_i != 4); if (__pyx_t_4) { - /* "w3lib/_url.pyx":1275 + /* "w3lib/_url.pyx":1274 * output = str(n % 256) + output * if i != 4: * output = "." + output # <<<<<<<<<<<<<< * n = floor(n / 256) * return output */ - __pyx_t_2 = PyNumber_Add(__pyx_kp_u__6, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1275, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_kp_u__5, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1274 + /* "w3lib/_url.pyx":1273 * for i in range(1, 5): * output = str(n % 256) + output * if i != 4: # <<<<<<<<<<<<<< @@ -18960,16 +18561,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1276 + /* "w3lib/_url.pyx":1275 * if i != 4: * output = "." + output * n = floor(n / 256) # <<<<<<<<<<<<<< * return output * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1276, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1276, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -18990,7 +18591,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1276, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -18998,7 +18599,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_2 = 0; } - /* "w3lib/_url.pyx":1277 + /* "w3lib/_url.pyx":1276 * output = "." + output * n = floor(n / 256) * return output # <<<<<<<<<<<<<< @@ -19006,12 +18607,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1277, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1276, __pyx_L1_error) __Pyx_INCREF(__pyx_v_output); __pyx_r = ((PyObject*)__pyx_v_output); goto __pyx_L0; - /* "w3lib/_url.pyx":1269 + /* "w3lib/_url.pyx":1268 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< @@ -19035,7 +18636,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":1280 +/* "w3lib/_url.pyx":1279 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< @@ -19043,7 +18644,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject * ) -> Optional[int]: */ -static PyObject *__pyx_pf_5w3lib_4_url_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_5w3lib_4_url_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -19053,16 +18654,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_54__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1280, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_length, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_min_length) < 0) __PYX_ERR(0, 1280, __pyx_L1_error) - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_length, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_min_length) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 1280, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 1279, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1280, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1279, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -19081,15 +18682,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_54__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index = {"_get_ipv6_first_longest_0_piece_index", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index = {"_get_ipv6_first_longest_0_piece_index", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19136,18 +18737,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1280, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1279, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1280, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1279, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_ipv6_first_longest_0_piece_index") < 0)) __PYX_ERR(0, 1280, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_ipv6_first_longest_0_piece_index") < 0)) __PYX_ERR(0, 1279, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19159,7 +18760,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_ipv6_first_longest_0_piece_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1280, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_ipv6_first_longest_0_piece_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1279, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19173,9 +18774,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1281, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_min_length), (&PyInt_Type), 0, "min_length", 1))) __PYX_ERR(0, 1281, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(__pyx_self, __pyx_v_address, __pyx_v_min_length); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1280, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_min_length), (&PyInt_Type), 0, "min_length", 1))) __PYX_ERR(0, 1280, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(__pyx_self, __pyx_v_address, __pyx_v_min_length); /* function exit code */ goto __pyx_L0; @@ -19192,7 +18793,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length) { +static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length) { PyObject *__pyx_v_index = NULL; PyObject *__pyx_v_index_length = NULL; PyObject *__pyx_v_current_length = NULL; @@ -19212,7 +18813,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_ipv6_first_longest_0_piece_index", 1); - /* "w3lib/_url.pyx":1283 + /* "w3lib/_url.pyx":1282 * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: * index = None # <<<<<<<<<<<<<< @@ -19222,7 +18823,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(Py_None); __pyx_v_index = Py_None; - /* "w3lib/_url.pyx":1284 + /* "w3lib/_url.pyx":1283 * ) -> Optional[int]: * index = None * index_length = 0 # <<<<<<<<<<<<<< @@ -19232,7 +18833,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __pyx_v_index_length = __pyx_int_0; - /* "w3lib/_url.pyx":1285 + /* "w3lib/_url.pyx":1284 * index = None * index_length = 0 * current_length = 0 # <<<<<<<<<<<<<< @@ -19242,7 +18843,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __pyx_v_current_length = __pyx_int_0; - /* "w3lib/_url.pyx":1286 + /* "w3lib/_url.pyx":1285 * index_length = 0 * current_length = 0 * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< @@ -19257,37 +18858,37 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1286, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1285, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1286, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1285, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1286, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_piece, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_current_index, __pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1286, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1287 + /* "w3lib/_url.pyx":1286 * current_length = 0 * for current_index, piece in enumerate(address): * if piece != 0: # <<<<<<<<<<<<<< * current_length = 0 * continue */ - __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1287, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1286, __pyx_L1_error) if (__pyx_t_5) { - /* "w3lib/_url.pyx":1288 + /* "w3lib/_url.pyx":1287 * for current_index, piece in enumerate(address): * if piece != 0: * current_length = 0 # <<<<<<<<<<<<<< @@ -19297,7 +18898,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_int_0); - /* "w3lib/_url.pyx":1289 + /* "w3lib/_url.pyx":1288 * if piece != 0: * current_length = 0 * continue # <<<<<<<<<<<<<< @@ -19306,7 +18907,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":1287 + /* "w3lib/_url.pyx":1286 * current_length = 0 * for current_index, piece in enumerate(address): * if piece != 0: # <<<<<<<<<<<<<< @@ -19315,56 +18916,56 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C */ } - /* "w3lib/_url.pyx":1290 + /* "w3lib/_url.pyx":1289 * current_length = 0 * continue * current_length += 1 # <<<<<<<<<<<<<< * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1291 + /* "w3lib/_url.pyx":1290 * continue * current_length += 1 * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< * index = current_index + 1 - current_length * index_length = current_length */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_index_length, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_index_length, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L7_bool_binop_done; } - __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_min_length, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_min_length, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L7_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":1292 + /* "w3lib/_url.pyx":1291 * current_length += 1 * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length # <<<<<<<<<<<<<< * index_length = current_length * return index */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1292, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_v_current_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1292, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_v_current_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":1293 + /* "w3lib/_url.pyx":1292 * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length * index_length = current_length # <<<<<<<<<<<<<< @@ -19374,7 +18975,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_v_current_length); __Pyx_DECREF_SET(__pyx_v_index_length, __pyx_v_current_length); - /* "w3lib/_url.pyx":1291 + /* "w3lib/_url.pyx":1290 * continue * current_length += 1 * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< @@ -19383,7 +18984,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C */ } - /* "w3lib/_url.pyx":1286 + /* "w3lib/_url.pyx":1285 * index_length = 0 * current_length = 0 * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< @@ -19395,7 +18996,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1294 + /* "w3lib/_url.pyx":1293 * index = current_index + 1 - current_length * index_length = current_length * return index # <<<<<<<<<<<<<< @@ -19403,12 +19004,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_index))||((__pyx_v_index) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_index))) __PYX_ERR(0, 1294, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_index))||((__pyx_v_index) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_index))) __PYX_ERR(0, 1293, __pyx_L1_error) __Pyx_INCREF(__pyx_v_index); __pyx_r = ((PyObject*)__pyx_v_index); goto __pyx_L0; - /* "w3lib/_url.pyx":1280 + /* "w3lib/_url.pyx":1279 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< @@ -19435,7 +19036,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C return __pyx_r; } -/* "w3lib/_url.pyx":1298 +/* "w3lib/_url.pyx":1297 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< @@ -19444,15 +19045,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(C */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_45_serialize_ipv6(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_43_serialize_ipv6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_45_serialize_ipv6 = {"_serialize_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_45_serialize_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_45_serialize_ipv6(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_43_serialize_ipv6 = {"_serialize_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_43_serialize_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_43_serialize_ipv6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19496,12 +19097,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1298, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1297, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv6") < 0)) __PYX_ERR(0, 1298, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv6") < 0)) __PYX_ERR(0, 1297, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19512,7 +19113,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1298, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1297, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19526,8 +19127,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1298, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_44_serialize_ipv6(__pyx_self, __pyx_v_address); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_42_serialize_ipv6(__pyx_self, __pyx_v_address); /* function exit code */ goto __pyx_L0; @@ -19544,7 +19145,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { +static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { PyObject *__pyx_v_output = NULL; PyObject *__pyx_v_compress = NULL; int __pyx_v_ignore0; @@ -19564,7 +19165,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_ipv6", 1); - /* "w3lib/_url.pyx":1299 + /* "w3lib/_url.pyx":1298 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: * output = "" # <<<<<<<<<<<<<< @@ -19574,14 +19175,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_kp_u_); __pyx_v_output = __pyx_kp_u_; - /* "w3lib/_url.pyx":1300 + /* "w3lib/_url.pyx":1299 * def _serialize_ipv6(address: List[int]) -> str: * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) # <<<<<<<<<<<<<< * ignore0 = False * for piece_index in range(8): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_ipv6_first_longest_0_piece); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1300, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_ipv6_first_longest_0_piece); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -19601,14 +19202,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_address}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1300, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_compress = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1301 + /* "w3lib/_url.pyx":1300 * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) * ignore0 = False # <<<<<<<<<<<<<< @@ -19617,7 +19218,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 0; - /* "w3lib/_url.pyx":1302 + /* "w3lib/_url.pyx":1301 * compress = _get_ipv6_first_longest_0_piece_index(address) * ignore0 = False * for piece_index in range(8): # <<<<<<<<<<<<<< @@ -19627,7 +19228,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject for (__pyx_t_5 = 0; __pyx_t_5 < 8; __pyx_t_5+=1) { __pyx_v_piece_index = __pyx_t_5; - /* "w3lib/_url.pyx":1303 + /* "w3lib/_url.pyx":1302 * ignore0 = False * for piece_index in range(8): * if ignore0: # <<<<<<<<<<<<<< @@ -19636,21 +19237,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ if (__pyx_v_ignore0) { - /* "w3lib/_url.pyx":1304 + /* "w3lib/_url.pyx":1303 * for piece_index in range(8): * if ignore0: * if not address[piece_index]: # <<<<<<<<<<<<<< * continue * ignore0 = False */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1304, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "w3lib/_url.pyx":1305 + /* "w3lib/_url.pyx":1304 * if ignore0: * if not address[piece_index]: * continue # <<<<<<<<<<<<<< @@ -19659,7 +19260,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":1304 + /* "w3lib/_url.pyx":1303 * for piece_index in range(8): * if ignore0: * if not address[piece_index]: # <<<<<<<<<<<<<< @@ -19668,7 +19269,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1306 + /* "w3lib/_url.pyx":1305 * if not address[piece_index]: * continue * ignore0 = False # <<<<<<<<<<<<<< @@ -19677,7 +19278,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 0; - /* "w3lib/_url.pyx":1303 + /* "w3lib/_url.pyx":1302 * ignore0 = False * for piece_index in range(8): * if ignore0: # <<<<<<<<<<<<<< @@ -19686,22 +19287,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1307 + /* "w3lib/_url.pyx":1306 * continue * ignore0 = False * if compress == piece_index: # <<<<<<<<<<<<<< * separator = "::" if piece_index == 0 else ":" * output += separator */ - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1307, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_compress, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1307, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_compress, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1307, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_7) { - /* "w3lib/_url.pyx":1308 + /* "w3lib/_url.pyx":1307 * ignore0 = False * if compress == piece_index: * separator = "::" if piece_index == 0 else ":" # <<<<<<<<<<<<<< @@ -19710,28 +19311,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_t_7 = (__pyx_v_piece_index == 0); if (__pyx_t_7) { - __Pyx_INCREF(__pyx_kp_u__23); - __pyx_t_2 = __pyx_kp_u__23; + __Pyx_INCREF(__pyx_kp_u__22); + __pyx_t_2 = __pyx_kp_u__22; } else { - __Pyx_INCREF(__pyx_kp_u__5); - __pyx_t_2 = __pyx_kp_u__5; + __Pyx_INCREF(__pyx_kp_u__4); + __pyx_t_2 = __pyx_kp_u__4; } __Pyx_XDECREF_SET(__pyx_v_separator, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1309 + /* "w3lib/_url.pyx":1308 * if compress == piece_index: * separator = "::" if piece_index == 0 else ":" * output += separator # <<<<<<<<<<<<<< * ignore0 = True * continue */ - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_output, __pyx_v_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_output, __pyx_v_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1310 + /* "w3lib/_url.pyx":1309 * separator = "::" if piece_index == 0 else ":" * output += separator * ignore0 = True # <<<<<<<<<<<<<< @@ -19740,7 +19341,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 1; - /* "w3lib/_url.pyx":1311 + /* "w3lib/_url.pyx":1310 * output += separator * ignore0 = True * continue # <<<<<<<<<<<<<< @@ -19749,7 +19350,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":1307 + /* "w3lib/_url.pyx":1306 * continue * ignore0 = False * if compress == piece_index: # <<<<<<<<<<<<<< @@ -19758,25 +19359,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1312 + /* "w3lib/_url.pyx":1311 * ignore0 = True * continue * output += f"{address[piece_index]:x}" # <<<<<<<<<<<<<< * if piece_index != 7: * output += ":" */ - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1312, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1312, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1312, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1313 + /* "w3lib/_url.pyx":1312 * continue * output += f"{address[piece_index]:x}" * if piece_index != 7: # <<<<<<<<<<<<<< @@ -19786,19 +19387,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_t_7 = (__pyx_v_piece_index != 7); if (__pyx_t_7) { - /* "w3lib/_url.pyx":1314 + /* "w3lib/_url.pyx":1313 * output += f"{address[piece_index]:x}" * if piece_index != 7: * output += ":" # <<<<<<<<<<<<<< * return output * */ - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1314, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1313 + /* "w3lib/_url.pyx":1312 * continue * output += f"{address[piece_index]:x}" * if piece_index != 7: # <<<<<<<<<<<<<< @@ -19809,7 +19410,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_L3_continue:; } - /* "w3lib/_url.pyx":1315 + /* "w3lib/_url.pyx":1314 * if piece_index != 7: * output += ":" * return output # <<<<<<<<<<<<<< @@ -19821,7 +19422,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "w3lib/_url.pyx":1298 + /* "w3lib/_url.pyx":1297 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< @@ -19845,7 +19446,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":1319 +/* "w3lib/_url.pyx":1318 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(url: _URL) -> str: # <<<<<<<<<<<<<< @@ -19854,15 +19455,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_47_serialize_host(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_45_serialize_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_47_serialize_host = {"_serialize_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_47_serialize_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_47_serialize_host(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_45_serialize_host = {"_serialize_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_45_serialize_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_45_serialize_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19906,12 +19507,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1319, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1318, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_host") < 0)) __PYX_ERR(0, 1319, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_host") < 0)) __PYX_ERR(0, 1318, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19922,7 +19523,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1319, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1318, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19936,7 +19537,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_46_serialize_host(__pyx_self, __pyx_v_url); + __pyx_r = __pyx_pf_5w3lib_4_url_44_serialize_host(__pyx_self, __pyx_v_url); /* function exit code */ { @@ -19949,7 +19550,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { +static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -19966,25 +19567,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_host", 1); - /* "w3lib/_url.pyx":1320 + /* "w3lib/_url.pyx":1319 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(url: _URL) -> str: * if url._host_type == IPV4: # <<<<<<<<<<<<<< * return _serialize_ipv4(url.ipv4) * if url._host_type == IPV6: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "w3lib/_url.pyx":1321 + /* "w3lib/_url.pyx":1320 * def _serialize_host(url: _URL) -> str: * if url._host_type == IPV4: * return _serialize_ipv4(url.ipv4) # <<<<<<<<<<<<<< @@ -19992,9 +19593,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject * return f"[{_serialize_ipv6(url.ipv6)}]" */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_serialize_ipv4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1321, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_serialize_ipv4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_ipv4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_ipv4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -20015,16 +19616,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 1321, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 1320, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1320 + /* "w3lib/_url.pyx":1319 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(url: _URL) -> str: * if url._host_type == IPV4: # <<<<<<<<<<<<<< @@ -20033,25 +19634,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1322 + /* "w3lib/_url.pyx":1321 * if url._host_type == IPV4: * return _serialize_ipv4(url.ipv4) * if url._host_type == IPV6: # <<<<<<<<<<<<<< * return f"[{_serialize_ipv6(url.ipv6)}]" * return url.hostname */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1322, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "w3lib/_url.pyx":1323 + /* "w3lib/_url.pyx":1322 * return _serialize_ipv4(url.ipv4) * if url._host_type == IPV6: * return f"[{_serialize_ipv6(url.ipv6)}]" # <<<<<<<<<<<<<< @@ -20059,17 +19660,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = 0; __pyx_t_8 = 127; - __Pyx_INCREF(__pyx_kp_u__8); + __Pyx_INCREF(__pyx_kp_u__7); __pyx_t_7 += 1; - __Pyx_GIVEREF(__pyx_kp_u__8); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__8); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_serialize_ipv6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_kp_u__7); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__7); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_serialize_ipv6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_ipv6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1323, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_ipv6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; __pyx_t_6 = 0; @@ -20090,11 +19691,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1323, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8; @@ -20102,18 +19703,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); __pyx_t_3 = 0; - __Pyx_INCREF(__pyx_kp_u__9); + __Pyx_INCREF(__pyx_kp_u__8); __pyx_t_7 += 1; - __Pyx_GIVEREF(__pyx_kp_u__9); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__9); - __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__8); + __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1322 + /* "w3lib/_url.pyx":1321 * if url._host_type == IPV4: * return _serialize_ipv4(url.ipv4) * if url._host_type == IPV6: # <<<<<<<<<<<<<< @@ -20122,7 +19723,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1324 + /* "w3lib/_url.pyx":1323 * if url._host_type == IPV6: * return f"[{_serialize_ipv6(url.ipv6)}]" * return url.hostname # <<<<<<<<<<<<<< @@ -20130,14 +19731,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1324, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 1324, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 1323, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1319 + /* "w3lib/_url.pyx":1318 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(url: _URL) -> str: # <<<<<<<<<<<<<< @@ -20160,7 +19761,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":1328 +/* "w3lib/_url.pyx":1327 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL) -> str: # <<<<<<<<<<<<<< @@ -20169,15 +19770,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_49_serialize_url_path(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_47_serialize_url_path(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_49_serialize_url_path = {"_serialize_url_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_49_serialize_url_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_49_serialize_url_path(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_47_serialize_url_path = {"_serialize_url_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_47_serialize_url_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_47_serialize_url_path(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -20221,12 +19822,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1328, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1327, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url_path") < 0)) __PYX_ERR(0, 1328, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url_path") < 0)) __PYX_ERR(0, 1327, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -20237,7 +19838,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_url_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1328, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_url_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1327, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20251,7 +19852,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_48_serialize_url_path(__pyx_self, __pyx_v_url); + __pyx_r = __pyx_pf_5w3lib_4_url_46_serialize_url_path(__pyx_self, __pyx_v_url); /* function exit code */ { @@ -20264,7 +19865,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { +static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { PyObject *__pyx_v_output = NULL; PyObject *__pyx_v_segment = NULL; PyObject *__pyx_r = NULL; @@ -20281,20 +19882,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_url_path", 1); - /* "w3lib/_url.pyx":1329 + /* "w3lib/_url.pyx":1328 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL) -> str: * if url.opaque_path: # <<<<<<<<<<<<<< * assert isinstance(url.path, str) * return url.path */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1329, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1328, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "w3lib/_url.pyx":1330 + /* "w3lib/_url.pyx":1329 * def _serialize_url_path(url: _URL) -> str: * if url.opaque_path: * assert isinstance(url.path, str) # <<<<<<<<<<<<<< @@ -20303,20 +19904,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyUnicode_Check(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1330, __pyx_L1_error) + __PYX_ERR(0, 1329, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 1330, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 1329, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":1331 + /* "w3lib/_url.pyx":1330 * if url.opaque_path: * assert isinstance(url.path, str) * return url.path # <<<<<<<<<<<<<< @@ -20324,14 +19925,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj * return "" */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1331, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1330, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1329 + /* "w3lib/_url.pyx":1328 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL) -> str: * if url.opaque_path: # <<<<<<<<<<<<<< @@ -20340,16 +19941,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj */ } - /* "w3lib/_url.pyx":1332 + /* "w3lib/_url.pyx":1331 * assert isinstance(url.path, str) * return url.path * if len(url.path) <= 1 and url._path_token_seen: # <<<<<<<<<<<<<< * return "" * output = "" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1332, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__pyx_t_3 <= 1); if (__pyx_t_4) { @@ -20357,15 +19958,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj __pyx_t_2 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1332, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":1333 + /* "w3lib/_url.pyx":1332 * return url.path * if len(url.path) <= 1 and url._path_token_seen: * return "" # <<<<<<<<<<<<<< @@ -20377,7 +19978,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj __pyx_r = __pyx_kp_u_; goto __pyx_L0; - /* "w3lib/_url.pyx":1332 + /* "w3lib/_url.pyx":1331 * assert isinstance(url.path, str) * return url.path * if len(url.path) <= 1 and url._path_token_seen: # <<<<<<<<<<<<<< @@ -20386,7 +19987,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj */ } - /* "w3lib/_url.pyx":1334 + /* "w3lib/_url.pyx":1333 * if len(url.path) <= 1 and url._path_token_seen: * return "" * output = "" # <<<<<<<<<<<<<< @@ -20396,23 +19997,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj __Pyx_INCREF(__pyx_kp_u_); __pyx_v_output = __pyx_kp_u_; - /* "w3lib/_url.pyx":1335 + /* "w3lib/_url.pyx":1334 * return "" * output = "" * for segment in url.path: # <<<<<<<<<<<<<< * output += f"/{segment}" * return output */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1335, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1335, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1334, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -20421,28 +20022,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1335, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1334, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1335, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1334, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1335, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1334, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1335, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1334, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -20452,7 +20053,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1335, __pyx_L1_error) + else __PYX_ERR(0, 1334, __pyx_L1_error) } break; } @@ -20461,25 +20062,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj __Pyx_XDECREF_SET(__pyx_v_segment, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1336 + /* "w3lib/_url.pyx":1335 * output = "" * for segment in url.path: * output += f"/{segment}" # <<<<<<<<<<<<<< * return output * */ - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_segment, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1336, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_segment, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1336, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1336, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1335 + /* "w3lib/_url.pyx":1334 * return "" * output = "" * for segment in url.path: # <<<<<<<<<<<<<< @@ -20489,7 +20090,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1337 + /* "w3lib/_url.pyx":1336 * for segment in url.path: * output += f"/{segment}" * return output # <<<<<<<<<<<<<< @@ -20501,7 +20102,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "w3lib/_url.pyx":1328 + /* "w3lib/_url.pyx":1327 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL) -> str: # <<<<<<<<<<<<<< @@ -20524,7 +20125,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj return __pyx_r; } -/* "w3lib/_url.pyx":1341 +/* "w3lib/_url.pyx":1340 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url(url: _URL) -> str: # <<<<<<<<<<<<<< @@ -20533,16 +20134,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObj */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_51_serialize_url(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_49_serialize_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_50_serialize_url, "Return a string representation of *url* following the URL serialization\n algorithm defined in the `URL living standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer\n "); -static PyMethodDef __pyx_mdef_5w3lib_4_url_51_serialize_url = {"_serialize_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_51_serialize_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_50_serialize_url}; -static PyObject *__pyx_pw_5w3lib_4_url_51_serialize_url(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_48_serialize_url, "Return a string representation of *url* following the URL serialization\n algorithm defined in the `URL living standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer\n "); +static PyMethodDef __pyx_mdef_5w3lib_4_url_49_serialize_url = {"_serialize_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_49_serialize_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_48_serialize_url}; +static PyObject *__pyx_pw_5w3lib_4_url_49_serialize_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -20586,12 +20187,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1341, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1340, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url") < 0)) __PYX_ERR(0, 1341, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url") < 0)) __PYX_ERR(0, 1340, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -20602,7 +20203,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1341, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1340, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20616,7 +20217,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_50_serialize_url(__pyx_self, __pyx_v_url); + __pyx_r = __pyx_pf_5w3lib_4_url_48_serialize_url(__pyx_self, __pyx_v_url); /* function exit code */ { @@ -20629,7 +20230,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { +static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { PyObject *__pyx_v_output = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -20646,136 +20247,136 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_url", 1); - /* "w3lib/_url.pyx":1347 + /* "w3lib/_url.pyx":1346 * .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer * """ * output = url.scheme + ":" # <<<<<<<<<<<<<< * if url.hostname or url._host_type != HOSTNAME: * output += "//" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_output = __pyx_t_2; __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1348 + /* "w3lib/_url.pyx":1347 * """ * output = url.scheme + ":" * if url.hostname or url._host_type != HOSTNAME: # <<<<<<<<<<<<<< * output += "//" * if url.username or url.password: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_HOSTNAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_HOSTNAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1349 + /* "w3lib/_url.pyx":1348 * output = url.scheme + ":" * if url.hostname or url._host_type != HOSTNAME: * output += "//" # <<<<<<<<<<<<<< * if url.username or url.password: * output += url.username */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__24); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__23); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1350 + /* "w3lib/_url.pyx":1349 * if url.hostname or url._host_type != HOSTNAME: * output += "//" * if url.username or url.password: # <<<<<<<<<<<<<< * output += url.username * if url.password: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1350, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1350, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L7_bool_binop_done; } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1350, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1350, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __pyx_t_4; __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1351 + /* "w3lib/_url.pyx":1350 * output += "//" * if url.username or url.password: * output += url.username # <<<<<<<<<<<<<< * if url.password: * output += f":{url.password}" */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1351, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1352 + /* "w3lib/_url.pyx":1351 * if url.username or url.password: * output += url.username * if url.password: # <<<<<<<<<<<<<< * output += f":{url.password}" * elif url._password_token_seen: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1352, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1353 + /* "w3lib/_url.pyx":1352 * output += url.username * if url.password: * output += f":{url.password}" # <<<<<<<<<<<<<< * elif url._password_token_seen: * output += ":" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1353, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1353, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1352 + /* "w3lib/_url.pyx":1351 * if url.username or url.password: * output += url.username * if url.password: # <<<<<<<<<<<<<< @@ -20785,32 +20386,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L9; } - /* "w3lib/_url.pyx":1354 + /* "w3lib/_url.pyx":1353 * if url.password: * output += f":{url.password}" * elif url._password_token_seen: # <<<<<<<<<<<<<< * output += ":" * output += "@" */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1354, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1354, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1355 + /* "w3lib/_url.pyx":1354 * output += f":{url.password}" * elif url._password_token_seen: * output += ":" # <<<<<<<<<<<<<< * output += "@" * output += _serialize_host(url) */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1355, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1354 + /* "w3lib/_url.pyx":1353 * if url.password: * output += f":{url.password}" * elif url._password_token_seen: # <<<<<<<<<<<<<< @@ -20820,19 +20421,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L9:; - /* "w3lib/_url.pyx":1356 + /* "w3lib/_url.pyx":1355 * elif url._password_token_seen: * output += ":" * output += "@" # <<<<<<<<<<<<<< * output += _serialize_host(url) * if url.port > -1: */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__15); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1356, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1350 + /* "w3lib/_url.pyx":1349 * if url.hostname or url._host_type != HOSTNAME: * output += "//" * if url.username or url.password: # <<<<<<<<<<<<<< @@ -20841,14 +20442,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * */ } - /* "w3lib/_url.pyx":1357 + /* "w3lib/_url.pyx":1356 * output += ":" * output += "@" * output += _serialize_host(url) # <<<<<<<<<<<<<< * if url.port > -1: * output += f":{url.port}" */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_6 = 0; @@ -20868,53 +20469,53 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_url}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1357, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1358 + /* "w3lib/_url.pyx":1357 * output += "@" * output += _serialize_host(url) * if url.port > -1: # <<<<<<<<<<<<<< * output += f":{url.port}" * elif url._port_token_seen: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_neg_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1358, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_neg_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1358, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1359 + /* "w3lib/_url.pyx":1358 * output += _serialize_host(url) * if url.port > -1: * output += f":{url.port}" # <<<<<<<<<<<<<< * elif url._port_token_seen: * output += ":" */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1359, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u__5, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1359, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1358 + /* "w3lib/_url.pyx":1357 * output += "@" * output += _serialize_host(url) * if url.port > -1: # <<<<<<<<<<<<<< @@ -20924,32 +20525,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L10; } - /* "w3lib/_url.pyx":1360 + /* "w3lib/_url.pyx":1359 * if url.port > -1: * output += f":{url.port}" * elif url._port_token_seen: # <<<<<<<<<<<<<< * output += ":" * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1360, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1359, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1361 + /* "w3lib/_url.pyx":1360 * output += f":{url.port}" * elif url._port_token_seen: * output += ":" # <<<<<<<<<<<<<< * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: * output += "/." */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1360 + /* "w3lib/_url.pyx":1359 * if url.port > -1: * output += f":{url.port}" * elif url._port_token_seen: # <<<<<<<<<<<<<< @@ -20959,7 +20560,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L10:; - /* "w3lib/_url.pyx":1348 + /* "w3lib/_url.pyx":1347 * """ * output = url.scheme + ":" * if url.hostname or url._host_type != HOSTNAME: # <<<<<<<<<<<<<< @@ -20969,16 +20570,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L3; } - /* "w3lib/_url.pyx":1362 + /* "w3lib/_url.pyx":1361 * elif url._port_token_seen: * output += ":" * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< * output += "/." * output += _serialize_url_path(url) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1362, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1361, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_4); if (__pyx_t_7) { @@ -20986,9 +20587,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_7; goto __pyx_L11_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1362, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1361, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (__pyx_t_8 > 1); if (__pyx_t_7) { @@ -20996,31 +20597,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_7; goto __pyx_L11_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1362, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1362, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1361, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = (!__pyx_t_7); __pyx_t_3 = __pyx_t_4; __pyx_L11_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1363 + /* "w3lib/_url.pyx":1362 * output += ":" * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: * output += "/." # <<<<<<<<<<<<<< * output += _serialize_url_path(url) * if url.query: */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__25); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1363, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__24); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1362 + /* "w3lib/_url.pyx":1361 * elif url._port_token_seen: * output += ":" * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< @@ -21030,14 +20631,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L3:; - /* "w3lib/_url.pyx":1364 + /* "w3lib/_url.pyx":1363 * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: * output += "/." * output += _serialize_url_path(url) # <<<<<<<<<<<<<< * if url.query: * output += f"?{url.query}" */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_url_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_url_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_6 = 0; @@ -21057,51 +20658,51 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_url}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1364, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1365 + /* "w3lib/_url.pyx":1364 * output += "/." * output += _serialize_url_path(url) * if url.query: # <<<<<<<<<<<<<< * output += f"?{url.query}" * elif url._query_token_seen: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1365, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1366 + /* "w3lib/_url.pyx":1365 * output += _serialize_url_path(url) * if url.query: * output += f"?{url.query}" # <<<<<<<<<<<<<< * elif url._query_token_seen: * output += "?" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__19, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__18, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1365 + /* "w3lib/_url.pyx":1364 * output += "/." * output += _serialize_url_path(url) * if url.query: # <<<<<<<<<<<<<< @@ -21111,32 +20712,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L14; } - /* "w3lib/_url.pyx":1367 + /* "w3lib/_url.pyx":1366 * if url.query: * output += f"?{url.query}" * elif url._query_token_seen: # <<<<<<<<<<<<<< * output += "?" * if url.fragment: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1367, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1367, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1368 + /* "w3lib/_url.pyx":1367 * output += f"?{url.query}" * elif url._query_token_seen: * output += "?" # <<<<<<<<<<<<<< * if url.fragment: * output += f"#{url.fragment}" */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__19); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__18); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1367 + /* "w3lib/_url.pyx":1366 * if url.query: * output += f"?{url.query}" * elif url._query_token_seen: # <<<<<<<<<<<<<< @@ -21146,41 +20747,41 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L14:; - /* "w3lib/_url.pyx":1369 + /* "w3lib/_url.pyx":1368 * elif url._query_token_seen: * output += "?" * if url.fragment: # <<<<<<<<<<<<<< * output += f"#{url.fragment}" * elif url._fragment_token_seen: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1369, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1369, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1370 + /* "w3lib/_url.pyx":1369 * output += "?" * if url.fragment: * output += f"#{url.fragment}" # <<<<<<<<<<<<<< * elif url._fragment_token_seen: * output += "#" */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u__20, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u__19, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1369 + /* "w3lib/_url.pyx":1368 * elif url._query_token_seen: * output += "?" * if url.fragment: # <<<<<<<<<<<<<< @@ -21190,32 +20791,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L15; } - /* "w3lib/_url.pyx":1371 + /* "w3lib/_url.pyx":1370 * if url.fragment: * output += f"#{url.fragment}" * elif url._fragment_token_seen: # <<<<<<<<<<<<<< * output += "#" * return output */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1371, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1372 + /* "w3lib/_url.pyx":1371 * output += f"#{url.fragment}" * elif url._fragment_token_seen: * output += "#" # <<<<<<<<<<<<<< * return output * */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1371 + /* "w3lib/_url.pyx":1370 * if url.fragment: * output += f"#{url.fragment}" * elif url._fragment_token_seen: # <<<<<<<<<<<<<< @@ -21225,7 +20826,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L15:; - /* "w3lib/_url.pyx":1373 + /* "w3lib/_url.pyx":1372 * elif url._fragment_token_seen: * output += "#" * return output # <<<<<<<<<<<<<< @@ -21233,12 +20834,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1373, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1372, __pyx_L1_error) __Pyx_INCREF(__pyx_v_output); __pyx_r = ((PyObject*)__pyx_v_output); goto __pyx_L0; - /* "w3lib/_url.pyx":1341 + /* "w3lib/_url.pyx":1340 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url(url: _URL) -> str: # <<<<<<<<<<<<<< @@ -21260,7 +20861,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "w3lib/_url.pyx":1376 +/* "w3lib/_url.pyx":1375 * * * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< @@ -21269,15 +20870,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject * */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_53_safe_url(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_51_safe_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_53_safe_url = {"_safe_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_53_safe_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_53_safe_url(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_51_safe_url = {"_safe_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_51_safe_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_51_safe_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -21324,7 +20925,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1375, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -21332,14 +20933,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1375, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_safe_url", 1, 2, 2, 1); __PYX_ERR(0, 1376, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_url", 1, 2, 2, 1); __PYX_ERR(0, 1375, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_safe_url") < 0)) __PYX_ERR(0, 1376, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_safe_url") < 0)) __PYX_ERR(0, 1375, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -21352,7 +20953,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_safe_url", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1376, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_url", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1375, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21366,9 +20967,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 1376, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 1376, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_52_safe_url(__pyx_self, __pyx_v_input, __pyx_v_encoding); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 1375, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 1375, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_50_safe_url(__pyx_self, __pyx_v_input, __pyx_v_encoding); /* function exit code */ goto __pyx_L0; @@ -21385,7 +20986,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_52_safe_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding) { +static PyObject *__pyx_pf_5w3lib_4_url_50_safe_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding) { PyObject *__pyx_v_url = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -21398,13 +20999,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_52_safe_url(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_url", 1); - /* "w3lib/_url.pyx":1377 + /* "w3lib/_url.pyx":1376 * * def _safe_url(input: str, encoding: str) -> str: * url = _parse_url(input, encoding) # <<<<<<<<<<<<<< * return _serialize_url(url) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -21424,20 +21025,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_52_safe_url(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_input, __pyx_v_encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_url = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1378 + /* "w3lib/_url.pyx":1377 * def _safe_url(input: str, encoding: str) -> str: * url = _parse_url(input, encoding) * return _serialize_url(url) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_serialize_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1378, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_serialize_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -21457,16 +21058,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_52_safe_url(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_url}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1378, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1377, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1376 + /* "w3lib/_url.pyx":1375 * * * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< @@ -21914,7 +21515,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS, __pyx_k_SPECIAL_QUERY_SAFEST_CHARS, sizeof(__pyx_k_SPECIAL_QUERY_SAFEST_CHARS), 0, 0, 1, 1}, {&__pyx_n_s_SPECIAL_SCHEMES, __pyx_k_SPECIAL_SCHEMES, sizeof(__pyx_k_SPECIAL_SCHEMES), 0, 0, 1, 1}, {&__pyx_n_s_Tuple, __pyx_k_Tuple, sizeof(__pyx_k_Tuple), 0, 0, 1, 1}, - {&__pyx_kp_s_Tuple_int_bool, __pyx_k_Tuple_int_bool, sizeof(__pyx_k_Tuple_int_bool), 0, 0, 1, 0}, + {&__pyx_kp_s_Tuple_int_bint, __pyx_k_Tuple_int_bint, sizeof(__pyx_k_Tuple_int_bint), 0, 0, 1, 0}, {&__pyx_n_s_URL, __pyx_k_URL, sizeof(__pyx_k_URL), 0, 0, 1, 1}, {&__pyx_n_s_URL___init, __pyx_k_URL___init, sizeof(__pyx_k_URL___init), 0, 0, 1, 1}, {&__pyx_kp_u_URL_is_relative, __pyx_k_URL_is_relative, sizeof(__pyx_k_URL_is_relative), 0, 1, 0, 0}, @@ -21926,47 +21527,45 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_UTF_8_ENCODING, __pyx_k_UTF_8_ENCODING, sizeof(__pyx_k_UTF_8_ENCODING), 0, 0, 1, 1}, {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0}, {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, + {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0}, {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0}, {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0}, {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0}, {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0}, + {&__pyx_n_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 1}, {&__pyx_kp_u__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0}, - {&__pyx_n_s__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 0, 1, 1}, + {&__pyx_kp_b__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 0, 0, 0}, {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0}, - {&__pyx_kp_b__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 0, 0}, {&__pyx_kp_u__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 1, 0, 0}, - {&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0}, + {&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0}, {&__pyx_kp_u__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0, 0}, {&__pyx_kp_u__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 1, 0, 0}, - {&__pyx_kp_u__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 1, 0, 0}, - {&__pyx_n_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 1}, + {&__pyx_n_s__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 0, 1, 1}, + {&__pyx_kp_b__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 0, 0}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0}, {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, - {&__pyx_kp_b__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 0, 0}, {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, - {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, - {&__pyx_kp_u__73, __pyx_k__73, sizeof(__pyx_k__73), 0, 1, 0, 0}, - {&__pyx_n_s__76, __pyx_k__76, sizeof(__pyx_k__76), 0, 0, 1, 1}, + {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, + {&__pyx_kp_u__72, __pyx_k__72, sizeof(__pyx_k__72), 0, 1, 0, 0}, + {&__pyx_kp_u__75, __pyx_k__75, sizeof(__pyx_k__75), 0, 1, 0, 0}, + {&__pyx_kp_u__76, __pyx_k__76, sizeof(__pyx_k__76), 0, 1, 0, 0}, + {&__pyx_kp_u__77, __pyx_k__77, sizeof(__pyx_k__77), 0, 1, 0, 0}, + {&__pyx_kp_b__78, __pyx_k__78, sizeof(__pyx_k__78), 0, 0, 0, 0}, + {&__pyx_kp_u__78, __pyx_k__78, sizeof(__pyx_k__78), 0, 1, 0, 0}, {&__pyx_kp_u__79, __pyx_k__79, sizeof(__pyx_k__79), 0, 1, 0, 0}, {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, {&__pyx_kp_u__80, __pyx_k__80, sizeof(__pyx_k__80), 0, 1, 0, 0}, - {&__pyx_kp_u__81, __pyx_k__81, sizeof(__pyx_k__81), 0, 1, 0, 0}, + {&__pyx_kp_b__81, __pyx_k__81, sizeof(__pyx_k__81), 0, 0, 0, 0}, {&__pyx_kp_b__82, __pyx_k__82, sizeof(__pyx_k__82), 0, 0, 0, 0}, - {&__pyx_kp_u__82, __pyx_k__82, sizeof(__pyx_k__82), 0, 1, 0, 0}, {&__pyx_kp_u__83, __pyx_k__83, sizeof(__pyx_k__83), 0, 1, 0, 0}, - {&__pyx_kp_u__84, __pyx_k__84, sizeof(__pyx_k__84), 0, 1, 0, 0}, {&__pyx_kp_b__85, __pyx_k__85, sizeof(__pyx_k__85), 0, 0, 0, 0}, - {&__pyx_kp_b__86, __pyx_k__86, sizeof(__pyx_k__86), 0, 0, 0, 0}, - {&__pyx_kp_u__87, __pyx_k__87, sizeof(__pyx_k__87), 0, 1, 0, 0}, + {&__pyx_kp_b__88, __pyx_k__88, sizeof(__pyx_k__88), 0, 0, 0, 0}, {&__pyx_kp_b__89, __pyx_k__89, sizeof(__pyx_k__89), 0, 0, 0, 0}, {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, - {&__pyx_kp_b__92, __pyx_k__92, sizeof(__pyx_k__92), 0, 0, 0, 0}, - {&__pyx_kp_b__93, __pyx_k__93, sizeof(__pyx_k__93), 0, 0, 0, 0}, - {&__pyx_kp_u__94, __pyx_k__94, sizeof(__pyx_k__94), 0, 1, 0, 0}, - {&__pyx_kp_u__95, __pyx_k__95, sizeof(__pyx_k__95), 0, 1, 0, 0}, + {&__pyx_kp_u__90, __pyx_k__90, sizeof(__pyx_k__90), 0, 1, 0, 0}, + {&__pyx_kp_u__91, __pyx_k__91, sizeof(__pyx_k__91), 0, 1, 0, 0}, {&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1}, {&__pyx_n_s_annotations, __pyx_k_annotations, sizeof(__pyx_k_annotations), 0, 0, 1, 1}, {&__pyx_kp_u_ansi_x3_4_1968, __pyx_k_ansi_x3_4_1968, sizeof(__pyx_k_ansi_x3_4_1968), 0, 1, 0, 0}, @@ -21984,9 +21583,8 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_be_strict, __pyx_k_be_strict, sizeof(__pyx_k_be_strict), 0, 0, 1, 1}, {&__pyx_n_u_big5, __pyx_k_big5, sizeof(__pyx_k_big5), 0, 1, 0, 1}, {&__pyx_kp_u_big5_hkscs, __pyx_k_big5_hkscs, sizeof(__pyx_k_big5_hkscs), 0, 1, 0, 0}, - {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_bint, __pyx_k_bint, sizeof(__pyx_k_bint), 0, 0, 1, 1}, {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, - {&__pyx_n_s_byte, __pyx_k_byte, sizeof(__pyx_k_byte), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_check_bidi, __pyx_k_check_bidi, sizeof(__pyx_k_check_bidi), 0, 0, 1, 1}, {&__pyx_n_s_check_hyphens, __pyx_k_check_hyphens, sizeof(__pyx_k_check_hyphens), 0, 0, 1, 1}, @@ -22055,11 +21653,9 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_u_elot_928, __pyx_k_elot_928, sizeof(__pyx_k_elot_928), 0, 1, 0, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, - {&__pyx_n_s_encode_output, __pyx_k_encode_output, sizeof(__pyx_k_encode_output), 0, 0, 1, 1}, {&__pyx_n_s_encode_set, __pyx_k_encode_set, sizeof(__pyx_k_encode_set), 0, 0, 1, 1}, {&__pyx_n_s_encoded, __pyx_k_encoded, sizeof(__pyx_k_encoded), 0, 0, 1, 1}, {&__pyx_n_s_encoded_code_points, __pyx_k_encoded_code_points, sizeof(__pyx_k_encoded_code_points), 0, 0, 1, 1}, - {&__pyx_n_s_encoder, __pyx_k_encoder, sizeof(__pyx_k_encoder), 0, 0, 1, 1}, {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, {&__pyx_n_s_ends_in_number, __pyx_k_ends_in_number, sizeof(__pyx_k_ends_in_number), 0, 0, 1, 1}, {&__pyx_n_s_ends_in_number_locals_genexpr, __pyx_k_ends_in_number_locals_genexpr, sizeof(__pyx_k_ends_in_number_locals_genexpr), 0, 0, 1, 1}, @@ -22200,7 +21796,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_u_iso_ir_149, __pyx_k_iso_ir_149, sizeof(__pyx_k_iso_ir_149), 0, 1, 0, 0}, {&__pyx_kp_u_iso_ir_157, __pyx_k_iso_ir_157, sizeof(__pyx_k_iso_ir_157), 0, 1, 0, 0}, {&__pyx_kp_u_iso_ir_58, __pyx_k_iso_ir_58, sizeof(__pyx_k_iso_ir_58), 0, 1, 0, 0}, - {&__pyx_n_s_isomorph, __pyx_k_isomorph, sizeof(__pyx_k_isomorph), 0, 0, 1, 1}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_u_koi, __pyx_k_koi, sizeof(__pyx_k_koi), 0, 1, 0, 1}, {&__pyx_n_u_koi8, __pyx_k_koi8, sizeof(__pyx_k_koi8), 0, 1, 0, 1}, @@ -22267,7 +21862,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_path_safe_chars, __pyx_k_path_safe_chars, sizeof(__pyx_k_path_safe_chars), 0, 0, 1, 1}, {&__pyx_n_s_path_token_seen, __pyx_k_path_token_seen, sizeof(__pyx_k_path_token_seen), 0, 0, 1, 1}, - {&__pyx_n_s_percent_encode_after_encoding, __pyx_k_percent_encode_after_encoding, sizeof(__pyx_k_percent_encode_after_encoding), 0, 0, 1, 1}, {&__pyx_n_s_percent_encode_set, __pyx_k_percent_encode_set, sizeof(__pyx_k_percent_encode_set), 0, 0, 1, 1}, {&__pyx_n_s_piece, __pyx_k_piece, sizeof(__pyx_k_piece), 0, 0, 1, 1}, {&__pyx_n_s_piece_index, __pyx_k_piece_index, sizeof(__pyx_k_piece_index), 0, 0, 1, 1}, @@ -22307,7 +21901,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_shorten_path, __pyx_k_shorten_path, sizeof(__pyx_k_shorten_path), 0, 0, 1, 1}, {&__pyx_n_u_sjis, __pyx_k_sjis, sizeof(__pyx_k_sjis), 0, 1, 0, 1}, {&__pyx_n_s_skip_authority_shortcut, __pyx_k_skip_authority_shortcut, sizeof(__pyx_k_skip_authority_shortcut), 0, 0, 1, 1}, - {&__pyx_n_s_space_as_plus, __pyx_k_space_as_plus, sizeof(__pyx_k_space_as_plus), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_starts_with_windows_drive_lette, __pyx_k_starts_with_windows_drive_lette, sizeof(__pyx_k_starts_with_windows_drive_lette), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, @@ -22382,10 +21975,10 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 461, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 462, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 592, __pyx_L1_error) - __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 595, __pyx_L1_error) __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 739, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1067, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1066, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -22414,42 +22007,42 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * return (int(input, base=r), validation_error) * */ - __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, Py_True); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__6 = PyTuple_Pack(2, __pyx_int_0, Py_True); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); - /* "w3lib/_url.pyx":1026 + /* "w3lib/_url.pyx":1025 * * elif state == NO_SCHEME: * raise ValueError("No URL scheme") # <<<<<<<<<<<<<< * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_No_URL_scheme); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_No_URL_scheme); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1025, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); - /* "w3lib/_url.pyx":1033 + /* "w3lib/_url.pyx":1032 * pointer += 1 * else: * raise ValueError("URL is relative") # <<<<<<<<<<<<<< * * elif state == PATH_OR_AUTHORITY: */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_URL_is_relative); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_URL_is_relative); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); - /* "w3lib/_url.pyx":1192 + /* "w3lib/_url.pyx":1191 * and _is_windows_drive_letter(buffer) * ): * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< * if ( * not url.path */ - __pyx_slice__22 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(0, 1192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__22); - __Pyx_GIVEREF(__pyx_slice__22); + __pyx_slice__21 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__21); + __Pyx_GIVEREF(__pyx_slice__21); /* "w3lib/_url.pyx":45 * @@ -22458,10 +22051,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * return { * label: f"windows-125{last_digit}" */ - __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_last_digit, __pyx_n_s_label); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_short_windows_125, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(2, __pyx_n_s_last_digit, __pyx_n_s_label); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_short_windows_125, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 45, __pyx_L1_error) /* "w3lib/_url.pyx":69 * label: _UTF_8_ENCODING @@ -22470,9 +22063,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "unicode11utf8", * "unicode20utf8", */ - __pyx_tuple__29 = PyTuple_Pack(6, __pyx_kp_u_unicode_1_1_utf_8, __pyx_n_u_unicode11utf8, __pyx_n_u_unicode20utf8, __pyx_kp_u_utf_8, __pyx_n_u_utf8, __pyx_kp_u_x_unicode20utf8); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__28 = PyTuple_Pack(6, __pyx_kp_u_unicode_1_1_utf_8, __pyx_n_u_unicode11utf8, __pyx_n_u_unicode20utf8, __pyx_kp_u_utf_8, __pyx_n_u_utf8, __pyx_kp_u_x_unicode20utf8); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); /* "w3lib/_url.pyx":80 * label: "ibm866" @@ -22481,9 +22074,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "cp866", * "csibm866", */ - __pyx_tuple__30 = PyTuple_Pack(4, __pyx_kp_u_866, __pyx_n_u_cp866, __pyx_n_u_csibm866, __pyx_n_u_ibm866); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 80, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__29 = PyTuple_Pack(4, __pyx_kp_u_866, __pyx_n_u_cp866, __pyx_n_u_csibm866, __pyx_n_u_ibm866); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); /* "w3lib/_url.pyx":89 * label: "iso-8859-2" @@ -22492,9 +22085,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "iso-8859-2", * "iso-ir-101", */ - __pyx_tuple__31 = PyTuple_Pack(9, __pyx_n_u_csisolatin2, __pyx_kp_u_iso_8859_2, __pyx_kp_u_iso_ir_101, __pyx_kp_u_iso8859_2, __pyx_n_u_iso88592, __pyx_kp_u_iso_8859_2_2, __pyx_kp_u_iso_8859_2_1987, __pyx_n_u_l2, __pyx_n_u_latin2); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_tuple__30 = PyTuple_Pack(9, __pyx_n_u_csisolatin2, __pyx_kp_u_iso_8859_2, __pyx_kp_u_iso_ir_101, __pyx_kp_u_iso8859_2, __pyx_n_u_iso88592, __pyx_kp_u_iso_8859_2_2, __pyx_kp_u_iso_8859_2_1987, __pyx_n_u_l2, __pyx_n_u_latin2); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); /* "w3lib/_url.pyx":103 * label: "iso-8859-3" @@ -22503,9 +22096,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "iso-8859-3", * "iso-ir-109", */ - __pyx_tuple__32 = PyTuple_Pack(9, __pyx_n_u_csisolatin3, __pyx_kp_u_iso_8859_3, __pyx_kp_u_iso_ir_109, __pyx_kp_u_iso8859_3, __pyx_n_u_iso88593, __pyx_kp_u_iso_8859_3_2, __pyx_kp_u_iso_8859_3_1988, __pyx_n_u_l3, __pyx_n_u_latin3); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_tuple__31 = PyTuple_Pack(9, __pyx_n_u_csisolatin3, __pyx_kp_u_iso_8859_3, __pyx_kp_u_iso_ir_109, __pyx_kp_u_iso8859_3, __pyx_n_u_iso88593, __pyx_kp_u_iso_8859_3_2, __pyx_kp_u_iso_8859_3_1988, __pyx_n_u_l3, __pyx_n_u_latin3); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); /* "w3lib/_url.pyx":117 * label: "iso-8859-4" @@ -22514,9 +22107,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "iso-8859-4", * "iso-ir-110", */ - __pyx_tuple__33 = PyTuple_Pack(9, __pyx_n_u_csisolatin4, __pyx_kp_u_iso_8859_4, __pyx_kp_u_iso_ir_110, __pyx_kp_u_iso8859_4, __pyx_n_u_iso88594, __pyx_kp_u_iso_8859_4_2, __pyx_kp_u_iso_8859_4_1988, __pyx_n_u_l4, __pyx_n_u_latin4); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_tuple__32 = PyTuple_Pack(9, __pyx_n_u_csisolatin4, __pyx_kp_u_iso_8859_4, __pyx_kp_u_iso_ir_110, __pyx_kp_u_iso8859_4, __pyx_n_u_iso88594, __pyx_kp_u_iso_8859_4_2, __pyx_kp_u_iso_8859_4_1988, __pyx_n_u_l4, __pyx_n_u_latin4); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); /* "w3lib/_url.pyx":131 * label: "iso-8859-5" @@ -22525,9 +22118,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "cyrillic", * "iso-8859-5", */ - __pyx_tuple__34 = PyTuple_Pack(8, __pyx_n_u_csisolatincyrillic, __pyx_n_u_cyrillic, __pyx_kp_u_iso_8859_5, __pyx_kp_u_iso_ir_144, __pyx_kp_u_iso8859_5, __pyx_n_u_iso88595, __pyx_kp_u_iso_8859_5_2, __pyx_kp_u_iso_8859_5_1988); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_tuple__33 = PyTuple_Pack(8, __pyx_n_u_csisolatincyrillic, __pyx_n_u_cyrillic, __pyx_kp_u_iso_8859_5, __pyx_kp_u_iso_ir_144, __pyx_kp_u_iso8859_5, __pyx_n_u_iso88595, __pyx_kp_u_iso_8859_5_2, __pyx_kp_u_iso_8859_5_1988); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); /* "w3lib/_url.pyx":144 * label: "iso-8859-6" @@ -22536,9 +22129,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "asmo-708", * "csiso88596e", */ - __pyx_tuple__35 = PyTuple_Pack(14, __pyx_n_u_arabic, __pyx_kp_u_asmo_708, __pyx_n_u_csiso88596e, __pyx_n_u_csiso88596i, __pyx_n_u_csisolatinarabic, __pyx_kp_u_ecma_114, __pyx_kp_u_iso_8859_6, __pyx_kp_u_iso_8859_6_e, __pyx_kp_u_iso_8859_6_i, __pyx_kp_u_iso_ir_127, __pyx_kp_u_iso8859_6, __pyx_n_u_iso88596, __pyx_kp_u_iso_8859_6_2, __pyx_kp_u_iso_8859_6_1987); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_tuple__34 = PyTuple_Pack(14, __pyx_n_u_arabic, __pyx_kp_u_asmo_708, __pyx_n_u_csiso88596e, __pyx_n_u_csiso88596i, __pyx_n_u_csisolatinarabic, __pyx_kp_u_ecma_114, __pyx_kp_u_iso_8859_6, __pyx_kp_u_iso_8859_6_e, __pyx_kp_u_iso_8859_6_i, __pyx_kp_u_iso_ir_127, __pyx_kp_u_iso8859_6, __pyx_n_u_iso88596, __pyx_kp_u_iso_8859_6_2, __pyx_kp_u_iso_8859_6_1987); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); /* "w3lib/_url.pyx":163 * label: "iso-8859-7" @@ -22547,9 +22140,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "ecma-118", * "elot_928", */ - __pyx_tuple__36 = PyTuple_Pack(12, __pyx_n_u_csisolatingreek, __pyx_kp_u_ecma_118, __pyx_n_u_elot_928, __pyx_n_u_greek, __pyx_n_u_greek8, __pyx_kp_u_iso_8859_7, __pyx_kp_u_iso_ir_126, __pyx_kp_u_iso8859_7, __pyx_n_u_iso88597, __pyx_kp_u_iso_8859_7_2, __pyx_kp_u_iso_8859_7_1987, __pyx_n_u_sun_eu_greek); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_tuple__35 = PyTuple_Pack(12, __pyx_n_u_csisolatingreek, __pyx_kp_u_ecma_118, __pyx_n_u_elot_928, __pyx_n_u_greek, __pyx_n_u_greek8, __pyx_kp_u_iso_8859_7, __pyx_kp_u_iso_ir_126, __pyx_kp_u_iso8859_7, __pyx_n_u_iso88597, __pyx_kp_u_iso_8859_7_2, __pyx_kp_u_iso_8859_7_1987, __pyx_n_u_sun_eu_greek); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); /* "w3lib/_url.pyx":180 * label: "iso-8859-8" @@ -22558,9 +22151,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "csisolatinhebrew", * "hebrew", */ - __pyx_tuple__37 = PyTuple_Pack(11, __pyx_n_u_csiso88598e, __pyx_n_u_csisolatinhebrew, __pyx_n_u_hebrew, __pyx_kp_u_iso_8859_8, __pyx_kp_u_iso_8859_8_e, __pyx_kp_u_iso_ir_138, __pyx_kp_u_iso8859_8, __pyx_n_u_iso88598, __pyx_kp_u_iso_8859_8_2, __pyx_kp_u_iso_8859_8_1988, __pyx_n_u_visual); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_tuple__36 = PyTuple_Pack(11, __pyx_n_u_csiso88598e, __pyx_n_u_csisolatinhebrew, __pyx_n_u_hebrew, __pyx_kp_u_iso_8859_8, __pyx_kp_u_iso_8859_8_e, __pyx_kp_u_iso_ir_138, __pyx_kp_u_iso8859_8, __pyx_n_u_iso88598, __pyx_kp_u_iso_8859_8_2, __pyx_kp_u_iso_8859_8_1988, __pyx_n_u_visual); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); /* "w3lib/_url.pyx":196 * label: "iso-8859-8-i" @@ -22569,9 +22162,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "iso-8859-8-i", * "logical", */ - __pyx_tuple__38 = PyTuple_Pack(3, __pyx_n_u_csiso88598i, __pyx_kp_u_iso_8859_8_i, __pyx_n_u_logical); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 196, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_tuple__37 = PyTuple_Pack(3, __pyx_n_u_csiso88598i, __pyx_kp_u_iso_8859_8_i, __pyx_n_u_logical); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 196, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); /* "w3lib/_url.pyx":204 * label: "iso-8859-10" @@ -22580,9 +22173,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "iso-8859-10", * "iso-ir-157", */ - __pyx_tuple__39 = PyTuple_Pack(7, __pyx_n_u_csisolatin6, __pyx_kp_u_iso_8859_10, __pyx_kp_u_iso_ir_157, __pyx_kp_u_iso8859_10, __pyx_n_u_iso885910, __pyx_n_u_l6, __pyx_n_u_latin6); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_tuple__38 = PyTuple_Pack(7, __pyx_n_u_csisolatin6, __pyx_kp_u_iso_8859_10, __pyx_kp_u_iso_ir_157, __pyx_kp_u_iso8859_10, __pyx_n_u_iso885910, __pyx_n_u_l6, __pyx_n_u_latin6); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); /* "w3lib/_url.pyx":228 * label: "iso-8859-13" @@ -22591,9 +22184,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "iso8859-13", * "iso885913", */ - __pyx_tuple__40 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_13, __pyx_kp_u_iso8859_13, __pyx_n_u_iso885913); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_tuple__39 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_13, __pyx_kp_u_iso8859_13, __pyx_n_u_iso885913); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); /* "w3lib/_url.pyx":236 * label: "iso-8859-14" @@ -22602,9 +22195,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "iso8859-14", * "iso885914", */ - __pyx_tuple__41 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_14, __pyx_kp_u_iso8859_14, __pyx_n_u_iso885914); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_tuple__40 = PyTuple_Pack(3, __pyx_kp_u_iso_8859_14, __pyx_kp_u_iso8859_14, __pyx_n_u_iso885914); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); /* "w3lib/_url.pyx":244 * label: "iso-8859-15" @@ -22613,9 +22206,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "iso-8859-15", * "iso8859-15", */ - __pyx_tuple__42 = PyTuple_Pack(6, __pyx_n_u_csisolatin9, __pyx_kp_u_iso_8859_15, __pyx_kp_u_iso8859_15, __pyx_n_u_iso885915, __pyx_kp_u_iso_8859_15_2, __pyx_n_u_l9); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_tuple__41 = PyTuple_Pack(6, __pyx_n_u_csisolatin9, __pyx_kp_u_iso_8859_15, __pyx_kp_u_iso8859_15, __pyx_n_u_iso885915, __pyx_kp_u_iso_8859_15_2, __pyx_n_u_l9); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); /* "w3lib/_url.pyx":256 * label: "koi8-r" @@ -22624,9 +22217,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "koi", * "koi8", */ - __pyx_tuple__43 = PyTuple_Pack(5, __pyx_n_u_cskoi8r, __pyx_n_u_koi, __pyx_n_u_koi8, __pyx_kp_u_koi8_r, __pyx_n_u_koi8_r_2); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_tuple__42 = PyTuple_Pack(5, __pyx_n_u_cskoi8r, __pyx_n_u_koi, __pyx_n_u_koi8, __pyx_kp_u_koi8_r, __pyx_n_u_koi8_r_2); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); /* "w3lib/_url.pyx":266 * label: "koi8-u" @@ -22635,9 +22228,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "koi8-u", * ) */ - __pyx_tuple__44 = PyTuple_Pack(2, __pyx_kp_u_koi8_ru, __pyx_kp_u_koi8_u); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_tuple__43 = PyTuple_Pack(2, __pyx_kp_u_koi8_ru, __pyx_kp_u_koi8_u); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); /* "w3lib/_url.pyx":273 * label: "macintosh" @@ -22646,9 +22239,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "mac", * "macintosh", */ - __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_u_csmacintosh, __pyx_n_u_mac, __pyx_n_u_macintosh, __pyx_kp_u_x_mac_roman); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_tuple__44 = PyTuple_Pack(4, __pyx_n_u_csmacintosh, __pyx_n_u_mac, __pyx_n_u_macintosh, __pyx_kp_u_x_mac_roman); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); /* "w3lib/_url.pyx":282 * label: "cp874" @@ -22657,9 +22250,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "iso-8859-11", * "iso8859-11", */ - __pyx_tuple__46 = PyTuple_Pack(6, __pyx_kp_u_dos_874, __pyx_kp_u_iso_8859_11, __pyx_kp_u_iso8859_11, __pyx_n_u_iso885911, __pyx_kp_u_tis_620, __pyx_kp_u_windows_874); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_tuple__45 = PyTuple_Pack(6, __pyx_kp_u_dos_874, __pyx_kp_u_iso_8859_11, __pyx_kp_u_iso8859_11, __pyx_n_u_iso885911, __pyx_kp_u_tis_620, __pyx_kp_u_windows_874); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); /* "w3lib/_url.pyx":290 * ) @@ -22668,9 +22261,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * **_short_windows_125(1), * **{ */ - __pyx_tuple__47 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); /* "w3lib/_url.pyx":291 * }, @@ -22679,9 +22272,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * **{ * label: "windows-1252" */ - __pyx_tuple__48 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); /* "w3lib/_url.pyx":295 * label: "windows-1252" @@ -22690,9 +22283,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "ascii", * "cp1252", */ - __pyx_tuple__49 = PyTuple_Pack(17, __pyx_kp_u_ansi_x3_4_1968, __pyx_n_u_ascii, __pyx_n_u_cp1252, __pyx_n_u_cp819, __pyx_n_u_csisolatin1, __pyx_n_u_ibm819, __pyx_kp_u_iso_8859_1, __pyx_kp_u_iso_ir_100, __pyx_kp_u_iso8859_1, __pyx_n_u_iso88591, __pyx_kp_u_iso_8859_1_2, __pyx_kp_u_iso_8859_1_1987, __pyx_n_u_l1, __pyx_n_u_latin1, __pyx_kp_u_us_ascii, __pyx_kp_u_windows_1252, __pyx_kp_u_x_cp1252); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_tuple__48 = PyTuple_Pack(17, __pyx_kp_u_ansi_x3_4_1968, __pyx_n_u_ascii, __pyx_n_u_cp1252, __pyx_n_u_cp819, __pyx_n_u_csisolatin1, __pyx_n_u_ibm819, __pyx_kp_u_iso_8859_1, __pyx_kp_u_iso_ir_100, __pyx_kp_u_iso8859_1, __pyx_n_u_iso88591, __pyx_kp_u_iso_8859_1_2, __pyx_kp_u_iso_8859_1_1987, __pyx_n_u_l1, __pyx_n_u_latin1, __pyx_kp_u_us_ascii, __pyx_kp_u_windows_1252, __pyx_kp_u_x_cp1252); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); /* "w3lib/_url.pyx":314 * ) @@ -22701,9 +22294,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * **{ * label: "windows-1254" */ - __pyx_tuple__50 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__50); - __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); /* "w3lib/_url.pyx":318 * label: "windows-1254" @@ -22712,9 +22305,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "csisolatin5", * "iso-8859-9", */ - __pyx_tuple__51 = PyTuple_Pack(12, __pyx_n_u_cp1254, __pyx_n_u_csisolatin5, __pyx_kp_u_iso_8859_9, __pyx_kp_u_iso_ir_148, __pyx_kp_u_iso8859_9, __pyx_n_u_iso88599, __pyx_kp_u_iso_8859_9_2, __pyx_kp_u_iso_8859_9_1989, __pyx_n_u_l5, __pyx_n_u_latin5, __pyx_kp_u_windows_1254, __pyx_kp_u_x_cp1254); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_tuple__50 = PyTuple_Pack(12, __pyx_n_u_cp1254, __pyx_n_u_csisolatin5, __pyx_kp_u_iso_8859_9, __pyx_kp_u_iso_ir_148, __pyx_kp_u_iso8859_9, __pyx_n_u_iso88599, __pyx_kp_u_iso_8859_9_2, __pyx_kp_u_iso_8859_9_1989, __pyx_n_u_l5, __pyx_n_u_latin5, __pyx_kp_u_windows_1254, __pyx_kp_u_x_cp1254); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); /* "w3lib/_url.pyx":332 * ) @@ -22723,9 +22316,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * **_short_windows_125(6), * **_short_windows_125(7), */ - __pyx_tuple__52 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 332, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__52); - __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); /* "w3lib/_url.pyx":333 * }, @@ -22734,9 +22327,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * **_short_windows_125(7), * **_short_windows_125(8), */ - __pyx_tuple__53 = PyTuple_Pack(1, __pyx_int_6); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__53); - __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_int_6); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); /* "w3lib/_url.pyx":334 * **_short_windows_125(5), @@ -22745,9 +22338,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * **_short_windows_125(8), * **{ */ - __pyx_tuple__54 = PyTuple_Pack(1, __pyx_int_7); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__54); - __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_int_7); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); /* "w3lib/_url.pyx":335 * **_short_windows_125(6), @@ -22756,9 +22349,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * **{ * label: "mac-cyrillic" */ - __pyx_tuple__55 = PyTuple_Pack(1, __pyx_int_8); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__55); - __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_int_8); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); /* "w3lib/_url.pyx":339 * label: "mac-cyrillic" @@ -22767,9 +22360,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "x-mac-ukrainian", * ) */ - __pyx_tuple__56 = PyTuple_Pack(2, __pyx_kp_u_x_mac_cyrillic, __pyx_kp_u_x_mac_ukrainian); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_tuple__55 = PyTuple_Pack(2, __pyx_kp_u_x_mac_cyrillic, __pyx_kp_u_x_mac_ukrainian); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); /* "w3lib/_url.pyx":346 * label: "gbk" @@ -22778,9 +22371,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "csgb2312", * "csiso58gb231280", */ - __pyx_tuple__57 = PyTuple_Pack(9, __pyx_n_u_chinese, __pyx_n_u_csgb2312, __pyx_n_u_csiso58gb231280, __pyx_n_u_gb2312, __pyx_n_u_gb_2312, __pyx_kp_u_gb_2312_80, __pyx_n_u_gbk, __pyx_kp_u_iso_ir_58, __pyx_kp_u_x_gbk); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__57); - __Pyx_GIVEREF(__pyx_tuple__57); + __pyx_tuple__56 = PyTuple_Pack(9, __pyx_n_u_chinese, __pyx_n_u_csgb2312, __pyx_n_u_csiso58gb231280, __pyx_n_u_gb2312, __pyx_n_u_gb_2312, __pyx_kp_u_gb_2312_80, __pyx_n_u_gbk, __pyx_kp_u_iso_ir_58, __pyx_kp_u_x_gbk); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); /* "w3lib/_url.pyx":361 * label: "big5" @@ -22789,9 +22382,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "big5-hkscs", * "cn-big5", */ - __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_u_big5, __pyx_kp_u_big5_hkscs, __pyx_kp_u_cn_big5, __pyx_n_u_csbig5, __pyx_kp_u_x_x_big5); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__58); - __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_tuple__57 = PyTuple_Pack(5, __pyx_n_u_big5, __pyx_kp_u_big5_hkscs, __pyx_kp_u_cn_big5, __pyx_n_u_csbig5, __pyx_kp_u_x_x_big5); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); /* "w3lib/_url.pyx":371 * label: "euc-jp" @@ -22800,9 +22393,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "euc-jp", * "x-euc-jp", */ - __pyx_tuple__59 = PyTuple_Pack(3, __pyx_n_u_cseucpkdfmtjapanese, __pyx_kp_u_euc_jp, __pyx_kp_u_x_euc_jp); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__59); - __Pyx_GIVEREF(__pyx_tuple__59); + __pyx_tuple__58 = PyTuple_Pack(3, __pyx_n_u_cseucpkdfmtjapanese, __pyx_kp_u_euc_jp, __pyx_kp_u_x_euc_jp); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); /* "w3lib/_url.pyx":379 * label: "iso-2022-jp" @@ -22811,9 +22404,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "iso-2022-jp", * ) */ - __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_u_csiso2022jp, __pyx_kp_u_iso_2022_jp); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__60); - __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_tuple__59 = PyTuple_Pack(2, __pyx_n_u_csiso2022jp, __pyx_kp_u_iso_2022_jp); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); /* "w3lib/_url.pyx":386 * label: "shift_jis" @@ -22822,9 +22415,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "ms932", * "ms_kanji", */ - __pyx_tuple__61 = PyTuple_Pack(8, __pyx_n_u_csshiftjis, __pyx_n_u_ms932, __pyx_n_u_ms_kanji, __pyx_kp_u_shift_jis, __pyx_n_u_shift_jis_2, __pyx_n_u_sjis, __pyx_kp_u_windows_31j, __pyx_kp_u_x_sjis); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__61); - __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_tuple__60 = PyTuple_Pack(8, __pyx_n_u_csshiftjis, __pyx_n_u_ms932, __pyx_n_u_ms_kanji, __pyx_kp_u_shift_jis, __pyx_n_u_shift_jis_2, __pyx_n_u_sjis, __pyx_kp_u_windows_31j, __pyx_kp_u_x_sjis); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); /* "w3lib/_url.pyx":399 * label: "euc-kr" @@ -22833,9 +22426,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "csksc56011987", * "euc-kr", */ - __pyx_tuple__62 = PyTuple_Pack(10, __pyx_n_u_cseuckr, __pyx_n_u_csksc56011987, __pyx_kp_u_euc_kr, __pyx_kp_u_iso_ir_149, __pyx_n_u_korean, __pyx_kp_u_ks_c_5601_1987, __pyx_kp_u_ks_c_5601_1989, __pyx_n_u_ksc5601, __pyx_n_u_ksc_5601, __pyx_kp_u_windows_949); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__62); - __Pyx_GIVEREF(__pyx_tuple__62); + __pyx_tuple__61 = PyTuple_Pack(10, __pyx_n_u_cseuckr, __pyx_n_u_csksc56011987, __pyx_kp_u_euc_kr, __pyx_kp_u_iso_ir_149, __pyx_n_u_korean, __pyx_kp_u_ks_c_5601_1987, __pyx_kp_u_ks_c_5601_1989, __pyx_n_u_ksc5601, __pyx_n_u_ksc_5601, __pyx_kp_u_windows_949); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); /* "w3lib/_url.pyx":414 * label: _REPLACEMENT_ENCODING @@ -22844,9 +22437,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "hz-gb-2312", * "iso-2022-cn", */ - __pyx_tuple__63 = PyTuple_Pack(6, __pyx_n_u_csiso2022kr, __pyx_kp_u_hz_gb_2312, __pyx_kp_u_iso_2022_cn, __pyx_kp_u_iso_2022_cn_ext, __pyx_kp_u_iso_2022_kr, __pyx_n_u_replacement); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__63); - __Pyx_GIVEREF(__pyx_tuple__63); + __pyx_tuple__62 = PyTuple_Pack(6, __pyx_n_u_csiso2022kr, __pyx_kp_u_hz_gb_2312, __pyx_kp_u_iso_2022_cn, __pyx_kp_u_iso_2022_cn_ext, __pyx_kp_u_iso_2022_kr, __pyx_n_u_replacement); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); /* "w3lib/_url.pyx":425 * label: _UTF_16BE_ENCODING @@ -22855,9 +22448,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "utf-16be", * ) */ - __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_u_unicodefffe, __pyx_kp_u_utf_16be); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__64); - __Pyx_GIVEREF(__pyx_tuple__64); + __pyx_tuple__63 = PyTuple_Pack(2, __pyx_n_u_unicodefffe, __pyx_kp_u_utf_16be); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); /* "w3lib/_url.pyx":432 * label: _UTF_16LE_ENCODING @@ -22866,9 +22459,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * "iso-10646-ucs-2", * "ucs-2", */ - __pyx_tuple__65 = PyTuple_Pack(7, __pyx_n_u_csunicode, __pyx_kp_u_iso_10646_ucs_2, __pyx_kp_u_ucs_2, __pyx_n_u_unicode, __pyx_n_u_unicodefeff, __pyx_kp_u_utf_16, __pyx_kp_u_utf_16le); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__65); - __Pyx_GIVEREF(__pyx_tuple__65); + __pyx_tuple__64 = PyTuple_Pack(7, __pyx_n_u_csunicode, __pyx_kp_u_iso_10646_ucs_2, __pyx_kp_u_ucs_2, __pyx_n_u_unicode, __pyx_n_u_unicodefeff, __pyx_kp_u_utf_16, __pyx_kp_u_utf_16le); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); /* "w3lib/_url.pyx":446 * @@ -22877,10 +22470,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def _get_encoder(encoding: str) -> EncodeFunction: * codec_info = codecs.lookup(encoding) */ - __pyx_tuple__66 = PyTuple_Pack(2, __pyx_n_s_encoding, __pyx_n_s_codec_info); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__66); - __Pyx_GIVEREF(__pyx_tuple__66); - __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_encoder, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 446, __pyx_L1_error) + __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_encoding, __pyx_n_s_codec_info); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_encoder, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 446, __pyx_L1_error) /* "w3lib/_url.pyx":452 * @@ -22889,9 +22482,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__68); - __Pyx_GIVEREF(__pyx_tuple__68); + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); /* "w3lib/_url.pyx":456 * @@ -22900,22 +22493,22 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def _get_encoding(label: str) -> str: * label = label.strip(_ASCII_WHITESPACE).lower() */ - __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_label, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__69); - __Pyx_GIVEREF(__pyx_tuple__69); - __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_encoding, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_tuple__68 = PyTuple_Pack(2, __pyx_n_s_label, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_encoding, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 456, __pyx_L1_error) /* "w3lib/_url.pyx":547 - * _fragment_token_seen: bool + * _fragment_token_seen: bint * * def __init__(self): # <<<<<<<<<<<<<< * self.scheme = "" * self.username = "" */ - __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__71); - __Pyx_GIVEREF(__pyx_tuple__71); - __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_init, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_init, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 547, __pyx_L1_error) /* "w3lib/_url.pyx":571 * @@ -22924,22 +22517,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * path = url.path * if url.scheme == "file" and len(path) == 1 and _is_windows_drive_letter(path[0]): */ - __pyx_tuple__74 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_path); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__74); - __Pyx_GIVEREF(__pyx_tuple__74); - __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_shorten_path, 571, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 571, __pyx_L1_error) - - /* "w3lib/_url.pyx":580 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode - * # Extended to handled cases where % is to be percent-encoded. - * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input: str, - * *, - */ - __pyx_tuple__77 = PyTuple_Pack(11, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_percent_encode_set, __pyx_n_s_space_as_plus, __pyx_n_s_encoder, __pyx_n_s_output, __pyx_n_s_encode_output, __pyx_n_s__76, __pyx_n_s_i, __pyx_n_s_byte, __pyx_n_s_isomorph); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__77); - __Pyx_GIVEREF(__pyx_tuple__77); - __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_percent_encode_after_encoding, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_tuple__73 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_path); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_shorten_path, 571, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 571, __pyx_L1_error) /* "w3lib/_url.pyx":629 * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" @@ -22948,9 +22529,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 * */ - __pyx_tuple__88 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__88); - __Pyx_GIVEREF(__pyx_tuple__88); + __pyx_tuple__84 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); /* "w3lib/_url.pyx":634 * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" @@ -22959,9 +22540,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * # Characters that are safe in all of: */ - __pyx_tuple__90 = PyTuple_Pack(2, __pyx_kp_b__20, __pyx_kp_b_); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__90); - __Pyx_GIVEREF(__pyx_tuple__90); + __pyx_tuple__86 = PyTuple_Pack(2, __pyx_kp_b__19, __pyx_kp_b_); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); /* "w3lib/_url.pyx":646 * # be escaped as %25 when it is not already being used as part of an escape @@ -22970,9 +22551,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS */ - __pyx_tuple__91 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__91); - __Pyx_GIVEREF(__pyx_tuple__91); + __pyx_tuple__87 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); /* "w3lib/_url.pyx":683 * @@ -22981,10 +22562,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * address = [0] * 8 * piece_index = 0 */ - __pyx_tuple__96 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_address, __pyx_n_s_piece_index, __pyx_n_s_compress, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_value, __pyx_n_s_length, __pyx_n_s_numbers_seen, __pyx_n_s_ipv4_piece, __pyx_n_s_number, __pyx_n_s_swaps); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__96); - __Pyx_GIVEREF(__pyx_tuple__96); - __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv6, 683, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_tuple__92 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_address, __pyx_n_s_piece_index, __pyx_n_s_compress, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_value, __pyx_n_s_length, __pyx_n_s_numbers_seen, __pyx_n_s_ipv4_piece, __pyx_n_s_number, __pyx_n_s_swaps); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv6, 683, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 683, __pyx_L1_error) /* "w3lib/_url.pyx":770 * @@ -22993,10 +22574,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * input: str, * percent_encode_set: _PercentEncodeSet, */ - __pyx_tuple__98 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__98); - __Pyx_GIVEREF(__pyx_tuple__98); - __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_utf_8_percent_encode, 770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_tuple__94 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_utf_8_percent_encode, 770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 770, __pyx_L1_error) /* "w3lib/_url.pyx":782 * @@ -23005,34 +22586,34 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: */ - __pyx_tuple__100 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__100); - __Pyx_GIVEREF(__pyx_tuple__100); - __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_opaque_host, 782, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_tuple__96 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_opaque_host, 782, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 782, __pyx_L1_error) /* "w3lib/_url.pyx":790 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< + * def _parse_ipv4_number(input: str) -> Tuple[int, bint]: # <<<<<<<<<<<<<< * if not input: * raise ValueError */ - __pyx_tuple__102 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_validation_error, __pyx_n_s_r); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 790, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__102); - __Pyx_GIVEREF(__pyx_tuple__102); - __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4_number, 790, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_tuple__98 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_validation_error, __pyx_n_s_r); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); + __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4_number, 790, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 790, __pyx_L1_error) /* "w3lib/_url.pyx":810 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< + * def _ends_in_number(input: str) -> bint: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and parts[-1] == "": */ - __pyx_tuple__104 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_last, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 810, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__104); - __Pyx_GIVEREF(__pyx_tuple__104); - __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_ends_in_number, 810, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 810, __pyx_L1_error) + __pyx_tuple__100 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_last, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 810, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); + __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_ends_in_number, 810, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 810, __pyx_L1_error) /* "w3lib/_url.pyx":827 * @@ -23041,22 +22622,22 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * parts = input.split(".") * if parts and not parts[-1]: */ - __pyx_tuple__106 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_numbers, __pyx_n_s_part, __pyx_n_s_result, __pyx_n_s_ipv4, __pyx_n_s_counter, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__106); - __Pyx_GIVEREF(__pyx_tuple__106); - __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4, 827, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 827, __pyx_L1_error) + __pyx_tuple__102 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_numbers, __pyx_n_s_part, __pyx_n_s_result, __pyx_n_s_ipv4, __pyx_n_s_counter, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__102); + __Pyx_GIVEREF(__pyx_tuple__102); + __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4, 827, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 827, __pyx_L1_error) /* "w3lib/_url.pyx":850 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< + * def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: # <<<<<<<<<<<<<< * result = _utr46._to_ascii( * domain, */ - __pyx_tuple__108 = PyTuple_Pack(3, __pyx_n_s_domain, __pyx_n_s_be_strict, __pyx_n_s_result); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__108); - __Pyx_GIVEREF(__pyx_tuple__108); - __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_domain_to_ascii, 850, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_tuple__104 = PyTuple_Pack(3, __pyx_n_s_domain, __pyx_n_s_be_strict, __pyx_n_s_result); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__104); + __Pyx_GIVEREF(__pyx_tuple__104); + __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_domain_to_ascii, 850, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 850, __pyx_L1_error) /* "w3lib/_url.pyx":869 * @@ -23065,52 +22646,52 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * input: str, * url: _URL, */ - __pyx_tuple__110 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_url, __pyx_n_s_domain, __pyx_n_s_ascii_domain, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 869, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__110); - __Pyx_GIVEREF(__pyx_tuple__110); - __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_host, 869, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 869, __pyx_L1_error) + __pyx_tuple__106 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_url, __pyx_n_s_domain, __pyx_n_s_ascii_domain, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 869, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__106); + __Pyx_GIVEREF(__pyx_tuple__106); + __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_host, 869, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 869, __pyx_L1_error) /* "w3lib/_url.pyx":898 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter - * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * def _is_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * */ - __pyx_tuple__112 = PyTuple_Pack(1, __pyx_n_s_input); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 898, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__112); - __Pyx_GIVEREF(__pyx_tuple__112); - __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_windows_drive_letter, 898, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 898, __pyx_L1_error) + __pyx_tuple__108 = PyTuple_Pack(1, __pyx_n_s_input); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__108); + __Pyx_GIVEREF(__pyx_tuple__108); + __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_windows_drive_letter, 898, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 898, __pyx_L1_error) /* "w3lib/_url.pyx":903 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter - * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * def _starts_with_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< * input_length = len(input) * return ( */ - __pyx_tuple__114 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_input_length); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 903, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__114); - __Pyx_GIVEREF(__pyx_tuple__114); - __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_starts_with_windows_drive_lette, 903, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 903, __pyx_L1_error) + __pyx_tuple__110 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_input_length); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__110); + __Pyx_GIVEREF(__pyx_tuple__110); + __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_starts_with_windows_drive_lette, 903, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 903, __pyx_L1_error) /* "w3lib/_url.pyx":913 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment - * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * def _is_double_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< * return input in ( * "..", */ - __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_double_dot_path_segment, 913, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_double_dot_path_segment, 913, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 913, __pyx_L1_error) /* "w3lib/_url.pyx":928 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment - * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * def _is_single_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< * return input in ( * ".", */ - __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_single_dot_path_segment, 928, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 928, __pyx_L1_error) + __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_single_dot_path_segment, 928, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 928, __pyx_L1_error) /* "w3lib/_url.pyx":939 * # to be escaped, they are escaped in an idempotent way (i.e. if they are @@ -23119,10 +22700,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * *, input: str, pointer: int, encode_set: _PercentEncodeSet * ) -> str: */ - __pyx_tuple__118 = PyTuple_Pack(4, __pyx_n_s_input, __pyx_n_s_pointer, __pyx_n_s_encode_set, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__118); - __Pyx_GIVEREF(__pyx_tuple__118); - __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_idempotent_utf_8_percent_encode, 939, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_tuple__114 = PyTuple_Pack(4, __pyx_n_s_input, __pyx_n_s_pointer, __pyx_n_s_encode_set, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 939, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__114); + __Pyx_GIVEREF(__pyx_tuple__114); + __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_idempotent_utf_8_percent_encode, 939, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 939, __pyx_L1_error) /* "w3lib/_url.pyx":954 * @@ -23131,10 +22712,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) * */ - __pyx_tuple__120 = PyTuple_Pack(1, __pyx_n_s_url); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 954, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__120); - __Pyx_GIVEREF(__pyx_tuple__120); - __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_preprocess_url, 954, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 954, __pyx_L1_error) + __pyx_tuple__116 = PyTuple_Pack(1, __pyx_n_s_url); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 954, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__116); + __Pyx_GIVEREF(__pyx_tuple__116); + __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_preprocess_url, 954, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 954, __pyx_L1_error) /* "w3lib/_url.pyx":958 * @@ -23143,91 +22724,91 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * input: str, * encoding: str = "utf-8", */ - __pyx_tuple__122 = PyTuple_Pack(19, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_url, __pyx_n_s_state, __pyx_n_s_buffer, __pyx_n_s_at_sign_seen, __pyx_n_s_inside_brackets, __pyx_n_s_skip_authority_shortcut, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_reached_end, __pyx_n_s_c, __pyx_n_s_at_sign_index, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_encoded_code_points, __pyx_n_s_port, __pyx_n_s_encoded, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 958, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__122); - __Pyx_GIVEREF(__pyx_tuple__122); - __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_url, 958, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 958, __pyx_L1_error) + __pyx_tuple__118 = PyTuple_Pack(19, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_url, __pyx_n_s_state, __pyx_n_s_buffer, __pyx_n_s_at_sign_seen, __pyx_n_s_inside_brackets, __pyx_n_s_skip_authority_shortcut, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_reached_end, __pyx_n_s_c, __pyx_n_s_at_sign_index, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_encoded_code_points, __pyx_n_s_port, __pyx_n_s_encoded, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 958, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__118); + __Pyx_GIVEREF(__pyx_tuple__118); + __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_url, 958, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 958, __pyx_L1_error) - /* "w3lib/_url.pyx":1269 + /* "w3lib/_url.pyx":1268 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< * output = "" * n = address */ - __pyx_tuple__124 = PyTuple_Pack(4, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 1269, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__124); - __Pyx_GIVEREF(__pyx_tuple__124); - __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv4, 1269, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 1269, __pyx_L1_error) + __pyx_tuple__120 = PyTuple_Pack(4, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 1268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__120); + __Pyx_GIVEREF(__pyx_tuple__120); + __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv4, 1268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 1268, __pyx_L1_error) - /* "w3lib/_url.pyx":1280 + /* "w3lib/_url.pyx":1279 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: */ - __pyx_tuple__126 = PyTuple_Pack(7, __pyx_n_s_address, __pyx_n_s_min_length, __pyx_n_s_index, __pyx_n_s_index_length, __pyx_n_s_current_length, __pyx_n_s_current_index, __pyx_n_s_piece); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 1280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__126); - __Pyx_GIVEREF(__pyx_tuple__126); - __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_ipv6_first_longest_0_piece, 1280, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 1280, __pyx_L1_error) + __pyx_tuple__122 = PyTuple_Pack(7, __pyx_n_s_address, __pyx_n_s_min_length, __pyx_n_s_index, __pyx_n_s_index_length, __pyx_n_s_current_length, __pyx_n_s_current_index, __pyx_n_s_piece); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 1279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__122); + __Pyx_GIVEREF(__pyx_tuple__122); + __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_ipv6_first_longest_0_piece, 1279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 1279, __pyx_L1_error) - /* "w3lib/_url.pyx":1298 + /* "w3lib/_url.pyx":1297 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) */ - __pyx_tuple__128 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_compress, __pyx_n_s_ignore0, __pyx_n_s_piece_index, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 1298, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__128); - __Pyx_GIVEREF(__pyx_tuple__128); - __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv6, 1298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 1298, __pyx_L1_error) + __pyx_tuple__124 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_compress, __pyx_n_s_ignore0, __pyx_n_s_piece_index, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 1297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__124); + __Pyx_GIVEREF(__pyx_tuple__124); + __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv6, 1297, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 1297, __pyx_L1_error) - /* "w3lib/_url.pyx":1319 + /* "w3lib/_url.pyx":1318 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(url: _URL) -> str: # <<<<<<<<<<<<<< * if url._host_type == IPV4: * return _serialize_ipv4(url.ipv4) */ - __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_host, 1319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_host, 1318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 1318, __pyx_L1_error) - /* "w3lib/_url.pyx":1328 + /* "w3lib/_url.pyx":1327 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL) -> str: # <<<<<<<<<<<<<< * if url.opaque_path: * assert isinstance(url.path, str) */ - __pyx_tuple__131 = PyTuple_Pack(3, __pyx_n_s_url, __pyx_n_s_output, __pyx_n_s_segment); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 1328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__131); - __Pyx_GIVEREF(__pyx_tuple__131); - __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url_path, 1328, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_tuple__127 = PyTuple_Pack(3, __pyx_n_s_url, __pyx_n_s_output, __pyx_n_s_segment); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 1327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__127); + __Pyx_GIVEREF(__pyx_tuple__127); + __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url_path, 1327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 1327, __pyx_L1_error) - /* "w3lib/_url.pyx":1341 + /* "w3lib/_url.pyx":1340 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url(url: _URL) -> str: # <<<<<<<<<<<<<< * """Return a string representation of *url* following the URL serialization * algorithm defined in the `URL living standard`_. */ - __pyx_tuple__133 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_output); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 1341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__133); - __Pyx_GIVEREF(__pyx_tuple__133); - __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url, 1341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 1341, __pyx_L1_error) + __pyx_tuple__129 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_output); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 1340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__129); + __Pyx_GIVEREF(__pyx_tuple__129); + __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url, 1340, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 1340, __pyx_L1_error) - /* "w3lib/_url.pyx":1376 + /* "w3lib/_url.pyx":1375 * * * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< * url = _parse_url(input, encoding) * return _serialize_url(url) */ - __pyx_tuple__135 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_url); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 1376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__135); - __Pyx_GIVEREF(__pyx_tuple__135); - __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_safe_url, 1376, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 1376, __pyx_L1_error) + __pyx_tuple__131 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_url); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 1375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__131); + __Pyx_GIVEREF(__pyx_tuple__131); + __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_safe_url, 1375, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -23252,7 +22833,6 @@ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_80 = PyInt_FromLong(80); if (unlikely(!__pyx_int_80)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -24218,7 +23798,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_last_digit, __pyx_n_s_int) < 0) __PYX_ERR(0, 45, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Dict_str_str) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_1_short_windows_125, 0, __pyx_n_s_short_windows_125, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_1_short_windows_125, 0, __pyx_n_s_short_windows_125, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -24287,7 +23867,7 @@ if (!__Pyx_RefNanny) { * "unicode-1-1-utf-8", * "unicode11utf8", */ - __pyx_t_2 = __pyx_tuple__29; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__28; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 6) break; @@ -24354,7 +23934,7 @@ if (!__Pyx_RefNanny) { * "866", * "cp866", */ - __pyx_t_2 = __pyx_tuple__30; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__29; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 4) break; @@ -24420,7 +24000,7 @@ if (!__Pyx_RefNanny) { * "csisolatin2", * "iso-8859-2", */ - __pyx_t_2 = __pyx_tuple__31; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__30; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 9) break; @@ -24486,7 +24066,7 @@ if (!__Pyx_RefNanny) { * "csisolatin3", * "iso-8859-3", */ - __pyx_t_2 = __pyx_tuple__32; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__31; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 9) break; @@ -24552,7 +24132,7 @@ if (!__Pyx_RefNanny) { * "csisolatin4", * "iso-8859-4", */ - __pyx_t_2 = __pyx_tuple__33; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__32; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 9) break; @@ -24618,7 +24198,7 @@ if (!__Pyx_RefNanny) { * "csisolatincyrillic", * "cyrillic", */ - __pyx_t_2 = __pyx_tuple__34; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__33; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 8) break; @@ -24684,7 +24264,7 @@ if (!__Pyx_RefNanny) { * "arabic", * "asmo-708", */ - __pyx_t_2 = __pyx_tuple__35; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__34; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 14) break; @@ -24750,7 +24330,7 @@ if (!__Pyx_RefNanny) { * "csisolatingreek", * "ecma-118", */ - __pyx_t_2 = __pyx_tuple__36; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__35; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 12) break; @@ -24816,7 +24396,7 @@ if (!__Pyx_RefNanny) { * "csiso88598e", * "csisolatinhebrew", */ - __pyx_t_2 = __pyx_tuple__37; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__36; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 11) break; @@ -24882,7 +24462,7 @@ if (!__Pyx_RefNanny) { * "csiso88598i", * "iso-8859-8-i", */ - __pyx_t_2 = __pyx_tuple__38; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__37; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 3) break; @@ -24948,7 +24528,7 @@ if (!__Pyx_RefNanny) { * "csisolatin6", * "iso-8859-10", */ - __pyx_t_2 = __pyx_tuple__39; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__38; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 7) break; @@ -25014,7 +24594,7 @@ if (!__Pyx_RefNanny) { * "csisolatin6", * "iso-8859-10", */ - __pyx_t_2 = __pyx_tuple__39; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__38; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 7) break; @@ -25080,7 +24660,7 @@ if (!__Pyx_RefNanny) { * "iso-8859-13", * "iso8859-13", */ - __pyx_t_2 = __pyx_tuple__40; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__39; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 3) break; @@ -25146,7 +24726,7 @@ if (!__Pyx_RefNanny) { * "iso-8859-14", * "iso8859-14", */ - __pyx_t_2 = __pyx_tuple__41; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__40; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 3) break; @@ -25212,7 +24792,7 @@ if (!__Pyx_RefNanny) { * "csisolatin9", * "iso-8859-15", */ - __pyx_t_2 = __pyx_tuple__42; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__41; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 6) break; @@ -25279,7 +24859,7 @@ if (!__Pyx_RefNanny) { * "cskoi8r", * "koi", */ - __pyx_t_2 = __pyx_tuple__43; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__42; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 5) break; @@ -25345,7 +24925,7 @@ if (!__Pyx_RefNanny) { * "koi8-ru", * "koi8-u", */ - __pyx_t_2 = __pyx_tuple__44; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__43; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 2) break; @@ -25411,7 +24991,7 @@ if (!__Pyx_RefNanny) { * "csmacintosh", * "mac", */ - __pyx_t_2 = __pyx_tuple__45; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__44; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 4) break; @@ -25477,7 +25057,7 @@ if (!__Pyx_RefNanny) { * "dos-874", * "iso-8859-11", */ - __pyx_t_2 = __pyx_tuple__46; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__45; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 6) break; @@ -25534,7 +25114,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2 == Py_None)) { @@ -25556,7 +25136,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3 == Py_None)) { @@ -25587,7 +25167,7 @@ if (!__Pyx_RefNanny) { * "ansi_x3.4-1968", * "ascii", */ - __pyx_t_2 = __pyx_tuple__49; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = __pyx_tuple__48; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 17) break; @@ -25644,7 +25224,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2 == Py_None)) { @@ -25675,7 +25255,7 @@ if (!__Pyx_RefNanny) { * "cp1254", * "csisolatin5", */ - __pyx_t_3 = __pyx_tuple__51; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__50; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 12) break; @@ -25732,7 +25312,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3 == Py_None)) { @@ -25754,7 +25334,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2 == Py_None)) { @@ -25776,7 +25356,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3 == Py_None)) { @@ -25798,7 +25378,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_short_windows_125); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2 == Py_None)) { @@ -25829,7 +25409,7 @@ if (!__Pyx_RefNanny) { * "x-mac-cyrillic", * "x-mac-ukrainian", */ - __pyx_t_3 = __pyx_tuple__56; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__55; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 2) break; @@ -25895,7 +25475,7 @@ if (!__Pyx_RefNanny) { * "chinese", * "csgb2312", */ - __pyx_t_3 = __pyx_tuple__57; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__56; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 9) break; @@ -25962,7 +25542,7 @@ if (!__Pyx_RefNanny) { * "big5", * "big5-hkscs", */ - __pyx_t_3 = __pyx_tuple__58; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__57; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 5) break; @@ -26028,7 +25608,7 @@ if (!__Pyx_RefNanny) { * "cseucpkdfmtjapanese", * "euc-jp", */ - __pyx_t_3 = __pyx_tuple__59; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__58; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 3) break; @@ -26094,7 +25674,7 @@ if (!__Pyx_RefNanny) { * "csiso2022jp", * "iso-2022-jp", */ - __pyx_t_3 = __pyx_tuple__60; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__59; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 2) break; @@ -26160,7 +25740,7 @@ if (!__Pyx_RefNanny) { * "csshiftjis", * "ms932", */ - __pyx_t_3 = __pyx_tuple__61; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__60; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 8) break; @@ -26226,7 +25806,7 @@ if (!__Pyx_RefNanny) { * "cseuckr", * "csksc56011987", */ - __pyx_t_3 = __pyx_tuple__62; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__61; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 10) break; @@ -26292,7 +25872,7 @@ if (!__Pyx_RefNanny) { * "csiso2022kr", * "hz-gb-2312", */ - __pyx_t_3 = __pyx_tuple__63; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__62; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 6) break; @@ -26361,7 +25941,7 @@ if (!__Pyx_RefNanny) { * "unicodefffe", * "utf-16be", */ - __pyx_t_3 = __pyx_tuple__64; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__63; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 2) break; @@ -26430,7 +26010,7 @@ if (!__Pyx_RefNanny) { * "csunicode", * "iso-10646-ucs-2", */ - __pyx_t_3 = __pyx_tuple__65; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __pyx_tuple__64; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { if (__pyx_t_7 >= 7) break; @@ -26504,7 +26084,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 446, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_EncodeFunction) < 0) __PYX_ERR(0, 446, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_3_get_encoder, 0, __pyx_n_s_get_encoder, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_3_get_encoder, 0, __pyx_n_s_get_encoder, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -26524,7 +26104,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTF_8_ENCODER, __pyx_t_6) < 0) __PYX_ERR(0, 452, __pyx_L1_error) @@ -26550,7 +26130,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_label, __pyx_n_s_str) < 0) __PYX_ERR(0, 456, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 456, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_5_get_encoding, 0, __pyx_n_s_get_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_5_get_encoding, 0, __pyx_n_s_get_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -26961,31 +26541,31 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_scheme, __pyx_n_s_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_username, __pyx_n_s_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_password, __pyx_n_s_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_password_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_password_token_seen, __pyx_n_s_bint) < 0) __PYX_ERR(0, 528, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_host_type, __pyx_n_s_uchar) < 0) __PYX_ERR(0, 528, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hostname, __pyx_n_s_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ipv4, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 528, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ipv6, __pyx_kp_s_cython_int_8) < 0) __PYX_ERR(0, 528, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_port, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 528, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_port_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_port_token_seen, __pyx_n_s_bint) < 0) __PYX_ERR(0, 528, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path, __pyx_kp_s_List_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_path_token_seen, __pyx_n_s_bint) < 0) __PYX_ERR(0, 528, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_opaque_path, __pyx_n_s_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query, __pyx_n_s_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query_token_seen, __pyx_n_s_bint) < 0) __PYX_ERR(0, 528, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fragment, __pyx_n_s_str) < 0) __PYX_ERR(0, 528, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fragment_token_seen, __pyx_n_s_bool) < 0) __PYX_ERR(0, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fragment_token_seen, __pyx_n_s_bint) < 0) __PYX_ERR(0, 528, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_annotations, __pyx_t_4) < 0) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "w3lib/_url.pyx":547 - * _fragment_token_seen: bool + * _fragment_token_seen: bint * * def __init__(self): # <<<<<<<<<<<<<< * self.scheme = "" * self.username = "" */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_1__init__, 0, __pyx_n_s_URL___init, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_4_URL_1__init__, 0, __pyx_n_s_URL___init, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -27012,7 +26592,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHANUMERIC); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__73); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__72); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCHEME_CHARS, __pyx_t_4) < 0) __PYX_ERR(0, 567, __pyx_L1_error) @@ -27029,39 +26609,13 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 571, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 571, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_7_shorten_path, 0, __pyx_n_s_shorten_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_7_shorten_path, 0, __pyx_n_s_shorten_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_shorten_path, __pyx_t_6) < 0) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":580 - * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode - * # Extended to handled cases where % is to be percent-encoded. - * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< - * input: str, - * *, - */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_space_as_plus, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_space_as_plus, __pyx_n_s_bool) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_9_percent_encode_after_encoding, 0, __pyx_n_s_percent_encode_after_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_3, __pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_percent_encode_after_encoding, __pyx_t_3) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":615 * * @@ -27069,8 +26623,8 @@ if (!__Pyx_RefNanny) { * _C0_CONTROL, * greater_than="~", */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); /* "w3lib/_url.pyx":616 * @@ -27089,10 +26643,10 @@ if (!__Pyx_RefNanny) { * _C0_CONTROL, * greater_than="~", */ - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error); __pyx_t_4 = 0; /* "w3lib/_url.pyx":617 @@ -27104,7 +26658,7 @@ if (!__Pyx_RefNanny) { */ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_greater_than, __pyx_kp_u__79) < 0) __PYX_ERR(0, 617, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_greater_than, __pyx_kp_u__75) < 0) __PYX_ERR(0, 617, __pyx_L1_error) /* "w3lib/_url.pyx":615 * @@ -27113,10 +26667,10 @@ if (!__Pyx_RefNanny) { * _C0_CONTROL, * greater_than="~", */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27130,7 +26684,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__80); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__76); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 619, __pyx_L1_error) @@ -27145,7 +26699,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__81); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__77); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 620, __pyx_L1_error) @@ -27160,7 +26714,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__82); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__78); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_t_4) < 0) __PYX_ERR(0, 621, __pyx_L1_error) @@ -27175,7 +26729,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__83); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__79); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 622, __pyx_L1_error) @@ -27190,7 +26744,7 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__84); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__80); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 623, __pyx_L1_error) @@ -27203,7 +26757,7 @@ if (!__Pyx_RefNanny) { * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_GEN_DELIMS, __pyx_kp_b__85) < 0) __PYX_ERR(0, 626, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_GEN_DELIMS, __pyx_kp_b__81) < 0) __PYX_ERR(0, 626, __pyx_L1_error) /* "w3lib/_url.pyx":627 * # constants from RFC 3986, Section 2.2 and 2.3 @@ -27212,7 +26766,7 @@ if (!__Pyx_RefNanny) { * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_SUB_DELIMS, __pyx_kp_b__86) < 0) __PYX_ERR(0, 627, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_SUB_DELIMS, __pyx_kp_b__82) < 0) __PYX_ERR(0, 627, __pyx_L1_error) /* "w3lib/_url.pyx":628 * RFC3986_GEN_DELIMS = b":/?#[]@" @@ -27225,12 +26779,12 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RFC3986_SUB_DELIMS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 628, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_RESERVED, __pyx_t_6) < 0) __PYX_ERR(0, 628, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_RESERVED, __pyx_t_3) < 0) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "w3lib/_url.pyx":629 * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" @@ -27239,29 +26793,29 @@ if (!__Pyx_RefNanny) { * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_string); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascii_letters); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascii_letters); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_string); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_digits); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_digits); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__87); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__83); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_UNRESERVED, __pyx_t_4) < 0) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -27272,7 +26826,7 @@ if (!__Pyx_RefNanny) { * * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRA_SAFE_CHARS, __pyx_kp_b__89) < 0) __PYX_ERR(0, 630, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRA_SAFE_CHARS, __pyx_kp_b__85) < 0) __PYX_ERR(0, 630, __pyx_L1_error) /* "w3lib/_url.pyx":632 * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 @@ -27283,17 +26837,17 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RFC3986_UNRESERVED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_SUB_DELIMS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_SUB_DELIMS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_kp_b__5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_b__4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_USERINFO_SAFE_CHARS, __pyx_t_6) < 0) __PYX_ERR(0, 632, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_USERINFO_SAFE_CHARS, __pyx_t_3) < 0) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "w3lib/_url.pyx":633 * @@ -27302,23 +26856,23 @@ if (!__Pyx_RefNanny) { * _path_safe_chars = _safe_chars.replace(b"#", b"") * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_RESERVED); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_RESERVED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RFC3986_UNRESERVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EXTRA_SAFE_CHARS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_b__3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_chars, __pyx_t_2) < 0) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27331,12 +26885,12 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_safe_chars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_replace); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_path_safe_chars, __pyx_t_2) < 0) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27349,15 +26903,15 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RFC3986_USERINFO_SAFE_CHARS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_translate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_translate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_delete, __pyx_kp_b__92) < 0) __PYX_ERR(0, 646, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__91, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_delete, __pyx_kp_b__88) < 0) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__87, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_SAFEST_CHARS, __pyx_t_4) < 0) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -27376,13 +26930,13 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_delete, __pyx_kp_b__93) < 0) __PYX_ERR(0, 647, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__91, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_delete, __pyx_kp_b__89) < 0) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__87, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_SAFEST_CHARS, __pyx_t_6) < 0) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_SAFEST_CHARS, __pyx_t_3) < 0) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "w3lib/_url.pyx":648 * _USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") @@ -27391,10 +26945,10 @@ if (!__Pyx_RefNanny) { * _SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") * _FRAGMENT_SAFEST_CHARS = _PATH_SAFEST_CHARS */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_SAFEST_CHARS, __pyx_t_6) < 0) __PYX_ERR(0, 648, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_SAFEST_CHARS, __pyx_t_3) < 0) __PYX_ERR(0, 648, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "w3lib/_url.pyx":649 * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") @@ -27403,18 +26957,18 @@ if (!__Pyx_RefNanny) { * _FRAGMENT_SAFEST_CHARS = _PATH_SAFEST_CHARS * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_translate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_translate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_delete, __pyx_kp_b__82) < 0) __PYX_ERR(0, 649, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__91, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_delete, __pyx_kp_b__78) < 0) __PYX_ERR(0, 649, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__87, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS, __pyx_t_2) < 0) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27447,12 +27001,12 @@ if (!__Pyx_RefNanny) { * | _RFC2396_USERINFO_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "w3lib/_url.pyx":655 * _USERINFO_PERCENT_ENCODE_SET @@ -27461,12 +27015,12 @@ if (!__Pyx_RefNanny) { * ) * _SAFE_PATH_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27487,12 +27041,12 @@ if (!__Pyx_RefNanny) { * | _RFC2396_ABS_PATH_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "w3lib/_url.pyx":660 * _PATH_PERCENT_ENCODE_SET @@ -27501,12 +27055,12 @@ if (!__Pyx_RefNanny) { * ) * _SAFE_QUERY_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27527,12 +27081,12 @@ if (!__Pyx_RefNanny) { * | _RFC2396_QUERY_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "w3lib/_url.pyx":665 * _QUERY_PERCENT_ENCODE_SET @@ -27541,12 +27095,12 @@ if (!__Pyx_RefNanny) { * ) * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27567,12 +27121,12 @@ if (!__Pyx_RefNanny) { * | _RFC2396_QUERY_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "w3lib/_url.pyx":670 * _SPECIAL_QUERY_PERCENT_ENCODE_SET @@ -27581,12 +27135,12 @@ if (!__Pyx_RefNanny) { * ) * _SAFE_FRAGMENT_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO, __pyx_t_2) < 0) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27607,12 +27161,12 @@ if (!__Pyx_RefNanny) { * | _RFC2396_FRAGMENT_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 674, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "w3lib/_url.pyx":675 * _FRAGMENT_PERCENT_ENCODE_SET @@ -27621,12 +27175,12 @@ if (!__Pyx_RefNanny) { * ) * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE, __pyx_t_2) < 0) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27637,7 +27191,7 @@ if (!__Pyx_RefNanny) { * _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_kp_u__94) < 0) __PYX_ERR(0, 679, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_kp_u__90) < 0) __PYX_ERR(0, 679, __pyx_L1_error) /* "w3lib/_url.pyx":680 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point @@ -27648,17 +27202,17 @@ if (!__Pyx_RefNanny) { */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__95); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__91); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_t_6) < 0) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_t_3) < 0) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "w3lib/_url.pyx":683 * @@ -27667,14 +27221,14 @@ if (!__Pyx_RefNanny) { * address = [0] * 8 * piece_index = 0 */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 683, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 683, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_11_parse_ipv6, 0, __pyx_n_s_parse_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 683, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_9_parse_ipv6, 0, __pyx_n_s_parse_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -27690,12 +27244,12 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 770, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 770, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 770, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_13_utf_8_percent_encode, 0, __pyx_n_s_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_11_utf_8_percent_encode, 0, __pyx_n_s_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf_8_percent_encode, __pyx_t_6) < 0) __PYX_ERR(0, 770, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf_8_percent_encode, __pyx_t_3) < 0) __PYX_ERR(0, 770, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "w3lib/_url.pyx":782 * @@ -27704,50 +27258,50 @@ if (!__Pyx_RefNanny) { * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 782, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 782, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_15_parse_opaque_host, 0, __pyx_n_s_parse_opaque_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 782, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_13_parse_opaque_host, 0, __pyx_n_s_parse_opaque_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_opaque_host, __pyx_t_4) < 0) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "w3lib/_url.pyx":790 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser - * def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # <<<<<<<<<<<<<< + * def _parse_ipv4_number(input: str) -> Tuple[int, bint]: # <<<<<<<<<<<<<< * if not input: * raise ValueError */ __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 790, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Tuple_int_bool) < 0) __PYX_ERR(0, 790, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_17_parse_ipv4_number, 0, __pyx_n_s_parse_ipv4_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 790, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Tuple_int_bint) < 0) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_15_parse_ipv4_number, 0, __pyx_n_s_parse_ipv4_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4_number, __pyx_t_6) < 0) __PYX_ERR(0, 790, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4_number, __pyx_t_3) < 0) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "w3lib/_url.pyx":810 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker - * def _ends_in_number(input: str) -> bool: # <<<<<<<<<<<<<< + * def _ends_in_number(input: str) -> bint: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and parts[-1] == "": */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 810, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 810, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 810, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_19_ends_in_number, 0, __pyx_n_s_ends_in_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 810, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 810, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 810, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 810, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_17_ends_in_number, 0, __pyx_n_s_ends_in_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_ends_in_number, __pyx_t_4) < 0) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -27762,33 +27316,36 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 827, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 827, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_21_parse_ipv4, 0, __pyx_n_s_parse_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_19_parse_ipv4, 0, __pyx_n_s_parse_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4, __pyx_t_6) < 0) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4, __pyx_t_3) < 0) __PYX_ERR(0, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "w3lib/_url.pyx":850 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii - * def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: # <<<<<<<<<<<<<< + * def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: # <<<<<<<<<<<<<< * result = _utr46._to_ascii( * domain, */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_be_strict, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_be_strict, __pyx_t_4) < 0) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domain, __pyx_n_s_str) < 0) __PYX_ERR(0, 850, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_be_strict, __pyx_n_s_bool) < 0) __PYX_ERR(0, 850, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_be_strict, __pyx_n_s_bint) < 0) __PYX_ERR(0, 850, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 850, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_23_domain_to_ascii, 0, __pyx_n_s_domain_to_ascii, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_21_domain_to_ascii, 0, __pyx_n_s_domain_to_ascii, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_6); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_domain_to_ascii, __pyx_t_2) < 0) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27805,7 +27362,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 869, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 869, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 869, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_25_parse_host, 0, __pyx_n_s_parse_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_23_parse_host, 0, __pyx_n_s_parse_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27815,15 +27372,15 @@ if (!__Pyx_RefNanny) { /* "w3lib/_url.pyx":898 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter - * def _is_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * def _is_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 898, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 898, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_27_is_windows_drive_letter, 0, __pyx_n_s_is_windows_drive_letter, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 898, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_25_is_windows_drive_letter, 0, __pyx_n_s_is_windows_drive_letter, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -27833,15 +27390,15 @@ if (!__Pyx_RefNanny) { /* "w3lib/_url.pyx":903 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter - * def _starts_with_windows_drive_letter(input: str) -> bool: # <<<<<<<<<<<<<< + * def _starts_with_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< * input_length = len(input) * return ( */ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 903, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 903, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_29_starts_with_windows_drive_letter, 0, __pyx_n_s_starts_with_windows_drive_lette, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 903, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 903, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_27_starts_with_windows_drive_letter, 0, __pyx_n_s_starts_with_windows_drive_lette, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27851,15 +27408,15 @@ if (!__Pyx_RefNanny) { /* "w3lib/_url.pyx":913 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment - * def _is_double_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * def _is_double_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< * return input in ( * "..", */ __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 913, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 913, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_31_is_double_dot_path_segment, 0, __pyx_n_s_is_double_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_29_is_double_dot_path_segment, 0, __pyx_n_s_is_double_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -27869,15 +27426,15 @@ if (!__Pyx_RefNanny) { /* "w3lib/_url.pyx":928 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment - * def _is_single_dot_path_segment(input: str) -> bool: # <<<<<<<<<<<<<< + * def _is_single_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< * return input in ( * ".", */ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 928, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 928, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_33_is_single_dot_path_segment, 0, __pyx_n_s_is_single_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 928, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_31_is_single_dot_path_segment, 0, __pyx_n_s_is_single_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27897,7 +27454,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pointer, __pyx_n_s_int) < 0) __PYX_ERR(0, 939, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 939, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 939, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_35_idempotent_utf_8_percent_encode, 0, __pyx_n_s_idempotent_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_33_idempotent_utf_8_percent_encode, 0, __pyx_n_s_idempotent_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -27915,7 +27472,7 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_url, __pyx_n_s_str) < 0) __PYX_ERR(0, 954, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 954, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_37_preprocess_url, 0, __pyx_n_s_preprocess_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_35_preprocess_url, 0, __pyx_n_s_preprocess_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27934,154 +27491,154 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 958, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 958, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 958, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_39_parse_url, 0, __pyx_n_s_parse_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_37_parse_url, 0, __pyx_n_s_parse_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__68); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__67); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_url, __pyx_t_2) < 0) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1269 + /* "w3lib/_url.pyx":1268 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< * output = "" * n = address */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1269, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_address, __pyx_n_s_int) < 0) __PYX_ERR(0, 1269, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1269, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_41_serialize_ipv4, 0, __pyx_n_s_serialize_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1269, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_address, __pyx_n_s_int) < 0) __PYX_ERR(0, 1268, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1268, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_39_serialize_ipv4, 0, __pyx_n_s_serialize_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv4, __pyx_t_4) < 0) __PYX_ERR(0, 1269, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv4, __pyx_t_4) < 0) __PYX_ERR(0, 1268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1280 + /* "w3lib/_url.pyx":1279 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1280, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1280, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_min_length, __pyx_n_s_int) < 0) __PYX_ERR(0, 1280, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 1280, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index, 0, __pyx_n_s_get_ipv6_first_longest_0_piece, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_min_length, __pyx_n_s_int) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index, 0, __pyx_n_s_get_ipv6_first_longest_0_piece, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 1280, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 1279, __pyx_L1_error) - /* "w3lib/_url.pyx":1281 + /* "w3lib/_url.pyx":1280 * * def _get_ipv6_first_longest_0_piece_index( * address: List[int], *, min_length: int = 2 # <<<<<<<<<<<<<< * ) -> Optional[int]: * index = None */ - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_2))) __PYX_ERR(0, 1281, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_2))) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_INCREF(__pyx_int_2); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_2)->__pyx_arg_min_length = ((PyObject*)__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_5w3lib_4_url_54__defaults__); + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_5w3lib_4_url_52__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_t_2) < 0) __PYX_ERR(0, 1280, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_t_2) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1298 + /* "w3lib/_url.pyx":1297 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1298, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1298, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_45_serialize_ipv6, 0, __pyx_n_s_serialize_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1298, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1297, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_43_serialize_ipv6, 0, __pyx_n_s_serialize_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 1298, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1319 + /* "w3lib/_url.pyx":1318 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(url: _URL) -> str: # <<<<<<<<<<<<<< * if url._host_type == IPV4: * return _serialize_ipv4(url.ipv4) */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1319, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1319, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_47_serialize_host, 0, __pyx_n_s_serialize_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1318, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_45_serialize_host, 0, __pyx_n_s_serialize_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_host, __pyx_t_2) < 0) __PYX_ERR(0, 1319, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_host, __pyx_t_2) < 0) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1328 + /* "w3lib/_url.pyx":1327 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL) -> str: # <<<<<<<<<<<<<< * if url.opaque_path: * assert isinstance(url.path, str) */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1328, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1328, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_49_serialize_url_path, 0, __pyx_n_s_serialize_url_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1328, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1327, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1327, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_47_serialize_url_path, 0, __pyx_n_s_serialize_url_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url_path, __pyx_t_4) < 0) __PYX_ERR(0, 1328, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url_path, __pyx_t_4) < 0) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1341 + /* "w3lib/_url.pyx":1340 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url(url: _URL) -> str: # <<<<<<<<<<<<<< * """Return a string representation of *url* following the URL serialization * algorithm defined in the `URL living standard`_. */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1341, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1341, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1341, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_51_serialize_url, 0, __pyx_n_s_serialize_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1340, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1340, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_49_serialize_url, 0, __pyx_n_s_serialize_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url, __pyx_t_2) < 0) __PYX_ERR(0, 1341, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url, __pyx_t_2) < 0) __PYX_ERR(0, 1340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1376 + /* "w3lib/_url.pyx":1375 * * * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< * url = _parse_url(input, encoding) * return _serialize_url(url) */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 1376, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 1376, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1376, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_53_safe_url, 0, __pyx_n_s_safe_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1376, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 1375, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 1375, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1375, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_51_safe_url, 0, __pyx_n_s_safe_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_url, __pyx_t_4) < 0) __PYX_ERR(0, 1376, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_url, __pyx_t_4) < 0) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "w3lib/_url.pyx":1 @@ -29884,17 +29441,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, return NULL; } -/* RaiseKeywordRequired */ -static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name) { - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() needs keyword-only argument %U", func_name, kw_name); - #else - "%s() needs keyword-only argument %s", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, @@ -29981,79 +29527,7 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { } return __Pyx_PyObject_GetItem_Slow(obj, key); } -#endif - -/* PyIntCompare */ -static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { - CYTHON_MAYBE_UNUSED_VAR(intval); - CYTHON_UNUSED_VAR(inplace); - if (op1 == op2) { - return 1; - } - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long a = PyInt_AS_LONG(op1); - return (a == b); - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - int unequal; - unsigned long uintval; - Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); - const digit* digits = __Pyx_PyLong_Digits(op1); - if (intval == 0) { - return (__Pyx_PyLong_IsZero(op1) == 1); - } else if (intval < 0) { - if (__Pyx_PyLong_IsNonNeg(op1)) - return 0; - intval = -intval; - } else { - if (__Pyx_PyLong_IsNeg(op1)) - return 0; - } - uintval = (unsigned long) intval; -#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 4)) { - unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 3)) { - unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 2)) { - unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 1)) { - unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif - unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); - return (unequal == 0); - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif - return ((double)a == (double)b); - } - return __Pyx_PyObject_IsTrueAndDecref( - PyObject_RichCompare(op1, op2, Py_EQ)); -} +#endif /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY @@ -30224,6 +29698,78 @@ static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) { } #endif +/* PyIntCompare */ +static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_UNUSED_VAR(inplace); + if (op1 == op2) { + return 1; + } + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + return (a == b); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + if (intval == 0) { + return (__Pyx_PyLong_IsZero(op1) == 1); + } else if (intval < 0) { + if (__Pyx_PyLong_IsNonNeg(op1)) + return 0; + intval = -intval; + } else { + if (__Pyx_PyLong_IsNeg(op1)) + return 0; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + return (unequal == 0); + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + return ((double)a == (double)b); + } + return __Pyx_PyObject_IsTrueAndDecref( + PyObject_RichCompare(op1, op2, Py_EQ)); +} + /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { @@ -30942,6 +30488,17 @@ static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr, return (int) PyUnicode_Tailmatch(s, substr, start, end, direction); } +/* RaiseKeywordRequired */ +static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name) { + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() needs keyword-only argument %U", func_name, kw_name); + #else + "%s() needs keyword-only argument %s", func_name, + PyString_AS_STRING(kw_name)); + #endif +} + /* CIntToDigits */ static const char DIGIT_PAIRS_10[2*10*10+1] = { "00010203040506070809" @@ -31920,7 +31477,7 @@ static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject * #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__26; + PyObject *module, *from_list, *star = __pyx_n_s__25; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) @@ -31983,7 +31540,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__6); + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__5); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } @@ -33859,6 +33416,28 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } #endif +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + /* PyUCS4InUnicode */ #if PY_VERSION_HEX < 0x03090000 || (defined(PyUnicode_WCHAR_KIND) && defined(PyUnicode_AS_UNICODE)) #if PY_VERSION_HEX < 0x03090000 @@ -33928,28 +33507,6 @@ static CYTHON_INLINE int __Pyx_UnicodeContainsUCS4(PyObject* unicode, Py_UCS4 ch #endif } -/* CIntFromPyVerify */ -#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC @@ -34078,6 +33635,70 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char valu } } +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC @@ -34351,70 +33972,6 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { return (int) -1; } -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int neg_one = (int) -1, const_zero = (int) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); -#else - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); - if (!from_bytes) return NULL; - py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); - if (!py_bytes) goto limited_bad; - order_str = PyUnicode_FromString(little ? "little" : "big"); - if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; - } - result = PyObject_Call(from_bytes, arg_tuple, kwds); - limited_bad: - Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); - Py_XDECREF(order_str); - Py_XDECREF(py_bytes); - Py_XDECREF(from_bytes); - return result; -#endif - } -} - /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC @@ -34698,7 +34255,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__19); + name = __Pyx_NewRef(__pyx_n_s__18); } return name; } diff --git a/w3lib/_url.pyx b/w3lib/_url.pyx index 5c25fe95..ac3ed893 100644 --- a/w3lib/_url.pyx +++ b/w3lib/_url.pyx @@ -529,20 +529,20 @@ class _URL: scheme: str username: str password: str - _password_token_seen: bool + _password_token_seen: bint _host_type: uchar hostname: str ipv4: cython.int ipv6: cython.int[8] port: cython.int - _port_token_seen: bool + _port_token_seen: bint path: List[str] - _path_token_seen: bool + _path_token_seen: bint opaque_path: str query: str - _query_token_seen: bool + _query_token_seen: bint fragment: str - _fragment_token_seen: bool + _fragment_token_seen: bint def __init__(self): self.scheme = "" @@ -577,31 +577,31 @@ def _shorten_path(url: _URL) -> None: # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode # Extended to handled cases where % is to be percent-encoded. +@cfunc def _percent_encode_after_encoding( input: str, *, encoding: str, percent_encode_set: _PercentEncodeSet, - space_as_plus: bool = False, ) -> str: encoder = _get_encoder(encoding) output = "" # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B # instead of &#NNN; encode_output, _ = encoder(input, "xmlcharrefreplace") - for i in range(len(encode_output)): # pylint: disable=consider-using-enumerate + encode_output_length: cython.int = len(encode_output) + for i in range(encode_output_length): # pylint: disable=consider-using-enumerate byte = encode_output[i] - if space_as_plus and byte == 0x20: - output += "+" - continue isomorph = chr(byte) if isomorph not in percent_encode_set: output += isomorph elif isomorph == "%": + next: cython.int = i + 1 + next_next: cython.int = i + 2 if ( - len(encode_output) <= i + 2 - or chr(encode_output[i + 1]) not in _ASCII_HEX_DIGIT - or chr(encode_output[i + 2]) not in _ASCII_HEX_DIGIT + encode_output_length <= next_next + or chr(encode_output[next]) not in _ASCII_HEX_DIGIT + or chr(encode_output[next_next]) not in _ASCII_HEX_DIGIT ): output += "%25" else: @@ -787,7 +787,7 @@ def _parse_opaque_host(input: str) -> str: # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser -def _parse_ipv4_number(input: str) -> Tuple[int, bool]: +def _parse_ipv4_number(input: str) -> Tuple[int, bint]: if not input: raise ValueError validation_error = False @@ -807,7 +807,7 @@ def _parse_ipv4_number(input: str) -> Tuple[int, bool]: # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker -def _ends_in_number(input: str) -> bool: +def _ends_in_number(input: str) -> bint: parts = input.split(".") if parts and parts[-1] == "": if len(parts) == 1: @@ -847,7 +847,7 @@ def _parse_ipv4(input: str) -> int: # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii -def _domain_to_ascii(domain: str, *, be_strict: bool = False) -> str: +def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: result = _utr46._to_ascii( domain, use_std3_ascii_rules=be_strict, @@ -895,12 +895,12 @@ def _parse_host( # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter -def _is_windows_drive_letter(input: str) -> bool: +def _is_windows_drive_letter(input: str) -> bint: return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter -def _starts_with_windows_drive_letter(input: str) -> bool: +def _starts_with_windows_drive_letter(input: str) -> bint: input_length = len(input) return ( input_length >= 2 @@ -910,7 +910,7 @@ def _starts_with_windows_drive_letter(input: str) -> bool: # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment -def _is_double_dot_path_segment(input: str) -> bool: +def _is_double_dot_path_segment(input: str) -> bint: return input in ( "..", ".%2e", @@ -925,7 +925,7 @@ def _is_double_dot_path_segment(input: str) -> bool: # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment -def _is_single_dot_path_segment(input: str) -> bool: +def _is_single_dot_path_segment(input: str) -> bint: return input in ( ".", "%2e", @@ -979,19 +979,18 @@ def _parse_url( encoding = _get_output_encoding(encoding) url = _URL() - url.path = [] state = SCHEME_START buffer = "" at_sign_seen = inside_brackets = skip_authority_shortcut = False - pointer = 0 + pointer: cython.int = 0 input = _preprocess_url(input) - input_length = len(input) + input_length: cython.int = len(input) while True: reached_end: bint = pointer >= input_length if not reached_end: - c: str = input[pointer] + c = input[pointer] if state == SCHEME_START: if not reached_end and c in _ASCII_ALPHA: @@ -1011,7 +1010,7 @@ def _parse_url( state = FILE elif url.scheme in _SPECIAL_SCHEMES: state = SPECIAL_AUTHORITY_SLASHES - elif pointer + 1 < len(input) and input[pointer + 1] == "/": + elif pointer + 1 < input_length and input[pointer + 1] == "/": state = PATH_OR_AUTHORITY pointer += 1 else: From 8f1f809b467d28e261566be34adcc36951fa1eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 13 Feb 2024 18:55:59 +0100 Subject: [PATCH 34/34] Minor change --- setup.py | 2 +- w3lib/_url.c | 5560 +++++++++++++++++++++++++---------------------- w3lib/_url.pyx | 1 - w3lib/_util.c | 680 +++--- w3lib/_util.pyx | 4 +- 5 files changed, 3288 insertions(+), 2959 deletions(-) diff --git a/setup.py b/setup.py index c1ff5eb4..2af0dc4d 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ def no_cythonize(extensions, **_ignore): "language_level": 3, "profile": bool(int(os.getenv("CYTHON_PROFILE", 0))), } - extensions = cythonize(extensions, compiler_directives=compiler_directives) + extensions = cythonize(extensions, compiler_directives=compiler_directives, force=bool(int(os.getenv("CYTHON_FORCE", 0)))) else: extensions = no_cythonize(extensions) diff --git a/w3lib/_url.c b/w3lib/_url.c index 8b795321..c349e9e7 100644 --- a/w3lib/_url.c +++ b/w3lib/_url.c @@ -1482,7 +1482,7 @@ struct __pyx_defaults { PyObject *__pyx_arg_min_length; }; -/* "w3lib/_url.pyx":817 +/* "w3lib/_url.pyx":816 * parts = parts[:-1] * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< @@ -1496,7 +1496,7 @@ struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr { }; -/* "w3lib/_url.pyx":837 +/* "w3lib/_url.pyx":836 * result = _parse_ipv4_number(part) * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< @@ -1984,6 +1984,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); +/* RaiseKeywordRequired.proto */ +static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name); + /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); @@ -2139,9 +2142,6 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co static int __Pyx_PyUnicode_Tailmatch( PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction); -/* RaiseKeywordRequired.proto */ -static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name); - /* PyUnicodeContains.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_ContainsTF(PyObject* substring, PyObject* text, int eq) { int result = PyUnicode_Contains(text, substring); @@ -2644,7 +2644,6 @@ static PyObject *__pyx_9genexpr30__pyx_v_5w3lib_4_url_label; static PyObject *__pyx_9genexpr31__pyx_v_5w3lib_4_url_label; static PyObject *__pyx_9genexpr32__pyx_v_5w3lib_4_url_char; static PyObject *__pyx_f_5w3lib_4_url__get_output_encoding(PyObject *); /*proto*/ -static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *, PyObject *, PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "w3lib._url" @@ -2704,20 +2703,21 @@ static const char __pyx_k__23[] = "//"; static const char __pyx_k__24[] = "/."; static const char __pyx_k__25[] = "*"; static const char __pyx_k__72[] = "+-."; -static const char __pyx_k__75[] = "~"; -static const char __pyx_k__76[] = " \"<>`"; -static const char __pyx_k__77[] = " \"#<>"; -static const char __pyx_k__78[] = "'"; -static const char __pyx_k__79[] = "?`{}"; -static const char __pyx_k__80[] = "/:;=@[\\]^|"; -static const char __pyx_k__81[] = ":/?#[]@"; -static const char __pyx_k__82[] = "!$&'()*+,;="; -static const char __pyx_k__83[] = "-._~"; -static const char __pyx_k__85[] = "|"; -static const char __pyx_k__88[] = ":;="; -static const char __pyx_k__89[] = "#[]|"; -static const char __pyx_k__90[] = "\000\t\n\r #/:<>?@[\\]^|"; -static const char __pyx_k__91[] = "%"; +static const char __pyx_k__75[] = "_"; +static const char __pyx_k__78[] = "~"; +static const char __pyx_k__79[] = " \"<>`"; +static const char __pyx_k__80[] = " \"#<>"; +static const char __pyx_k__81[] = "'"; +static const char __pyx_k__82[] = "?`{}"; +static const char __pyx_k__83[] = "/:;=@[\\]^|"; +static const char __pyx_k__84[] = ":/?#[]@"; +static const char __pyx_k__85[] = "!$&'()*+,;="; +static const char __pyx_k__86[] = "-._~"; +static const char __pyx_k__88[] = "|"; +static const char __pyx_k__91[] = ":;="; +static const char __pyx_k__92[] = "#[]|"; +static const char __pyx_k__93[] = "\000\t\n\r #/:<>?@[\\]^|"; +static const char __pyx_k__94[] = "%"; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_ftp[] = "ftp"; @@ -2740,6 +2740,7 @@ static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_big5[] = "big5"; static const char __pyx_k_bint[] = "bint"; +static const char __pyx_k_byte[] = "byte"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_file[] = "file"; static const char __pyx_k_http[] = "http"; @@ -2752,6 +2753,7 @@ static const char __pyx_k_last[] = "last"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_math[] = "math"; static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_next[] = "next"; static const char __pyx_k_part[] = "part"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_port[] = "port"; @@ -2850,6 +2852,7 @@ static const char __pyx_k_cskoi8r[] = "cskoi8r"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_dos_874[] = "dos-874"; static const char __pyx_k_encoded[] = "encoded"; +static const char __pyx_k_encoder[] = "encoder"; static const char __pyx_k_gb18030[] = "gb18030"; static const char __pyx_k_gb_2312[] = "gb_2312"; static const char __pyx_k_genexpr[] = "genexpr"; @@ -2894,6 +2897,7 @@ static const char __pyx_k_iso88596[] = "iso88596"; static const char __pyx_k_iso88597[] = "iso88597"; static const char __pyx_k_iso88598[] = "iso88598"; static const char __pyx_k_iso88599[] = "iso88599"; +static const char __pyx_k_isomorph[] = "isomorph"; static const char __pyx_k_koi8_r_2[] = "koi8_r"; static const char __pyx_k_ksc_5601[] = "ksc_5601"; static const char __pyx_k_ms_kanji[] = "ms_kanji"; @@ -2935,6 +2939,7 @@ static const char __pyx_k_localhost[] = "localhost"; static const char __pyx_k_lru_cache[] = "lru_cache"; static const char __pyx_k_macintosh[] = "macintosh"; static const char __pyx_k_metaclass[] = "__metaclass__"; +static const char __pyx_k_next_next[] = "next_next"; static const char __pyx_k_parse_url[] = "_parse_url"; static const char __pyx_k_separator[] = "separator"; static const char __pyx_k_shift_jis[] = "shift-jis"; @@ -3068,6 +3073,7 @@ static const char __pyx_k_check_joiners[] = "check_joiners"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_csksc56011987[] = "csksc56011987"; static const char __pyx_k_current_index[] = "current_index"; +static const char __pyx_k_encode_output[] = "encode_output"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_iso_8859_15_2[] = "iso_8859-15"; static const char __pyx_k_serialize_url[] = "_serialize_url"; @@ -3148,6 +3154,7 @@ static const char __pyx_k_fragment_token_seen[] = "_fragment_token_seen"; static const char __pyx_k_password_token_seen[] = "_password_token_seen"; static const char __pyx_k_ASCII_TAB_OR_NEWLINE[] = "_ASCII_TAB_OR_NEWLINE"; static const char __pyx_k_REPLACEMENT_ENCODING[] = "_REPLACEMENT_ENCODING"; +static const char __pyx_k_encode_output_length[] = "encode_output_length"; static const char __pyx_k_use_std3_ascii_rules[] = "use_std3_ascii_rules"; static const char __pyx_k_utf_8_percent_encode[] = "_utf_8_percent_encode"; static const char __pyx_k_FRAGMENT_SAFEST_CHARS[] = "_FRAGMENT_SAFEST_CHARS"; @@ -3170,6 +3177,7 @@ static const char __pyx_k_SAFE_PATH_PERCENT_ENCODE_SET[] = "_SAFE_PATH_PERCENT_E static const char __pyx_k_C0_CONTROL_PERCENT_ENCODE_SET[] = "_C0_CONTROL_PERCENT_ENCODE_SET"; static const char __pyx_k_SAFE_QUERY_PERCENT_ENCODE_SET[] = "_SAFE_QUERY_PERCENT_ENCODE_SET"; static const char __pyx_k_ends_in_number_locals_genexpr[] = "_ends_in_number..genexpr"; +static const char __pyx_k_percent_encode_after_encoding[] = "_percent_encode_after_encoding"; static const char __pyx_k_OUTPUT_ENCODING_UTF8_ENCODINGS[] = "_OUTPUT_ENCODING_UTF8_ENCODINGS"; static const char __pyx_k_get_ipv6_first_longest_0_piece[] = "_get_ipv6_first_longest_0_piece_index"; static const char __pyx_k_ASCII_TAB_OR_NEWLINE_TRANSLATIO[] = "_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE"; @@ -3195,31 +3203,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_2_get_encoder(CYTHON_UNUSED PyObject *__p static PyObject *__pyx_pf_5w3lib_4_url_4_get_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_label); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_4_URL___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_6_shorten_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_10_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_12_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_20_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, int __pyx_v_be_strict); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_url); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_24_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_28_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_30_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_34_preprocess_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ -static PyObject *__pyx_pf_5w3lib_4_url_50_safe_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, int __pyx_v_be_strict); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_36_preprocess_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url); /* proto */ +static PyObject *__pyx_pf_5w3lib_4_url_52_safe_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding); /* proto */ static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_5w3lib_4_url___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_strip = {0, 0, 0, 0, 0}; @@ -3376,23 +3385,24 @@ typedef struct { PyObject *__pyx_kp_u__5; PyObject *__pyx_kp_u__7; PyObject *__pyx_kp_u__72; - PyObject *__pyx_kp_u__75; - PyObject *__pyx_kp_u__76; - PyObject *__pyx_kp_u__77; - PyObject *__pyx_kp_b__78; + PyObject *__pyx_n_s__75; PyObject *__pyx_kp_u__78; PyObject *__pyx_kp_u__79; PyObject *__pyx_kp_u__8; PyObject *__pyx_kp_u__80; PyObject *__pyx_kp_b__81; - PyObject *__pyx_kp_b__82; + PyObject *__pyx_kp_u__81; + PyObject *__pyx_kp_u__82; PyObject *__pyx_kp_u__83; + PyObject *__pyx_kp_b__84; PyObject *__pyx_kp_b__85; + PyObject *__pyx_kp_u__86; PyObject *__pyx_kp_b__88; - PyObject *__pyx_kp_b__89; PyObject *__pyx_kp_u__9; - PyObject *__pyx_kp_u__90; - PyObject *__pyx_kp_u__91; + PyObject *__pyx_kp_b__91; + PyObject *__pyx_kp_b__92; + PyObject *__pyx_kp_u__93; + PyObject *__pyx_kp_u__94; PyObject *__pyx_n_s_address; PyObject *__pyx_n_s_annotations; PyObject *__pyx_kp_u_ansi_x3_4_1968; @@ -3412,6 +3422,7 @@ typedef struct { PyObject *__pyx_kp_u_big5_hkscs; PyObject *__pyx_n_s_bint; PyObject *__pyx_n_s_buffer; + PyObject *__pyx_n_s_byte; PyObject *__pyx_n_s_c; PyObject *__pyx_n_s_check_bidi; PyObject *__pyx_n_s_check_hyphens; @@ -3480,9 +3491,12 @@ typedef struct { PyObject *__pyx_n_u_elot_928; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_encode; + PyObject *__pyx_n_s_encode_output; + PyObject *__pyx_n_s_encode_output_length; PyObject *__pyx_n_s_encode_set; PyObject *__pyx_n_s_encoded; PyObject *__pyx_n_s_encoded_code_points; + PyObject *__pyx_n_s_encoder; PyObject *__pyx_n_s_encoding; PyObject *__pyx_n_s_ends_in_number; PyObject *__pyx_n_s_ends_in_number_locals_genexpr; @@ -3623,6 +3637,7 @@ typedef struct { PyObject *__pyx_kp_u_iso_ir_149; PyObject *__pyx_kp_u_iso_ir_157; PyObject *__pyx_kp_u_iso_ir_58; + PyObject *__pyx_n_s_isomorph; PyObject *__pyx_n_s_keys; PyObject *__pyx_n_u_koi; PyObject *__pyx_n_u_koi8; @@ -3670,6 +3685,8 @@ typedef struct { PyObject *__pyx_n_u_ms_kanji; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_next; + PyObject *__pyx_n_s_next_next; PyObject *__pyx_n_s_number; PyObject *__pyx_n_s_numbers; PyObject *__pyx_n_s_numbers_seen; @@ -3689,6 +3706,7 @@ typedef struct { PyObject *__pyx_n_s_path; PyObject *__pyx_n_s_path_safe_chars; PyObject *__pyx_n_s_path_token_seen; + PyObject *__pyx_n_s_percent_encode_after_encoding; PyObject *__pyx_n_s_percent_encode_set; PyObject *__pyx_n_s_piece; PyObject *__pyx_n_s_piece_index; @@ -3859,55 +3877,57 @@ typedef struct { PyObject *__pyx_tuple__68; PyObject *__pyx_tuple__70; PyObject *__pyx_tuple__73; - PyObject *__pyx_tuple__84; - PyObject *__pyx_tuple__86; + PyObject *__pyx_tuple__76; PyObject *__pyx_tuple__87; - PyObject *__pyx_tuple__92; - PyObject *__pyx_tuple__94; - PyObject *__pyx_tuple__96; - PyObject *__pyx_tuple__98; - PyObject *__pyx_tuple__100; - PyObject *__pyx_tuple__102; - PyObject *__pyx_tuple__104; - PyObject *__pyx_tuple__106; - PyObject *__pyx_tuple__108; - PyObject *__pyx_tuple__110; - PyObject *__pyx_tuple__114; - PyObject *__pyx_tuple__116; - PyObject *__pyx_tuple__118; - PyObject *__pyx_tuple__120; - PyObject *__pyx_tuple__122; - PyObject *__pyx_tuple__124; + PyObject *__pyx_tuple__89; + PyObject *__pyx_tuple__90; + PyObject *__pyx_tuple__95; + PyObject *__pyx_tuple__97; + PyObject *__pyx_tuple__99; + PyObject *__pyx_tuple__101; + PyObject *__pyx_tuple__103; + PyObject *__pyx_tuple__105; + PyObject *__pyx_tuple__107; + PyObject *__pyx_tuple__109; + PyObject *__pyx_tuple__111; + PyObject *__pyx_tuple__113; + PyObject *__pyx_tuple__117; + PyObject *__pyx_tuple__119; + PyObject *__pyx_tuple__121; + PyObject *__pyx_tuple__123; + PyObject *__pyx_tuple__125; PyObject *__pyx_tuple__127; - PyObject *__pyx_tuple__129; - PyObject *__pyx_tuple__131; + PyObject *__pyx_tuple__130; + PyObject *__pyx_tuple__132; + PyObject *__pyx_tuple__134; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__66; PyObject *__pyx_codeobj__69; PyObject *__pyx_codeobj__71; PyObject *__pyx_codeobj__74; - PyObject *__pyx_codeobj__93; - PyObject *__pyx_codeobj__95; - PyObject *__pyx_codeobj__97; - PyObject *__pyx_codeobj__99; - PyObject *__pyx_codeobj__101; - PyObject *__pyx_codeobj__103; - PyObject *__pyx_codeobj__105; - PyObject *__pyx_codeobj__107; - PyObject *__pyx_codeobj__109; - PyObject *__pyx_codeobj__111; + PyObject *__pyx_codeobj__77; + PyObject *__pyx_codeobj__96; + PyObject *__pyx_codeobj__98; + PyObject *__pyx_codeobj__100; + PyObject *__pyx_codeobj__102; + PyObject *__pyx_codeobj__104; + PyObject *__pyx_codeobj__106; + PyObject *__pyx_codeobj__108; + PyObject *__pyx_codeobj__110; PyObject *__pyx_codeobj__112; - PyObject *__pyx_codeobj__113; + PyObject *__pyx_codeobj__114; PyObject *__pyx_codeobj__115; - PyObject *__pyx_codeobj__117; - PyObject *__pyx_codeobj__119; - PyObject *__pyx_codeobj__121; - PyObject *__pyx_codeobj__123; - PyObject *__pyx_codeobj__125; + PyObject *__pyx_codeobj__116; + PyObject *__pyx_codeobj__118; + PyObject *__pyx_codeobj__120; + PyObject *__pyx_codeobj__122; + PyObject *__pyx_codeobj__124; PyObject *__pyx_codeobj__126; PyObject *__pyx_codeobj__128; - PyObject *__pyx_codeobj__130; - PyObject *__pyx_codeobj__132; + PyObject *__pyx_codeobj__129; + PyObject *__pyx_codeobj__131; + PyObject *__pyx_codeobj__133; + PyObject *__pyx_codeobj__135; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -4072,23 +4092,24 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_u__5); Py_CLEAR(clear_module_state->__pyx_kp_u__7); Py_CLEAR(clear_module_state->__pyx_kp_u__72); - Py_CLEAR(clear_module_state->__pyx_kp_u__75); - Py_CLEAR(clear_module_state->__pyx_kp_u__76); - Py_CLEAR(clear_module_state->__pyx_kp_u__77); - Py_CLEAR(clear_module_state->__pyx_kp_b__78); + Py_CLEAR(clear_module_state->__pyx_n_s__75); Py_CLEAR(clear_module_state->__pyx_kp_u__78); Py_CLEAR(clear_module_state->__pyx_kp_u__79); Py_CLEAR(clear_module_state->__pyx_kp_u__8); Py_CLEAR(clear_module_state->__pyx_kp_u__80); Py_CLEAR(clear_module_state->__pyx_kp_b__81); - Py_CLEAR(clear_module_state->__pyx_kp_b__82); + Py_CLEAR(clear_module_state->__pyx_kp_u__81); + Py_CLEAR(clear_module_state->__pyx_kp_u__82); Py_CLEAR(clear_module_state->__pyx_kp_u__83); + Py_CLEAR(clear_module_state->__pyx_kp_b__84); Py_CLEAR(clear_module_state->__pyx_kp_b__85); + Py_CLEAR(clear_module_state->__pyx_kp_u__86); Py_CLEAR(clear_module_state->__pyx_kp_b__88); - Py_CLEAR(clear_module_state->__pyx_kp_b__89); Py_CLEAR(clear_module_state->__pyx_kp_u__9); - Py_CLEAR(clear_module_state->__pyx_kp_u__90); - Py_CLEAR(clear_module_state->__pyx_kp_u__91); + Py_CLEAR(clear_module_state->__pyx_kp_b__91); + Py_CLEAR(clear_module_state->__pyx_kp_b__92); + Py_CLEAR(clear_module_state->__pyx_kp_u__93); + Py_CLEAR(clear_module_state->__pyx_kp_u__94); Py_CLEAR(clear_module_state->__pyx_n_s_address); Py_CLEAR(clear_module_state->__pyx_n_s_annotations); Py_CLEAR(clear_module_state->__pyx_kp_u_ansi_x3_4_1968); @@ -4108,6 +4129,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_u_big5_hkscs); Py_CLEAR(clear_module_state->__pyx_n_s_bint); Py_CLEAR(clear_module_state->__pyx_n_s_buffer); + Py_CLEAR(clear_module_state->__pyx_n_s_byte); Py_CLEAR(clear_module_state->__pyx_n_s_c); Py_CLEAR(clear_module_state->__pyx_n_s_check_bidi); Py_CLEAR(clear_module_state->__pyx_n_s_check_hyphens); @@ -4176,9 +4198,12 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_u_elot_928); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_encode); + Py_CLEAR(clear_module_state->__pyx_n_s_encode_output); + Py_CLEAR(clear_module_state->__pyx_n_s_encode_output_length); Py_CLEAR(clear_module_state->__pyx_n_s_encode_set); Py_CLEAR(clear_module_state->__pyx_n_s_encoded); Py_CLEAR(clear_module_state->__pyx_n_s_encoded_code_points); + Py_CLEAR(clear_module_state->__pyx_n_s_encoder); Py_CLEAR(clear_module_state->__pyx_n_s_encoding); Py_CLEAR(clear_module_state->__pyx_n_s_ends_in_number); Py_CLEAR(clear_module_state->__pyx_n_s_ends_in_number_locals_genexpr); @@ -4319,6 +4344,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_149); Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_157); Py_CLEAR(clear_module_state->__pyx_kp_u_iso_ir_58); + Py_CLEAR(clear_module_state->__pyx_n_s_isomorph); Py_CLEAR(clear_module_state->__pyx_n_s_keys); Py_CLEAR(clear_module_state->__pyx_n_u_koi); Py_CLEAR(clear_module_state->__pyx_n_u_koi8); @@ -4366,6 +4392,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_u_ms_kanji); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_next); + Py_CLEAR(clear_module_state->__pyx_n_s_next_next); Py_CLEAR(clear_module_state->__pyx_n_s_number); Py_CLEAR(clear_module_state->__pyx_n_s_numbers); Py_CLEAR(clear_module_state->__pyx_n_s_numbers_seen); @@ -4385,6 +4413,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_path); Py_CLEAR(clear_module_state->__pyx_n_s_path_safe_chars); Py_CLEAR(clear_module_state->__pyx_n_s_path_token_seen); + Py_CLEAR(clear_module_state->__pyx_n_s_percent_encode_after_encoding); Py_CLEAR(clear_module_state->__pyx_n_s_percent_encode_set); Py_CLEAR(clear_module_state->__pyx_n_s_piece); Py_CLEAR(clear_module_state->__pyx_n_s_piece_index); @@ -4555,55 +4584,57 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_tuple__68); Py_CLEAR(clear_module_state->__pyx_tuple__70); Py_CLEAR(clear_module_state->__pyx_tuple__73); - Py_CLEAR(clear_module_state->__pyx_tuple__84); - Py_CLEAR(clear_module_state->__pyx_tuple__86); + Py_CLEAR(clear_module_state->__pyx_tuple__76); Py_CLEAR(clear_module_state->__pyx_tuple__87); - Py_CLEAR(clear_module_state->__pyx_tuple__92); - Py_CLEAR(clear_module_state->__pyx_tuple__94); - Py_CLEAR(clear_module_state->__pyx_tuple__96); - Py_CLEAR(clear_module_state->__pyx_tuple__98); - Py_CLEAR(clear_module_state->__pyx_tuple__100); - Py_CLEAR(clear_module_state->__pyx_tuple__102); - Py_CLEAR(clear_module_state->__pyx_tuple__104); - Py_CLEAR(clear_module_state->__pyx_tuple__106); - Py_CLEAR(clear_module_state->__pyx_tuple__108); - Py_CLEAR(clear_module_state->__pyx_tuple__110); - Py_CLEAR(clear_module_state->__pyx_tuple__114); - Py_CLEAR(clear_module_state->__pyx_tuple__116); - Py_CLEAR(clear_module_state->__pyx_tuple__118); - Py_CLEAR(clear_module_state->__pyx_tuple__120); - Py_CLEAR(clear_module_state->__pyx_tuple__122); - Py_CLEAR(clear_module_state->__pyx_tuple__124); + Py_CLEAR(clear_module_state->__pyx_tuple__89); + Py_CLEAR(clear_module_state->__pyx_tuple__90); + Py_CLEAR(clear_module_state->__pyx_tuple__95); + Py_CLEAR(clear_module_state->__pyx_tuple__97); + Py_CLEAR(clear_module_state->__pyx_tuple__99); + Py_CLEAR(clear_module_state->__pyx_tuple__101); + Py_CLEAR(clear_module_state->__pyx_tuple__103); + Py_CLEAR(clear_module_state->__pyx_tuple__105); + Py_CLEAR(clear_module_state->__pyx_tuple__107); + Py_CLEAR(clear_module_state->__pyx_tuple__109); + Py_CLEAR(clear_module_state->__pyx_tuple__111); + Py_CLEAR(clear_module_state->__pyx_tuple__113); + Py_CLEAR(clear_module_state->__pyx_tuple__117); + Py_CLEAR(clear_module_state->__pyx_tuple__119); + Py_CLEAR(clear_module_state->__pyx_tuple__121); + Py_CLEAR(clear_module_state->__pyx_tuple__123); + Py_CLEAR(clear_module_state->__pyx_tuple__125); Py_CLEAR(clear_module_state->__pyx_tuple__127); - Py_CLEAR(clear_module_state->__pyx_tuple__129); - Py_CLEAR(clear_module_state->__pyx_tuple__131); + Py_CLEAR(clear_module_state->__pyx_tuple__130); + Py_CLEAR(clear_module_state->__pyx_tuple__132); + Py_CLEAR(clear_module_state->__pyx_tuple__134); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__66); Py_CLEAR(clear_module_state->__pyx_codeobj__69); Py_CLEAR(clear_module_state->__pyx_codeobj__71); Py_CLEAR(clear_module_state->__pyx_codeobj__74); - Py_CLEAR(clear_module_state->__pyx_codeobj__93); - Py_CLEAR(clear_module_state->__pyx_codeobj__95); - Py_CLEAR(clear_module_state->__pyx_codeobj__97); - Py_CLEAR(clear_module_state->__pyx_codeobj__99); - Py_CLEAR(clear_module_state->__pyx_codeobj__101); - Py_CLEAR(clear_module_state->__pyx_codeobj__103); - Py_CLEAR(clear_module_state->__pyx_codeobj__105); - Py_CLEAR(clear_module_state->__pyx_codeobj__107); - Py_CLEAR(clear_module_state->__pyx_codeobj__109); - Py_CLEAR(clear_module_state->__pyx_codeobj__111); + Py_CLEAR(clear_module_state->__pyx_codeobj__77); + Py_CLEAR(clear_module_state->__pyx_codeobj__96); + Py_CLEAR(clear_module_state->__pyx_codeobj__98); + Py_CLEAR(clear_module_state->__pyx_codeobj__100); + Py_CLEAR(clear_module_state->__pyx_codeobj__102); + Py_CLEAR(clear_module_state->__pyx_codeobj__104); + Py_CLEAR(clear_module_state->__pyx_codeobj__106); + Py_CLEAR(clear_module_state->__pyx_codeobj__108); + Py_CLEAR(clear_module_state->__pyx_codeobj__110); Py_CLEAR(clear_module_state->__pyx_codeobj__112); - Py_CLEAR(clear_module_state->__pyx_codeobj__113); + Py_CLEAR(clear_module_state->__pyx_codeobj__114); Py_CLEAR(clear_module_state->__pyx_codeobj__115); - Py_CLEAR(clear_module_state->__pyx_codeobj__117); - Py_CLEAR(clear_module_state->__pyx_codeobj__119); - Py_CLEAR(clear_module_state->__pyx_codeobj__121); - Py_CLEAR(clear_module_state->__pyx_codeobj__123); - Py_CLEAR(clear_module_state->__pyx_codeobj__125); + Py_CLEAR(clear_module_state->__pyx_codeobj__116); + Py_CLEAR(clear_module_state->__pyx_codeobj__118); + Py_CLEAR(clear_module_state->__pyx_codeobj__120); + Py_CLEAR(clear_module_state->__pyx_codeobj__122); + Py_CLEAR(clear_module_state->__pyx_codeobj__124); Py_CLEAR(clear_module_state->__pyx_codeobj__126); Py_CLEAR(clear_module_state->__pyx_codeobj__128); - Py_CLEAR(clear_module_state->__pyx_codeobj__130); - Py_CLEAR(clear_module_state->__pyx_codeobj__132); + Py_CLEAR(clear_module_state->__pyx_codeobj__129); + Py_CLEAR(clear_module_state->__pyx_codeobj__131); + Py_CLEAR(clear_module_state->__pyx_codeobj__133); + Py_CLEAR(clear_module_state->__pyx_codeobj__135); return 0; } #endif @@ -4746,23 +4777,24 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_u__5); Py_VISIT(traverse_module_state->__pyx_kp_u__7); Py_VISIT(traverse_module_state->__pyx_kp_u__72); - Py_VISIT(traverse_module_state->__pyx_kp_u__75); - Py_VISIT(traverse_module_state->__pyx_kp_u__76); - Py_VISIT(traverse_module_state->__pyx_kp_u__77); - Py_VISIT(traverse_module_state->__pyx_kp_b__78); + Py_VISIT(traverse_module_state->__pyx_n_s__75); Py_VISIT(traverse_module_state->__pyx_kp_u__78); Py_VISIT(traverse_module_state->__pyx_kp_u__79); Py_VISIT(traverse_module_state->__pyx_kp_u__8); Py_VISIT(traverse_module_state->__pyx_kp_u__80); Py_VISIT(traverse_module_state->__pyx_kp_b__81); - Py_VISIT(traverse_module_state->__pyx_kp_b__82); + Py_VISIT(traverse_module_state->__pyx_kp_u__81); + Py_VISIT(traverse_module_state->__pyx_kp_u__82); Py_VISIT(traverse_module_state->__pyx_kp_u__83); + Py_VISIT(traverse_module_state->__pyx_kp_b__84); Py_VISIT(traverse_module_state->__pyx_kp_b__85); + Py_VISIT(traverse_module_state->__pyx_kp_u__86); Py_VISIT(traverse_module_state->__pyx_kp_b__88); - Py_VISIT(traverse_module_state->__pyx_kp_b__89); Py_VISIT(traverse_module_state->__pyx_kp_u__9); - Py_VISIT(traverse_module_state->__pyx_kp_u__90); - Py_VISIT(traverse_module_state->__pyx_kp_u__91); + Py_VISIT(traverse_module_state->__pyx_kp_b__91); + Py_VISIT(traverse_module_state->__pyx_kp_b__92); + Py_VISIT(traverse_module_state->__pyx_kp_u__93); + Py_VISIT(traverse_module_state->__pyx_kp_u__94); Py_VISIT(traverse_module_state->__pyx_n_s_address); Py_VISIT(traverse_module_state->__pyx_n_s_annotations); Py_VISIT(traverse_module_state->__pyx_kp_u_ansi_x3_4_1968); @@ -4782,6 +4814,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_u_big5_hkscs); Py_VISIT(traverse_module_state->__pyx_n_s_bint); Py_VISIT(traverse_module_state->__pyx_n_s_buffer); + Py_VISIT(traverse_module_state->__pyx_n_s_byte); Py_VISIT(traverse_module_state->__pyx_n_s_c); Py_VISIT(traverse_module_state->__pyx_n_s_check_bidi); Py_VISIT(traverse_module_state->__pyx_n_s_check_hyphens); @@ -4850,9 +4883,12 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_u_elot_928); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_encode); + Py_VISIT(traverse_module_state->__pyx_n_s_encode_output); + Py_VISIT(traverse_module_state->__pyx_n_s_encode_output_length); Py_VISIT(traverse_module_state->__pyx_n_s_encode_set); Py_VISIT(traverse_module_state->__pyx_n_s_encoded); Py_VISIT(traverse_module_state->__pyx_n_s_encoded_code_points); + Py_VISIT(traverse_module_state->__pyx_n_s_encoder); Py_VISIT(traverse_module_state->__pyx_n_s_encoding); Py_VISIT(traverse_module_state->__pyx_n_s_ends_in_number); Py_VISIT(traverse_module_state->__pyx_n_s_ends_in_number_locals_genexpr); @@ -4993,6 +5029,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_149); Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_157); Py_VISIT(traverse_module_state->__pyx_kp_u_iso_ir_58); + Py_VISIT(traverse_module_state->__pyx_n_s_isomorph); Py_VISIT(traverse_module_state->__pyx_n_s_keys); Py_VISIT(traverse_module_state->__pyx_n_u_koi); Py_VISIT(traverse_module_state->__pyx_n_u_koi8); @@ -5040,6 +5077,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_u_ms_kanji); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_next); + Py_VISIT(traverse_module_state->__pyx_n_s_next_next); Py_VISIT(traverse_module_state->__pyx_n_s_number); Py_VISIT(traverse_module_state->__pyx_n_s_numbers); Py_VISIT(traverse_module_state->__pyx_n_s_numbers_seen); @@ -5059,6 +5098,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_path); Py_VISIT(traverse_module_state->__pyx_n_s_path_safe_chars); Py_VISIT(traverse_module_state->__pyx_n_s_path_token_seen); + Py_VISIT(traverse_module_state->__pyx_n_s_percent_encode_after_encoding); Py_VISIT(traverse_module_state->__pyx_n_s_percent_encode_set); Py_VISIT(traverse_module_state->__pyx_n_s_piece); Py_VISIT(traverse_module_state->__pyx_n_s_piece_index); @@ -5229,55 +5269,57 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_tuple__68); Py_VISIT(traverse_module_state->__pyx_tuple__70); Py_VISIT(traverse_module_state->__pyx_tuple__73); - Py_VISIT(traverse_module_state->__pyx_tuple__84); - Py_VISIT(traverse_module_state->__pyx_tuple__86); + Py_VISIT(traverse_module_state->__pyx_tuple__76); Py_VISIT(traverse_module_state->__pyx_tuple__87); - Py_VISIT(traverse_module_state->__pyx_tuple__92); - Py_VISIT(traverse_module_state->__pyx_tuple__94); - Py_VISIT(traverse_module_state->__pyx_tuple__96); - Py_VISIT(traverse_module_state->__pyx_tuple__98); - Py_VISIT(traverse_module_state->__pyx_tuple__100); - Py_VISIT(traverse_module_state->__pyx_tuple__102); - Py_VISIT(traverse_module_state->__pyx_tuple__104); - Py_VISIT(traverse_module_state->__pyx_tuple__106); - Py_VISIT(traverse_module_state->__pyx_tuple__108); - Py_VISIT(traverse_module_state->__pyx_tuple__110); - Py_VISIT(traverse_module_state->__pyx_tuple__114); - Py_VISIT(traverse_module_state->__pyx_tuple__116); - Py_VISIT(traverse_module_state->__pyx_tuple__118); - Py_VISIT(traverse_module_state->__pyx_tuple__120); - Py_VISIT(traverse_module_state->__pyx_tuple__122); - Py_VISIT(traverse_module_state->__pyx_tuple__124); + Py_VISIT(traverse_module_state->__pyx_tuple__89); + Py_VISIT(traverse_module_state->__pyx_tuple__90); + Py_VISIT(traverse_module_state->__pyx_tuple__95); + Py_VISIT(traverse_module_state->__pyx_tuple__97); + Py_VISIT(traverse_module_state->__pyx_tuple__99); + Py_VISIT(traverse_module_state->__pyx_tuple__101); + Py_VISIT(traverse_module_state->__pyx_tuple__103); + Py_VISIT(traverse_module_state->__pyx_tuple__105); + Py_VISIT(traverse_module_state->__pyx_tuple__107); + Py_VISIT(traverse_module_state->__pyx_tuple__109); + Py_VISIT(traverse_module_state->__pyx_tuple__111); + Py_VISIT(traverse_module_state->__pyx_tuple__113); + Py_VISIT(traverse_module_state->__pyx_tuple__117); + Py_VISIT(traverse_module_state->__pyx_tuple__119); + Py_VISIT(traverse_module_state->__pyx_tuple__121); + Py_VISIT(traverse_module_state->__pyx_tuple__123); + Py_VISIT(traverse_module_state->__pyx_tuple__125); Py_VISIT(traverse_module_state->__pyx_tuple__127); - Py_VISIT(traverse_module_state->__pyx_tuple__129); - Py_VISIT(traverse_module_state->__pyx_tuple__131); + Py_VISIT(traverse_module_state->__pyx_tuple__130); + Py_VISIT(traverse_module_state->__pyx_tuple__132); + Py_VISIT(traverse_module_state->__pyx_tuple__134); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__66); Py_VISIT(traverse_module_state->__pyx_codeobj__69); Py_VISIT(traverse_module_state->__pyx_codeobj__71); Py_VISIT(traverse_module_state->__pyx_codeobj__74); - Py_VISIT(traverse_module_state->__pyx_codeobj__93); - Py_VISIT(traverse_module_state->__pyx_codeobj__95); - Py_VISIT(traverse_module_state->__pyx_codeobj__97); - Py_VISIT(traverse_module_state->__pyx_codeobj__99); - Py_VISIT(traverse_module_state->__pyx_codeobj__101); - Py_VISIT(traverse_module_state->__pyx_codeobj__103); - Py_VISIT(traverse_module_state->__pyx_codeobj__105); - Py_VISIT(traverse_module_state->__pyx_codeobj__107); - Py_VISIT(traverse_module_state->__pyx_codeobj__109); - Py_VISIT(traverse_module_state->__pyx_codeobj__111); + Py_VISIT(traverse_module_state->__pyx_codeobj__77); + Py_VISIT(traverse_module_state->__pyx_codeobj__96); + Py_VISIT(traverse_module_state->__pyx_codeobj__98); + Py_VISIT(traverse_module_state->__pyx_codeobj__100); + Py_VISIT(traverse_module_state->__pyx_codeobj__102); + Py_VISIT(traverse_module_state->__pyx_codeobj__104); + Py_VISIT(traverse_module_state->__pyx_codeobj__106); + Py_VISIT(traverse_module_state->__pyx_codeobj__108); + Py_VISIT(traverse_module_state->__pyx_codeobj__110); Py_VISIT(traverse_module_state->__pyx_codeobj__112); - Py_VISIT(traverse_module_state->__pyx_codeobj__113); + Py_VISIT(traverse_module_state->__pyx_codeobj__114); Py_VISIT(traverse_module_state->__pyx_codeobj__115); - Py_VISIT(traverse_module_state->__pyx_codeobj__117); - Py_VISIT(traverse_module_state->__pyx_codeobj__119); - Py_VISIT(traverse_module_state->__pyx_codeobj__121); - Py_VISIT(traverse_module_state->__pyx_codeobj__123); - Py_VISIT(traverse_module_state->__pyx_codeobj__125); + Py_VISIT(traverse_module_state->__pyx_codeobj__116); + Py_VISIT(traverse_module_state->__pyx_codeobj__118); + Py_VISIT(traverse_module_state->__pyx_codeobj__120); + Py_VISIT(traverse_module_state->__pyx_codeobj__122); + Py_VISIT(traverse_module_state->__pyx_codeobj__124); Py_VISIT(traverse_module_state->__pyx_codeobj__126); Py_VISIT(traverse_module_state->__pyx_codeobj__128); - Py_VISIT(traverse_module_state->__pyx_codeobj__130); - Py_VISIT(traverse_module_state->__pyx_codeobj__132); + Py_VISIT(traverse_module_state->__pyx_codeobj__129); + Py_VISIT(traverse_module_state->__pyx_codeobj__131); + Py_VISIT(traverse_module_state->__pyx_codeobj__133); + Py_VISIT(traverse_module_state->__pyx_codeobj__135); return 0; } #endif @@ -5432,23 +5474,24 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 #define __pyx_kp_u__72 __pyx_mstate_global->__pyx_kp_u__72 -#define __pyx_kp_u__75 __pyx_mstate_global->__pyx_kp_u__75 -#define __pyx_kp_u__76 __pyx_mstate_global->__pyx_kp_u__76 -#define __pyx_kp_u__77 __pyx_mstate_global->__pyx_kp_u__77 -#define __pyx_kp_b__78 __pyx_mstate_global->__pyx_kp_b__78 +#define __pyx_n_s__75 __pyx_mstate_global->__pyx_n_s__75 #define __pyx_kp_u__78 __pyx_mstate_global->__pyx_kp_u__78 #define __pyx_kp_u__79 __pyx_mstate_global->__pyx_kp_u__79 #define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8 #define __pyx_kp_u__80 __pyx_mstate_global->__pyx_kp_u__80 #define __pyx_kp_b__81 __pyx_mstate_global->__pyx_kp_b__81 -#define __pyx_kp_b__82 __pyx_mstate_global->__pyx_kp_b__82 +#define __pyx_kp_u__81 __pyx_mstate_global->__pyx_kp_u__81 +#define __pyx_kp_u__82 __pyx_mstate_global->__pyx_kp_u__82 #define __pyx_kp_u__83 __pyx_mstate_global->__pyx_kp_u__83 +#define __pyx_kp_b__84 __pyx_mstate_global->__pyx_kp_b__84 #define __pyx_kp_b__85 __pyx_mstate_global->__pyx_kp_b__85 +#define __pyx_kp_u__86 __pyx_mstate_global->__pyx_kp_u__86 #define __pyx_kp_b__88 __pyx_mstate_global->__pyx_kp_b__88 -#define __pyx_kp_b__89 __pyx_mstate_global->__pyx_kp_b__89 #define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9 -#define __pyx_kp_u__90 __pyx_mstate_global->__pyx_kp_u__90 -#define __pyx_kp_u__91 __pyx_mstate_global->__pyx_kp_u__91 +#define __pyx_kp_b__91 __pyx_mstate_global->__pyx_kp_b__91 +#define __pyx_kp_b__92 __pyx_mstate_global->__pyx_kp_b__92 +#define __pyx_kp_u__93 __pyx_mstate_global->__pyx_kp_u__93 +#define __pyx_kp_u__94 __pyx_mstate_global->__pyx_kp_u__94 #define __pyx_n_s_address __pyx_mstate_global->__pyx_n_s_address #define __pyx_n_s_annotations __pyx_mstate_global->__pyx_n_s_annotations #define __pyx_kp_u_ansi_x3_4_1968 __pyx_mstate_global->__pyx_kp_u_ansi_x3_4_1968 @@ -5468,6 +5511,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_u_big5_hkscs __pyx_mstate_global->__pyx_kp_u_big5_hkscs #define __pyx_n_s_bint __pyx_mstate_global->__pyx_n_s_bint #define __pyx_n_s_buffer __pyx_mstate_global->__pyx_n_s_buffer +#define __pyx_n_s_byte __pyx_mstate_global->__pyx_n_s_byte #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c #define __pyx_n_s_check_bidi __pyx_mstate_global->__pyx_n_s_check_bidi #define __pyx_n_s_check_hyphens __pyx_mstate_global->__pyx_n_s_check_hyphens @@ -5536,9 +5580,12 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_u_elot_928 __pyx_mstate_global->__pyx_n_u_elot_928 #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode +#define __pyx_n_s_encode_output __pyx_mstate_global->__pyx_n_s_encode_output +#define __pyx_n_s_encode_output_length __pyx_mstate_global->__pyx_n_s_encode_output_length #define __pyx_n_s_encode_set __pyx_mstate_global->__pyx_n_s_encode_set #define __pyx_n_s_encoded __pyx_mstate_global->__pyx_n_s_encoded #define __pyx_n_s_encoded_code_points __pyx_mstate_global->__pyx_n_s_encoded_code_points +#define __pyx_n_s_encoder __pyx_mstate_global->__pyx_n_s_encoder #define __pyx_n_s_encoding __pyx_mstate_global->__pyx_n_s_encoding #define __pyx_n_s_ends_in_number __pyx_mstate_global->__pyx_n_s_ends_in_number #define __pyx_n_s_ends_in_number_locals_genexpr __pyx_mstate_global->__pyx_n_s_ends_in_number_locals_genexpr @@ -5679,6 +5726,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_u_iso_ir_149 __pyx_mstate_global->__pyx_kp_u_iso_ir_149 #define __pyx_kp_u_iso_ir_157 __pyx_mstate_global->__pyx_kp_u_iso_ir_157 #define __pyx_kp_u_iso_ir_58 __pyx_mstate_global->__pyx_kp_u_iso_ir_58 +#define __pyx_n_s_isomorph __pyx_mstate_global->__pyx_n_s_isomorph #define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys #define __pyx_n_u_koi __pyx_mstate_global->__pyx_n_u_koi #define __pyx_n_u_koi8 __pyx_mstate_global->__pyx_n_u_koi8 @@ -5726,6 +5774,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_u_ms_kanji __pyx_mstate_global->__pyx_n_u_ms_kanji #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_next __pyx_mstate_global->__pyx_n_s_next +#define __pyx_n_s_next_next __pyx_mstate_global->__pyx_n_s_next_next #define __pyx_n_s_number __pyx_mstate_global->__pyx_n_s_number #define __pyx_n_s_numbers __pyx_mstate_global->__pyx_n_s_numbers #define __pyx_n_s_numbers_seen __pyx_mstate_global->__pyx_n_s_numbers_seen @@ -5745,6 +5795,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path #define __pyx_n_s_path_safe_chars __pyx_mstate_global->__pyx_n_s_path_safe_chars #define __pyx_n_s_path_token_seen __pyx_mstate_global->__pyx_n_s_path_token_seen +#define __pyx_n_s_percent_encode_after_encoding __pyx_mstate_global->__pyx_n_s_percent_encode_after_encoding #define __pyx_n_s_percent_encode_set __pyx_mstate_global->__pyx_n_s_percent_encode_set #define __pyx_n_s_piece __pyx_mstate_global->__pyx_n_s_piece #define __pyx_n_s_piece_index __pyx_mstate_global->__pyx_n_s_piece_index @@ -5915,55 +5966,57 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 #define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70 #define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 -#define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84 -#define __pyx_tuple__86 __pyx_mstate_global->__pyx_tuple__86 +#define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 #define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87 -#define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92 -#define __pyx_tuple__94 __pyx_mstate_global->__pyx_tuple__94 -#define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96 -#define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98 -#define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100 -#define __pyx_tuple__102 __pyx_mstate_global->__pyx_tuple__102 -#define __pyx_tuple__104 __pyx_mstate_global->__pyx_tuple__104 -#define __pyx_tuple__106 __pyx_mstate_global->__pyx_tuple__106 -#define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108 -#define __pyx_tuple__110 __pyx_mstate_global->__pyx_tuple__110 -#define __pyx_tuple__114 __pyx_mstate_global->__pyx_tuple__114 -#define __pyx_tuple__116 __pyx_mstate_global->__pyx_tuple__116 -#define __pyx_tuple__118 __pyx_mstate_global->__pyx_tuple__118 -#define __pyx_tuple__120 __pyx_mstate_global->__pyx_tuple__120 -#define __pyx_tuple__122 __pyx_mstate_global->__pyx_tuple__122 -#define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124 +#define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89 +#define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90 +#define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95 +#define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97 +#define __pyx_tuple__99 __pyx_mstate_global->__pyx_tuple__99 +#define __pyx_tuple__101 __pyx_mstate_global->__pyx_tuple__101 +#define __pyx_tuple__103 __pyx_mstate_global->__pyx_tuple__103 +#define __pyx_tuple__105 __pyx_mstate_global->__pyx_tuple__105 +#define __pyx_tuple__107 __pyx_mstate_global->__pyx_tuple__107 +#define __pyx_tuple__109 __pyx_mstate_global->__pyx_tuple__109 +#define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111 +#define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113 +#define __pyx_tuple__117 __pyx_mstate_global->__pyx_tuple__117 +#define __pyx_tuple__119 __pyx_mstate_global->__pyx_tuple__119 +#define __pyx_tuple__121 __pyx_mstate_global->__pyx_tuple__121 +#define __pyx_tuple__123 __pyx_mstate_global->__pyx_tuple__123 +#define __pyx_tuple__125 __pyx_mstate_global->__pyx_tuple__125 #define __pyx_tuple__127 __pyx_mstate_global->__pyx_tuple__127 -#define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129 -#define __pyx_tuple__131 __pyx_mstate_global->__pyx_tuple__131 +#define __pyx_tuple__130 __pyx_mstate_global->__pyx_tuple__130 +#define __pyx_tuple__132 __pyx_mstate_global->__pyx_tuple__132 +#define __pyx_tuple__134 __pyx_mstate_global->__pyx_tuple__134 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 #define __pyx_codeobj__69 __pyx_mstate_global->__pyx_codeobj__69 #define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71 #define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74 -#define __pyx_codeobj__93 __pyx_mstate_global->__pyx_codeobj__93 -#define __pyx_codeobj__95 __pyx_mstate_global->__pyx_codeobj__95 -#define __pyx_codeobj__97 __pyx_mstate_global->__pyx_codeobj__97 -#define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99 -#define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101 -#define __pyx_codeobj__103 __pyx_mstate_global->__pyx_codeobj__103 -#define __pyx_codeobj__105 __pyx_mstate_global->__pyx_codeobj__105 -#define __pyx_codeobj__107 __pyx_mstate_global->__pyx_codeobj__107 -#define __pyx_codeobj__109 __pyx_mstate_global->__pyx_codeobj__109 -#define __pyx_codeobj__111 __pyx_mstate_global->__pyx_codeobj__111 +#define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77 +#define __pyx_codeobj__96 __pyx_mstate_global->__pyx_codeobj__96 +#define __pyx_codeobj__98 __pyx_mstate_global->__pyx_codeobj__98 +#define __pyx_codeobj__100 __pyx_mstate_global->__pyx_codeobj__100 +#define __pyx_codeobj__102 __pyx_mstate_global->__pyx_codeobj__102 +#define __pyx_codeobj__104 __pyx_mstate_global->__pyx_codeobj__104 +#define __pyx_codeobj__106 __pyx_mstate_global->__pyx_codeobj__106 +#define __pyx_codeobj__108 __pyx_mstate_global->__pyx_codeobj__108 +#define __pyx_codeobj__110 __pyx_mstate_global->__pyx_codeobj__110 #define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112 -#define __pyx_codeobj__113 __pyx_mstate_global->__pyx_codeobj__113 +#define __pyx_codeobj__114 __pyx_mstate_global->__pyx_codeobj__114 #define __pyx_codeobj__115 __pyx_mstate_global->__pyx_codeobj__115 -#define __pyx_codeobj__117 __pyx_mstate_global->__pyx_codeobj__117 -#define __pyx_codeobj__119 __pyx_mstate_global->__pyx_codeobj__119 -#define __pyx_codeobj__121 __pyx_mstate_global->__pyx_codeobj__121 -#define __pyx_codeobj__123 __pyx_mstate_global->__pyx_codeobj__123 -#define __pyx_codeobj__125 __pyx_mstate_global->__pyx_codeobj__125 +#define __pyx_codeobj__116 __pyx_mstate_global->__pyx_codeobj__116 +#define __pyx_codeobj__118 __pyx_mstate_global->__pyx_codeobj__118 +#define __pyx_codeobj__120 __pyx_mstate_global->__pyx_codeobj__120 +#define __pyx_codeobj__122 __pyx_mstate_global->__pyx_codeobj__122 +#define __pyx_codeobj__124 __pyx_mstate_global->__pyx_codeobj__124 #define __pyx_codeobj__126 __pyx_mstate_global->__pyx_codeobj__126 #define __pyx_codeobj__128 __pyx_mstate_global->__pyx_codeobj__128 -#define __pyx_codeobj__130 __pyx_mstate_global->__pyx_codeobj__130 -#define __pyx_codeobj__132 __pyx_mstate_global->__pyx_codeobj__132 +#define __pyx_codeobj__129 __pyx_mstate_global->__pyx_codeobj__129 +#define __pyx_codeobj__131 __pyx_mstate_global->__pyx_codeobj__131 +#define __pyx_codeobj__133 __pyx_mstate_global->__pyx_codeobj__133 +#define __pyx_codeobj__135 __pyx_mstate_global->__pyx_codeobj__135 /* #### Code section: module_code ### */ /* "w3lib/_url.pyx":45 @@ -7447,12 +7500,136 @@ static PyObject *__pyx_pf_5w3lib_4_url_6_shorten_path(CYTHON_UNUSED PyObject *__ /* "w3lib/_url.pyx":580 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. - * @cfunc # <<<<<<<<<<<<<< - * def _percent_encode_after_encoding( + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< * input: str, + * *, */ -static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set) { +/* Python wrapper */ +static PyObject *__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_5w3lib_4_url_9_percent_encode_after_encoding = {"_percent_encode_after_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_9_percent_encode_after_encoding(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_input = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_percent_encode_set = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_percent_encode_after_encoding (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_encoding,&__pyx_n_s_percent_encode_set,0}; + if (likely(__pyx_kwds)) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 580, __pyx_L3_error) + } + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_percent_encode_set)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) + else { + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_percent_encode_set); __PYX_ERR(0, 580, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_percent_encode_after_encoding") < 0)) __PYX_ERR(0, 580, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + __Pyx_RaiseKeywordRequired("_percent_encode_after_encoding", __pyx_n_s_encoding); __PYX_ERR(0, 580, __pyx_L3_error) + } + __pyx_v_input = ((PyObject*)values[0]); + __pyx_v_encoding = ((PyObject*)values[1]); + __pyx_v_percent_encode_set = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_percent_encode_after_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 580, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("w3lib._url._percent_encode_after_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 581, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(__pyx_self, __pyx_v_input, __pyx_v_encoding, __pyx_v_percent_encode_set); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5w3lib_4_url_8_percent_encode_after_encoding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding, PyObject *__pyx_v_percent_encode_set) { PyObject *__pyx_v_encoder = NULL; PyObject *__pyx_v_output = NULL; PyObject *__pyx_v_encode_output = NULL; @@ -7480,14 +7657,14 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_percent_encode_after_encoding", 1); - /* "w3lib/_url.pyx":587 + /* "w3lib/_url.pyx":586 * percent_encode_set: _PercentEncodeSet, * ) -> str: * encoder = _get_encoder(encoding) # <<<<<<<<<<<<<< * output = "" * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_encoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -7507,14 +7684,14 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_encoder = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":588 + /* "w3lib/_url.pyx":587 * ) -> str: * encoder = _get_encoder(encoding) * output = "" # <<<<<<<<<<<<<< @@ -7524,7 +7701,7 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ __Pyx_INCREF(__pyx_kp_u_); __pyx_v_output = __pyx_kp_u_; - /* "w3lib/_url.pyx":591 + /* "w3lib/_url.pyx":590 * # TODO: Use an alternative to xmlcharrefreplace that returns %26%23NNN%3B * # instead of &#NNN; * encode_output, _ = encoder(input, "xmlcharrefreplace") # <<<<<<<<<<<<<< @@ -7550,7 +7727,7 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_input, __pyx_n_u_xmlcharrefreplace}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -7560,7 +7737,7 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 591, __pyx_L1_error) + __PYX_ERR(0, 590, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7573,15 +7750,15 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); @@ -7589,7 +7766,7 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 591, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 590, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; @@ -7597,7 +7774,7 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 591, __pyx_L1_error) + __PYX_ERR(0, 590, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_encode_output = __pyx_t_2; @@ -7605,26 +7782,26 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ __pyx_v__ = __pyx_t_3; __pyx_t_3 = 0; - /* "w3lib/_url.pyx":592 + /* "w3lib/_url.pyx":591 * # instead of &#NNN; * encode_output, _ = encoder(input, "xmlcharrefreplace") * encode_output_length: cython.int = len(encode_output) # <<<<<<<<<<<<<< * for i in range(encode_output_length): # pylint: disable=consider-using-enumerate * byte = encode_output[i] */ - __pyx_t_7 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_encode_output); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 591, __pyx_L1_error) __pyx_v_encode_output_length = __pyx_t_7; - /* "w3lib/_url.pyx":593 + /* "w3lib/_url.pyx":592 * encode_output, _ = encoder(input, "xmlcharrefreplace") * encode_output_length: cython.int = len(encode_output) * for i in range(encode_output_length): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< * byte = encode_output[i] * isomorph = chr(byte) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_encode_output_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_encode_output_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -7632,9 +7809,9 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 592, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -7643,28 +7820,28 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 593, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 592, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 592, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 593, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 592, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 592, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -7674,7 +7851,7 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 593, __pyx_L1_error) + else __PYX_ERR(0, 592, __pyx_L1_error) } break; } @@ -7683,53 +7860,53 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":594 + /* "w3lib/_url.pyx":593 * encode_output_length: cython.int = len(encode_output) * for i in range(encode_output_length): # pylint: disable=consider-using-enumerate * byte = encode_output[i] # <<<<<<<<<<<<<< * isomorph = chr(byte) * if isomorph not in percent_encode_set: */ - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_encode_output, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_byte, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":595 + /* "w3lib/_url.pyx":594 * for i in range(encode_output_length): # pylint: disable=consider-using-enumerate * byte = encode_output[i] * isomorph = chr(byte) # <<<<<<<<<<<<<< * if isomorph not in percent_encode_set: * output += isomorph */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_isomorph, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":596 + /* "w3lib/_url.pyx":595 * byte = encode_output[i] * isomorph = chr(byte) * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< * output += isomorph * elif isomorph == "%": */ - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_isomorph, __pyx_v_percent_encode_set, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_isomorph, __pyx_v_percent_encode_set, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 595, __pyx_L1_error) if (__pyx_t_9) { - /* "w3lib/_url.pyx":597 + /* "w3lib/_url.pyx":596 * isomorph = chr(byte) * if isomorph not in percent_encode_set: * output += isomorph # <<<<<<<<<<<<<< * elif isomorph == "%": * next: cython.int = i + 1 */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_v_isomorph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_v_isomorph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":596 + /* "w3lib/_url.pyx":595 * byte = encode_output[i] * isomorph = chr(byte) * if isomorph not in percent_encode_set: # <<<<<<<<<<<<<< @@ -7739,43 +7916,43 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ goto __pyx_L7; } - /* "w3lib/_url.pyx":598 + /* "w3lib/_url.pyx":597 * if isomorph not in percent_encode_set: * output += isomorph * elif isomorph == "%": # <<<<<<<<<<<<<< * next: cython.int = i + 1 * next_next: cython.int = i + 2 */ - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_isomorph, __pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 598, __pyx_L1_error) + __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_isomorph, __pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 597, __pyx_L1_error) if (__pyx_t_9) { - /* "w3lib/_url.pyx":599 + /* "w3lib/_url.pyx":598 * output += isomorph * elif isomorph == "%": * next: cython.int = i + 1 # <<<<<<<<<<<<<< * next_next: cython.int = i + 2 * if ( */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_next = __pyx_t_4; - /* "w3lib/_url.pyx":600 + /* "w3lib/_url.pyx":599 * elif isomorph == "%": * next: cython.int = i + 1 * next_next: cython.int = i + 2 # <<<<<<<<<<<<<< * if ( * encode_output_length <= next_next */ - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_next_next = __pyx_t_4; - /* "w3lib/_url.pyx":602 + /* "w3lib/_url.pyx":601 * next_next: cython.int = i + 2 * if ( * encode_output_length <= next_next # <<<<<<<<<<<<<< @@ -7789,21 +7966,21 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ goto __pyx_L9_bool_binop_done; } - /* "w3lib/_url.pyx":603 + /* "w3lib/_url.pyx":602 * if ( * encode_output_length <= next_next * or chr(encode_output[next]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * or chr(encode_output[next_next]) not in _ASCII_HEX_DIGIT * ): */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_encode_output, __pyx_v_next, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_encode_output, __pyx_v_next, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_3, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_3, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_10) { @@ -7812,27 +7989,27 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ goto __pyx_L9_bool_binop_done; } - /* "w3lib/_url.pyx":604 + /* "w3lib/_url.pyx":603 * encode_output_length <= next_next * or chr(encode_output[next]) not in _ASCII_HEX_DIGIT * or chr(encode_output[next_next]) not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * ): * output += "%25" */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_encode_output, __pyx_v_next_next, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_encode_output, __pyx_v_next_next, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_3, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_3, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L9_bool_binop_done:; - /* "w3lib/_url.pyx":601 + /* "w3lib/_url.pyx":600 * next: cython.int = i + 1 * next_next: cython.int = i + 2 * if ( # <<<<<<<<<<<<<< @@ -7841,19 +8018,19 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ */ if (__pyx_t_9) { - /* "w3lib/_url.pyx":606 + /* "w3lib/_url.pyx":605 * or chr(encode_output[next_next]) not in _ASCII_HEX_DIGIT * ): * output += "%25" # <<<<<<<<<<<<<< * else: * output += "%" */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u_25); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u_25); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":601 + /* "w3lib/_url.pyx":600 * next: cython.int = i + 1 * next_next: cython.int = i + 2 * if ( # <<<<<<<<<<<<<< @@ -7863,7 +8040,7 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ goto __pyx_L8; } - /* "w3lib/_url.pyx":608 + /* "w3lib/_url.pyx":607 * output += "%25" * else: * output += "%" # <<<<<<<<<<<<<< @@ -7871,14 +8048,14 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ * output += f"%{byte:02X}" */ /*else*/ { - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L8:; - /* "w3lib/_url.pyx":598 + /* "w3lib/_url.pyx":597 * if isomorph not in percent_encode_set: * output += isomorph * elif isomorph == "%": # <<<<<<<<<<<<<< @@ -7888,7 +8065,7 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ goto __pyx_L7; } - /* "w3lib/_url.pyx":610 + /* "w3lib/_url.pyx":609 * output += "%" * else: * output += f"%{byte:02X}" # <<<<<<<<<<<<<< @@ -7896,12 +8073,12 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ * return output */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_Format(__pyx_v_byte, __pyx_kp_u_02X); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Format(__pyx_v_byte, __pyx_kp_u_02X); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__3, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__3, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3); @@ -7909,7 +8086,7 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ } __pyx_L7:; - /* "w3lib/_url.pyx":593 + /* "w3lib/_url.pyx":592 * encode_output, _ = encoder(input, "xmlcharrefreplace") * encode_output_length: cython.int = len(encode_output) * for i in range(encode_output_length): # pylint: disable=consider-using-enumerate # <<<<<<<<<<<<<< @@ -7919,7 +8096,7 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":612 + /* "w3lib/_url.pyx":611 * output += f"%{byte:02X}" * * return output # <<<<<<<<<<<<<< @@ -7927,7 +8104,7 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 612, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_INCREF(__pyx_v_output); __pyx_r = ((PyObject*)__pyx_v_output); goto __pyx_L0; @@ -7935,9 +8112,9 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ /* "w3lib/_url.pyx":580 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode * # Extended to handled cases where % is to be percent-encoded. - * @cfunc # <<<<<<<<<<<<<< - * def _percent_encode_after_encoding( + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< * input: str, + * *, */ /* function exit code */ @@ -7947,7 +8124,7 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("w3lib._url._percent_encode_after_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_encoder); __Pyx_XDECREF(__pyx_v_output); @@ -7961,7 +8138,7 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ return __pyx_r; } -/* "w3lib/_url.pyx":683 +/* "w3lib/_url.pyx":682 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< @@ -7970,15 +8147,15 @@ static PyObject *__pyx_f_5w3lib_4_url__percent_encode_after_encoding(PyObject *_ */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_9_parse_ipv6(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_9_parse_ipv6 = {"_parse_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_9_parse_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_9_parse_ipv6(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_11_parse_ipv6 = {"_parse_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_11_parse_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_11_parse_ipv6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -8022,12 +8199,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv6") < 0)) __PYX_ERR(0, 683, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv6") < 0)) __PYX_ERR(0, 682, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -8038,7 +8215,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 683, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 682, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8052,8 +8229,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 683, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_8_parse_ipv6(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_10_parse_ipv6(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -8070,7 +8247,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_10_parse_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_v_address = NULL; PyObject *__pyx_v_piece_index = NULL; PyObject *__pyx_v_compress = NULL; @@ -8096,26 +8273,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_ipv6", 1); - /* "w3lib/_url.pyx":684 + /* "w3lib/_url.pyx":683 * * def _parse_ipv6(input: str) -> List[int]: * address = [0] * 8 # <<<<<<<<<<<<<< * piece_index = 0 * compress = None */ - __pyx_t_1 = PyList_New(1 * 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < 8; __pyx_temp++) { __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0)) __PYX_ERR(0, 684, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0)) __PYX_ERR(0, 683, __pyx_L1_error); } } __pyx_v_address = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":685 + /* "w3lib/_url.pyx":684 * def _parse_ipv6(input: str) -> List[int]: * address = [0] * 8 * piece_index = 0 # <<<<<<<<<<<<<< @@ -8125,7 +8302,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_int_0); __pyx_v_piece_index = __pyx_int_0; - /* "w3lib/_url.pyx":686 + /* "w3lib/_url.pyx":685 * address = [0] * 8 * piece_index = 0 * compress = None # <<<<<<<<<<<<<< @@ -8135,7 +8312,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(Py_None); __pyx_v_compress = Py_None; - /* "w3lib/_url.pyx":687 + /* "w3lib/_url.pyx":686 * piece_index = 0 * compress = None * pointer = 0 # <<<<<<<<<<<<<< @@ -8145,75 +8322,75 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_int_0); __pyx_v_pointer = __pyx_int_0; - /* "w3lib/_url.pyx":688 + /* "w3lib/_url.pyx":687 * compress = None * pointer = 0 * input_length = len(input) # <<<<<<<<<<<<<< * if pointer < input_length and input[pointer] == ":": * if pointer + 1 >= input_length or input[pointer + 1] != ":": */ - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 687, __pyx_L1_error) __pyx_v_input_length = __pyx_t_2; - /* "w3lib/_url.pyx":689 + /* "w3lib/_url.pyx":688 * pointer = 0 * input_length = len(input) * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< * if pointer + 1 >= input_length or input[pointer + 1] != ":": * raise ValueError */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":690 + /* "w3lib/_url.pyx":689 * input_length = len(input) * if pointer < input_length and input[pointer] == ":": * if pointer + 1 >= input_length or input[pointer + 1] != ":": # <<<<<<<<<<<<<< * raise ValueError * pointer += 2 */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 690, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 690, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L7_bool_binop_done; } - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 690, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__4, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 690, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__4, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L7_bool_binop_done:; if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":691 + /* "w3lib/_url.pyx":690 * if pointer < input_length and input[pointer] == ":": * if pointer + 1 >= input_length or input[pointer + 1] != ":": * raise ValueError # <<<<<<<<<<<<<< @@ -8221,9 +8398,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * piece_index += 1 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 691, __pyx_L1_error) + __PYX_ERR(0, 690, __pyx_L1_error) - /* "w3lib/_url.pyx":690 + /* "w3lib/_url.pyx":689 * input_length = len(input) * if pointer < input_length and input[pointer] == ":": * if pointer + 1 >= input_length or input[pointer + 1] != ":": # <<<<<<<<<<<<<< @@ -8232,31 +8409,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":692 + /* "w3lib/_url.pyx":691 * if pointer + 1 >= input_length or input[pointer + 1] != ":": * raise ValueError * pointer += 2 # <<<<<<<<<<<<<< * piece_index += 1 * compress = piece_index */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":693 + /* "w3lib/_url.pyx":692 * raise ValueError * pointer += 2 * piece_index += 1 # <<<<<<<<<<<<<< * compress = piece_index * while pointer < input_length: */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":694 + /* "w3lib/_url.pyx":693 * pointer += 2 * piece_index += 1 * compress = piece_index # <<<<<<<<<<<<<< @@ -8266,7 +8443,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_piece_index); __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); - /* "w3lib/_url.pyx":689 + /* "w3lib/_url.pyx":688 * pointer = 0 * input_length = len(input) * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< @@ -8275,7 +8452,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":695 + /* "w3lib/_url.pyx":694 * piece_index += 1 * compress = piece_index * while pointer < input_length: # <<<<<<<<<<<<<< @@ -8283,25 +8460,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * raise ValueError */ while (1) { - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":696 + /* "w3lib/_url.pyx":695 * compress = piece_index * while pointer < input_length: * if piece_index == 8: # <<<<<<<<<<<<<< * raise ValueError * if input[pointer] == ":": */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 695, __pyx_L1_error) if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":697 + /* "w3lib/_url.pyx":696 * while pointer < input_length: * if piece_index == 8: * raise ValueError # <<<<<<<<<<<<<< @@ -8309,9 +8486,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * if compress is not None: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 696, __pyx_L1_error) - /* "w3lib/_url.pyx":696 + /* "w3lib/_url.pyx":695 * compress = piece_index * while pointer < input_length: * if piece_index == 8: # <<<<<<<<<<<<<< @@ -8320,20 +8497,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":698 + /* "w3lib/_url.pyx":697 * if piece_index == 8: * raise ValueError * if input[pointer] == ":": # <<<<<<<<<<<<<< * if compress is not None: * raise ValueError */ - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":699 + /* "w3lib/_url.pyx":698 * raise ValueError * if input[pointer] == ":": * if compress is not None: # <<<<<<<<<<<<<< @@ -8343,7 +8520,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_compress != Py_None); if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":700 + /* "w3lib/_url.pyx":699 * if input[pointer] == ":": * if compress is not None: * raise ValueError # <<<<<<<<<<<<<< @@ -8351,9 +8528,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * piece_index += 1 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 700, __pyx_L1_error) + __PYX_ERR(0, 699, __pyx_L1_error) - /* "w3lib/_url.pyx":699 + /* "w3lib/_url.pyx":698 * raise ValueError * if input[pointer] == ":": * if compress is not None: # <<<<<<<<<<<<<< @@ -8362,31 +8539,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":701 + /* "w3lib/_url.pyx":700 * if compress is not None: * raise ValueError * pointer += 1 # <<<<<<<<<<<<<< * piece_index += 1 * compress = piece_index */ - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":702 + /* "w3lib/_url.pyx":701 * raise ValueError * pointer += 1 * piece_index += 1 # <<<<<<<<<<<<<< * compress = piece_index * continue */ - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":703 + /* "w3lib/_url.pyx":702 * pointer += 1 * piece_index += 1 * compress = piece_index # <<<<<<<<<<<<<< @@ -8396,7 +8573,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_piece_index); __Pyx_DECREF_SET(__pyx_v_compress, __pyx_v_piece_index); - /* "w3lib/_url.pyx":704 + /* "w3lib/_url.pyx":703 * piece_index += 1 * compress = piece_index * continue # <<<<<<<<<<<<<< @@ -8405,7 +8582,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ goto __pyx_L9_continue; - /* "w3lib/_url.pyx":698 + /* "w3lib/_url.pyx":697 * if piece_index == 8: * raise ValueError * if input[pointer] == ":": # <<<<<<<<<<<<<< @@ -8414,7 +8591,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":705 + /* "w3lib/_url.pyx":704 * compress = piece_index * continue * value = length = 0 # <<<<<<<<<<<<<< @@ -8426,7 +8603,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_int_0); - /* "w3lib/_url.pyx":706 + /* "w3lib/_url.pyx":705 * continue * value = length = 0 * while ( # <<<<<<<<<<<<<< @@ -8435,135 +8612,135 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ while (1) { - /* "w3lib/_url.pyx":707 + /* "w3lib/_url.pyx":706 * value = length = 0 * while ( * length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * ): * value = value * 0x10 + int(input[pointer], base=16) */ - __pyx_t_6 = PyObject_RichCompare(__pyx_v_length, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 707, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_length, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 706, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L16_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L16_bool_binop_done:; if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":709 + /* "w3lib/_url.pyx":708 * length < 4 and pointer < input_length and input[pointer] in _ASCII_HEX_DIGIT * ): * value = value * 0x10 + int(input[pointer], base=16) # <<<<<<<<<<<<<< * pointer += 1 * length += 1 */ - __pyx_t_6 = __Pyx_PyInt_MultiplyObjC(__pyx_v_value, __pyx_int_16, 0x10, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 709, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_MultiplyObjC(__pyx_v_value, __pyx_int_16, 0x10, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 709, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 709, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base, __pyx_int_16) < 0) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":710 + /* "w3lib/_url.pyx":709 * ): * value = value * 0x10 + int(input[pointer], base=16) * pointer += 1 # <<<<<<<<<<<<<< * length += 1 * if pointer < input_length and input[pointer] == ".": */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":711 + /* "w3lib/_url.pyx":710 * value = value * 0x10 + int(input[pointer], base=16) * pointer += 1 * length += 1 # <<<<<<<<<<<<<< * if pointer < input_length and input[pointer] == ".": * if length == 0: */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_length, __pyx_t_1); __pyx_t_1 = 0; } - /* "w3lib/_url.pyx":712 + /* "w3lib/_url.pyx":711 * pointer += 1 * length += 1 * if pointer < input_length and input[pointer] == ".": # <<<<<<<<<<<<<< * if length == 0: * raise ValueError */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L20_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":713 + /* "w3lib/_url.pyx":712 * length += 1 * if pointer < input_length and input[pointer] == ".": * if length == 0: # <<<<<<<<<<<<<< * raise ValueError * pointer -= length */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_length, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 713, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_length, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":714 + /* "w3lib/_url.pyx":713 * if pointer < input_length and input[pointer] == ".": * if length == 0: * raise ValueError # <<<<<<<<<<<<<< @@ -8571,9 +8748,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * if piece_index > 6: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 714, __pyx_L1_error) + __PYX_ERR(0, 713, __pyx_L1_error) - /* "w3lib/_url.pyx":713 + /* "w3lib/_url.pyx":712 * length += 1 * if pointer < input_length and input[pointer] == ".": * if length == 0: # <<<<<<<<<<<<<< @@ -8582,31 +8759,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":715 + /* "w3lib/_url.pyx":714 * if length == 0: * raise ValueError * pointer -= length # <<<<<<<<<<<<<< * if piece_index > 6: * raise ValueError */ - __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_v_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_pointer, __pyx_v_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":716 + /* "w3lib/_url.pyx":715 * raise ValueError * pointer -= length * if piece_index > 6: # <<<<<<<<<<<<<< * raise ValueError * numbers_seen = 0 */ - __pyx_t_7 = PyObject_RichCompare(__pyx_v_piece_index, __pyx_int_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 716, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 716, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_piece_index, __pyx_int_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":717 + /* "w3lib/_url.pyx":716 * pointer -= length * if piece_index > 6: * raise ValueError # <<<<<<<<<<<<<< @@ -8614,9 +8791,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * while pointer < input_length: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 717, __pyx_L1_error) + __PYX_ERR(0, 716, __pyx_L1_error) - /* "w3lib/_url.pyx":716 + /* "w3lib/_url.pyx":715 * raise ValueError * pointer -= length * if piece_index > 6: # <<<<<<<<<<<<<< @@ -8625,7 +8802,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":718 + /* "w3lib/_url.pyx":717 * if piece_index > 6: * raise ValueError * numbers_seen = 0 # <<<<<<<<<<<<<< @@ -8635,7 +8812,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_int_0); __pyx_v_numbers_seen = __pyx_int_0; - /* "w3lib/_url.pyx":719 + /* "w3lib/_url.pyx":718 * raise ValueError * numbers_seen = 0 * while pointer < input_length: # <<<<<<<<<<<<<< @@ -8643,15 +8820,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * if numbers_seen > 0: */ while (1) { - __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 719, __pyx_L1_error) + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 719, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":720 + /* "w3lib/_url.pyx":719 * numbers_seen = 0 * while pointer < input_length: * ipv4_piece = None # <<<<<<<<<<<<<< @@ -8661,54 +8838,54 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_ipv4_piece, Py_None); - /* "w3lib/_url.pyx":721 + /* "w3lib/_url.pyx":720 * while pointer < input_length: * ipv4_piece = None * if numbers_seen > 0: # <<<<<<<<<<<<<< * if input[pointer] == "." and numbers_seen < 4: * pointer += 1 */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":722 + /* "w3lib/_url.pyx":721 * ipv4_piece = None * if numbers_seen > 0: * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< * pointer += 1 * else: */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L28_bool_binop_done; } - __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_numbers_seen, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L28_bool_binop_done:; if (likely(__pyx_t_3)) { - /* "w3lib/_url.pyx":723 + /* "w3lib/_url.pyx":722 * if numbers_seen > 0: * if input[pointer] == "." and numbers_seen < 4: * pointer += 1 # <<<<<<<<<<<<<< * else: * raise ValueError */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":722 + /* "w3lib/_url.pyx":721 * ipv4_piece = None * if numbers_seen > 0: * if input[pointer] == "." and numbers_seen < 4: # <<<<<<<<<<<<<< @@ -8718,7 +8895,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py goto __pyx_L27; } - /* "w3lib/_url.pyx":725 + /* "w3lib/_url.pyx":724 * pointer += 1 * else: * raise ValueError # <<<<<<<<<<<<<< @@ -8727,11 +8904,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ /*else*/ { __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 725, __pyx_L1_error) + __PYX_ERR(0, 724, __pyx_L1_error) } __pyx_L27:; - /* "w3lib/_url.pyx":721 + /* "w3lib/_url.pyx":720 * while pointer < input_length: * ipv4_piece = None * if numbers_seen > 0: # <<<<<<<<<<<<<< @@ -8740,36 +8917,36 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":726 + /* "w3lib/_url.pyx":725 * else: * raise ValueError * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< * raise ValueError * while pointer < input_length and input[pointer] in _ASCII_DIGIT: */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L31_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L31_bool_binop_done:; if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":727 + /* "w3lib/_url.pyx":726 * raise ValueError * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: * raise ValueError # <<<<<<<<<<<<<< @@ -8777,9 +8954,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * number = int(input[pointer]) */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 727, __pyx_L1_error) + __PYX_ERR(0, 726, __pyx_L1_error) - /* "w3lib/_url.pyx":726 + /* "w3lib/_url.pyx":725 * else: * raise ValueError * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: # <<<<<<<<<<<<<< @@ -8788,7 +8965,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":728 + /* "w3lib/_url.pyx":727 * if pointer >= input_length or input[pointer] not in _ASCII_DIGIT: * raise ValueError * while pointer < input_length and input[pointer] in _ASCII_DIGIT: # <<<<<<<<<<<<<< @@ -8796,44 +8973,44 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * if ipv4_piece is None: */ while (1) { - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L35_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L35_bool_binop_done:; if (!__pyx_t_3) break; - /* "w3lib/_url.pyx":729 + /* "w3lib/_url.pyx":728 * raise ValueError * while pointer < input_length and input[pointer] in _ASCII_DIGIT: * number = int(input[pointer]) # <<<<<<<<<<<<<< * if ipv4_piece is None: * ipv4_piece = number */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_number, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":730 + /* "w3lib/_url.pyx":729 * while pointer < input_length and input[pointer] in _ASCII_DIGIT: * number = int(input[pointer]) * if ipv4_piece is None: # <<<<<<<<<<<<<< @@ -8843,7 +9020,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_ipv4_piece == Py_None); if (__pyx_t_3) { - /* "w3lib/_url.pyx":731 + /* "w3lib/_url.pyx":730 * number = int(input[pointer]) * if ipv4_piece is None: * ipv4_piece = number # <<<<<<<<<<<<<< @@ -8853,7 +9030,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_number); __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_v_number); - /* "w3lib/_url.pyx":730 + /* "w3lib/_url.pyx":729 * while pointer < input_length and input[pointer] in _ASCII_DIGIT: * number = int(input[pointer]) * if ipv4_piece is None: # <<<<<<<<<<<<<< @@ -8863,17 +9040,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py goto __pyx_L37; } - /* "w3lib/_url.pyx":732 + /* "w3lib/_url.pyx":731 * if ipv4_piece is None: * ipv4_piece = number * elif ipv4_piece == 0: # <<<<<<<<<<<<<< * raise ValueError * else: */ - __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_ipv4_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_ipv4_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 731, __pyx_L1_error) if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":733 + /* "w3lib/_url.pyx":732 * ipv4_piece = number * elif ipv4_piece == 0: * raise ValueError # <<<<<<<<<<<<<< @@ -8881,9 +9058,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * ipv4_piece = ipv4_piece * 10 + number */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 733, __pyx_L1_error) + __PYX_ERR(0, 732, __pyx_L1_error) - /* "w3lib/_url.pyx":732 + /* "w3lib/_url.pyx":731 * if ipv4_piece is None: * ipv4_piece = number * elif ipv4_piece == 0: # <<<<<<<<<<<<<< @@ -8892,7 +9069,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":735 + /* "w3lib/_url.pyx":734 * raise ValueError * else: * ipv4_piece = ipv4_piece * 10 + number # <<<<<<<<<<<<<< @@ -8900,9 +9077,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * raise ValueError */ /*else*/ { - __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ipv4_piece, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ipv4_piece, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_ipv4_piece, __pyx_t_1); @@ -8910,19 +9087,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py } __pyx_L37:; - /* "w3lib/_url.pyx":736 + /* "w3lib/_url.pyx":735 * else: * ipv4_piece = ipv4_piece * 10 + number * if ipv4_piece > 255: # <<<<<<<<<<<<<< * raise ValueError * pointer += 1 */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ipv4_piece, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ipv4_piece, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_3)) { - /* "w3lib/_url.pyx":737 + /* "w3lib/_url.pyx":736 * ipv4_piece = ipv4_piece * 10 + number * if ipv4_piece > 255: * raise ValueError # <<<<<<<<<<<<<< @@ -8930,9 +9107,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * assert isinstance(ipv4_piece, int) */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 737, __pyx_L1_error) + __PYX_ERR(0, 736, __pyx_L1_error) - /* "w3lib/_url.pyx":736 + /* "w3lib/_url.pyx":735 * else: * ipv4_piece = ipv4_piece * 10 + number * if ipv4_piece > 255: # <<<<<<<<<<<<<< @@ -8941,20 +9118,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":738 + /* "w3lib/_url.pyx":737 * if ipv4_piece > 255: * raise ValueError * pointer += 1 # <<<<<<<<<<<<<< * assert isinstance(ipv4_piece, int) * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_1); __pyx_t_1 = 0; } - /* "w3lib/_url.pyx":739 + /* "w3lib/_url.pyx":738 * raise ValueError * pointer += 1 * assert isinstance(ipv4_piece, int) # <<<<<<<<<<<<<< @@ -8966,44 +9143,44 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __pyx_t_3 = PyInt_Check(__pyx_v_ipv4_piece); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 739, __pyx_L1_error) + __PYX_ERR(0, 738, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 739, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 738, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":740 + /* "w3lib/_url.pyx":739 * pointer += 1 * assert isinstance(ipv4_piece, int) * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece # <<<<<<<<<<<<<< * numbers_seen += 1 * if numbers_seen in (2, 4): */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_ipv4_piece); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_ipv4_piece); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_1) < 0))) __PYX_ERR(0, 740, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_1) < 0))) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":741 + /* "w3lib/_url.pyx":740 * assert isinstance(ipv4_piece, int) * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece * numbers_seen += 1 # <<<<<<<<<<<<<< * if numbers_seen in (2, 4): * piece_index += 1 */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_numbers_seen, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_numbers_seen, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_numbers_seen, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":742 + /* "w3lib/_url.pyx":741 * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece * numbers_seen += 1 * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< @@ -9012,32 +9189,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ __Pyx_INCREF(__pyx_v_numbers_seen); __pyx_t_1 = __pyx_v_numbers_seen; - __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 742, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 741, __pyx_L1_error) if (!__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L40_bool_binop_done; } - __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 742, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 741, __pyx_L1_error) __pyx_t_3 = __pyx_t_5; __pyx_L40_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_3; if (__pyx_t_5) { - /* "w3lib/_url.pyx":743 + /* "w3lib/_url.pyx":742 * numbers_seen += 1 * if numbers_seen in (2, 4): * piece_index += 1 # <<<<<<<<<<<<<< * if numbers_seen != 4: * raise ValueError */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 743, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":742 + /* "w3lib/_url.pyx":741 * address[piece_index] = address[piece_index] * 0x100 + ipv4_piece * numbers_seen += 1 * if numbers_seen in (2, 4): # <<<<<<<<<<<<<< @@ -9047,17 +9224,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py } } - /* "w3lib/_url.pyx":744 + /* "w3lib/_url.pyx":743 * if numbers_seen in (2, 4): * piece_index += 1 * if numbers_seen != 4: # <<<<<<<<<<<<<< * raise ValueError * break */ - __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_numbers_seen, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_numbers_seen, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 743, __pyx_L1_error) if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":745 + /* "w3lib/_url.pyx":744 * piece_index += 1 * if numbers_seen != 4: * raise ValueError # <<<<<<<<<<<<<< @@ -9065,9 +9242,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * if pointer < input_length and input[pointer] == ":": */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 745, __pyx_L1_error) + __PYX_ERR(0, 744, __pyx_L1_error) - /* "w3lib/_url.pyx":744 + /* "w3lib/_url.pyx":743 * if numbers_seen in (2, 4): * piece_index += 1 * if numbers_seen != 4: # <<<<<<<<<<<<<< @@ -9076,7 +9253,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":746 + /* "w3lib/_url.pyx":745 * if numbers_seen != 4: * raise ValueError * break # <<<<<<<<<<<<<< @@ -9085,7 +9262,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ goto __pyx_L10_break; - /* "w3lib/_url.pyx":712 + /* "w3lib/_url.pyx":711 * pointer += 1 * length += 1 * if pointer < input_length and input[pointer] == ".": # <<<<<<<<<<<<<< @@ -9094,60 +9271,60 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":747 + /* "w3lib/_url.pyx":746 * raise ValueError * break * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< * pointer += 1 * if pointer >= input_length: */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L44_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = __pyx_t_3; __pyx_L44_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":748 + /* "w3lib/_url.pyx":747 * break * if pointer < input_length and input[pointer] == ":": * pointer += 1 # <<<<<<<<<<<<<< * if pointer >= input_length: * raise ValueError */ - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 748, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_pointer, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_pointer, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":749 + /* "w3lib/_url.pyx":748 * if pointer < input_length and input[pointer] == ":": * pointer += 1 * if pointer >= input_length: # <<<<<<<<<<<<<< * raise ValueError * elif pointer < input_length: */ - __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":750 + /* "w3lib/_url.pyx":749 * pointer += 1 * if pointer >= input_length: * raise ValueError # <<<<<<<<<<<<<< @@ -9155,9 +9332,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * raise ValueError */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 750, __pyx_L1_error) + __PYX_ERR(0, 749, __pyx_L1_error) - /* "w3lib/_url.pyx":749 + /* "w3lib/_url.pyx":748 * if pointer < input_length and input[pointer] == ":": * pointer += 1 * if pointer >= input_length: # <<<<<<<<<<<<<< @@ -9166,7 +9343,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":747 + /* "w3lib/_url.pyx":746 * raise ValueError * break * if pointer < input_length and input[pointer] == ":": # <<<<<<<<<<<<<< @@ -9176,22 +9353,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py goto __pyx_L43; } - /* "w3lib/_url.pyx":751 + /* "w3lib/_url.pyx":750 * if pointer >= input_length: * raise ValueError * elif pointer < input_length: # <<<<<<<<<<<<<< * raise ValueError * address[piece_index] = value */ - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_input_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_pointer, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":752 + /* "w3lib/_url.pyx":751 * raise ValueError * elif pointer < input_length: * raise ValueError # <<<<<<<<<<<<<< @@ -9199,9 +9376,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * piece_index += 1 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 752, __pyx_L1_error) + __PYX_ERR(0, 751, __pyx_L1_error) - /* "w3lib/_url.pyx":751 + /* "w3lib/_url.pyx":750 * if pointer >= input_length: * raise ValueError * elif pointer < input_length: # <<<<<<<<<<<<<< @@ -9211,23 +9388,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py } __pyx_L43:; - /* "w3lib/_url.pyx":753 + /* "w3lib/_url.pyx":752 * elif pointer < input_length: * raise ValueError * address[piece_index] = value # <<<<<<<<<<<<<< * piece_index += 1 * if compress is not None: */ - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_v_value) < 0))) __PYX_ERR(0, 753, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_v_value) < 0))) __PYX_ERR(0, 752, __pyx_L1_error) - /* "w3lib/_url.pyx":754 + /* "w3lib/_url.pyx":753 * raise ValueError * address[piece_index] = value * piece_index += 1 # <<<<<<<<<<<<<< * if compress is not None: * swaps = piece_index - compress */ - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_7); __pyx_t_7 = 0; @@ -9235,7 +9412,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py } __pyx_L10_break:; - /* "w3lib/_url.pyx":755 + /* "w3lib/_url.pyx":754 * address[piece_index] = value * piece_index += 1 * if compress is not None: # <<<<<<<<<<<<<< @@ -9245,19 +9422,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (__pyx_v_compress != Py_None); if (__pyx_t_5) { - /* "w3lib/_url.pyx":756 + /* "w3lib/_url.pyx":755 * piece_index += 1 * if compress is not None: * swaps = piece_index - compress # <<<<<<<<<<<<<< * piece_index = 7 * while piece_index != 0 and swaps > 0: */ - __pyx_t_7 = PyNumber_Subtract(__pyx_v_piece_index, __pyx_v_compress); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_v_piece_index, __pyx_v_compress); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_swaps = __pyx_t_7; __pyx_t_7 = 0; - /* "w3lib/_url.pyx":757 + /* "w3lib/_url.pyx":756 * if compress is not None: * swaps = piece_index - compress * piece_index = 7 # <<<<<<<<<<<<<< @@ -9267,7 +9444,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_int_7); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_int_7); - /* "w3lib/_url.pyx":758 + /* "w3lib/_url.pyx":757 * swaps = piece_index - compress * piece_index = 7 * while piece_index != 0 and swaps > 0: # <<<<<<<<<<<<<< @@ -9275,89 +9452,89 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * address[compress + swaps - 1], */ while (1) { - __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L50_bool_binop_done; } - __pyx_t_7 = PyObject_RichCompare(__pyx_v_swaps, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 758, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_swaps, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = __pyx_t_3; __pyx_L50_bool_binop_done:; if (!__pyx_t_5) break; - /* "w3lib/_url.pyx":760 + /* "w3lib/_url.pyx":759 * while piece_index != 0 and swaps > 0: * address[piece_index], address[compress + swaps - 1] = ( * address[compress + swaps - 1], # <<<<<<<<<<<<<< * address[piece_index], * ) */ - __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 760, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 760, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":761 + /* "w3lib/_url.pyx":760 * address[piece_index], address[compress + swaps - 1] = ( * address[compress + swaps - 1], * address[piece_index], # <<<<<<<<<<<<<< * ) * piece_index -= 1 */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_address, __pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":759 + /* "w3lib/_url.pyx":758 * piece_index = 7 * while piece_index != 0 and swaps > 0: * address[piece_index], address[compress + swaps - 1] = ( # <<<<<<<<<<<<<< * address[compress + swaps - 1], * address[piece_index], */ - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_7) < 0))) __PYX_ERR(0, 759, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_v_piece_index, __pyx_t_7) < 0))) __PYX_ERR(0, 758, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 759, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_v_compress, __pyx_v_swaps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 759, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_t_6, __pyx_t_1) < 0))) __PYX_ERR(0, 759, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_address, __pyx_t_6, __pyx_t_1) < 0))) __PYX_ERR(0, 758, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":763 + /* "w3lib/_url.pyx":762 * address[piece_index], * ) * piece_index -= 1 # <<<<<<<<<<<<<< * swaps -= 1 * elif compress is None and piece_index != 8: */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_piece_index, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_piece_index, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":764 + /* "w3lib/_url.pyx":763 * ) * piece_index -= 1 * swaps -= 1 # <<<<<<<<<<<<<< * elif compress is None and piece_index != 8: * raise ValueError */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_swaps, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_swaps, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_swaps, __pyx_t_1); __pyx_t_1 = 0; } - /* "w3lib/_url.pyx":755 + /* "w3lib/_url.pyx":754 * address[piece_index] = value * piece_index += 1 * if compress is not None: # <<<<<<<<<<<<<< @@ -9367,7 +9544,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py goto __pyx_L47; } - /* "w3lib/_url.pyx":765 + /* "w3lib/_url.pyx":764 * piece_index -= 1 * swaps -= 1 * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< @@ -9380,12 +9557,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __pyx_t_5 = __pyx_t_3; goto __pyx_L52_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 765, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece_index, __pyx_int_8, 8, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 764, __pyx_L1_error) __pyx_t_5 = __pyx_t_3; __pyx_L52_bool_binop_done:; if (unlikely(__pyx_t_5)) { - /* "w3lib/_url.pyx":766 + /* "w3lib/_url.pyx":765 * swaps -= 1 * elif compress is None and piece_index != 8: * raise ValueError # <<<<<<<<<<<<<< @@ -9393,9 +9570,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py * */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 766, __pyx_L1_error) + __PYX_ERR(0, 765, __pyx_L1_error) - /* "w3lib/_url.pyx":765 + /* "w3lib/_url.pyx":764 * piece_index -= 1 * swaps -= 1 * elif compress is None and piece_index != 8: # <<<<<<<<<<<<<< @@ -9405,7 +9582,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py } __pyx_L47:; - /* "w3lib/_url.pyx":767 + /* "w3lib/_url.pyx":766 * elif compress is None and piece_index != 8: * raise ValueError * return address # <<<<<<<<<<<<<< @@ -9417,7 +9594,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_address; goto __pyx_L0; - /* "w3lib/_url.pyx":683 + /* "w3lib/_url.pyx":682 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< @@ -9449,7 +9626,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "w3lib/_url.pyx":770 +/* "w3lib/_url.pyx":769 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -9458,15 +9635,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_8_parse_ipv6(CYTHON_UNUSED PyObject *__py */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_11_utf_8_percent_encode(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_11_utf_8_percent_encode = {"_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_11_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_11_utf_8_percent_encode(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_13_utf_8_percent_encode = {"_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_13_utf_8_percent_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -9513,7 +9690,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 770, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 769, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -9521,14 +9698,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 770, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 769, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, 1); __PYX_ERR(0, 770, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, 1); __PYX_ERR(0, 769, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_utf_8_percent_encode") < 0)) __PYX_ERR(0, 770, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_utf_8_percent_encode") < 0)) __PYX_ERR(0, 769, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -9541,7 +9718,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 770, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_utf_8_percent_encode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 769, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9555,8 +9732,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 771, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_10_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_percent_encode_set); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_percent_encode_set); /* function exit code */ goto __pyx_L0; @@ -9573,16 +9750,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_10_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set) { +static PyObject *__pyx_pf_5w3lib_4_url_12_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_percent_encode_set) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_utf_8_percent_encode", 1); - /* "w3lib/_url.pyx":774 + /* "w3lib/_url.pyx":773 * percent_encode_set: _PercentEncodeSet, * ) -> str: * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< @@ -9590,21 +9770,60 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_utf_8_percent_encode(CYTHON_UNUSED PyO * encoding="utf-8", */ __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "w3lib/_url.pyx":774 + * ) -> str: + * return _percent_encode_after_encoding( + * input, # <<<<<<<<<<<<<< + * encoding="utf-8", + * percent_encode_set=percent_encode_set, + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_input); + __Pyx_GIVEREF(__pyx_v_input); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input)) __PYX_ERR(0, 773, __pyx_L1_error); + + /* "w3lib/_url.pyx":775 + * return _percent_encode_after_encoding( + * input, + * encoding="utf-8", # <<<<<<<<<<<<<< + * percent_encode_set=percent_encode_set, + * ) + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_kp_u_utf_8) < 0) __PYX_ERR(0, 775, __pyx_L1_error) - /* "w3lib/_url.pyx":777 + /* "w3lib/_url.pyx":776 * input, * encoding="utf-8", * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __pyx_f_5w3lib_4_url__percent_encode_after_encoding(__pyx_v_input, __pyx_kp_u_utf_8, __pyx_v_percent_encode_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 775, __pyx_L1_error) + + /* "w3lib/_url.pyx":773 + * percent_encode_set: _PercentEncodeSet, + * ) -> str: + * return _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input, + * encoding="utf-8", + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":770 + /* "w3lib/_url.pyx":769 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -9615,6 +9834,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_utf_8_percent_encode(CYTHON_UNUSED PyO /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("w3lib._url._utf_8_percent_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -9623,7 +9845,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_utf_8_percent_encode(CYTHON_UNUSED PyO return __pyx_r; } -/* "w3lib/_url.pyx":782 +/* "w3lib/_url.pyx":781 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< @@ -9632,15 +9854,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_10_utf_8_percent_encode(CYTHON_UNUSED PyO */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_13_parse_opaque_host(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_15_parse_opaque_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_13_parse_opaque_host = {"_parse_opaque_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_13_parse_opaque_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_13_parse_opaque_host(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_15_parse_opaque_host = {"_parse_opaque_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_15_parse_opaque_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_15_parse_opaque_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -9684,12 +9906,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 782, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_opaque_host") < 0)) __PYX_ERR(0, 782, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_opaque_host") < 0)) __PYX_ERR(0, 781, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -9700,7 +9922,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_opaque_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 782, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_opaque_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 781, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9714,8 +9936,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 782, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_12_parse_opaque_host(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_14_parse_opaque_host(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -9732,7 +9954,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_12_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_14_parse_opaque_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { Py_UCS4 __pyx_v_code_point; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -9753,7 +9975,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_parse_opaque_host(CYTHON_UNUSED PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_opaque_host", 1); - /* "w3lib/_url.pyx":783 + /* "w3lib/_url.pyx":782 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: * for code_point in input: # <<<<<<<<<<<<<< @@ -9762,28 +9984,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_parse_opaque_host(CYTHON_UNUSED PyObje */ __Pyx_INCREF(__pyx_v_input); __pyx_t_1 = __pyx_v_input; - __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 783, __pyx_L1_error) + __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 782, __pyx_L1_error) for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) { __pyx_t_2 = __pyx_t_7; __pyx_v_code_point = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2); - /* "w3lib/_url.pyx":784 + /* "w3lib/_url.pyx":783 * def _parse_opaque_host(input: str) -> str: * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< * raise ValueError * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) */ - __pyx_t_8 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 784, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 784, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(__pyx_t_10)) { - /* "w3lib/_url.pyx":785 + /* "w3lib/_url.pyx":784 * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: * raise ValueError # <<<<<<<<<<<<<< @@ -9791,9 +10013,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_parse_opaque_host(CYTHON_UNUSED PyObje * */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 785, __pyx_L1_error) + __PYX_ERR(0, 784, __pyx_L1_error) - /* "w3lib/_url.pyx":784 + /* "w3lib/_url.pyx":783 * def _parse_opaque_host(input: str) -> str: * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: # <<<<<<<<<<<<<< @@ -9804,7 +10026,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_parse_opaque_host(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":786 + /* "w3lib/_url.pyx":785 * if code_point in _FORBIDDEN_HOST_CODE_POINTS: * raise ValueError * return _utf_8_percent_encode(input, _C0_CONTROL_PERCENT_ENCODE_SET) # <<<<<<<<<<<<<< @@ -9812,9 +10034,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_parse_opaque_host(CYTHON_UNUSED PyObje * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_5 = 0; @@ -9835,16 +10057,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_parse_opaque_host(CYTHON_UNUSED PyObje __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 786, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_9))) __PYX_ERR(0, 786, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_9))) __PYX_ERR(0, 785, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":782 + /* "w3lib/_url.pyx":781 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< @@ -9867,7 +10089,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_parse_opaque_host(CYTHON_UNUSED PyObje return __pyx_r; } -/* "w3lib/_url.pyx":790 +/* "w3lib/_url.pyx":789 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bint]: # <<<<<<<<<<<<<< @@ -9876,15 +10098,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_12_parse_opaque_host(CYTHON_UNUSED PyObje */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_15_parse_ipv4_number(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_17_parse_ipv4_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_15_parse_ipv4_number = {"_parse_ipv4_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_15_parse_ipv4_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_15_parse_ipv4_number(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_17_parse_ipv4_number = {"_parse_ipv4_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_17_parse_ipv4_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_17_parse_ipv4_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -9928,12 +10150,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 789, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4_number") < 0)) __PYX_ERR(0, 790, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4_number") < 0)) __PYX_ERR(0, 789, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -9944,7 +10166,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv4_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 790, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_ipv4_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 789, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9958,8 +10180,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 790, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_14_parse_ipv4_number(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_16_parse_ipv4_number(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -9976,7 +10198,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_16_parse_ipv4_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { int __pyx_v_validation_error; long __pyx_v_r; PyObject *__pyx_r = NULL; @@ -9994,7 +10216,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje __Pyx_RefNannySetupContext("_parse_ipv4_number", 0); __Pyx_INCREF(__pyx_v_input); - /* "w3lib/_url.pyx":791 + /* "w3lib/_url.pyx":790 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bint]: * if not input: # <<<<<<<<<<<<<< @@ -10005,7 +10227,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":792 + /* "w3lib/_url.pyx":791 * def _parse_ipv4_number(input: str) -> Tuple[int, bint]: * if not input: * raise ValueError # <<<<<<<<<<<<<< @@ -10013,9 +10235,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje * r = 10 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 792, __pyx_L1_error) + __PYX_ERR(0, 791, __pyx_L1_error) - /* "w3lib/_url.pyx":791 + /* "w3lib/_url.pyx":790 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bint]: * if not input: # <<<<<<<<<<<<<< @@ -10024,7 +10246,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje */ } - /* "w3lib/_url.pyx":793 + /* "w3lib/_url.pyx":792 * if not input: * raise ValueError * validation_error = False # <<<<<<<<<<<<<< @@ -10033,7 +10255,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_validation_error = 0; - /* "w3lib/_url.pyx":794 + /* "w3lib/_url.pyx":793 * raise ValueError * validation_error = False * r = 10 # <<<<<<<<<<<<<< @@ -10042,40 +10264,40 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_r = 10; - /* "w3lib/_url.pyx":795 + /* "w3lib/_url.pyx":794 * validation_error = False * r = 10 * if len(input) >= 2: # <<<<<<<<<<<<<< * if input[:2] in ("0X", "0x"): * validation_error = True */ - __pyx_t_3 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 794, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 >= 2); if (__pyx_t_2) { - /* "w3lib/_url.pyx":796 + /* "w3lib/_url.pyx":795 * r = 10 * if len(input) >= 2: * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< * validation_error = True * input = input[2:] */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 796, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0X, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 796, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0X, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 795, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L6_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0x, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 796, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_0x, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 795, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __pyx_L6_bool_binop_done:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_2; if (__pyx_t_1) { - /* "w3lib/_url.pyx":797 + /* "w3lib/_url.pyx":796 * if len(input) >= 2: * if input[:2] in ("0X", "0x"): * validation_error = True # <<<<<<<<<<<<<< @@ -10084,19 +10306,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_validation_error = 1; - /* "w3lib/_url.pyx":798 + /* "w3lib/_url.pyx":797 * if input[:2] in ("0X", "0x"): * validation_error = True * input = input[2:] # <<<<<<<<<<<<<< * r = 16 * elif input[0] == "0": */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":799 + /* "w3lib/_url.pyx":798 * validation_error = True * input = input[2:] * r = 16 # <<<<<<<<<<<<<< @@ -10105,7 +10327,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_r = 16; - /* "w3lib/_url.pyx":796 + /* "w3lib/_url.pyx":795 * r = 10 * if len(input) >= 2: * if input[:2] in ("0X", "0x"): # <<<<<<<<<<<<<< @@ -10115,18 +10337,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje goto __pyx_L5; } - /* "w3lib/_url.pyx":800 + /* "w3lib/_url.pyx":799 * input = input[2:] * r = 16 * elif input[0] == "0": # <<<<<<<<<<<<<< * validation_error = True * input = input[1:] */ - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 800, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 799, __pyx_L1_error) __pyx_t_1 = (__pyx_t_5 == 48); if (__pyx_t_1) { - /* "w3lib/_url.pyx":801 + /* "w3lib/_url.pyx":800 * r = 16 * elif input[0] == "0": * validation_error = True # <<<<<<<<<<<<<< @@ -10135,19 +10357,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_validation_error = 1; - /* "w3lib/_url.pyx":802 + /* "w3lib/_url.pyx":801 * elif input[0] == "0": * validation_error = True * input = input[1:] # <<<<<<<<<<<<<< * r = 8 * if not input: */ - __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":803 + /* "w3lib/_url.pyx":802 * validation_error = True * input = input[1:] * r = 8 # <<<<<<<<<<<<<< @@ -10156,7 +10378,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje */ __pyx_v_r = 8; - /* "w3lib/_url.pyx":800 + /* "w3lib/_url.pyx":799 * input = input[2:] * r = 16 * elif input[0] == "0": # <<<<<<<<<<<<<< @@ -10166,7 +10388,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje } __pyx_L5:; - /* "w3lib/_url.pyx":795 + /* "w3lib/_url.pyx":794 * validation_error = False * r = 10 * if len(input) >= 2: # <<<<<<<<<<<<<< @@ -10175,7 +10397,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje */ } - /* "w3lib/_url.pyx":804 + /* "w3lib/_url.pyx":803 * input = input[1:] * r = 8 * if not input: # <<<<<<<<<<<<<< @@ -10186,7 +10408,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "w3lib/_url.pyx":805 + /* "w3lib/_url.pyx":804 * r = 8 * if not input: * return (0, True) # <<<<<<<<<<<<<< @@ -10198,7 +10420,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje __pyx_r = __pyx_tuple__6; goto __pyx_L0; - /* "w3lib/_url.pyx":804 + /* "w3lib/_url.pyx":803 * input = input[1:] * r = 8 * if not input: # <<<<<<<<<<<<<< @@ -10207,7 +10429,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje */ } - /* "w3lib/_url.pyx":806 + /* "w3lib/_url.pyx":805 * if not input: * return (0, True) * return (int(input, base=r), validation_error) # <<<<<<<<<<<<<< @@ -10215,36 +10437,36 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 806, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_input); __Pyx_GIVEREF(__pyx_v_input); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_input)) __PYX_ERR(0, 806, __pyx_L1_error); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 806, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_input)) __PYX_ERR(0, 805, __pyx_L1_error); + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 806, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base, __pyx_t_7) < 0) __PYX_ERR(0, 806, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base, __pyx_t_7) < 0) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 806, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_validation_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 806, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_validation_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 806, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 806, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 805, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 806, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 805, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":790 + /* "w3lib/_url.pyx":789 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bint]: # <<<<<<<<<<<<<< @@ -10266,7 +10488,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje return __pyx_r; } -/* "w3lib/_url.pyx":810 +/* "w3lib/_url.pyx":809 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bint: # <<<<<<<<<<<<<< @@ -10275,15 +10497,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_14_parse_ipv4_number(CYTHON_UNUSED PyObje */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_17_ends_in_number(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_19_ends_in_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_17_ends_in_number = {"_ends_in_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_17_ends_in_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_17_ends_in_number(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_19_ends_in_number = {"_ends_in_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_19_ends_in_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_19_ends_in_number(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10327,12 +10549,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 810, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ends_in_number") < 0)) __PYX_ERR(0, 810, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ends_in_number") < 0)) __PYX_ERR(0, 809, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -10343,7 +10565,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_ends_in_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 810, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_ends_in_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 809, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10357,8 +10579,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 810, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_16_ends_in_number(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_18_ends_in_number(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -10376,7 +10598,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "w3lib/_url.pyx":817 +/* "w3lib/_url.pyx":816 * parts = parts[:-1] * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< @@ -10396,7 +10618,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED P if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct__genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 817, __pyx_L1_error) + __PYX_ERR(0, 816, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10404,7 +10626,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(CYTHON_UNUSED P __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_15_ends_in_number_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ends_in_number_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_15_ends_in_number_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ends_in_number_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10442,16 +10664,16 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 817, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 817, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 816, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 816, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -10459,28 +10681,28 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 816, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 816, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -10490,7 +10712,7 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 817, __pyx_L1_error) + else __PYX_ERR(0, 816, __pyx_L1_error) } break; } @@ -10500,9 +10722,9 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_code_point, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { @@ -10540,7 +10762,7 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout return __pyx_r; } -/* "w3lib/_url.pyx":810 +/* "w3lib/_url.pyx":809 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bint: # <<<<<<<<<<<<<< @@ -10548,7 +10770,7 @@ static PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator(__pyx_Corout * if parts and parts[-1] == "": */ -static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_18_ends_in_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_v_parts = NULL; PyObject *__pyx_v_last = NULL; PyObject *__pyx_gb_5w3lib_4_url_15_ends_in_number_2generator = 0; @@ -10569,51 +10791,51 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_ends_in_number", 1); - /* "w3lib/_url.pyx":811 + /* "w3lib/_url.pyx":810 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bint: * parts = input.split(".") # <<<<<<<<<<<<<< * if parts and parts[-1] == "": * if len(parts) == 1: */ - __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__5), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__5), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parts = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":812 + /* "w3lib/_url.pyx":811 * def _ends_in_number(input: str) -> bint: * parts = input.split(".") * if parts and parts[-1] == "": # <<<<<<<<<<<<<< * if len(parts) == 1: * return False */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 811, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":813 + /* "w3lib/_url.pyx":812 * parts = input.split(".") * if parts and parts[-1] == "": * if len(parts) == 1: # <<<<<<<<<<<<<< * return False * parts = parts[:-1] */ - __pyx_t_4 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 812, __pyx_L1_error) __pyx_t_2 = (__pyx_t_4 == 1); if (__pyx_t_2) { - /* "w3lib/_url.pyx":814 + /* "w3lib/_url.pyx":813 * if parts and parts[-1] == "": * if len(parts) == 1: * return False # <<<<<<<<<<<<<< @@ -10625,7 +10847,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject __pyx_r = Py_False; goto __pyx_L0; - /* "w3lib/_url.pyx":813 + /* "w3lib/_url.pyx":812 * parts = input.split(".") * if parts and parts[-1] == "": * if len(parts) == 1: # <<<<<<<<<<<<<< @@ -10634,19 +10856,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":815 + /* "w3lib/_url.pyx":814 * if len(parts) == 1: * return False * parts = parts[:-1] # <<<<<<<<<<<<<< * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice__2, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice__2, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":812 + /* "w3lib/_url.pyx":811 * def _ends_in_number(input: str) -> bint: * parts = input.split(".") * if parts and parts[-1] == "": # <<<<<<<<<<<<<< @@ -10655,43 +10877,43 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":816 + /* "w3lib/_url.pyx":815 * return False * parts = parts[:-1] * last = parts[-1] # <<<<<<<<<<<<<< * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_last = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":817 + /* "w3lib/_url.pyx":816 * parts = parts[:-1] * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< * return True * try: */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_last); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_last); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L8_bool_binop_done; } - __pyx_t_1 = __pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(NULL, __pyx_v_last); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_5w3lib_4_url_15_ends_in_number_genexpr(NULL, __pyx_v_last); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L8_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":818 + /* "w3lib/_url.pyx":817 * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True # <<<<<<<<<<<<<< @@ -10703,7 +10925,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject __pyx_r = Py_True; goto __pyx_L0; - /* "w3lib/_url.pyx":817 + /* "w3lib/_url.pyx":816 * parts = parts[:-1] * last = parts[-1] * if last and all(code_point in _ASCII_DIGIT for code_point in last): # <<<<<<<<<<<<<< @@ -10712,7 +10934,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":819 + /* "w3lib/_url.pyx":818 * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True * try: # <<<<<<<<<<<<<< @@ -10728,14 +10950,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { - /* "w3lib/_url.pyx":820 + /* "w3lib/_url.pyx":819 * return True * try: * _parse_ipv4_number(last) # <<<<<<<<<<<<<< * except ValueError: * return False */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L10_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -10755,13 +10977,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_last}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 820, __pyx_L10_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":819 + /* "w3lib/_url.pyx":818 * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True * try: # <<<<<<<<<<<<<< @@ -10778,7 +11000,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "w3lib/_url.pyx":821 + /* "w3lib/_url.pyx":820 * try: * _parse_ipv4_number(last) * except ValueError: # <<<<<<<<<<<<<< @@ -10788,12 +11010,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_10) { __Pyx_AddTraceback("w3lib._url._ends_in_number", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(0, 821, __pyx_L12_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(0, 820, __pyx_L12_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_9); - /* "w3lib/_url.pyx":822 + /* "w3lib/_url.pyx":821 * _parse_ipv4_number(last) * except ValueError: * return False # <<<<<<<<<<<<<< @@ -10810,7 +11032,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject } goto __pyx_L12_except_error; - /* "w3lib/_url.pyx":819 + /* "w3lib/_url.pyx":818 * if last and all(code_point in _ASCII_DIGIT for code_point in last): * return True * try: # <<<<<<<<<<<<<< @@ -10832,7 +11054,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject __pyx_L15_try_end:; } - /* "w3lib/_url.pyx":823 + /* "w3lib/_url.pyx":822 * except ValueError: * return False * return True # <<<<<<<<<<<<<< @@ -10844,7 +11066,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject __pyx_r = Py_True; goto __pyx_L0; - /* "w3lib/_url.pyx":810 + /* "w3lib/_url.pyx":809 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bint: # <<<<<<<<<<<<<< @@ -10868,7 +11090,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":827 +/* "w3lib/_url.pyx":826 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< @@ -10877,15 +11099,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_16_ends_in_number(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_19_parse_ipv4(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_21_parse_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_19_parse_ipv4 = {"_parse_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_19_parse_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_19_parse_ipv4(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_21_parse_ipv4 = {"_parse_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_21_parse_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_21_parse_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10929,12 +11151,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 826, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4") < 0)) __PYX_ERR(0, 827, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_ipv4") < 0)) __PYX_ERR(0, 826, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -10945,7 +11167,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 827, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 826, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10959,8 +11181,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 827, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_18_parse_ipv4(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 826, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_20_parse_ipv4(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -10978,7 +11200,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "w3lib/_url.pyx":837 +/* "w3lib/_url.pyx":836 * result = _parse_ipv4_number(part) * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< @@ -10998,7 +11220,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObj if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_5w3lib_4_url___pyx_scope_struct_1_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 837, __pyx_L1_error) + __PYX_ERR(0, 836, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -11006,7 +11228,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(CYTHON_UNUSED PyObj __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_ipv4_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_ipv4_locals_genexpr, __pyx_n_s_w3lib__url); if (unlikely(!gen)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -11042,30 +11264,30 @@ static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_Coroutine return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 837, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 837, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 836, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 836, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 837, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 836, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 836, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_item, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_item, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { __Pyx_XDECREF(__pyx_r); @@ -11102,7 +11324,7 @@ static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_Coroutine return __pyx_r; } -/* "w3lib/_url.pyx":827 +/* "w3lib/_url.pyx":826 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< @@ -11110,7 +11332,7 @@ static PyObject *__pyx_gb_5w3lib_4_url_11_parse_ipv4_2generator1(__pyx_Coroutine * if parts and not parts[-1]: */ -static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_20_parse_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_v_parts = NULL; PyObject *__pyx_v_numbers = NULL; PyObject *__pyx_v_part = NULL; @@ -11137,53 +11359,53 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_ipv4", 1); - /* "w3lib/_url.pyx":828 + /* "w3lib/_url.pyx":827 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: * parts = input.split(".") # <<<<<<<<<<<<<< * if parts and not parts[-1]: * parts = parts[:-1] */ - __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__5), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Split(__pyx_v_input, __Pyx_NoneAsNull(__pyx_kp_u__5), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parts = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":829 + /* "w3lib/_url.pyx":828 * def _parse_ipv4(input: str) -> int: * parts = input.split(".") * if parts and not parts[-1]: # <<<<<<<<<<<<<< * parts = parts[:-1] * if len(parts) > 4: */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_parts); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 828, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (!__pyx_t_3); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":830 + /* "w3lib/_url.pyx":829 * parts = input.split(".") * if parts and not parts[-1]: * parts = parts[:-1] # <<<<<<<<<<<<<< * if len(parts) > 4: * raise ValueError */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice__2, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parts, 0, -1L, NULL, NULL, &__pyx_slice__2, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_parts, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":829 + /* "w3lib/_url.pyx":828 * def _parse_ipv4(input: str) -> int: * parts = input.split(".") * if parts and not parts[-1]: # <<<<<<<<<<<<<< @@ -11192,18 +11414,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":831 + /* "w3lib/_url.pyx":830 * if parts and not parts[-1]: * parts = parts[:-1] * if len(parts) > 4: # <<<<<<<<<<<<<< * raise ValueError * numbers = [] */ - __pyx_t_5 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_5 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 830, __pyx_L1_error) __pyx_t_2 = (__pyx_t_5 > 4); if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":832 + /* "w3lib/_url.pyx":831 * parts = parts[:-1] * if len(parts) > 4: * raise ValueError # <<<<<<<<<<<<<< @@ -11211,9 +11433,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p * for part in parts: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 832, __pyx_L1_error) + __PYX_ERR(0, 831, __pyx_L1_error) - /* "w3lib/_url.pyx":831 + /* "w3lib/_url.pyx":830 * if parts and not parts[-1]: * parts = parts[:-1] * if len(parts) > 4: # <<<<<<<<<<<<<< @@ -11222,19 +11444,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":833 + /* "w3lib/_url.pyx":832 * if len(parts) > 4: * raise ValueError * numbers = [] # <<<<<<<<<<<<<< * for part in parts: * result = _parse_ipv4_number(part) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_numbers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":834 + /* "w3lib/_url.pyx":833 * raise ValueError * numbers = [] * for part in parts: # <<<<<<<<<<<<<< @@ -11246,9 +11468,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 833, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -11256,28 +11478,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 834, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 833, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 834, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 833, __pyx_L1_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 834, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 834, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 833, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 834, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 833, __pyx_L1_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 834, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -11287,7 +11509,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 834, __pyx_L1_error) + else __PYX_ERR(0, 833, __pyx_L1_error) } break; } @@ -11296,14 +11518,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p __Pyx_XDECREF_SET(__pyx_v_part, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":835 + /* "w3lib/_url.pyx":834 * numbers = [] * for part in parts: * result = _parse_ipv4_number(part) # <<<<<<<<<<<<<< * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 835, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_parse_ipv4_number); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -11323,26 +11545,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_part}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 835, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":836 + /* "w3lib/_url.pyx":835 * for part in parts: * result = _parse_ipv4_number(part) * numbers.append(result[0]) # <<<<<<<<<<<<<< * if any(item > 255 for item in numbers[:-1]): * raise ValueError */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_numbers, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_numbers, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":834 + /* "w3lib/_url.pyx":833 * raise ValueError * numbers = [] * for part in parts: # <<<<<<<<<<<<<< @@ -11352,26 +11574,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":837 + /* "w3lib/_url.pyx":836 * result = _parse_ipv4_number(part) * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< * raise ValueError * if numbers[-1] >= 256 ** (5 - len(numbers)): */ - __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_7 = __pyx_pf_5w3lib_4_url_11_parse_ipv4_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":838 + /* "w3lib/_url.pyx":837 * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): * raise ValueError # <<<<<<<<<<<<<< @@ -11379,9 +11601,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p * raise ValueError */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 838, __pyx_L1_error) + __PYX_ERR(0, 837, __pyx_L1_error) - /* "w3lib/_url.pyx":837 + /* "w3lib/_url.pyx":836 * result = _parse_ipv4_number(part) * numbers.append(result[0]) * if any(item > 255 for item in numbers[:-1]): # <<<<<<<<<<<<<< @@ -11390,26 +11612,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":839 + /* "w3lib/_url.pyx":838 * if any(item > 255 for item in numbers[:-1]): * raise ValueError * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< * raise ValueError * ipv4 = numbers[-1] */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyList_GET_SIZE(__pyx_v_numbers); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 839, __pyx_L1_error) - __pyx_t_7 = PyFloat_FromDouble(pow(256.0, ((double)(5 - __pyx_t_5)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyList_GET_SIZE(__pyx_v_numbers); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 838, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(pow(256.0, ((double)(5 - __pyx_t_5)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":840 + /* "w3lib/_url.pyx":839 * raise ValueError * if numbers[-1] >= 256 ** (5 - len(numbers)): * raise ValueError # <<<<<<<<<<<<<< @@ -11417,9 +11639,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p * counter = 0 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 840, __pyx_L1_error) + __PYX_ERR(0, 839, __pyx_L1_error) - /* "w3lib/_url.pyx":839 + /* "w3lib/_url.pyx":838 * if any(item > 255 for item in numbers[:-1]): * raise ValueError * if numbers[-1] >= 256 ** (5 - len(numbers)): # <<<<<<<<<<<<<< @@ -11428,19 +11650,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":841 + /* "w3lib/_url.pyx":840 * if numbers[-1] >= 256 ** (5 - len(numbers)): * raise ValueError * ipv4 = numbers[-1] # <<<<<<<<<<<<<< * counter = 0 * for n in numbers[:-1]: */ - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 841, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_numbers, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_ipv4 = __pyx_t_8; __pyx_t_8 = 0; - /* "w3lib/_url.pyx":842 + /* "w3lib/_url.pyx":841 * raise ValueError * ipv4 = numbers[-1] * counter = 0 # <<<<<<<<<<<<<< @@ -11450,14 +11672,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(__pyx_int_0); __pyx_v_counter = __pyx_int_0; - /* "w3lib/_url.pyx":843 + /* "w3lib/_url.pyx":842 * ipv4 = numbers[-1] * counter = 0 * for n in numbers[:-1]: # <<<<<<<<<<<<<< * ipv4 += n * 256 ** (3 - counter) * counter += 1 */ - __pyx_t_8 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 843, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_GetSlice(__pyx_v_numbers, 0, -1L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0; @@ -11466,53 +11688,53 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 843, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 842, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 843, __pyx_L1_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 842, __pyx_L1_error) #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 843, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_8); __pyx_t_8 = 0; - /* "w3lib/_url.pyx":844 + /* "w3lib/_url.pyx":843 * counter = 0 * for n in numbers[:-1]: * ipv4 += n * 256 ** (3 - counter) # <<<<<<<<<<<<<< * counter += 1 * return ipv4 */ - __pyx_t_8 = __Pyx_PyInt_SubtractCObj(__pyx_int_3, __pyx_v_counter, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_SubtractCObj(__pyx_int_3, __pyx_v_counter, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyNumber_Power(__pyx_int_256, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_1 = PyNumber_Power(__pyx_int_256, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ipv4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ipv4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_ipv4, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":845 + /* "w3lib/_url.pyx":844 * for n in numbers[:-1]: * ipv4 += n * 256 ** (3 - counter) * counter += 1 # <<<<<<<<<<<<<< * return ipv4 * */ - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_counter, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_counter, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_counter, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":843 + /* "w3lib/_url.pyx":842 * ipv4 = numbers[-1] * counter = 0 * for n in numbers[:-1]: # <<<<<<<<<<<<<< @@ -11522,7 +11744,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":846 + /* "w3lib/_url.pyx":845 * ipv4 += n * 256 ** (3 - counter) * counter += 1 * return ipv4 # <<<<<<<<<<<<<< @@ -11530,12 +11752,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_ipv4))||((__pyx_v_ipv4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_ipv4))) __PYX_ERR(0, 846, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_ipv4))||((__pyx_v_ipv4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_ipv4))) __PYX_ERR(0, 845, __pyx_L1_error) __Pyx_INCREF(__pyx_v_ipv4); __pyx_r = ((PyObject*)__pyx_v_ipv4); goto __pyx_L0; - /* "w3lib/_url.pyx":827 + /* "w3lib/_url.pyx":826 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< @@ -11565,7 +11787,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":850 +/* "w3lib/_url.pyx":849 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: # <<<<<<<<<<<<<< @@ -11574,15 +11796,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_18_parse_ipv4(CYTHON_UNUSED PyObject *__p */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_21_domain_to_ascii(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_23_domain_to_ascii(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_21_domain_to_ascii = {"_domain_to_ascii", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_21_domain_to_ascii, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_21_domain_to_ascii(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_23_domain_to_ascii = {"_domain_to_ascii", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_23_domain_to_ascii, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_23_domain_to_ascii(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11627,18 +11849,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 850, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 849, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 850, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 849, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_domain_to_ascii") < 0)) __PYX_ERR(0, 850, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_domain_to_ascii") < 0)) __PYX_ERR(0, 849, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -11647,14 +11869,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v_domain = ((PyObject*)values[0]); if (values[1]) { - __pyx_v_be_strict = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_be_strict == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 850, __pyx_L3_error) + __pyx_v_be_strict = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_be_strict == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 849, __pyx_L3_error) } else { __pyx_v_be_strict = ((int)((int)0)); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_domain_to_ascii", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 850, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_domain_to_ascii", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 849, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11668,8 +11890,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain), (&PyUnicode_Type), 0, "domain", 1))) __PYX_ERR(0, 850, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_20_domain_to_ascii(__pyx_self, __pyx_v_domain, __pyx_v_be_strict); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain), (&PyUnicode_Type), 0, "domain", 1))) __PYX_ERR(0, 849, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_22_domain_to_ascii(__pyx_self, __pyx_v_domain, __pyx_v_be_strict); /* function exit code */ goto __pyx_L0; @@ -11686,7 +11908,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_20_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, int __pyx_v_be_strict) { +static PyObject *__pyx_pf_5w3lib_4_url_22_domain_to_ascii(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, int __pyx_v_be_strict) { PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -11703,102 +11925,102 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_domain_to_ascii(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_domain_to_ascii", 1); - /* "w3lib/_url.pyx":851 + /* "w3lib/_url.pyx":850 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: * result = _utr46._to_ascii( # <<<<<<<<<<<<<< * domain, * use_std3_ascii_rules=be_strict, */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utr46); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utr46); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_ascii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_ascii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":852 + /* "w3lib/_url.pyx":851 * def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: * result = _utr46._to_ascii( * domain, # <<<<<<<<<<<<<< * use_std3_ascii_rules=be_strict, * check_hyphens=False, */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_domain); __Pyx_GIVEREF(__pyx_v_domain); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domain)) __PYX_ERR(0, 851, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domain)) __PYX_ERR(0, 850, __pyx_L1_error); - /* "w3lib/_url.pyx":853 + /* "w3lib/_url.pyx":852 * result = _utr46._to_ascii( * domain, * use_std3_ascii_rules=be_strict, # <<<<<<<<<<<<<< * check_hyphens=False, * check_bidi=True, */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_be_strict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_be_strict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_t_4) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_std3_ascii_rules, __pyx_t_4) < 0) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":854 + /* "w3lib/_url.pyx":853 * domain, * use_std3_ascii_rules=be_strict, * check_hyphens=False, # <<<<<<<<<<<<<< * check_bidi=True, * check_joiners=True, */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, Py_False) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_hyphens, Py_False) < 0) __PYX_ERR(0, 852, __pyx_L1_error) - /* "w3lib/_url.pyx":855 + /* "w3lib/_url.pyx":854 * use_std3_ascii_rules=be_strict, * check_hyphens=False, * check_bidi=True, # <<<<<<<<<<<<<< * check_joiners=True, * transitional_processing=False, */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, Py_True) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_bidi, Py_True) < 0) __PYX_ERR(0, 852, __pyx_L1_error) - /* "w3lib/_url.pyx":856 + /* "w3lib/_url.pyx":855 * check_hyphens=False, * check_bidi=True, * check_joiners=True, # <<<<<<<<<<<<<< * transitional_processing=False, * verify_dns_length=be_strict, */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, Py_True) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_joiners, Py_True) < 0) __PYX_ERR(0, 852, __pyx_L1_error) - /* "w3lib/_url.pyx":857 + /* "w3lib/_url.pyx":856 * check_bidi=True, * check_joiners=True, * transitional_processing=False, # <<<<<<<<<<<<<< * verify_dns_length=be_strict, * ) */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, Py_False) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitional_processing, Py_False) < 0) __PYX_ERR(0, 852, __pyx_L1_error) - /* "w3lib/_url.pyx":858 + /* "w3lib/_url.pyx":857 * check_joiners=True, * transitional_processing=False, * verify_dns_length=be_strict, # <<<<<<<<<<<<<< * ) * if not result: */ - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_be_strict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_be_strict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_t_4) < 0) __PYX_ERR(0, 853, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verify_dns_length, __pyx_t_4) < 0) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":851 + /* "w3lib/_url.pyx":850 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: * result = _utr46._to_ascii( # <<<<<<<<<<<<<< * domain, * use_std3_ascii_rules=be_strict, */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11806,25 +12028,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_domain_to_ascii(CYTHON_UNUSED PyObject __pyx_v_result = __pyx_t_4; __pyx_t_4 = 0; - /* "w3lib/_url.pyx":860 + /* "w3lib/_url.pyx":859 * verify_dns_length=be_strict, * ) * if not result: # <<<<<<<<<<<<<< * raise ValueError( * f"Domain name {domain!r} is an empty string after conversion to " */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 859, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (unlikely(__pyx_t_6)) { - /* "w3lib/_url.pyx":862 + /* "w3lib/_url.pyx":861 * if not result: * raise ValueError( * f"Domain name {domain!r} is an empty string after conversion to " # <<<<<<<<<<<<<< * f"ASCII, which makes for an invalid domain name." * ) */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_8 = 127; @@ -11832,7 +12054,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_domain_to_ascii(CYTHON_UNUSED PyObject __pyx_t_7 += 12; __Pyx_GIVEREF(__pyx_kp_u_Domain_name); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Domain_name); - __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_domain), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8; __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); @@ -11843,25 +12065,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_domain_to_ascii(CYTHON_UNUSED PyObject __pyx_t_7 += 86; __Pyx_GIVEREF(__pyx_kp_u_is_an_empty_string_after_conver); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_is_an_empty_string_after_conver); - __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":861 + /* "w3lib/_url.pyx":860 * ) * if not result: * raise ValueError( # <<<<<<<<<<<<<< * f"Domain name {domain!r} is an empty string after conversion to " * f"ASCII, which makes for an invalid domain name." */ - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 861, __pyx_L1_error) + __PYX_ERR(0, 860, __pyx_L1_error) - /* "w3lib/_url.pyx":860 + /* "w3lib/_url.pyx":859 * verify_dns_length=be_strict, * ) * if not result: # <<<<<<<<<<<<<< @@ -11870,7 +12092,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_domain_to_ascii(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":865 + /* "w3lib/_url.pyx":864 * f"ASCII, which makes for an invalid domain name." * ) * return result # <<<<<<<<<<<<<< @@ -11878,12 +12100,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_domain_to_ascii(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_result))) __PYX_ERR(0, 865, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_result))) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_INCREF(__pyx_v_result); __pyx_r = ((PyObject*)__pyx_v_result); goto __pyx_L0; - /* "w3lib/_url.pyx":850 + /* "w3lib/_url.pyx":849 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: # <<<<<<<<<<<<<< @@ -11906,7 +12128,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_domain_to_ascii(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":869 +/* "w3lib/_url.pyx":868 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< @@ -11915,15 +12137,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_20_domain_to_ascii(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_23_parse_host(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_25_parse_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_23_parse_host = {"_parse_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_23_parse_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_23_parse_host(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_25_parse_host = {"_parse_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_25_parse_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_25_parse_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11970,7 +12192,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 869, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 868, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -11978,14 +12200,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 869, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 868, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_parse_host", 1, 2, 2, 1); __PYX_ERR(0, 869, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_host", 1, 2, 2, 1); __PYX_ERR(0, 868, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_host") < 0)) __PYX_ERR(0, 869, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_host") < 0)) __PYX_ERR(0, 868, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -11998,7 +12220,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_host", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 869, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_host", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 868, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12012,8 +12234,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 870, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_22_parse_host(__pyx_self, __pyx_v_input, __pyx_v_url); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 869, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_24_parse_host(__pyx_self, __pyx_v_input, __pyx_v_url); /* function exit code */ goto __pyx_L0; @@ -12030,7 +12252,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_url) { +static PyObject *__pyx_pf_5w3lib_4_url_24_parse_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_url) { PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_ascii_domain = NULL; PyObject *__pyx_v_code_point = NULL; @@ -12050,28 +12272,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_host", 1); - /* "w3lib/_url.pyx":873 + /* "w3lib/_url.pyx":872 * url: _URL, * ) -> _URL: * if input.startswith("["): # <<<<<<<<<<<<<< * if not input.endswith("]"): * raise ValueError */ - __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__7, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__7, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 872, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_url.pyx":874 + /* "w3lib/_url.pyx":873 * ) -> _URL: * if input.startswith("["): * if not input.endswith("]"): # <<<<<<<<<<<<<< * raise ValueError * url.ipv6 = _parse_ipv6(input[1:-1]) */ - __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 874, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_input, __pyx_kp_u__8, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 873, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":875 + /* "w3lib/_url.pyx":874 * if input.startswith("["): * if not input.endswith("]"): * raise ValueError # <<<<<<<<<<<<<< @@ -12079,9 +12301,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p * url._host_type = IPV6 */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 875, __pyx_L1_error) + __PYX_ERR(0, 874, __pyx_L1_error) - /* "w3lib/_url.pyx":874 + /* "w3lib/_url.pyx":873 * ) -> _URL: * if input.startswith("["): * if not input.endswith("]"): # <<<<<<<<<<<<<< @@ -12090,16 +12312,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":876 + /* "w3lib/_url.pyx":875 * if not input.endswith("]"): * raise ValueError * url.ipv6 = _parse_ipv6(input[1:-1]) # <<<<<<<<<<<<<< * url._host_type = IPV6 * return url */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_ipv6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_input, 1, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -12120,26 +12342,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 876, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_ipv6, __pyx_t_3) < 0) __PYX_ERR(0, 876, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_ipv6, __pyx_t_3) < 0) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":877 + /* "w3lib/_url.pyx":876 * raise ValueError * url.ipv6 = _parse_ipv6(input[1:-1]) * url._host_type = IPV6 # <<<<<<<<<<<<<< * return url * if url.scheme not in _SPECIAL_SCHEMES: */ - __pyx_t_3 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_host_type, __pyx_t_3) < 0) __PYX_ERR(0, 877, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_host_type, __pyx_t_3) < 0) __PYX_ERR(0, 876, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":878 + /* "w3lib/_url.pyx":877 * url.ipv6 = _parse_ipv6(input[1:-1]) * url._host_type = IPV6 * return url # <<<<<<<<<<<<<< @@ -12151,7 +12373,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p __pyx_r = __pyx_v_url; goto __pyx_L0; - /* "w3lib/_url.pyx":873 + /* "w3lib/_url.pyx":872 * url: _URL, * ) -> _URL: * if input.startswith("["): # <<<<<<<<<<<<<< @@ -12160,30 +12382,30 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":879 + /* "w3lib/_url.pyx":878 * url._host_type = IPV6 * return url * if url.scheme not in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< * url.hostname = _parse_opaque_host(input) * url._host_type = HOSTNAME */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_t_4, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_t_4, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "w3lib/_url.pyx":880 + /* "w3lib/_url.pyx":879 * return url * if url.scheme not in _SPECIAL_SCHEMES: * url.hostname = _parse_opaque_host(input) # <<<<<<<<<<<<<< * url._host_type = HOSTNAME * return url */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_parse_opaque_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_parse_opaque_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -12203,26 +12425,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 880, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 880, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_t_4) < 0) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":881 + /* "w3lib/_url.pyx":880 * if url.scheme not in _SPECIAL_SCHEMES: * url.hostname = _parse_opaque_host(input) * url._host_type = HOSTNAME # <<<<<<<<<<<<<< * return url * domain = unquote(input) */ - __pyx_t_4 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_HOSTNAME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_HOSTNAME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_host_type, __pyx_t_4) < 0) __PYX_ERR(0, 881, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_host_type, __pyx_t_4) < 0) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":882 + /* "w3lib/_url.pyx":881 * url.hostname = _parse_opaque_host(input) * url._host_type = HOSTNAME * return url # <<<<<<<<<<<<<< @@ -12234,7 +12456,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p __pyx_r = __pyx_v_url; goto __pyx_L0; - /* "w3lib/_url.pyx":879 + /* "w3lib/_url.pyx":878 * url._host_type = IPV6 * return url * if url.scheme not in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< @@ -12243,14 +12465,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":883 + /* "w3lib/_url.pyx":882 * url._host_type = HOSTNAME * return url * domain = unquote(input) # <<<<<<<<<<<<<< * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_unquote); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_unquote); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -12270,21 +12492,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 883, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_domain = __pyx_t_4; __pyx_t_4 = 0; - /* "w3lib/_url.pyx":884 + /* "w3lib/_url.pyx":883 * return url * domain = unquote(input) * ascii_domain = _domain_to_ascii(domain) # <<<<<<<<<<<<<< * for code_point in ascii_domain: * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_domain_to_ascii); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_domain_to_ascii); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -12304,14 +12526,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_domain}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_ascii_domain = __pyx_t_4; __pyx_t_4 = 0; - /* "w3lib/_url.pyx":885 + /* "w3lib/_url.pyx":884 * domain = unquote(input) * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: # <<<<<<<<<<<<<< @@ -12323,9 +12545,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_ascii_domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_ascii_domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 884, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { @@ -12333,28 +12555,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 885, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 884, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 884, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 885, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 884, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 884, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -12364,7 +12586,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 885, __pyx_L1_error) + else __PYX_ERR(0, 884, __pyx_L1_error) } break; } @@ -12373,20 +12595,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p __Pyx_XDECREF_SET(__pyx_v_code_point, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":886 + /* "w3lib/_url.pyx":885 * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< * raise ValueError * if _ends_in_number(ascii_domain): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_code_point, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_code_point, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2)) { - /* "w3lib/_url.pyx":887 + /* "w3lib/_url.pyx":886 * for code_point in ascii_domain: * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: * raise ValueError # <<<<<<<<<<<<<< @@ -12394,9 +12616,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p * url.ipv4 = _parse_ipv4(ascii_domain) */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 887, __pyx_L1_error) + __PYX_ERR(0, 886, __pyx_L1_error) - /* "w3lib/_url.pyx":886 + /* "w3lib/_url.pyx":885 * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: # <<<<<<<<<<<<<< @@ -12405,7 +12627,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":885 + /* "w3lib/_url.pyx":884 * domain = unquote(input) * ascii_domain = _domain_to_ascii(domain) * for code_point in ascii_domain: # <<<<<<<<<<<<<< @@ -12415,14 +12637,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":888 + /* "w3lib/_url.pyx":887 * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: * raise ValueError * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< * url.ipv4 = _parse_ipv4(ascii_domain) * url._host_type = IPV4 */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ends_in_number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ends_in_number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -12442,22 +12664,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "w3lib/_url.pyx":889 + /* "w3lib/_url.pyx":888 * raise ValueError * if _ends_in_number(ascii_domain): * url.ipv4 = _parse_ipv4(ascii_domain) # <<<<<<<<<<<<<< * url._host_type = IPV4 * return url */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_parse_ipv4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_parse_ipv4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -12477,26 +12699,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ascii_domain}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 889, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_ipv4, __pyx_t_4) < 0) __PYX_ERR(0, 889, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_ipv4, __pyx_t_4) < 0) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":890 + /* "w3lib/_url.pyx":889 * if _ends_in_number(ascii_domain): * url.ipv4 = _parse_ipv4(ascii_domain) * url._host_type = IPV4 # <<<<<<<<<<<<<< * return url * url.hostname = ascii_domain */ - __pyx_t_4 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_host_type, __pyx_t_4) < 0) __PYX_ERR(0, 890, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_host_type, __pyx_t_4) < 0) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":891 + /* "w3lib/_url.pyx":890 * url.ipv4 = _parse_ipv4(ascii_domain) * url._host_type = IPV4 * return url # <<<<<<<<<<<<<< @@ -12508,7 +12730,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p __pyx_r = __pyx_v_url; goto __pyx_L0; - /* "w3lib/_url.pyx":888 + /* "w3lib/_url.pyx":887 * if code_point in _FORBIDDEN_DOMAIN_CODE_POINTS: * raise ValueError * if _ends_in_number(ascii_domain): # <<<<<<<<<<<<<< @@ -12517,28 +12739,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p */ } - /* "w3lib/_url.pyx":892 + /* "w3lib/_url.pyx":891 * url._host_type = IPV4 * return url * url.hostname = ascii_domain # <<<<<<<<<<<<<< * url._host_type = HOSTNAME * return url */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_ascii_domain) < 0) __PYX_ERR(0, 892, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_v_ascii_domain) < 0) __PYX_ERR(0, 891, __pyx_L1_error) - /* "w3lib/_url.pyx":893 + /* "w3lib/_url.pyx":892 * return url * url.hostname = ascii_domain * url._host_type = HOSTNAME # <<<<<<<<<<<<<< * return url * */ - __pyx_t_4 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_HOSTNAME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_HOSTNAME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_host_type, __pyx_t_4) < 0) __PYX_ERR(0, 893, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_host_type, __pyx_t_4) < 0) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":894 + /* "w3lib/_url.pyx":893 * url.hostname = ascii_domain * url._host_type = HOSTNAME * return url # <<<<<<<<<<<<<< @@ -12550,7 +12772,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p __pyx_r = __pyx_v_url; goto __pyx_L0; - /* "w3lib/_url.pyx":869 + /* "w3lib/_url.pyx":868 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< @@ -12575,7 +12797,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "w3lib/_url.pyx":898 +/* "w3lib/_url.pyx":897 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< @@ -12584,15 +12806,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_22_parse_host(CYTHON_UNUSED PyObject *__p */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_25_is_windows_drive_letter(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_25_is_windows_drive_letter = {"_is_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_25_is_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_25_is_windows_drive_letter(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_27_is_windows_drive_letter = {"_is_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_27_is_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -12636,12 +12858,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 897, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_windows_drive_letter") < 0)) __PYX_ERR(0, 898, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_windows_drive_letter") < 0)) __PYX_ERR(0, 897, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -12652,7 +12874,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 898, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_is_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 897, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12666,8 +12888,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 898, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_24_is_windows_drive_letter(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 897, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -12684,7 +12906,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_24_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_26_is_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -12699,7 +12921,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_is_windows_drive_letter(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_is_windows_drive_letter", 1); - /* "w3lib/_url.pyx":899 + /* "w3lib/_url.pyx":898 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bint: * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" # <<<<<<<<<<<<<< @@ -12707,33 +12929,33 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_is_windows_drive_letter(CYTHON_UNUSED * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 898, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 == 2); if (__pyx_t_3) { } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 899, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 898, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { } else { - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == (Py_UCS4)-1)) __PYX_ERR(0, 898, __pyx_L1_error) switch (__pyx_t_5) { case 58: case 0x7C: @@ -12744,7 +12966,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_is_windows_drive_letter(CYTHON_UNUSED break; } __pyx_t_7 = __pyx_t_3; - __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; @@ -12753,7 +12975,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_is_windows_drive_letter(CYTHON_UNUSED __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":898 + /* "w3lib/_url.pyx":897 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< @@ -12774,7 +12996,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_is_windows_drive_letter(CYTHON_UNUSED return __pyx_r; } -/* "w3lib/_url.pyx":903 +/* "w3lib/_url.pyx":902 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< @@ -12783,15 +13005,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_24_is_windows_drive_letter(CYTHON_UNUSED */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_27_starts_with_windows_drive_letter(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_27_starts_with_windows_drive_letter = {"_starts_with_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_27_starts_with_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_27_starts_with_windows_drive_letter(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_29_starts_with_windows_drive_letter = {"_starts_with_windows_drive_letter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_29_starts_with_windows_drive_letter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -12835,12 +13057,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 903, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 902, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_starts_with_windows_drive_letter") < 0)) __PYX_ERR(0, 903, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_starts_with_windows_drive_letter") < 0)) __PYX_ERR(0, 902, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -12851,7 +13073,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_starts_with_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 903, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_starts_with_windows_drive_letter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 902, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12865,8 +13087,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 903, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 902, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -12883,7 +13105,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_28_starts_with_windows_drive_letter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { Py_ssize_t __pyx_v_input_length; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -12902,17 +13124,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(CYTHO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_starts_with_windows_drive_letter", 1); - /* "w3lib/_url.pyx":904 + /* "w3lib/_url.pyx":903 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bint: * input_length = len(input) # <<<<<<<<<<<<<< * return ( * input_length >= 2 */ - __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 904, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 903, __pyx_L1_error) __pyx_v_input_length = __pyx_t_1; - /* "w3lib/_url.pyx":905 + /* "w3lib/_url.pyx":904 * def _starts_with_windows_drive_letter(input: str) -> bint: * input_length = len(input) * return ( # <<<<<<<<<<<<<< @@ -12921,7 +13143,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(CYTHO */ __Pyx_XDECREF(__pyx_r); - /* "w3lib/_url.pyx":906 + /* "w3lib/_url.pyx":905 * input_length = len(input) * return ( * input_length >= 2 # <<<<<<<<<<<<<< @@ -12931,23 +13153,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(CYTHO __pyx_t_3 = (__pyx_v_input_length >= 2); if (__pyx_t_3) { } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L3_bool_binop_done; } - /* "w3lib/_url.pyx":907 + /* "w3lib/_url.pyx":906 * return ( * input_length >= 2 * and _is_windows_drive_letter(input[:2]) # <<<<<<<<<<<<<< * and (input_length == 2 or input[2] in "/\\?#") * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 907, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 907, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_input, 0, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -12968,11 +13190,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(CYTHO __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 907, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 906, __pyx_L1_error) if (__pyx_t_3) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { @@ -12982,7 +13204,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(CYTHO goto __pyx_L3_bool_binop_done; } - /* "w3lib/_url.pyx":908 + /* "w3lib/_url.pyx":907 * input_length >= 2 * and _is_windows_drive_letter(input[:2]) * and (input_length == 2 or input[2] in "/\\?#") # <<<<<<<<<<<<<< @@ -12992,13 +13214,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(CYTHO __pyx_t_3 = (__pyx_v_input_length == 2); if (!__pyx_t_3) { } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_9 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == (Py_UCS4)-1)) __PYX_ERR(0, 908, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt_Unicode(__pyx_v_input, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == (Py_UCS4)-1)) __PYX_ERR(0, 907, __pyx_L1_error) switch (__pyx_t_9) { case 35: case 47: @@ -13011,7 +13233,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(CYTHO break; } __pyx_t_10 = __pyx_t_3; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __pyx_t_4 = 0; @@ -13020,7 +13242,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(CYTHO __pyx_t_2 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":903 + /* "w3lib/_url.pyx":902 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< @@ -13043,7 +13265,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(CYTHO return __pyx_r; } -/* "w3lib/_url.pyx":913 +/* "w3lib/_url.pyx":912 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< @@ -13052,15 +13274,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_26_starts_with_windows_drive_letter(CYTHO */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_29_is_double_dot_path_segment(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_29_is_double_dot_path_segment = {"_is_double_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_29_is_double_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_29_is_double_dot_path_segment(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_31_is_double_dot_path_segment = {"_is_double_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_31_is_double_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13104,12 +13326,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 913, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 912, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_double_dot_path_segment") < 0)) __PYX_ERR(0, 913, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_double_dot_path_segment") < 0)) __PYX_ERR(0, 912, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -13120,7 +13342,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_double_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 913, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_is_double_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 912, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13134,8 +13356,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 913, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_28_is_double_dot_path_segment(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 912, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -13152,7 +13374,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_28_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_30_is_double_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -13164,7 +13386,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_is_double_dot_path_segment(CYTHON_UNUS int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_is_double_dot_path_segment", 1); - /* "w3lib/_url.pyx":914 + /* "w3lib/_url.pyx":913 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bint: * return input in ( # <<<<<<<<<<<<<< @@ -13174,65 +13396,65 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_is_double_dot_path_segment(CYTHON_UNUS __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_input); __pyx_t_1 = __pyx_v_input; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 913, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 913, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 913, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 913, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 913, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 913, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 913, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2e, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 913, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_2E, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 913, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":913 + /* "w3lib/_url.pyx":912 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< @@ -13252,7 +13474,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_is_double_dot_path_segment(CYTHON_UNUS return __pyx_r; } -/* "w3lib/_url.pyx":928 +/* "w3lib/_url.pyx":927 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< @@ -13261,15 +13483,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_28_is_double_dot_path_segment(CYTHON_UNUS */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_31_is_single_dot_path_segment(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_31_is_single_dot_path_segment = {"_is_single_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_31_is_single_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_31_is_single_dot_path_segment(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_33_is_single_dot_path_segment = {"_is_single_dot_path_segment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_33_is_single_dot_path_segment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13313,12 +13535,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 928, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 927, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_single_dot_path_segment") < 0)) __PYX_ERR(0, 928, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_single_dot_path_segment") < 0)) __PYX_ERR(0, 927, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -13329,7 +13551,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_is_single_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 928, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_is_single_dot_path_segment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 927, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13343,8 +13565,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 928, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_30_is_single_dot_path_segment(__pyx_self, __pyx_v_input); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 927, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(__pyx_self, __pyx_v_input); /* function exit code */ goto __pyx_L0; @@ -13361,7 +13583,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_30_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { +static PyObject *__pyx_pf_5w3lib_4_url_32_is_single_dot_path_segment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -13373,7 +13595,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_is_single_dot_path_segment(CYTHON_UNUS int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_is_single_dot_path_segment", 1); - /* "w3lib/_url.pyx":929 + /* "w3lib/_url.pyx":928 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bint: * return input in ( # <<<<<<<<<<<<<< @@ -13383,29 +13605,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_is_single_dot_path_segment(CYTHON_UNUS __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_input); __pyx_t_1 = __pyx_v_input; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 928, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2e_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 928, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_2E_3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 928, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":928 + /* "w3lib/_url.pyx":927 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< @@ -13425,7 +13647,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_is_single_dot_path_segment(CYTHON_UNUS return __pyx_r; } -/* "w3lib/_url.pyx":939 +/* "w3lib/_url.pyx":938 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -13434,15 +13656,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_30_is_single_dot_path_segment(CYTHON_UNUS */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_33_idempotent_utf_8_percent_encode(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_33_idempotent_utf_8_percent_encode = {"_idempotent_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_33_idempotent_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_33_idempotent_utf_8_percent_encode(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_35_idempotent_utf_8_percent_encode = {"_idempotent_utf_8_percent_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_35_idempotent_utf_8_percent_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13484,33 +13706,33 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 939, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 938, __pyx_L3_error) else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 939, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 938, __pyx_L3_error) } if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pointer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 939, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 938, __pyx_L3_error) else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_pointer); __PYX_ERR(0, 939, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_pointer); __PYX_ERR(0, 938, __pyx_L3_error) } if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encode_set)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 939, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 938, __pyx_L3_error) else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_encode_set); __PYX_ERR(0, 939, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_encode_set); __PYX_ERR(0, 938, __pyx_L3_error) } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "_idempotent_utf_8_percent_encode") < 0)) __PYX_ERR(0, 939, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "_idempotent_utf_8_percent_encode") < 0)) __PYX_ERR(0, 938, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 0)) { goto __pyx_L5_argtuple_error; } else { - __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 939, __pyx_L3_error) + __Pyx_RaiseKeywordRequired("_idempotent_utf_8_percent_encode", __pyx_n_s_input); __PYX_ERR(0, 938, __pyx_L3_error) } __pyx_v_input = ((PyObject*)values[0]); __pyx_v_pointer = ((PyObject*)values[1]); @@ -13518,7 +13740,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_idempotent_utf_8_percent_encode", 1, 0, 0, __pyx_nargs); __PYX_ERR(0, 939, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_idempotent_utf_8_percent_encode", 1, 0, 0, __pyx_nargs); __PYX_ERR(0, 938, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13532,9 +13754,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 940, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pointer), (&PyInt_Type), 0, "pointer", 1))) __PYX_ERR(0, 940, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_pointer, __pyx_v_encode_set); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 939, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pointer), (&PyInt_Type), 0, "pointer", 1))) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(__pyx_self, __pyx_v_input, __pyx_v_pointer, __pyx_v_encode_set); /* function exit code */ goto __pyx_L0; @@ -13551,7 +13773,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set) { +static PyObject *__pyx_pf_5w3lib_4_url_34_idempotent_utf_8_percent_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_pointer, PyObject *__pyx_v_encode_set) { PyObject *__pyx_v_code_point = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -13567,53 +13789,53 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_idempotent_utf_8_percent_encode", 1); - /* "w3lib/_url.pyx":942 + /* "w3lib/_url.pyx":941 * *, input: str, pointer: int, encode_set: _PercentEncodeSet * ) -> str: * code_point = input[pointer] # <<<<<<<<<<<<<< * if code_point == "%" and "%" in encode_set: * if ( */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 942, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 941, __pyx_L1_error) __pyx_v_code_point = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":943 + /* "w3lib/_url.pyx":942 * ) -> str: * code_point = input[pointer] * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< * if ( * pointer + 2 >= len(input) */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 942, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__3, __pyx_v_encode_set, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__3, __pyx_v_encode_set, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 942, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":945 + /* "w3lib/_url.pyx":944 * if code_point == "%" and "%" in encode_set: * if ( * pointer + 2 >= len(input) # <<<<<<<<<<<<<< * or input[pointer + 1] not in _ASCII_HEX_DIGIT * or input[pointer + 2] not in _ASCII_HEX_DIGIT */ - __pyx_t_1 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 945, __pyx_L1_error) - __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 945, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 944, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 945, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 945, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_3) { } else { @@ -13621,21 +13843,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON goto __pyx_L7_bool_binop_done; } - /* "w3lib/_url.pyx":946 + /* "w3lib/_url.pyx":945 * if ( * pointer + 2 >= len(input) * or input[pointer + 1] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * or input[pointer + 2] not in _ASCII_HEX_DIGIT * ): */ - __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 946, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 946, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 946, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 946, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_3) { @@ -13644,27 +13866,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON goto __pyx_L7_bool_binop_done; } - /* "w3lib/_url.pyx":947 + /* "w3lib/_url.pyx":946 * pointer + 2 >= len(input) * or input[pointer + 1] not in _ASCII_HEX_DIGIT * or input[pointer + 2] not in _ASCII_HEX_DIGIT # <<<<<<<<<<<<<< * ): * return "%25" */ - __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 947, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_v_pointer, __pyx_int_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 947, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_input, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 947, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ASCII_HEX_DIGIT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 947, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_6, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 946, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; - /* "w3lib/_url.pyx":944 + /* "w3lib/_url.pyx":943 * code_point = input[pointer] * if code_point == "%" and "%" in encode_set: * if ( # <<<<<<<<<<<<<< @@ -13673,7 +13895,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON */ if (__pyx_t_2) { - /* "w3lib/_url.pyx":949 + /* "w3lib/_url.pyx":948 * or input[pointer + 2] not in _ASCII_HEX_DIGIT * ): * return "%25" # <<<<<<<<<<<<<< @@ -13685,7 +13907,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON __pyx_r = __pyx_kp_u_25; goto __pyx_L0; - /* "w3lib/_url.pyx":944 + /* "w3lib/_url.pyx":943 * code_point = input[pointer] * if code_point == "%" and "%" in encode_set: * if ( # <<<<<<<<<<<<<< @@ -13694,7 +13916,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON */ } - /* "w3lib/_url.pyx":950 + /* "w3lib/_url.pyx":949 * ): * return "%25" * return "%" # <<<<<<<<<<<<<< @@ -13706,7 +13928,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON __pyx_r = __pyx_kp_u__3; goto __pyx_L0; - /* "w3lib/_url.pyx":943 + /* "w3lib/_url.pyx":942 * ) -> str: * code_point = input[pointer] * if code_point == "%" and "%" in encode_set: # <<<<<<<<<<<<<< @@ -13715,7 +13937,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON */ } - /* "w3lib/_url.pyx":951 + /* "w3lib/_url.pyx":950 * return "%25" * return "%" * return _utf_8_percent_encode(code_point, encode_set) # <<<<<<<<<<<<<< @@ -13723,7 +13945,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 951, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; __pyx_t_7 = 0; @@ -13743,16 +13965,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_code_point, __pyx_v_encode_set}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 951, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_6))) __PYX_ERR(0, 951, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_6))) __PYX_ERR(0, 950, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":939 + /* "w3lib/_url.pyx":938 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -13774,7 +13996,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON return __pyx_r; } -/* "w3lib/_url.pyx":954 +/* "w3lib/_url.pyx":953 * * * def _preprocess_url(url: str) -> str: # <<<<<<<<<<<<<< @@ -13783,15 +14005,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_32_idempotent_utf_8_percent_encode(CYTHON */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_35_preprocess_url(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_37_preprocess_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_35_preprocess_url = {"_preprocess_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_35_preprocess_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_35_preprocess_url(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_37_preprocess_url = {"_preprocess_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_37_preprocess_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_37_preprocess_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13835,12 +14057,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 954, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 953, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_preprocess_url") < 0)) __PYX_ERR(0, 954, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_preprocess_url") < 0)) __PYX_ERR(0, 953, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -13851,7 +14073,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_preprocess_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 954, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_preprocess_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 953, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13865,8 +14087,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_url), (&PyUnicode_Type), 0, "url", 1))) __PYX_ERR(0, 954, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_34_preprocess_url(__pyx_self, __pyx_v_url); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_url), (&PyUnicode_Type), 0, "url", 1))) __PYX_ERR(0, 953, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_36_preprocess_url(__pyx_self, __pyx_v_url); /* function exit code */ goto __pyx_L0; @@ -13883,7 +14105,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_34_preprocess_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { +static PyObject *__pyx_pf_5w3lib_4_url_36_preprocess_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -13896,7 +14118,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_preprocess_url(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_preprocess_url", 1); - /* "w3lib/_url.pyx":955 + /* "w3lib/_url.pyx":954 * * def _preprocess_url(url: str) -> str: * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) # <<<<<<<<<<<<<< @@ -13904,15 +14126,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_preprocess_url(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_C0_CONTROL_OR_SPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_url, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_url, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_translate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_translate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASCII_TAB_OR_NEWLINE_TRANSLATIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -13933,16 +14155,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_preprocess_url(CYTHON_UNUSED PyObject __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 955, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 954, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":954 + /* "w3lib/_url.pyx":953 * * * def _preprocess_url(url: str) -> str: # <<<<<<<<<<<<<< @@ -13964,7 +14186,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_preprocess_url(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":958 +/* "w3lib/_url.pyx":957 * * * def _parse_url( # <<<<<<<<<<<<<< @@ -13973,16 +14195,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_34_preprocess_url(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_37_parse_url(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_39_parse_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_36_parse_url, "Return a :class:`_URL` object built from *url* and *encoding*, following\n the URL parsing algorithm defined in the `URL living standard`_, with\n additional logic to support older standards as well.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing\n "); -static PyMethodDef __pyx_mdef_5w3lib_4_url_37_parse_url = {"_parse_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_37_parse_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_36_parse_url}; -static PyObject *__pyx_pw_5w3lib_4_url_37_parse_url(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_38_parse_url, "Return a :class:`_URL` object built from *url* and *encoding*, following\n the URL parsing algorithm defined in the `URL living standard`_, with\n additional logic to support older standards as well.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-parsing\n "); +static PyMethodDef __pyx_mdef_5w3lib_4_url_39_parse_url = {"_parse_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_39_parse_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_38_parse_url}; +static PyObject *__pyx_pw_5w3lib_4_url_39_parse_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -14030,19 +14252,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 958, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 957, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 958, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 957, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_url") < 0)) __PYX_ERR(0, 958, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_url") < 0)) __PYX_ERR(0, 957, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -14058,7 +14280,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse_url", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 958, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse_url", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 957, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14072,9 +14294,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 959, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 960, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_36_parse_url(__pyx_self, __pyx_v_input, __pyx_v_encoding); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 958, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 959, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_38_parse_url(__pyx_self, __pyx_v_input, __pyx_v_encoding); /* function exit code */ goto __pyx_L0; @@ -14091,7 +14313,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding) { +static PyObject *__pyx_pf_5w3lib_4_url_38_parse_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding) { PyObject *__pyx_v_url = NULL; unsigned char __pyx_v_state; PyObject *__pyx_v_buffer = NULL; @@ -14133,26 +14355,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_v_input); __Pyx_INCREF(__pyx_v_encoding); - /* "w3lib/_url.pyx":979 + /* "w3lib/_url.pyx":978 * # explicitly an empty string (e.g. ``a://a:@example.com``), so that its * # output can match the original parsed URL if desired. * encoding = _get_output_encoding(encoding) # <<<<<<<<<<<<<< * * url = _URL() */ - __pyx_t_1 = __pyx_f_5w3lib_4_url__get_output_encoding(__pyx_v_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_1 = __pyx_f_5w3lib_4_url__get_output_encoding(__pyx_v_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_encoding, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":981 + /* "w3lib/_url.pyx":980 * encoding = _get_output_encoding(encoding) * * url = _URL() # <<<<<<<<<<<<<< * state = SCHEME_START * buffer = "" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_URL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_URL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -14172,14 +14394,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_url = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":982 + /* "w3lib/_url.pyx":981 * * url = _URL() * state = SCHEME_START # <<<<<<<<<<<<<< @@ -14188,7 +14410,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_SCHEME_START; - /* "w3lib/_url.pyx":983 + /* "w3lib/_url.pyx":982 * url = _URL() * state = SCHEME_START * buffer = "" # <<<<<<<<<<<<<< @@ -14198,7 +14420,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __pyx_v_buffer = __pyx_kp_u_; - /* "w3lib/_url.pyx":984 + /* "w3lib/_url.pyx":983 * state = SCHEME_START * buffer = "" * at_sign_seen = inside_brackets = skip_authority_shortcut = False # <<<<<<<<<<<<<< @@ -14209,7 +14431,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_v_inside_brackets = 0; __pyx_v_skip_authority_shortcut = 0; - /* "w3lib/_url.pyx":985 + /* "w3lib/_url.pyx":984 * buffer = "" * at_sign_seen = inside_brackets = skip_authority_shortcut = False * pointer: cython.int = 0 # <<<<<<<<<<<<<< @@ -14218,14 +14440,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_pointer = 0; - /* "w3lib/_url.pyx":987 + /* "w3lib/_url.pyx":986 * pointer: cython.int = 0 * * input = _preprocess_url(input) # <<<<<<<<<<<<<< * input_length: cython.int = len(input) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_preprocess_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_preprocess_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -14245,15 +14467,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_input}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 987, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_input, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":988 + /* "w3lib/_url.pyx":987 * * input = _preprocess_url(input) * input_length: cython.int = len(input) # <<<<<<<<<<<<<< @@ -14262,12 +14484,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ if (unlikely(__pyx_v_input == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 988, __pyx_L1_error) + __PYX_ERR(0, 987, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 988, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_input); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 987, __pyx_L1_error) __pyx_v_input_length = __pyx_t_5; - /* "w3lib/_url.pyx":990 + /* "w3lib/_url.pyx":989 * input_length: cython.int = len(input) * * while True: # <<<<<<<<<<<<<< @@ -14276,7 +14498,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ while (1) { - /* "w3lib/_url.pyx":991 + /* "w3lib/_url.pyx":990 * * while True: * reached_end: bint = pointer >= input_length # <<<<<<<<<<<<<< @@ -14285,7 +14507,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_reached_end = (__pyx_v_pointer >= __pyx_v_input_length); - /* "w3lib/_url.pyx":992 + /* "w3lib/_url.pyx":991 * while True: * reached_end: bint = pointer >= input_length * if not reached_end: # <<<<<<<<<<<<<< @@ -14295,20 +14517,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (!__pyx_v_reached_end); if (__pyx_t_6) { - /* "w3lib/_url.pyx":993 + /* "w3lib/_url.pyx":992 * reached_end: bint = pointer >= input_length * if not reached_end: * c = input[pointer] # <<<<<<<<<<<<<< * * if state == SCHEME_START: */ - __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_v_pointer, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 993, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 993, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_v_pointer, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 992, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromOrdinal(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":992 + /* "w3lib/_url.pyx":991 * while True: * reached_end: bint = pointer >= input_length * if not reached_end: # <<<<<<<<<<<<<< @@ -14317,7 +14539,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":995 + /* "w3lib/_url.pyx":994 * c = input[pointer] * * if state == SCHEME_START: # <<<<<<<<<<<<<< @@ -14327,7 +14549,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SCHEME_START); if (__pyx_t_6) { - /* "w3lib/_url.pyx":996 + /* "w3lib/_url.pyx":995 * * if state == SCHEME_START: * if not reached_end and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< @@ -14340,29 +14562,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_t_8; goto __pyx_L8_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 996, __pyx_L1_error) } - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 995, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_ALPHA); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 996, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_8; __pyx_L8_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":997 + /* "w3lib/_url.pyx":996 * if state == SCHEME_START: * if not reached_end and c in _ASCII_ALPHA: * buffer += c # <<<<<<<<<<<<<< * state = SCHEME * else: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 997, __pyx_L1_error) } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 996, __pyx_L1_error) } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":998 + /* "w3lib/_url.pyx":997 * if not reached_end and c in _ASCII_ALPHA: * buffer += c * state = SCHEME # <<<<<<<<<<<<<< @@ -14371,7 +14593,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_SCHEME; - /* "w3lib/_url.pyx":996 + /* "w3lib/_url.pyx":995 * * if state == SCHEME_START: * if not reached_end and c in _ASCII_ALPHA: # <<<<<<<<<<<<<< @@ -14381,7 +14603,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L7; } - /* "w3lib/_url.pyx":1000 + /* "w3lib/_url.pyx":999 * state = SCHEME * else: * state = NO_SCHEME # <<<<<<<<<<<<<< @@ -14391,7 +14613,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_NO_SCHEME; - /* "w3lib/_url.pyx":1001 + /* "w3lib/_url.pyx":1000 * else: * state = NO_SCHEME * pointer -= 1 # <<<<<<<<<<<<<< @@ -14402,7 +14624,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L7:; - /* "w3lib/_url.pyx":995 + /* "w3lib/_url.pyx":994 * c = input[pointer] * * if state == SCHEME_START: # <<<<<<<<<<<<<< @@ -14412,7 +14634,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1003 + /* "w3lib/_url.pyx":1002 * pointer -= 1 * * elif state == SCHEME: # <<<<<<<<<<<<<< @@ -14422,7 +14644,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SCHEME); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1004 + /* "w3lib/_url.pyx":1003 * * elif state == SCHEME: * if not reached_end and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< @@ -14435,29 +14657,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_t_8; goto __pyx_L11_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1004, __pyx_L1_error) } - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SCHEME_CHARS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1003, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SCHEME_CHARS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1004, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1003, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_8; __pyx_L11_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1005 + /* "w3lib/_url.pyx":1004 * elif state == SCHEME: * if not reached_end and c in _SCHEME_CHARS: * buffer += c # <<<<<<<<<<<<<< * elif not reached_end and c == ":": * url.scheme = buffer.lower() */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1005, __pyx_L1_error) } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1004, __pyx_L1_error) } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1004 + /* "w3lib/_url.pyx":1003 * * elif state == SCHEME: * if not reached_end and c in _SCHEME_CHARS: # <<<<<<<<<<<<<< @@ -14467,7 +14689,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L10; } - /* "w3lib/_url.pyx":1006 + /* "w3lib/_url.pyx":1005 * if not reached_end and c in _SCHEME_CHARS: * buffer += c * elif not reached_end and c == ":": # <<<<<<<<<<<<<< @@ -14480,20 +14702,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_t_8; goto __pyx_L13_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1006, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1006, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1005, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1005, __pyx_L1_error) __pyx_t_6 = __pyx_t_8; __pyx_L13_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1007 + /* "w3lib/_url.pyx":1006 * buffer += c * elif not reached_end and c == ":": * url.scheme = buffer.lower() # <<<<<<<<<<<<<< * buffer = "" * if url.scheme == "file": */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_buffer, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1007, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_buffer, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -14513,14 +14735,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1007, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme, __pyx_t_1) < 0) __PYX_ERR(0, 1007, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme, __pyx_t_1) < 0) __PYX_ERR(0, 1006, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1008 + /* "w3lib/_url.pyx":1007 * elif not reached_end and c == ":": * url.scheme = buffer.lower() * buffer = "" # <<<<<<<<<<<<<< @@ -14530,20 +14752,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1009 + /* "w3lib/_url.pyx":1008 * url.scheme = buffer.lower() * buffer = "" * if url.scheme == "file": # <<<<<<<<<<<<<< * state = FILE * elif url.scheme in _SPECIAL_SCHEMES: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1009, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1008, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1010 + /* "w3lib/_url.pyx":1009 * buffer = "" * if url.scheme == "file": * state = FILE # <<<<<<<<<<<<<< @@ -14552,7 +14774,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FILE; - /* "w3lib/_url.pyx":1009 + /* "w3lib/_url.pyx":1008 * url.scheme = buffer.lower() * buffer = "" * if url.scheme == "file": # <<<<<<<<<<<<<< @@ -14562,23 +14784,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L15; } - /* "w3lib/_url.pyx":1011 + /* "w3lib/_url.pyx":1010 * if url.scheme == "file": * state = FILE * elif url.scheme in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< * state = SPECIAL_AUTHORITY_SLASHES * elif pointer + 1 < input_length and input[pointer + 1] == "/": */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1011, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1010, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1012 + /* "w3lib/_url.pyx":1011 * state = FILE * elif url.scheme in _SPECIAL_SCHEMES: * state = SPECIAL_AUTHORITY_SLASHES # <<<<<<<<<<<<<< @@ -14587,7 +14809,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES; - /* "w3lib/_url.pyx":1011 + /* "w3lib/_url.pyx":1010 * if url.scheme == "file": * state = FILE * elif url.scheme in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< @@ -14597,7 +14819,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L15; } - /* "w3lib/_url.pyx":1013 + /* "w3lib/_url.pyx":1012 * elif url.scheme in _SPECIAL_SCHEMES: * state = SPECIAL_AUTHORITY_SLASHES * elif pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< @@ -14611,13 +14833,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L16_bool_binop_done; } __pyx_t_9 = (__pyx_v_pointer + 1); - __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 1013, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 1012, __pyx_L1_error) __pyx_t_8 = (__pyx_t_7 == 47); __pyx_t_6 = __pyx_t_8; __pyx_L16_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1014 + /* "w3lib/_url.pyx":1013 * state = SPECIAL_AUTHORITY_SLASHES * elif pointer + 1 < input_length and input[pointer + 1] == "/": * state = PATH_OR_AUTHORITY # <<<<<<<<<<<<<< @@ -14626,7 +14848,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY; - /* "w3lib/_url.pyx":1015 + /* "w3lib/_url.pyx":1014 * elif pointer + 1 < input_length and input[pointer + 1] == "/": * state = PATH_OR_AUTHORITY * pointer += 1 # <<<<<<<<<<<<<< @@ -14635,7 +14857,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_pointer = (__pyx_v_pointer + 1); - /* "w3lib/_url.pyx":1013 + /* "w3lib/_url.pyx":1012 * elif url.scheme in _SPECIAL_SCHEMES: * state = SPECIAL_AUTHORITY_SLASHES * elif pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< @@ -14645,7 +14867,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L15; } - /* "w3lib/_url.pyx":1017 + /* "w3lib/_url.pyx":1016 * pointer += 1 * else: * url.opaque_path = "" # <<<<<<<<<<<<<< @@ -14653,9 +14875,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * else: */ /*else*/ { - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path, __pyx_kp_u_) < 0) __PYX_ERR(0, 1017, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path, __pyx_kp_u_) < 0) __PYX_ERR(0, 1016, __pyx_L1_error) - /* "w3lib/_url.pyx":1018 + /* "w3lib/_url.pyx":1017 * else: * url.opaque_path = "" * state = OPAQUE_PATH # <<<<<<<<<<<<<< @@ -14666,7 +14888,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L15:; - /* "w3lib/_url.pyx":1006 + /* "w3lib/_url.pyx":1005 * if not reached_end and c in _SCHEME_CHARS: * buffer += c * elif not reached_end and c == ":": # <<<<<<<<<<<<<< @@ -14676,7 +14898,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L10; } - /* "w3lib/_url.pyx":1020 + /* "w3lib/_url.pyx":1019 * state = OPAQUE_PATH * else: * buffer = "" # <<<<<<<<<<<<<< @@ -14687,7 +14909,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1021 + /* "w3lib/_url.pyx":1020 * else: * buffer = "" * state = NO_SCHEME # <<<<<<<<<<<<<< @@ -14696,7 +14918,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_NO_SCHEME; - /* "w3lib/_url.pyx":1022 + /* "w3lib/_url.pyx":1021 * buffer = "" * state = NO_SCHEME * pointer = -1 # <<<<<<<<<<<<<< @@ -14707,7 +14929,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L10:; - /* "w3lib/_url.pyx":1003 + /* "w3lib/_url.pyx":1002 * pointer -= 1 * * elif state == SCHEME: # <<<<<<<<<<<<<< @@ -14717,7 +14939,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1024 + /* "w3lib/_url.pyx":1023 * pointer = -1 * * elif state == NO_SCHEME: # <<<<<<<<<<<<<< @@ -14727,20 +14949,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_NO_SCHEME); if (unlikely(__pyx_t_6)) { - /* "w3lib/_url.pyx":1025 + /* "w3lib/_url.pyx":1024 * * elif state == NO_SCHEME: * raise ValueError("No URL scheme") # <<<<<<<<<<<<<< * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1025, __pyx_L1_error) + __PYX_ERR(0, 1024, __pyx_L1_error) - /* "w3lib/_url.pyx":1024 + /* "w3lib/_url.pyx":1023 * pointer = -1 * * elif state == NO_SCHEME: # <<<<<<<<<<<<<< @@ -14749,7 +14971,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1027 + /* "w3lib/_url.pyx":1026 * raise ValueError("No URL scheme") * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< @@ -14759,7 +14981,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_RELATIVE_OR_AUTHORITY); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1028 + /* "w3lib/_url.pyx":1027 * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< @@ -14772,8 +14994,8 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_t_8; goto __pyx_L19_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1028, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1028, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1027, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1027, __pyx_L1_error) if (__pyx_t_8) { } else { __pyx_t_6 = __pyx_t_8; @@ -14786,13 +15008,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L19_bool_binop_done; } __pyx_t_9 = (__pyx_v_pointer + 1); - __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 1028, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 1027, __pyx_L1_error) __pyx_t_8 = (__pyx_t_7 == 47); __pyx_t_6 = __pyx_t_8; __pyx_L19_bool_binop_done:; if (likely(__pyx_t_6)) { - /* "w3lib/_url.pyx":1029 + /* "w3lib/_url.pyx":1028 * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< @@ -14801,7 +15023,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":1030 + /* "w3lib/_url.pyx":1029 * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 # <<<<<<<<<<<<<< @@ -14810,7 +15032,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_pointer = (__pyx_v_pointer + 1); - /* "w3lib/_url.pyx":1028 + /* "w3lib/_url.pyx":1027 * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< @@ -14820,7 +15042,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L18; } - /* "w3lib/_url.pyx":1032 + /* "w3lib/_url.pyx":1031 * pointer += 1 * else: * raise ValueError("URL is relative") # <<<<<<<<<<<<<< @@ -14828,15 +15050,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * elif state == PATH_OR_AUTHORITY: */ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1032, __pyx_L1_error) + __PYX_ERR(0, 1031, __pyx_L1_error) } __pyx_L18:; - /* "w3lib/_url.pyx":1027 + /* "w3lib/_url.pyx":1026 * raise ValueError("No URL scheme") * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: # <<<<<<<<<<<<<< @@ -14846,7 +15068,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1034 + /* "w3lib/_url.pyx":1033 * raise ValueError("URL is relative") * * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< @@ -14856,7 +15078,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH_OR_AUTHORITY); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1035 + /* "w3lib/_url.pyx":1034 * * elif state == PATH_OR_AUTHORITY: * if not reached_end and c == "/": # <<<<<<<<<<<<<< @@ -14869,13 +15091,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_t_8; goto __pyx_L24_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1035, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1035, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1034, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1034, __pyx_L1_error) __pyx_t_6 = __pyx_t_8; __pyx_L24_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1036 + /* "w3lib/_url.pyx":1035 * elif state == PATH_OR_AUTHORITY: * if not reached_end and c == "/": * state = AUTHORITY # <<<<<<<<<<<<<< @@ -14884,7 +15106,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_AUTHORITY; - /* "w3lib/_url.pyx":1035 + /* "w3lib/_url.pyx":1034 * * elif state == PATH_OR_AUTHORITY: * if not reached_end and c == "/": # <<<<<<<<<<<<<< @@ -14894,7 +15116,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L23; } - /* "w3lib/_url.pyx":1038 + /* "w3lib/_url.pyx":1037 * state = AUTHORITY * else: * state = PATH # <<<<<<<<<<<<<< @@ -14904,7 +15126,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1039 + /* "w3lib/_url.pyx":1038 * else: * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< @@ -14915,7 +15137,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L23:; - /* "w3lib/_url.pyx":1034 + /* "w3lib/_url.pyx":1033 * raise ValueError("URL is relative") * * elif state == PATH_OR_AUTHORITY: # <<<<<<<<<<<<<< @@ -14925,7 +15147,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1041 + /* "w3lib/_url.pyx":1040 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< @@ -14935,7 +15157,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_SLASHES); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1042 + /* "w3lib/_url.pyx":1041 * * elif state == SPECIAL_AUTHORITY_SLASHES: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< @@ -14948,8 +15170,8 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_t_8; goto __pyx_L27_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1042, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1042, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1041, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1041, __pyx_L1_error) if (__pyx_t_8) { } else { __pyx_t_6 = __pyx_t_8; @@ -14962,13 +15184,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L27_bool_binop_done; } __pyx_t_9 = (__pyx_v_pointer + 1); - __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 1042, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 1041, __pyx_L1_error) __pyx_t_8 = (__pyx_t_7 == 47); __pyx_t_6 = __pyx_t_8; __pyx_L27_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1043 + /* "w3lib/_url.pyx":1042 * elif state == SPECIAL_AUTHORITY_SLASHES: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< @@ -14977,7 +15199,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":1044 + /* "w3lib/_url.pyx":1043 * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer += 1 # <<<<<<<<<<<<<< @@ -14986,7 +15208,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_pointer = (__pyx_v_pointer + 1); - /* "w3lib/_url.pyx":1042 + /* "w3lib/_url.pyx":1041 * * elif state == SPECIAL_AUTHORITY_SLASHES: * if not reached_end and c == "/" and pointer + 1 < input_length and input[pointer + 1] == "/": # <<<<<<<<<<<<<< @@ -14996,7 +15218,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L26; } - /* "w3lib/_url.pyx":1046 + /* "w3lib/_url.pyx":1045 * pointer += 1 * else: * state = SPECIAL_AUTHORITY_IGNORE_SLASHES # <<<<<<<<<<<<<< @@ -15006,7 +15228,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES; - /* "w3lib/_url.pyx":1047 + /* "w3lib/_url.pyx":1046 * else: * state = SPECIAL_AUTHORITY_IGNORE_SLASHES * pointer -= 1 # <<<<<<<<<<<<<< @@ -15017,7 +15239,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L26:; - /* "w3lib/_url.pyx":1041 + /* "w3lib/_url.pyx":1040 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_SLASHES: # <<<<<<<<<<<<<< @@ -15027,7 +15249,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1049 + /* "w3lib/_url.pyx":1048 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< @@ -15037,7 +15259,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_SPECIAL_AUTHORITY_IGNORE_SLASHES); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1050 + /* "w3lib/_url.pyx":1049 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: * if reached_end or c not in "/\\": # <<<<<<<<<<<<<< @@ -15049,13 +15271,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_v_reached_end; goto __pyx_L32_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1050, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__13, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1050, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1049, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__13, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1049, __pyx_L1_error) __pyx_t_6 = __pyx_t_8; __pyx_L32_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1051 + /* "w3lib/_url.pyx":1050 * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: * if reached_end or c not in "/\\": * state = AUTHORITY # <<<<<<<<<<<<<< @@ -15064,7 +15286,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_AUTHORITY; - /* "w3lib/_url.pyx":1052 + /* "w3lib/_url.pyx":1051 * if reached_end or c not in "/\\": * state = AUTHORITY * pointer -= 1 # <<<<<<<<<<<<<< @@ -15073,7 +15295,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_pointer = (__pyx_v_pointer - 1); - /* "w3lib/_url.pyx":1050 + /* "w3lib/_url.pyx":1049 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: * if reached_end or c not in "/\\": # <<<<<<<<<<<<<< @@ -15082,7 +15304,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1049 + /* "w3lib/_url.pyx":1048 * pointer -= 1 * * elif state == SPECIAL_AUTHORITY_IGNORE_SLASHES: # <<<<<<<<<<<<<< @@ -15092,7 +15314,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1054 + /* "w3lib/_url.pyx":1053 * pointer -= 1 * * elif state == AUTHORITY: # <<<<<<<<<<<<<< @@ -15102,7 +15324,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_AUTHORITY); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1055 + /* "w3lib/_url.pyx":1054 * * elif state == AUTHORITY: * if not skip_authority_shortcut: # <<<<<<<<<<<<<< @@ -15112,7 +15334,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (!__pyx_v_skip_authority_shortcut); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1056 + /* "w3lib/_url.pyx":1055 * elif state == AUTHORITY: * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) # <<<<<<<<<<<<<< @@ -15121,29 +15343,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ if (unlikely(__pyx_v_input == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "find"); - __PYX_ERR(0, 1056, __pyx_L1_error) + __PYX_ERR(0, 1055, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_pointer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1056, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_pointer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = (__Pyx_Py_IsNone(__pyx_t_2) ? (0) : (__Pyx_PyIndex_AsSsize_t(__pyx_t_2))); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L1_error) + __pyx_t_5 = (__Pyx_Py_IsNone(__pyx_t_2) ? (0) : (__Pyx_PyIndex_AsSsize_t(__pyx_t_2))); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_10 = PyUnicode_Find(__pyx_v_input, __pyx_kp_u__14, __pyx_t_5, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-2))) __PYX_ERR(0, 1056, __pyx_L1_error) - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1056, __pyx_L1_error) + __pyx_t_10 = PyUnicode_Find(__pyx_v_input, __pyx_kp_u__14, __pyx_t_5, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-2))) __PYX_ERR(0, 1055, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_at_sign_index, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1057 + /* "w3lib/_url.pyx":1056 * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: # <<<<<<<<<<<<<< * state = HOST * else: */ - __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_at_sign_index, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1057, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_at_sign_index, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1056, __pyx_L1_error) if (__pyx_t_6) { - /* "w3lib/_url.pyx":1058 + /* "w3lib/_url.pyx":1057 * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: * state = HOST # <<<<<<<<<<<<<< @@ -15152,7 +15374,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_HOST; - /* "w3lib/_url.pyx":1057 + /* "w3lib/_url.pyx":1056 * if not skip_authority_shortcut: * at_sign_index = input.find("@", pointer) * if at_sign_index == -1: # <<<<<<<<<<<<<< @@ -15162,7 +15384,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L35; } - /* "w3lib/_url.pyx":1060 + /* "w3lib/_url.pyx":1059 * state = HOST * else: * skip_authority_shortcut = True # <<<<<<<<<<<<<< @@ -15174,7 +15396,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L35:; - /* "w3lib/_url.pyx":1061 + /* "w3lib/_url.pyx":1060 * else: * skip_authority_shortcut = True * pointer -= 1 # <<<<<<<<<<<<<< @@ -15183,7 +15405,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_pointer = (__pyx_v_pointer - 1); - /* "w3lib/_url.pyx":1055 + /* "w3lib/_url.pyx":1054 * * elif state == AUTHORITY: * if not skip_authority_shortcut: # <<<<<<<<<<<<<< @@ -15193,7 +15415,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L34; } - /* "w3lib/_url.pyx":1062 + /* "w3lib/_url.pyx":1061 * skip_authority_shortcut = True * pointer -= 1 * elif not reached_end and c == "@": # <<<<<<<<<<<<<< @@ -15206,13 +15428,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_t_8; goto __pyx_L36_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1062, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1062, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1061, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1061, __pyx_L1_error) __pyx_t_6 = __pyx_t_8; __pyx_L36_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1063 + /* "w3lib/_url.pyx":1062 * pointer -= 1 * elif not reached_end and c == "@": * if at_sign_seen: # <<<<<<<<<<<<<< @@ -15221,19 +15443,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ if (__pyx_v_at_sign_seen) { - /* "w3lib/_url.pyx":1064 + /* "w3lib/_url.pyx":1063 * elif not reached_end and c == "@": * if at_sign_seen: * buffer = "%40" + buffer # <<<<<<<<<<<<<< * at_sign_seen = True * for i, code_point in enumerate(buffer): */ - __pyx_t_2 = PyNumber_Add(__pyx_kp_u_40, __pyx_v_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_kp_u_40, __pyx_v_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1063 + /* "w3lib/_url.pyx":1062 * pointer -= 1 * elif not reached_end and c == "@": * if at_sign_seen: # <<<<<<<<<<<<<< @@ -15242,7 +15464,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1065 + /* "w3lib/_url.pyx":1064 * if at_sign_seen: * buffer = "%40" + buffer * at_sign_seen = True # <<<<<<<<<<<<<< @@ -15251,7 +15473,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_at_sign_seen = 1; - /* "w3lib/_url.pyx":1066 + /* "w3lib/_url.pyx":1065 * buffer = "%40" + buffer * at_sign_seen = True * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< @@ -15265,9 +15487,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1065, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_11)) { @@ -15275,28 +15497,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1065, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1065, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1065, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1065, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -15306,7 +15528,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1066, __pyx_L1_error) + else __PYX_ERR(0, 1065, __pyx_L1_error) } break; } @@ -15316,44 +15538,44 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_3 = 0; __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; - /* "w3lib/_url.pyx":1067 + /* "w3lib/_url.pyx":1066 * at_sign_seen = True * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< * url._password_token_seen = True * continue */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_code_point, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) if (__pyx_t_8) { } else { __pyx_t_6 = __pyx_t_8; goto __pyx_L42_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = (!__pyx_t_8); __pyx_t_6 = __pyx_t_12; __pyx_L42_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1068 + /* "w3lib/_url.pyx":1067 * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: * url._password_token_seen = True # <<<<<<<<<<<<<< * continue * encoded_code_points = _idempotent_utf_8_percent_encode( */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen, Py_True) < 0) __PYX_ERR(0, 1068, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen, Py_True) < 0) __PYX_ERR(0, 1067, __pyx_L1_error) - /* "w3lib/_url.pyx":1069 + /* "w3lib/_url.pyx":1068 * if code_point == ":" and not url._password_token_seen: * url._password_token_seen = True * continue # <<<<<<<<<<<<<< @@ -15362,7 +15584,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ goto __pyx_L39_continue; - /* "w3lib/_url.pyx":1067 + /* "w3lib/_url.pyx":1066 * at_sign_seen = True * for i, code_point in enumerate(buffer): * if code_point == ":" and not url._password_token_seen: # <<<<<<<<<<<<<< @@ -15371,91 +15593,91 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1070 + /* "w3lib/_url.pyx":1069 * url._password_token_seen = True * continue * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=buffer, * pointer=i, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1070, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":1071 + /* "w3lib/_url.pyx":1070 * continue * encoded_code_points = _idempotent_utf_8_percent_encode( * input=buffer, # <<<<<<<<<<<<<< * pointer=i, * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, */ - __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1071, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_input, __pyx_v_buffer) < 0) __PYX_ERR(0, 1071, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_input, __pyx_v_buffer) < 0) __PYX_ERR(0, 1070, __pyx_L1_error) - /* "w3lib/_url.pyx":1072 + /* "w3lib/_url.pyx":1071 * encoded_code_points = _idempotent_utf_8_percent_encode( * input=buffer, * pointer=i, # <<<<<<<<<<<<<< * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, * ) */ - if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_pointer, __pyx_v_i) < 0) __PYX_ERR(0, 1071, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_pointer, __pyx_v_i) < 0) __PYX_ERR(0, 1070, __pyx_L1_error) - /* "w3lib/_url.pyx":1073 + /* "w3lib/_url.pyx":1072 * input=buffer, * pointer=i, * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * ) * if url._password_token_seen: */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1073, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_encode_set, __pyx_t_14) < 0) __PYX_ERR(0, 1071, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_encode_set, __pyx_t_14) < 0) __PYX_ERR(0, 1070, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "w3lib/_url.pyx":1070 + /* "w3lib/_url.pyx":1069 * url._password_token_seen = True * continue * encoded_code_points = _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=buffer, * pointer=i, */ - __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1070, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_encoded_code_points, __pyx_t_14); __pyx_t_14 = 0; - /* "w3lib/_url.pyx":1075 + /* "w3lib/_url.pyx":1074 * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, * ) * if url._password_token_seen: # <<<<<<<<<<<<<< * url.password += encoded_code_points * else: */ - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1075, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1075, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1076 + /* "w3lib/_url.pyx":1075 * ) * if url._password_token_seen: * url.password += encoded_code_points # <<<<<<<<<<<<<< * else: * url.username += encoded_code_points */ - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1076, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_14, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1076, __pyx_L1_error) + __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_14, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_13) < 0) __PYX_ERR(0, 1076, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_password, __pyx_t_13) < 0) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "w3lib/_url.pyx":1075 + /* "w3lib/_url.pyx":1074 * encode_set=_SAFE_USERINFO_PERCENT_ENCODE_SET, * ) * if url._password_token_seen: # <<<<<<<<<<<<<< @@ -15465,7 +15687,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L44; } - /* "w3lib/_url.pyx":1078 + /* "w3lib/_url.pyx":1077 * url.password += encoded_code_points * else: * url.username += encoded_code_points # <<<<<<<<<<<<<< @@ -15473,17 +15695,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": */ /*else*/ { - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1078, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1078, __pyx_L1_error) + __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_v_encoded_code_points); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_14) < 0) __PYX_ERR(0, 1078, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_username, __pyx_t_14) < 0) __PYX_ERR(0, 1077, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __pyx_L44:; - /* "w3lib/_url.pyx":1066 + /* "w3lib/_url.pyx":1065 * buffer = "%40" + buffer * at_sign_seen = True * for i, code_point in enumerate(buffer): # <<<<<<<<<<<<<< @@ -15495,7 +15717,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1079 + /* "w3lib/_url.pyx":1078 * else: * url.username += encoded_code_points * buffer = "" # <<<<<<<<<<<<<< @@ -15505,7 +15727,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1062 + /* "w3lib/_url.pyx":1061 * skip_authority_shortcut = True * pointer -= 1 * elif not reached_end and c == "@": # <<<<<<<<<<<<<< @@ -15515,7 +15737,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L34; } - /* "w3lib/_url.pyx":1080 + /* "w3lib/_url.pyx":1079 * url.username += encoded_code_points * buffer = "" * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< @@ -15527,18 +15749,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_v_reached_end; goto __pyx_L46_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1080, __pyx_L1_error) } - __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1079, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) if (!__pyx_t_12) { } else { __pyx_t_6 = __pyx_t_12; goto __pyx_L46_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_12) { @@ -15546,13 +15768,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_t_12; goto __pyx_L46_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1080, __pyx_L1_error) } - __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1079, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) __pyx_t_6 = __pyx_t_12; __pyx_L46_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1081 + /* "w3lib/_url.pyx":1080 * buffer = "" * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< @@ -15564,13 +15786,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_v_at_sign_seen; goto __pyx_L51_bool_binop_done; } - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1080, __pyx_L1_error) __pyx_t_8 = (!__pyx_t_12); __pyx_t_6 = __pyx_t_8; __pyx_L51_bool_binop_done:; if (unlikely(__pyx_t_6)) { - /* "w3lib/_url.pyx":1082 + /* "w3lib/_url.pyx":1081 * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if at_sign_seen and not buffer: * raise ValueError # <<<<<<<<<<<<<< @@ -15578,9 +15800,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * buffer = "" */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1082, __pyx_L1_error) + __PYX_ERR(0, 1081, __pyx_L1_error) - /* "w3lib/_url.pyx":1081 + /* "w3lib/_url.pyx":1080 * buffer = "" * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if at_sign_seen and not buffer: # <<<<<<<<<<<<<< @@ -15589,17 +15811,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1083 + /* "w3lib/_url.pyx":1082 * if at_sign_seen and not buffer: * raise ValueError * pointer -= len(buffer) + 1 # <<<<<<<<<<<<<< * buffer = "" * state = HOST */ - __pyx_t_10 = PyObject_Length(__pyx_v_buffer); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1083, __pyx_L1_error) + __pyx_t_10 = PyObject_Length(__pyx_v_buffer); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1082, __pyx_L1_error) __pyx_v_pointer = (__pyx_v_pointer - (__pyx_t_10 + 1)); - /* "w3lib/_url.pyx":1084 + /* "w3lib/_url.pyx":1083 * raise ValueError * pointer -= len(buffer) + 1 * buffer = "" # <<<<<<<<<<<<<< @@ -15609,7 +15831,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1085 + /* "w3lib/_url.pyx":1084 * pointer -= len(buffer) + 1 * buffer = "" * state = HOST # <<<<<<<<<<<<<< @@ -15618,7 +15840,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_HOST; - /* "w3lib/_url.pyx":1080 + /* "w3lib/_url.pyx":1079 * url.username += encoded_code_points * buffer = "" * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< @@ -15628,7 +15850,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L34; } - /* "w3lib/_url.pyx":1087 + /* "w3lib/_url.pyx":1086 * state = HOST * else: * buffer += c # <<<<<<<<<<<<<< @@ -15636,15 +15858,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * elif state == HOST: */ /*else*/ { - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1087, __pyx_L1_error) } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1087, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1086, __pyx_L1_error) } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L34:; - /* "w3lib/_url.pyx":1054 + /* "w3lib/_url.pyx":1053 * pointer -= 1 * * elif state == AUTHORITY: # <<<<<<<<<<<<<< @@ -15654,7 +15876,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1089 + /* "w3lib/_url.pyx":1088 * buffer += c * * elif state == HOST: # <<<<<<<<<<<<<< @@ -15664,7 +15886,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = (__pyx_v_state == __pyx_v_5w3lib_4_url_HOST); if (__pyx_t_6) { - /* "w3lib/_url.pyx":1090 + /* "w3lib/_url.pyx":1089 * * elif state == HOST: * if not reached_end and c == ":" and not inside_brackets: # <<<<<<<<<<<<<< @@ -15677,8 +15899,8 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_t_8; goto __pyx_L54_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1090, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1090, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1089, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1089, __pyx_L1_error) if (__pyx_t_8) { } else { __pyx_t_6 = __pyx_t_8; @@ -15689,18 +15911,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_L54_bool_binop_done:; if (__pyx_t_6) { - /* "w3lib/_url.pyx":1091 + /* "w3lib/_url.pyx":1090 * elif state == HOST: * if not reached_end and c == ":" and not inside_brackets: * if not buffer: # <<<<<<<<<<<<<< * raise ValueError * url = _parse_host(buffer, url) */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1091, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1090, __pyx_L1_error) __pyx_t_8 = (!__pyx_t_6); if (unlikely(__pyx_t_8)) { - /* "w3lib/_url.pyx":1092 + /* "w3lib/_url.pyx":1091 * if not reached_end and c == ":" and not inside_brackets: * if not buffer: * raise ValueError # <<<<<<<<<<<<<< @@ -15708,9 +15930,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * buffer = "" */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1092, __pyx_L1_error) + __PYX_ERR(0, 1091, __pyx_L1_error) - /* "w3lib/_url.pyx":1091 + /* "w3lib/_url.pyx":1090 * elif state == HOST: * if not reached_end and c == ":" and not inside_brackets: * if not buffer: # <<<<<<<<<<<<<< @@ -15719,14 +15941,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1093 + /* "w3lib/_url.pyx":1092 * if not buffer: * raise ValueError * url = _parse_host(buffer, url) # <<<<<<<<<<<<<< * buffer = "" * state = PORT */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1093, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = NULL; __pyx_t_4 = 0; @@ -15746,14 +15968,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_v_buffer, __pyx_v_url}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_url, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1094 + /* "w3lib/_url.pyx":1093 * raise ValueError * url = _parse_host(buffer, url) * buffer = "" # <<<<<<<<<<<<<< @@ -15763,7 +15985,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1095 + /* "w3lib/_url.pyx":1094 * url = _parse_host(buffer, url) * buffer = "" * state = PORT # <<<<<<<<<<<<<< @@ -15772,16 +15994,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PORT; - /* "w3lib/_url.pyx":1096 + /* "w3lib/_url.pyx":1095 * buffer = "" * state = PORT * url._port_token_seen = True # <<<<<<<<<<<<<< * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * pointer -= 1 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen, Py_True) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen, Py_True) < 0) __PYX_ERR(0, 1095, __pyx_L1_error) - /* "w3lib/_url.pyx":1090 + /* "w3lib/_url.pyx":1089 * * elif state == HOST: * if not reached_end and c == ":" and not inside_brackets: # <<<<<<<<<<<<<< @@ -15791,7 +16013,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L53; } - /* "w3lib/_url.pyx":1097 + /* "w3lib/_url.pyx":1096 * state = PORT * url._port_token_seen = True * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< @@ -15803,18 +16025,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = __pyx_v_reached_end; goto __pyx_L58_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1097, __pyx_L1_error) } - __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1097, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1096, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1096, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_8 = __pyx_t_6; goto __pyx_L58_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1097, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1097, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1097, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { @@ -15822,13 +16044,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = __pyx_t_6; goto __pyx_L58_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1097, __pyx_L1_error) } - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1097, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1096, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_t_8 = __pyx_t_6; __pyx_L58_bool_binop_done:; if (__pyx_t_8) { - /* "w3lib/_url.pyx":1098 + /* "w3lib/_url.pyx":1097 * url._port_token_seen = True * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * pointer -= 1 # <<<<<<<<<<<<<< @@ -15837,18 +16059,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_pointer = (__pyx_v_pointer - 1); - /* "w3lib/_url.pyx":1099 + /* "w3lib/_url.pyx":1098 * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * pointer -= 1 * if url.scheme in _SPECIAL_SCHEMES and not buffer: # <<<<<<<<<<<<<< * raise ValueError * url = _parse_host(buffer, url) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1099, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1099, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1099, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { @@ -15856,13 +16078,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = __pyx_t_6; goto __pyx_L63_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1099, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1098, __pyx_L1_error) __pyx_t_12 = (!__pyx_t_6); __pyx_t_8 = __pyx_t_12; __pyx_L63_bool_binop_done:; if (unlikely(__pyx_t_8)) { - /* "w3lib/_url.pyx":1100 + /* "w3lib/_url.pyx":1099 * pointer -= 1 * if url.scheme in _SPECIAL_SCHEMES and not buffer: * raise ValueError # <<<<<<<<<<<<<< @@ -15870,9 +16092,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * buffer = "" */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1100, __pyx_L1_error) + __PYX_ERR(0, 1099, __pyx_L1_error) - /* "w3lib/_url.pyx":1099 + /* "w3lib/_url.pyx":1098 * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * pointer -= 1 * if url.scheme in _SPECIAL_SCHEMES and not buffer: # <<<<<<<<<<<<<< @@ -15881,14 +16103,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1101 + /* "w3lib/_url.pyx":1100 * if url.scheme in _SPECIAL_SCHEMES and not buffer: * raise ValueError * url = _parse_host(buffer, url) # <<<<<<<<<<<<<< * buffer = "" * state = PATH_START */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = NULL; __pyx_t_4 = 0; @@ -15908,14 +16130,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_v_buffer, __pyx_v_url}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_url, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1102 + /* "w3lib/_url.pyx":1101 * raise ValueError * url = _parse_host(buffer, url) * buffer = "" # <<<<<<<<<<<<<< @@ -15925,7 +16147,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1103 + /* "w3lib/_url.pyx":1102 * url = _parse_host(buffer, url) * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< @@ -15934,7 +16156,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":1097 + /* "w3lib/_url.pyx":1096 * state = PORT * url._port_token_seen = True * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< @@ -15944,7 +16166,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L53; } - /* "w3lib/_url.pyx":1104 + /* "w3lib/_url.pyx":1103 * buffer = "" * state = PATH_START * elif not reached_end: # <<<<<<<<<<<<<< @@ -15954,18 +16176,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = (!__pyx_v_reached_end); if (__pyx_t_8) { - /* "w3lib/_url.pyx":1105 + /* "w3lib/_url.pyx":1104 * state = PATH_START * elif not reached_end: * if c == "[": # <<<<<<<<<<<<<< * inside_brackets = True * elif c == "]": */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1105, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1105, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1104, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1104, __pyx_L1_error) if (__pyx_t_8) { - /* "w3lib/_url.pyx":1106 + /* "w3lib/_url.pyx":1105 * elif not reached_end: * if c == "[": * inside_brackets = True # <<<<<<<<<<<<<< @@ -15974,7 +16196,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_inside_brackets = 1; - /* "w3lib/_url.pyx":1105 + /* "w3lib/_url.pyx":1104 * state = PATH_START * elif not reached_end: * if c == "[": # <<<<<<<<<<<<<< @@ -15984,18 +16206,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L65; } - /* "w3lib/_url.pyx":1107 + /* "w3lib/_url.pyx":1106 * if c == "[": * inside_brackets = True * elif c == "]": # <<<<<<<<<<<<<< * inside_brackets = False * buffer += c */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1107, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1107, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1106, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1106, __pyx_L1_error) if (__pyx_t_8) { - /* "w3lib/_url.pyx":1108 + /* "w3lib/_url.pyx":1107 * inside_brackets = True * elif c == "]": * inside_brackets = False # <<<<<<<<<<<<<< @@ -16004,7 +16226,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_inside_brackets = 0; - /* "w3lib/_url.pyx":1107 + /* "w3lib/_url.pyx":1106 * if c == "[": * inside_brackets = True * elif c == "]": # <<<<<<<<<<<<<< @@ -16014,20 +16236,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L65:; - /* "w3lib/_url.pyx":1109 + /* "w3lib/_url.pyx":1108 * elif c == "]": * inside_brackets = False * buffer += c # <<<<<<<<<<<<<< * * elif state == PORT: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1109, __pyx_L1_error) } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1108, __pyx_L1_error) } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1104 + /* "w3lib/_url.pyx":1103 * buffer = "" * state = PATH_START * elif not reached_end: # <<<<<<<<<<<<<< @@ -16037,7 +16259,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L53:; - /* "w3lib/_url.pyx":1089 + /* "w3lib/_url.pyx":1088 * buffer += c * * elif state == HOST: # <<<<<<<<<<<<<< @@ -16047,7 +16269,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1111 + /* "w3lib/_url.pyx":1110 * buffer += c * * elif state == PORT: # <<<<<<<<<<<<<< @@ -16057,7 +16279,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PORT); if (__pyx_t_8) { - /* "w3lib/_url.pyx":1112 + /* "w3lib/_url.pyx":1111 * * elif state == PORT: * if not reached_end and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< @@ -16070,29 +16292,29 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = __pyx_t_12; goto __pyx_L67_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1112, __pyx_L1_error) } - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1111, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ASCII_DIGIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1112, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __pyx_t_12; __pyx_L67_bool_binop_done:; if (__pyx_t_8) { - /* "w3lib/_url.pyx":1113 + /* "w3lib/_url.pyx":1112 * elif state == PORT: * if not reached_end and c in _ASCII_DIGIT: * buffer += c # <<<<<<<<<<<<<< * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if buffer: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1113, __pyx_L1_error) } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1113, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1112, __pyx_L1_error) } + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1112 + /* "w3lib/_url.pyx":1111 * * elif state == PORT: * if not reached_end and c in _ASCII_DIGIT: # <<<<<<<<<<<<<< @@ -16102,7 +16324,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L66; } - /* "w3lib/_url.pyx":1114 + /* "w3lib/_url.pyx":1113 * if not reached_end and c in _ASCII_DIGIT: * buffer += c * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< @@ -16114,18 +16336,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = __pyx_v_reached_end; goto __pyx_L69_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1114, __pyx_L1_error) } - __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1113, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1113, __pyx_L1_error) if (!__pyx_t_12) { } else { __pyx_t_8 = __pyx_t_12; goto __pyx_L69_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1114, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_12) { @@ -16133,36 +16355,36 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = __pyx_t_12; goto __pyx_L69_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1114, __pyx_L1_error) } - __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1113, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1113, __pyx_L1_error) __pyx_t_8 = __pyx_t_12; __pyx_L69_bool_binop_done:; if (likely(__pyx_t_8)) { - /* "w3lib/_url.pyx":1115 + /* "w3lib/_url.pyx":1114 * buffer += c * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if buffer: # <<<<<<<<<<<<<< * port: cython.int = int(buffer) * if port > 2**16 - 1: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1115, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) if (__pyx_t_8) { - /* "w3lib/_url.pyx":1116 + /* "w3lib/_url.pyx":1115 * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if buffer: * port: cython.int = int(buffer) # <<<<<<<<<<<<<< * if port > 2**16 - 1: * raise ValueError(f"Port {port} is too high.") */ - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1116, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_port = __pyx_t_4; - /* "w3lib/_url.pyx":1117 + /* "w3lib/_url.pyx":1116 * if buffer: * port: cython.int = int(buffer) * if port > 2**16 - 1: # <<<<<<<<<<<<<< @@ -16172,14 +16394,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = (__pyx_v_port > 0xffff); if (unlikely(__pyx_t_8)) { - /* "w3lib/_url.pyx":1118 + /* "w3lib/_url.pyx":1117 * port: cython.int = int(buffer) * if port > 2**16 - 1: * raise ValueError(f"Port {port} is too high.") # <<<<<<<<<<<<<< * url.port = port * buffer = "" */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = 0; __pyx_t_7 = 127; @@ -16187,7 +16409,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_10 += 5; __Pyx_GIVEREF(__pyx_kp_u_Port); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Port); - __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_port, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1118, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_port, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -16197,17 +16419,17 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_10 += 13; __Pyx_GIVEREF(__pyx_kp_u_is_too_high); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_is_too_high); - __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1118, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1118, __pyx_L1_error) + __PYX_ERR(0, 1117, __pyx_L1_error) - /* "w3lib/_url.pyx":1117 + /* "w3lib/_url.pyx":1116 * if buffer: * port: cython.int = int(buffer) * if port > 2**16 - 1: # <<<<<<<<<<<<<< @@ -16216,19 +16438,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1119 + /* "w3lib/_url.pyx":1118 * if port > 2**16 - 1: * raise ValueError(f"Port {port} is too high.") * url.port = port # <<<<<<<<<<<<<< * buffer = "" * state = PATH_START */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_port); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_port); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_2) < 0) __PYX_ERR(0, 1119, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_port, __pyx_t_2) < 0) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1120 + /* "w3lib/_url.pyx":1119 * raise ValueError(f"Port {port} is too high.") * url.port = port * buffer = "" # <<<<<<<<<<<<<< @@ -16238,7 +16460,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1115 + /* "w3lib/_url.pyx":1114 * buffer += c * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": * if buffer: # <<<<<<<<<<<<<< @@ -16247,7 +16469,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1121 + /* "w3lib/_url.pyx":1120 * url.port = port * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< @@ -16256,7 +16478,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":1122 + /* "w3lib/_url.pyx":1121 * buffer = "" * state = PATH_START * pointer -= 1 # <<<<<<<<<<<<<< @@ -16265,7 +16487,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_pointer = (__pyx_v_pointer - 1); - /* "w3lib/_url.pyx":1114 + /* "w3lib/_url.pyx":1113 * if not reached_end and c in _ASCII_DIGIT: * buffer += c * elif reached_end or c in "/?#" or url.scheme in _SPECIAL_SCHEMES and c == "\\": # <<<<<<<<<<<<<< @@ -16275,7 +16497,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L66; } - /* "w3lib/_url.pyx":1124 + /* "w3lib/_url.pyx":1123 * pointer -= 1 * else: * raise ValueError # <<<<<<<<<<<<<< @@ -16284,11 +16506,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ /*else*/ { __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - __PYX_ERR(0, 1124, __pyx_L1_error) + __PYX_ERR(0, 1123, __pyx_L1_error) } __pyx_L66:; - /* "w3lib/_url.pyx":1111 + /* "w3lib/_url.pyx":1110 * buffer += c * * elif state == PORT: # <<<<<<<<<<<<<< @@ -16298,7 +16520,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1126 + /* "w3lib/_url.pyx":1125 * raise ValueError * * elif state == FILE: # <<<<<<<<<<<<<< @@ -16308,25 +16530,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE); if (__pyx_t_8) { - /* "w3lib/_url.pyx":1127 + /* "w3lib/_url.pyx":1126 * * elif state == FILE: * url.scheme = "file" # <<<<<<<<<<<<<< * url.hostname = "" * if not reached_end and c in "/\\": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme, __pyx_n_u_file) < 0) __PYX_ERR(0, 1127, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_scheme, __pyx_n_u_file) < 0) __PYX_ERR(0, 1126, __pyx_L1_error) - /* "w3lib/_url.pyx":1128 + /* "w3lib/_url.pyx":1127 * elif state == FILE: * url.scheme = "file" * url.hostname = "" # <<<<<<<<<<<<<< * if not reached_end and c in "/\\": * state = FILE_SLASH */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1128, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1127, __pyx_L1_error) - /* "w3lib/_url.pyx":1129 + /* "w3lib/_url.pyx":1128 * url.scheme = "file" * url.hostname = "" * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< @@ -16339,13 +16561,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = __pyx_t_12; goto __pyx_L76_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1129, __pyx_L1_error) } - __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1129, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1128, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1128, __pyx_L1_error) __pyx_t_8 = __pyx_t_12; __pyx_L76_bool_binop_done:; if (__pyx_t_8) { - /* "w3lib/_url.pyx":1130 + /* "w3lib/_url.pyx":1129 * url.hostname = "" * if not reached_end and c in "/\\": * state = FILE_SLASH # <<<<<<<<<<<<<< @@ -16354,7 +16576,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FILE_SLASH; - /* "w3lib/_url.pyx":1129 + /* "w3lib/_url.pyx":1128 * url.scheme = "file" * url.hostname = "" * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< @@ -16364,7 +16586,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L75; } - /* "w3lib/_url.pyx":1132 + /* "w3lib/_url.pyx":1131 * state = FILE_SLASH * else: * state = PATH # <<<<<<<<<<<<<< @@ -16374,7 +16596,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1133 + /* "w3lib/_url.pyx":1132 * else: * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< @@ -16385,7 +16607,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L75:; - /* "w3lib/_url.pyx":1126 + /* "w3lib/_url.pyx":1125 * raise ValueError * * elif state == FILE: # <<<<<<<<<<<<<< @@ -16395,7 +16617,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1135 + /* "w3lib/_url.pyx":1134 * pointer -= 1 * * elif state == FILE_SLASH: # <<<<<<<<<<<<<< @@ -16405,7 +16627,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_SLASH); if (__pyx_t_8) { - /* "w3lib/_url.pyx":1136 + /* "w3lib/_url.pyx":1135 * * elif state == FILE_SLASH: * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< @@ -16418,13 +16640,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = __pyx_t_12; goto __pyx_L79_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1136, __pyx_L1_error) } - __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1136, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1135, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1135, __pyx_L1_error) __pyx_t_8 = __pyx_t_12; __pyx_L79_bool_binop_done:; if (__pyx_t_8) { - /* "w3lib/_url.pyx":1137 + /* "w3lib/_url.pyx":1136 * elif state == FILE_SLASH: * if not reached_end and c in "/\\": * state = FILE_HOST # <<<<<<<<<<<<<< @@ -16433,7 +16655,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FILE_HOST; - /* "w3lib/_url.pyx":1136 + /* "w3lib/_url.pyx":1135 * * elif state == FILE_SLASH: * if not reached_end and c in "/\\": # <<<<<<<<<<<<<< @@ -16443,7 +16665,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L78; } - /* "w3lib/_url.pyx":1139 + /* "w3lib/_url.pyx":1138 * state = FILE_HOST * else: * state = PATH # <<<<<<<<<<<<<< @@ -16453,7 +16675,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1140 + /* "w3lib/_url.pyx":1139 * else: * state = PATH * pointer -= 1 # <<<<<<<<<<<<<< @@ -16464,7 +16686,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L78:; - /* "w3lib/_url.pyx":1135 + /* "w3lib/_url.pyx":1134 * pointer -= 1 * * elif state == FILE_SLASH: # <<<<<<<<<<<<<< @@ -16474,7 +16696,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1142 + /* "w3lib/_url.pyx":1141 * pointer -= 1 * * elif state == FILE_HOST: # <<<<<<<<<<<<<< @@ -16484,7 +16706,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FILE_HOST); if (__pyx_t_8) { - /* "w3lib/_url.pyx":1143 + /* "w3lib/_url.pyx":1142 * * elif state == FILE_HOST: * if reached_end or c in "/\\?#": # <<<<<<<<<<<<<< @@ -16496,13 +16718,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = __pyx_v_reached_end; goto __pyx_L82_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1143, __pyx_L1_error) } - __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1143, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1142, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1142, __pyx_L1_error) __pyx_t_8 = __pyx_t_12; __pyx_L82_bool_binop_done:; if (__pyx_t_8) { - /* "w3lib/_url.pyx":1144 + /* "w3lib/_url.pyx":1143 * elif state == FILE_HOST: * if reached_end or c in "/\\?#": * pointer -= 1 # <<<<<<<<<<<<<< @@ -16511,14 +16733,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_pointer = (__pyx_v_pointer - 1); - /* "w3lib/_url.pyx":1145 + /* "w3lib/_url.pyx":1144 * if reached_end or c in "/\\?#": * pointer -= 1 * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< * state = PATH * elif not buffer: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1145, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = NULL; __pyx_t_4 = 0; @@ -16538,15 +16760,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_buffer}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1145, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_8) { - /* "w3lib/_url.pyx":1146 + /* "w3lib/_url.pyx":1145 * pointer -= 1 * if _is_windows_drive_letter(buffer): * state = PATH # <<<<<<<<<<<<<< @@ -16555,7 +16777,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1145 + /* "w3lib/_url.pyx":1144 * if reached_end or c in "/\\?#": * pointer -= 1 * if _is_windows_drive_letter(buffer): # <<<<<<<<<<<<<< @@ -16565,27 +16787,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L84; } - /* "w3lib/_url.pyx":1147 + /* "w3lib/_url.pyx":1146 * if _is_windows_drive_letter(buffer): * state = PATH * elif not buffer: # <<<<<<<<<<<<<< * url.hostname = "" * state = PATH_START */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1147, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1146, __pyx_L1_error) __pyx_t_12 = (!__pyx_t_8); if (__pyx_t_12) { - /* "w3lib/_url.pyx":1148 + /* "w3lib/_url.pyx":1147 * state = PATH * elif not buffer: * url.hostname = "" # <<<<<<<<<<<<<< * state = PATH_START * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1148, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1147, __pyx_L1_error) - /* "w3lib/_url.pyx":1149 + /* "w3lib/_url.pyx":1148 * elif not buffer: * url.hostname = "" * state = PATH_START # <<<<<<<<<<<<<< @@ -16594,7 +16816,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH_START; - /* "w3lib/_url.pyx":1147 + /* "w3lib/_url.pyx":1146 * if _is_windows_drive_letter(buffer): * state = PATH * elif not buffer: # <<<<<<<<<<<<<< @@ -16604,7 +16826,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L84; } - /* "w3lib/_url.pyx":1151 + /* "w3lib/_url.pyx":1150 * state = PATH_START * else: * url = _parse_host(buffer, url) # <<<<<<<<<<<<<< @@ -16612,7 +16834,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * url.hostname = "" */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1151, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = NULL; __pyx_t_4 = 0; @@ -16632,36 +16854,36 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_v_buffer, __pyx_v_url}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1151, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF_SET(__pyx_v_url, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1152 + /* "w3lib/_url.pyx":1151 * else: * url = _parse_host(buffer, url) * if url.hostname == "localhost": # <<<<<<<<<<<<<< * url.hostname = "" * buffer = "" */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1152, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_localhost, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1152, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_localhost, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_12) { - /* "w3lib/_url.pyx":1153 + /* "w3lib/_url.pyx":1152 * url = _parse_host(buffer, url) * if url.hostname == "localhost": * url.hostname = "" # <<<<<<<<<<<<<< * buffer = "" * state = PATH_START */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1153, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_hostname, __pyx_kp_u_) < 0) __PYX_ERR(0, 1152, __pyx_L1_error) - /* "w3lib/_url.pyx":1152 + /* "w3lib/_url.pyx":1151 * else: * url = _parse_host(buffer, url) * if url.hostname == "localhost": # <<<<<<<<<<<<<< @@ -16670,7 +16892,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1154 + /* "w3lib/_url.pyx":1153 * if url.hostname == "localhost": * url.hostname = "" * buffer = "" # <<<<<<<<<<<<<< @@ -16680,7 +16902,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1155 + /* "w3lib/_url.pyx":1154 * url.hostname = "" * buffer = "" * state = PATH_START # <<<<<<<<<<<<<< @@ -16691,7 +16913,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L84:; - /* "w3lib/_url.pyx":1143 + /* "w3lib/_url.pyx":1142 * * elif state == FILE_HOST: * if reached_end or c in "/\\?#": # <<<<<<<<<<<<<< @@ -16701,7 +16923,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L81; } - /* "w3lib/_url.pyx":1156 + /* "w3lib/_url.pyx":1155 * buffer = "" * state = PATH_START * elif not reached_end: # <<<<<<<<<<<<<< @@ -16711,20 +16933,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = (!__pyx_v_reached_end); if (__pyx_t_12) { - /* "w3lib/_url.pyx":1157 + /* "w3lib/_url.pyx":1156 * state = PATH_START * elif not reached_end: * buffer += c # <<<<<<<<<<<<<< * * elif state == PATH_START: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1157, __pyx_L1_error) } - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1157, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1156, __pyx_L1_error) } + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1156 + /* "w3lib/_url.pyx":1155 * buffer = "" * state = PATH_START * elif not reached_end: # <<<<<<<<<<<<<< @@ -16734,7 +16956,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L81:; - /* "w3lib/_url.pyx":1142 + /* "w3lib/_url.pyx":1141 * pointer -= 1 * * elif state == FILE_HOST: # <<<<<<<<<<<<<< @@ -16744,7 +16966,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1159 + /* "w3lib/_url.pyx":1158 * buffer += c * * elif state == PATH_START: # <<<<<<<<<<<<<< @@ -16754,23 +16976,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH_START); if (__pyx_t_12) { - /* "w3lib/_url.pyx":1160 + /* "w3lib/_url.pyx":1159 * * elif state == PATH_START: * if url.scheme in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< * state = PATH * if not reached_end and c not in "/\\": */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1160, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_12) { - /* "w3lib/_url.pyx":1161 + /* "w3lib/_url.pyx":1160 * elif state == PATH_START: * if url.scheme in _SPECIAL_SCHEMES: * state = PATH # <<<<<<<<<<<<<< @@ -16779,7 +17001,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1162 + /* "w3lib/_url.pyx":1161 * if url.scheme in _SPECIAL_SCHEMES: * state = PATH * if not reached_end and c not in "/\\": # <<<<<<<<<<<<<< @@ -16792,13 +17014,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = __pyx_t_8; goto __pyx_L88_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1162, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__13, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1162, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1161, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__13, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1161, __pyx_L1_error) __pyx_t_12 = __pyx_t_8; __pyx_L88_bool_binop_done:; if (__pyx_t_12) { - /* "w3lib/_url.pyx":1163 + /* "w3lib/_url.pyx":1162 * state = PATH * if not reached_end and c not in "/\\": * pointer -= 1 # <<<<<<<<<<<<<< @@ -16807,7 +17029,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_pointer = (__pyx_v_pointer - 1); - /* "w3lib/_url.pyx":1162 + /* "w3lib/_url.pyx":1161 * if url.scheme in _SPECIAL_SCHEMES: * state = PATH * if not reached_end and c not in "/\\": # <<<<<<<<<<<<<< @@ -16816,7 +17038,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1160 + /* "w3lib/_url.pyx":1159 * * elif state == PATH_START: * if url.scheme in _SPECIAL_SCHEMES: # <<<<<<<<<<<<<< @@ -16826,7 +17048,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L86; } - /* "w3lib/_url.pyx":1164 + /* "w3lib/_url.pyx":1163 * if not reached_end and c not in "/\\": * pointer -= 1 * elif not reached_end: # <<<<<<<<<<<<<< @@ -16836,27 +17058,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = (!__pyx_v_reached_end); if (__pyx_t_12) { - /* "w3lib/_url.pyx":1165 + /* "w3lib/_url.pyx":1164 * pointer -= 1 * elif not reached_end: * if c == "?": # <<<<<<<<<<<<<< * url._query_token_seen = True * state = QUERY */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1165, __pyx_L1_error) } - __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1165, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1164, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1164, __pyx_L1_error) if (__pyx_t_12) { - /* "w3lib/_url.pyx":1166 + /* "w3lib/_url.pyx":1165 * elif not reached_end: * if c == "?": * url._query_token_seen = True # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1166, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1165, __pyx_L1_error) - /* "w3lib/_url.pyx":1167 + /* "w3lib/_url.pyx":1166 * if c == "?": * url._query_token_seen = True * state = QUERY # <<<<<<<<<<<<<< @@ -16865,7 +17087,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":1165 + /* "w3lib/_url.pyx":1164 * pointer -= 1 * elif not reached_end: * if c == "?": # <<<<<<<<<<<<<< @@ -16875,27 +17097,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L90; } - /* "w3lib/_url.pyx":1168 + /* "w3lib/_url.pyx":1167 * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< * url._fragment_token_seen = True * state = FRAGMENT */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1168, __pyx_L1_error) } - __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1168, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1167, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1167, __pyx_L1_error) if (__pyx_t_12) { - /* "w3lib/_url.pyx":1169 + /* "w3lib/_url.pyx":1168 * state = QUERY * elif c == "#": * url._fragment_token_seen = True # <<<<<<<<<<<<<< * state = FRAGMENT * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1168, __pyx_L1_error) - /* "w3lib/_url.pyx":1170 + /* "w3lib/_url.pyx":1169 * elif c == "#": * url._fragment_token_seen = True * state = FRAGMENT # <<<<<<<<<<<<<< @@ -16904,7 +17126,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1168 + /* "w3lib/_url.pyx":1167 * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< @@ -16914,7 +17136,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L90; } - /* "w3lib/_url.pyx":1172 + /* "w3lib/_url.pyx":1171 * state = FRAGMENT * else: * state = PATH # <<<<<<<<<<<<<< @@ -16924,18 +17146,18 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py /*else*/ { __pyx_v_state = __pyx_v_5w3lib_4_url_PATH; - /* "w3lib/_url.pyx":1173 + /* "w3lib/_url.pyx":1172 * else: * state = PATH * if c != "/": # <<<<<<<<<<<<<< * pointer -= 1 * */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1173, __pyx_L1_error) } - __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1173, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1172, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1172, __pyx_L1_error) if (__pyx_t_12) { - /* "w3lib/_url.pyx":1174 + /* "w3lib/_url.pyx":1173 * state = PATH * if c != "/": * pointer -= 1 # <<<<<<<<<<<<<< @@ -16944,7 +17166,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_pointer = (__pyx_v_pointer - 1); - /* "w3lib/_url.pyx":1173 + /* "w3lib/_url.pyx":1172 * else: * state = PATH * if c != "/": # <<<<<<<<<<<<<< @@ -16955,7 +17177,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L90:; - /* "w3lib/_url.pyx":1164 + /* "w3lib/_url.pyx":1163 * if not reached_end and c not in "/\\": * pointer -= 1 * elif not reached_end: # <<<<<<<<<<<<<< @@ -16965,7 +17187,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L86:; - /* "w3lib/_url.pyx":1159 + /* "w3lib/_url.pyx":1158 * buffer += c * * elif state == PATH_START: # <<<<<<<<<<<<<< @@ -16975,7 +17197,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1176 + /* "w3lib/_url.pyx":1175 * pointer -= 1 * * elif state == PATH: # <<<<<<<<<<<<<< @@ -16985,7 +17207,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = (__pyx_v_state == __pyx_v_5w3lib_4_url_PATH); if (__pyx_t_12) { - /* "w3lib/_url.pyx":1177 + /* "w3lib/_url.pyx":1176 * * elif state == PATH: * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": # <<<<<<<<<<<<<< @@ -16997,46 +17219,46 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = __pyx_v_reached_end; goto __pyx_L93_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1177, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1177, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1176, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1176, __pyx_L1_error) if (!__pyx_t_8) { } else { __pyx_t_12 = __pyx_t_8; goto __pyx_L93_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1177, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_8) { goto __pyx_L96_next_or; } else { } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1177, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1177, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1176, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1176, __pyx_L1_error) if (!__pyx_t_8) { } else { __pyx_t_12 = __pyx_t_8; goto __pyx_L93_bool_binop_done; } __pyx_L96_next_or:; - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1177, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1177, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1176, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1176, __pyx_L1_error) __pyx_t_12 = __pyx_t_8; __pyx_L93_bool_binop_done:; if (__pyx_t_12) { - /* "w3lib/_url.pyx":1178 + /* "w3lib/_url.pyx":1177 * elif state == PATH: * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< * _shorten_path(url) * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_double_dot_path_segment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_double_dot_path_segment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = NULL; __pyx_t_4 = 0; @@ -17056,22 +17278,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_buffer}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_12) { - /* "w3lib/_url.pyx":1179 + /* "w3lib/_url.pyx":1178 * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): * _shorten_path(url) # <<<<<<<<<<<<<< * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_shorten_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = NULL; __pyx_t_4 = 0; @@ -17091,31 +17313,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_url}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1180 + /* "w3lib/_url.pyx":1179 * if _is_double_dot_path_segment(buffer): * _shorten_path(url) * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): # <<<<<<<<<<<<<< * url.path.append("") * elif _is_single_dot_path_segment(buffer): */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1180, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1179, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1179, __pyx_L1_error) if (__pyx_t_8) { } else { __pyx_t_12 = __pyx_t_8; goto __pyx_L100_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1179, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { @@ -17123,8 +17345,8 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_8 = __pyx_t_6; goto __pyx_L102_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1180, __pyx_L1_error) } - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1179, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1179, __pyx_L1_error) __pyx_t_8 = __pyx_t_6; __pyx_L102_bool_binop_done:; __pyx_t_6 = (!__pyx_t_8); @@ -17132,19 +17354,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_L100_bool_binop_done:; if (__pyx_t_12) { - /* "w3lib/_url.pyx":1181 + /* "w3lib/_url.pyx":1180 * _shorten_path(url) * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") # <<<<<<<<<<<<<< * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_kp_u_); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_kp_u_); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1180 + /* "w3lib/_url.pyx":1179 * if _is_double_dot_path_segment(buffer): * _shorten_path(url) * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): # <<<<<<<<<<<<<< @@ -17153,7 +17375,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1178 + /* "w3lib/_url.pyx":1177 * elif state == PATH: * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": * if _is_double_dot_path_segment(buffer): # <<<<<<<<<<<<<< @@ -17163,14 +17385,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L98; } - /* "w3lib/_url.pyx":1182 + /* "w3lib/_url.pyx":1181 * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_single_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_single_dot_path_segment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = NULL; __pyx_t_4 = 0; @@ -17190,33 +17412,33 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_buffer}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_12) { - /* "w3lib/_url.pyx":1183 + /* "w3lib/_url.pyx":1182 * url.path.append("") * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): # <<<<<<<<<<<<<< * url.path.append("") * else: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1183, __pyx_L1_error) } - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1183, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1182, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__11, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1182, __pyx_L1_error) if (__pyx_t_6) { } else { __pyx_t_12 = __pyx_t_6; goto __pyx_L105_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1183, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1183, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1183, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_8) { @@ -17224,8 +17446,8 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_6 = __pyx_t_8; goto __pyx_L107_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1183, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1183, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1182, __pyx_L1_error) } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1182, __pyx_L1_error) __pyx_t_6 = __pyx_t_8; __pyx_L107_bool_binop_done:; __pyx_t_8 = (!__pyx_t_6); @@ -17233,19 +17455,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_L105_bool_binop_done:; if (__pyx_t_12) { - /* "w3lib/_url.pyx":1184 + /* "w3lib/_url.pyx":1183 * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") # <<<<<<<<<<<<<< * else: * if ( */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_kp_u_); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_kp_u_); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1183 + /* "w3lib/_url.pyx":1182 * url.path.append("") * elif _is_single_dot_path_segment(buffer): * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): # <<<<<<<<<<<<<< @@ -17254,7 +17476,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1182 + /* "w3lib/_url.pyx":1181 * if c != "/" and not (url.scheme in _SPECIAL_SCHEMES and c == "\\"): * url.path.append("") * elif _is_single_dot_path_segment(buffer): # <<<<<<<<<<<<<< @@ -17264,7 +17486,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L98; } - /* "w3lib/_url.pyx":1186 + /* "w3lib/_url.pyx":1185 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< @@ -17273,16 +17495,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ /*else*/ { - /* "w3lib/_url.pyx":1187 + /* "w3lib/_url.pyx":1186 * else: * if ( * url.scheme == "file" # <<<<<<<<<<<<<< * and not url.path * and _is_windows_drive_letter(buffer) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1187, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1187, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_file, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_8) { } else { @@ -17290,16 +17512,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L110_bool_binop_done; } - /* "w3lib/_url.pyx":1188 + /* "w3lib/_url.pyx":1187 * if ( * url.scheme == "file" * and not url.path # <<<<<<<<<<<<<< * and _is_windows_drive_letter(buffer) * ): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = (!__pyx_t_8); if (__pyx_t_6) { @@ -17308,14 +17530,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L110_bool_binop_done; } - /* "w3lib/_url.pyx":1189 + /* "w3lib/_url.pyx":1188 * url.scheme == "file" * and not url.path * and _is_windows_drive_letter(buffer) # <<<<<<<<<<<<<< * ): * buffer = buffer[0] + ":" + buffer[2:] */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_windows_drive_letter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = NULL; __pyx_t_4 = 0; @@ -17335,16 +17557,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_buffer}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1189, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_12 = __pyx_t_6; __pyx_L110_bool_binop_done:; - /* "w3lib/_url.pyx":1186 + /* "w3lib/_url.pyx":1185 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< @@ -17353,28 +17575,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ if (__pyx_t_12) { - /* "w3lib/_url.pyx":1191 + /* "w3lib/_url.pyx":1190 * and _is_windows_drive_letter(buffer) * ): * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< * if ( * not url.path */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_buffer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_buffer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1191, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_buffer, 2, 0, NULL, NULL, &__pyx_slice__21, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_buffer, 2, 0, NULL, NULL, &__pyx_slice__21, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1191, __pyx_L1_error) + __pyx_t_14 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_14); __pyx_t_14 = 0; - /* "w3lib/_url.pyx":1186 + /* "w3lib/_url.pyx":1185 * url.path.append("") * else: * if ( # <<<<<<<<<<<<<< @@ -17383,16 +17605,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1193 + /* "w3lib/_url.pyx":1192 * buffer = buffer[0] + ":" + buffer[2:] * if ( * not url.path # <<<<<<<<<<<<<< * and not buffer * and not reached_end */ - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1193, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1193, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_8 = (!__pyx_t_6); if (__pyx_t_8) { @@ -17401,14 +17623,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L114_bool_binop_done; } - /* "w3lib/_url.pyx":1194 + /* "w3lib/_url.pyx":1193 * if ( * not url.path * and not buffer # <<<<<<<<<<<<<< * and not reached_end * and c in "?#" */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1193, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_8); if (__pyx_t_6) { } else { @@ -17416,7 +17638,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L114_bool_binop_done; } - /* "w3lib/_url.pyx":1195 + /* "w3lib/_url.pyx":1194 * not url.path * and not buffer * and not reached_end # <<<<<<<<<<<<<< @@ -17430,22 +17652,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L114_bool_binop_done; } - /* "w3lib/_url.pyx":1196 + /* "w3lib/_url.pyx":1195 * and not buffer * and not reached_end * and c in "?#" # <<<<<<<<<<<<<< * and input[pointer - 1] not in "/\\" * ): */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1196, __pyx_L1_error) } - __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1196, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1195, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1195, __pyx_L1_error) if (__pyx_t_6) { } else { __pyx_t_12 = __pyx_t_6; goto __pyx_L114_bool_binop_done; } - /* "w3lib/_url.pyx":1197 + /* "w3lib/_url.pyx":1196 * and not reached_end * and c in "?#" * and input[pointer - 1] not in "/\\" # <<<<<<<<<<<<<< @@ -17453,7 +17675,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * url._path_token_seen = True */ __pyx_t_9 = (__pyx_v_pointer - 1); - __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 1197, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_input, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 1196, __pyx_L1_error) switch (__pyx_t_7) { case 47: case 92: @@ -17467,7 +17689,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = __pyx_t_8; __pyx_L114_bool_binop_done:; - /* "w3lib/_url.pyx":1192 + /* "w3lib/_url.pyx":1191 * ): * buffer = buffer[0] + ":" + buffer[2:] * if ( # <<<<<<<<<<<<<< @@ -17476,16 +17698,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ if (__pyx_t_12) { - /* "w3lib/_url.pyx":1199 + /* "w3lib/_url.pyx":1198 * and input[pointer - 1] not in "/\\" * ): * url._path_token_seen = True # <<<<<<<<<<<<<< * url.path.append(buffer) * buffer = "" */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen, Py_True) < 0) __PYX_ERR(0, 1199, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen, Py_True) < 0) __PYX_ERR(0, 1198, __pyx_L1_error) - /* "w3lib/_url.pyx":1192 + /* "w3lib/_url.pyx":1191 * ): * buffer = buffer[0] + ":" + buffer[2:] * if ( # <<<<<<<<<<<<<< @@ -17494,21 +17716,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1200 + /* "w3lib/_url.pyx":1199 * ): * url._path_token_seen = True * url.path.append(buffer) # <<<<<<<<<<<<<< * buffer = "" * if not reached_end: */ - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1200, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_14, __pyx_v_buffer); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1200, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_14, __pyx_v_buffer); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __pyx_L98:; - /* "w3lib/_url.pyx":1201 + /* "w3lib/_url.pyx":1200 * url._path_token_seen = True * url.path.append(buffer) * buffer = "" # <<<<<<<<<<<<<< @@ -17518,7 +17740,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1202 + /* "w3lib/_url.pyx":1201 * url.path.append(buffer) * buffer = "" * if not reached_end: # <<<<<<<<<<<<<< @@ -17528,27 +17750,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = (!__pyx_v_reached_end); if (__pyx_t_12) { - /* "w3lib/_url.pyx":1203 + /* "w3lib/_url.pyx":1202 * buffer = "" * if not reached_end: * if c == "?": # <<<<<<<<<<<<<< * url._query_token_seen = True * state = QUERY */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1203, __pyx_L1_error) } - __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1203, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1202, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1202, __pyx_L1_error) if (__pyx_t_12) { - /* "w3lib/_url.pyx":1204 + /* "w3lib/_url.pyx":1203 * if not reached_end: * if c == "?": * url._query_token_seen = True # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1204, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1203, __pyx_L1_error) - /* "w3lib/_url.pyx":1205 + /* "w3lib/_url.pyx":1204 * if c == "?": * url._query_token_seen = True * state = QUERY # <<<<<<<<<<<<<< @@ -17557,7 +17779,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":1203 + /* "w3lib/_url.pyx":1202 * buffer = "" * if not reached_end: * if c == "?": # <<<<<<<<<<<<<< @@ -17567,27 +17789,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L120; } - /* "w3lib/_url.pyx":1206 + /* "w3lib/_url.pyx":1205 * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< * url._fragment_token_seen = True * state = FRAGMENT */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1206, __pyx_L1_error) } - __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1206, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1205, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1205, __pyx_L1_error) if (__pyx_t_12) { - /* "w3lib/_url.pyx":1207 + /* "w3lib/_url.pyx":1206 * state = QUERY * elif c == "#": * url._fragment_token_seen = True # <<<<<<<<<<<<<< * state = FRAGMENT * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1207, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) - /* "w3lib/_url.pyx":1208 + /* "w3lib/_url.pyx":1207 * elif c == "#": * url._fragment_token_seen = True * state = FRAGMENT # <<<<<<<<<<<<<< @@ -17596,7 +17818,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1206 + /* "w3lib/_url.pyx":1205 * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< @@ -17606,7 +17828,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L120:; - /* "w3lib/_url.pyx":1202 + /* "w3lib/_url.pyx":1201 * url.path.append(buffer) * buffer = "" * if not reached_end: # <<<<<<<<<<<<<< @@ -17615,7 +17837,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1177 + /* "w3lib/_url.pyx":1176 * * elif state == PATH: * if reached_end or c == "/" or (url.scheme in _SPECIAL_SCHEMES and c == "\\") or c in "?#": # <<<<<<<<<<<<<< @@ -17625,7 +17847,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L92; } - /* "w3lib/_url.pyx":1210 + /* "w3lib/_url.pyx":1209 * state = FRAGMENT * else: * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -17633,56 +17855,56 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * pointer=pointer, */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - /* "w3lib/_url.pyx":1211 + /* "w3lib/_url.pyx":1210 * else: * buffer += _idempotent_utf_8_percent_encode( * input=input, # <<<<<<<<<<<<<< * pointer=pointer, * encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) - /* "w3lib/_url.pyx":1212 + /* "w3lib/_url.pyx":1211 * buffer += _idempotent_utf_8_percent_encode( * input=input, * pointer=pointer, # <<<<<<<<<<<<<< * encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, * ) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_t_1) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_t_1) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1213 + /* "w3lib/_url.pyx":1212 * input=input, * pointer=pointer, * encode_set=_SAFE_PATH_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * ) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_t_1) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_t_1) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1210 + /* "w3lib/_url.pyx":1209 * state = FRAGMENT * else: * buffer += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, * pointer=pointer, */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_2); @@ -17690,7 +17912,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L92:; - /* "w3lib/_url.pyx":1176 + /* "w3lib/_url.pyx":1175 * pointer -= 1 * * elif state == PATH: # <<<<<<<<<<<<<< @@ -17700,7 +17922,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1216 + /* "w3lib/_url.pyx":1215 * ) * * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< @@ -17710,7 +17932,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = (__pyx_v_state == __pyx_v_5w3lib_4_url_OPAQUE_PATH); if (__pyx_t_12) { - /* "w3lib/_url.pyx":1217 + /* "w3lib/_url.pyx":1216 * * elif state == OPAQUE_PATH: * if not reached_end: # <<<<<<<<<<<<<< @@ -17720,27 +17942,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = (!__pyx_v_reached_end); if (__pyx_t_12) { - /* "w3lib/_url.pyx":1218 + /* "w3lib/_url.pyx":1217 * elif state == OPAQUE_PATH: * if not reached_end: * if c == "?": # <<<<<<<<<<<<<< * url._query_token_seen = True * state = QUERY */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1218, __pyx_L1_error) } - __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1218, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1217, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1217, __pyx_L1_error) if (__pyx_t_12) { - /* "w3lib/_url.pyx":1219 + /* "w3lib/_url.pyx":1218 * if not reached_end: * if c == "?": * url._query_token_seen = True # <<<<<<<<<<<<<< * state = QUERY * elif c == "#": */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1219, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen, Py_True) < 0) __PYX_ERR(0, 1218, __pyx_L1_error) - /* "w3lib/_url.pyx":1220 + /* "w3lib/_url.pyx":1219 * if c == "?": * url._query_token_seen = True * state = QUERY # <<<<<<<<<<<<<< @@ -17749,7 +17971,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_QUERY; - /* "w3lib/_url.pyx":1218 + /* "w3lib/_url.pyx":1217 * elif state == OPAQUE_PATH: * if not reached_end: * if c == "?": # <<<<<<<<<<<<<< @@ -17759,27 +17981,27 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L122; } - /* "w3lib/_url.pyx":1221 + /* "w3lib/_url.pyx":1220 * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< * url._fragment_token_seen = True * state = FRAGMENT */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1221, __pyx_L1_error) } - __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1221, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1220, __pyx_L1_error) } + __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1220, __pyx_L1_error) if (__pyx_t_12) { - /* "w3lib/_url.pyx":1222 + /* "w3lib/_url.pyx":1221 * state = QUERY * elif c == "#": * url._fragment_token_seen = True # <<<<<<<<<<<<<< * state = FRAGMENT * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1222, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1221, __pyx_L1_error) - /* "w3lib/_url.pyx":1223 + /* "w3lib/_url.pyx":1222 * elif c == "#": * url._fragment_token_seen = True * state = FRAGMENT # <<<<<<<<<<<<<< @@ -17788,7 +18010,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1221 + /* "w3lib/_url.pyx":1220 * url._query_token_seen = True * state = QUERY * elif c == "#": # <<<<<<<<<<<<<< @@ -17798,7 +18020,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L122; } - /* "w3lib/_url.pyx":1225 + /* "w3lib/_url.pyx":1224 * state = FRAGMENT * else: * encoded = _utf_8_percent_encode( # <<<<<<<<<<<<<< @@ -17806,26 +18028,26 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py * _C0_CONTROL_PERCENT_ENCODE_SET, */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_utf_8_percent_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_url.pyx":1226 + /* "w3lib/_url.pyx":1225 * else: * encoded = _utf_8_percent_encode( * c, # <<<<<<<<<<<<<< * _C0_CONTROL_PERCENT_ENCODE_SET, * ) */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1226, __pyx_L1_error) } + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1225, __pyx_L1_error) } - /* "w3lib/_url.pyx":1227 + /* "w3lib/_url.pyx":1226 * encoded = _utf_8_percent_encode( * c, * _C0_CONTROL_PERCENT_ENCODE_SET, # <<<<<<<<<<<<<< * ) * url.opaque_path += encoded */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1227, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_13 = NULL; __pyx_t_4 = 0; @@ -17846,31 +18068,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1225, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_XDECREF_SET(__pyx_v_encoded, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1229 + /* "w3lib/_url.pyx":1228 * _C0_CONTROL_PERCENT_ENCODE_SET, * ) * url.opaque_path += encoded # <<<<<<<<<<<<<< * * elif state == QUERY: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_encoded); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path, __pyx_t_1) < 0) __PYX_ERR(0, 1229, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path, __pyx_t_1) < 0) __PYX_ERR(0, 1228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L122:; - /* "w3lib/_url.pyx":1217 + /* "w3lib/_url.pyx":1216 * * elif state == OPAQUE_PATH: * if not reached_end: # <<<<<<<<<<<<<< @@ -17879,7 +18101,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1216 + /* "w3lib/_url.pyx":1215 * ) * * elif state == OPAQUE_PATH: # <<<<<<<<<<<<<< @@ -17889,7 +18111,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1231 + /* "w3lib/_url.pyx":1230 * url.opaque_path += encoded * * elif state == QUERY: # <<<<<<<<<<<<<< @@ -17899,32 +18121,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = (__pyx_v_state == __pyx_v_5w3lib_4_url_QUERY); if (__pyx_t_12) { - /* "w3lib/_url.pyx":1232 + /* "w3lib/_url.pyx":1231 * * elif state == QUERY: * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") * ): */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_kp_u_utf_8, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1232, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_kp_u_utf_8, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1231, __pyx_L1_error) if (__pyx_t_8) { } else { __pyx_t_12 = __pyx_t_8; goto __pyx_L124_bool_binop_done; } - /* "w3lib/_url.pyx":1233 + /* "w3lib/_url.pyx":1232 * elif state == QUERY: * if encoding != "utf-8" and ( * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") # <<<<<<<<<<<<<< * ): * encoding = "utf-8" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1232, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_8) { @@ -17932,15 +18154,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = __pyx_t_8; goto __pyx_L124_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_ws, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_ws, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1232, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_8 = __pyx_t_6; goto __pyx_L127_bool_binop_done; } - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_wss, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_wss, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1232, __pyx_L1_error) __pyx_t_8 = __pyx_t_6; __pyx_L127_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -17948,7 +18170,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = __pyx_t_6; __pyx_L124_bool_binop_done:; - /* "w3lib/_url.pyx":1232 + /* "w3lib/_url.pyx":1231 * * elif state == QUERY: * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< @@ -17957,7 +18179,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ if (__pyx_t_12) { - /* "w3lib/_url.pyx":1235 + /* "w3lib/_url.pyx":1234 * not url.scheme in _SPECIAL_SCHEMES or url.scheme in ("ws", "wss") * ): * encoding = "utf-8" # <<<<<<<<<<<<<< @@ -17967,7 +18189,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_utf_8); __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_kp_u_utf_8); - /* "w3lib/_url.pyx":1232 + /* "w3lib/_url.pyx":1231 * * elif state == QUERY: * if encoding != "utf-8" and ( # <<<<<<<<<<<<<< @@ -17976,7 +18198,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1236 + /* "w3lib/_url.pyx":1235 * ): * encoding = "utf-8" * if reached_end or c == "#": # <<<<<<<<<<<<<< @@ -17988,49 +18210,49 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = __pyx_v_reached_end; goto __pyx_L130_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1236, __pyx_L1_error) } - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1236, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1235, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1235, __pyx_L1_error) __pyx_t_12 = __pyx_t_6; __pyx_L130_bool_binop_done:; if (__pyx_t_12) { - /* "w3lib/_url.pyx":1239 + /* "w3lib/_url.pyx":1238 * percent_encode_set = ( * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET * if url.scheme in _SPECIAL_SCHEMES # <<<<<<<<<<<<<< * else _SAFE_QUERY_PERCENT_ENCODE_SET * ) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_SPECIAL_SCHEMES); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_14, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1239, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_14, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_12) { - /* "w3lib/_url.pyx":1238 + /* "w3lib/_url.pyx":1237 * if reached_end or c == "#": * percent_encode_set = ( * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * if url.scheme in _SPECIAL_SCHEMES * else _SAFE_QUERY_PERCENT_ENCODE_SET */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_2 = __pyx_t_14; __pyx_t_14 = 0; } else { - /* "w3lib/_url.pyx":1240 + /* "w3lib/_url.pyx":1239 * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET * if url.scheme in _SPECIAL_SCHEMES * else _SAFE_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * url.query += _percent_encode_after_encoding( */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_2 = __pyx_t_14; __pyx_t_14 = 0; @@ -18038,42 +18260,71 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_XDECREF_SET(__pyx_v_percent_encode_set, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1242 + /* "w3lib/_url.pyx":1241 * else _SAFE_QUERY_PERCENT_ENCODE_SET * ) * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< * buffer, * encoding=encoding, */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_percent_encode_after_encoding); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); - /* "w3lib/_url.pyx":1243 + /* "w3lib/_url.pyx":1242 * ) * url.query += _percent_encode_after_encoding( * buffer, # <<<<<<<<<<<<<< * encoding=encoding, * percent_encode_set=percent_encode_set, */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_buffer))||((__pyx_v_buffer) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_buffer))) __PYX_ERR(0, 1243, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_buffer); + __Pyx_GIVEREF(__pyx_v_buffer); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_buffer)) __PYX_ERR(0, 1241, __pyx_L1_error); + + /* "w3lib/_url.pyx":1243 + * url.query += _percent_encode_after_encoding( + * buffer, + * encoding=encoding, # <<<<<<<<<<<<<< + * percent_encode_set=percent_encode_set, + * ) + */ + __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 1243, __pyx_L1_error) - /* "w3lib/_url.pyx":1242 + /* "w3lib/_url.pyx":1244 + * buffer, + * encoding=encoding, + * percent_encode_set=percent_encode_set, # <<<<<<<<<<<<<< + * ) + * buffer = "" + */ + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_percent_encode_set, __pyx_v_percent_encode_set) < 0) __PYX_ERR(0, 1243, __pyx_L1_error) + + /* "w3lib/_url.pyx":1241 * else _SAFE_QUERY_PERCENT_ENCODE_SET * ) * url.query += _percent_encode_after_encoding( # <<<<<<<<<<<<<< * buffer, * encoding=encoding, */ - __pyx_t_14 = __pyx_f_5w3lib_4_url__percent_encode_after_encoding(((PyObject*)__pyx_v_buffer), __pyx_v_encoding, __pyx_v_percent_encode_set); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_1, __pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_1) < 0) __PYX_ERR(0, 1242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_query, __pyx_t_13) < 0) __PYX_ERR(0, 1241, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "w3lib/_url.pyx":1247 + /* "w3lib/_url.pyx":1246 * percent_encode_set=percent_encode_set, * ) * buffer = "" # <<<<<<<<<<<<<< @@ -18083,7 +18334,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(__pyx_kp_u_); __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_kp_u_); - /* "w3lib/_url.pyx":1248 + /* "w3lib/_url.pyx":1247 * ) * buffer = "" * if not reached_end and c == "#": # <<<<<<<<<<<<<< @@ -18096,22 +18347,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = __pyx_t_6; goto __pyx_L133_bool_binop_done; } - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1248, __pyx_L1_error) } - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1248, __pyx_L1_error) + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1247, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_c, __pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1247, __pyx_L1_error) __pyx_t_12 = __pyx_t_6; __pyx_L133_bool_binop_done:; if (__pyx_t_12) { - /* "w3lib/_url.pyx":1249 + /* "w3lib/_url.pyx":1248 * buffer = "" * if not reached_end and c == "#": * url._fragment_token_seen = True # <<<<<<<<<<<<<< * state = FRAGMENT * elif not reached_end: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1249, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen, Py_True) < 0) __PYX_ERR(0, 1248, __pyx_L1_error) - /* "w3lib/_url.pyx":1250 + /* "w3lib/_url.pyx":1249 * if not reached_end and c == "#": * url._fragment_token_seen = True * state = FRAGMENT # <<<<<<<<<<<<<< @@ -18120,7 +18371,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ __pyx_v_state = __pyx_v_5w3lib_4_url_FRAGMENT; - /* "w3lib/_url.pyx":1248 + /* "w3lib/_url.pyx":1247 * ) * buffer = "" * if not reached_end and c == "#": # <<<<<<<<<<<<<< @@ -18129,7 +18380,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1236 + /* "w3lib/_url.pyx":1235 * ): * encoding = "utf-8" * if reached_end or c == "#": # <<<<<<<<<<<<<< @@ -18139,7 +18390,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L129; } - /* "w3lib/_url.pyx":1251 + /* "w3lib/_url.pyx":1250 * url._fragment_token_seen = True * state = FRAGMENT * elif not reached_end: # <<<<<<<<<<<<<< @@ -18149,20 +18400,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = (!__pyx_v_reached_end); if (__pyx_t_12) { - /* "w3lib/_url.pyx":1252 + /* "w3lib/_url.pyx":1251 * state = FRAGMENT * elif not reached_end: * buffer += c # <<<<<<<<<<<<<< * * elif state == FRAGMENT: */ - if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1252, __pyx_L1_error) } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); - __pyx_t_1 = 0; + if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 1251, __pyx_L1_error) } + __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_buffer, __pyx_v_c); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_13); + __pyx_t_13 = 0; - /* "w3lib/_url.pyx":1251 + /* "w3lib/_url.pyx":1250 * url._fragment_token_seen = True * state = FRAGMENT * elif not reached_end: # <<<<<<<<<<<<<< @@ -18172,7 +18423,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L129:; - /* "w3lib/_url.pyx":1231 + /* "w3lib/_url.pyx":1230 * url.opaque_path += encoded * * elif state == QUERY: # <<<<<<<<<<<<<< @@ -18182,7 +18433,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py goto __pyx_L6; } - /* "w3lib/_url.pyx":1254 + /* "w3lib/_url.pyx":1253 * buffer += c * * elif state == FRAGMENT: # <<<<<<<<<<<<<< @@ -18192,7 +18443,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = (__pyx_v_state == __pyx_v_5w3lib_4_url_FRAGMENT); if (__pyx_t_12) { - /* "w3lib/_url.pyx":1255 + /* "w3lib/_url.pyx":1254 * * elif state == FRAGMENT: * if not reached_end: # <<<<<<<<<<<<<< @@ -18202,56 +18453,56 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = (!__pyx_v_reached_end); if (__pyx_t_12) { - /* "w3lib/_url.pyx":1256 + /* "w3lib/_url.pyx":1255 * elif state == FRAGMENT: * if not reached_end: * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, pointer=pointer, encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET * ) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_idempotent_utf_8_percent_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_url.pyx":1257 + /* "w3lib/_url.pyx":1256 * if not reached_end: * url.fragment += _idempotent_utf_8_percent_encode( * input=input, pointer=pointer, encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1257, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_pointer); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_t_13) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_t_13) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) __PYX_ERR(0, 1256, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_pointer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pointer, __pyx_t_1) < 0) __PYX_ERR(0, 1256, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode_set, __pyx_t_1) < 0) __PYX_ERR(0, 1256, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1256 + /* "w3lib/_url.pyx":1255 * elif state == FRAGMENT: * if not reached_end: * url.fragment += _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * input=input, pointer=pointer, encode_set=_SAFE_FRAGMENT_PERCENT_ENCODE_SET * ) */ - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_t_2) < 0) __PYX_ERR(0, 1256, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_url, __pyx_n_s_fragment, __pyx_t_2) < 0) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1255 + /* "w3lib/_url.pyx":1254 * * elif state == FRAGMENT: * if not reached_end: # <<<<<<<<<<<<<< @@ -18260,7 +18511,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1254 + /* "w3lib/_url.pyx":1253 * buffer += c * * elif state == FRAGMENT: # <<<<<<<<<<<<<< @@ -18270,7 +18521,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L6:; - /* "w3lib/_url.pyx":1260 + /* "w3lib/_url.pyx":1259 * ) * * if pointer >= input_length: # <<<<<<<<<<<<<< @@ -18280,7 +18531,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_t_12 = (__pyx_v_pointer >= __pyx_v_input_length); if (__pyx_t_12) { - /* "w3lib/_url.pyx":1261 + /* "w3lib/_url.pyx":1260 * * if pointer >= input_length: * break # <<<<<<<<<<<<<< @@ -18289,7 +18540,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ goto __pyx_L4_break; - /* "w3lib/_url.pyx":1260 + /* "w3lib/_url.pyx":1259 * ) * * if pointer >= input_length: # <<<<<<<<<<<<<< @@ -18298,7 +18549,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ } - /* "w3lib/_url.pyx":1262 + /* "w3lib/_url.pyx":1261 * if pointer >= input_length: * break * pointer += 1 # <<<<<<<<<<<<<< @@ -18309,7 +18560,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py } __pyx_L4_break:; - /* "w3lib/_url.pyx":1264 + /* "w3lib/_url.pyx":1263 * pointer += 1 * * return url # <<<<<<<<<<<<<< @@ -18321,7 +18572,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_url; goto __pyx_L0; - /* "w3lib/_url.pyx":958 + /* "w3lib/_url.pyx":957 * * * def _parse_url( # <<<<<<<<<<<<<< @@ -18355,7 +18606,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "w3lib/_url.pyx":1268 +/* "w3lib/_url.pyx":1267 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< @@ -18364,15 +18615,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_36_parse_url(CYTHON_UNUSED PyObject *__py */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_39_serialize_ipv4(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_41_serialize_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_39_serialize_ipv4 = {"_serialize_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_39_serialize_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_39_serialize_ipv4(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_41_serialize_ipv4 = {"_serialize_ipv4", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_41_serialize_ipv4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_41_serialize_ipv4(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18416,12 +18667,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1268, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1267, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv4") < 0)) __PYX_ERR(0, 1268, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv4") < 0)) __PYX_ERR(0, 1267, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18432,7 +18683,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1268, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_ipv4", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1267, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18446,8 +18697,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyInt_Type), 0, "address", 1))) __PYX_ERR(0, 1268, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_38_serialize_ipv4(__pyx_self, __pyx_v_address); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyInt_Type), 0, "address", 1))) __PYX_ERR(0, 1267, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_40_serialize_ipv4(__pyx_self, __pyx_v_address); /* function exit code */ goto __pyx_L0; @@ -18464,7 +18715,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { +static PyObject *__pyx_pf_5w3lib_4_url_40_serialize_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { PyObject *__pyx_v_output = NULL; PyObject *__pyx_v_n = NULL; long __pyx_v_i; @@ -18482,7 +18733,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_ipv4", 1); - /* "w3lib/_url.pyx":1269 + /* "w3lib/_url.pyx":1268 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: * output = "" # <<<<<<<<<<<<<< @@ -18492,7 +18743,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_kp_u_); __pyx_v_output = __pyx_kp_u_; - /* "w3lib/_url.pyx":1270 + /* "w3lib/_url.pyx":1269 * def _serialize_ipv4(address: int) -> str: * output = "" * n = address # <<<<<<<<<<<<<< @@ -18502,7 +18753,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_v_address); __pyx_v_n = __pyx_v_address; - /* "w3lib/_url.pyx":1271 + /* "w3lib/_url.pyx":1270 * output = "" * n = address * for i in range(1, 5): # <<<<<<<<<<<<<< @@ -18512,25 +18763,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject for (__pyx_t_1 = 1; __pyx_t_1 < 5; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "w3lib/_url.pyx":1272 + /* "w3lib/_url.pyx":1271 * n = address * for i in range(1, 5): * output = str(n % 256) + output # <<<<<<<<<<<<<< * if i != 4: * output = "." + output */ - __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1272, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1272, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1272, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1273 + /* "w3lib/_url.pyx":1272 * for i in range(1, 5): * output = str(n % 256) + output * if i != 4: # <<<<<<<<<<<<<< @@ -18540,19 +18791,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_4 = (__pyx_v_i != 4); if (__pyx_t_4) { - /* "w3lib/_url.pyx":1274 + /* "w3lib/_url.pyx":1273 * output = str(n % 256) + output * if i != 4: * output = "." + output # <<<<<<<<<<<<<< * n = floor(n / 256) * return output */ - __pyx_t_2 = PyNumber_Add(__pyx_kp_u__5, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1274, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_kp_u__5, __pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1273 + /* "w3lib/_url.pyx":1272 * for i in range(1, 5): * output = str(n % 256) + output * if i != 4: # <<<<<<<<<<<<<< @@ -18561,16 +18812,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1275 + /* "w3lib/_url.pyx":1274 * if i != 4: * output = "." + output * n = floor(n / 256) # <<<<<<<<<<<<<< * return output * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1275, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1275, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_n, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -18591,7 +18842,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1275, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -18599,7 +18850,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject __pyx_t_2 = 0; } - /* "w3lib/_url.pyx":1276 + /* "w3lib/_url.pyx":1275 * output = "." + output * n = floor(n / 256) * return output # <<<<<<<<<<<<<< @@ -18607,12 +18858,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1276, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_INCREF(__pyx_v_output); __pyx_r = ((PyObject*)__pyx_v_output); goto __pyx_L0; - /* "w3lib/_url.pyx":1268 + /* "w3lib/_url.pyx":1267 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< @@ -18636,7 +18887,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":1279 +/* "w3lib/_url.pyx":1278 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< @@ -18644,7 +18895,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_38_serialize_ipv4(CYTHON_UNUSED PyObject * ) -> Optional[int]: */ -static PyObject *__pyx_pf_5w3lib_4_url_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_5w3lib_4_url_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -18654,16 +18905,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_52__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_length, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_min_length) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_length, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_min_length) < 0) __PYX_ERR(0, 1278, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 1279, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 1278, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1279, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1278, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -18682,15 +18933,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_52__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index = {"_get_ipv6_first_longest_0_piece_index", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index = {"_get_ipv6_first_longest_0_piece_index", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18737,18 +18988,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1279, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1278, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1279, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1278, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_ipv6_first_longest_0_piece_index") < 0)) __PYX_ERR(0, 1279, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_ipv6_first_longest_0_piece_index") < 0)) __PYX_ERR(0, 1278, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18760,7 +19011,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_ipv6_first_longest_0_piece_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1279, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_ipv6_first_longest_0_piece_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1278, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18774,9 +19025,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1280, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_min_length), (&PyInt_Type), 0, "min_length", 1))) __PYX_ERR(0, 1280, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(__pyx_self, __pyx_v_address, __pyx_v_min_length); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1279, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_min_length), (&PyInt_Type), 0, "min_length", 1))) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(__pyx_self, __pyx_v_address, __pyx_v_min_length); /* function exit code */ goto __pyx_L0; @@ -18793,7 +19044,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length) { +static PyObject *__pyx_pf_5w3lib_4_url_42_get_ipv6_first_longest_0_piece_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_min_length) { PyObject *__pyx_v_index = NULL; PyObject *__pyx_v_index_length = NULL; PyObject *__pyx_v_current_length = NULL; @@ -18813,7 +19064,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_ipv6_first_longest_0_piece_index", 1); - /* "w3lib/_url.pyx":1282 + /* "w3lib/_url.pyx":1281 * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: * index = None # <<<<<<<<<<<<<< @@ -18823,7 +19074,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(Py_None); __pyx_v_index = Py_None; - /* "w3lib/_url.pyx":1283 + /* "w3lib/_url.pyx":1282 * ) -> Optional[int]: * index = None * index_length = 0 # <<<<<<<<<<<<<< @@ -18833,7 +19084,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __pyx_v_index_length = __pyx_int_0; - /* "w3lib/_url.pyx":1284 + /* "w3lib/_url.pyx":1283 * index = None * index_length = 0 * current_length = 0 # <<<<<<<<<<<<<< @@ -18843,7 +19094,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __pyx_v_current_length = __pyx_int_0; - /* "w3lib/_url.pyx":1285 + /* "w3lib/_url.pyx":1284 * index_length = 0 * current_length = 0 * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< @@ -18858,37 +19109,37 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1285, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1284, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1285, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1284, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1285, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_piece, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_current_index, __pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1285, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1286 + /* "w3lib/_url.pyx":1285 * current_length = 0 * for current_index, piece in enumerate(address): * if piece != 0: # <<<<<<<<<<<<<< * current_length = 0 * continue */ - __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1286, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_piece, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1285, __pyx_L1_error) if (__pyx_t_5) { - /* "w3lib/_url.pyx":1287 + /* "w3lib/_url.pyx":1286 * for current_index, piece in enumerate(address): * if piece != 0: * current_length = 0 # <<<<<<<<<<<<<< @@ -18898,7 +19149,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_int_0); - /* "w3lib/_url.pyx":1288 + /* "w3lib/_url.pyx":1287 * if piece != 0: * current_length = 0 * continue # <<<<<<<<<<<<<< @@ -18907,7 +19158,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":1286 + /* "w3lib/_url.pyx":1285 * current_length = 0 * for current_index, piece in enumerate(address): * if piece != 0: # <<<<<<<<<<<<<< @@ -18916,56 +19167,56 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C */ } - /* "w3lib/_url.pyx":1289 + /* "w3lib/_url.pyx":1288 * current_length = 0 * continue * current_length += 1 # <<<<<<<<<<<<<< * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1289, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_length, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_current_length, __pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_url.pyx":1290 + /* "w3lib/_url.pyx":1289 * continue * current_length += 1 * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< * index = current_index + 1 - current_length * index_length = current_length */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_index_length, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1290, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_index_length, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1289, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L7_bool_binop_done; } - __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_min_length, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1290, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_current_length, __pyx_v_min_length, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1289, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L7_bool_binop_done:; if (__pyx_t_5) { - /* "w3lib/_url.pyx":1291 + /* "w3lib/_url.pyx":1290 * current_length += 1 * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length # <<<<<<<<<<<<<< * index_length = current_length * return index */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_current_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_v_current_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_v_current_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_7); __pyx_t_7 = 0; - /* "w3lib/_url.pyx":1292 + /* "w3lib/_url.pyx":1291 * if current_length > index_length and current_length >= min_length: * index = current_index + 1 - current_length * index_length = current_length # <<<<<<<<<<<<<< @@ -18975,7 +19226,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C __Pyx_INCREF(__pyx_v_current_length); __Pyx_DECREF_SET(__pyx_v_index_length, __pyx_v_current_length); - /* "w3lib/_url.pyx":1290 + /* "w3lib/_url.pyx":1289 * continue * current_length += 1 * if current_length > index_length and current_length >= min_length: # <<<<<<<<<<<<<< @@ -18984,7 +19235,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C */ } - /* "w3lib/_url.pyx":1285 + /* "w3lib/_url.pyx":1284 * index_length = 0 * current_length = 0 * for current_index, piece in enumerate(address): # <<<<<<<<<<<<<< @@ -18996,7 +19247,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1293 + /* "w3lib/_url.pyx":1292 * index = current_index + 1 - current_length * index_length = current_length * return index # <<<<<<<<<<<<<< @@ -19004,12 +19255,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_index))||((__pyx_v_index) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_index))) __PYX_ERR(0, 1293, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_v_index))||((__pyx_v_index) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_v_index))) __PYX_ERR(0, 1292, __pyx_L1_error) __Pyx_INCREF(__pyx_v_index); __pyx_r = ((PyObject*)__pyx_v_index); goto __pyx_L0; - /* "w3lib/_url.pyx":1279 + /* "w3lib/_url.pyx":1278 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< @@ -19036,7 +19287,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C return __pyx_r; } -/* "w3lib/_url.pyx":1297 +/* "w3lib/_url.pyx":1296 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< @@ -19045,15 +19296,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_40_get_ipv6_first_longest_0_piece_index(C */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_43_serialize_ipv6(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_45_serialize_ipv6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_43_serialize_ipv6 = {"_serialize_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_43_serialize_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_43_serialize_ipv6(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_45_serialize_ipv6 = {"_serialize_ipv6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_45_serialize_ipv6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_45_serialize_ipv6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19097,12 +19348,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1297, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1296, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv6") < 0)) __PYX_ERR(0, 1297, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_ipv6") < 0)) __PYX_ERR(0, 1296, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19113,7 +19364,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1297, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_ipv6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1296, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19127,8 +19378,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1297, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_42_serialize_ipv6(__pyx_self, __pyx_v_address); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_address), (&PyList_Type), 0, "address", 1))) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_44_serialize_ipv6(__pyx_self, __pyx_v_address); /* function exit code */ goto __pyx_L0; @@ -19145,7 +19396,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { +static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address) { PyObject *__pyx_v_output = NULL; PyObject *__pyx_v_compress = NULL; int __pyx_v_ignore0; @@ -19165,7 +19416,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_ipv6", 1); - /* "w3lib/_url.pyx":1298 + /* "w3lib/_url.pyx":1297 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: * output = "" # <<<<<<<<<<<<<< @@ -19175,14 +19426,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_kp_u_); __pyx_v_output = __pyx_kp_u_; - /* "w3lib/_url.pyx":1299 + /* "w3lib/_url.pyx":1298 * def _serialize_ipv6(address: List[int]) -> str: * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) # <<<<<<<<<<<<<< * ignore0 = False * for piece_index in range(8): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_ipv6_first_longest_0_piece); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1299, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_ipv6_first_longest_0_piece); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -19202,14 +19453,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_address}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_compress = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1300 + /* "w3lib/_url.pyx":1299 * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) * ignore0 = False # <<<<<<<<<<<<<< @@ -19218,7 +19469,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 0; - /* "w3lib/_url.pyx":1301 + /* "w3lib/_url.pyx":1300 * compress = _get_ipv6_first_longest_0_piece_index(address) * ignore0 = False * for piece_index in range(8): # <<<<<<<<<<<<<< @@ -19228,7 +19479,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject for (__pyx_t_5 = 0; __pyx_t_5 < 8; __pyx_t_5+=1) { __pyx_v_piece_index = __pyx_t_5; - /* "w3lib/_url.pyx":1302 + /* "w3lib/_url.pyx":1301 * ignore0 = False * for piece_index in range(8): * if ignore0: # <<<<<<<<<<<<<< @@ -19237,21 +19488,21 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ if (__pyx_v_ignore0) { - /* "w3lib/_url.pyx":1303 + /* "w3lib/_url.pyx":1302 * for piece_index in range(8): * if ignore0: * if not address[piece_index]: # <<<<<<<<<<<<<< * continue * ignore0 = False */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1303, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1303, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "w3lib/_url.pyx":1304 + /* "w3lib/_url.pyx":1303 * if ignore0: * if not address[piece_index]: * continue # <<<<<<<<<<<<<< @@ -19260,7 +19511,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":1303 + /* "w3lib/_url.pyx":1302 * for piece_index in range(8): * if ignore0: * if not address[piece_index]: # <<<<<<<<<<<<<< @@ -19269,7 +19520,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1305 + /* "w3lib/_url.pyx":1304 * if not address[piece_index]: * continue * ignore0 = False # <<<<<<<<<<<<<< @@ -19278,7 +19529,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 0; - /* "w3lib/_url.pyx":1302 + /* "w3lib/_url.pyx":1301 * ignore0 = False * for piece_index in range(8): * if ignore0: # <<<<<<<<<<<<<< @@ -19287,22 +19538,22 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1306 + /* "w3lib/_url.pyx":1305 * continue * ignore0 = False * if compress == piece_index: # <<<<<<<<<<<<<< * separator = "::" if piece_index == 0 else ":" * output += separator */ - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_piece_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_compress, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_compress, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1306, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_7) { - /* "w3lib/_url.pyx":1307 + /* "w3lib/_url.pyx":1306 * ignore0 = False * if compress == piece_index: * separator = "::" if piece_index == 0 else ":" # <<<<<<<<<<<<<< @@ -19320,19 +19571,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject __Pyx_XDECREF_SET(__pyx_v_separator, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1308 + /* "w3lib/_url.pyx":1307 * if compress == piece_index: * separator = "::" if piece_index == 0 else ":" * output += separator # <<<<<<<<<<<<<< * ignore0 = True * continue */ - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_output, __pyx_v_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1308, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_output, __pyx_v_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1309 + /* "w3lib/_url.pyx":1308 * separator = "::" if piece_index == 0 else ":" * output += separator * ignore0 = True # <<<<<<<<<<<<<< @@ -19341,7 +19592,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ __pyx_v_ignore0 = 1; - /* "w3lib/_url.pyx":1310 + /* "w3lib/_url.pyx":1309 * output += separator * ignore0 = True * continue # <<<<<<<<<<<<<< @@ -19350,7 +19601,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ goto __pyx_L3_continue; - /* "w3lib/_url.pyx":1306 + /* "w3lib/_url.pyx":1305 * continue * ignore0 = False * if compress == piece_index: # <<<<<<<<<<<<<< @@ -19359,25 +19610,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1311 + /* "w3lib/_url.pyx":1310 * ignore0 = True * continue * output += f"{address[piece_index]:x}" # <<<<<<<<<<<<<< * if piece_index != 7: * output += ":" */ - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_address, __pyx_v_piece_index, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1311, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1312 + /* "w3lib/_url.pyx":1311 * continue * output += f"{address[piece_index]:x}" * if piece_index != 7: # <<<<<<<<<<<<<< @@ -19387,19 +19638,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_t_7 = (__pyx_v_piece_index != 7); if (__pyx_t_7) { - /* "w3lib/_url.pyx":1313 + /* "w3lib/_url.pyx":1312 * output += f"{address[piece_index]:x}" * if piece_index != 7: * output += ":" # <<<<<<<<<<<<<< * return output * */ - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1313, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1312 + /* "w3lib/_url.pyx":1311 * continue * output += f"{address[piece_index]:x}" * if piece_index != 7: # <<<<<<<<<<<<<< @@ -19410,7 +19661,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_L3_continue:; } - /* "w3lib/_url.pyx":1314 + /* "w3lib/_url.pyx":1313 * if piece_index != 7: * output += ":" * return output # <<<<<<<<<<<<<< @@ -19422,7 +19673,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "w3lib/_url.pyx":1297 + /* "w3lib/_url.pyx":1296 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< @@ -19446,7 +19697,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":1318 +/* "w3lib/_url.pyx":1317 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(url: _URL) -> str: # <<<<<<<<<<<<<< @@ -19455,15 +19706,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_42_serialize_ipv6(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_45_serialize_host(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_47_serialize_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_45_serialize_host = {"_serialize_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_45_serialize_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_45_serialize_host(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_47_serialize_host = {"_serialize_host", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_47_serialize_host, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_47_serialize_host(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19507,12 +19758,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1318, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1317, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_host") < 0)) __PYX_ERR(0, 1318, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_host") < 0)) __PYX_ERR(0, 1317, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19523,7 +19774,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1318, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_host", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1317, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19537,7 +19788,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_44_serialize_host(__pyx_self, __pyx_v_url); + __pyx_r = __pyx_pf_5w3lib_4_url_46_serialize_host(__pyx_self, __pyx_v_url); /* function exit code */ { @@ -19550,7 +19801,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { +static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -19567,25 +19818,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_host", 1); - /* "w3lib/_url.pyx":1319 + /* "w3lib/_url.pyx":1318 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(url: _URL) -> str: * if url._host_type == IPV4: # <<<<<<<<<<<<<< * return _serialize_ipv4(url.ipv4) * if url._host_type == IPV6: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "w3lib/_url.pyx":1320 + /* "w3lib/_url.pyx":1319 * def _serialize_host(url: _URL) -> str: * if url._host_type == IPV4: * return _serialize_ipv4(url.ipv4) # <<<<<<<<<<<<<< @@ -19593,9 +19844,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject * return f"[{_serialize_ipv6(url.ipv6)}]" */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_serialize_ipv4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1320, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_serialize_ipv4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_ipv4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_ipv4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -19616,16 +19867,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 1320, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 1319, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1319 + /* "w3lib/_url.pyx":1318 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(url: _URL) -> str: * if url._host_type == IPV4: # <<<<<<<<<<<<<< @@ -19634,25 +19885,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1321 + /* "w3lib/_url.pyx":1320 * if url._host_type == IPV4: * return _serialize_ipv4(url.ipv4) * if url._host_type == IPV6: # <<<<<<<<<<<<<< * return f"[{_serialize_ipv6(url.ipv6)}]" * return url.hostname */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1321, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_IPV6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1321, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "w3lib/_url.pyx":1322 + /* "w3lib/_url.pyx":1321 * return _serialize_ipv4(url.ipv4) * if url._host_type == IPV6: * return f"[{_serialize_ipv6(url.ipv6)}]" # <<<<<<<<<<<<<< @@ -19660,7 +19911,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = 0; __pyx_t_8 = 127; @@ -19668,9 +19919,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject __pyx_t_7 += 1; __Pyx_GIVEREF(__pyx_kp_u__7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__7); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_serialize_ipv6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_serialize_ipv6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_ipv6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1322, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_ipv6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; __pyx_t_6 = 0; @@ -19691,11 +19942,11 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8; @@ -19707,14 +19958,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject __pyx_t_7 += 1; __Pyx_GIVEREF(__pyx_kp_u__8); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__8); - __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1321 + /* "w3lib/_url.pyx":1320 * if url._host_type == IPV4: * return _serialize_ipv4(url.ipv4) * if url._host_type == IPV6: # <<<<<<<<<<<<<< @@ -19723,7 +19974,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject */ } - /* "w3lib/_url.pyx":1323 + /* "w3lib/_url.pyx":1322 * if url._host_type == IPV6: * return f"[{_serialize_ipv6(url.ipv6)}]" * return url.hostname # <<<<<<<<<<<<<< @@ -19731,14 +19982,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 1323, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 1322, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1318 + /* "w3lib/_url.pyx":1317 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(url: _URL) -> str: # <<<<<<<<<<<<<< @@ -19761,7 +20012,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject return __pyx_r; } -/* "w3lib/_url.pyx":1327 +/* "w3lib/_url.pyx":1326 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL) -> str: # <<<<<<<<<<<<<< @@ -19770,15 +20021,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_44_serialize_host(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_47_serialize_url_path(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_49_serialize_url_path(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_47_serialize_url_path = {"_serialize_url_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_47_serialize_url_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_47_serialize_url_path(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_49_serialize_url_path = {"_serialize_url_path", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_49_serialize_url_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_49_serialize_url_path(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19822,12 +20073,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1327, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1326, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url_path") < 0)) __PYX_ERR(0, 1327, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url_path") < 0)) __PYX_ERR(0, 1326, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19838,7 +20089,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_url_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1327, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_url_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1326, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19852,7 +20103,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_46_serialize_url_path(__pyx_self, __pyx_v_url); + __pyx_r = __pyx_pf_5w3lib_4_url_48_serialize_url_path(__pyx_self, __pyx_v_url); /* function exit code */ { @@ -19865,7 +20116,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { +static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { PyObject *__pyx_v_output = NULL; PyObject *__pyx_v_segment = NULL; PyObject *__pyx_r = NULL; @@ -19882,20 +20133,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_url_path", 1); - /* "w3lib/_url.pyx":1328 + /* "w3lib/_url.pyx":1327 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL) -> str: * if url.opaque_path: # <<<<<<<<<<<<<< * assert isinstance(url.path, str) * return url.path */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "w3lib/_url.pyx":1329 + /* "w3lib/_url.pyx":1328 * def _serialize_url_path(url: _URL) -> str: * if url.opaque_path: * assert isinstance(url.path, str) # <<<<<<<<<<<<<< @@ -19904,20 +20155,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyUnicode_Check(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 1329, __pyx_L1_error) + __PYX_ERR(0, 1328, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 1329, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 1328, __pyx_L1_error) #endif - /* "w3lib/_url.pyx":1330 + /* "w3lib/_url.pyx":1329 * if url.opaque_path: * assert isinstance(url.path, str) * return url.path # <<<<<<<<<<<<<< @@ -19925,14 +20176,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj * return "" */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1330, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1329, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1328 + /* "w3lib/_url.pyx":1327 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL) -> str: * if url.opaque_path: # <<<<<<<<<<<<<< @@ -19941,16 +20192,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj */ } - /* "w3lib/_url.pyx":1331 + /* "w3lib/_url.pyx":1330 * assert isinstance(url.path, str) * return url.path * if len(url.path) <= 1 and url._path_token_seen: # <<<<<<<<<<<<<< * return "" * output = "" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1331, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__pyx_t_3 <= 1); if (__pyx_t_4) { @@ -19958,15 +20209,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj __pyx_t_2 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1331, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { - /* "w3lib/_url.pyx":1332 + /* "w3lib/_url.pyx":1331 * return url.path * if len(url.path) <= 1 and url._path_token_seen: * return "" # <<<<<<<<<<<<<< @@ -19978,7 +20229,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj __pyx_r = __pyx_kp_u_; goto __pyx_L0; - /* "w3lib/_url.pyx":1331 + /* "w3lib/_url.pyx":1330 * assert isinstance(url.path, str) * return url.path * if len(url.path) <= 1 and url._path_token_seen: # <<<<<<<<<<<<<< @@ -19987,7 +20238,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj */ } - /* "w3lib/_url.pyx":1333 + /* "w3lib/_url.pyx":1332 * if len(url.path) <= 1 and url._path_token_seen: * return "" * output = "" # <<<<<<<<<<<<<< @@ -19997,23 +20248,23 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj __Pyx_INCREF(__pyx_kp_u_); __pyx_v_output = __pyx_kp_u_; - /* "w3lib/_url.pyx":1334 + /* "w3lib/_url.pyx":1333 * return "" * output = "" * for segment in url.path: # <<<<<<<<<<<<<< * output += f"/{segment}" * return output */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1333, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -20022,28 +20273,28 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1334, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1333, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1333, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1334, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1333, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1333, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -20053,7 +20304,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1334, __pyx_L1_error) + else __PYX_ERR(0, 1333, __pyx_L1_error) } break; } @@ -20062,25 +20313,25 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj __Pyx_XDECREF_SET(__pyx_v_segment, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1335 + /* "w3lib/_url.pyx":1334 * output = "" * for segment in url.path: * output += f"/{segment}" # <<<<<<<<<<<<<< * return output * */ - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_segment, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_segment, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1335, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_output, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1334 + /* "w3lib/_url.pyx":1333 * return "" * output = "" * for segment in url.path: # <<<<<<<<<<<<<< @@ -20090,7 +20341,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1336 + /* "w3lib/_url.pyx":1335 * for segment in url.path: * output += f"/{segment}" * return output # <<<<<<<<<<<<<< @@ -20102,7 +20353,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "w3lib/_url.pyx":1327 + /* "w3lib/_url.pyx":1326 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL) -> str: # <<<<<<<<<<<<<< @@ -20125,7 +20376,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj return __pyx_r; } -/* "w3lib/_url.pyx":1340 +/* "w3lib/_url.pyx":1339 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url(url: _URL) -> str: # <<<<<<<<<<<<<< @@ -20134,16 +20385,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_46_serialize_url_path(CYTHON_UNUSED PyObj */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_49_serialize_url(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_51_serialize_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_48_serialize_url, "Return a string representation of *url* following the URL serialization\n algorithm defined in the `URL living standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer\n "); -static PyMethodDef __pyx_mdef_5w3lib_4_url_49_serialize_url = {"_serialize_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_49_serialize_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_48_serialize_url}; -static PyObject *__pyx_pw_5w3lib_4_url_49_serialize_url(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_5w3lib_4_url_50_serialize_url, "Return a string representation of *url* following the URL serialization\n algorithm defined in the `URL living standard`_.\n\n .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer\n "); +static PyMethodDef __pyx_mdef_5w3lib_4_url_51_serialize_url = {"_serialize_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_51_serialize_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5w3lib_4_url_50_serialize_url}; +static PyObject *__pyx_pw_5w3lib_4_url_51_serialize_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -20187,12 +20438,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1340, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1339, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url") < 0)) __PYX_ERR(0, 1340, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_serialize_url") < 0)) __PYX_ERR(0, 1339, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -20203,7 +20454,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_serialize_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1340, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_serialize_url", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1339, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20217,7 +20468,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5w3lib_4_url_48_serialize_url(__pyx_self, __pyx_v_url); + __pyx_r = __pyx_pf_5w3lib_4_url_50_serialize_url(__pyx_self, __pyx_v_url); /* function exit code */ { @@ -20230,7 +20481,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { +static PyObject *__pyx_pf_5w3lib_4_url_50_serialize_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url) { PyObject *__pyx_v_output = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -20247,136 +20498,136 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_serialize_url", 1); - /* "w3lib/_url.pyx":1346 + /* "w3lib/_url.pyx":1345 * .. _URL living standard: https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-url-serializer * """ * output = url.scheme + ":" # <<<<<<<<<<<<<< * if url.hostname or url._host_type != HOSTNAME: * output += "//" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_scheme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1346, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_output = __pyx_t_2; __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1347 + /* "w3lib/_url.pyx":1346 * """ * output = url.scheme + ":" * if url.hostname or url._host_type != HOSTNAME: # <<<<<<<<<<<<<< * output += "//" * if url.username or url.password: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_hostname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_host_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_HOSTNAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_char(__pyx_v_5w3lib_4_url_HOSTNAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1348 + /* "w3lib/_url.pyx":1347 * output = url.scheme + ":" * if url.hostname or url._host_type != HOSTNAME: * output += "//" # <<<<<<<<<<<<<< * if url.username or url.password: * output += url.username */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__23); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__23); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1349 + /* "w3lib/_url.pyx":1348 * if url.hostname or url._host_type != HOSTNAME: * output += "//" * if url.username or url.password: # <<<<<<<<<<<<<< * output += url.username * if url.password: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1349, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1348, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L7_bool_binop_done; } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1349, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1348, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __pyx_t_4; __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1350 + /* "w3lib/_url.pyx":1349 * output += "//" * if url.username or url.password: * output += url.username # <<<<<<<<<<<<<< * if url.password: * output += f":{url.password}" */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1350, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_username); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1351 + /* "w3lib/_url.pyx":1350 * if url.username or url.password: * output += url.username * if url.password: # <<<<<<<<<<<<<< * output += f":{url.password}" * elif url._password_token_seen: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1351, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1352 + /* "w3lib/_url.pyx":1351 * output += url.username * if url.password: * output += f":{url.password}" # <<<<<<<<<<<<<< * elif url._password_token_seen: * output += ":" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1352, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1352, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1351 + /* "w3lib/_url.pyx":1350 * if url.username or url.password: * output += url.username * if url.password: # <<<<<<<<<<<<<< @@ -20386,32 +20637,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L9; } - /* "w3lib/_url.pyx":1353 + /* "w3lib/_url.pyx":1352 * if url.password: * output += f":{url.password}" * elif url._password_token_seen: # <<<<<<<<<<<<<< * output += ":" * output += "@" */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1353, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_password_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1353, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1354 + /* "w3lib/_url.pyx":1353 * output += f":{url.password}" * elif url._password_token_seen: * output += ":" # <<<<<<<<<<<<<< * output += "@" * output += _serialize_host(url) */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1354, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1353 + /* "w3lib/_url.pyx":1352 * if url.password: * output += f":{url.password}" * elif url._password_token_seen: # <<<<<<<<<<<<<< @@ -20421,19 +20672,19 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L9:; - /* "w3lib/_url.pyx":1355 + /* "w3lib/_url.pyx":1354 * elif url._password_token_seen: * output += ":" * output += "@" # <<<<<<<<<<<<<< * output += _serialize_host(url) * if url.port > -1: */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1355, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1349 + /* "w3lib/_url.pyx":1348 * if url.hostname or url._host_type != HOSTNAME: * output += "//" * if url.username or url.password: # <<<<<<<<<<<<<< @@ -20442,14 +20693,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * */ } - /* "w3lib/_url.pyx":1356 + /* "w3lib/_url.pyx":1355 * output += ":" * output += "@" * output += _serialize_host(url) # <<<<<<<<<<<<<< * if url.port > -1: * output += f":{url.port}" */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_6 = 0; @@ -20469,53 +20720,53 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_url}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1356, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1357 + /* "w3lib/_url.pyx":1356 * output += "@" * output += _serialize_host(url) * if url.port > -1: # <<<<<<<<<<<<<< * output += f":{url.port}" * elif url._port_token_seen: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_neg_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1357, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_neg_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1357, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1358 + /* "w3lib/_url.pyx":1357 * output += _serialize_host(url) * if url.port > -1: * output += f":{url.port}" # <<<<<<<<<<<<<< * elif url._port_token_seen: * output += ":" */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1358, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1358, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u__4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1357 + /* "w3lib/_url.pyx":1356 * output += "@" * output += _serialize_host(url) * if url.port > -1: # <<<<<<<<<<<<<< @@ -20525,32 +20776,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L10; } - /* "w3lib/_url.pyx":1359 + /* "w3lib/_url.pyx":1358 * if url.port > -1: * output += f":{url.port}" * elif url._port_token_seen: # <<<<<<<<<<<<<< * output += ":" * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_port_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1359, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1360 + /* "w3lib/_url.pyx":1359 * output += f":{url.port}" * elif url._port_token_seen: * output += ":" # <<<<<<<<<<<<<< * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: * output += "/." */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1359 + /* "w3lib/_url.pyx":1358 * if url.port > -1: * output += f":{url.port}" * elif url._port_token_seen: # <<<<<<<<<<<<<< @@ -20560,7 +20811,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L10:; - /* "w3lib/_url.pyx":1347 + /* "w3lib/_url.pyx":1346 * """ * output = url.scheme + ":" * if url.hostname or url._host_type != HOSTNAME: # <<<<<<<<<<<<<< @@ -20570,16 +20821,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L3; } - /* "w3lib/_url.pyx":1361 + /* "w3lib/_url.pyx":1360 * elif url._port_token_seen: * output += ":" * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< * output += "/." * output += _serialize_url_path(url) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_opaque_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_4); if (__pyx_t_7) { @@ -20587,9 +20838,9 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_7; goto __pyx_L11_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (__pyx_t_8 > 1); if (__pyx_t_7) { @@ -20597,31 +20848,31 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_7; goto __pyx_L11_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = (!__pyx_t_7); __pyx_t_3 = __pyx_t_4; __pyx_L11_bool_binop_done:; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1362 + /* "w3lib/_url.pyx":1361 * output += ":" * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: * output += "/." # <<<<<<<<<<<<<< * output += _serialize_url_path(url) * if url.query: */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__24); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1362, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__24); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1361 + /* "w3lib/_url.pyx":1360 * elif url._port_token_seen: * output += ":" * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: # <<<<<<<<<<<<<< @@ -20631,14 +20882,14 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L3:; - /* "w3lib/_url.pyx":1363 + /* "w3lib/_url.pyx":1362 * elif not url.opaque_path and len(url.path) > 1 and not url.path[0]: * output += "/." * output += _serialize_url_path(url) # <<<<<<<<<<<<<< * if url.query: * output += f"?{url.query}" */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_url_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_url_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_6 = 0; @@ -20658,51 +20909,51 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_url}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1363, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1364 + /* "w3lib/_url.pyx":1363 * output += "/." * output += _serialize_url_path(url) * if url.query: # <<<<<<<<<<<<<< * output += f"?{url.query}" * elif url._query_token_seen: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1364, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1365 + /* "w3lib/_url.pyx":1364 * output += _serialize_url_path(url) * if url.query: * output += f"?{url.query}" # <<<<<<<<<<<<<< * elif url._query_token_seen: * output += "?" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1365, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__18, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__18, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1365, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1364 + /* "w3lib/_url.pyx":1363 * output += "/." * output += _serialize_url_path(url) * if url.query: # <<<<<<<<<<<<<< @@ -20712,32 +20963,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L14; } - /* "w3lib/_url.pyx":1366 + /* "w3lib/_url.pyx":1365 * if url.query: * output += f"?{url.query}" * elif url._query_token_seen: # <<<<<<<<<<<<<< * output += "?" * if url.fragment: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_query_token_seen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1366, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1365, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1367 + /* "w3lib/_url.pyx":1366 * output += f"?{url.query}" * elif url._query_token_seen: * output += "?" # <<<<<<<<<<<<<< * if url.fragment: * output += f"#{url.fragment}" */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__18); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1367, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__18); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_url.pyx":1366 + /* "w3lib/_url.pyx":1365 * if url.query: * output += f"?{url.query}" * elif url._query_token_seen: # <<<<<<<<<<<<<< @@ -20747,41 +20998,41 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L14:; - /* "w3lib/_url.pyx":1368 + /* "w3lib/_url.pyx":1367 * elif url._query_token_seen: * output += "?" * if url.fragment: # <<<<<<<<<<<<<< * output += f"#{url.fragment}" * elif url._fragment_token_seen: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1368, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1367, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1369 + /* "w3lib/_url.pyx":1368 * output += "?" * if url.fragment: * output += f"#{url.fragment}" # <<<<<<<<<<<<<< * elif url._fragment_token_seen: * output += "#" */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1369, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u__19, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1369, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u__19, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1368 + /* "w3lib/_url.pyx":1367 * elif url._query_token_seen: * output += "?" * if url.fragment: # <<<<<<<<<<<<<< @@ -20791,32 +21042,32 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * goto __pyx_L15; } - /* "w3lib/_url.pyx":1370 + /* "w3lib/_url.pyx":1369 * if url.fragment: * output += f"#{url.fragment}" * elif url._fragment_token_seen: # <<<<<<<<<<<<<< * output += "#" * return output */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_fragment_token_seen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1369, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "w3lib/_url.pyx":1371 + /* "w3lib/_url.pyx":1370 * output += f"#{url.fragment}" * elif url._fragment_token_seen: * output += "#" # <<<<<<<<<<<<<< * return output * */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_kp_u__19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1370 + /* "w3lib/_url.pyx":1369 * if url.fragment: * output += f"#{url.fragment}" * elif url._fragment_token_seen: # <<<<<<<<<<<<<< @@ -20826,7 +21077,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * } __pyx_L15:; - /* "w3lib/_url.pyx":1372 + /* "w3lib/_url.pyx":1371 * elif url._fragment_token_seen: * output += "#" * return output # <<<<<<<<<<<<<< @@ -20834,12 +21085,12 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1372, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_output))||((__pyx_v_output) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_output))) __PYX_ERR(0, 1371, __pyx_L1_error) __Pyx_INCREF(__pyx_v_output); __pyx_r = ((PyObject*)__pyx_v_output); goto __pyx_L0; - /* "w3lib/_url.pyx":1340 + /* "w3lib/_url.pyx":1339 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url(url: _URL) -> str: # <<<<<<<<<<<<<< @@ -20861,7 +21112,7 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "w3lib/_url.pyx":1375 +/* "w3lib/_url.pyx":1374 * * * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< @@ -20870,15 +21121,15 @@ static PyObject *__pyx_pf_5w3lib_4_url_48_serialize_url(CYTHON_UNUSED PyObject * */ /* Python wrapper */ -static PyObject *__pyx_pw_5w3lib_4_url_51_safe_url(PyObject *__pyx_self, +static PyObject *__pyx_pw_5w3lib_4_url_53_safe_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_5w3lib_4_url_51_safe_url = {"_safe_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_51_safe_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5w3lib_4_url_51_safe_url(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_5w3lib_4_url_53_safe_url = {"_safe_url", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5w3lib_4_url_53_safe_url, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_5w3lib_4_url_53_safe_url(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -20925,7 +21176,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1375, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1374, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -20933,14 +21184,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1375, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1374, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_safe_url", 1, 2, 2, 1); __PYX_ERR(0, 1375, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_url", 1, 2, 2, 1); __PYX_ERR(0, 1374, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_safe_url") < 0)) __PYX_ERR(0, 1375, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_safe_url") < 0)) __PYX_ERR(0, 1374, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -20953,7 +21204,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_safe_url", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1375, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_url", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1374, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20967,9 +21218,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 1375, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 1375, __pyx_L1_error) - __pyx_r = __pyx_pf_5w3lib_4_url_50_safe_url(__pyx_self, __pyx_v_input, __pyx_v_encoding); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), (&PyUnicode_Type), 0, "input", 1))) __PYX_ERR(0, 1374, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 1))) __PYX_ERR(0, 1374, __pyx_L1_error) + __pyx_r = __pyx_pf_5w3lib_4_url_52_safe_url(__pyx_self, __pyx_v_input, __pyx_v_encoding); /* function exit code */ goto __pyx_L0; @@ -20986,7 +21237,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_4_url_50_safe_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding) { +static PyObject *__pyx_pf_5w3lib_4_url_52_safe_url(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_encoding) { PyObject *__pyx_v_url = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -20999,13 +21250,13 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_safe_url(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_url", 1); - /* "w3lib/_url.pyx":1376 + /* "w3lib/_url.pyx":1375 * * def _safe_url(input: str, encoding: str) -> str: * url = _parse_url(input, encoding) # <<<<<<<<<<<<<< * return _serialize_url(url) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -21025,20 +21276,20 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_safe_url(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_input, __pyx_v_encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_url = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_url.pyx":1377 + /* "w3lib/_url.pyx":1376 * def _safe_url(input: str, encoding: str) -> str: * url = _parse_url(input, encoding) * return _serialize_url(url) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_serialize_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_serialize_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -21058,16 +21309,16 @@ static PyObject *__pyx_pf_5w3lib_4_url_50_safe_url(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_url}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1377, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1376, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_url.pyx":1375 + /* "w3lib/_url.pyx":1374 * * * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< @@ -21549,23 +21800,24 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, {&__pyx_kp_u__72, __pyx_k__72, sizeof(__pyx_k__72), 0, 1, 0, 0}, - {&__pyx_kp_u__75, __pyx_k__75, sizeof(__pyx_k__75), 0, 1, 0, 0}, - {&__pyx_kp_u__76, __pyx_k__76, sizeof(__pyx_k__76), 0, 1, 0, 0}, - {&__pyx_kp_u__77, __pyx_k__77, sizeof(__pyx_k__77), 0, 1, 0, 0}, - {&__pyx_kp_b__78, __pyx_k__78, sizeof(__pyx_k__78), 0, 0, 0, 0}, + {&__pyx_n_s__75, __pyx_k__75, sizeof(__pyx_k__75), 0, 0, 1, 1}, {&__pyx_kp_u__78, __pyx_k__78, sizeof(__pyx_k__78), 0, 1, 0, 0}, {&__pyx_kp_u__79, __pyx_k__79, sizeof(__pyx_k__79), 0, 1, 0, 0}, {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, {&__pyx_kp_u__80, __pyx_k__80, sizeof(__pyx_k__80), 0, 1, 0, 0}, {&__pyx_kp_b__81, __pyx_k__81, sizeof(__pyx_k__81), 0, 0, 0, 0}, - {&__pyx_kp_b__82, __pyx_k__82, sizeof(__pyx_k__82), 0, 0, 0, 0}, + {&__pyx_kp_u__81, __pyx_k__81, sizeof(__pyx_k__81), 0, 1, 0, 0}, + {&__pyx_kp_u__82, __pyx_k__82, sizeof(__pyx_k__82), 0, 1, 0, 0}, {&__pyx_kp_u__83, __pyx_k__83, sizeof(__pyx_k__83), 0, 1, 0, 0}, + {&__pyx_kp_b__84, __pyx_k__84, sizeof(__pyx_k__84), 0, 0, 0, 0}, {&__pyx_kp_b__85, __pyx_k__85, sizeof(__pyx_k__85), 0, 0, 0, 0}, + {&__pyx_kp_u__86, __pyx_k__86, sizeof(__pyx_k__86), 0, 1, 0, 0}, {&__pyx_kp_b__88, __pyx_k__88, sizeof(__pyx_k__88), 0, 0, 0, 0}, - {&__pyx_kp_b__89, __pyx_k__89, sizeof(__pyx_k__89), 0, 0, 0, 0}, {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, - {&__pyx_kp_u__90, __pyx_k__90, sizeof(__pyx_k__90), 0, 1, 0, 0}, - {&__pyx_kp_u__91, __pyx_k__91, sizeof(__pyx_k__91), 0, 1, 0, 0}, + {&__pyx_kp_b__91, __pyx_k__91, sizeof(__pyx_k__91), 0, 0, 0, 0}, + {&__pyx_kp_b__92, __pyx_k__92, sizeof(__pyx_k__92), 0, 0, 0, 0}, + {&__pyx_kp_u__93, __pyx_k__93, sizeof(__pyx_k__93), 0, 1, 0, 0}, + {&__pyx_kp_u__94, __pyx_k__94, sizeof(__pyx_k__94), 0, 1, 0, 0}, {&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1}, {&__pyx_n_s_annotations, __pyx_k_annotations, sizeof(__pyx_k_annotations), 0, 0, 1, 1}, {&__pyx_kp_u_ansi_x3_4_1968, __pyx_k_ansi_x3_4_1968, sizeof(__pyx_k_ansi_x3_4_1968), 0, 1, 0, 0}, @@ -21585,6 +21837,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_u_big5_hkscs, __pyx_k_big5_hkscs, sizeof(__pyx_k_big5_hkscs), 0, 1, 0, 0}, {&__pyx_n_s_bint, __pyx_k_bint, sizeof(__pyx_k_bint), 0, 0, 1, 1}, {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_byte, __pyx_k_byte, sizeof(__pyx_k_byte), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_check_bidi, __pyx_k_check_bidi, sizeof(__pyx_k_check_bidi), 0, 0, 1, 1}, {&__pyx_n_s_check_hyphens, __pyx_k_check_hyphens, sizeof(__pyx_k_check_hyphens), 0, 0, 1, 1}, @@ -21653,9 +21906,12 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_u_elot_928, __pyx_k_elot_928, sizeof(__pyx_k_elot_928), 0, 1, 0, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_encode_output, __pyx_k_encode_output, sizeof(__pyx_k_encode_output), 0, 0, 1, 1}, + {&__pyx_n_s_encode_output_length, __pyx_k_encode_output_length, sizeof(__pyx_k_encode_output_length), 0, 0, 1, 1}, {&__pyx_n_s_encode_set, __pyx_k_encode_set, sizeof(__pyx_k_encode_set), 0, 0, 1, 1}, {&__pyx_n_s_encoded, __pyx_k_encoded, sizeof(__pyx_k_encoded), 0, 0, 1, 1}, {&__pyx_n_s_encoded_code_points, __pyx_k_encoded_code_points, sizeof(__pyx_k_encoded_code_points), 0, 0, 1, 1}, + {&__pyx_n_s_encoder, __pyx_k_encoder, sizeof(__pyx_k_encoder), 0, 0, 1, 1}, {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, {&__pyx_n_s_ends_in_number, __pyx_k_ends_in_number, sizeof(__pyx_k_ends_in_number), 0, 0, 1, 1}, {&__pyx_n_s_ends_in_number_locals_genexpr, __pyx_k_ends_in_number_locals_genexpr, sizeof(__pyx_k_ends_in_number_locals_genexpr), 0, 0, 1, 1}, @@ -21796,6 +22052,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_u_iso_ir_149, __pyx_k_iso_ir_149, sizeof(__pyx_k_iso_ir_149), 0, 1, 0, 0}, {&__pyx_kp_u_iso_ir_157, __pyx_k_iso_ir_157, sizeof(__pyx_k_iso_ir_157), 0, 1, 0, 0}, {&__pyx_kp_u_iso_ir_58, __pyx_k_iso_ir_58, sizeof(__pyx_k_iso_ir_58), 0, 1, 0, 0}, + {&__pyx_n_s_isomorph, __pyx_k_isomorph, sizeof(__pyx_k_isomorph), 0, 0, 1, 1}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_u_koi, __pyx_k_koi, sizeof(__pyx_k_koi), 0, 1, 0, 1}, {&__pyx_n_u_koi8, __pyx_k_koi8, sizeof(__pyx_k_koi8), 0, 1, 0, 1}, @@ -21843,6 +22100,8 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_u_ms_kanji, __pyx_k_ms_kanji, sizeof(__pyx_k_ms_kanji), 0, 1, 0, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1}, + {&__pyx_n_s_next_next, __pyx_k_next_next, sizeof(__pyx_k_next_next), 0, 0, 1, 1}, {&__pyx_n_s_number, __pyx_k_number, sizeof(__pyx_k_number), 0, 0, 1, 1}, {&__pyx_n_s_numbers, __pyx_k_numbers, sizeof(__pyx_k_numbers), 0, 0, 1, 1}, {&__pyx_n_s_numbers_seen, __pyx_k_numbers_seen, sizeof(__pyx_k_numbers_seen), 0, 0, 1, 1}, @@ -21862,6 +22121,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_path_safe_chars, __pyx_k_path_safe_chars, sizeof(__pyx_k_path_safe_chars), 0, 0, 1, 1}, {&__pyx_n_s_path_token_seen, __pyx_k_path_token_seen, sizeof(__pyx_k_path_token_seen), 0, 0, 1, 1}, + {&__pyx_n_s_percent_encode_after_encoding, __pyx_k_percent_encode_after_encoding, sizeof(__pyx_k_percent_encode_after_encoding), 0, 0, 1, 1}, {&__pyx_n_s_percent_encode_set, __pyx_k_percent_encode_set, sizeof(__pyx_k_percent_encode_set), 0, 0, 1, 1}, {&__pyx_n_s_piece, __pyx_k_piece, sizeof(__pyx_k_piece), 0, 0, 1, 1}, {&__pyx_n_s_piece_index, __pyx_k_piece_index, sizeof(__pyx_k_piece_index), 0, 0, 1, 1}, @@ -21975,10 +22235,10 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 461, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 462, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 593, __pyx_L1_error) - __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 595, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 739, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1065, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -22000,47 +22260,47 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_slice__2); __Pyx_GIVEREF(__pyx_slice__2); - /* "w3lib/_url.pyx":805 + /* "w3lib/_url.pyx":804 * r = 8 * if not input: * return (0, True) # <<<<<<<<<<<<<< * return (int(input, base=r), validation_error) * */ - __pyx_tuple__6 = PyTuple_Pack(2, __pyx_int_0, Py_True); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 805, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(2, __pyx_int_0, Py_True); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "w3lib/_url.pyx":1025 + /* "w3lib/_url.pyx":1024 * * elif state == NO_SCHEME: * raise ValueError("No URL scheme") # <<<<<<<<<<<<<< * * elif state == SPECIAL_RELATIVE_OR_AUTHORITY: */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_No_URL_scheme); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1025, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_No_URL_scheme); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1024, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "w3lib/_url.pyx":1032 + /* "w3lib/_url.pyx":1031 * pointer += 1 * else: * raise ValueError("URL is relative") # <<<<<<<<<<<<<< * * elif state == PATH_OR_AUTHORITY: */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_URL_is_relative); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_URL_is_relative); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - /* "w3lib/_url.pyx":1191 + /* "w3lib/_url.pyx":1190 * and _is_windows_drive_letter(buffer) * ): * buffer = buffer[0] + ":" + buffer[2:] # <<<<<<<<<<<<<< * if ( * not url.path */ - __pyx_slice__21 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(0, 1191, __pyx_L1_error) + __pyx_slice__21 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__21); __Pyx_GIVEREF(__pyx_slice__21); @@ -22522,293 +22782,305 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__73); __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_shorten_path, 571, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 571, __pyx_L1_error) - /* "w3lib/_url.pyx":629 + /* "w3lib/_url.pyx":580 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode + * # Extended to handled cases where % is to be percent-encoded. + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + __pyx_tuple__76 = PyTuple_Pack(13, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_percent_encode_set, __pyx_n_s_encoder, __pyx_n_s_output, __pyx_n_s_encode_output, __pyx_n_s__75, __pyx_n_s_encode_output_length, __pyx_n_s_i, __pyx_n_s_byte, __pyx_n_s_isomorph, __pyx_n_s_next, __pyx_n_s_next_next); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_percent_encode_after_encoding, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 580, __pyx_L1_error) + + /* "w3lib/_url.pyx":628 * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") # <<<<<<<<<<<<<< * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 * */ - __pyx_tuple__84 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__84); - __Pyx_GIVEREF(__pyx_tuple__84); + __pyx_tuple__87 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); - /* "w3lib/_url.pyx":634 + /* "w3lib/_url.pyx":633 * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" * _safe_chars = RFC3986_RESERVED + RFC3986_UNRESERVED + EXTRA_SAFE_CHARS + b"%" * _path_safe_chars = _safe_chars.replace(b"#", b"") # <<<<<<<<<<<<<< * * # Characters that are safe in all of: */ - __pyx_tuple__86 = PyTuple_Pack(2, __pyx_kp_b__19, __pyx_kp_b_); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__86); - __Pyx_GIVEREF(__pyx_tuple__86); + __pyx_tuple__89 = PyTuple_Pack(2, __pyx_kp_b__19, __pyx_kp_b_); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__89); + __Pyx_GIVEREF(__pyx_tuple__89); - /* "w3lib/_url.pyx":646 + /* "w3lib/_url.pyx":645 * # be escaped as %25 when it is not already being used as part of an escape * # character. * _USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") # <<<<<<<<<<<<<< * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS */ - __pyx_tuple__87 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__87); - __Pyx_GIVEREF(__pyx_tuple__87); + __pyx_tuple__90 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); - /* "w3lib/_url.pyx":683 + /* "w3lib/_url.pyx":682 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< * address = [0] * 8 * piece_index = 0 */ - __pyx_tuple__92 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_address, __pyx_n_s_piece_index, __pyx_n_s_compress, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_value, __pyx_n_s_length, __pyx_n_s_numbers_seen, __pyx_n_s_ipv4_piece, __pyx_n_s_number, __pyx_n_s_swaps); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__92); - __Pyx_GIVEREF(__pyx_tuple__92); - __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv6, 683, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_tuple__95 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_address, __pyx_n_s_piece_index, __pyx_n_s_compress, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_value, __pyx_n_s_length, __pyx_n_s_numbers_seen, __pyx_n_s_ipv4_piece, __pyx_n_s_number, __pyx_n_s_swaps); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv6, 682, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 682, __pyx_L1_error) - /* "w3lib/_url.pyx":770 + /* "w3lib/_url.pyx":769 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< * input: str, * percent_encode_set: _PercentEncodeSet, */ - __pyx_tuple__94 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__94); - __Pyx_GIVEREF(__pyx_tuple__94); - __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_utf_8_percent_encode, 770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_tuple__97 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 769, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_utf_8_percent_encode, 769, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 769, __pyx_L1_error) - /* "w3lib/_url.pyx":782 + /* "w3lib/_url.pyx":781 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: */ - __pyx_tuple__96 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__96); - __Pyx_GIVEREF(__pyx_tuple__96); - __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_opaque_host, 782, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_tuple__99 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); + __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_opaque_host, 781, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 781, __pyx_L1_error) - /* "w3lib/_url.pyx":790 + /* "w3lib/_url.pyx":789 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bint]: # <<<<<<<<<<<<<< * if not input: * raise ValueError */ - __pyx_tuple__98 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_validation_error, __pyx_n_s_r); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 790, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__98); - __Pyx_GIVEREF(__pyx_tuple__98); - __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4_number, 790, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_tuple__101 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_validation_error, __pyx_n_s_r); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__101); + __Pyx_GIVEREF(__pyx_tuple__101); + __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4_number, 789, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 789, __pyx_L1_error) - /* "w3lib/_url.pyx":810 + /* "w3lib/_url.pyx":809 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bint: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and parts[-1] == "": */ - __pyx_tuple__100 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_last, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 810, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__100); - __Pyx_GIVEREF(__pyx_tuple__100); - __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_ends_in_number, 810, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 810, __pyx_L1_error) + __pyx_tuple__103 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_last, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__103); + __Pyx_GIVEREF(__pyx_tuple__103); + __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_ends_in_number, 809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 809, __pyx_L1_error) - /* "w3lib/_url.pyx":827 + /* "w3lib/_url.pyx":826 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and not parts[-1]: */ - __pyx_tuple__102 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_numbers, __pyx_n_s_part, __pyx_n_s_result, __pyx_n_s_ipv4, __pyx_n_s_counter, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__102); - __Pyx_GIVEREF(__pyx_tuple__102); - __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4, 827, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 827, __pyx_L1_error) + __pyx_tuple__105 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_parts, __pyx_n_s_numbers, __pyx_n_s_part, __pyx_n_s_result, __pyx_n_s_ipv4, __pyx_n_s_counter, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__105); + __Pyx_GIVEREF(__pyx_tuple__105); + __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_ipv4, 826, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 826, __pyx_L1_error) - /* "w3lib/_url.pyx":850 + /* "w3lib/_url.pyx":849 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: # <<<<<<<<<<<<<< * result = _utr46._to_ascii( * domain, */ - __pyx_tuple__104 = PyTuple_Pack(3, __pyx_n_s_domain, __pyx_n_s_be_strict, __pyx_n_s_result); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__104); - __Pyx_GIVEREF(__pyx_tuple__104); - __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_domain_to_ascii, 850, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_tuple__107 = PyTuple_Pack(3, __pyx_n_s_domain, __pyx_n_s_be_strict, __pyx_n_s_result); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 849, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__107); + __Pyx_GIVEREF(__pyx_tuple__107); + __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_domain_to_ascii, 849, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 849, __pyx_L1_error) - /* "w3lib/_url.pyx":869 + /* "w3lib/_url.pyx":868 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< * input: str, * url: _URL, */ - __pyx_tuple__106 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_url, __pyx_n_s_domain, __pyx_n_s_ascii_domain, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 869, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__106); - __Pyx_GIVEREF(__pyx_tuple__106); - __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_host, 869, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 869, __pyx_L1_error) + __pyx_tuple__109 = PyTuple_Pack(5, __pyx_n_s_input, __pyx_n_s_url, __pyx_n_s_domain, __pyx_n_s_ascii_domain, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 868, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__109); + __Pyx_GIVEREF(__pyx_tuple__109); + __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_host, 868, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 868, __pyx_L1_error) - /* "w3lib/_url.pyx":898 + /* "w3lib/_url.pyx":897 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * */ - __pyx_tuple__108 = PyTuple_Pack(1, __pyx_n_s_input); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 898, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__108); - __Pyx_GIVEREF(__pyx_tuple__108); - __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_windows_drive_letter, 898, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 898, __pyx_L1_error) + __pyx_tuple__111 = PyTuple_Pack(1, __pyx_n_s_input); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__111); + __Pyx_GIVEREF(__pyx_tuple__111); + __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_windows_drive_letter, 897, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 897, __pyx_L1_error) - /* "w3lib/_url.pyx":903 + /* "w3lib/_url.pyx":902 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< * input_length = len(input) * return ( */ - __pyx_tuple__110 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_input_length); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 903, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__110); - __Pyx_GIVEREF(__pyx_tuple__110); - __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_starts_with_windows_drive_lette, 903, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 903, __pyx_L1_error) + __pyx_tuple__113 = PyTuple_Pack(2, __pyx_n_s_input, __pyx_n_s_input_length); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 902, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__113); + __Pyx_GIVEREF(__pyx_tuple__113); + __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_starts_with_windows_drive_lette, 902, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 902, __pyx_L1_error) - /* "w3lib/_url.pyx":913 + /* "w3lib/_url.pyx":912 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< * return input in ( * "..", */ - __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_double_dot_path_segment, 913, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_double_dot_path_segment, 912, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 912, __pyx_L1_error) - /* "w3lib/_url.pyx":928 + /* "w3lib/_url.pyx":927 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< * return input in ( * ".", */ - __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_single_dot_path_segment, 928, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 928, __pyx_L1_error) + __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_is_single_dot_path_segment, 927, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 927, __pyx_L1_error) - /* "w3lib/_url.pyx":939 + /* "w3lib/_url.pyx":938 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * *, input: str, pointer: int, encode_set: _PercentEncodeSet * ) -> str: */ - __pyx_tuple__114 = PyTuple_Pack(4, __pyx_n_s_input, __pyx_n_s_pointer, __pyx_n_s_encode_set, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__114); - __Pyx_GIVEREF(__pyx_tuple__114); - __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_idempotent_utf_8_percent_encode, 939, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_tuple__117 = PyTuple_Pack(4, __pyx_n_s_input, __pyx_n_s_pointer, __pyx_n_s_encode_set, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 938, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__117); + __Pyx_GIVEREF(__pyx_tuple__117); + __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_idempotent_utf_8_percent_encode, 938, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 938, __pyx_L1_error) - /* "w3lib/_url.pyx":954 + /* "w3lib/_url.pyx":953 * * * def _preprocess_url(url: str) -> str: # <<<<<<<<<<<<<< * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) * */ - __pyx_tuple__116 = PyTuple_Pack(1, __pyx_n_s_url); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 954, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__116); - __Pyx_GIVEREF(__pyx_tuple__116); - __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_preprocess_url, 954, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 954, __pyx_L1_error) + __pyx_tuple__119 = PyTuple_Pack(1, __pyx_n_s_url); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__119); + __Pyx_GIVEREF(__pyx_tuple__119); + __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_preprocess_url, 953, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 953, __pyx_L1_error) - /* "w3lib/_url.pyx":958 + /* "w3lib/_url.pyx":957 * * * def _parse_url( # <<<<<<<<<<<<<< * input: str, * encoding: str = "utf-8", */ - __pyx_tuple__118 = PyTuple_Pack(19, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_url, __pyx_n_s_state, __pyx_n_s_buffer, __pyx_n_s_at_sign_seen, __pyx_n_s_inside_brackets, __pyx_n_s_skip_authority_shortcut, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_reached_end, __pyx_n_s_c, __pyx_n_s_at_sign_index, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_encoded_code_points, __pyx_n_s_port, __pyx_n_s_encoded, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 958, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__118); - __Pyx_GIVEREF(__pyx_tuple__118); - __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_url, 958, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 958, __pyx_L1_error) + __pyx_tuple__121 = PyTuple_Pack(19, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_url, __pyx_n_s_state, __pyx_n_s_buffer, __pyx_n_s_at_sign_seen, __pyx_n_s_inside_brackets, __pyx_n_s_skip_authority_shortcut, __pyx_n_s_pointer, __pyx_n_s_input_length, __pyx_n_s_reached_end, __pyx_n_s_c, __pyx_n_s_at_sign_index, __pyx_n_s_i, __pyx_n_s_code_point, __pyx_n_s_encoded_code_points, __pyx_n_s_port, __pyx_n_s_encoded, __pyx_n_s_percent_encode_set); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 957, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__121); + __Pyx_GIVEREF(__pyx_tuple__121); + __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_parse_url, 957, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 957, __pyx_L1_error) - /* "w3lib/_url.pyx":1268 + /* "w3lib/_url.pyx":1267 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< * output = "" * n = address */ - __pyx_tuple__120 = PyTuple_Pack(4, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 1268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__120); - __Pyx_GIVEREF(__pyx_tuple__120); - __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv4, 1268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 1268, __pyx_L1_error) + __pyx_tuple__123 = PyTuple_Pack(4, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 1267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__123); + __Pyx_GIVEREF(__pyx_tuple__123); + __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv4, 1267, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 1267, __pyx_L1_error) - /* "w3lib/_url.pyx":1279 + /* "w3lib/_url.pyx":1278 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: */ - __pyx_tuple__122 = PyTuple_Pack(7, __pyx_n_s_address, __pyx_n_s_min_length, __pyx_n_s_index, __pyx_n_s_index_length, __pyx_n_s_current_length, __pyx_n_s_current_index, __pyx_n_s_piece); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 1279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__122); - __Pyx_GIVEREF(__pyx_tuple__122); - __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_ipv6_first_longest_0_piece, 1279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_tuple__125 = PyTuple_Pack(7, __pyx_n_s_address, __pyx_n_s_min_length, __pyx_n_s_index, __pyx_n_s_index_length, __pyx_n_s_current_length, __pyx_n_s_current_index, __pyx_n_s_piece); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 1278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__125); + __Pyx_GIVEREF(__pyx_tuple__125); + __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_get_ipv6_first_longest_0_piece, 1278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 1278, __pyx_L1_error) - /* "w3lib/_url.pyx":1297 + /* "w3lib/_url.pyx":1296 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) */ - __pyx_tuple__124 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_compress, __pyx_n_s_ignore0, __pyx_n_s_piece_index, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 1297, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__124); - __Pyx_GIVEREF(__pyx_tuple__124); - __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv6, 1297, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_tuple__127 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_output, __pyx_n_s_compress, __pyx_n_s_ignore0, __pyx_n_s_piece_index, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 1296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__127); + __Pyx_GIVEREF(__pyx_tuple__127); + __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_ipv6, 1296, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 1296, __pyx_L1_error) - /* "w3lib/_url.pyx":1318 + /* "w3lib/_url.pyx":1317 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(url: _URL) -> str: # <<<<<<<<<<<<<< * if url._host_type == IPV4: * return _serialize_ipv4(url.ipv4) */ - __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_host, 1318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_host, 1317, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 1317, __pyx_L1_error) - /* "w3lib/_url.pyx":1327 + /* "w3lib/_url.pyx":1326 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL) -> str: # <<<<<<<<<<<<<< * if url.opaque_path: * assert isinstance(url.path, str) */ - __pyx_tuple__127 = PyTuple_Pack(3, __pyx_n_s_url, __pyx_n_s_output, __pyx_n_s_segment); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 1327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__127); - __Pyx_GIVEREF(__pyx_tuple__127); - __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url_path, 1327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 1327, __pyx_L1_error) + __pyx_tuple__130 = PyTuple_Pack(3, __pyx_n_s_url, __pyx_n_s_output, __pyx_n_s_segment); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 1326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__130); + __Pyx_GIVEREF(__pyx_tuple__130); + __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url_path, 1326, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 1326, __pyx_L1_error) - /* "w3lib/_url.pyx":1340 + /* "w3lib/_url.pyx":1339 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url(url: _URL) -> str: # <<<<<<<<<<<<<< * """Return a string representation of *url* following the URL serialization * algorithm defined in the `URL living standard`_. */ - __pyx_tuple__129 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_output); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 1340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__129); - __Pyx_GIVEREF(__pyx_tuple__129); - __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url, 1340, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 1340, __pyx_L1_error) + __pyx_tuple__132 = PyTuple_Pack(2, __pyx_n_s_url, __pyx_n_s_output); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 1339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__132); + __Pyx_GIVEREF(__pyx_tuple__132); + __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_serialize_url, 1339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 1339, __pyx_L1_error) - /* "w3lib/_url.pyx":1375 + /* "w3lib/_url.pyx":1374 * * * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< * url = _parse_url(input, encoding) * return _serialize_url(url) */ - __pyx_tuple__131 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_url); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 1375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__131); - __Pyx_GIVEREF(__pyx_tuple__131); - __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_safe_url, 1375, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 1375, __pyx_L1_error) + __pyx_tuple__134 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_encoding, __pyx_n_s_url); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 1374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__134); + __Pyx_GIVEREF(__pyx_tuple__134); + __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__url_pyx, __pyx_n_s_safe_url, 1374, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 1374, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -22928,15 +23200,15 @@ static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr)) __PYX_ERR(0, 817, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr)) __PYX_ERR(0, 816, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 816, __pyx_L1_error) #else __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr = &__pyx_type_5w3lib_4_url___pyx_scope_struct__genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 817, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 816, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_5w3lib_4_url___pyx_scope_struct__genexpr->tp_print = 0; @@ -22947,15 +23219,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 837, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 836, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 836, __pyx_L1_error) #else __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr = &__pyx_type_5w3lib_4_url___pyx_scope_struct_1_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 837, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 836, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_5w3lib_4_url___pyx_scope_struct_1_genexpr->tp_print = 0; @@ -26616,1040 +26888,1060 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_shorten_path, __pyx_t_6) < 0) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":615 + /* "w3lib/_url.pyx":580 + * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode + * # Extended to handled cases where % is to be percent-encoded. + * def _percent_encode_after_encoding( # <<<<<<<<<<<<<< + * input: str, + * *, + */ + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_9_percent_encode_after_encoding, 0, __pyx_n_s_percent_encode_after_encoding, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_percent_encode_after_encoding, __pyx_t_4) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "w3lib/_url.pyx":614 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); - /* "w3lib/_url.pyx":616 + /* "w3lib/_url.pyx":615 * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( * _C0_CONTROL, # <<<<<<<<<<<<<< * greater_than="~", * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); - /* "w3lib/_url.pyx":615 + /* "w3lib/_url.pyx":614 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error); - __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(0, 614, __pyx_L1_error); + __pyx_t_6 = 0; - /* "w3lib/_url.pyx":617 + /* "w3lib/_url.pyx":616 * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( * _C0_CONTROL, * greater_than="~", # <<<<<<<<<<<<<< * ) * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_greater_than, __pyx_kp_u__75) < 0) __PYX_ERR(0, 617, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_greater_than, __pyx_kp_u__78) < 0) __PYX_ERR(0, 616, __pyx_L1_error) - /* "w3lib/_url.pyx":615 + /* "w3lib/_url.pyx":614 * * * _C0_CONTROL_PERCENT_ENCODE_SET = _PercentEncodeSet( # <<<<<<<<<<<<<< * _C0_CONTROL, * greater_than="~", */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":619 + /* "w3lib/_url.pyx":618 * greater_than="~", * ) * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' # <<<<<<<<<<<<<< * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__76); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__79); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET, __pyx_t_6) < 0) __PYX_ERR(0, 618, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":620 + /* "w3lib/_url.pyx":619 * ) * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' # <<<<<<<<<<<<<< * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__77); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_C0_CONTROL_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__80); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":621 + /* "w3lib/_url.pyx":620 * _FRAGMENT_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "<>`' * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" # <<<<<<<<<<<<<< * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__78); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__81); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_t_4) < 0) __PYX_ERR(0, 621, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE, __pyx_t_6) < 0) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":622 + /* "w3lib/_url.pyx":621 * _QUERY_PERCENT_ENCODE_SET = _C0_CONTROL_PERCENT_ENCODE_SET + ' "#<>' * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" # <<<<<<<<<<<<<< * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__79); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__82); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 622, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":623 + /* "w3lib/_url.pyx":622 * _SPECIAL_QUERY_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "'" * _PATH_PERCENT_ENCODE_SET = _QUERY_PERCENT_ENCODE_SET + "?`{}" * _USERINFO_PERCENT_ENCODE_SET = _PATH_PERCENT_ENCODE_SET + "/:;=@[\\]^|" # <<<<<<<<<<<<<< * * # constants from RFC 3986, Section 2.2 and 2.3 */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__80); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__83); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_t_4) < 0) __PYX_ERR(0, 623, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET, __pyx_t_6) < 0) __PYX_ERR(0, 622, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":626 + /* "w3lib/_url.pyx":625 * * # constants from RFC 3986, Section 2.2 and 2.3 * RFC3986_GEN_DELIMS = b":/?#[]@" # <<<<<<<<<<<<<< * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_GEN_DELIMS, __pyx_kp_b__81) < 0) __PYX_ERR(0, 626, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_GEN_DELIMS, __pyx_kp_b__84) < 0) __PYX_ERR(0, 625, __pyx_L1_error) - /* "w3lib/_url.pyx":627 + /* "w3lib/_url.pyx":626 * # constants from RFC 3986, Section 2.2 and 2.3 * RFC3986_GEN_DELIMS = b":/?#[]@" * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" # <<<<<<<<<<<<<< * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_SUB_DELIMS, __pyx_kp_b__82) < 0) __PYX_ERR(0, 627, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_SUB_DELIMS, __pyx_kp_b__85) < 0) __PYX_ERR(0, 626, __pyx_L1_error) - /* "w3lib/_url.pyx":628 + /* "w3lib/_url.pyx":627 * RFC3986_GEN_DELIMS = b":/?#[]@" * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS # <<<<<<<<<<<<<< * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RFC3986_GEN_DELIMS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RFC3986_SUB_DELIMS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_GEN_DELIMS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RFC3986_SUB_DELIMS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_RESERVED, __pyx_t_3) < 0) __PYX_ERR(0, 628, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_RESERVED, __pyx_t_3) < 0) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":629 + /* "w3lib/_url.pyx":628 * RFC3986_SUB_DELIMS = b"!$&'()*+,;=" * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") # <<<<<<<<<<<<<< * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascii_letters); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascii_letters); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_digits); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_digits); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__83); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_kp_u__86); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_UNRESERVED, __pyx_t_4) < 0) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_UNRESERVED, __pyx_t_6) < 0) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":630 + /* "w3lib/_url.pyx":629 * RFC3986_RESERVED = RFC3986_GEN_DELIMS + RFC3986_SUB_DELIMS * RFC3986_UNRESERVED = (string.ascii_letters + string.digits + "-._~").encode("ascii") * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 # <<<<<<<<<<<<<< * * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRA_SAFE_CHARS, __pyx_kp_b__85) < 0) __PYX_ERR(0, 630, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRA_SAFE_CHARS, __pyx_kp_b__88) < 0) __PYX_ERR(0, 629, __pyx_L1_error) - /* "w3lib/_url.pyx":632 + /* "w3lib/_url.pyx":631 * EXTRA_SAFE_CHARS = b"|" # see https://github.com/scrapy/w3lib/pull/25 * * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" # <<<<<<<<<<<<<< * _safe_chars = RFC3986_RESERVED + RFC3986_UNRESERVED + EXTRA_SAFE_CHARS + b"%" * _path_safe_chars = _safe_chars.replace(b"#", b"") */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RFC3986_UNRESERVED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_SUB_DELIMS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RFC3986_UNRESERVED); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_SUB_DELIMS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_b__4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_b__4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_USERINFO_SAFE_CHARS, __pyx_t_3) < 0) __PYX_ERR(0, 632, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RFC3986_USERINFO_SAFE_CHARS, __pyx_t_3) < 0) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":633 + /* "w3lib/_url.pyx":632 * * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" * _safe_chars = RFC3986_RESERVED + RFC3986_UNRESERVED + EXTRA_SAFE_CHARS + b"%" # <<<<<<<<<<<<<< * _path_safe_chars = _safe_chars.replace(b"#", b"") * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_RESERVED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_RESERVED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RFC3986_UNRESERVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RFC3986_UNRESERVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EXTRA_SAFE_CHARS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EXTRA_SAFE_CHARS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_b__3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_b__3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_chars, __pyx_t_2) < 0) __PYX_ERR(0, 633, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_chars, __pyx_t_2) < 0) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":634 + /* "w3lib/_url.pyx":633 * RFC3986_USERINFO_SAFE_CHARS = RFC3986_UNRESERVED + RFC3986_SUB_DELIMS + b":" * _safe_chars = RFC3986_RESERVED + RFC3986_UNRESERVED + EXTRA_SAFE_CHARS + b"%" * _path_safe_chars = _safe_chars.replace(b"#", b"") # <<<<<<<<<<<<<< * * # Characters that are safe in all of: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_safe_chars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_safe_chars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_replace); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_replace); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_path_safe_chars, __pyx_t_2) < 0) __PYX_ERR(0, 634, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_path_safe_chars, __pyx_t_2) < 0) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":646 + /* "w3lib/_url.pyx":645 * # be escaped as %25 when it is not already being used as part of an escape * # character. * _USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") # <<<<<<<<<<<<<< * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RFC3986_USERINFO_SAFE_CHARS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RFC3986_USERINFO_SAFE_CHARS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_translate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_translate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_delete, __pyx_kp_b__88) < 0) __PYX_ERR(0, 646, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__87, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_delete, __pyx_kp_b__91) < 0) __PYX_ERR(0, 645, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__90, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_SAFEST_CHARS, __pyx_t_4) < 0) __PYX_ERR(0, 646, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_USERINFO_SAFEST_CHARS, __pyx_t_6) < 0) __PYX_ERR(0, 645, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":647 + /* "w3lib/_url.pyx":646 * # character. * _USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") # <<<<<<<<<<<<<< * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS * _SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_safe_chars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_translate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_safe_chars); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_translate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_delete, __pyx_kp_b__89) < 0) __PYX_ERR(0, 647, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__87, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_delete, __pyx_kp_b__92) < 0) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__90, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_SAFEST_CHARS, __pyx_t_3) < 0) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PATH_SAFEST_CHARS, __pyx_t_3) < 0) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":648 + /* "w3lib/_url.pyx":647 * _USERINFO_SAFEST_CHARS = RFC3986_USERINFO_SAFE_CHARS.translate(None, delete=b":;=") * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS # <<<<<<<<<<<<<< * _SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") * _FRAGMENT_SAFEST_CHARS = _PATH_SAFEST_CHARS */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_SAFEST_CHARS, __pyx_t_3) < 0) __PYX_ERR(0, 648, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_SAFEST_CHARS, __pyx_t_3) < 0) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":649 + /* "w3lib/_url.pyx":648 * _PATH_SAFEST_CHARS = _safe_chars.translate(None, delete=b"#[]|") * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS * _SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") # <<<<<<<<<<<<<< * _FRAGMENT_SAFEST_CHARS = _PATH_SAFEST_CHARS * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_translate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_translate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_delete, __pyx_kp_b__78) < 0) __PYX_ERR(0, 649, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__87, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_delete, __pyx_kp_b__81) < 0) __PYX_ERR(0, 648, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__90, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS, __pyx_t_2) < 0) __PYX_ERR(0, 649, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL_QUERY_SAFEST_CHARS, __pyx_t_2) < 0) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":650 + /* "w3lib/_url.pyx":649 * _QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS * _SPECIAL_QUERY_SAFEST_CHARS = _PATH_SAFEST_CHARS.translate(None, delete=b"'") * _FRAGMENT_SAFEST_CHARS = _PATH_SAFEST_CHARS # <<<<<<<<<<<<<< * * _SAFE_USERINFO_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 650, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH_SAFEST_CHARS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_SAFEST_CHARS, __pyx_t_2) < 0) __PYX_ERR(0, 650, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FRAGMENT_SAFEST_CHARS, __pyx_t_2) < 0) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":653 + /* "w3lib/_url.pyx":652 * * _SAFE_USERINFO_PERCENT_ENCODE_SET = ( * _USERINFO_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC3986_USERINFO_PERCENT_ENCODE_SET * | _RFC2396_USERINFO_PERCENT_ENCODE_SET */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_USERINFO_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":654 + /* "w3lib/_url.pyx":653 * _SAFE_USERINFO_PERCENT_ENCODE_SET = ( * _USERINFO_PERCENT_ENCODE_SET * | _RFC3986_USERINFO_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC2396_USERINFO_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":655 + /* "w3lib/_url.pyx":654 * _USERINFO_PERCENT_ENCODE_SET * | _RFC3986_USERINFO_PERCENT_ENCODE_SET * | _RFC2396_USERINFO_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * _SAFE_PATH_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_USERINFO_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_2 = PyNumber_Or(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_USERINFO_PERCENT_ENCODE_SE, __pyx_t_2) < 0) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":658 + /* "w3lib/_url.pyx":657 * ) * _SAFE_PATH_PERCENT_ENCODE_SET = ( * _PATH_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC3986_PATH_PERCENT_ENCODE_SET * | _RFC2396_ABS_PATH_PERCENT_ENCODE_SET */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":659 + /* "w3lib/_url.pyx":658 * _SAFE_PATH_PERCENT_ENCODE_SET = ( * _PATH_PERCENT_ENCODE_SET * | _RFC3986_PATH_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC2396_ABS_PATH_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_PATH_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":660 + /* "w3lib/_url.pyx":659 * _PATH_PERCENT_ENCODE_SET * | _RFC3986_PATH_PERCENT_ENCODE_SET * | _RFC2396_ABS_PATH_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * _SAFE_QUERY_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_ABS_PATH_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_2 = PyNumber_Or(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 657, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_PATH_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":663 + /* "w3lib/_url.pyx":662 * ) * _SAFE_QUERY_PERCENT_ENCODE_SET = ( * _QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC3986_QUERY_PERCENT_ENCODE_SET * | _RFC2396_QUERY_PERCENT_ENCODE_SET */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QUERY_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":664 + /* "w3lib/_url.pyx":663 * _SAFE_QUERY_PERCENT_ENCODE_SET = ( * _QUERY_PERCENT_ENCODE_SET * | _RFC3986_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC2396_QUERY_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":665 + /* "w3lib/_url.pyx":664 * _QUERY_PERCENT_ENCODE_SET * | _RFC3986_QUERY_PERCENT_ENCODE_SET * | _RFC2396_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error) + __pyx_t_2 = PyNumber_Or(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_QUERY_PERCENT_ENCODE_SET, __pyx_t_2) < 0) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":668 + /* "w3lib/_url.pyx":667 * ) * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET = ( * _SPECIAL_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC3986_QUERY_PERCENT_ENCODE_SET * | _RFC2396_QUERY_PERCENT_ENCODE_SET */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":669 + /* "w3lib/_url.pyx":668 * _SAFE_SPECIAL_QUERY_PERCENT_ENCODE_SET = ( * _SPECIAL_QUERY_PERCENT_ENCODE_SET * | _RFC3986_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC2396_QUERY_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":670 + /* "w3lib/_url.pyx":669 * _SPECIAL_QUERY_PERCENT_ENCODE_SET * | _RFC3986_QUERY_PERCENT_ENCODE_SET * | _RFC2396_QUERY_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * _SAFE_FRAGMENT_PERCENT_ENCODE_SET = ( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_QUERY_PERCENT_ENCODE_SE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error) + __pyx_t_2 = PyNumber_Or(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO, __pyx_t_2) < 0) __PYX_ERR(0, 667, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_SPECIAL_QUERY_PERCENT_ENCO, __pyx_t_2) < 0) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":673 + /* "w3lib/_url.pyx":672 * ) * _SAFE_FRAGMENT_PERCENT_ENCODE_SET = ( * _FRAGMENT_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC3986_FRAGMENT_PERCENT_ENCODE_SET * | _RFC2396_FRAGMENT_PERCENT_ENCODE_SET */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FRAGMENT_PERCENT_ENCODE_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_url.pyx":674 + /* "w3lib/_url.pyx":673 * _SAFE_FRAGMENT_PERCENT_ENCODE_SET = ( * _FRAGMENT_PERCENT_ENCODE_SET * | _RFC3986_FRAGMENT_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * | _RFC2396_FRAGMENT_PERCENT_ENCODE_SET * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC3986_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 673, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":675 + /* "w3lib/_url.pyx":674 * _FRAGMENT_PERCENT_ENCODE_SET * | _RFC3986_FRAGMENT_PERCENT_ENCODE_SET * | _RFC2396_FRAGMENT_PERCENT_ENCODE_SET # <<<<<<<<<<<<<< * ) * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RFC2396_FRAGMENT_PERCENT_ENCODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Or(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_2 = PyNumber_Or(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE, __pyx_t_2) < 0) __PYX_ERR(0, 672, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SAFE_FRAGMENT_PERCENT_ENCODE_SE, __pyx_t_2) < 0) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":679 + /* "w3lib/_url.pyx":678 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point * _FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" # <<<<<<<<<<<<<< * _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_kp_u__90) < 0) __PYX_ERR(0, 679, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS, __pyx_kp_u__93) < 0) __PYX_ERR(0, 678, __pyx_L1_error) - /* "w3lib/_url.pyx":680 + /* "w3lib/_url.pyx":679 * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#forbidden-host-code-point * _FORBIDDEN_HOST_CODE_POINTS = "\x00\t\n\r #/:<>?@[\\]^|" * _FORBIDDEN_DOMAIN_CODE_POINTS = _FORBIDDEN_HOST_CODE_POINTS + _C0_CONTROL + "%\x7F" # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FORBIDDEN_HOST_CODE_POINTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_C0_CONTROL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__91); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__94); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_t_3) < 0) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORBIDDEN_DOMAIN_CODE_POINTS, __pyx_t_3) < 0) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":683 + /* "w3lib/_url.pyx":682 * * * def _parse_ipv6(input: str) -> List[int]: # <<<<<<<<<<<<<< * address = [0] * 8 * piece_index = 0 */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 683, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 683, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_9_parse_ipv6, 0, __pyx_n_s_parse_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 682, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_11_parse_ipv6, 0, __pyx_n_s_parse_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv6, __pyx_t_6) < 0) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":770 + /* "w3lib/_url.pyx":769 * * * def _utf_8_percent_encode( # <<<<<<<<<<<<<< * input: str, * percent_encode_set: _PercentEncodeSet, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 770, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 770, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 770, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_11_utf_8_percent_encode, 0, __pyx_n_s_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 769, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 769, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_percent_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 769, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 769, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_13_utf_8_percent_encode, 0, __pyx_n_s_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf_8_percent_encode, __pyx_t_3) < 0) __PYX_ERR(0, 770, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf_8_percent_encode, __pyx_t_3) < 0) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":782 + /* "w3lib/_url.pyx":781 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-opaque-host-parser * def _parse_opaque_host(input: str) -> str: # <<<<<<<<<<<<<< * for code_point in input: * if code_point in _FORBIDDEN_HOST_CODE_POINTS: */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 782, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 782, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_13_parse_opaque_host, 0, __pyx_n_s_parse_opaque_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 781, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_15_parse_opaque_host, 0, __pyx_n_s_parse_opaque_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_opaque_host, __pyx_t_4) < 0) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_opaque_host, __pyx_t_6) < 0) __PYX_ERR(0, 781, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":790 + /* "w3lib/_url.pyx":789 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ipv4-number-parser * def _parse_ipv4_number(input: str) -> Tuple[int, bint]: # <<<<<<<<<<<<<< * if not input: * raise ValueError */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 790, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Tuple_int_bint) < 0) __PYX_ERR(0, 790, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_15_parse_ipv4_number, 0, __pyx_n_s_parse_ipv4_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 789, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_Tuple_int_bint) < 0) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_17_parse_ipv4_number, 0, __pyx_n_s_parse_ipv4_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4_number, __pyx_t_3) < 0) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4_number, __pyx_t_3) < 0) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":810 + /* "w3lib/_url.pyx":809 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#ends-in-a-number-checker * def _ends_in_number(input: str) -> bint: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and parts[-1] == "": */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 810, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 810, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 810, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_17_ends_in_number, 0, __pyx_n_s_ends_in_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 810, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_19_ends_in_number, 0, __pyx_n_s_ends_in_number, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ends_in_number, __pyx_t_4) < 0) __PYX_ERR(0, 810, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ends_in_number, __pyx_t_6) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":827 + /* "w3lib/_url.pyx":826 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4-parser * def _parse_ipv4(input: str) -> int: # <<<<<<<<<<<<<< * parts = input.split(".") * if parts and not parts[-1]: */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 827, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 827, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_19_parse_ipv4, 0, __pyx_n_s_parse_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 826, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 826, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_21_parse_ipv4, 0, __pyx_n_s_parse_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4, __pyx_t_3) < 0) __PYX_ERR(0, 827, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_ipv4, __pyx_t_3) < 0) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_url.pyx":850 + /* "w3lib/_url.pyx":849 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-domain-to-ascii * def _domain_to_ascii(domain: str, *, be_strict: bint = False) -> str: # <<<<<<<<<<<<<< * result = _utr46._to_ascii( * domain, */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_be_strict, __pyx_t_4) < 0) __PYX_ERR(0, 850, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domain, __pyx_n_s_str) < 0) __PYX_ERR(0, 850, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_be_strict, __pyx_n_s_bint) < 0) __PYX_ERR(0, 850, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 850, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_21_domain_to_ascii, 0, __pyx_n_s_domain_to_ascii, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 849, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_be_strict, __pyx_t_6) < 0) __PYX_ERR(0, 849, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 849, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domain, __pyx_n_s_str) < 0) __PYX_ERR(0, 849, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_be_strict, __pyx_n_s_bint) < 0) __PYX_ERR(0, 849, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 849, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_23_domain_to_ascii, 0, __pyx_n_s_domain_to_ascii, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_domain_to_ascii, __pyx_t_2) < 0) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_domain_to_ascii, __pyx_t_2) < 0) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":869 + /* "w3lib/_url.pyx":868 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-parser * def _parse_host( # <<<<<<<<<<<<<< * input: str, * url: _URL, */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 869, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 869, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 869, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_23_parse_host, 0, __pyx_n_s_parse_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 868, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 868, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 868, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_25_parse_host, 0, __pyx_n_s_parse_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 868, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_host, __pyx_t_4) < 0) __PYX_ERR(0, 869, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_host, __pyx_t_6) < 0) __PYX_ERR(0, 868, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":898 + /* "w3lib/_url.pyx":897 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#windows-drive-letter * def _is_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< * return len(input) == 2 and input[0] in _ASCII_ALPHA and input[1] in ":|" * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 898, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 898, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_25_is_windows_drive_letter, 0, __pyx_n_s_is_windows_drive_letter, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 897, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 897, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_27_is_windows_drive_letter, 0, __pyx_n_s_is_windows_drive_letter, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_windows_drive_letter, __pyx_t_2) < 0) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_windows_drive_letter, __pyx_t_2) < 0) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":903 + /* "w3lib/_url.pyx":902 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#start-with-a-windows-drive-letter * def _starts_with_windows_drive_letter(input: str) -> bint: # <<<<<<<<<<<<<< * input_length = len(input) * return ( */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 903, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 903, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_27_starts_with_windows_drive_letter, 0, __pyx_n_s_starts_with_windows_drive_lette, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 903, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 902, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 902, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_29_starts_with_windows_drive_letter, 0, __pyx_n_s_starts_with_windows_drive_lette, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 902, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_starts_with_windows_drive_lette, __pyx_t_4) < 0) __PYX_ERR(0, 903, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_starts_with_windows_drive_lette, __pyx_t_6) < 0) __PYX_ERR(0, 902, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":913 + /* "w3lib/_url.pyx":912 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#double-dot-path-segment * def _is_double_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< * return input in ( * "..", */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 913, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 913, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 913, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_29_is_double_dot_path_segment, 0, __pyx_n_s_is_double_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 912, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 912, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_31_is_double_dot_path_segment, 0, __pyx_n_s_is_double_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_double_dot_path_segment, __pyx_t_2) < 0) __PYX_ERR(0, 913, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_double_dot_path_segment, __pyx_t_2) < 0) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":928 + /* "w3lib/_url.pyx":927 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#single-dot-path-segment * def _is_single_dot_path_segment(input: str) -> bint: # <<<<<<<<<<<<<< * return input in ( * ".", */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 928, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 928, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 928, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_31_is_single_dot_path_segment, 0, __pyx_n_s_is_single_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 927, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bint) < 0) __PYX_ERR(0, 927, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_33_is_single_dot_path_segment, 0, __pyx_n_s_is_single_dot_path_segment, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 927, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_single_dot_path_segment, __pyx_t_4) < 0) __PYX_ERR(0, 928, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_single_dot_path_segment, __pyx_t_6) < 0) __PYX_ERR(0, 927, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":939 + /* "w3lib/_url.pyx":938 * # to be escaped, they are escaped in an idempotent way (i.e. if they are * # already part of an escape sequence, they are not re-encoded). * def _idempotent_utf_8_percent_encode( # <<<<<<<<<<<<<< * *, input: str, pointer: int, encode_set: _PercentEncodeSet * ) -> str: */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 939, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pointer, __pyx_n_s_int) < 0) __PYX_ERR(0, 939, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 939, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 939, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_33_idempotent_utf_8_percent_encode, 0, __pyx_n_s_idempotent_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 938, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 938, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pointer, __pyx_n_s_int) < 0) __PYX_ERR(0, 938, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encode_set, __pyx_n_s_PercentEncodeSet) < 0) __PYX_ERR(0, 938, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 938, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_35_idempotent_utf_8_percent_encode, 0, __pyx_n_s_idempotent_utf_8_percent_encode, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_idempotent_utf_8_percent_encode, __pyx_t_2) < 0) __PYX_ERR(0, 939, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_idempotent_utf_8_percent_encode, __pyx_t_2) < 0) __PYX_ERR(0, 938, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":954 + /* "w3lib/_url.pyx":953 * * * def _preprocess_url(url: str) -> str: # <<<<<<<<<<<<<< * return url.strip(_C0_CONTROL_OR_SPACE).translate(_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE) * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_url, __pyx_n_s_str) < 0) __PYX_ERR(0, 954, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 954, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_35_preprocess_url, 0, __pyx_n_s_preprocess_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_url, __pyx_n_s_str) < 0) __PYX_ERR(0, 953, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 953, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_37_preprocess_url, 0, __pyx_n_s_preprocess_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_preprocess_url, __pyx_t_4) < 0) __PYX_ERR(0, 954, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_preprocess_url, __pyx_t_6) < 0) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":958 + /* "w3lib/_url.pyx":957 * * * def _parse_url( # <<<<<<<<<<<<<< * input: str, * encoding: str = "utf-8", */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 958, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 958, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 958, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_37_parse_url, 0, __pyx_n_s_parse_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 957, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 957, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 957, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_URL) < 0) __PYX_ERR(0, 957, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_39_parse_url, 0, __pyx_n_s_parse_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__67); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_url, __pyx_t_2) < 0) __PYX_ERR(0, 958, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_url, __pyx_t_2) < 0) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1268 + /* "w3lib/_url.pyx":1267 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv4 * def _serialize_ipv4(address: int) -> str: # <<<<<<<<<<<<<< * output = "" * n = address */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1268, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_address, __pyx_n_s_int) < 0) __PYX_ERR(0, 1268, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1268, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_39_serialize_ipv4, 0, __pyx_n_s_serialize_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_address, __pyx_n_s_int) < 0) __PYX_ERR(0, 1267, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1267, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_41_serialize_ipv4, 0, __pyx_n_s_serialize_ipv4, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv4, __pyx_t_4) < 0) __PYX_ERR(0, 1268, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv4, __pyx_t_6) < 0) __PYX_ERR(0, 1267, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":1279 + /* "w3lib/_url.pyx":1278 * * * def _get_ipv6_first_longest_0_piece_index( # <<<<<<<<<<<<<< * address: List[int], *, min_length: int = 2 * ) -> Optional[int]: */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_min_length, __pyx_n_s_int) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_41_get_ipv6_first_longest_0_piece_index, 0, __pyx_n_s_get_ipv6_first_longest_0_piece, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1278, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_min_length, __pyx_n_s_int) < 0) __PYX_ERR(0, 1278, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 1278, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_43_get_ipv6_first_longest_0_piece_index, 0, __pyx_n_s_get_ipv6_first_longest_0_piece, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 1279, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 1278, __pyx_L1_error) - /* "w3lib/_url.pyx":1280 + /* "w3lib/_url.pyx":1279 * * def _get_ipv6_first_longest_0_piece_index( * address: List[int], *, min_length: int = 2 # <<<<<<<<<<<<<< * ) -> Optional[int]: * index = None */ - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_2))) __PYX_ERR(0, 1280, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_2))) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_INCREF(__pyx_int_2); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_2)->__pyx_arg_min_length = ((PyObject*)__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_5w3lib_4_url_52__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_t_2) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_5w3lib_4_url_54__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ipv6_first_longest_0_piece, __pyx_t_2) < 0) __PYX_ERR(0, 1278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1297 + /* "w3lib/_url.pyx":1296 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-ipv6-serializer * def _serialize_ipv6(address: List[int]) -> str: # <<<<<<<<<<<<<< * output = "" * compress = _get_ipv6_first_longest_0_piece_index(address) */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1297, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1297, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_43_serialize_ipv6, 0, __pyx_n_s_serialize_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1297, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_address, __pyx_kp_s_List_int) < 0) __PYX_ERR(0, 1296, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_45_serialize_ipv6, 0, __pyx_n_s_serialize_ipv6, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 1297, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_ipv6, __pyx_t_6) < 0) __PYX_ERR(0, 1296, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":1318 + /* "w3lib/_url.pyx":1317 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#concept-host-serializer * def _serialize_host(url: _URL) -> str: # <<<<<<<<<<<<<< * if url._host_type == IPV4: * return _serialize_ipv4(url.ipv4) */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1318, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1318, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_45_serialize_host, 0, __pyx_n_s_serialize_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1317, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_47_serialize_host, 0, __pyx_n_s_serialize_host, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_host, __pyx_t_2) < 0) __PYX_ERR(0, 1318, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_host, __pyx_t_2) < 0) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1327 + /* "w3lib/_url.pyx":1326 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-path-serializer * def _serialize_url_path(url: _URL) -> str: # <<<<<<<<<<<<<< * if url.opaque_path: * assert isinstance(url.path, str) */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1327, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1327, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1327, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_47_serialize_url_path, 0, __pyx_n_s_serialize_url_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1326, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1326, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_49_serialize_url_path, 0, __pyx_n_s_serialize_url_path, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url_path, __pyx_t_4) < 0) __PYX_ERR(0, 1327, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url_path, __pyx_t_6) < 0) __PYX_ERR(0, 1326, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "w3lib/_url.pyx":1340 + /* "w3lib/_url.pyx":1339 * * # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#url-serializing * def _serialize_url(url: _URL) -> str: # <<<<<<<<<<<<<< * """Return a string representation of *url* following the URL serialization * algorithm defined in the `URL living standard`_. */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1340, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1340, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_49_serialize_url, 0, __pyx_n_s_serialize_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1340, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_url, __pyx_n_s_URL) < 0) __PYX_ERR(0, 1339, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1339, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_51_serialize_url, 0, __pyx_n_s_serialize_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url, __pyx_t_2) < 0) __PYX_ERR(0, 1340, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_url, __pyx_t_2) < 0) __PYX_ERR(0, 1339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_url.pyx":1375 + /* "w3lib/_url.pyx":1374 * * * def _safe_url(input: str, encoding: str) -> str: # <<<<<<<<<<<<<< * url = _parse_url(input, encoding) * return _serialize_url(url) */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 1375, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 1375, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1375, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_51_safe_url, 0, __pyx_n_s_safe_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_n_s_str) < 0) __PYX_ERR(0, 1374, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_n_s_str) < 0) __PYX_ERR(0, 1374, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1374, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_4_url_53_safe_url, 0, __pyx_n_s_safe_url, NULL, __pyx_n_s_w3lib__url, __pyx_d, ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_url, __pyx_t_4) < 0) __PYX_ERR(0, 1375, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_url, __pyx_t_6) < 0) __PYX_ERR(0, 1374, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "w3lib/_url.pyx":1 * # pylint: disable=protected-access,too-many-instance-attributes,too-many-locals,too-many-nested-blocks,too-many-statements # <<<<<<<<<<<<<< * * import codecs */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /*--- Wrapped vars code ---*/ @@ -29441,6 +29733,17 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, return NULL; } +/* RaiseKeywordRequired */ +static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name) { + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() needs keyword-only argument %U", func_name, kw_name); + #else + "%s() needs keyword-only argument %s", func_name, + PyString_AS_STRING(kw_name)); + #endif +} + /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, @@ -30488,17 +30791,6 @@ static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr, return (int) PyUnicode_Tailmatch(s, substr, start, end, direction); } -/* RaiseKeywordRequired */ -static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name) { - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() needs keyword-only argument %U", func_name, kw_name); - #else - "%s() needs keyword-only argument %s", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - /* CIntToDigits */ static const char DIGIT_PAIRS_10[2*10*10+1] = { "00010203040506070809" diff --git a/w3lib/_url.pyx b/w3lib/_url.pyx index ac3ed893..37bab7c9 100644 --- a/w3lib/_url.pyx +++ b/w3lib/_url.pyx @@ -577,7 +577,6 @@ def _shorten_path(url: _URL) -> None: # https://url.spec.whatwg.org/commit-snapshots/a46cb9188a48c2c9d80ba32a9b1891652d6b4900/#utf-8-percent-encode # Extended to handled cases where % is to be percent-encoded. -@cfunc def _percent_encode_after_encoding( input: str, *, diff --git a/w3lib/_util.c b/w3lib/_util.c index 61401780..28b2cc94 100644 --- a/w3lib/_util.c +++ b/w3lib/_util.c @@ -1477,7 +1477,7 @@ static const char *__pyx_f[] = { struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__; struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr; -/* "w3lib/_util.pyx":18 +/* "w3lib/_util.pyx":20 * """ * * def __init__( # <<<<<<<<<<<<<< @@ -1490,7 +1490,7 @@ struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ { }; -/* "w3lib/_util.pyx":30 +/* "w3lib/_util.pyx":32 * if exclude: * code_points = "".join( * chr(value) # <<<<<<<<<<<<<< @@ -2169,6 +2169,11 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #define __Pyx_HAS_GCC_DIAGNOSTIC #endif +/* ObjectAsUCS4.proto */ +#define __Pyx_PyObject_AsPy_UCS4(x)\ + (likely(PyUnicode_Check(x)) ? __Pyx_PyUnicode_AsPy_UCS4(x) : __Pyx__PyObject_AsPy_UCS4(x)) +static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject*); + /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); @@ -2323,6 +2328,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ +/* Module declarations from "cython" */ + /* Module declarations from "w3lib._util" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ @@ -2393,6 +2400,7 @@ static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_Union_int_str[] = "Union[int, str]"; static const char __pyx_k_code_points_2[] = "_code_points"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; +static const char __pyx_k_cython_Py_UCS4[] = "cython.Py_UCS4"; static const char __pyx_k_greater_than_2[] = "_greater_than"; static const char __pyx_k_greater_than_3[] = ", greater_than="; static const char __pyx_k_new_code_points[] = "new_code_points"; @@ -2414,7 +2422,7 @@ static const char __pyx_k_Set_of_code_points_that_require[] = "Set of code point /* #### Code section: decls ### */ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__init___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_points, PyObject *__pyx_v_greater_than, PyObject *__pyx_v_exclude); /* proto */ -static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_point); /* proto */ +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, Py_UCS4 __pyx_v_code_point); /* proto */ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_points); /* proto */ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_points); /* proto */ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ @@ -2450,6 +2458,8 @@ typedef struct { PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_5w3lib_5_util___pyx_scope_struct____init__; PyObject *__pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr; #endif @@ -2487,6 +2497,7 @@ typedef struct { PyObject *__pyx_n_s_code_points_2; PyObject *__pyx_n_s_contains; PyObject *__pyx_n_s_cp; + PyObject *__pyx_kp_s_cython_Py_UCS4; PyObject *__pyx_n_s_dict; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_doc; @@ -2622,6 +2633,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_code_points_2); Py_CLEAR(clear_module_state->__pyx_n_s_contains); Py_CLEAR(clear_module_state->__pyx_n_s_cp); + Py_CLEAR(clear_module_state->__pyx_kp_s_cython_Py_UCS4); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_doc); @@ -2735,6 +2747,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_code_points_2); Py_VISIT(traverse_module_state->__pyx_n_s_contains); Py_VISIT(traverse_module_state->__pyx_n_s_cp); + Py_VISIT(traverse_module_state->__pyx_kp_s_cython_Py_UCS4); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_doc); @@ -2821,6 +2834,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE #define __pyx_type_5w3lib_5_util___pyx_scope_struct____init__ __pyx_mstate_global->__pyx_type_5w3lib_5_util___pyx_scope_struct____init__ #define __pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr #endif @@ -2858,6 +2873,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_code_points_2 __pyx_mstate_global->__pyx_n_s_code_points_2 #define __pyx_n_s_contains __pyx_mstate_global->__pyx_n_s_contains #define __pyx_n_s_cp __pyx_mstate_global->__pyx_n_s_cp +#define __pyx_kp_s_cython_Py_UCS4 __pyx_mstate_global->__pyx_kp_s_cython_Py_UCS4 #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc @@ -2917,7 +2933,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 /* #### Code section: module_code ### */ -/* "w3lib/_util.pyx":18 +/* "w3lib/_util.pyx":20 * """ * * def __init__( # <<<<<<<<<<<<<< @@ -2968,7 +2984,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_code_points,&__pyx_n_s_greater_than,&__pyx_n_s_exclude,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_kp_u_))); - /* "w3lib/_util.pyx":23 + /* "w3lib/_util.pyx":25 * *, * greater_than: Union[int, str] = "\x7f", * exclude: bool = False, # <<<<<<<<<<<<<< @@ -2993,7 +3009,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -3001,9 +3017,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 18, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 20, __pyx_L3_error) } } if (kw_args > 0 && likely(kw_args <= 2)) { @@ -3011,12 +3027,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds for (index = 2; index < 4 && kw_args > 0; index++) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 18, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 20, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -3031,7 +3047,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 18, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 20, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3045,10 +3061,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code_points), (&PyUnicode_Type), 0, "code_points", 1))) __PYX_ERR(0, 20, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code_points), (&PyUnicode_Type), 0, "code_points", 1))) __PYX_ERR(0, 22, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(__pyx_self, __pyx_v_self, __pyx_v_code_points, __pyx_v_greater_than, __pyx_v_exclude); - /* "w3lib/_util.pyx":18 + /* "w3lib/_util.pyx":20 * """ * * def __init__( # <<<<<<<<<<<<<< @@ -3072,7 +3088,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "w3lib/_util.pyx":30 +/* "w3lib/_util.pyx":32 * if exclude: * code_points = "".join( * chr(value) # <<<<<<<<<<<<<< @@ -3092,7 +3108,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__init___genexpr(Py if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_5w3lib_5_util___pyx_scope_struct_1_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 30, __pyx_L1_error) + __PYX_ERR(0, 32, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -3103,7 +3119,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__init___genexpr(Py __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_PercentEncodeSet___init___local, __pyx_n_s_w3lib__util); if (unlikely(!gen)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_PercentEncodeSet___init___local, __pyx_n_s_w3lib__util); if (unlikely(!gen)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -3140,26 +3156,26 @@ static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 30, __pyx_L1_error) - __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 30, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - /* "w3lib/_util.pyx":31 + /* "w3lib/_util.pyx":33 * code_points = "".join( * chr(value) * for value in range(self._greater_than + 1) # <<<<<<<<<<<<<< * if chr(value) not in code_points * ) */ - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 31, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 33, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -3167,28 +3183,28 @@ static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 31, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 33, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 33, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 31, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 33, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 33, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -3198,7 +3214,7 @@ static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 31, __pyx_L1_error) + else __PYX_ERR(0, 33, __pyx_L1_error) } break; } @@ -3209,37 +3225,37 @@ static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_util.pyx":32 + /* "w3lib/_util.pyx":34 * chr(value) * for value in range(self._greater_than + 1) * if chr(value) not in code_points # <<<<<<<<<<<<<< * ) * self._code_points = code_points */ - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_code_points)) { __Pyx_RaiseClosureNameError("code_points"); __PYX_ERR(0, 32, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_code_points)) { __Pyx_RaiseClosureNameError("code_points"); __PYX_ERR(0, 34, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_code_points == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 32, __pyx_L1_error) + __PYX_ERR(0, 34, __pyx_L1_error) } - __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_code_points, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_code_points, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "w3lib/_util.pyx":30 + /* "w3lib/_util.pyx":32 * if exclude: * code_points = "".join( * chr(value) # <<<<<<<<<<<<<< * for value in range(self._greater_than + 1) * if chr(value) not in code_points */ - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 30, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_util.pyx":32 + /* "w3lib/_util.pyx":34 * chr(value) * for value in range(self._greater_than + 1) * if chr(value) not in code_points # <<<<<<<<<<<<<< @@ -3248,7 +3264,7 @@ static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator */ } - /* "w3lib/_util.pyx":31 + /* "w3lib/_util.pyx":33 * code_points = "".join( * chr(value) * for value in range(self._greater_than + 1) # <<<<<<<<<<<<<< @@ -3259,7 +3275,7 @@ static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "w3lib/_util.pyx":30 + /* "w3lib/_util.pyx":32 * if exclude: * code_points = "".join( * chr(value) # <<<<<<<<<<<<<< @@ -3286,7 +3302,7 @@ static PyObject *__pyx_gb_5w3lib_5_util_17_PercentEncodeSet_8__init___2generator return __pyx_r; } -/* "w3lib/_util.pyx":18 +/* "w3lib/_util.pyx":20 * """ * * def __init__( # <<<<<<<<<<<<<< @@ -3311,7 +3327,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_5w3lib_5_util___pyx_scope_struct____init__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 18, __pyx_L1_error) + __PYX_ERR(0, 20, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -3320,7 +3336,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_code_points); __Pyx_INCREF(__pyx_v_greater_than); - /* "w3lib/_util.pyx":25 + /* "w3lib/_util.pyx":27 * exclude: bool = False, * ): * if isinstance(greater_than, str): # <<<<<<<<<<<<<< @@ -3330,20 +3346,20 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS __pyx_t_1 = PyUnicode_Check(__pyx_v_greater_than); if (__pyx_t_1) { - /* "w3lib/_util.pyx":26 + /* "w3lib/_util.pyx":28 * ): * if isinstance(greater_than, str): * greater_than = ord(greater_than) # <<<<<<<<<<<<<< * self._greater_than = greater_than * if exclude: */ - __pyx_t_2 = __Pyx_PyObject_Ord(__pyx_v_greater_than); if (unlikely(__pyx_t_2 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 26, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Ord(__pyx_v_greater_than); if (unlikely(__pyx_t_2 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_greater_than, __pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_util.pyx":25 + /* "w3lib/_util.pyx":27 * exclude: bool = False, * ): * if isinstance(greater_than, str): # <<<<<<<<<<<<<< @@ -3352,63 +3368,63 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS */ } - /* "w3lib/_util.pyx":27 + /* "w3lib/_util.pyx":29 * if isinstance(greater_than, str): * greater_than = ord(greater_than) * self._greater_than = greater_than # <<<<<<<<<<<<<< * if exclude: * code_points = "".join( */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2, __pyx_v_greater_than) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2, __pyx_v_greater_than) < 0) __PYX_ERR(0, 29, __pyx_L1_error) - /* "w3lib/_util.pyx":28 + /* "w3lib/_util.pyx":30 * greater_than = ord(greater_than) * self._greater_than = greater_than * if exclude: # <<<<<<<<<<<<<< * code_points = "".join( * chr(value) */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exclude); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exclude); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 30, __pyx_L1_error) if (__pyx_t_1) { - /* "w3lib/_util.pyx":31 + /* "w3lib/_util.pyx":33 * code_points = "".join( * chr(value) * for value in range(self._greater_than + 1) # <<<<<<<<<<<<<< * if chr(value) not in code_points * ) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_util.pyx":30 + /* "w3lib/_util.pyx":32 * if exclude: * code_points = "".join( * chr(value) # <<<<<<<<<<<<<< * for value in range(self._greater_than + 1) * if chr(value) not in code_points */ - __pyx_t_4 = __pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__init___genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_4 = __pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__init___genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_util.pyx":29 + /* "w3lib/_util.pyx":31 * self._greater_than = greater_than * if exclude: * code_points = "".join( # <<<<<<<<<<<<<< * chr(value) * for value in range(self._greater_than + 1) */ - __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_code_points); @@ -3416,7 +3432,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_util.pyx":28 + /* "w3lib/_util.pyx":30 * greater_than = ord(greater_than) * self._greater_than = greater_than * if exclude: # <<<<<<<<<<<<<< @@ -3425,16 +3441,16 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS */ } - /* "w3lib/_util.pyx":34 + /* "w3lib/_util.pyx":36 * if chr(value) not in code_points * ) * self._code_points = code_points # <<<<<<<<<<<<<< * - * def __contains__(self, code_point: str) -> bool: + * def __contains__(self, code_point: cython.Py_UCS4) -> bool: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2, __pyx_cur_scope->__pyx_v_code_points) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2, __pyx_cur_scope->__pyx_v_code_points) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - /* "w3lib/_util.pyx":18 + /* "w3lib/_util.pyx":20 * """ * * def __init__( # <<<<<<<<<<<<<< @@ -3459,10 +3475,10 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet___init__(CYTHON_UNUS return __pyx_r; } -/* "w3lib/_util.pyx":36 +/* "w3lib/_util.pyx":38 * self._code_points = code_points * - * def __contains__(self, code_point: str) -> bool: # <<<<<<<<<<<<<< + * def __contains__(self, code_point: cython.Py_UCS4) -> bool: # <<<<<<<<<<<<<< * return code_point in self._code_points or ord(code_point) > self._greater_than * */ @@ -3484,7 +3500,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_code_point = 0; + Py_UCS4 __pyx_v_code_point; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -3523,7 +3539,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -3531,14 +3547,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, 1); __PYX_ERR(0, 36, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, 1); __PYX_ERR(0, 38, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__contains__") < 0)) __PYX_ERR(0, 36, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__contains__") < 0)) __PYX_ERR(0, 38, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -3547,11 +3563,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; - __pyx_v_code_point = ((PyObject*)values[1]); + __pyx_v_code_point = __Pyx_PyObject_AsPy_UCS4(values[1]); if (unlikely((__pyx_v_code_point == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 36, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 38, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3565,14 +3581,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code_point), (&PyUnicode_Type), 0, "code_point", 1))) __PYX_ERR(0, 36, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(__pyx_self, __pyx_v_self, __pyx_v_code_point); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -3583,60 +3594,61 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code_point) { +static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, Py_UCS4 __pyx_v_code_point) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - long __pyx_t_4; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__contains__", 1); - /* "w3lib/_util.pyx":37 + /* "w3lib/_util.pyx":39 * - * def __contains__(self, code_point: str) -> bool: + * def __contains__(self, code_point: cython.Py_UCS4) -> bool: * return code_point in self._code_points or ord(code_point) > self._greater_than # <<<<<<<<<<<<<< * * def __add__(self, code_points: str) -> "_PercentEncodeSet": */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_code_point, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_3) { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_4) { } else { - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_Ord(__pyx_v_code_point); if (unlikely(__pyx_t_4 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 37, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_long(__Pyx_long_cast(__pyx_v_code_point)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 37, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_t_6); - __pyx_t_1 = __pyx_t_6; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "w3lib/_util.pyx":36 + /* "w3lib/_util.pyx":38 * self._code_points = code_points * - * def __contains__(self, code_point: str) -> bool: # <<<<<<<<<<<<<< + * def __contains__(self, code_point: cython.Py_UCS4) -> bool: # <<<<<<<<<<<<<< * return code_point in self._code_points or ord(code_point) > self._greater_than * */ @@ -3645,8 +3657,8 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(CYTHON __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("w3lib._util._PercentEncodeSet.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -3655,7 +3667,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_2__contains__(CYTHON return __pyx_r; } -/* "w3lib/_util.pyx":39 +/* "w3lib/_util.pyx":41 * return code_point in self._code_points or ord(code_point) > self._greater_than * * def __add__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< @@ -3719,7 +3731,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -3727,14 +3739,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, 1); __PYX_ERR(0, 39, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, 1); __PYX_ERR(0, 41, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__add__") < 0)) __PYX_ERR(0, 39, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__add__") < 0)) __PYX_ERR(0, 41, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -3747,7 +3759,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 39, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 41, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3761,7 +3773,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code_points), (&PyUnicode_Type), 0, "code_points", 1))) __PYX_ERR(0, 39, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code_points), (&PyUnicode_Type), 0, "code_points", 1))) __PYX_ERR(0, 41, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(__pyx_self, __pyx_v_self, __pyx_v_code_points); /* function exit code */ @@ -3791,7 +3803,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(CYTHON_UNUS int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__add__", 1); - /* "w3lib/_util.pyx":40 + /* "w3lib/_util.pyx":42 * * def __add__(self, code_points: str) -> "_PercentEncodeSet": * return _PercentEncodeSet( # <<<<<<<<<<<<<< @@ -3799,57 +3811,57 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(CYTHON_UNUS * greater_than=self._greater_than, */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_util.pyx":41 + /* "w3lib/_util.pyx":43 * def __add__(self, code_points: str) -> "_PercentEncodeSet": * return _PercentEncodeSet( * self._code_points + code_points, # <<<<<<<<<<<<<< * greater_than=self._greater_than, * ) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_code_points); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_code_points); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_util.pyx":40 + /* "w3lib/_util.pyx":42 * * def __add__(self, code_points: str) -> "_PercentEncodeSet": * return _PercentEncodeSet( # <<<<<<<<<<<<<< * self._code_points + code_points, * greater_than=self._greater_than, */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error); __pyx_t_3 = 0; - /* "w3lib/_util.pyx":42 + /* "w3lib/_util.pyx":44 * return _PercentEncodeSet( * self._code_points + code_points, * greater_than=self._greater_than, # <<<<<<<<<<<<<< * ) * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_greater_than, __pyx_t_4) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_greater_than, __pyx_t_4) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_util.pyx":40 + /* "w3lib/_util.pyx":42 * * def __add__(self, code_points: str) -> "_PercentEncodeSet": * return _PercentEncodeSet( # <<<<<<<<<<<<<< * self._code_points + code_points, * greater_than=self._greater_than, */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3858,7 +3870,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(CYTHON_UNUS __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_util.pyx":39 + /* "w3lib/_util.pyx":41 * return code_point in self._code_points or ord(code_point) > self._greater_than * * def __add__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< @@ -3880,7 +3892,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_4__add__(CYTHON_UNUS return __pyx_r; } -/* "w3lib/_util.pyx":45 +/* "w3lib/_util.pyx":47 * ) * * def __sub__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< @@ -3944,7 +3956,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -3952,14 +3964,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__sub__", 1, 2, 2, 1); __PYX_ERR(0, 45, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__sub__", 1, 2, 2, 1); __PYX_ERR(0, 47, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__sub__") < 0)) __PYX_ERR(0, 45, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__sub__") < 0)) __PYX_ERR(0, 47, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -3972,7 +3984,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__sub__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 45, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__sub__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 47, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3986,7 +3998,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code_points), (&PyUnicode_Type), 0, "code_points", 1))) __PYX_ERR(0, 45, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code_points), (&PyUnicode_Type), 0, "code_points", 1))) __PYX_ERR(0, 47, __pyx_L1_error) __pyx_r = __pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(__pyx_self, __pyx_v_self, __pyx_v_code_points); /* function exit code */ @@ -4025,19 +4037,19 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__sub__", 1); - /* "w3lib/_util.pyx":46 + /* "w3lib/_util.pyx":48 * * def __sub__(self, code_points: str) -> "_PercentEncodeSet": * new_code_points = self._code_points # <<<<<<<<<<<<<< * for code_point in code_points: * new_code_points = new_code_points.replace(code_point, "") */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_new_code_points = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_util.pyx":47 + /* "w3lib/_util.pyx":49 * def __sub__(self, code_points: str) -> "_PercentEncodeSet": * new_code_points = self._code_points * for code_point in code_points: # <<<<<<<<<<<<<< @@ -4046,21 +4058,21 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS */ __Pyx_INCREF(__pyx_v_code_points); __pyx_t_2 = __pyx_v_code_points; - __pyx_t_7 = __Pyx_init_unicode_iteration(__pyx_t_2, (&__pyx_t_4), (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_7 = __Pyx_init_unicode_iteration(__pyx_t_2, (&__pyx_t_4), (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 49, __pyx_L1_error) for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_4; __pyx_t_8++) { __pyx_t_3 = __pyx_t_8; __pyx_v_code_point = __Pyx_PyUnicode_READ(__pyx_t_6, __pyx_t_5, __pyx_t_3); - /* "w3lib/_util.pyx":48 + /* "w3lib/_util.pyx":50 * new_code_points = self._code_points * for code_point in code_points: * new_code_points = new_code_points.replace(code_point, "") # <<<<<<<<<<<<<< * return _PercentEncodeSet( * new_code_points, */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_code_points, __pyx_n_s_replace); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_code_points, __pyx_n_s_replace); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_code_point); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_7 = 0; @@ -4081,7 +4093,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -4090,7 +4102,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_util.pyx":49 + /* "w3lib/_util.pyx":51 * for code_point in code_points: * new_code_points = new_code_points.replace(code_point, "") * return _PercentEncodeSet( # <<<<<<<<<<<<<< @@ -4098,44 +4110,44 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS * greater_than=self._greater_than, */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "w3lib/_util.pyx":50 + /* "w3lib/_util.pyx":52 * new_code_points = new_code_points.replace(code_point, "") * return _PercentEncodeSet( * new_code_points, # <<<<<<<<<<<<<< * greater_than=self._greater_than, * ) */ - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_new_code_points); __Pyx_GIVEREF(__pyx_v_new_code_points); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_new_code_points)) __PYX_ERR(0, 49, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_new_code_points)) __PYX_ERR(0, 51, __pyx_L1_error); - /* "w3lib/_util.pyx":51 + /* "w3lib/_util.pyx":53 * return _PercentEncodeSet( * new_code_points, * greater_than=self._greater_than, # <<<<<<<<<<<<<< * ) * */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_greater_than, __pyx_t_11) < 0) __PYX_ERR(0, 51, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_greater_than, __pyx_t_11) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "w3lib/_util.pyx":49 + /* "w3lib/_util.pyx":51 * for code_point in code_points: * new_code_points = new_code_points.replace(code_point, "") * return _PercentEncodeSet( # <<<<<<<<<<<<<< * new_code_points, * greater_than=self._greater_than, */ - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -4144,7 +4156,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS __pyx_t_11 = 0; goto __pyx_L0; - /* "w3lib/_util.pyx":45 + /* "w3lib/_util.pyx":47 * ) * * def __sub__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< @@ -4168,7 +4180,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_6__sub__(CYTHON_UNUS return __pyx_r; } -/* "w3lib/_util.pyx":54 +/* "w3lib/_util.pyx":56 * ) * * def __or__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< @@ -4232,7 +4244,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -4240,14 +4252,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__or__", 1, 2, 2, 1); __PYX_ERR(0, 54, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__or__", 1, 2, 2, 1); __PYX_ERR(0, 56, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__or__") < 0)) __PYX_ERR(0, 54, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__or__") < 0)) __PYX_ERR(0, 56, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -4260,7 +4272,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__or__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 54, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__or__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 56, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4302,19 +4314,19 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSE int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__or__", 1); - /* "w3lib/_util.pyx":55 + /* "w3lib/_util.pyx":57 * * def __or__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": * greater_than = min(self._greater_than, other._greater_than) # <<<<<<<<<<<<<< * code_points = "".join(set(self._code_points) | set(other._code_points)) * return _PercentEncodeSet( */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_1); @@ -4331,34 +4343,34 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSE __pyx_v_greater_than = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_util.pyx":56 + /* "w3lib/_util.pyx":58 * def __or__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": * greater_than = min(self._greater_than, other._greater_than) * code_points = "".join(set(self._code_points) | set(other._code_points)) # <<<<<<<<<<<<<< * return _PercentEncodeSet( * code_points, */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_3 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_2 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Or(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_1 = PyNumber_Or(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_code_points = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_util.pyx":57 + /* "w3lib/_util.pyx":59 * greater_than = min(self._greater_than, other._greater_than) * code_points = "".join(set(self._code_points) | set(other._code_points)) * return _PercentEncodeSet( # <<<<<<<<<<<<<< @@ -4366,41 +4378,41 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSE * greater_than=greater_than, */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_util.pyx":58 + /* "w3lib/_util.pyx":60 * code_points = "".join(set(self._code_points) | set(other._code_points)) * return _PercentEncodeSet( * code_points, # <<<<<<<<<<<<<< * greater_than=greater_than, * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_code_points); __Pyx_GIVEREF(__pyx_v_code_points); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_code_points)) __PYX_ERR(0, 57, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_code_points)) __PYX_ERR(0, 59, __pyx_L1_error); - /* "w3lib/_util.pyx":59 + /* "w3lib/_util.pyx":61 * return _PercentEncodeSet( * code_points, * greater_than=greater_than, # <<<<<<<<<<<<<< * ) * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_greater_than, __pyx_v_greater_than) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_greater_than, __pyx_v_greater_than) < 0) __PYX_ERR(0, 61, __pyx_L1_error) - /* "w3lib/_util.pyx":57 + /* "w3lib/_util.pyx":59 * greater_than = min(self._greater_than, other._greater_than) * code_points = "".join(set(self._code_points) | set(other._code_points)) * return _PercentEncodeSet( # <<<<<<<<<<<<<< * code_points, * greater_than=greater_than, */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4409,7 +4421,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSE __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_util.pyx":54 + /* "w3lib/_util.pyx":56 * ) * * def __or__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< @@ -4433,7 +4445,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_8__or__(CYTHON_UNUSE return __pyx_r; } -/* "w3lib/_util.pyx":62 +/* "w3lib/_util.pyx":64 * ) * * def __and__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< @@ -4497,7 +4509,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -4505,14 +4517,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__and__", 1, 2, 2, 1); __PYX_ERR(0, 62, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__and__", 1, 2, 2, 1); __PYX_ERR(0, 64, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__and__") < 0)) __PYX_ERR(0, 62, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__and__") < 0)) __PYX_ERR(0, 64, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -4525,7 +4537,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__and__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 62, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__and__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 64, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4567,19 +4579,19 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNU int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__and__", 1); - /* "w3lib/_util.pyx":63 + /* "w3lib/_util.pyx":65 * * def __and__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": * greater_than = max(self._greater_than, other._greater_than) # <<<<<<<<<<<<<< * code_points = "".join(set(self._code_points) & set(other._code_points)) * return _PercentEncodeSet( */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_1); @@ -4596,34 +4608,34 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNU __pyx_v_greater_than = __pyx_t_1; __pyx_t_1 = 0; - /* "w3lib/_util.pyx":64 + /* "w3lib/_util.pyx":66 * def __and__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": * greater_than = max(self._greater_than, other._greater_than) * code_points = "".join(set(self._code_points) & set(other._code_points)) # <<<<<<<<<<<<<< * return _PercentEncodeSet( * code_points, */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_3 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_2 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_And(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_1 = PyNumber_And(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_code_points = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_util.pyx":65 + /* "w3lib/_util.pyx":67 * greater_than = max(self._greater_than, other._greater_than) * code_points = "".join(set(self._code_points) & set(other._code_points)) * return _PercentEncodeSet( # <<<<<<<<<<<<<< @@ -4631,41 +4643,41 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNU * greater_than=greater_than, */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PercentEncodeSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "w3lib/_util.pyx":66 + /* "w3lib/_util.pyx":68 * code_points = "".join(set(self._code_points) & set(other._code_points)) * return _PercentEncodeSet( * code_points, # <<<<<<<<<<<<<< * greater_than=greater_than, * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_code_points); __Pyx_GIVEREF(__pyx_v_code_points); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_code_points)) __PYX_ERR(0, 65, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_code_points)) __PYX_ERR(0, 67, __pyx_L1_error); - /* "w3lib/_util.pyx":67 + /* "w3lib/_util.pyx":69 * return _PercentEncodeSet( * code_points, * greater_than=greater_than, # <<<<<<<<<<<<<< * ) * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_greater_than, __pyx_v_greater_than) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_greater_than, __pyx_v_greater_than) < 0) __PYX_ERR(0, 69, __pyx_L1_error) - /* "w3lib/_util.pyx":65 + /* "w3lib/_util.pyx":67 * greater_than = max(self._greater_than, other._greater_than) * code_points = "".join(set(self._code_points) & set(other._code_points)) * return _PercentEncodeSet( # <<<<<<<<<<<<<< * code_points, * greater_than=greater_than, */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4674,7 +4686,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNU __pyx_t_4 = 0; goto __pyx_L0; - /* "w3lib/_util.pyx":62 + /* "w3lib/_util.pyx":64 * ) * * def __and__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< @@ -4698,7 +4710,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_10__and__(CYTHON_UNU return __pyx_r; } -/* "w3lib/_util.pyx":70 +/* "w3lib/_util.pyx":72 * ) * * def __repr__(self) -> str: # <<<<<<<<<<<<<< @@ -4759,12 +4771,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 70, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 72, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -4775,7 +4787,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 70, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 72, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4817,60 +4829,60 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UN int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); - /* "w3lib/_util.pyx":71 + /* "w3lib/_util.pyx":73 * * def __repr__(self) -> str: * cp = "".join(sorted(tuple(self._code_points), key=ord)) # <<<<<<<<<<<<<< * gt = chr(self._greater_than) * return f"_PercentEncodeSet({cp!r}, greater_than={gt!r})" */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetBuiltinName(__pyx_n_s_ord); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetBuiltinName(__pyx_n_s_ord); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_cp = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "w3lib/_util.pyx":72 + /* "w3lib/_util.pyx":74 * def __repr__(self) -> str: * cp = "".join(sorted(tuple(self._code_points), key=ord)) * gt = chr(self._greater_than) # <<<<<<<<<<<<<< * return f"_PercentEncodeSet({cp!r}, greater_than={gt!r})" */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_greater_than_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_gt = __pyx_t_3; __pyx_t_3 = 0; - /* "w3lib/_util.pyx":73 + /* "w3lib/_util.pyx":75 * cp = "".join(sorted(tuple(self._code_points), key=ord)) * gt = chr(self._greater_than) * return f"_PercentEncodeSet({cp!r}, greater_than={gt!r})" # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = 127; @@ -4878,7 +4890,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UN __pyx_t_4 += 18; __Pyx_GIVEREF(__pyx_kp_u_PercentEncodeSet_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_PercentEncodeSet_2); - __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_cp), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_cp), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_5; __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); @@ -4889,7 +4901,7 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UN __pyx_t_4 += 15; __Pyx_GIVEREF(__pyx_kp_u_greater_than_3); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_greater_than_3); - __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_gt), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_gt), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_5; __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); @@ -4900,14 +4912,14 @@ static PyObject *__pyx_pf_5w3lib_5_util_17_PercentEncodeSet_12__repr__(CYTHON_UN __pyx_t_4 += 1; __Pyx_GIVEREF(__pyx_kp_u__3); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__3); - __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "w3lib/_util.pyx":70 + /* "w3lib/_util.pyx":72 * ) * * def __repr__(self) -> str: # <<<<<<<<<<<<<< @@ -5292,6 +5304,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_code_points_2, __pyx_k_code_points_2, sizeof(__pyx_k_code_points_2), 0, 0, 1, 1}, {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1}, {&__pyx_n_s_cp, __pyx_k_cp, sizeof(__pyx_k_cp), 0, 0, 1, 1}, + {&__pyx_kp_s_cython_Py_UCS4, __pyx_k_cython_Py_UCS4, sizeof(__pyx_k_cython_Py_UCS4), 0, 0, 1, 0}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, @@ -5341,9 +5354,9 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 31, __pyx_L1_error) - __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 32, __pyx_L1_error) - __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 73, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -5354,86 +5367,86 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "w3lib/_util.pyx":18 + /* "w3lib/_util.pyx":20 * """ * * def __init__( # <<<<<<<<<<<<<< * self, * code_points: str, */ - __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_code_points, __pyx_n_s_greater_than, __pyx_n_s_exclude, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_code_points, __pyx_n_s_greater_than, __pyx_n_s_exclude, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_init, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_init, 20, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 20, __pyx_L1_error) - /* "w3lib/_util.pyx":36 + /* "w3lib/_util.pyx":38 * self._code_points = code_points * - * def __contains__(self, code_point: str) -> bool: # <<<<<<<<<<<<<< + * def __contains__(self, code_point: cython.Py_UCS4) -> bool: # <<<<<<<<<<<<<< * return code_point in self._code_points or ord(code_point) > self._greater_than * */ - __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_contains, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_contains, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 38, __pyx_L1_error) - /* "w3lib/_util.pyx":39 + /* "w3lib/_util.pyx":41 * return code_point in self._code_points or ord(code_point) > self._greater_than * * def __add__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< * return _PercentEncodeSet( * self._code_points + code_points, */ - __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_code_points); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_code_points); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_add, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_add, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 41, __pyx_L1_error) - /* "w3lib/_util.pyx":45 + /* "w3lib/_util.pyx":47 * ) * * def __sub__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< * new_code_points = self._code_points * for code_point in code_points: */ - __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_code_points, __pyx_n_s_new_code_points, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_code_points, __pyx_n_s_new_code_points, __pyx_n_s_code_point); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_sub, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_sub, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 47, __pyx_L1_error) - /* "w3lib/_util.pyx":54 + /* "w3lib/_util.pyx":56 * ) * * def __or__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< * greater_than = min(self._greater_than, other._greater_than) * code_points = "".join(set(self._code_points) | set(other._code_points)) */ - __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_greater_than, __pyx_n_s_code_points); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_greater_than, __pyx_n_s_code_points); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_or, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_or, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 56, __pyx_L1_error) - /* "w3lib/_util.pyx":62 + /* "w3lib/_util.pyx":64 * ) * * def __and__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< * greater_than = max(self._greater_than, other._greater_than) * code_points = "".join(set(self._code_points) & set(other._code_points)) */ - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_and, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_and, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 64, __pyx_L1_error) - /* "w3lib/_util.pyx":70 + /* "w3lib/_util.pyx":72 * ) * * def __repr__(self) -> str: # <<<<<<<<<<<<<< * cp = "".join(sorted(tuple(self._code_points), key=ord)) * gt = chr(self._greater_than) */ - __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_cp, __pyx_n_s_gt); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_cp, __pyx_n_s_gt); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_repr, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_w3lib__util_pyx, __pyx_n_s_repr, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -5496,15 +5509,15 @@ static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_5_util___pyx_scope_struct____init___spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__)) __PYX_ERR(0, 18, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_5_util___pyx_scope_struct____init___spec, __pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_5_util___pyx_scope_struct____init___spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__)) __PYX_ERR(0, 20, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_5_util___pyx_scope_struct____init___spec, __pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__) < 0) __PYX_ERR(0, 20, __pyx_L1_error) #else __pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__ = &__pyx_type_5w3lib_5_util___pyx_scope_struct____init__; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__) < 0) __PYX_ERR(0, 20, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_5w3lib_5_util___pyx_scope_struct____init__->tp_print = 0; @@ -5515,15 +5528,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 30, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 32, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 32, __pyx_L1_error) #else __pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr = &__pyx_type_5w3lib_5_util___pyx_scope_struct_1_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 32, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_5w3lib_5_util___pyx_scope_struct_1_genexpr->tp_print = 0; @@ -5845,184 +5858,186 @@ if (!__Pyx_RefNanny) { if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - /* "w3lib/_util.pyx":1 + /* "w3lib/_util.pyx":3 + * import cython + * * from typing import Union # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Union); __Pyx_GIVEREF(__pyx_n_s_Union); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Union)) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Union)) __PYX_ERR(0, 3, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "w3lib/_util.pyx":4 + /* "w3lib/_util.pyx":6 * * * class _PercentEncodeSet: # <<<<<<<<<<<<<< * """Set of code points that require percent-encoding. * */ - __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_PercentEncodeSet, __pyx_n_s_PercentEncodeSet, (PyObject *) NULL, __pyx_n_s_w3lib__util, __pyx_kp_s_Set_of_code_points_that_require); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_PercentEncodeSet, __pyx_n_s_PercentEncodeSet, (PyObject *) NULL, __pyx_n_s_w3lib__util, __pyx_kp_s_Set_of_code_points_that_require); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "w3lib/_util.pyx":18 + /* "w3lib/_util.pyx":20 * """ * * def __init__( # <<<<<<<<<<<<<< * self, * code_points: str, */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_greater_than, ((PyObject*)__pyx_kp_u_)) < 0) __PYX_ERR(0, 18, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_exclude, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 18, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 18, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_greater_than, ((PyObject*)__pyx_kp_u_)) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_exclude, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 18, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_greater_than, __pyx_kp_s_Union_int_str) < 0) __PYX_ERR(0, 18, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_exclude, __pyx_n_s_bool) < 0) __PYX_ERR(0, 18, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_1__init__, 0, __pyx_n_s_PercentEncodeSet___init, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 18, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_greater_than, __pyx_kp_s_Union_int_str) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_exclude, __pyx_n_s_bool) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_1__init__, 0, __pyx_n_s_PercentEncodeSet___init, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_5, __pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_util.pyx":36 + /* "w3lib/_util.pyx":38 * self._code_points = code_points * - * def __contains__(self, code_point: str) -> bool: # <<<<<<<<<<<<<< + * def __contains__(self, code_point: cython.Py_UCS4) -> bool: # <<<<<<<<<<<<<< * return code_point in self._code_points or ord(code_point) > self._greater_than * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_code_point, __pyx_n_s_str) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_3__contains__, 0, __pyx_n_s_PercentEncodeSet___contains, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_code_point, __pyx_kp_s_cython_Py_UCS4) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_3__contains__, 0, __pyx_n_s_PercentEncodeSet___contains, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_contains, __pyx_t_4) < 0) __PYX_ERR(0, 36, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_contains, __pyx_t_4) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_util.pyx":39 + /* "w3lib/_util.pyx":41 * return code_point in self._code_points or ord(code_point) > self._greater_than * * def __add__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< * return _PercentEncodeSet( * self._code_points + code_points, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 39, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 39, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_5__add__, 0, __pyx_n_s_PercentEncodeSet___add, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_5__add__, 0, __pyx_n_s_PercentEncodeSet___add, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_add, __pyx_t_5) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_add, __pyx_t_5) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_util.pyx":45 + /* "w3lib/_util.pyx":47 * ) * * def __sub__(self, code_points: str) -> "_PercentEncodeSet": # <<<<<<<<<<<<<< * new_code_points = self._code_points * for code_point in code_points: */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_7__sub__, 0, __pyx_n_s_PercentEncodeSet___sub, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_code_points, __pyx_n_s_str) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_7__sub__, 0, __pyx_n_s_PercentEncodeSet___sub, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_sub, __pyx_t_4) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_sub, __pyx_t_4) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_util.pyx":54 + /* "w3lib/_util.pyx":56 * ) * * def __or__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< * greater_than = min(self._greater_than, other._greater_than) * code_points = "".join(set(self._code_points) | set(other._code_points)) */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_other, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_9__or__, 0, __pyx_n_s_PercentEncodeSet___or, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_other, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_9__or__, 0, __pyx_n_s_PercentEncodeSet___or, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_or, __pyx_t_5) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_or, __pyx_t_5) < 0) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_util.pyx":62 + /* "w3lib/_util.pyx":64 * ) * * def __and__(self, other: "_PercentEncodeSet") -> "_PercentEncodeSet": # <<<<<<<<<<<<<< * greater_than = max(self._greater_than, other._greater_than) * code_points = "".join(set(self._code_points) & set(other._code_points)) */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_other, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_11__and__, 0, __pyx_n_s_PercentEncodeSet___and, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_other, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_PercentEncodeSet_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_11__and__, 0, __pyx_n_s_PercentEncodeSet___and, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_and, __pyx_t_4) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_and, __pyx_t_4) < 0) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "w3lib/_util.pyx":70 + /* "w3lib/_util.pyx":72 * ) * * def __repr__(self) -> str: # <<<<<<<<<<<<<< * cp = "".join(sorted(tuple(self._code_points), key=ord)) * gt = chr(self._greater_than) */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 70, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_13__repr__, 0, __pyx_n_s_PercentEncodeSet___repr, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5w3lib_5_util_17_PercentEncodeSet_13__repr__, 0, __pyx_n_s_PercentEncodeSet___repr, NULL, __pyx_n_s_w3lib__util, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_repr, __pyx_t_5) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_repr, __pyx_t_5) < 0) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "w3lib/_util.pyx":4 + /* "w3lib/_util.pyx":6 * * * class _PercentEncodeSet: # <<<<<<<<<<<<<< * """Set of code points that require percent-encoding. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_PercentEncodeSet, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_PercentEncodeSet, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PercentEncodeSet, __pyx_t_5) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PercentEncodeSet, __pyx_t_5) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "w3lib/_util.pyx":1 - * from typing import Union # <<<<<<<<<<<<<< - * + * import cython # <<<<<<<<<<<<<< * + * from typing import Union */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -9775,6 +9790,27 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } #endif +/* ObjectAsUCS4 */ +static Py_UCS4 __Pyx__PyObject_AsPy_UCS4_raise_error(long ival) { + if (ival < 0) { + if (!PyErr_Occurred()) + PyErr_SetString(PyExc_OverflowError, + "cannot convert negative value to Py_UCS4"); + } else { + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to Py_UCS4"); + } + return (Py_UCS4)-1; +} +static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject* x) { + long ival; + ival = __Pyx_PyInt_As_long(x); + if (unlikely(!__Pyx_is_valid_index(ival, 1114111 + 1))) { + return __Pyx__PyObject_AsPy_UCS4_raise_error(ival); + } + return (Py_UCS4)ival; +} + /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC diff --git a/w3lib/_util.pyx b/w3lib/_util.pyx index c3308ea0..1100b9b1 100644 --- a/w3lib/_util.pyx +++ b/w3lib/_util.pyx @@ -1,3 +1,5 @@ +import cython + from typing import Union @@ -33,7 +35,7 @@ class _PercentEncodeSet: ) self._code_points = code_points - def __contains__(self, code_point: str) -> bool: + def __contains__(self, code_point: cython.Py_UCS4) -> bool: return code_point in self._code_points or ord(code_point) > self._greater_than def __add__(self, code_points: str) -> "_PercentEncodeSet":